Commit 087f33bb by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents add3832d afbdf0d6
......@@ -149,7 +149,7 @@ Component({
wx.hideLoading()
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus?status=F')
}
}, data))
}, data.wxParams))
}
})
},
......
......@@ -28,7 +28,6 @@ wxService.page({
plusMemberName: '',
defalutCoupon: '',
addressId: '', // 收货地址id
showPlus: null
},
/**
......@@ -55,12 +54,22 @@ wxService.page({
// 下单 && 计算优惠价
this.setData({
trolleySku2Buy: tradeDto.trolleySku2Buy,
showPlus: app.globalData.isPlusVip ? false : true
trolleySku2Buy: tradeDto.trolleySku2Buy
}, () => {
this.initCitys()
// 地址列表
this.getAddressList()
const { trolleySku2Buy, checkByPremium, addressId, addressInfo } = this.data
let params = {
checkByPremium,
trolleySku2Buy,
addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
}
this.calPreferentialPrice(params) // 计算优惠价
// if (!this.data.wxAddress){
// this.getAddressList()
// }
......@@ -326,7 +335,8 @@ wxService.page({
wx.showLoading({
title: '加载中'
})
wxService.post(`/sale/trade/buyer/bill`, params).then(res => {
wxService.post(`/sale/payment/merged/buyer/bill`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
......@@ -380,13 +390,13 @@ wxService.page({
addressInfo: _defalutAddress
}, () => {
// preview
const { trolleySku2Buy, checkByPremium, addressId, addressInfo } = this.data
let params = {
checkByPremium,
trolleySku2Buy,
addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
}
this.calPreferentialPrice(params) // 计算优惠价
// const { trolleySku2Buy, checkByPremium, addressId, addressInfo } = this.data
// let params = {
// checkByPremium,
// trolleySku2Buy,
// addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
// }
// this.calPreferentialPrice(params) // 计算优惠价
})
}
}
......
......@@ -86,7 +86,7 @@
<!-- 商品合计 -->
<view class="pro-sum">
<view class="vip-info" wx:if="{{showPlus}}">
<view class="vip-info" wx:if="{{!isVip}}">
<view class="vip-left">
<view class="left-top">
<image class="top-image" src="/assets/imgs/7_1_0/plus-icon.png" />
......@@ -117,7 +117,7 @@
<text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text>
</view>
<text class="plus-member-price">¥{{plusMemberPrice}}</text>
<text class="plus-member-price total-price">¥{{plusMemberPrice}}</text>
</view>
</view>
<view class="coupon">
......
......@@ -44,7 +44,7 @@ wxService.page({
orderList: null,
totalPages: 0,
subImgs: [],
trade: '', // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
status: '', // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
no_data: true,
currentTradeId: ''
},
......@@ -70,9 +70,7 @@ wxService.page({
pageNo: 1,
pageSize: 5
}, () => {
const params = { trade: this.data.trade }
this.initOrderList(this.data.pageNo, this.data.pageSize, params)
// this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
})
}
......@@ -96,7 +94,7 @@ wxService.page({
icon: 'none'
})
setTimeout(() => {
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
}, 200)
} else {
wx.showToast({
......@@ -229,14 +227,14 @@ wxService.page({
currentIndex: type,
pageNo: 1,
orderList: [],
trade: '',
status: '',
no_data: true
}, () => {
if (type == 5 && status == 'RF') {
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.setData({
trade: status
status: status
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
})
......@@ -244,13 +242,13 @@ wxService.page({
}
})
},
initOrderList(pageNo, pageSize, trade) {
console.log('-------------', trade)
initOrderList(pageNo, pageSize, status) {
console.log('-------------', status)
wx.showLoading({
title: '加载中',
mask: true
})
const params = { trade }
const params = { status: status }
wxService.post(`/sale/trade/buyer/history?pageNum=${pageNo}&pageSize=${pageSize}`, params).then(res => {
if (res) {
const { result, data } = res.data
......@@ -354,7 +352,7 @@ wxService.page({
this.setData({
pageNo: this.data.pageNo + 1,
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
})
},
......
......@@ -80,7 +80,7 @@
</view>
<view class="order-pro-list">
<text>活动折扣</text>
<text>¥{{detail.payAmount}}</text>
<text>¥{{detail.discount}}</text>
</view>
<view class="order-pro-list">
<text>优惠券优惠</text>
......
......@@ -41,6 +41,7 @@ wxService.page({
},()=> {
// 当前用户是否关注公众号
this.getMemberSubscribe()
this.loginUpdateStroage() //登录更新plus缓存
})
// 动态设置title
......@@ -48,6 +49,16 @@ wxService.page({
title: status == 'S' ? '支付成功' : '支付失败'
})
},
loginUpdateStroage(){
const code = wx.getStorageSync('_loginCode')
const wechatInfo = wx.getStorageSync('_wechatInfo')
wxService.post(`/member/minaLogin`, {
code,
wechatInfo,
brandId: app.globalData.brandId,
})
},
toPlus() {
wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => {
const { result, data } = res.data
......
......@@ -112,6 +112,7 @@ class Http {
post (url, parmas, channel) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('--------------header-----------------', this.getTentacle())
if(baseUserInfo){
return this.request({
url,
......
......@@ -263,6 +263,7 @@ function getUserInfoByBtn(userInfo) {
}).then((res) => {
logger.log(' wx _userInfo success res --->', res)
wx.setStorageSync('_userInfo', res[0].userInfo)
wx.setStorageSync('_wechatInfo', res[0])
wx.setStorageSync('reLoginErr', false)
wx.showLoading({
title: '正在加载...',
......
function observe(obj, key, watchFun, deep, page) {
let val = obj[key];
if (val != null && typeof val === "object" && deep) {
Object.keys(val).forEach((item) => {
observe(val, item, watchFun, deep, page);
});
}
Object.defineProperty(obj, key, {
configurable: true,
enumerable: true,
set: function(value) {
watchFun.call(page, value, val);
val = value;
if (deep) {
observe(obj, key, watchFun, deep, page);
}
},
get: function() {
return val;
}
});
}
export function setWatcher(page) {
let data = page.data;
let watch = page.watch;
if(!watch) return false
Object.keys(watch).forEach((item) => {
let targetData = data;
let keys = item.split(".");
for (let i = 0; i < keys.length - 1; i++) {
targetData = targetData[keys[i]];
}
let targetKey = keys[keys.length - 1];
let watchFun = watch[item].handler || watch[item];
let deep = watch[item].deep;
observe(targetData, targetKey, watchFun, deep, page);
});
}
......@@ -18,7 +18,7 @@ const config = require('../config/index').envInfo
import utils from './util'
const citysData = require('./city.js')
import { Integer } from './integerDigitalConvertion'
import * as watch from "./watch.js";
let openCardLister = null
/**
......@@ -505,6 +505,7 @@ class WXService extends Http {
onLoad: function (...args) {
const page = this
_self.initAppGlobalDataSync()
watch.setWatcher(page);
//修改参数
let pageIsFromShare = false, id = null;
args.forEach(item => {
......
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