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
21f44b3e
Commit
21f44b3e
authored
Sep 16, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_7.1.0' into fixbug-ZYW
parents
0e604500
b36cf03f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
73 deletions
+83
-73
app.js
src/app.js
+1
-1
selectCoupon.js
src/component/selectCoupon/selectCoupon.js
+37
-31
selectCoupon.wxml
src/component/selectCoupon/selectCoupon.wxml
+18
-23
tabSort.js
src/component/tabSort/tabSort.js
+3
-2
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+7
-4
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+0
-3
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+2
-2
paymentStatus.js
src/subPackage/page/pages/paymentStatus/paymentStatus.js
+11
-3
paymentStatus.wxml
src/subPackage/page/pages/paymentStatus/paymentStatus.wxml
+4
-4
No files found.
src/app.js
View file @
21f44b3e
...
@@ -46,7 +46,7 @@ App({
...
@@ -46,7 +46,7 @@ App({
let
currentEndTime
=
(
new
Date
(
registerTime
.
replace
(
/-/g
,
'/'
))).
getTime
();
// 过期时间
let
currentEndTime
=
(
new
Date
(
registerTime
.
replace
(
/-/g
,
'/'
))).
getTime
();
// 过期时间
let
currentTime
=
(
new
Date
()).
getTime
();
// 现在时间
let
currentTime
=
(
new
Date
()).
getTime
();
// 现在时间
this
.
globalData
.
isPlusVip
=
currentTime
>=
currentEndTime
?
true
:
false
this
.
globalData
.
isPlusVip
=
currentTime
>=
currentEndTime
?
true
:
false
console
.
log
(
'this.globalData.isPlusVip'
,
this
.
globalData
.
isPlusVip
)
if
(
options
.
referrerInfo
&&
options
.
referrerInfo
.
extraData
!=
null
){
if
(
options
.
referrerInfo
&&
options
.
referrerInfo
.
extraData
!=
null
){
const
{
activate_ticket
,
card_id
,
code
,
errCode
,
wx_activate_after_submit_url
}
=
options
.
referrerInfo
.
extraData
const
{
activate_ticket
,
card_id
,
code
,
errCode
,
wx_activate_after_submit_url
}
=
options
.
referrerInfo
.
extraData
let
urlData
=
wx_activate_after_submit_url
.
split
(
"?"
);
let
urlData
=
wx_activate_after_submit_url
.
split
(
"?"
);
...
...
src/component/selectCoupon/selectCoupon.js
View file @
21f44b3e
...
@@ -12,8 +12,7 @@ Component({
...
@@ -12,8 +12,7 @@ Component({
},
},
couponList
:
{
couponList
:
{
type
:
Array
,
type
:
Array
,
value
:
[],
value
:
[]
observer
:
'_couponList'
}
}
},
},
/**
/**
...
@@ -21,27 +20,43 @@ Component({
...
@@ -21,27 +20,43 @@ Component({
*/
*/
data
:
{
data
:
{
checkedColor
:
'rgb(203, 60, 60)'
,
checkedColor
:
'rgb(203, 60, 60)'
,
isSelect
:
false
isSelect
:
false
,
newConponOrderList
:
[]
},
observers
:
{
couponList
:
function
(
rate
)
{
this
.
changeList
()
},
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
_couponList
(
newV
,
oldV
)
{
changeList
()
{
console
.
log
(
'newV, oldV'
,
newV
)
const
{
couponList
}
=
this
.
data
if
(
newV
!==
oldV
)
{
if
(
couponList
.
length
)
{
newV
.
map
(
item
=>
{
couponList
.
map
(
coupon
=>
{
item
.
couponSettingDTO
.
notice
=
JSON
.
parse
(
item
.
couponSettingDTO
.
notice
)
coupon
.
couponDTOS
.
forEach
(
item
=>
{
for
(
let
i
in
item
.
couponSettingDTO
.
notice
)
{
item
.
checked
=
false
if
(
item
.
couponSettingDTO
.
notice
[
i
].
type
==
1
)
{
item
.
title
=
coupon
.
couponSettingDTO
.
title
item
.
couponSettingDTO
.
notice
[
i
].
value
=
item
.
couponSettingDTO
.
startTime
.
substring
(
0
,
10
)
+
' 至 '
+
item
.
couponSettingDTO
.
endTime
.
substring
(
0
,
10
)
item
.
type
=
coupon
.
couponSettingDTO
.
type
item
.
faceAmount
=
coupon
.
couponSettingDTO
.
faceAmount
item
.
takeCouponBgimg
=
coupon
.
couponSettingDetailDTO
.
style
.
takeCouponBgimg
// notice 格式
item
.
newNotice
=
JSON
.
parse
(
item
.
notice
)
for
(
let
i
in
item
.
newNotice
)
{
if
(
item
.
newNotice
[
i
].
type
==
1
)
{
item
.
newNotice
[
i
].
value
=
item
.
startTime
.
substring
(
0
,
10
)
+
' 至 '
+
item
.
endTime
.
substring
(
0
,
10
)
}
}
}
}
})
})
})
this
.
_updateData
({
wxService
.
nextTick
(()
=>
{
couponList
:
newV
this
.
setData
({
newConponOrderList
:
couponList
})
})
})
}
}
},
},
...
@@ -52,37 +67,28 @@ Component({
...
@@ -52,37 +67,28 @@ Component({
},
},
selectCoupon
(
e
)
{
selectCoupon
(
e
)
{
// 1 抵用券 2 折扣券
// 1 抵用券 2 折扣券
const
{
id
,
index
,
type
}
=
e
.
currentTarget
.
dataset
const
{
id
,
index
,
type
,
amount
}
=
e
.
currentTarget
.
dataset
const
{
coupon
List
}
=
this
.
data
const
{
newConponOrder
List
}
=
this
.
data
couponList
.
forEach
(
item
=>
{
newConponOrderList
.
forEach
(
item
=>
{
item
.
c
hecked
=
false
item
.
c
ouponDTOS
.
forEach
(
coupon
=>
coupon
.
checked
=
coupon
.
id
==
id
?
true
:
false
)
})
})
couponList
[
index
].
checked
=
true
let
params
=
{
let
params
=
{
type
,
type
,
id
,
id
,
faceAmount
:
''
faceAmount
:
amount
}
if
(
type
==
1
){
params
.
faceAmount
=
couponList
[
index
].
couponSettingDTO
.
faceAmount
}
else
if
(
type
==
2
){
params
.
faceAmount
=
couponList
[
index
].
couponSettingDTO
.
faceAmount
}
}
wxService
.
nextTick
(()
=>
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updateCoupon'
,
params
)
this
.
triggerEvent
(
'updateCoupon'
,
params
)
})
})
// wxService.nextTick(() => {
// this.triggerEvent('updateCoupon', couponList[index].couponDiscount)
// })
this
.
setData
({
this
.
setData
({
couponList
newConponOrderList
},()
=>
{
},
()
=>
{
this
.
hidePopup
()})
this
.
hidePopup
()
})
},
},
hidePopup
:
function
()
{
// 隐藏弹出框
hidePopup
:
function
()
{
// 隐藏弹出框
this
.
setData
({
this
.
setData
({
...
...
src/component/selectCoupon/selectCoupon.wxml
View file @
21f44b3e
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="modal-content{{show ? ' active' : ''}}">
<view class="modal-content{{show ? ' active' : ''}}">
<!--{{couponList}}-->
<view class="modal-header">
<view class="modal-header">
<image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix" />
<image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix" />
<text class="modal-title">选择优惠券</text>
<text class="modal-title">选择优惠券</text>
...
@@ -12,9 +11,17 @@
...
@@ -12,9 +11,17 @@
/>
/>
</view>
</view>
<view class="modal-info" wx:if="{{couponList.length}}">
<view class="modal-info" wx:if="{{newConponOrderList.length}}">
<block wx:for="{{couponList}}" wx:key="{{index}}" wx:for-item="item">
<block wx:for="{{newConponOrderList}}" wx:key="{{index}}" wx:for-item="item">
<view class="coupon-list" data-id="{{item.couponSettingDTO.couponSettingId}}" data-index="{{index}}" data-type="{{item.couponSettingDTO.type}}" bindtap="selectCoupon">
<block wx:for="{{item.couponDTOS}}" wx:key="{{index}}" wx:for-item="coupon">
<view
class="coupon-list"
data-id="{{coupon.id}}"
data-index="{{index}}"
data-type="{{coupon.type}}"
data-amount="{{coupon.faceAmount}}"
bindtap="selectCoupon"
>
<image
<image
wx:if="{{false}}"
wx:if="{{false}}"
class="coupon-bg"
class="coupon-bg"
...
@@ -24,35 +31,23 @@
...
@@ -24,35 +31,23 @@
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" />
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" />
<view class="coupon-info">
<view class="coupon-info">
<view class="left-price">
<view class="left-price">
<image class="left-price-coupon-bg" src="{{item.couponSettingDetailDTO.style
.takeCouponBgimg}}" />
<image class="left-price-coupon-bg" src="{{coupon
.takeCouponBgimg}}" />
</view>
</view>
<view class="right-info">
<view class="right-info">
<view class="coupon-title">{{item.couponSettingDTO
.title}}</view>
<view class="coupon-title">{{coupon
.title}}</view>
<view wx:for="{{item.couponSettingDTO.notice}}" wx:key="{{index}}
">
<view wx:for="{{coupon.newNotice}}" wx:key="{{index}}" wx:for-item="notice
">
<text class='coupon-time'>{{item
.label}}</text>
<text class='coupon-time'>{{notice
.label}}</text>
<text class='coupon-desc wpl'>{{item
.value}}</text>
<text class='coupon-desc wpl'>{{notice
.value}}</text>
</view>
</view>
</view>
</view>
<view class="select-radio">
<view class="select-radio">
<icon size="16" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}"></icon
>
<icon size="16" type="{{coupon.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" /
>
</view>
</view>
<!-- <view class="select-radio">
<view class="{{isSelect ? 'theme-color' : ''}} coupon-radio">
<image
wx:if="{{isSelect}}"
class="tick-success"
src="/assets/imgs/7_1_0/tick-success.png"
mode="widthFix"
/>
</view>
</view>-->
</view>
</view>
</view>
</view>
</block>
</block>
</block>
</view>
</view>
<view wx:else class="empty-coupon">
<view wx:else class="empty-coupon">
...
...
src/component/tabSort/tabSort.js
View file @
21f44b3e
...
@@ -66,13 +66,14 @@ Component({
...
@@ -66,13 +66,14 @@ Component({
let
cur
=
ev
.
current
let
cur
=
ev
.
current
let
curItemType
=
ev
.
item
let
curItemType
=
ev
.
item
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
{
currentTab
}
=
this
.
data
// 切换 active
// 切换 active
if
(
this
.
data
.
currentTab
==
cur
)
{
if
(
currentTab
==
cur
)
{
return
false
return
false
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
currentTab
:
cur
,
currentTab
:
cur
})
})
}
}
// link row
// link row
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
21f44b3e
...
@@ -76,7 +76,7 @@ wxService.page({
...
@@ -76,7 +76,7 @@ wxService.page({
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
const
{
faceAmount
,
type
,
id
}
=
e
.
detail
const
{
faceAmount
,
type
,
id
}
=
e
.
detail
const
{
orderPrice
}
=
this
.
data
const
{
orderPrice
}
=
this
.
data
console
.
log
(
'id'
,
id
)
if
(
type
==
1
)
{
if
(
type
==
1
)
{
this
.
setData
({
this
.
setData
({
couponId
:
id
,
couponId
:
id
,
...
@@ -86,10 +86,11 @@ wxService.page({
...
@@ -86,10 +86,11 @@ wxService.page({
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
let
discounPrice
=
(
faceAmount
/
100
)
*
(
orderPrice
)
let
discounPrice
=
(
faceAmount
/
100
)
*
(
orderPrice
)
let
spread
=
Math
.
round
(
orderPrice
-
discounPrice
)
let
spread
=
Math
.
round
(
orderPrice
-
discounPrice
)
this
.
setData
({
this
.
setData
({
couponId
:
id
,
couponId
:
id
,
haveCoupon
:
true
,
haveCoupon
:
true
,
currentCoupon
:
`
${
spread
}
折
`
currentCoupon
:
`
${
spread
}
元
`
})
})
}
}
// 实付款
// 实付款
...
@@ -98,7 +99,7 @@ wxService.page({
...
@@ -98,7 +99,7 @@ wxService.page({
setPayPrice
()
{
setPayPrice
()
{
const
{
currentCoupon
,
orderPrice
}
=
this
.
data
const
{
currentCoupon
,
orderPrice
}
=
this
.
data
let
orderCoupon
=
parseFloat
(
currentCoupon
)
let
orderCoupon
=
parseFloat
(
currentCoupon
)
console
.
log
(
'orderPrice - orderCoupon'
,
orderPrice
-
orderCoupon
)
this
.
setData
({
this
.
setData
({
orderPrice
:
Math
.
round
(
orderPrice
-
orderCoupon
)
orderPrice
:
Math
.
round
(
orderPrice
-
orderCoupon
)
})
})
...
@@ -287,11 +288,13 @@ wxService.page({
...
@@ -287,11 +288,13 @@ wxService.page({
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
delete
data
.
appId
delete
data
.
appId
console
.
log
(
'dddd'
,
data
.
amount
)
let
amount
=
data
.
amount
||
0
wx
.
requestPayment
(
Object
.
assign
({
wx
.
requestPayment
(
Object
.
assign
({
success
(
res
)
{
success
(
res
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
// 支付成功页面
// 支付成功页面
wxService
.
router
(
'/subPackage/page/pages/paymentStatus/paymentStatus'
)
wxService
.
router
(
`/subPackage/page/pages/paymentStatus/paymentStatus?amount=
${
amount
}
`
)
},
},
fail
(
res
)
{
fail
(
res
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
21f44b3e
...
@@ -151,9 +151,6 @@
...
@@ -151,9 +151,6 @@
<text class="cost-label">实付款:</text>
<text class="cost-label">实付款:</text>
<text class="cost-price">¥{{utils.numberFormat(orderPrice)}}</text>
<text class="cost-price">¥{{utils.numberFormat(orderPrice)}}</text>
</view>
</view>
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
<view class="theme-color buy-btn">
<view class="theme-color buy-btn">
<button form-type="submit" style="display: inline;" class="theme-color buy-btn">立即购买</button>
<button form-type="submit" style="display: inline;" class="theme-color buy-btn">立即购买</button>
</view>
</view>
...
...
src/pages/userCenter/userCenter.wxml
View file @
21f44b3e
...
@@ -21,13 +21,13 @@
...
@@ -21,13 +21,13 @@
<announcement notice="{{pItem.notice}}"/>
<announcement notice="{{pItem.notice}}"/>
</view>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" />
<tab-sort category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
/>
</view>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
<attention focus-wx="{{pItem.focusWx}}" />
</view>
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/>
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
/>
</view>
</view>
</block>
</block>
</view>
</view>
...
...
src/subPackage/page/pages/paymentStatus/paymentStatus.js
View file @
21f44b3e
...
@@ -11,7 +11,7 @@ wxService.page({
...
@@ -11,7 +11,7 @@ wxService.page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
amount
:
0
},
},
/**
/**
...
@@ -32,9 +32,17 @@ wxService.page({
...
@@ -32,9 +32,17 @@ wxService.page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
const
{
amount
}
=
this
.
options
this
.
setData
({
amount
})
},
goOrder
()
{
wxService
.
router
(
`/pages/order/order`
)
},
goClassificationPage
()
{
wxService
.
router
(
`/pages/category/category`
)
},
},
/**
/**
* 生命周期函数--监听页面隐藏
* 生命周期函数--监听页面隐藏
*/
*/
...
...
src/subPackage/page/pages/paymentStatus/paymentStatus.wxml
View file @
21f44b3e
...
@@ -10,11 +10,11 @@
...
@@ -10,11 +10,11 @@
bindload=""
bindload=""
/>
/>
<view class="status-success">支付成功</view>
<view class="status-success">支付成功</view>
<view class="status-price">¥
306.90
</view>
<view class="status-price">¥
{{amount}}
</view>
<view class="status-time">交易时间: 2019-03-24 至 2019-06-23</view
>
<!-- <view class="status-time">交易时间: 2019-03-24 至 2019-06-23</view> --
>
<view class="status-btn weui-flex">
<view class="status-btn weui-flex">
<view class="btn-detail">查看详情</view>
<view class="btn-detail"
bindtap="goOrder"
>查看详情</view>
<view class="btn-go-on">继续逛逛</view>
<view class="btn-go-on"
bindtap="goClassificationPage"
>继续逛逛</view>
</view>
</view>
</view>
</view>
<view class="status-look df">
<view class="status-look df">
...
...
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