Commit 9e4b8e02 by 高淑倩

getAssPath

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