Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-h5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-h5
Commits
f4d45d02
提交
f4d45d02
authored
11月 17, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查漏补缺
上级
58c63e7e
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
409 行增加
和
93 行删除
+409
-93
pages.json
src/pages.json
+6
-0
index.vue
src/pages/cart/index.vue
+2
-2
goodsSku.vue
src/pages/goods/goodsSku.vue
+3
-1
index.vue
src/pages/goods/index.vue
+1
-0
login.vue
src/pages/login/login.vue
+5
-2
checkout.vue
src/pages/order/checkout.vue
+16
-10
downPdf.vue
src/pages/order/downPdf.vue
+2
-11
editQuotation.vue
src/pages/order/editQuotation.vue
+27
-22
orderList.vue
src/pages/order/orderList.vue
+30
-24
quotation.vue
src/pages/order/quotation.vue
+8
-4
productLineDetails.vue
src/pages/productLine/productLineDetails.vue
+302
-0
request.ts
src/utils/request.ts
+7
-17
没有找到文件。
src/pages.json
浏览文件 @
f4d45d02
...
...
@@ -155,6 +155,12 @@
"navigationBarTitleText"
:
"重新报价"
,
"navigationBarBackgroundColor"
:
"#fff"
}
},
{
"path"
:
"pages/productLine/productLineDetails"
,
"style"
:
{
"navigationBarTitleText"
:
"产品线详情"
,
"navigationBarBackgroundColor"
:
"#fff"
}
}
],
"tabBar"
:
{
...
...
src/pages/cart/index.vue
浏览文件 @
f4d45d02
...
...
@@ -103,7 +103,7 @@
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
}
from
'vue'
;
import
{
getCartIndex
,
cartChecked
,
cartDelete
,
cartUpdate
}
from
'@/api/cart'
;
import
{
onShow
,
onLoad
}
from
'@dcloudio/uni-app'
;
import
{
onShow
}
from
'@dcloudio/uni-app'
;
import
_
from
'lodash'
;
import
config
from
'@/utils/config'
;
...
...
@@ -206,7 +206,7 @@ const tapOptions = () => {
key
:
prop
,
data
:
el
,
success
(
res
:
any
)
{
if
(
prop
==
'c
art
Id'
&&
el
==
0
)
{
if
(
prop
==
'c
oupon
Id'
&&
el
==
0
)
{
if
(
type
.
value
===
0
)
uni
.
navigateTo
({
url
:
`../order/checkout?type=`
+
'cart'
});
else
uni
.
navigateTo
({
url
:
`../order/checkout?type=`
+
'productLineCart'
});
...
...
src/pages/goods/goodsSku.vue
浏览文件 @
f4d45d02
...
...
@@ -138,7 +138,9 @@ let custom = (selectShop: any) => {
goodsInfo
.
value
.
spec_list
.
map
((
item
:
any
,
i
:
number
)
=>
{
if
(
item
.
custom
)
{
selectShop
.
sku_name_arr
[
i
]
=
item
.
custom
customArr
.
push
(
item
.
custom
)
let
obj
:
any
=
{}
obj
[
item
.
name
]
=
item
.
custom
customArr
.
push
(
obj
)
flag
=
true
}
})
...
...
src/pages/goods/index.vue
浏览文件 @
f4d45d02
...
...
@@ -167,6 +167,7 @@ onLoad((options: any) => {
let
selectedGoodsItem
=
ref
()
let
selectedGoodsSum
=
ref
()
// 选择规格展示
let
selectedGoods
=
computed
(()
=>
{
if
(
selectedGoodsItem
.
value
.
length
>
0
)
{
let
str
=
''
...
...
src/pages/login/login.vue
浏览文件 @
f4d45d02
...
...
@@ -64,7 +64,9 @@ let clickNextStep = () => {
let
initLogin
=
async
(
mobile
:
number
,
password
:
string
)
=>
{
uni
.
clearStorage
();
let
res
:
any
=
await
login
({
mobile
,
password
});
if
(
res
.
data
.
code
==
200
)
{
console
.
log
(
res
,
'res'
);
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
'2000'
);
uni
.
setStorage
({
key
:
'token'
,
data
:
res
.
data
.
data
.
token
,
...
...
@@ -94,13 +96,14 @@ let initLogin = async (mobile: number, password: string) => {
},
});
}
else
{
console
.
log
(
'5000'
);
uni
.
showToast
({
title
:
'手机号或密码错误'
,
icon
:
'none'
,
duration
:
2000
,
});
}
}
;
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/order/checkout.vue
浏览文件 @
f4d45d02
...
...
@@ -81,10 +81,11 @@ let baseUrl = config.baseUrl;
const
buyNowId
=
ref
(
uni
.
getStorageSync
(
'buyNowId'
)
||
0
);
const
buyNowData
=
ref
();
const
remarks
=
ref
();
// 订单备注
const
type
=
ref
(
''
);
// 何种方式下单
const
type
=
ref
(
''
as
any
);
// 何种方式下单
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
console
.
log
(
type
.
value
,
'.type'
);
});
// 设置地址
...
...
@@ -97,7 +98,8 @@ const tapAddresss = () => {
// 结算
const
onsubmit
=
()
=>
{
let
types
=
0
;
if
(
type
.
value
===
'productline'
)
types
=
2
;
console
.
log
(
type
.
value
,
'type.value'
);
if
(
type
.
value
===
'productline'
||
type
.
value
===
'productLineCart'
)
types
=
2
;
else
types
=
0
;
let
data
:
object
=
{
addressId
:
uni
.
getStorageSync
(
'addressId'
),
...
...
@@ -109,16 +111,22 @@ const onsubmit = () => {
// 提交订单
orderSubmit
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
res
.
data
.
data
.
orderId
}
&type=
${
type
.
value
}
`
,
});
if
(
type
.
value
==
'productline'
||
type
.
value
==
'productLineCart'
)
{
uni
.
navigateTo
({
url
:
`../productLine/productLineDetails?orderId=
${
res
.
data
.
data
.
orderId
}
&type=
${
type
.
value
}
`
,
});
}
else
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
res
.
data
.
data
.
orderId
}
&type=
${
type
.
value
}
`
,
});
}
// orderDetail({
// orderId: res.data.data.orderId,
// }).then((res1: any) => {
// console.log(res1, '订单详情信息');
// });
}
});
...
...
@@ -158,12 +166,10 @@ onShow(() => {
case
'cart'
:
buyNowId
.
value
=
0
;
initCheckoutCart
(
buyNowId
.
value
,
0
);
type
.
value
=
''
;
break
;
case
'productLineCart'
:
buyNowId
.
value
=
0
;
initCheckoutCart
(
buyNowId
.
value
,
2
);
type
.
value
=
''
;
break
;
case
'goods'
:
buyNowId
.
value
=
uni
.
getStorageSync
(
'buyNowId'
);
...
...
src/pages/order/downPdf.vue
浏览文件 @
f4d45d02
...
...
@@ -91,6 +91,7 @@
</view>
</view>
</view>
<view
style=
"height: 100rpx;"
></view>
<view
class=
"footer"
>
<text>
商品总价:¥
{{
totlePirce
}}
</text>
<text>
含税商品总价:¥
{{
taxTotlePirce
}}
</text>
...
...
@@ -104,7 +105,6 @@ import config from '@/utils/config';
import
{
useStore
,
useCurrentStore
}
from
'@/store/useStore'
;
// import { getOrderPdf } from '@/api/cart';
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
let
baseUrl
=
config
.
baseUrl
;
let
store
=
useStore
();
...
...
@@ -124,7 +124,6 @@ onLoad((options: any) => {
enclosure
.
value
=
res
.
data
.
data
.
orderInfo
.
enclosure
;
detailData
.
value
=
res
.
data
.
data
.
orderGoods
;
orderId
.
value
=
res
.
data
.
data
.
orderInfo
.
id
;
initProductLineIndex
();
}
console
.
log
(
res
,
'订单详情信息'
);
});
...
...
@@ -225,15 +224,6 @@ let initTax = () => {
});
};
let
initProductLineIndex
=
()
=>
{
console
.
log
(
type
.
value
,
'产品线type'
);
detailData
.
value
.
map
((
item
:
any
)
=>
{
getProductLineIndex
({
lineId
:
item
.
goodsId
}).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'产品线'
);
});
});
};
onBackPress
(()
=>
{
if
(
type
.
value
===
'productline'
)
{
store
.
$reset
();
...
...
@@ -300,6 +290,7 @@ onBackPress(() => {
.footer
{
position
:
fixed
;
bottom
:
0
;
z-index
:
99
;
width
:
100%
;
height
:
100rpx
;
background-color
:
#fff
;
...
...
src/pages/order/editQuotation.vue
浏览文件 @
f4d45d02
...
...
@@ -99,28 +99,7 @@ onLoad((options: any) => {
tax
.
value
=
Number
(
res
.
data
.
data
.
mall_tax_rate
)
*
0.01
;
}
});
quotationInitAgain
({
orderId
:
orderId
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
quotationData
.
value
=
res
.
data
.
data
;
let
data
=
quotationData
.
value
.
quotation
;
quotationList
.
value
=
[
{
title
:
'发货人'
,
value
:
data
.
attend
},
{
title
:
'发货联系电话'
,
value
:
data
.
tel
},
{
title
:
'发货email'
,
value
:
data
.
email
},
{
title
:
'发货地址'
,
value
:
data
.
addr
},
{
title
:
'收货公司名称'
,
value
:
data
.
toCust
},
{
title
:
'收货人'
,
value
:
data
.
quotationAttend
},
{
title
:
'收货email'
,
value
:
data
.
quotationEmail
},
{
title
:
'收货联系电话'
,
value
:
data
.
quotationTel
},
{
title
:
'交货日期'
,
value
:
data
.
deliveryDate
},
{
title
:
'收货地址'
,
value
:
data
.
deliveryAddr
},
{
title
:
'订单号'
,
value
:
data
.
noOrder
},
{
title
:
'付款方式'
,
value
:
data
.
pay
},
{
title
:
'保修'
,
value
:
data
.
guarantee
},
{
title
:
'备注'
,
value
:
data
.
remarks
},
];
}
});
init
()
});
// 总价格
...
...
@@ -155,6 +134,7 @@ let modelConfirm = () => {
if
(
content
.
value
===
'确认重新报价?'
)
{
fillQuotation
(
quotationData
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
init
()
showModel
.
value
=
false
;
}
});
...
...
@@ -205,6 +185,31 @@ let priceInput = (val: any, index: number) => {
quotationData
.
value
.
items
[
index
].
totalPrice
*
tax
.
value
+
quotationData
.
value
.
items
[
index
].
totalPrice
;
};
let
init
=
()
=>
{
quotationInitAgain
({
orderId
:
orderId
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
quotationData
.
value
=
res
.
data
.
data
;
let
data
=
quotationData
.
value
.
quotation
;
quotationList
.
value
=
[
{
title
:
'发货人'
,
value
:
data
.
attend
},
{
title
:
'发货联系电话'
,
value
:
data
.
tel
},
{
title
:
'发货email'
,
value
:
data
.
email
},
{
title
:
'发货地址'
,
value
:
data
.
addr
},
{
title
:
'收货公司名称'
,
value
:
data
.
toCust
},
{
title
:
'收货人'
,
value
:
data
.
quotationAttend
},
{
title
:
'收货email'
,
value
:
data
.
quotationEmail
},
{
title
:
'收货联系电话'
,
value
:
data
.
quotationTel
},
{
title
:
'交货日期'
,
value
:
data
.
deliveryDate
},
{
title
:
'收货地址'
,
value
:
data
.
deliveryAddr
},
{
title
:
'订单号'
,
value
:
data
.
noOrder
},
{
title
:
'付款方式'
,
value
:
data
.
pay
},
{
title
:
'保修'
,
value
:
data
.
guarantee
},
{
title
:
'备注'
,
value
:
data
.
remarks
},
];
}
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/order/orderList.vue
浏览文件 @
f4d45d02
...
...
@@ -97,7 +97,7 @@
<view
v-if=
"res.orderStatusText === '待推送'"
class=
"evaluate btn"
@
tap=
"orderQuotation(res.id)"
@
tap=
"orderQuotation(res.id
, res.type
)"
>
生成报价
</view>
...
...
@@ -190,18 +190,6 @@ onLoad((options?: any) => {
getOrderList
()
})
// 跳转到订单详情
let
toDownPdf
=
(
orderId
:
number
)
=>
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
orderId
}
&type=profile`
,
success
()
{
currentStore
.
$patch
({
current
:
current
.
value
})
}
});
}
// 价格小数
let
priceDecimal
=
computed
(()
=>
{
return
(
val
:
any
)
=>
{
...
...
@@ -270,19 +258,37 @@ let orderDel = (orderId: number) => {
orderIds
.
value
=
orderId
}
// 生成报价
let
orderQuotation
=
(
orderId
:
number
)
=>
{
// 生成报价
type为0是普通订单, 2是生产线订单
let
orderQuotation
=
(
orderId
:
number
,
type
:
number
)
=>
{
orderIds
.
value
=
orderId
quotationExist
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
data
)
{
uni
.
navigateTo
({
url
:
'../order/editQuotation?orderId='
+
orderId
})
}
else
toDownPdf
(
orderId
)
}
if
(
type
==
0
)
{
quotationExist
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
data
)
{
uni
.
navigateTo
({
url
:
'../order/editQuotation?orderId='
+
orderId
})
}
else
toDownPdf
(
orderId
)
}
})
}
else
{
uni
.
navigateTo
({
url
:
'../productLine/productLineDetails?orderId='
+
orderId
})
}
}
})
// 跳转到订单详情
let
toDownPdf
=
(
orderId
:
number
)
=>
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
orderId
}
&type=profile`
,
success
()
{
currentStore
.
$patch
({
current
:
current
.
value
})
}
});
}
// 推送订单
...
...
src/pages/order/quotation.vue
浏览文件 @
f4d45d02
...
...
@@ -183,15 +183,19 @@ onReady(() => {
let
submit
=
()
=>
{
uFormRef
.
value
?.
validate
((
valid
:
any
,
err
:
any
)
=>
{
if
(
valid
)
{
quotationData
.
value
.
items
.
forEach
((
item
:
any
,
i
:
number
)
=>
{
if
(
item
.
goodsName
==
unitPrice
.
value
[
i
].
goodsName
)
{
item
.
price
=
unitPrice
.
value
[
i
].
unitPrice
}
quotationData
.
value
.
items
.
forEach
((
item
:
any
)
=>
{
console
.
log
(
item
,
unitPrice
.
value
);
unitPrice
.
value
.
map
((
res
:
any
)
=>
{
if
(
item
.
goodsName
==
res
.
goodsName
)
{
item
.
price
=
res
.
unitPrice
}
})
})
let
data
=
{
items
:
quotationData
.
value
.
items
,
quotation
:
formData
.
value
,
};
console
.
log
(
data
,
'submit'
);
fillQuotation
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
showModel
.
value
=
true
});
...
...
src/pages/productLine/productLineDetails.vue
0 → 100644
浏览文件 @
f4d45d02
<
template
>
<view
class=
"container"
>
<block
v-for=
"(item, index) in detailData"
>
<view>
<view
class=
"details"
>
<u-image
width=
"140rpx"
height=
"200rpx"
:src=
"
item.picUrl.split('http').length > 1
? item.picUrl
: baseUrl + item.picUrl
"
class=
"img"
></u-image>
<view
class=
"right"
>
<view
class=
"name"
>
{{
item
.
goodsName
}}
</view>
<view
class=
"tag"
>
<block
v-for=
"(item1, index1) in item.specifications?.length"
:key=
"index1"
>
<u-tag
:text=
"item.specifications[index1]"
type=
"info"
size=
"mini"
style=
"margin: 8rpx 8rpx 8rpx 0;"
/>
</block>
</view>
<view
class=
"sum-price"
>
<view
style=
"display: flex; flex-direction: column;"
>
<view
style=
"display: flex; flex-direction: row; align-items: center; margin-bottom: 10rpx;"
>
<text>
设置单价:
</text>
<u-input
v-model=
"item.unitPrice"
type=
"number"
height=
"50"
placeholder=
"请输入单价"
style=
"width: 200rpx;"
/>
</view>
<view
style=
"margin-bottom: 10rpx;"
>
金额:¥
{{
item
.
unitPrice
?
(
Number
(
item
.
unitPrice
)
*
item
.
number
).
toFixed
(
2
)
:
0
}}
</view>
<view
style=
"margin-bottom: 10rpx;"
>
含税金额:¥
{{
item
.
unitPrice
?
(
Number
(
item
.
unitPrice
)
*
item
.
number
+
Number
(
item
.
unitPrice
)
*
item
.
number
*
tax
*
0.01
).
toFixed
(
2
)
:
0
}}
</view>
</view>
<text
style=
"color: #969799; font-size: 12px;"
>
x
{{
item
.
number
}}
</text>
</view>
</view>
</view>
<u-line
v-if=
"detailData.length > 1"
color=
"#e8e8e8"
/>
</view>
</block>
<view
class=
"content-footer"
>
<u-button
shape=
"circle"
type=
"error"
size=
"mini"
style=
"margin-right: 30;"
@
tap=
"toIndex"
>
返回首页
</u-button>
<view
class=
""
>
<u-button
shape=
"circle"
size=
"mini"
@
tap=
"generateQuote"
>
生成报价
</u-button>
<u-button
shape=
"circle"
size=
"mini"
style=
"margin-left: 20rpx;"
@
tap=
"download"
>
下载pdf
</u-button>
</view>
</view>
</view>
<view
style=
"height: 100rpx;"
></view>
<view
class=
"footer"
>
<text>
商品总价:¥
{{
totlePirce
}}
</text>
<text>
含税商品总价:¥
{{
taxTotlePirce
}}
</text>
</view>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
getTax
,
orderDetail
}
from
'@/api/index'
;
import
{
quotationInit
}
from
'@/api/cart'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
let
baseUrl
=
config
.
baseUrl
;
let
enclosure
=
ref
(
''
);
// pdf key值
let
detailData
=
ref
([]
as
any
);
let
type
=
ref
();
let
orderId
=
ref
();
let
tax
=
ref
(
0
);
// 税率
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
orderId
.
value
=
options
.
orderId
initOrderData
(
options
.
orderId
);
// initQuotationInit(options.orderId);
// initPdf(options.orderId); // 查询pdf详细资料
initTax
();
// 查询税率
});
// 返回首页
let
toIndex
=
()
=>
{
uni
.
reLaunch
({
url
:
'../index/index'
,
});
};
// 生成报价
let
generateQuote
=
()
=>
{
let
data
=
[]
as
any
;
let
flag
=
true
;
detailData
.
value
.
map
((
item
:
any
)
=>
{
if
(
typeof
item
.
unitPrice
===
'undefined'
)
{
flag
=
false
;
return
uni
.
showToast
({
title
:
`请填写
${
item
.
goodsName
}
单价`
,
icon
:
'none'
,
});
}
else
data
.
push
({
goodsName
:
item
.
goodsName
,
unitPrice
:
item
.
unitPrice
,
});
});
if
(
flag
)
uni
.
navigateTo
({
url
:
`../order/quotation?orderId=
${
orderId
.
value
}
&data=
${
JSON
.
stringify
(
data
)}
`
,
});
};
// 总价格
let
totlePirce
:
any
=
computed
(()
=>
{
let
totlePic
=
0
;
if
(
detailData
.
value
)
{
detailData
.
value
.
map
((
item
:
any
)
=>
{
if
(
typeof
item
.
unitPrice
!==
'undefined'
)
{
totlePic
+=
Number
(
item
.
unitPrice
);
}
});
}
return
totlePic
.
toFixed
(
2
);
});
// 含税总价格
let
taxTotlePirce
=
computed
(()
=>
{
let
taxTotlePic
=
Number
(
totlePirce
.
value
)
+
Number
(
totlePirce
.
value
)
*
tax
.
value
*
0.01
;
return
Number
(
taxTotlePic
).
toFixed
(
2
);
});
// 下载pdf
let
download
=
()
=>
{
uni
.
showLoading
({
title
:
'正在请求数据'
,
});
uni
.
request
({
url
:
baseUrl
+
'/wx/storage/download/'
+
enclosure
.
value
,
responseType
:
'arraybuffer'
,
success
:
(
res
:
any
)
=>
{
uni
.
hideLoading
();
if
(
res
.
data
)
{
let
blob
=
new
Blob
([
res
.
data
]);
let
downloadElement
=
document
.
createElement
(
'a'
);
let
href
=
window
.
URL
.
createObjectURL
(
blob
);
//创建下载的链接
downloadElement
.
href
=
href
;
downloadElement
.
download
=
enclosure
.
value
+
'.pdf'
;
//下载后文件名
document
.
body
.
appendChild
(
downloadElement
);
downloadElement
.
click
();
//点击下载
document
.
body
.
removeChild
(
downloadElement
);
//下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
);
//释放掉blob对象
}
},
fail
(
err
:
any
)
{
console
.
log
(
err
);
},
});
};
// 获取下载pdf信息
// let initPdf = (orderId: number) => {
// getOrderPdf({ orderId }).then((res: any) => {
// if (res.data.code === 200) {
// console.log(res, 'pdf');
// }
// });
// };
// 获取税率
let
initTax
=
()
=>
{
getTax
().
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
tax
.
value
=
Number
(
res
.
data
.
data
.
mall_tax_rate
);
});
};
let
initQuotationInit
=
(
orderId
:
number
)
=>
{
quotationInit
({
orderId
}).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'产品线'
);
});
};
// 获取goodsId
let
initOrderData
=
(
orderId
:
number
)
=>
{
orderDetail
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
res
.
data
.
data
.
orderGoods
.
map
((
item
:
any
)
=>
{
initProductLineIndex
(
item
.
goodsId
);
});
}
});
};
// 通过goodsId查询产品线数据
let
initProductLineIndex
=
(
lineId
:
number
)
=>
{
getProductLineIndex
({
lineId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
detailData
.
value
=
[...
res
.
data
.
data
.
cartList
,
...
detailData
.
value
];
console
.
log
(
res
,
'lineId'
);
}
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
box-sizing
:
border-box
;
margin
:
16rpx
32rpx
;
background-color
:
#fff
;
.details
{
width
:
100%
;
padding
:
16rpx
32rpx
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
flex-start
;
align-items
:
center
;
.img
{
margin-right
:
20rpx
;
}
.tag
{
margin-top
:
1%
;
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
margin-bottom
:
5%
;
}
.right
{
width
:
80%
;
.sum-price
{
display
:
flex
;
justify-content
:
space-between
;
}
}
}
.content-footer
{
margin-top
:
50rpx
;
padding
:
50rpx
;
width
:
100%
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
}
.footer
{
position
:
fixed
;
bottom
:
0
;
z-index
:
99
;
width
:
100%
;
height
:
100rpx
;
background-color
:
#fff
;
padding
:
0
32rpx
;
line-height
:
100rpx
;
font-size
:
30rpx
;
font-weight
:
600
;
display
:
flex
;
justify-content
:
space-between
;
}
</
style
>
src/utils/request.ts
浏览文件 @
f4d45d02
...
...
@@ -7,8 +7,8 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
header
:
any
;
uni
.
showLoading
({
title
:
'加载中...'
})
title
:
'加载中...'
,
})
;
if
(
uni
.
getStorageSync
(
'token'
)
!==
undefined
&&
uni
.
getStorageSync
(
'token'
)
!==
''
)
{
header
=
{
'content-type'
:
'application/json'
,
...
...
@@ -38,22 +38,12 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
uni
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
resolve
(
res
);
}
else
if
(
res
.
data
.
code
==
501
)
{
nextTick
(()
=>
{
uni
.
reLaunch
({
url
:
'/pages/login/login'
,
success
()
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
});
},
fail
(
err
)
{
console
.
log
(
err
);
},
});
}
else
if
(
res
.
data
.
code
==
500
)
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
});
}
else
if
(
res
.
error
==
=
'invalid_token'
)
{
}
else
if
(
res
.
error
==
'invalid_token'
)
{
console
.
log
(
'token'
,
res
);
uni
.
clearStorage
();
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论