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
f99fdf75
提交
f99fdf75
authored
11月 07, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
0c534802
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
137 行增加
和
45 行删除
+137
-45
checkout.vue
src/pages/order/checkout.vue
+13
-11
downPdf.vue
src/pages/order/downPdf.vue
+124
-34
没有找到文件。
src/pages/order/checkout.vue
浏览文件 @
f99fdf75
...
...
@@ -36,7 +36,8 @@
</view>
<view
class=
"sum-price"
>
<text>
¥
{{
item
.
price
.
toFixed
(
2
)
}}
</text>
<!--
<text>
¥
{{
item
.
price
.
toFixed
(
2
)
}}
</text>
-->
<text></text>
<text
style=
"color: #969799; font-size: 12px;"
>
x
{{
item
.
number
}}
</text>
</view>
</view>
...
...
@@ -80,7 +81,7 @@ let baseUrl = config.baseUrl;
const
buyNowId
=
ref
(
uni
.
getStorageSync
(
'buyNowId'
)
||
0
);
const
buyNowData
=
ref
();
const
remarks
=
ref
();
// 订单备注
const
type
=
ref
(
''
);
const
type
=
ref
(
''
);
// 何种方式下单
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
...
...
@@ -108,16 +109,17 @@ const onsubmit = () => {
// 提交订单
orderSubmit
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
orderDetail
({
orderId
:
res
.
data
.
data
.
orderId
,
}).
then
((
res1
:
any
)
=>
{
console
.
log
(
res1
,
'订单详情信息'
);
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?data=
${
JSON
.
stringify
(
res1
.
data
.
data
)}
&type=
${
type
.
value
}
`
,
});
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, '订单详情信息');
// });
}
});
};
...
...
src/pages/order/downPdf.vue
浏览文件 @
f99fdf75
<
template
>
<!--
<u-navbar
back-text=
""
title=
"订单详情"
title-color=
"#000"
></u-navbar>
-->
<view
class=
"container"
>
<view
v-for=
"(item, index) in detailData"
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 0pt;"
/>
</block>
</view>
<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"
>
<text
style=
"color: red;"
>
¥
{{
item
.
price
.
toFixed
(
2
)
}}
</text>
<text
style=
"color: #969799; font-size: 12px;"
>
x
{{
item
.
number
}}
</text>
<view
class=
"sum-price"
>
<!--
<text
style=
"color: red;"
>
¥
{{
item
.
price
.
toFixed
(
2
)
}}
</text>
-->
<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
*
0.13
).
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>
</
view
>
<view
class=
"footer"
>
</
block
>
<view
class=
"
content-
footer"
>
<u-button
shape=
"circle"
type=
"error"
...
...
@@ -45,14 +88,19 @@
</view>
</view>
</view>
<view
class=
"footer"
>
<text>
商品总价:¥
{{
totlePirce
}}
</text>
<text>
含税商品总价:¥
{{
taxTotlePirce
}}
</text>
</view>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
;
import
{
onLoad
,
on
Hide
,
on
BackPress
}
from
'@dcloudio/uni-app'
;
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
useStore
}
from
'@/store/useStore'
;
import
{
getOrderPdf
}
from
'@/api/cart'
;
import
{
orderDetail
}
from
'@/api/index'
;
let
baseUrl
=
config
.
baseUrl
;
let
store
=
useStore
();
...
...
@@ -63,13 +111,24 @@ let orderId = ref();
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
let
data
=
JSON
.
parse
(
options
.
data
);
enclosure
.
value
=
data
.
orderInfo
.
enclosure
;
detailData
.
value
=
data
.
orderGoods
;
orderId
.
value
=
data
.
orderInfo
.
id
;
initPdf
(
data
.
orderInfo
.
id
);
orderDetail
({
orderId
:
options
.
orderId
,
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
enclosure
.
value
=
res
.
data
.
data
.
orderInfo
.
enclosure
;
detailData
.
value
=
res
.
data
.
data
.
orderGoods
;
orderId
.
value
=
res
.
data
.
data
.
orderInfo
.
id
;
}
console
.
log
(
res
,
'订单详情信息'
);
});
// let data = JSON.parse(options.data);
// enclosure.value = data.orderInfo.enclosure;
// detailData.value = data.orderGoods;
// orderId.value = data.orderInfo.id;
initPdf
(
options
.
orderId
);
});
// 返回首页
let
toIndex
=
()
=>
{
uni
.
reLaunch
({
url
:
'../index/index'
,
...
...
@@ -79,10 +138,27 @@ let toIndex = () => {
// 生成报价
let
generateQuote
=
()
=>
{
uni
.
navigateTo
({
url
:
'./quotation?orderId='
+
orderId
.
value
,
url
:
`./quotation?orderId=
${
orderId
.
value
}
&data=
${
detailData
.
value
}
`
,
});
};
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
)
*
0.13
;
return
Number
(
taxTotlePic
).
toFixed
(
2
);
});
// 下载pdf
let
download
=
()
=>
{
uni
.
showLoading
({
...
...
@@ -155,7 +231,7 @@ onBackPress(() => {
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
margin-bottom
:
13
%
;
margin-bottom
:
5
%
;
}
.right
{
...
...
@@ -168,7 +244,7 @@ onBackPress(() => {
}
}
.footer
{
.
content-
footer
{
margin-top
:
50rpx
;
padding
:
50rpx
;
width
:
100%
;
...
...
@@ -177,4 +253,18 @@ onBackPress(() => {
align-items
:
center
;
}
}
.footer
{
position
:
fixed
;
bottom
:
0
;
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
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论