Commit 9e4b8e02 by 高淑倩

getAssPath

parent beb87ed7
...@@ -110,9 +110,9 @@ App({ ...@@ -110,9 +110,9 @@ App({
imageUrl: envInfo.imgCtx, //图片地址 imageUrl: envInfo.imgCtx, //图片地址
isFullSucreen: false, // 当前设备是否为 FullSucreen isFullSucreen: false, // 当前设备是否为 FullSucreen
commonFunc: commonFunc, commonFunc: commonFunc,
brandId: 2711, // brandId: 2711,
// brandId: 2005, // brandId: 2005,
// brandId: 1001, brandId: 1001,
// brandId: 1002, // brandId: 1002,
} }
}) })
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test, 预生产 pre const PROJECT_ENV = 'dev' // 生产 prod, 开发1 dev,开发2 dev2, 测试 test, 预生产 pre
const needMock = '' // const needMock = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
...@@ -9,8 +9,8 @@ const needMock = '' // ...@@ -9,8 +9,8 @@ const needMock = '' //
// 1 2 3 步!!!!!!!!!!!!!!!!!!!!!! prod appid brandId // 1 2 3 步!!!!!!!!!!!!!!!!!!!!!! prod appid brandId
// const devCtx = 'http://111.231.86.64' const devCtx = 'http://buyer.devapi.bigaka.net' // 开发环境 1
const devCtx = 'http://buyer.devapi.bigaka.net' // 开发环境 const devCtx2 = 'http://dev-sellerapi.bigaka.net' // 开发环境 2
const testCtx = 'https://crm-b.bigaka.net/api' // 发测试时解开此注释 const testCtx = 'https://crm-b.bigaka.net/api' // 发测试时解开此注释
const preCtx = 'https://crm-b.bigaka.com/api' // 发预生产时解开此注释 const preCtx = 'https://crm-b.bigaka.com/api' // 发预生产时解开此注释
const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释 const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释
...@@ -23,6 +23,7 @@ const prodImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址 ...@@ -23,6 +23,7 @@ const prodImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址
const config = { const config = {
dev: devCtx, dev: devCtx,
dev2: devCtx2,
test: testCtx, test: testCtx,
pre: preCtx, pre: preCtx,
prod: prodCtx prod: prodCtx
......
...@@ -14,28 +14,30 @@ wxService.page({ ...@@ -14,28 +14,30 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
pages:[], pages: [],
render: null, // 渲染页面数据对象(安全渲染) render: null, // 渲染页面数据对象(安全渲染)
renderPageOver: false, // 渲染页面结束 renderPageOver: false, // 渲染页面结束
integralNum: 0, integralNum: 0,
couponNum: 0, couponNum: 0,
// isAllScreen: fullSucreen.isAllScreen // isAllScreen: fullSucreen.isAllScreen
isAllScreen: config.isAllScreen, isAllScreen: config.isAllScreen,
token:'', token: '',
isAuthorization: false, isAuthorization: false,
pageId: 3, pageId: 3,
baseUserInfo: null, baseUserInfo: null,
cardMember: null, cardMember: null,
curMemberTrial: false, // 当前会员是不是体验者
curAccessiblePathArr: [] // 当前体验版本对应的路径
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad () {}, onLoad() { },
/** /**
* 监听子组件事件 * 监听子组件事件
* */ * */
updatePage(ev) { updatePage(ev) {
const {pageId} = ev.detail const { pageId } = ev.detail
console.log('pageId', pageId) console.log('pageId', pageId)
// this.setData({ // this.setData({
// pages: [], // pages: [],
...@@ -43,12 +45,12 @@ wxService.page({ ...@@ -43,12 +45,12 @@ wxService.page({
// },()=>{ // },()=>{
// this.initPage(pageId) // this.initPage(pageId)
// }) // })
wxService.router(`/subPackage/page/pages/subPage/subPage`).search({pageId}) wxService.router(`/subPackage/page/pages/subPage/subPage`).search({ pageId })
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow() {
// 取会员卡号 // 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const cardMember = wx.getStorageSync('_cardMember') const cardMember = wx.getStorageSync('_cardMember')
...@@ -74,7 +76,6 @@ wxService.page({ ...@@ -74,7 +76,6 @@ wxService.page({
handlerDataOnPage.init(this, 'pages') handlerDataOnPage.init(this, 'pages')
this.initPage(this.data.pageId) this.initPage(this.data.pageId)
// _cardMemebr // _cardMemebr
// if (baseUserInfo){ // if (baseUserInfo){
// this.setData({ // this.setData({
...@@ -93,37 +94,67 @@ wxService.page({ ...@@ -93,37 +94,67 @@ wxService.page({
// }) // })
// } // }
if (baseUserInfo && !reLoginErrFlag){ if (baseUserInfo && !reLoginErrFlag) {
this.setData({ this.setData({
token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
baseUserInfo, baseUserInfo,
cardMember, cardMember,
isAuthorization: false isAuthorization: false
},()=>{ }, () => {
// 积分数量 // 积分数量
this.getMemberPointInfo() this.getMemberPointInfo()
// 优惠券数量 // 优惠券数量
this.getMemberCouponInfo() this.getMemberCouponInfo()
// 获取当前会员是否是体验者
const { member } = baseUserInfo
const curMemberTrial = member.trial || true
console.log('curMemberTrial', curMemberTrial)
if (curMemberTrial) {
this.setData({
curMemberTrial
}, () => {
// 获取当前体验版信息
this.trialList()
})
}
}) })
} }
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
}) })
} }
}, },
trialList() {
console.log('wxService.getAssPath()',wxService.getAssPath())
wx.showLoading({
title: '加载中'
})
wxService.get(`/member/trial/list`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
console.log('res', res)
this.setData({
curAccessiblePathArr: data
})
}
}
})
},
// 查询积分信息 // 查询积分信息
getMemberPointInfo(){ getMemberPointInfo() {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => { wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => {
if(res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
...@@ -131,16 +162,16 @@ wxService.page({ ...@@ -131,16 +162,16 @@ wxService.page({
integralNum: data && data.point || 0 integralNum: data && data.point || 0
}) })
} }
} }
}) })
}, },
// 查询优惠券数量 // 查询优惠券数量
getMemberCouponInfo(){ getMemberCouponInfo() {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => { wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
if(res){ if (res) {
const { result, data } = res && res.data const { result, data } = res && res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
...@@ -157,7 +188,7 @@ wxService.page({ ...@@ -157,7 +188,7 @@ wxService.page({
}) })
}, },
// page 信息 // page 信息
initPage(pageId){ initPage(pageId) {
this.setData({ this.setData({
products: [] products: []
}) })
...@@ -165,22 +196,22 @@ wxService.page({ ...@@ -165,22 +196,22 @@ wxService.page({
title: '加载中' title: '加载中'
}) })
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => { // wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
// 动态页面 // 动态页面
wxService.post(`/merchant/modelPage/mainSetting?brandId=${app.globalData.brandId}`).then(res => { wxService.post(`/merchant/modelPage/mainSetting?brandId=${app.globalData.brandId}`).then(res => {
if(!res) return false if (!res) return false
const {result,data} = res.data const { result, data } = res.data
if(result == 0){ if (result == 0) {
// 动态设置title // 动态设置title
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: data.page.title title: data.page.title
}) })
// 段落 // 段落
const products = data.paragraphs const products = data.paragraphs
const filterResult = products.map((res,index)=>{ const filterResult = products.map((res, index) => {
return { return {
...res,index ...res, index
} }
}).filter(item=> { }).filter(item => {
// wx.hideLoading() // wx.hideLoading()
}) })
...@@ -201,15 +232,15 @@ wxService.page({ ...@@ -201,15 +232,15 @@ wxService.page({
* @param isLastPage * @param isLastPage
* @param now * @param now
*/ */
renderPageFunc ({ products }) { renderPageFunc({ products }) {
let productData = handlerDataOnPage.handlerArray(products) let productData = handlerDataOnPage.handlerArray(products)
logger.log('productData.keysNum', productData.keysNum(), productData) logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({ this.setData({
...productData ...productData
},()=>{ }, () => {
wx.hideLoading() wx.hideLoading()
}) })
} }
}) })
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.6.6", "libVersion": "2.6.6",
"appid": "wx700028bf32a3be66", "appid": "wxc3b64b09b1d3dfc2",
"projectname": "7-Eleven", "projectname": "7-Eleven",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
......
var pathJson = {
'7.1': [ // 版本对应路径
'pages/pointList/pointList',
'pages/pointDetail/pointDetail'
]
}
module.exports = pathJson
\ No newline at end of file
...@@ -88,18 +88,7 @@ export function getAppUserInfo () { ...@@ -88,18 +88,7 @@ export function getAppUserInfo () {
} }
} }
export default { export default {
c1C2Map, c1C2Map,
c2C3Map c2C3Map
} }
export function checkOpenCard () {
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let isMember = '0'
if (baseUserInfo && baseUserInfo.isMember === '1') {
isMember = '1'
}
const pass = isMember === '1'
return pass
}
...@@ -14,6 +14,7 @@ const Promise = require('../lib/bluebird') ...@@ -14,6 +14,7 @@ const Promise = require('../lib/bluebird')
const config = require('../config/index').envInfo const config = require('../config/index').envInfo
import utils from './util' import utils from './util'
let openCardLister = null let openCardLister = null
const pathData = require('./currentAccessiblePath.js')
/** /**
* 单例 * 单例
*/ */
...@@ -285,7 +286,16 @@ class WXService extends Http { ...@@ -285,7 +286,16 @@ class WXService extends Http {
}) })
} }
getAssPath () {
const paths = pathData
let pathArr = []
for(const key in paths){
if (paths.hasOwnProperty(key)) {
pathArr.push(key)
}
}
return pathArr
}
// handlerPage (page) { // handlerPage (page) {
// const AccreditWhitePages = [ // const AccreditWhitePages = [
// 'pages/welcome/welcome' // 'pages/welcome/welcome'
......
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