Commit 087f33bb by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

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