Commit ad2c1f74 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 11e84c9c 3204be37
...@@ -40,15 +40,6 @@ App({ ...@@ -40,15 +40,6 @@ App({
onShow: function (options = {}) { onShow: function (options = {}) {
console.log('app-onshow', options) console.log('app-onshow', options)
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const premiumExpireTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.premiumExpireTime || ''
// ios 兼容 是不是plus vip
let currentEndTime = (new Date(premiumExpireTime.replace(/-/g, '/'))).getTime(); // 到期时间
let currentTime = (new Date()).getTime();
this.globalData.isPlusVip = currentTime <= currentEndTime ? true : false // 当前时间 < 到期时间为vip
console.log('premiumExpireTime', premiumExpireTime)
console.log('当前时间', new Date())
console.log('当前时间 < 到期时间为vip',this.globalData.isPlusVip)
if (options.referrerInfo && options.referrerInfo.extraData!=null){ if (options.referrerInfo && options.referrerInfo.extraData!=null){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
......
...@@ -37,6 +37,10 @@ Component({ ...@@ -37,6 +37,10 @@ Component({
_token: newVal _token: newVal
}) })
} }
},
isVip: {
type: Boolean,
type: false
} }
}, },
/** /**
...@@ -64,13 +68,14 @@ Component({ ...@@ -64,13 +68,14 @@ Component({
}, },
}, },
attached() { attached() {
const { isPlusVip, imageUrl } = app.globalData console.log("isvip", this.data.isVip)
const { personData } = this.data const { imageUrl } = app.globalData
const { personData, isVip } = this.data
this.setData({ this.setData({
personCenter: personData, personCenter: personData,
baseImgUrl: imageUrl, baseImgUrl: imageUrl,
isPlusVip, isPlusVip: isVip,
currentPlusStyle: isPlusVip ? personData.plus.filter(item => item.purchased == 1)[0] : personData.plus.filter(item => item.purchased == 0)[0] currentPlusStyle: isVip ? personData.plus.filter(item => item.purchased == 1)[0] : personData.plus.filter(item => item.purchased == 0)[0]
}) })
}, },
methods: { methods: {
......
// pages/confirmOrder/confirmOrder.js // pages/confirmOrder/confirmOrder.js
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
const app = getApp()
wxService.page({ wxService.page({
/** /**
...@@ -19,7 +20,6 @@ wxService.page({ ...@@ -19,7 +20,6 @@ wxService.page({
cityView: '', cityView: '',
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
selectCityName: ['', ''], selectCityName: ['', ''],
currentCoupon: '无可用优惠券',
wxAddress: false, wxAddress: false,
currentCoupon: '', currentCoupon: '',
orderPrice: null, // 订单金额 orderPrice: null, // 订单金额
...@@ -27,7 +27,8 @@ wxService.page({ ...@@ -27,7 +27,8 @@ wxService.page({
plusMemberPrice: 0, // plus 默认价 plusMemberPrice: 0, // plus 默认价
plusMemberName:'', plusMemberName:'',
defalutCoupon: '', defalutCoupon: '',
addressId: '' // 收货地址id addressId: '', // 收货地址id
showPlus: null
}, },
/** /**
...@@ -40,6 +41,8 @@ wxService.page({ ...@@ -40,6 +41,8 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log('dddd',app.globalData.isPlusVip)
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo')
let pages = getCurrentPages(); let pages = getCurrentPages();
...@@ -53,7 +56,11 @@ wxService.page({ ...@@ -53,7 +56,11 @@ wxService.page({
// 下单 && 计算优惠价 // 下单 && 计算优惠价
this.setData({ trolleySku2Buy: tradeDto.trolleySku2Buy }, () => { this.setData({
trolleySku2Buy: tradeDto.trolleySku2Buy,
showPlus: app.globalData.isPlusVip ? false : true
}, () => {
console.log('showPlus', this.data.showPlus)
const { trolleySku2Buy, checkByPremium } = this.data const { trolleySku2Buy, checkByPremium } = this.data
let params = { let params = {
checkByPremium, checkByPremium,
...@@ -296,11 +303,11 @@ wxService.page({ ...@@ -296,11 +303,11 @@ wxService.page({
}) })
}, },
handelGobuy() { handelGobuy() {
const { trolleySku2Buy, couponId, addressInfo } = this.data const { trolleySku2Buy, couponId,addressId, addressInfo } = this.data
let params = { let params = {
couponId, couponId,
trolleySku2Buy, trolleySku2Buy,
addressId: addressInfo.id addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
} }
this.getBill(params) // 下单 this.getBill(params) // 下单
...@@ -398,6 +405,9 @@ wxService.page({ ...@@ -398,6 +405,9 @@ wxService.page({
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
this.setData({
addressId:data
})
} }
}).finally(() => { }).finally(() => {
wx.hideLoading() wx.hideLoading()
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<!-- 商品合计 --> <!-- 商品合计 -->
<view class="pro-sum"> <view class="pro-sum">
<view class="vip-info"> <view class="vip-info" wx:if="{{showPlus}}">
<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" />
...@@ -124,8 +124,7 @@ ...@@ -124,8 +124,7 @@
<view> <view>
<text class="price-label">优惠券</text> <text class="price-label">优惠券</text>
<view class="select-coupon" bindtap="selectCoupon"> <view class="select-coupon" bindtap="selectCoupon">
<text class="coupon-price"> {{defalutCoupon?'-': ''}}{{currentCoupon ? currentCoupon : defalutCoupon}}{{defalutCoupon?'元': ''}}</text> <text class="{{defalutCoupon ? 'coupon-price' : 'no-coupon'}}"> {{defalutCoupon?'-': '无可用优惠券'}}{{currentCoupon ? currentCoupon : defalutCoupon}}{{defalutCoupon?'元': ''}}</text>
<!--<text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}"> -{{currentCoupon ? currentCoupon : defalutCoupon}}</text>-->
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" /> <image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view> </view>
</view> </view>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/> <image-swiper image-data="{{pItem.rotationchart.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 2}}"> <view class="" wx:if="{{pItem.type == 2}}">
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/> <person-center isVip="{{isVip}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 3}}"> <view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/> <pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
......
...@@ -498,6 +498,8 @@ class WXService extends Http { ...@@ -498,6 +498,8 @@ class WXService extends Http {
config.data.currentHasUserInfo = false; config.data.currentHasUserInfo = false;
// 当前页面是否需要授权 // 当前页面是否需要授权
config.data.currentPageRequireAuth = false; config.data.currentPageRequireAuth = false;
// vip
config.data.isVip = ''
const CONFIG_PAPGE = { const CONFIG_PAPGE = {
onLoad: function (...args) { onLoad: function (...args) {
...@@ -533,9 +535,21 @@ class WXService extends Http { ...@@ -533,9 +535,21 @@ class WXService extends Http {
_self.currentPage = page _self.currentPage = page
config.onShow && config.onShow.apply(page, args) config.onShow && config.onShow.apply(page, args)
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const premiumExpireTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.premiumExpireTime || ''
wx.setStorageSync('_premiumExpireTime', premiumExpireTime)
const premiumExpireStorage = wx.getStorageSync('_premiumExpireTime')
// ios 兼容 是不是plus vip
let currentEndTime = (new Date(premiumExpireStorage.replace(/-/g, '/'))).getTime(); // 到期时间
let currentTime = (new Date()).getTime();
let vipFlag = currentTime <= currentEndTime ? true : false // 当前时间 < 到期时间为vip
console.log('premiumExpireStorage', premiumExpireStorage)
console.log('当前时间 < 到期时间为vip',vipFlag)
if (baseUserInfo) { if (baseUserInfo) {
page.setData({ page.setData({
currentHasUserInfo: true currentHasUserInfo: true,
isVip: vipFlag
}); });
} else { } else {
page.setData({ page.setData({
......
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