Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
c0baa9e0
Commit
c0baa9e0
authored
Aug 31, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单
parent
2d4c87bb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
30 deletions
+30
-30
cart.js
src/pages/cart/cart.js
+9
-3
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+16
-22
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+3
-3
project.config.json
src/project.config.json
+2
-2
No files found.
src/pages/cart/cart.js
View file @
c0baa9e0
...
...
@@ -233,11 +233,17 @@ wxService.page({
})
return
false
}
console
.
log
(
'trolleySku2Buy'
,
trolleySku2Buy
)
// 去下单页 && 参数
let
parmas
=
{
trolleySku2Buy
:
JSON
.
stringify
(
trolleySku2Buy
)
// let parmas = {
// trolleySku2Buy: JSON.stringify(trolleySku2Buy)
// }
let
tradeDto
=
{
couponId
:
''
,
trolleySku2Buy
:
JSON
.
stringify
(
trolleySku2Buy
)
}
const
parmas
=
tradeDto
wxService
.
router
(
'/pages/confirmOrder/confirmOrder'
)
.
search
(
parmas
)
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
c0baa9e0
...
...
@@ -30,27 +30,21 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
const
{
couponId
,
trolleySku2Buy
}
=
this
.
options
// {
// "couponId": 0,
// "trolleySku2Buy": [
// {
// "count": 0,
// "skuId": 0
// }
// ]
// }
let
tradeDto
=
{
couponId
:
couponId
,
trolleySku2Buy
:
JSON
.
parse
(
trolleySku2Buy
)
}
let
trolleySku2Buy
=
this
.
options
.
trolleySku2Buy
console
.
log
(
'tradeDto'
,
tradeDto
)
console
.
log
(
'trolleySku2Buy'
,
trolleySku2Buy
)
// 下单 && 计算优惠价
// if (trolleySku2Buy.length) {
// this.setData({ trolleySku2Buy
}, () => {
// this.calPreferentialPrice(trolleySku2Buy
) // 计算优惠价
//
})
// }
this
.
setData
({
trolleySku2Buy
:
tradeDto
},
()
=>
{
this
.
calPreferentialPrice
(
tradeDto
)
// 计算优惠价
})
this
.
initCitys
()
// 地址列表
this
.
getAddressList
()
...
...
@@ -191,11 +185,11 @@ wxService.page({
wxService
.
router
(
'/pages/myAddress/myAddress'
)
},
// 计算优惠价
calPreferentialPrice
(
tr
olleySku2Buy
)
{
calPreferentialPrice
(
tr
adeDto
)
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/sale/trade/buyer/preview`
,
tr
olleySku2Buy
).
then
(
res
=>
{
wxService
.
post
(
`/sale/trade/buyer/preview`
,
tr
adeDto
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
...
...
@@ -256,11 +250,11 @@ wxService.page({
let
hasDefalut
=
wx
.
getStorageSync
(
'_defalutAddress'
)
let
_defalutAddress
=
null
if
(
hasDefalut
)
{
if
(
hasDefalut
)
{
_defalutAddress
=
hasDefalut
}
else
{
data
.
forEach
(
item
=>
{
if
(
item
.
type
==
1
)
{
data
.
forEach
(
item
=>
{
if
(
item
.
type
==
1
)
{
_defalutAddress
=
item
}
})
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
c0baa9e0
...
...
@@ -63,7 +63,7 @@
<view class="gray-line" />
<!-- 商品列表 -->
<view class="pro-wrap">
<block wx:for="{{currentOrderList}}" wx:key="{{item}}">
<block wx:for="{{currentOrderList
.tradePreviewSkus
}}" wx:key="{{item}}">
<view class="pro-list">
<image class="pro-img" src="{{item.productImgUrl}}" />
<view class="pro-info">
...
...
@@ -108,7 +108,7 @@
<view class="order-price">
<view class="pro-total-price">
<text class="price-label">商品合计</text>
<text class="total-price">¥
306
</text>
<text class="total-price">¥
{{currentOrderList.amount}}
</text>
</view>
<view class="plus-price" wx:if="{{isSelect}}">
<view class="plus-info">
...
...
@@ -147,7 +147,7 @@
<view class="pro-footer">
<view class="cost">
<text class="cost-label">实付款:</text>
<text class="cost-price">¥
306
</text>
<text class="cost-price">¥
{{currentOrderList.amount}}
</text>
</view>
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
...
...
src/project.config.json
View file @
c0baa9e0
...
...
@@ -39,7 +39,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
1
6
,
"current"
:
1
7
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -151,7 +151,7 @@
"id"
:
17
,
"name"
:
"确认订单"
,
"pathName"
:
"pages/confirmOrder/confirmOrder"
,
"query"
:
"
trolleySku2Buy=[{
\"
count
\"
:1,
\"
skuId
\"
:2000704
}]"
,
"query"
:
"
couponId=&trolleySku2Buy=[{
\"
count
\"
:1,
\"
skuId
\"
:613473098901098500
}]"
,
"scene"
:
null
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment