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
ff28a65a
Commit
ff28a65a
authored
Aug 31, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_7.1.0' into feature-zyw-sc
parents
d6a3421a
c0baa9e0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
61 deletions
+91
-61
cart.js
src/pages/cart/cart.js
+9
-3
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+21
-13
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+3
-3
order.js
src/pages/order/order.js
+48
-34
refund.js
src/pages/refund/refund.js
+8
-6
project.config.json
src/project.config.json
+2
-2
No files found.
src/pages/cart/cart.js
View file @
ff28a65a
...
...
@@ -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 @
ff28a65a
...
...
@@ -24,19 +24,27 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
let
trolleySku2Buy
=
this
.
options
.
trolleySku2Buy
// 下单 && 计算优惠价
if
(
trolleySku2Buy
.
length
)
{
this
.
setData
({
trolleySku2Buy
},
()
=>
{
this
.
calPreferentialPrice
(
trolleySku2Buy
)
// 计算优惠价
})
const
{
couponId
,
trolleySku2Buy
}
=
this
.
options
let
tradeDto
=
{
couponId
:
couponId
,
trolleySku2Buy
:
JSON
.
parse
(
trolleySku2Buy
)
}
console
.
log
(
'tradeDto'
,
tradeDto
)
// 下单 && 计算优惠价
this
.
setData
({
trolleySku2Buy
:
tradeDto
},
()
=>
{
this
.
calPreferentialPrice
(
tradeDto
)
// 计算优惠价
})
this
.
initCitys
()
// 地址列表
this
.
getAddressList
()
...
...
@@ -177,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
)
{
...
...
@@ -242,16 +250,16 @@ 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
}
})
}
this
.
setData
({
addressInfo
:
_defalutAddress
})
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
ff28a65a
...
...
@@ -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/pages/order/order.js
View file @
ff28a65a
...
...
@@ -60,7 +60,24 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
trade
)
console
.
log
(
'currentIndex'
,
this
.
data
.
currentIndex
)
const
{
currentIndex
}
=
this
.
data
if
(
currentIndex
==
5
){
this
.
getRefundList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
this
.
setData
({
pageNo
:
1
,
pageSize
:
5
},()
=>
{
const
params
=
{
trade
:
this
.
data
.
trade
}
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
params
)
// this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
})
}
},
// 确认收货
handelConfirmReceipt
(
e
)
{
...
...
@@ -74,9 +91,7 @@ wxService.page({
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
})
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
trade
)
}
}
})
...
...
@@ -116,37 +131,30 @@ wxService.page({
})
wxService
.
post
(
`/sale/trade/buyer/wxprepay/
${
id
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
// const payJson = JSON.parse(decodeURIComponent(res_.data.data.parameter))
// wx.requestPayment({
// 'timeStamp': payJson.timeStamp,
// 'nonceStr': payJson.nonceStr,
// 'package': payJson.package,
// 'signType': payJson.signType,
// 'paySign': payJson.paySign,
// 'success': _res => {
// wx.hideLoading()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// wx.reportAnalytics('api_pay_success', {
// orderno: orderNo
// })
// this.initByStatus(this.data.status)
// },
// 'fail': _res => {
// wx.hideLoading()
// wx.showToast({
// title: '支付失败',
// icon: 'none',
// mask: true
// })
// }
// })
wx
.
requestPayment
(
Object
.
assign
({
success
(
res
)
{
wx
.
hideLoading
()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// 支付成功页面
wxService
.
router
(
'/subPackage/page/pages/paymentStatus/paymentStatus'
)
},
fail
(
res
)
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'支付失败'
,
icon
:
'none'
,
mask
:
true
})
}
},
data
))
}
}
})
...
...
@@ -192,11 +200,17 @@ wxService.page({
if
(
type
==
5
&&
status
==
'RF'
)
{
this
.
getRefundList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
status
)
this
.
setData
({
trade
:
status
},()
=>
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
status
)
})
}
})
},
initOrderList
(
pageNo
,
pageSize
,
trade
)
{
console
.
log
(
'-------------'
,
trade
)
wx
.
showLoading
({
title
:
'加载中'
,
mask
:
true
...
...
src/pages/refund/refund.js
View file @
ff28a65a
...
...
@@ -50,22 +50,24 @@ wxService.page({
pics
:[]
},
submitRefund
()
{
if
(
this
.
data
.
curType
.
value
==
0
)
{
var
selectGoods
=
this
.
data
.
cartList
.
filter
(
item
=>
item
.
checked
)
if
(
selectGoods
.
length
==
0
)
{
wx
.
showToast
({
title
:
'请选择退款
原因
'
,
title
:
'请选择退款
商品
'
,
icon
:
'none'
})
return
false
}
var
selectGoods
=
this
.
data
.
cartList
.
filter
(
item
=>
item
.
checked
)
if
(
selectGoods
.
length
==
0
)
{
if
(
this
.
data
.
curType
.
value
==
0
)
{
wx
.
showToast
({
title
:
'请选择退款
商品
'
,
title
:
'请选择退款
原因
'
,
icon
:
'none'
})
return
false
}
console
.
log
(
'selectGoods'
,
selectGoods
)
var
refundCreateDto
=
this
.
data
.
refundCreateDto
...
...
src/project.config.json
View file @
ff28a65a
...
...
@@ -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