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
087f33bb
Commit
087f33bb
authored
Sep 21, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_7.1.0' into fixbug-ZYW
parents
add3832d
afbdf0d6
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
91 additions
and
27 deletions
+91
-27
plus.js
src/component/plus/plus.js
+1
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+21
-11
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+2
-2
order.js
src/pages/order/order.js
+9
-11
orderDetail.wxml
src/pages/orderDetail/orderDetail.wxml
+1
-1
paymentStatus.js
src/subPackage/page/pages/paymentStatus/paymentStatus.js
+11
-0
Http.js
src/utils/Http.js
+1
-0
util.js
src/utils/util.js
+1
-0
watch.js
src/utils/watch.js
+42
-0
wxService.js
src/utils/wxService.js
+2
-1
No files found.
src/component/plus/plus.js
View file @
087f33bb
...
...
@@ -149,7 +149,7 @@ Component({
wx
.
hideLoading
()
wxService
.
router
(
'/subPackage/page/pages/paymentStatus/paymentStatus?status=F'
)
}
},
data
))
},
data
.
wxParams
))
}
})
},
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
087f33bb
...
...
@@ -28,7 +28,6 @@ wxService.page({
plusMemberName
:
''
,
defalutCoupon
:
''
,
addressId
:
''
,
// 收货地址id
showPlus
:
null
},
/**
...
...
@@ -55,12 +54,22 @@ wxService.page({
// 下单 && 计算优惠价
this
.
setData
({
trolleySku2Buy
:
tradeDto
.
trolleySku2Buy
,
showPlus
:
app
.
globalData
.
isPlusVip
?
false
:
true
trolleySku2Buy
:
tradeDto
.
trolleySku2Buy
},
()
=>
{
this
.
initCitys
()
// 地址列表
this
.
getAddressList
()
const
{
trolleySku2Buy
,
checkByPremium
,
addressId
,
addressInfo
}
=
this
.
data
let
params
=
{
checkByPremium
,
trolleySku2Buy
,
addressId
:
addressId
?
addressId
:
addressInfo
.
id
// 微信地址 or 地址id
}
this
.
calPreferentialPrice
(
params
)
// 计算优惠价
// if (!this.data.wxAddress){
// this.getAddressList()
// }
...
...
@@ -326,7 +335,8 @@ wxService.page({
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/sale/trade/buyer/bill`
,
params
).
then
(
res
=>
{
wxService
.
post
(
`/sale/payment/merged/buyer/bill`
,
params
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
...
...
@@ -380,13 +390,13 @@ wxService.page({
addressInfo
:
_defalutAddress
},
()
=>
{
// preview
const
{
trolleySku2Buy
,
checkByPremium
,
addressId
,
addressInfo
}
=
this
.
data
let
params
=
{
checkByPremium
,
trolleySku2Buy
,
addressId
:
addressId
?
addressId
:
addressInfo
.
id
// 微信地址 or 地址id
}
this
.
calPreferentialPrice
(
params
)
// 计算优惠价
//
const { trolleySku2Buy, checkByPremium, addressId, addressInfo } = this.data
//
let params = {
//
checkByPremium,
//
trolleySku2Buy,
//
addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
//
}
//
this.calPreferentialPrice(params) // 计算优惠价
})
}
}
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
087f33bb
...
...
@@ -86,7 +86,7 @@
<!-- 商品合计 -->
<view class="pro-sum">
<view class="vip-info" wx:if="{{
showPlus
}}">
<view class="vip-info" wx:if="{{
!isVip
}}">
<view class="vip-left">
<view class="left-top">
<image class="top-image" src="/assets/imgs/7_1_0/plus-icon.png" />
...
...
@@ -117,7 +117,7 @@
<text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text>
</view>
<text class="plus-member-price">¥{{plusMemberPrice}}</text>
<text class="plus-member-price
total-price
">¥{{plusMemberPrice}}</text>
</view>
</view>
<view class="coupon">
...
...
src/pages/order/order.js
View file @
087f33bb
...
...
@@ -44,7 +44,7 @@ wxService.page({
orderList
:
null
,
totalPages
:
0
,
subImgs
:
[],
trade
:
''
,
// 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
status
:
''
,
// 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
no_data
:
true
,
currentTradeId
:
''
},
...
...
@@ -70,9 +70,7 @@ wxService.page({
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)
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
status
)
})
}
...
...
@@ -96,7 +94,7 @@ wxService.page({
icon
:
'none'
})
setTimeout
(()
=>
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
trade
)
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
status
)
},
200
)
}
else
{
wx
.
showToast
({
...
...
@@ -229,14 +227,14 @@ wxService.page({
currentIndex
:
type
,
pageNo
:
1
,
orderList
:
[],
trade
:
''
,
status
:
''
,
no_data
:
true
},
()
=>
{
if
(
type
==
5
&&
status
==
'RF'
)
{
this
.
getRefundList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
this
.
setData
({
trade
:
status
status
:
status
},
()
=>
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
status
)
})
...
...
@@ -244,13 +242,13 @@ wxService.page({
}
})
},
initOrderList
(
pageNo
,
pageSize
,
trade
)
{
console
.
log
(
'-------------'
,
trade
)
initOrderList
(
pageNo
,
pageSize
,
status
)
{
console
.
log
(
'-------------'
,
status
)
wx
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
const
params
=
{
trade
}
const
params
=
{
status
:
status
}
wxService
.
post
(
`/sale/trade/buyer/history?pageNum=
${
pageNo
}
&pageSize=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
...
...
@@ -354,7 +352,7 @@ wxService.page({
this
.
setData
({
pageNo
:
this
.
data
.
pageNo
+
1
,
},
()
=>
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
trade
)
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
status
)
})
},
...
...
src/pages/orderDetail/orderDetail.wxml
View file @
087f33bb
...
...
@@ -80,7 +80,7 @@
</view>
<view class="order-pro-list">
<text>活动折扣</text>
<text>¥{{detail.
payAm
ount}}</text>
<text>¥{{detail.
disc
ount}}</text>
</view>
<view class="order-pro-list">
<text>优惠券优惠</text>
...
...
src/subPackage/page/pages/paymentStatus/paymentStatus.js
View file @
087f33bb
...
...
@@ -41,6 +41,7 @@ wxService.page({
},()
=>
{
// 当前用户是否关注公众号
this
.
getMemberSubscribe
()
this
.
loginUpdateStroage
()
//登录更新plus缓存
})
// 动态设置title
...
...
@@ -48,6 +49,16 @@ wxService.page({
title
:
status
==
'S'
?
'支付成功'
:
'支付失败'
})
},
loginUpdateStroage
(){
const
code
=
wx
.
getStorageSync
(
'_loginCode'
)
const
wechatInfo
=
wx
.
getStorageSync
(
'_wechatInfo'
)
wxService
.
post
(
`/member/minaLogin`
,
{
code
,
wechatInfo
,
brandId
:
app
.
globalData
.
brandId
,
})
},
toPlus
()
{
wxService
.
post
(
`/merchant/modelPage/mainSetting/page?brandId=
${
app
.
globalData
.
brandId
}
&isMain=3&type=2`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
...
...
src/utils/Http.js
View file @
087f33bb
...
...
@@ -112,6 +112,7 @@ class Http {
post
(
url
,
parmas
,
channel
)
{
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
console
.
log
(
'--------------header-----------------'
,
this
.
getTentacle
())
if
(
baseUserInfo
){
return
this
.
request
({
url
,
...
...
src/utils/util.js
View file @
087f33bb
...
...
@@ -263,6 +263,7 @@ function getUserInfoByBtn(userInfo) {
}).
then
((
res
)
=>
{
logger
.
log
(
' wx _userInfo success res --->'
,
res
)
wx
.
setStorageSync
(
'_userInfo'
,
res
[
0
].
userInfo
)
wx
.
setStorageSync
(
'_wechatInfo'
,
res
[
0
])
wx
.
setStorageSync
(
'reLoginErr'
,
false
)
wx
.
showLoading
({
title
:
'正在加载...'
,
...
...
src/utils/watch.js
0 → 100644
View file @
087f33bb
function
observe
(
obj
,
key
,
watchFun
,
deep
,
page
)
{
let
val
=
obj
[
key
];
if
(
val
!=
null
&&
typeof
val
===
"object"
&&
deep
)
{
Object
.
keys
(
val
).
forEach
((
item
)
=>
{
observe
(
val
,
item
,
watchFun
,
deep
,
page
);
});
}
Object
.
defineProperty
(
obj
,
key
,
{
configurable
:
true
,
enumerable
:
true
,
set
:
function
(
value
)
{
watchFun
.
call
(
page
,
value
,
val
);
val
=
value
;
if
(
deep
)
{
observe
(
obj
,
key
,
watchFun
,
deep
,
page
);
}
},
get
:
function
()
{
return
val
;
}
});
}
export
function
setWatcher
(
page
)
{
let
data
=
page
.
data
;
let
watch
=
page
.
watch
;
if
(
!
watch
)
return
false
Object
.
keys
(
watch
).
forEach
((
item
)
=>
{
let
targetData
=
data
;
let
keys
=
item
.
split
(
"."
);
for
(
let
i
=
0
;
i
<
keys
.
length
-
1
;
i
++
)
{
targetData
=
targetData
[
keys
[
i
]];
}
let
targetKey
=
keys
[
keys
.
length
-
1
];
let
watchFun
=
watch
[
item
].
handler
||
watch
[
item
];
let
deep
=
watch
[
item
].
deep
;
observe
(
targetData
,
targetKey
,
watchFun
,
deep
,
page
);
});
}
src/utils/wxService.js
View file @
087f33bb
...
...
@@ -18,7 +18,7 @@ const config = require('../config/index').envInfo
import
utils
from
'./util'
const
citysData
=
require
(
'./city.js'
)
import
{
Integer
}
from
'./integerDigitalConvertion'
import
*
as
watch
from
"./watch.js"
;
let
openCardLister
=
null
/**
...
...
@@ -505,6 +505,7 @@ class WXService extends Http {
onLoad
:
function
(...
args
)
{
const
page
=
this
_self
.
initAppGlobalDataSync
()
watch
.
setWatcher
(
page
);
//修改参数
let
pageIsFromShare
=
false
,
id
=
null
;
args
.
forEach
(
item
=>
{
...
...
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