Commit 3d135425 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 1d42b485 39c449b1
// pages/confirmOrder/confirmOrder.js // pages/confirmOrder/confirmOrder.js
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
const app = getApp() const app = getApp()
const utils = require('../../utils/util')
wxService.page({ wxService.page({
/** /**
...@@ -15,6 +16,9 @@ wxService.page({ ...@@ -15,6 +16,9 @@ wxService.page({
trolleySku2Buy: Array, trolleySku2Buy: Array,
currentOrderList: Array, currentOrderList: Array,
isSelect: false, isSelect: false,
selectPrice:'',
noSelectPrice:'',
plusSpread:'',
goodsAddress: false, goodsAddress: false,
citys: null, citys: null,
cityView: '', cityView: '',
...@@ -113,10 +117,6 @@ wxService.page({ ...@@ -113,10 +117,6 @@ wxService.page({
let plusPrice = isSelect ? plusMemberPrice : 0 // plus let plusPrice = isSelect ? plusMemberPrice : 0 // plus
let calCouponPrice = defalutCoupon ? defalutCoupon : orderCoupon let calCouponPrice = defalutCoupon ? defalutCoupon : orderCoupon
console.log('优惠价', orderCoupon)
console.log('默认优惠', defalutCoupon)
console.log('参与计算coupon', calCouponPrice)
// 实际价格 - 优惠价 + plus // 实际价格 - 优惠价 + plus
this.setData({ this.setData({
// orderPrice: Math.round(orderInitPrice - orderCoupon) // orderPrice: Math.round(orderInitPrice - orderCoupon)
...@@ -308,6 +308,27 @@ wxService.page({ ...@@ -308,6 +308,27 @@ wxService.page({
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
let skuList = data.tradePreviewSkus
let sum =0
skuList.forEach((item,index) => {
// item.price
sum += skuList[index].price
})
// 初始化商品价格
const { isSelect } = this.data
if(isSelect){
this.setData({
selectPrice: sum
})
} else {
this.setData({
noSelectPrice: sum
})
}
this.setData({ this.setData({
currentOrderList: data, currentOrderList: data,
defalutCoupon: data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0].couponDiscount || '', defalutCoupon: data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0].couponDiscount || '',
......
<!--pages/confirmOrder/confirmOrder.wxml--> <!--pages/confirmOrder/confirmOrder.wxml-->
<wxs src="../..//wxs/utils.wxs" module="utils" /> <wxs src="../../wxs/utils.wxs" module="utils" />
<view class="page-confirm-order"> <view class="page-confirm-order">
<form bindsubmit="formSubmit"> <form bindsubmit="formSubmit">
...@@ -110,12 +110,12 @@ ...@@ -110,12 +110,12 @@
<view class="order-price"> <view class="order-price">
<view class="pro-total-price"> <view class="pro-total-price">
<text class="price-label">商品合计</text> <text class="price-label">商品合计</text>
<text class="total-price">¥{{currentOrderList.amount}}</text> <text class="total-price">¥{{utils.numberFormat(currentOrderList.amount - currentOrderList.freight)}}</text>
</view> </view>
<view class="plus-price" wx:if="{{isSelect}}"> <view class="plus-price" wx:if="{{isSelect}}">
<view class="plus-info"> <view class="plus-info">
<text class="price-label">plus会员价</text> <text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text> <text class="member-price">-¥{{utils.numberFormat(noSelectPrice - selectPrice)}}</text>
</view> </view>
<text class="plus-member-price total-price">¥{{plusMemberPrice}}</text> <text class="plus-member-price total-price">¥{{plusMemberPrice}}</text>
</view> </view>
......
...@@ -187,7 +187,8 @@ wxService.page({ ...@@ -187,7 +187,8 @@ wxService.page({
// 退货寄回 // 退货寄回
handelCheckRfSend(e) { handelCheckRfSend(e) {
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
console.log('handelCheckRfSend', id) console.log('handelCheckRfSend物流弹框', id)
// 物流弹框
}, },
// 取消退款 // 取消退款
handelCancelRefund(e) { handelCancelRefund(e) {
......
...@@ -74,11 +74,17 @@ wxService.page({ ...@@ -74,11 +74,17 @@ wxService.page({
title: `删除成功!`, title: `删除成功!`,
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
} else { } else {
wx.showToast({ wx.showToast({
title: `删除失败!`, title: `删除失败!`,
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
} }
} }
}) })
...@@ -132,11 +138,17 @@ wxService.page({ ...@@ -132,11 +138,17 @@ wxService.page({
title: `取消成功!`, title: `取消成功!`,
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
} else { } else {
wx.showToast({ wx.showToast({
title: `取消失败!`, title: `取消失败!`,
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
} }
} }
}) })
......
<wxs src="../../wxs/utils.wxs" module="utils" />
<view class="page-order-detail"> <view class="page-order-detail">
<view class="header-wrap" style="background-image:url('/assets/imgs/7_1_0/rf_bgc.jpg')"> <view class="header-wrap" style="background-image:url('/assets/imgs/7_1_0/rf_bgc.jpg')">
<view class="refund-status"> <view class="refund-status">
...@@ -80,11 +81,11 @@ ...@@ -80,11 +81,11 @@
</view> </view>
<view class="order-pro-list"> <view class="order-pro-list">
<text>活动折扣</text> <text>活动折扣</text>
<text>¥{{detail.discount}}</text> <text>¥{{utils.numberFormat(detail.promotionDiscount)}}</text>
</view> </view>
<view class="order-pro-list"> <view class="order-pro-list">
<text>优惠券优惠</text> <text>优惠券优惠</text>
<text>¥{{detail.discount}}</text> <text>¥{{utils.numberFormat(detail.coouponDiscount)}}</text>
</view> </view>
<view class="order-pro-list"> <view class="order-pro-list">
<text class="pay-amount">实付金额</text> <text class="pay-amount">实付金额</text>
......
...@@ -33,12 +33,12 @@ wxService.page({ ...@@ -33,12 +33,12 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { amount,status } = this.options const { amount, status } = this.options
console.log('this.options', status) console.log('this.options', status)
this.setData({ this.setData({
amount, amount,
status status
},()=> { }, () => {
// 当前用户是否关注公众号 // 当前用户是否关注公众号
this.getMemberSubscribe() this.getMemberSubscribe()
this.loginUpdateStroage() //登录更新plus缓存 this.loginUpdateStroage() //登录更新plus缓存
...@@ -49,30 +49,31 @@ wxService.page({ ...@@ -49,30 +49,31 @@ wxService.page({
title: status == 'S' ? '支付成功' : '支付失败' title: status == 'S' ? '支付成功' : '支付失败'
}) })
}, },
loginUpdateStroage(){ loginUpdateStroage() {
const code = wx.getStorageSync('_loginCode') const code = wx.getStorageSync('_loginCode')
const wechatInfo = wx.getStorageSync('_wechatInfo') const wechatInfo = wx.getStorageSync('_wechatInfo')
wxService.login().then((res) => {
wxService.post(`/member/minaLogin`, { wxService.post(`/member/minaLogin`, {
code, code:res.code,
wechatInfo, wechatInfo,
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
}) })
})
}, },
toPlus() { toPlus() {
wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => { wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0){ if (result == 0) {
wxService.router(`/subPackage/page/pages/subPage/subPage?pageId=${data.page.pageId}`) wxService.router(`/subPackage/page/pages/subPage/subPage?pageId=${data.page.pageId}`)
} }
}) })
}, },
getMemberSubscribe(){ getMemberSubscribe() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { openid } = baseUserInfo.member const { openid } = baseUserInfo.member
wxService.post(`/member/subscribe?openid=${openid}`).then(res => { wxService.post(`/member/subscribe?openid=${openid}`).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0){ if (result == 0) {
// 0 未关注 1 已关注 // 0 未关注 1 已关注
this.setData({ this.setData({
isSubscribe: data == 0 ? false : true isSubscribe: data == 0 ? false : true
......
...@@ -294,6 +294,10 @@ const formatNumber = n => { ...@@ -294,6 +294,10 @@ const formatNumber = n => {
return n[1] ? n : '0' + n return n[1] ? n : '0' + n
} }
function getSum(preValue,curValue,index, array) {
return preValue + curValue;
}
function _getUserInfo(ev) { function _getUserInfo(ev) {
const userInfo = ev.detail || ev const userInfo = ev.detail || ev
return getUserInfoByBtn(userInfo).then((data = {}) => { return getUserInfoByBtn(userInfo).then((data = {}) => {
...@@ -351,6 +355,7 @@ wxService.setGetAuthUserInfo(_getUserInfo); ...@@ -351,6 +355,7 @@ wxService.setGetAuthUserInfo(_getUserInfo);
module.exports = { module.exports = {
_getUserInfo, _getUserInfo,
formatTime, formatTime,
getSum,
getCurrentPageUrl, getCurrentPageUrl,
getCurrentRouter, getCurrentRouter,
getCurrentPageUrlWithArgs, getCurrentPageUrlWithArgs,
......
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