Commit 21f44b3e by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 0e604500 b36cf03f
......@@ -46,7 +46,7 @@ App({
let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间
let currentTime = (new Date()).getTime(); // 现在时间
this.globalData.isPlusVip = currentTime >= currentEndTime ? true : false
console.log('this.globalData.isPlusVip',this.globalData.isPlusVip)
if (options.referrerInfo && options.referrerInfo.extraData!=null){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
let urlData = wx_activate_after_submit_url.split("?");
......
......@@ -12,8 +12,7 @@ Component({
},
couponList: {
type: Array,
value: [],
observer: '_couponList'
value: []
}
},
/**
......@@ -21,27 +20,43 @@ Component({
*/
data: {
checkedColor: 'rgb(203, 60, 60)',
isSelect:false
isSelect: false,
newConponOrderList: []
},
observers: {
couponList: function (rate) {
this.changeList()
},
},
/**
* 组件的方法列表
*/
methods: {
_couponList(newV, oldV) {
console.log('newV, oldV', newV)
if (newV !== oldV) {
newV.map(item => {
item.couponSettingDTO.notice = JSON.parse(item.couponSettingDTO.notice)
for (let i in item.couponSettingDTO.notice) {
if (item.couponSettingDTO.notice[i].type == 1) {
item.couponSettingDTO.notice[i].value = item.couponSettingDTO.startTime.substring(0, 10) + ' 至 ' + item.couponSettingDTO.endTime.substring(0, 10)
changeList() {
const { couponList } = this.data
if (couponList.length) {
couponList.map(coupon => {
coupon.couponDTOS.forEach(item => {
item.checked = false
item.title = coupon.couponSettingDTO.title
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({
couponList: newV
wxService.nextTick(() => {
this.setData({
newConponOrderList: couponList
})
})
}
},
......@@ -52,37 +67,28 @@ Component({
},
selectCoupon(e) {
// 1 抵用券 2 折扣券
const { id,index,type } = e.currentTarget.dataset
const { couponList } = this.data
const { id, index, type, amount } = e.currentTarget.dataset
const { newConponOrderList } = this.data
couponList.forEach(item=>{
item.checked = false
newConponOrderList.forEach(item => {
item.couponDTOS.forEach(coupon => coupon.checked = coupon.id == id ? true : false )
})
couponList[index].checked = true
let params = {
type,
id,
faceAmount: ''
}
if(type == 1){
params.faceAmount = couponList[index].couponSettingDTO.faceAmount
} else if(type == 2){
params.faceAmount = couponList[index].couponSettingDTO.faceAmount
faceAmount: amount
}
wxService.nextTick(() => {
this.triggerEvent('updateCoupon', params)
})
// wxService.nextTick(() => {
// this.triggerEvent('updateCoupon', couponList[index].couponDiscount)
// })
this.setData({
couponList
},()=>{
this.hidePopup()})
newConponOrderList
}, () => {
this.hidePopup()
})
},
hidePopup: function () { // 隐藏弹出框
this.setData({
......
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="modal-content{{show ? ' active' : ''}}">
<!--{{couponList}}-->
<view class="modal-header">
<image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix" />
<text class="modal-title">选择优惠券</text>
......@@ -12,9 +11,17 @@
/>
</view>
<view class="modal-info" wx:if="{{couponList.length}}">
<block wx:for="{{couponList}}" 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">
<view class="modal-info" wx:if="{{newConponOrderList.length}}">
<block wx:for="{{newConponOrderList}}" wx:key="{{index}}" wx:for-item="item">
<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
wx:if="{{false}}"
class="coupon-bg"
......@@ -24,35 +31,23 @@
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" />
<view class="coupon-info">
<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 class="right-info">
<view class="coupon-title">{{item.couponSettingDTO.title}}</view>
<view wx:for="{{item.couponSettingDTO.notice}}" wx:key="{{index}}">
<text class='coupon-time'>{{item.label}}</text>
<text class='coupon-desc wpl'>{{item.value}}</text>
<view class="coupon-title">{{coupon.title}}</view>
<view wx:for="{{coupon.newNotice}}" wx:key="{{index}}" wx:for-item="notice">
<text class='coupon-time'>{{notice.label}}</text>
<text class='coupon-desc wpl'>{{notice.value}}</text>
</view>
</view>
<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 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>
</block>
</block>
</view>
<view wx:else class="empty-coupon">
......
......@@ -66,13 +66,14 @@ Component({
let cur = ev.current
let curItemType = ev.item
const userInfo = wx.getStorageSync('_baseUserInfo')
const {currentTab} = this.data
// 切换 active
if (this.data.currentTab == cur) {
if (currentTab == cur) {
return false
} else {
this.setData({
currentTab: cur,
currentTab: cur
})
}
// link row
......
......@@ -76,7 +76,7 @@ wxService.page({
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
const { faceAmount, type, id } = e.detail
const { orderPrice } = this.data
console.log('id', id)
if (type == 1) {
this.setData({
couponId: id,
......@@ -86,10 +86,11 @@ wxService.page({
} else if (type == 2) {
let discounPrice = (faceAmount / 100) * (orderPrice)
let spread = Math.round(orderPrice - discounPrice)
this.setData({
couponId: id,
haveCoupon: true,
currentCoupon: `${spread} `
currentCoupon: `${spread} `
})
}
// 实付款
......@@ -98,7 +99,7 @@ wxService.page({
setPayPrice() {
const { currentCoupon, orderPrice } = this.data
let orderCoupon = parseFloat(currentCoupon)
console.log('orderPrice - orderCoupon', orderPrice - orderCoupon)
this.setData({
orderPrice: Math.round(orderPrice - orderCoupon)
})
......@@ -287,11 +288,13 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
delete data.appId
console.log('dddd', data.amount)
let amount = data.amount || 0
wx.requestPayment(Object.assign({
success(res) {
wx.hideLoading()
// 支付成功页面
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus')
wxService.router(`/subPackage/page/pages/paymentStatus/paymentStatus?amount=${amount}`)
},
fail(res) {
wx.hideLoading()
......
......@@ -151,9 +151,6 @@
<text class="cost-label">实付款:</text>
<text class="cost-price">¥{{utils.numberFormat(orderPrice)}}</text>
</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">
<button form-type="submit" style="display: inline;" class="theme-color buy-btn">立即购买</button>
</view>
......
......@@ -21,13 +21,13 @@
<announcement notice="{{pItem.notice}}"/>
</view>
<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 class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<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>
</block>
</view>
......
......@@ -11,7 +11,7 @@ wxService.page({
* 页面的初始数据
*/
data: {
amount: 0
},
/**
......@@ -32,9 +32,17 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
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 @@
bindload=""
/>
<view class="status-success">支付成功</view>
<view class="status-price">¥ 306.90</view>
<view class="status-time">交易时间: 2019-03-24 至 2019-06-23</view>
<view class="status-price">¥ {{amount}}</view>
<!-- <view class="status-time">交易时间: 2019-03-24 至 2019-06-23</view> -->
<view class="status-btn weui-flex">
<view class="btn-detail">查看详情</view>
<view class="btn-go-on">继续逛逛</view>
<view class="btn-detail" bindtap="goOrder">查看详情</view>
<view class="btn-go-on" bindtap="goClassificationPage">继续逛逛</view>
</view>
</view>
<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