Commit 21f44b3e by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 0e604500 b36cf03f
...@@ -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("?");
......
...@@ -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 { couponList } = this.data const { newConponOrderList } = this.data
couponList.forEach(item=>{ newConponOrderList.forEach(item => {
item.checked = false item.couponDTOS.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({
......
<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,46 +11,42 @@ ...@@ -12,46 +11,42 @@
/> />
</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">
<image <view
wx:if="{{false}}" class="coupon-list"
class="coupon-bg" data-id="{{coupon.id}}"
src="/assets/imgs/7_1_0/coupon-bg.png" data-index="{{index}}"
mode="widthFix" data-type="{{coupon.type}}"
/> data-amount="{{coupon.faceAmount}}"
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" /> bindtap="selectCoupon"
<view class="coupon-info"> >
<view class="left-price"> <image
<image class="left-price-coupon-bg" src="{{item.couponSettingDetailDTO.style.takeCouponBgimg}}" /> wx:if="{{false}}"
</view> class="coupon-bg"
<view class="right-info"> src="/assets/imgs/7_1_0/coupon-bg.png"
<view class="coupon-title">{{item.couponSettingDTO.title}}</view> mode="widthFix"
<view wx:for="{{item.couponSettingDTO.notice}}" wx:key="{{index}}"> />
<text class='coupon-time'>{{item.label}}</text> <image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" />
<text class='coupon-desc wpl'>{{item.value}}</text> <view class="coupon-info">
<view class="left-price">
<image class="left-price-coupon-bg" src="{{coupon.takeCouponBgimg}}" />
</view> </view>
</view> <view class="right-info">
<view class="coupon-title">{{coupon.title}}</view>
<view class="select-radio"> <view wx:for="{{coupon.newNotice}}" wx:key="{{index}}" wx:for-item="notice">
<icon size="16" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}"></icon> <text class='coupon-time'>{{notice.label}}</text>
</view> <text class='coupon-desc wpl'>{{notice.value}}</text>
</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 class="select-radio">
<icon size="16" type="{{coupon.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" />
</view>
</view>
</view> </view>
</view> </block>
</block> </block>
</view> </view>
......
...@@ -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
......
...@@ -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()
......
...@@ -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>
......
...@@ -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>
......
...@@ -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`)
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment