| | |
| | | } from './api/index' |
| | | import CustomHook from 'spa-custom-hooks'; |
| | | let globalData = { |
| | | token: '', |
| | | token: wx.getStorageSync('token'), |
| | | primary: '#B08771', |
| | | bottomLift: '' |
| | | } |
| | | let pathMap = [ |
| | | '/pages/detailDis/product', |
| | | '/pages/detailDis/case', |
| | | '/pages/detailDis/realpic', |
| | | '/pages/consult/detail', |
| | | '/pages/productVideo/index', |
| | | ] |
| | | App({ |
| | | globalData, |
| | | onLaunch: function (op) { |
| | | console.log('options', op.query) |
| | | let pathMap = [ |
| | | '/pages/detailDis/product', |
| | | '/pages/detailDis/case', |
| | | '/pages/detailDis/realpic', |
| | | '/pages/consult/detail', |
| | | '/pages/productVideo/index', |
| | | ] |
| | | //获取当前设备信息 |
| | | const WindowInfo = wx.getWindowInfo() |
| | | if (WindowInfo.safeArea.top > 20) { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | if (op.query.scene) { |
| | | let temp = op.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | // if (op.query.scene) { |
| | | // let temp = op.query.scene.split('_') |
| | | // wx.navigateTo({ |
| | | // url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | // }) |
| | | // } |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | onShow(options) { |
| | | console.log('options', options); |
| | | const token = wx.getStorageSync('token') || '' |
| | | if(token){ |
| | | if (options.query.scene) { |
| | | let temp = options.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | CustomHook.install({ |
| | |
| | | this.initData() |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | setTimeout(() => { |
| | | getMemberInfo().then(res => { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | }) |
| | | }, 500) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({ member }) |
| | | |
| | | eventBus.once("reloadHome", () => { |
| | | console.log('reloadHome'); |
| | | this.onLoad() |
| | |
| | | }, |
| | | changePath(e) { |
| | | let index = e.currentTarget.dataset.type |
| | | const member = this.data.member |
| | | let that = this |
| | | switch (index) { |
| | | case '0': |
| | |
| | | }) |
| | | break; |
| | | case '2': |
| | | wx.navigateTo({ |
| | | url: '/pages/design/design' |
| | | }) |
| | | if(member && member.phone){ |
| | | wx.navigateTo({ |
| | | url: '/pages/design/design' |
| | | }) |
| | | }else{ |
| | | wx.navigateTo({ |
| | | url: '/pages/auth/auth', |
| | | }) |
| | | } |
| | | |
| | | // wx.navigateTo({ |
| | | // url: '/pages/wonderful_activity/index', |
| | | // success: function(res) { |
| | |
| | | <view class="container"> |
| | | <image class="avatar" src=""></image> |
| | | <image class="avatar" src="../../static/icon/logo.png"></image> |
| | | <view class="home_title">志邦优家</view> |
| | | <view class="placeholder9">最懂你的营销助手</view> |
| | | <!-- --> |
| | |
| | | wx.clearStorageSync() |
| | | setTimeout(() => { |
| | | wx.setStorageSync('sessionKey', sessionKey) |
| | | wx.navigateTo({ |
| | | wx.redirectTo({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | }, 300) |