diff --git a/app.js b/app.js index 1f9f10d..789f546 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ //app.js App({ //----------------------------------------------globalData-------------------------------------- - release: 0, + release: 1, httpUrl: 'https://api-test.qniao.cn', tmplIds: ['kg0T1ve0FpYrEtZ4ExbypHm8mtS7OJaehvqN_T9ypoI'], globalData: { diff --git a/assets/image/icon_adv.jpg b/assets/image/icon_adv.jpg new file mode 100644 index 0000000..eddbea0 Binary files /dev/null and b/assets/image/icon_adv.jpg differ diff --git a/components/button/index.wxss b/components/button/index.wxss index f53a201..89074a9 100644 --- a/components/button/index.wxss +++ b/components/button/index.wxss @@ -362,7 +362,7 @@ background-color: #dfdfdf!important; color: #fff!important } - +/* .wux-button--tag, .wux-button--tag--disabled { border-color: transparent!important; @@ -392,4 +392,4 @@ .wux-button--tag.wux-button--hover { background-color: #999999!important; color: #fff!important -} \ No newline at end of file +} */ \ No newline at end of file diff --git a/components/tab/index.js b/components/tab/index.js index f59934d..01d16db 100644 --- a/components/tab/index.js +++ b/components/tab/index.js @@ -70,7 +70,6 @@ Component({ if (this.data.scroll) { // 超出滚动的情况 // 保持滚动后当前 item '尽可能' 在屏幕中间 let scrollLeft = itemLeft - (this.data.windowWidth - itemWidth) / 2; - console.log('scrollLeft>>>' + scrollLeft) this.setData({ tabCur: tabCur, scrollLeft: scrollLeft, diff --git a/pages/mall/order-info/index.js b/pages/mall/order-info/index.js index 181bfe7..da8a9df 100644 --- a/pages/mall/order-info/index.js +++ b/pages/mall/order-info/index.js @@ -60,7 +60,7 @@ Page({ console.log('mall>>order>>onEvent', message) if(message.what == 1 && util.isEmpty(this.data.token)){ this.setData({ token: app.globalData.token }) - } else if(message.what == 10 && message.arg == 1){ + } else if(message.what == 10){ wx.navigateBack() } }, @@ -180,6 +180,7 @@ Page({ const element = this.data.orderInfo.skuList[index]; if(this.checkSkuPrice(this.data.matchTag, element)){ this.data.form.unitPrice = Number(element.price) + this.data.form.monthPrice = Number(element.groupMonthPrice) this.data.form.stockNumber = Number(element.stockNumber) // 如果当前的数量大于所选规格的库存数量,那么就设置成库存数量; if(this.data.form.number > this.data.form.stockNumber){ diff --git a/pages/mall/order-info/index.wxml b/pages/mall/order-info/index.wxml index e596ef0..128a822 100644 --- a/pages/mall/order-info/index.wxml +++ b/pages/mall/order-info/index.wxml @@ -5,7 +5,7 @@ - + @@ -24,9 +24,9 @@ 选择{{sukItem.name}} - - - {{item.val}} + + + {{item.val}} @@ -47,7 +47,7 @@ - + 拼团说明 {{orderInfo.groupSummary}} diff --git a/pages/mall/order-offer/index.js b/pages/mall/order-offer/index.js index 3f7efb2..07916cf 100644 --- a/pages/mall/order-offer/index.js +++ b/pages/mall/order-offer/index.js @@ -19,10 +19,11 @@ Page({ onLoad: function (options) { if (options.json) { var form = JSON.parse(options.json) - form.payType = 1 + form.payType = form.sellMode == 1 ? 1 : 3 // form.totalPrice = float.accAdd(float.accMul(form.unitPrice, form.number), form.dividePrice) form.totalPrice = float.accMul(form.unitPrice, form.number).toFixed(2) form.preAmount = float.accMul(float.accMul(form.unitPrice, form.number), 0.1).toFixed(2) + form.monthAmount = float.accMul(form.monthPrice, form.number).toFixed(2) this.setData({ form: form, isIPhoneX: app.globalData.isIPhoneX @@ -41,15 +42,8 @@ Page({ }, checkMode: function (e) { - var preAmount = 0 - if (e.currentTarget.dataset.index == 1) { - preAmount = float.accMul(float.accMul(this.data.form.unitPrice, this.data.form.number), 0.1).toFixed(2) - } else if (e.currentTarget.dataset.index == 2) { - preAmount = float.accMul(this.data.form.unitPrice, this.data.form.number).toFixed(2) - } this.setData({ - ['form.payType']: Number(e.currentTarget.dataset.index), - ['form.preAmount']: preAmount + ['form.payType']: Number(e.currentTarget.dataset.index) }) }, @@ -84,9 +78,19 @@ Page({ data.number = this.data.form.number data.sellMode = Number(this.data.form.sellMode) data.payType = Number(this.data.form.payType) - data.realPrice = data.payType == 1 ? this.data.form.preAmount : 0 - data.unitPrice = this.data.form.unitPrice - data.totalPrice = this.data.form.totalPrice + if (data.payType == 1) { + data.realPrice = this.data.form.preAmount + data.unitPrice = this.data.form.unitPrice + data.totalPrice = this.data.form.totalPrice + } else if (data.payType == 2 || data.payType == 4) { + data.realPrice = this.data.form.totalPrice + data.totalPrice = this.data.form.totalPrice + data.unitPrice = this.data.form.unitPrice + } else if (data.payType == 3) { + data.realPrice = 0 + data.unitPrice = this.data.form.monthPrice + data.totalPrice = this.data.form.monthAmount + } data.mobile = this.data.addressInfo.telNumber data.realName = this.data.addressInfo.userName data.address = this.data.addressInfo.provinceName + this.data.addressInfo.cityName + this.data.addressInfo.countyName + this.data.addressInfo.detailInfo @@ -98,9 +102,7 @@ Page({ request.post('/bxe-mall/order', data).then(result => { //成功回调 wx.hideLoading() - if (data.payType == 1) { - this.requestPayment(result.data.wxpay) - } else { + if (data.payType == 3) { wx.requestSubscribeMessage({ tmplIds: app.tmplIds, complete(res) { @@ -109,26 +111,29 @@ Page({ }) } }) + } else { + this.requestPayment(result.data.wxpay) } }).catch(err => { //异常回调 wx.hideLoading() - if (data.payType == 2) { - wx.redirectTo({ - url: '/pages/mall/order-result/index?type=0&message=' + err - }) - } + util.showToast(err) }) }, // 微信支付流程 requestPayment: function (data) { - data.success = function(res){ + data.success = function (res) { util.showToast('订单支付成功') - wx.redirectTo({ - url: '/pages/mall/order-result/index?type=2' + wx.requestSubscribeMessage({ + tmplIds: app.tmplIds, + complete(res) { + wx.redirectTo({ + url: '/pages/mall/order-result/index?type=2' + }) + } }) } - data.fail = function(res){ + data.fail = function (res) { util.showToast('订单支付失败') } wx.requestPayment(data) diff --git a/pages/mall/order-offer/index.wxml b/pages/mall/order-offer/index.wxml index fd3b8be..e70a767 100644 --- a/pages/mall/order-offer/index.wxml +++ b/pages/mall/order-offer/index.wxml @@ -33,10 +33,8 @@ {{form.name}} - - {{form.outline}} - {{form.summary}} - + {{form.outline}} + {{form.summary}} @@ -51,14 +49,26 @@ 购买数量 {{form.number}} - + + + 预付金额 ¥{{form.preAmount}} + + 应付金额 + ¥{{form.totalPrice}} + + + 月结金额 + ¥{{form.monthAmount}} + + + 现结金额 + ¥{{form.totalPrice}} + @@ -66,17 +76,27 @@ 付款方式 - + 预付定金 预付款10%,余款货到付款 - + 全额支付 + + + 月结付款 + + + + + 现结付款 + + @@ -90,8 +110,10 @@ - 合计: - ¥{{form.totalPrice}} + 合计:¥ + {{form.preAmount}} + {{form.totalPrice}} + {{form.monthAmount}} diff --git a/pages/mall/order-offer/index.wxss b/pages/mall/order-offer/index.wxss index b4e50ed..2dc077e 100644 --- a/pages/mall/order-offer/index.wxss +++ b/pages/mall/order-offer/index.wxss @@ -86,7 +86,7 @@ button::after { .page-outline { margin-top: 8rpx; - font-size: 28rpx; + font-size: 26rpx; font-family: PingFang-SC-Regular, PingFang-SC; font-weight: 400; color: rgba(51, 51, 51, 1); diff --git a/pages/mall/order-result/index.js b/pages/mall/order-result/index.js index 5abab82..c5570ab 100644 --- a/pages/mall/order-result/index.js +++ b/pages/mall/order-result/index.js @@ -32,9 +32,9 @@ Page({ msg = options.message } this.setData({ - ['icon.type']: 'success', - ['icon.color']: '#008AFF', - ['buttons[0].type']: 'positive', + ['icon.type']: 'warn', + ['icon.color']: '#ef473a', + ['buttons[0].type']: 'light', title: '支付失败', label: '订单提交失败', message: msg @@ -45,9 +45,9 @@ Page({ msg = options.message } this.setData({ - ['icon.type']: 'warn', - ['icon.color']: '#ef473a', - ['buttons[0].type']: 'light', + ['icon.type']: 'success', + ['icon.color']: '#008AFF', + ['buttons[0].type']: 'positive', title: '下单成功', label: '订单提交成功', message: msg @@ -58,9 +58,9 @@ Page({ msg = options.message } this.setData({ - ['icon.type']: 'warn', - ['icon.color']: '#ef473a', - ['buttons[0].type']: 'light', + ['icon.type']: 'success', + ['icon.color']: '#008AFF', + ['buttons[0].type']: 'positive', title: '支付成功', label: '订单提交成功', message: msg diff --git a/pages/mall/order-result/index.wxml b/pages/mall/order-result/index.wxml index 63dcf72..54fdfd4 100644 --- a/pages/mall/order-result/index.wxml +++ b/pages/mall/order-result/index.wxml @@ -4,4 +4,4 @@ {{title}} - \ No newline at end of file + \ No newline at end of file diff --git a/pages/mall/shops/index.wxml b/pages/mall/shops/index.wxml index 4536a1a..bbfd255 100644 --- a/pages/mall/shops/index.wxml +++ b/pages/mall/shops/index.wxml @@ -102,7 +102,7 @@ - + 特价 @@ -124,10 +124,10 @@ - + - {{finished?'到底了':'加载中...'}} + {{finished?'到底啦~':'加载中...'}}