| @@ -5,24 +5,8 @@ App({ | |||||
| data: { | data: { | ||||
| newArr:[],//存放分享二维进入消息信息 | newArr:[],//存放分享二维进入消息信息 | ||||
| }, | }, | ||||
| // 这里这么写,是要在其他界面监听,而不是在app.js中监听,而且这个监听方法,需要一个回调方法。 | |||||
| watch: function (method) { | |||||
| var obj = this.globalData; | |||||
| Object.defineProperty(obj, "ifShowTab", { | |||||
| configurable: true, | |||||
| enumerable: true, | |||||
| set: function (value) { | |||||
| this._ifShowTab = value; | |||||
| console.log('是否会被执行2') | |||||
| method(value); | |||||
| }, | |||||
| get: function () { | |||||
| // 可以在这里打印一些东西,然后在其他界面调用getApp().globalData.name的时候,这里就会执行。 | |||||
| return this._ifShowTab | |||||
| } | |||||
| }) | |||||
| }, | |||||
| onLaunch: function(options) { | onLaunch: function(options) { | ||||
| wx.hideTabBar() | |||||
| var that = this; | var that = this; | ||||
| if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow | if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow | ||||
| that.globalData.previewFlag = false | that.globalData.previewFlag = false | ||||
| @@ -160,6 +144,7 @@ App({ | |||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| /** | /** | ||||
| * 下载小程序新版本并重启应用 | * 下载小程序新版本并重启应用 | ||||
| */ | */ | ||||
| @@ -182,7 +167,6 @@ App({ | |||||
| }, | }, | ||||
| globalData: { | globalData: { | ||||
| styleLsit:{}, | styleLsit:{}, | ||||
| ifShowTab: true, | |||||
| previewFlag:false,//解决图片预览调用noshow | previewFlag:false,//解决图片预览调用noshow | ||||
| activityId:'',//活动id方便授权数据回传 | activityId:'',//活动id方便授权数据回传 | ||||
| typeLsit: [],//初始哈样式 | typeLsit: [],//初始哈样式 | ||||
| @@ -100,8 +100,6 @@ Component({ | |||||
| console.log(data.index) | console.log(data.index) | ||||
| const url = data.path; | const url = data.path; | ||||
| if (data.index == 0 || data.index == 3) { | if (data.index == 0 || data.index == 3) { | ||||
| console.log("ifShowTab = false") | |||||
| app.globalData.ifShowTab = false | |||||
| this.getTemplateId() | this.getTemplateId() | ||||
| } | } | ||||
| @@ -123,63 +121,42 @@ Component({ | |||||
| } = res | } = res | ||||
| if (code == 200) { | if (code == 200) { | ||||
| app.globalData.styleLsit = data | app.globalData.styleLsit = data | ||||
| this.setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${data.t_in.icon}`, | |||||
| "selectedIconPath": `${data.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${data.t_md.icon}`, | |||||
| "selectedIconPath": `${data.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${data.t_tc.icon}`, | |||||
| "selectedIconPath": `${data.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${data.t_uc.icon}`, | |||||
| "selectedIconPath": `${data.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| selectedColor: `${data.t_uc_std.styleClass}`, | |||||
| home_a_img: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${data.t_in.icon}`, | |||||
| "selectedIconPath": `${data.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${data.t_md.icon}`, | |||||
| "selectedIconPath": `${data.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${data.t_tc.icon}`, | |||||
| "selectedIconPath": `${data.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${data.t_uc.icon}`, | |||||
| "selectedIconPath": `${data.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| this.setTabStyle() | |||||
| } | } | ||||
| // console.log(this.data.list[0].selectedIconPath, '99999999999999999999999999999999999999999') | // console.log(this.data.list[0].selectedIconPath, '99999999999999999999999999999999999999999') | ||||
| }) | }) | ||||
| }, | }, | ||||
| // 初始换底部导航栏 | |||||
| setTabStyle: function () { | |||||
| this.getTabBar().setData({ | |||||
| selectedColor: `${app.globalData.styleLsit.t_in_std.styleClass}`, | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| }, | |||||
| getTemplateId() { | getTemplateId() { | ||||
| // console.log("隐藏") | // console.log("隐藏") | ||||
| @@ -210,7 +187,6 @@ Component({ | |||||
| this.data.templateId.map(res => { | this.data.templateId.map(res => { | ||||
| tmplIds.push(res.templateId) | tmplIds.push(res.templateId) | ||||
| }) | }) | ||||
| // console.log(tmplIds[0], "?|?|?|", this.data.templateId) | |||||
| wx.requestSubscribeMessage({ | wx.requestSubscribeMessage({ | ||||
| tmplIds: tmplIds, | tmplIds: tmplIds, | ||||
| success(res) { | success(res) { | ||||
| @@ -225,7 +201,7 @@ Component({ | |||||
| Http.post({ | Http.post({ | ||||
| url: config.api.wxMsg | url: config.api.wxMsg | ||||
| }).then(res => { | }).then(res => { | ||||
| app.globalData.ifShowTab = true | |||||
| wx.setStorageSync({ | wx.setStorageSync({ | ||||
| key: 'ifShowTab', | key: 'ifShowTab', | ||||
| data: true, | data: true, | ||||
| @@ -234,7 +210,7 @@ Component({ | |||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| app.globalData.ifShowTab = true | |||||
| // for (let i = 0; i < tmplIds.length;i++){ | // for (let i = 0; i < tmplIds.length;i++){ | ||||
| // if (res.tmplIds[i] == 'accept'){ | // if (res.tmplIds[i] == 'accept'){ | ||||
| @@ -243,7 +219,7 @@ Component({ | |||||
| // } | // } | ||||
| }, | }, | ||||
| complete(){ | complete(){ | ||||
| app.globalData.ifShowTab = true | |||||
| } | } | ||||
| }) | }) | ||||
| }, | }, | ||||
| @@ -1,8 +1,8 @@ | |||||
| <!--miniprogram/custom-tab-bar/index.wxml--> | <!--miniprogram/custom-tab-bar/index.wxml--> | ||||
| <cover-view class="tab-bar" wx:if="{{list.length!=0}}"> | |||||
| <cover-view class="tab-bar-border"></cover-view> | |||||
| <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab"> | |||||
| <cover-image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></cover-image> | |||||
| <cover-view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</cover-view> | |||||
| </cover-view> | |||||
| </cover-view> | |||||
| <view class="tab-bar" wx:if="{{list.length!=0}}"> | |||||
| <view class="tab-bar-border"></view> | |||||
| <view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab"> | |||||
| <image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image> | |||||
| <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -8,6 +8,7 @@ | |||||
| background: white; | background: white; | ||||
| display: flex; | display: flex; | ||||
| padding-bottom: env(safe-area-inset-bottom); | padding-bottom: env(safe-area-inset-bottom); | ||||
| overflow: hidden; | |||||
| } | } | ||||
| .tab-bar-border { | .tab-bar-border { | ||||
| @@ -29,11 +30,11 @@ | |||||
| flex-direction: column; | flex-direction: column; | ||||
| } | } | ||||
| .tab-bar-item cover-image { | |||||
| .tab-bar-item image { | |||||
| width: 46rpx; | width: 46rpx; | ||||
| height: 46rpx; | height: 46rpx; | ||||
| } | } | ||||
| .tab-bar-item cover-view { | |||||
| .tab-bar-item view { | |||||
| font-size: 20rpx; | font-size: 20rpx; | ||||
| } | } | ||||
| @@ -1,13 +1,6 @@ | |||||
| { | { | ||||
| "ext": { | "ext": { | ||||
| "attr": { | "attr": { | ||||
| "car": { | |||||
| "etcp": { | |||||
| "etcpAppId": "wx192b7d2e8dcbefd0", | |||||
| "etcpVersion": "release", | |||||
| "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||||
| } | |||||
| }, | |||||
| "imgProxy": [ | "imgProxy": [ | ||||
| { | { | ||||
| "newUrl": "https://ctest.malls.iformall.com/img", | "newUrl": "https://ctest.malls.iformall.com/img", | ||||
| @@ -23,11 +16,14 @@ | |||||
| } | } | ||||
| ], | ], | ||||
| "configUrl": "https://ctest.malls.iformall.com/C/api", | "configUrl": "https://ctest.malls.iformall.com/C/api", | ||||
| "etcpAppId": "wx9f3a77763caa7c89", | |||||
| "etcpVersion": "release", | |||||
| "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", | |||||
| "ifHaveWebSocket": "0", | "ifHaveWebSocket": "0", | ||||
| "ifHaveCarModular": "1" | "ifHaveCarModular": "1" | ||||
| }, | }, | ||||
| "name": "金泸商务", | |||||
| "weappId": "wx649b3be73c1afe47", | |||||
| "name": "富茂望京测试版", | |||||
| "weappId": "wx9f3a77763caa7c89", | |||||
| "appVersion": "C.test.5.2.0" | "appVersion": "C.test.5.2.0" | ||||
| }, | }, | ||||
| "debug": false, | "debug": false, | ||||
| @@ -73,7 +69,7 @@ | |||||
| "provider": "wx2b03c6e691cd7370" | "provider": "wx2b03c6e691cd7370" | ||||
| } | } | ||||
| }, | }, | ||||
| "extAppid": "wx649b3be73c1afe47", | |||||
| "extAppid": "wx9f3a77763caa7c89", | |||||
| "extEnable": true, | "extEnable": true, | ||||
| "permission": { | "permission": { | ||||
| "scope.userLocation": { | "scope.userLocation": { | ||||
| @@ -259,7 +259,6 @@ Page({ | |||||
| * 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
| */ | */ | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| console.log("我只执行一次") | |||||
| this.getType() | this.getType() | ||||
| this.getLocation(); | this.getLocation(); | ||||
| let that = this; | let that = this; | ||||
| @@ -320,110 +319,43 @@ Page({ | |||||
| onUnload() { | onUnload() { | ||||
| // wx.removeStorageSync('squareList') | // wx.removeStorageSync('squareList') | ||||
| }, | }, | ||||
| watchBack: function (ifShowTab) { //监听ifShowTab变化 | |||||
| if (ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| }else{ | |||||
| console.log("我隐藏了") | |||||
| this.getTabBar().setData({ | |||||
| list:[] | |||||
| }) | |||||
| } | |||||
| // 初始换底部导航栏 | |||||
| setTabStyle: function () { | |||||
| this.getTabBar().setData({ | |||||
| selectedColor: `${app.globalData.styleLsit.t_in_std.styleClass}`, | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| }, | }, | ||||
| onShow: function() { | onShow: function() { | ||||
| if (app.globalData.ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag")==1){//处理授权取消后回到首页底部导航栏显示 | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| wx.removeStorageSync("tabFlag") | |||||
| if(JSON.stringify(app.globalData.styleLsit)!="{}"){ | |||||
| this.setTabStyle() | |||||
| } | } | ||||
| console.log("我每次都执行" ,app.globalData.ifShowTab) | |||||
| app.watch(this.watchBack) | |||||
| this.ifShowSqare(); | this.ifShowSqare(); | ||||
| if (wx.getStorageSync("squareList")) { | if (wx.getStorageSync("squareList")) { | ||||
| var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name | var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name | ||||
| @@ -79,7 +79,20 @@ Page({ | |||||
| url: `/pages/getphoneInfo/index?path=main` | url: `/pages/getphoneInfo/index?path=main` | ||||
| }); | }); | ||||
| }, | }, | ||||
| //是否授权手机号 | |||||
| ifPhoneInfo() { | |||||
| let that = this; | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| return | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| /* 判断是否授权*/ | /* 判断是否授权*/ | ||||
| userAuthorization() { | userAuthorization() { | ||||
| Http.get({ | Http.get({ | ||||
| @@ -88,7 +101,7 @@ Page({ | |||||
| token: app.globalData.token | token: app.globalData.token | ||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| // this.getUserInfo() | |||||
| this.ifPhoneInfo() | |||||
| }).catch(err => { | }).catch(err => { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/getuserinfo/index`, | url: `/pages/getuserinfo/index`, | ||||
| @@ -128,67 +141,7 @@ Page({ | |||||
| gotoedit: function() { | gotoedit: function() { | ||||
| this.checkUserStatus(); | this.checkUserStatus(); | ||||
| }, | }, | ||||
| watchBack: function (ifShowTab) { //监听ifShowTab变化 | |||||
| console.log("ifShowTab",ifShowTab) | |||||
| if (ifShowTab) { | |||||
| console.log("ifShowTab", ifShowTab) | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| }, | |||||
| onLoad() { | onLoad() { | ||||
| if (typeof this.getTabBar === 'function' && | |||||
| this.getTabBar()) { | |||||
| if (ifStoreApp == 1) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 1 | |||||
| }) | |||||
| } else if (ifStoreApp == 2) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 2 | |||||
| }) | |||||
| } else { | |||||
| this.getTabBar().setData({ | |||||
| selected: 3, | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| } | |||||
| this.getLocation(); | this.getLocation(); | ||||
| this.updateScene(); | this.updateScene(); | ||||
| // this.getRoomId(); | // this.getRoomId(); | ||||
| @@ -263,42 +216,6 @@ Page({ | |||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| onShow: function() { | onShow: function() { | ||||
| console.log(app.globalData.ifShowTab,"////") | |||||
| if (app.globalData.ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| app.watch(this.watchBack) | |||||
| let that = this; | let that = this; | ||||
| that.userAuthorization() | that.userAuthorization() | ||||
| if (typeof that.getTabBar === 'function' && | if (typeof that.getTabBar === 'function' && | ||||
| @@ -314,40 +231,10 @@ Page({ | |||||
| } else { | } else { | ||||
| that.getTabBar().setData({ | that.getTabBar().setData({ | ||||
| selected: 3, | selected: 3, | ||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag") == 1) {//处理授权取消后回到首页底部导航栏显示 | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| wx.removeStorageSync("tabFlag") | |||||
| } | |||||
| that.setData({ | that.setData({ | ||||
| appVersion: extConfig.appVersion, | appVersion: extConfig.appVersion, | ||||
| }) | }) | ||||
| @@ -67,13 +67,11 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| backHome: function() { | backHome: function() { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/index', | url: '/index/index', | ||||
| }) | }) | ||||
| }, | }, | ||||
| getPhoneNumber: function(e) { | getPhoneNumber: function(e) { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| var that = this; | var that = this; | ||||
| var iv = e.detail.iv; | var iv = e.detail.iv; | ||||
| var encryptedData = e.detail.encryptedData; | var encryptedData = e.detail.encryptedData; | ||||
| @@ -166,7 +164,11 @@ Page({ | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/user' | url: '/index/user' | ||||
| }); | }); | ||||
| } else { | |||||
| } else if (that.data.mineFlag == 'index'){ | |||||
| wx.switchTab({ | |||||
| url: '/index/index' | |||||
| }); | |||||
| }else { | |||||
| wx.showToast({ | wx.showToast({ | ||||
| title: res.data.msg, | title: res.data.msg, | ||||
| @@ -136,7 +136,7 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| backHome: function() { | backHome: function() { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/index', | url: '/index/index', | ||||
| }) | }) | ||||
| @@ -22,10 +22,25 @@ Page({ | |||||
| phoneNumber: e.currentTarget.dataset.merchantlinkphone | phoneNumber: e.currentTarget.dataset.merchantlinkphone | ||||
| }); | }); | ||||
| }, | }, | ||||
| //是否授权手机号 | |||||
| ifPhoneInfo() { | |||||
| let that = this; | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| return | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=index`, | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| /** | /** | ||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| onShow: function () { | onShow: function () { | ||||
| this.ifPhoneInfo() | |||||
| let that = this; | let that = this; | ||||
| console.log("渲染开始") | console.log("渲染开始") | ||||
| Http.get({ | Http.get({ | ||||