Commit 52bf2509 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 3fb4917a 51be3781
......@@ -40,6 +40,10 @@ App({
onShow: function (options = {}) {
console.log('app-onshow', options)
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){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
......
......@@ -31,6 +31,7 @@ wxService.page({
plusMemberPrice: 0, // plus 默认价
plusMemberName: '',
defalutCoupon: '',
defalutCouponId: '',
addressId: '', // 收货地址id
},
......@@ -332,6 +333,7 @@ wxService.page({
this.setData({
currentOrderList: data,
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
}, () => {
// 实付款
......@@ -342,13 +344,13 @@ wxService.page({
})
},
handelGobuy() {
const { trolleySku2Buy, couponId, addressId, addressInfo } = this.data
const { trolleySku2Buy, couponId, addressId, addressInfo, defalutCouponId } = this.data
let params = {
couponId,
couponId: couponId? couponId : defalutCouponId,
trolleySku2Buy,
addressId: addressId ? addressId : addressInfo.id // 微信地址 or 地址id
}
console.log('wwwwwwwwwwwwwwwparams', params)
this.getBill(params) // 下单
},
// 下单
......@@ -358,8 +360,6 @@ console.log('wwwwwwwwwwwwwwwparams', params)
})
const { isSelect} = this.data
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 => {
if (res) {
const { result, data } = res.data
......
......@@ -56,6 +56,54 @@ wxService.page({
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) {
wx.showLoading({
......@@ -248,46 +296,46 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
// 登录接口返回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
}
// const { memberId, member } = wx.getStorageSync('_baseUserInfo')
// // 登录接口返回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
})
}
// 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
// })
// }
},
/**
......
......@@ -5,7 +5,6 @@
"x-dialog":"/component/dialog/dialog",
"x-progress-point":"/component/progressPoint/progressPoint",
"x-progress-image":"/component/progressImage/progressImage",
"authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point",
"go-home": "/component/goHome/goHome"
"authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point"
}
}
\ No newline at end of file
......@@ -70,7 +70,6 @@
bind:_closeDialog="_closeDialog"
show="{{dialog.show}}"
/>
<!--goHome-->
<go-home/>
<authorization-modal-point isAuthorization='{{isAuthorization}}' />
......@@ -14,7 +14,16 @@ wxService.page({
currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
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({
* 生命周期函数--监听页面显示
*/
onShow() {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
this.getPointList()
// const { memberId, member } = wx.getStorageSync('_baseUserInfo')
// this.getPointList()
},
getPointList() {
wx.showLoading({
......
{
"navigationBarTitleText": "集点列表",
"usingComponents": {
"status-img": "/component/statusPoint/statusPoint",
"go-home": "/component/goHome/goHome"
"status-img": "/component/statusPoint/statusPoint"
}
}
\ No newline at end of file
......@@ -30,7 +30,3 @@
</view>
</block>
</view>
<!--goHome-->
<go-home/>
// 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: {
curHeight: ''
},
/**
......@@ -15,6 +20,10 @@ Page({
},
handelGoHome() {
wxService.router('/pages/userCenter/userCenter').replace()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......@@ -26,7 +35,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
wxService.getSystemInfo().then(res => {
this.setData({
curHeight: res.windowHeight
})
})
},
/**
......
{
"navigationBarTitleText": "回到首页",
"navigationBarTitleText": "敬请期待",
"usingComponents": {}
}
\ No newline at end of file
<!--subPackage/page/pages/goToHome/goToHome.wxml-->
<!-- <view class="bottom-img" bindtap="handelGoHome">
<image class="img-top" mode="widthFix" src="/assets/imgs/7_1_0/go-top.png" bindtap="goTop"></image>
</view> -->
<view class="btn-wrap">
<view class="btn-home">
<button class="btn btn-primary">回到首页</button>
</view>
</view>
<view class="go-home" style="height:{{curHeight}}px" bindtap="handelGoHome"></view>
<!--<view class="go-tips">敬请期待</view>
<view class="btn-wrap">
<view class="btn-home" bindtap="handelGoHome">
<button type='primary' class='btn-primary'>回到首页</button>
</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) {
})
}
export function getCurrentRouter () {
var pages = getCurrentPages() // 获取加载的页面
var currentPage = pages[pages.length - 1] // 获取当前页面的对象
return currentPage
}
export function getAppUserInfo () {
const userInfo = wx.getStorageSync('_userInfo')
if (userInfo) {
......
......@@ -19,6 +19,7 @@ import utils from './util'
const citysData = require('./city.js')
import { Integer } from './integerDigitalConvertion'
import * as watch from "./watch.js";
const pathData = require('./currentAccessiblePath.js')
let openCardLister = null
/**
......@@ -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() {
return new Promise((resolve, reject) => {
wx.getSystemInfo({
......@@ -500,6 +541,9 @@ class WXService extends Http {
config.data.currentPageRequireAuth = false;
// vip
config.data.isVip = ''
// 集点体验者
config.data.experAccessible;
const CONFIG_PAPGE = {
onLoad: function (...args) {
......@@ -532,10 +576,13 @@ class WXService extends Http {
config.onLoad && config.onLoad.apply(page, args);
},
onShow: function (...args) {
const isExperiencer = wx.getStorageSync('isExperiencer')
const page = this
_self.currentPage = page
config.onShow && config.onShow.apply(page, args)
wx.removeStorageSync('_premiumExpireTime')
// 获取当前页
let router = getCurrentRouter()
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const premiumExpireTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.premiumExpireTime || ''
......@@ -553,6 +600,20 @@ class WXService extends Http {
page.setData({
currentHasUserInfo: true,
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 {
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