Commit 52bf2509 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 3fb4917a 51be3781
...@@ -40,6 +40,10 @@ App({ ...@@ -40,6 +40,10 @@ 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 { member } = baseUserInfo
const curMemberTrial = member && member.trial || false
wx.setStorageSync('isExperiencer', curMemberTrial)
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
......
...@@ -31,6 +31,7 @@ wxService.page({ ...@@ -31,6 +31,7 @@ wxService.page({
plusMemberPrice: 0, // plus 默认价 plusMemberPrice: 0, // plus 默认价
plusMemberName: '', plusMemberName: '',
defalutCoupon: '', defalutCoupon: '',
defalutCouponId: '',
addressId: '', // 收货地址id addressId: '', // 收货地址id
}, },
...@@ -332,6 +333,7 @@ wxService.page({ ...@@ -332,6 +333,7 @@ wxService.page({
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 || '',
defalutCouponId: data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0] && data.couponDiscountPreviews[0].couponDTOS[0] && data.couponDiscountPreviews[0].couponDTOS[0].id || '',
orderInitPrice: data.amount orderInitPrice: data.amount
}, () => { }, () => {
// 实付款 // 实付款
...@@ -342,13 +344,13 @@ wxService.page({ ...@@ -342,13 +344,13 @@ wxService.page({
}) })
}, },
handelGobuy() { handelGobuy() {
const { trolleySku2Buy, couponId, addressId, addressInfo } = this.data const { trolleySku2Buy, couponId, addressId, addressInfo, defalutCouponId } = this.data
let params = { let params = {
couponId, couponId: couponId? couponId : defalutCouponId,
trolleySku2Buy, trolleySku2Buy,
addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
} }
console.log('wwwwwwwwwwwwwwwparams', params)
this.getBill(params) // 下单 this.getBill(params) // 下单
}, },
// 下单 // 下单
...@@ -358,8 +360,6 @@ console.log('wwwwwwwwwwwwwwwparams', params) ...@@ -358,8 +360,6 @@ console.log('wwwwwwwwwwwwwwwparams', params)
}) })
const { isSelect} = this.data const { isSelect} = this.data
let url = isSelect ? '/sale/payment/merged/buyer/bill' : '/sale/trade/buyer/bill' let url = isSelect ? '/sale/payment/merged/buyer/bill' : '/sale/trade/buyer/bill'
// /trade/buyer/bill
// wxService.post(`/sale/payment/merged/buyer/bill`, params).then(res => {
wxService.post(`${url}`, params).then(res => { wxService.post(`${url}`, params).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
......
...@@ -56,6 +56,54 @@ wxService.page({ ...@@ -56,6 +56,54 @@ wxService.page({
this.generatePointObject(tentacleInfo); this.generatePointObject(tentacleInfo);
} }
}, },
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
isAuthorization: false
}, () => {
const option = this.options || {}
const { scene } = option
if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
id = shareId
} else {
id = option.id
}
if (id) {
this.setData({
id
}, () => {
this.getPointDetail(id)
})
}
// 隐藏 dialog
this.isShowDialog(false)
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
}
else {
this.setData({
isAuthorization: true
})
}
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
}
},
// 集点详情 // 集点详情
getPointDetail(id) { getPointDetail(id) {
wx.showLoading({ wx.showLoading({
...@@ -248,46 +296,46 @@ wxService.page({ ...@@ -248,46 +296,46 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { memberId, member } = wx.getStorageSync('_baseUserInfo') // const { memberId, member } = wx.getStorageSync('_baseUserInfo')
// 登录接口返回err // // 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr') // const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo') // const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id // let id
if (baseUserInfo && !reLoginErrFlag){ // if (baseUserInfo && !reLoginErrFlag){
this.setData({ // this.setData({
isAuthorization: false // isAuthorization: false
},()=>{ // },()=>{
const option = this.options || {} // const option = this.options || {}
const { scene } = option // const { scene } = option
if (scene) { // if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0] // let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0 // let shareId = idParam && idParam.split('=')[1] || 0
id = shareId // id = shareId
} else { // } else {
id = option.id // id = option.id
} // }
if (id) { // if (id) {
this.setData({ // this.setData({
id // id
}, () => { // }, () => {
this.getPointDetail(id) // this.getPointDetail(id)
}) // })
} // }
// 隐藏 dialog // // 隐藏 dialog
this.isShowDialog(false) // this.isShowDialog(false)
}) // })
} // }
else if(!baseUserInfo && reLoginErrFlag){ // else if(!baseUserInfo && reLoginErrFlag){
this.setData({ // this.setData({
isAuthorization: true // isAuthorization: true
}) // })
} // }
else { // else {
this.setData({ // this.setData({
isAuthorization: true // isAuthorization: true
}) // })
} // }
}, },
/** /**
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
"x-dialog":"/component/dialog/dialog", "x-dialog":"/component/dialog/dialog",
"x-progress-point":"/component/progressPoint/progressPoint", "x-progress-point":"/component/progressPoint/progressPoint",
"x-progress-image":"/component/progressImage/progressImage", "x-progress-image":"/component/progressImage/progressImage",
"authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point", "authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point"
"go-home": "/component/goHome/goHome"
} }
} }
\ No newline at end of file
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
bind:_closeDialog="_closeDialog" bind:_closeDialog="_closeDialog"
show="{{dialog.show}}" show="{{dialog.show}}"
/> />
<!--goHome-->
<go-home/>
<authorization-modal-point isAuthorization='{{isAuthorization}}' /> <authorization-modal-point isAuthorization='{{isAuthorization}}' />
...@@ -14,7 +14,16 @@ wxService.page({ ...@@ -14,7 +14,16 @@ wxService.page({
currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除 currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始 currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始
}, },
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
this.getPointList()
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -41,8 +50,8 @@ wxService.page({ ...@@ -41,8 +50,8 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const { memberId, member } = wx.getStorageSync('_baseUserInfo') // const { memberId, member } = wx.getStorageSync('_baseUserInfo')
this.getPointList() // this.getPointList()
}, },
getPointList() { getPointList() {
wx.showLoading({ wx.showLoading({
......
{ {
"navigationBarTitleText": "集点列表", "navigationBarTitleText": "集点列表",
"usingComponents": { "usingComponents": {
"status-img": "/component/statusPoint/statusPoint", "status-img": "/component/statusPoint/statusPoint"
"go-home": "/component/goHome/goHome"
} }
} }
\ No newline at end of file
...@@ -30,7 +30,3 @@ ...@@ -30,7 +30,3 @@
</view> </view>
</block> </block>
</view> </view>
<!--goHome-->
<go-home/>
// subPackage/page/pages/goToHome/goToHome.js // subPackage/page/pages/goToHome/goToHome.js
Page({ var app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo
wxService.page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
curHeight: ''
}, },
/** /**
...@@ -15,6 +20,10 @@ Page({ ...@@ -15,6 +20,10 @@ Page({
}, },
handelGoHome() {
wxService.router('/pages/userCenter/userCenter').replace()
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -26,7 +35,11 @@ Page({ ...@@ -26,7 +35,11 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
wxService.getSystemInfo().then(res => {
this.setData({
curHeight: res.windowHeight
})
})
}, },
/** /**
......
{ {
"navigationBarTitleText": "回到首页", "navigationBarTitleText": "敬请期待",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file
<!--subPackage/page/pages/goToHome/goToHome.wxml--> <!--subPackage/page/pages/goToHome/goToHome.wxml-->
<!-- <view class="bottom-img" bindtap="handelGoHome"> <view class="go-home" style="height:{{curHeight}}px" bindtap="handelGoHome"></view>
<image class="img-top" mode="widthFix" src="/assets/imgs/7_1_0/go-top.png" bindtap="goTop"></image>
</view> --> <!--<view class="go-tips">敬请期待</view>
<view class="btn-wrap"> <view class="btn-wrap">
<view class="btn-home"> <view class="btn-home" bindtap="handelGoHome">
<button class="btn btn-primary">回到首页</button> <button type='primary' class='btn-primary'>回到首页</button>
</view> </view>
</view> </view-->
This source diff could not be displayed because it is too large. You can view the blob instead.
var pathJson = {
'7.1': [ // 版本对应路径
'pages/pointList/pointList',
'pages/pointDetail/pointDetail'
]
}
module.exports = pathJson
\ No newline at end of file
...@@ -79,6 +79,12 @@ export function getC3 (c2Name) { ...@@ -79,6 +79,12 @@ export function getC3 (c2Name) {
}) })
} }
export function getCurrentRouter () {
var pages = getCurrentPages() // 获取加载的页面
var currentPage = pages[pages.length - 1] // 获取当前页面的对象
return currentPage
}
export function getAppUserInfo () { export function getAppUserInfo () {
const userInfo = wx.getStorageSync('_userInfo') const userInfo = wx.getStorageSync('_userInfo')
if (userInfo) { if (userInfo) {
......
...@@ -19,6 +19,7 @@ import utils from './util' ...@@ -19,6 +19,7 @@ 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"; import * as watch from "./watch.js";
const pathData = require('./currentAccessiblePath.js')
let openCardLister = null let openCardLister = null
/** /**
...@@ -368,6 +369,46 @@ class WXService extends Http { ...@@ -368,6 +369,46 @@ class WXService extends Http {
}) })
} }
getAssPath() {
const paths = pathData
let pathArr = []
for (const key in paths) {
if (paths.hasOwnProperty(key)) {
let pathObj = {}
pathObj[key] = paths[key]
pathArr.push(pathObj)
}
}
return pathArr
}
trialList() {
let localPath = this.getAssPath()
wx.showLoading({
title: '加载中'
})
return this.get(`/member/trial/list`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
// 对应的path
let currentPaths = [];
localPath.forEach(item => {
console.log('---------', item, data)
if (item.hasOwnProperty(data)) {
currentPaths = item[data]
} else {
console.log(222);
}
})
return Promise.resolve({ currentPaths })
}
}
})
}
getSystemInfo() { getSystemInfo() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.getSystemInfo({ wx.getSystemInfo({
...@@ -500,6 +541,9 @@ class WXService extends Http { ...@@ -500,6 +541,9 @@ class WXService extends Http {
config.data.currentPageRequireAuth = false; config.data.currentPageRequireAuth = false;
// vip // vip
config.data.isVip = '' config.data.isVip = ''
// 集点体验者
config.data.experAccessible;
const CONFIG_PAPGE = { const CONFIG_PAPGE = {
onLoad: function (...args) { onLoad: function (...args) {
...@@ -532,10 +576,13 @@ class WXService extends Http { ...@@ -532,10 +576,13 @@ class WXService extends Http {
config.onLoad && config.onLoad.apply(page, args); config.onLoad && config.onLoad.apply(page, args);
}, },
onShow: function (...args) { onShow: function (...args) {
const isExperiencer = wx.getStorageSync('isExperiencer')
const page = this const page = this
_self.currentPage = page _self.currentPage = page
config.onShow && config.onShow.apply(page, args) config.onShow && config.onShow.apply(page, args)
wx.removeStorageSync('_premiumExpireTime') wx.removeStorageSync('_premiumExpireTime')
// 获取当前页
let router = getCurrentRouter()
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const premiumExpireTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.premiumExpireTime || '' const premiumExpireTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.premiumExpireTime || ''
...@@ -553,6 +600,20 @@ class WXService extends Http { ...@@ -553,6 +600,20 @@ class WXService extends Http {
page.setData({ page.setData({
currentHasUserInfo: true, currentHasUserInfo: true,
isVip: vipFlag isVip: vipFlag
},()=>{
_self.trialList().then(res => {
if (!res) return false
const { currentPaths } = res
if (currentPaths.indexOf(router.route) > -1 && isExperiencer) {
this.setData({
experAccessible: true
})
} else {
this.setData({
experAccessible: false
})
}
})
}); });
} 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