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
2a392919
提交
2a392919
authored
11月 01, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成订单详情页面
上级
20578618
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
101 行增加
和
25 行删除
+101
-25
pages.json
src/pages.json
+1
-1
index.vue
src/pages/cart/index.vue
+4
-2
index.vue
src/pages/category/index.vue
+1
-1
checkout.vue
src/pages/order/checkout.vue
+2
-13
downPdf.vue
src/pages/order/downPdf.vue
+89
-3
request.ts
src/utils/request.ts
+4
-5
没有找到文件。
src/pages.json
浏览文件 @
2a392919
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
},
{
},
{
"path"
:
"pages/order/downPdf"
,
"path"
:
"pages/order/downPdf"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单详情
"
,
"navigationBarBackgroundColor"
:
"#fff"
"navigationBarBackgroundColor"
:
"#fff"
}
}
}
}
...
...
src/pages/cart/index.vue
浏览文件 @
2a392919
...
@@ -162,7 +162,6 @@ const checkboxGroupChange = (e: any) => {
...
@@ -162,7 +162,6 @@ const checkboxGroupChange = (e: any) => {
// 单个删除
// 单个删除
const
deleteCart
=
(
index
:
number
)
=>
{
const
deleteCart
=
(
index
:
number
)
=>
{
delProductIds
.
value
.
push
(
cartList
.
value
[
index
].
productId
);
delProductIds
.
value
.
push
(
cartList
.
value
[
index
].
productId
);
console
.
log
(
delProductIds
.
value
);
showModel
.
show
=
true
;
showModel
.
show
=
true
;
};
};
...
@@ -206,15 +205,18 @@ const onConfirm = () => {
...
@@ -206,15 +205,18 @@ const onConfirm = () => {
if
(
delProductIds
.
value
)
{
if
(
delProductIds
.
value
)
{
if
(
delProductIds
.
value
.
length
===
1
)
{
if
(
delProductIds
.
value
.
length
===
1
)
{
cartDelete
({
productIds
:
delProductIds
.
value
}).
then
((
res
:
any
)
=>
{
cartDelete
({
productIds
:
delProductIds
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
delProductIds
.
value
=
[];
delProductIds
.
value
=
[];
cartList
.
value
=
res
.
data
.
data
.
cartList
;
cartList
.
value
=
res
.
data
.
data
.
cartList
;
allGoods
.
value
=
getAllList
();
allGoods
.
value
=
getAllList
();
checkedGoods
.
value
=
getCheckedList
(
cartList
.
value
);
checkedGoods
.
value
=
getCheckedList
(
cartList
.
value
);
totalPrice
.
value
=
res
.
data
.
data
.
cartTotal
.
checkedGoodsAmount
.
toFixed
(
2
);
totalPrice
.
value
=
res
.
data
.
data
.
cartTotal
.
checkedGoodsAmount
.
toFixed
(
2
);
showModel
.
show
=
false
;
showModel
.
show
=
false
;
}
});
});
}
else
{
}
else
{
cartDelete
({
productIds
:
delProductIds
.
value
}).
then
((
res
:
any
)
=>
{
cartDelete
({
productIds
:
delProductIds
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
delProductIds
.
value
=
[];
delProductIds
.
value
=
[];
cartList
.
value
=
res
.
data
.
data
.
cartList
;
cartList
.
value
=
res
.
data
.
data
.
cartList
;
allGoods
.
value
=
getAllList
();
allGoods
.
value
=
getAllList
();
...
@@ -223,6 +225,7 @@ const onConfirm = () => {
...
@@ -223,6 +225,7 @@ const onConfirm = () => {
// 批量删除后,check的name属性没有更新,需要刷新当前页面
// 批量删除后,check的name属性没有更新,需要刷新当前页面
uni
.
reLaunch
({
url
:
'../cart/index'
});
uni
.
reLaunch
({
url
:
'../cart/index'
});
showModel
.
show
=
false
;
showModel
.
show
=
false
;
}
});
});
}
}
}
}
...
@@ -269,7 +272,6 @@ const initCartIndex = () => {
...
@@ -269,7 +272,6 @@ const initCartIndex = () => {
if
(
sort
===
0
)
checkedAll
.
value
=
true
;
if
(
sort
===
0
)
checkedAll
.
value
=
true
;
else
checkedAll
.
value
=
false
;
else
checkedAll
.
value
=
false
;
sort
=
0
;
sort
=
0
;
console
.
log
(
'购物车数据'
,
cartList
.
value
);
});
});
};
};
...
...
src/pages/category/index.vue
浏览文件 @
2a392919
...
@@ -48,7 +48,7 @@ const currentSubCategoryData = ref([] as any); //初始tabber数据
...
@@ -48,7 +48,7 @@ const currentSubCategoryData = ref([] as any); //初始tabber数据
const
listQuery
=
ref
({
const
listQuery
=
ref
({
categoryId
:
0
,
categoryId
:
0
,
page
:
1
,
page
:
1
,
limit
:
10
,
limit
:
10
});
});
let
status
=
ref
(
'loadmore'
);
let
status
=
ref
(
'loadmore'
);
let
total
=
ref
(
0
);
let
total
=
ref
(
0
);
...
...
src/pages/order/checkout.vue
浏览文件 @
2a392919
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</view>
</view>
</view>
</view>
<!-- 商品详情 -->
<!-- 商品详情 -->
<view
v-for=
"(item, index) in buyNowData?.checkedGoodsList"
class=
"details"
>
<view
v-for=
"(item, index) in buyNowData?.checkedGoodsList"
:key=
"item.id"
class=
"details"
>
<u-image
<u-image
width=
"140rpx"
width=
"140rpx"
height=
"200rpx"
height=
"200rpx"
...
@@ -48,14 +48,6 @@
...
@@ -48,14 +48,6 @@
<view
class=
"label"
>
商品金额
</view>
<view
class=
"label"
>
商品金额
</view>
<view
class=
"item-price"
>
¥
{{
buyNowData
?.
goodsTotalPrice
.
toFixed
(
2
)
}}
</view>
<view
class=
"item-price"
>
¥
{{
buyNowData
?.
goodsTotalPrice
.
toFixed
(
2
)
}}
</view>
</view>
</view>
<!--
<view
class=
"item-list"
>
<view
class=
"label"
>
邮费
</view>
<view
class=
"item-price"
>
¥
{{
buyNowData
?.
freightPrice
.
toFixed
(
2
)
}}
</view>
</view>
-->
<!--
<view
class=
"item-list"
>
<view
class=
"label"
>
优惠券
</view>
<view
class=
"item-price"
>
¥12
</view>
</view>
-->
<view
class=
"item-list-end"
>
<view
class=
"item-list-end"
>
<view
class=
"label"
>
订单备注
</view>
<view
class=
"label"
>
订单备注
</view>
<u-input
v-model=
"remarks"
/>
<u-input
v-model=
"remarks"
/>
...
@@ -120,11 +112,8 @@ const onsubmit = () => {
...
@@ -120,11 +112,8 @@ const onsubmit = () => {
}).
then
((
res1
:
any
)
=>
{
}).
then
((
res1
:
any
)
=>
{
console
.
log
(
res1
,
'订单详情信息'
);
console
.
log
(
res1
,
'订单详情信息'
);
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?
enclosure=
${
res1
.
data
.
data
.
orderInfo
.
enclosure
}
`
,
url
:
`/pages/order/downPdf?
data=
${
JSON
.
stringify
(
res1
.
data
.
data
)
}
`
,
});
});
// uni.switchTab({
// url: '../profile/index',
// });
});
});
}
}
});
});
...
...
src/pages/order/downPdf.vue
浏览文件 @
2a392919
<
template
>
<
template
>
<u-button
@
tap=
"download"
style=
"margin: 100px auto;"
>
下载pdf
</u-button>
<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>
<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>
</view>
</view>
<view
class=
"footer"
>
<u-button
shape=
"circle"
type=
"error"
size=
"mini"
@
tap=
"toIndex"
>
返回首页
</u-button>
<u-button
shape=
"circle"
size=
"mini"
@
tap=
"download"
>
下载pdf
</u-button>
</view>
</view>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
onLoad
,
onHide
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onHide
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
config
from
'@/utils/config'
;
const
baseUrl
=
config
.
baseUrl
;
const
baseUrl
=
config
.
baseUrl
;
let
enclosure
=
ref
(
''
);
let
enclosure
=
ref
(
''
);
let
detailData
=
ref
();
onLoad
((
options
:
any
)
=>
{
onLoad
((
options
:
any
)
=>
{
enclosure
.
value
=
options
.
enclosure
;
let
data
=
JSON
.
parse
(
options
.
data
);
enclosure
.
value
=
data
.
orderInfo
.
enclosure
;
detailData
.
value
=
data
.
orderGoods
;
console
.
log
(
enclosure
.
value
,
data
);
});
});
let
toIndex
=
()
=>
{
uni
.
reLaunch
({
url
:
'../index/index'
})
}
// 下载pdf
// 下载pdf
let
download
=
()
=>
{
let
download
=
()
=>
{
uni
.
showLoading
({
uni
.
showLoading
({
...
@@ -49,4 +93,46 @@ let download = () => {
...
@@ -49,4 +93,46 @@ let download = () => {
// });
// });
</
script
>
</
script
>
<
style
></
style
>
<
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
:
13%
;
}
.right
{
width
:
80%
;
.sum-price
{
display
:
flex
;
justify-content
:
space-between
;
}
}
}
.footer
{
margin-top
:
50rpx
;
padding
:
50rpx
25%
;
width
:
100%
;
display
:
flex
;
align-items
:
center
;
}
}
</
style
>
src/utils/request.ts
浏览文件 @
2a392919
...
@@ -6,6 +6,9 @@ const baseUrl = config.baseUrl;
...
@@ -6,6 +6,9 @@ const baseUrl = config.baseUrl;
function
request
(
url
:
string
,
method
:
'GET'
|
'POST'
|
'PUT'
|
'DELETE'
,
data
?:
object
|
any
)
{
function
request
(
url
:
string
,
method
:
'GET'
|
'POST'
|
'PUT'
|
'DELETE'
,
data
?:
object
|
any
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
header
:
any
;
let
header
:
any
;
uni
.
showLoading
({
title
:
'加载中...'
})
if
(
uni
.
getStorageSync
(
'token'
)
!==
undefined
&&
uni
.
getStorageSync
(
'token'
)
!==
''
)
{
if
(
uni
.
getStorageSync
(
'token'
)
!==
undefined
&&
uni
.
getStorageSync
(
'token'
)
!==
''
)
{
header
=
{
header
=
{
'content-type'
:
'application/json'
,
'content-type'
:
'application/json'
,
...
@@ -54,12 +57,8 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
...
@@ -54,12 +57,8 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
console
.
log
(
'token'
,
res
);
console
.
log
(
'token'
,
res
);
uni
.
clearStorage
();
uni
.
clearStorage
();
}
else
{
}
else
{
console
.
log
(
res
,
'非200错误'
);
console
.
log
(
res
.
data
,
'非200错误'
);
//其余异样
//其余异样
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
});
reject
(
res
);
reject
(
res
);
}
}
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论