| @@ -253,8 +253,17 @@ Page({ | |||||
| }, | }, | ||||
| gotomange: function () { | gotomange: function () { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/managelicenseplate/managelicenseplate', | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/managelicenseplate/managelicenseplate', | |||||
| }) | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=passCar`, | |||||
| }) | |||||
| }) | }) | ||||
| }, | }, | ||||
| bindfail: function (res) { | bindfail: function (res) { | ||||
| @@ -283,14 +292,32 @@ Page({ | |||||
| } | } | ||||
| }, | }, | ||||
| showquan: function () { | showquan: function () { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/passCar/couponList/couponList', | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/passCar/couponList/couponList', | |||||
| }) | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=passCar`, | |||||
| }) | |||||
| }) | }) | ||||
| }, | }, | ||||
| showList: function () { | showList: function () { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/passCar/showList/showList', | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/passCar/showList/showList', | |||||
| }) | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=passCar`, | |||||
| }) | |||||
| }) | }) | ||||
| }, | }, | ||||
| @@ -302,66 +329,79 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| onShow: function (options) { | onShow: function (options) { | ||||
| this.setData({ | |||||
| goHomeUrl: app.globalData.goHomeUrl | |||||
| }) | |||||
| if (typeof this.getTabBar === 'function' && | |||||
| this.getTabBar()) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 2 | |||||
| }) | |||||
| } | |||||
| var that = this; | var that = this; | ||||
| that.setData({ | |||||
| etcpAppId: extConfig.attr.car.etcp.etcpAppId, | |||||
| carMiniVersion: extConfig.attr.car.version, | |||||
| etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl, | |||||
| payPath: extConfig.attr.car.etcp.payPath, | |||||
| ifHaveCarModular: extConfig.attr.ifHaveCarModular | |||||
| }) | |||||
| console.log(this.data.ifHaveCarModular, 'ifHaveCarModular'); | |||||
| if (app.globalData.token) { | |||||
| that.getList(); | |||||
| that.init(); | |||||
| } else { | |||||
| that.init(); | |||||
| } | |||||
| /** | |||||
| * 只有用户选择了优惠券 | |||||
| * 才会进行券和车牌的绑定 | |||||
| */ | |||||
| /* if (wx.getStorageSync("chosed") && that.data.quanid) { | |||||
| that.getStopFee(that.data.listCardNum); | |||||
| that.bindCoupon(that.data.quanid); | |||||
| wx.setStorage({ | |||||
| key: 'chosed', | |||||
| data: '', | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| goHomeUrl: app.globalData.goHomeUrl | |||||
| }) | }) | ||||
| }; */ | |||||
| if (app.globalData.token) { | |||||
| // that.initUsrCarList(); | |||||
| that.initUsrCarList("flags"); | |||||
| if (typeof this.getTabBar === 'function' && | |||||
| this.getTabBar()) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 2 | |||||
| }) | |||||
| } | |||||
| that.setData({ | that.setData({ | ||||
| current: 0 | |||||
| etcpAppId: extConfig.attr.car.etcp.etcpAppId, | |||||
| carMiniVersion: extConfig.attr.car.version, | |||||
| etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl, | |||||
| payPath: extConfig.attr.car.etcp.payPath, | |||||
| ifHaveCarModular: extConfig.attr.ifHaveCarModular | |||||
| }) | }) | ||||
| } | |||||
| if (that.data.addCar) { | |||||
| // 绑车牌 | |||||
| if (app.globalData.carLogin) { | |||||
| that.bindCar(that.data.addCar); | |||||
| console.log(this.data.ifHaveCarModular, 'ifHaveCarModular'); | |||||
| if (app.globalData.token) { | |||||
| that.getList(); | |||||
| that.init(); | |||||
| } else { | } else { | ||||
| that.bindCar(that.data.addCar); | |||||
| that.init(); | |||||
| } | |||||
| /** | |||||
| * 只有用户选择了优惠券 | |||||
| * 才会进行券和车牌的绑定 | |||||
| */ | |||||
| /* if (wx.getStorageSync("chosed") && that.data.quanid) { | |||||
| that.getStopFee(that.data.listCardNum); | |||||
| that.bindCoupon(that.data.quanid); | |||||
| wx.setStorage({ | |||||
| key: 'chosed', | |||||
| data: '', | |||||
| }) | |||||
| }; */ | |||||
| if (app.globalData.token) { | |||||
| // that.initUsrCarList(); | |||||
| that.initUsrCarList("flags"); | |||||
| that.setData({ | |||||
| current: 0 | |||||
| }) | |||||
| } | } | ||||
| that.setData({ | |||||
| addCar: null | |||||
| }); | |||||
| } | |||||
| this.getTicketList(0, 1); | |||||
| if (that.data.addCar) { | |||||
| // 绑车牌 | |||||
| if (app.globalData.carLogin) { | |||||
| that.bindCar(that.data.addCar); | |||||
| } else { | |||||
| that.bindCar(that.data.addCar); | |||||
| } | |||||
| that.setData({ | |||||
| addCar: null | |||||
| }); | |||||
| } | |||||
| this.getTicketList(0, 1); | |||||
| }).catch(err => { | |||||
| that.setData({ | |||||
| etcpAppId: extConfig.attr.car.etcp.etcpAppId, | |||||
| carMiniVersion: extConfig.attr.car.version, | |||||
| etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl, | |||||
| payPath: extConfig.attr.car.etcp.payPath, | |||||
| ifHaveCarModular: extConfig.attr.ifHaveCarModular | |||||
| }) | |||||
| that.initPark(); | |||||
| that.getParkStatus(); | |||||
| }) | |||||
| }, | }, | ||||
| cancelMove: function () { | cancelMove: function () { | ||||
| console.log(111) | console.log(111) | ||||
| @@ -376,39 +416,45 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| var that = this; | var that = this; | ||||
| /** | |||||
| * 获得分享小程序的 | |||||
| * title | |||||
| * desc | |||||
| */ | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.getWeapNote, | |||||
| data: { | |||||
| appId: config.weapp.AppId, | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| /** | |||||
| * 获得分享小程序的 | |||||
| * title | |||||
| * desc | |||||
| */ | |||||
| Http.get({ | |||||
| url: config.api.getWeapNote, | |||||
| data: { | |||||
| appId: config.weapp.AppId, | |||||
| } | |||||
| }) | |||||
| .then(res => { | |||||
| let weapNote = JSON.parse(res.data.weapNote); | |||||
| that.setData({ | |||||
| desc: weapNote.carpage.desc, | |||||
| title: weapNote.carpage.title | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err); | |||||
| }) | |||||
| // 登录 | |||||
| var scene = decodeURIComponent(options.scene); | |||||
| that.setData({ | |||||
| scene: scene | |||||
| }); | |||||
| if (app.globalData.token) { } else { | |||||
| // app.getLocation(); | |||||
| that.userLogin() | |||||
| } | } | ||||
| }).catch(err => { | |||||
| return | |||||
| }) | }) | ||||
| .then(res => { | |||||
| let weapNote = JSON.parse(res.data.weapNote); | |||||
| that.setData({ | |||||
| desc: weapNote.carpage.desc, | |||||
| title: weapNote.carpage.title | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err); | |||||
| }) | |||||
| // 登录 | |||||
| var scene = decodeURIComponent(options.scene); | |||||
| that.setData({ | |||||
| scene: scene | |||||
| }); | |||||
| if (app.globalData.token) { } else { | |||||
| // app.getLocation(); | |||||
| that.userLogin() | |||||
| } | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 用户登录 | * 用户登录 | ||||
| @@ -499,9 +545,18 @@ Page({ | |||||
| .catch(err => { }) | .catch(err => { }) | ||||
| }, | }, | ||||
| jumpToAdd: function () { | jumpToAdd: function () { | ||||
| wx.navigateTo({ | |||||
| url: `/pages/addPark/addPark?flags=managepalte` | |||||
| }); | |||||
| Http.get({ | |||||
| url: config.api.checkPhoneStatus, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/addPark/addPark?flags=managepalte` | |||||
| }); | |||||
| }).catch(err => { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=passCar`, | |||||
| }) | |||||
| }) | |||||
| }, | }, | ||||
| passc: function () { | passc: function () { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| @@ -13,7 +13,6 @@ Page({ | |||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| data: { | data: { | ||||
| mch_id: mch_id, | mch_id: mch_id, | ||||
| businessSwitch: businessSwitch, | businessSwitch: businessSwitch, | ||||
| goUrl: "", | goUrl: "", | ||||
| @@ -63,6 +62,7 @@ Page({ | |||||
| placeholder: '', | placeholder: '', | ||||
| userAvatarUrl: "", | userAvatarUrl: "", | ||||
| userName: "", | userName: "", | ||||
| ifSetUserInfo: false | |||||
| }, | }, | ||||
| suerService() { | suerService() { | ||||
| console.log("打开客服") | console.log("打开客服") | ||||
| @@ -107,14 +107,25 @@ Page({ | |||||
| url: config.api.checkPhoneStatus, | url: config.api.checkPhoneStatus, | ||||
| data: {} | data: {} | ||||
| }).then(res => { | }).then(res => { | ||||
| that.setData({ | |||||
| ifSetUserInfo: true | |||||
| }) | |||||
| return | return | ||||
| }).catch(err => { | }).catch(err => { | ||||
| wx.setStorageSync('ifSetUserInfo', 1) //手机号未授权 | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
| that.setData({ | |||||
| ifSetUserInfo: false | |||||
| }) | }) | ||||
| const ifSetUserInfo = wx.getStorageSync('ifSetUserInfo') | |||||
| if (ifSetUserInfo != 2) { | |||||
| wx.setStorageSync('ifSetUserInfo', 1) //手机号未授权 | |||||
| } | |||||
| // wx.navigateTo({ | |||||
| // url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
| // }) | |||||
| }) | }) | ||||
| }, | }, | ||||
| /* 判断是否授权*/ | /* 判断是否授权*/ | ||||
| userAuthorization() { | userAuthorization() { | ||||
| Http.get({ | Http.get({ | ||||
| @@ -138,15 +149,27 @@ Page({ | |||||
| * 跳转到成长值的页面 | * 跳转到成长值的页面 | ||||
| */ | */ | ||||
| gotograde: function () { | gotograde: function () { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/czdetail/czdetail', | |||||
| }) | |||||
| if (this.data.ifSetUserInfo) { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/czdetail/czdetail', | |||||
| }) | |||||
| } else { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| gotointegralmall: function () { | gotointegralmall: function () { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/integralmall/integraHistory/index', | |||||
| }) | |||||
| if (this.data.ifSetUserInfo) { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/integralmall/integraHistory/index', | |||||
| }) | |||||
| } else { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -265,11 +288,11 @@ Page({ | |||||
| console.log('cancel'); | console.log('cancel'); | ||||
| } | } | ||||
| if (res.confirm) { | if (res.confirm) { | ||||
| wx.setStorageSync('ifSetUserInfo', 2) // 已完成手机号授权 | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages3/setUserInfo/index', | url: '/pages3/setUserInfo/index', | ||||
| }) | }) | ||||
| } | } | ||||
| wx.setStorageSync('ifSetUserInfo', 2) // 已完成手机号授权 | |||||
| } | } | ||||
| }) | }) | ||||
| } | } | ||||
| @@ -13,12 +13,28 @@ | |||||
| </view> | </view> | ||||
| <view class="top-content" wx:if="{{ifStoreApp!=1}}"> | <view class="top-content" wx:if="{{ifStoreApp!=1}}"> | ||||
| <view class='user_title'> | <view class='user_title'> | ||||
| <view class="user-avatar" bindtap='gotoedit'> | |||||
| <view wx:if="{{!ifSetUserInfo}}" class="user-avatar" bindtap='gotoPhoneInfo'> | |||||
| <!-- <open-data class="open" type="userAvatarUrl"></open-data> --> | <!-- <open-data class="open" type="userAvatarUrl"></open-data> --> | ||||
| <image wx:if="{{userAvatarUrl.length>1}}" class="userAvatarUrl" bindtap="goSetAvatar" src="{{userAvatarUrl}}"></image> | <image wx:if="{{userAvatarUrl.length>1}}" class="userAvatarUrl" bindtap="goSetAvatar" src="{{userAvatarUrl}}"></image> | ||||
| <image wx:else class="userAvatarUrl" bindtap="goSetAvatar" src="https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"></image> | <image wx:else class="userAvatarUrl" bindtap="goSetAvatar" src="https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"></image> | ||||
| </view> | </view> | ||||
| <view class="user-name" bindtap='gotoedit'> | |||||
| <view wx:if="{{ifSetUserInfo}}" class="user-avatar" bindtap='gotoedit'> | |||||
| <!-- <open-data class="open" type="userAvatarUrl"></open-data> --> | |||||
| <image wx:if="{{userAvatarUrl.length>1}}" class="userAvatarUrl" bindtap="goSetAvatar" src="{{userAvatarUrl}}"></image> | |||||
| <image wx:else class="userAvatarUrl" bindtap="goSetAvatar" src="https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"></image> | |||||
| </view> | |||||
| <view wx:if="{{!ifSetUserInfo}}" class="user-name" bindtap='gotoPhoneInfo'> | |||||
| <!-- <open-data class="name" type="userNickName"></open-data> --> | |||||
| <p class="name">登录成为会员</p> | |||||
| <!-- 会员等级 --> | |||||
| <!-- <view class=' usre_level'style='background:{{levelBg}}'> | |||||
| <text class='chengzhang '>{{levelName}}</text> | |||||
| </view> --> | |||||
| </view> | |||||
| <view wx:if="{{ifSetUserInfo}}" class="user-name" bindtap='gotoedit'> | |||||
| <!-- <open-data class="name" type="userNickName"></open-data> --> | <!-- <open-data class="name" type="userNickName"></open-data> --> | ||||
| <p class="name">{{userName}}</p> | <p class="name">{{userName}}</p> | ||||
| <!-- 会员等级 --> | <!-- 会员等级 --> | ||||
| @@ -26,6 +42,7 @@ | |||||
| <text class='chengzhang '>{{levelName}}</text> | <text class='chengzhang '>{{levelName}}</text> | ||||
| </view> --> | </view> --> | ||||
| </view> | </view> | ||||
| <!-- --> | <!-- --> | ||||
| <view class="user_phone" wx:if="{{curPhone}}" style="margin-top:20rpx;" bindtap='gotoPhoneInfo'> | <view class="user_phone" wx:if="{{curPhone}}" style="margin-top:20rpx;" bindtap='gotoPhoneInfo'> | ||||
| <!-- <text class="my">我的手机号:</text> --> | <!-- <text class="my">我的手机号:</text> --> | ||||
| @@ -44,11 +61,14 @@ | |||||
| </navigator> | </navigator> | ||||
| </view> | </view> | ||||
| <view class="user_growth_box"> | <view class="user_growth_box"> | ||||
| <navigator url="/pages/specialcourtesy/specialcourtesy"> | |||||
| <navigator wx:if="{{ifSetUserInfo}}" url="/pages/specialcourtesy/specialcourtesy"> | |||||
| <image src="{{rqCode}}" class="RQcode"></image> | <image src="{{rqCode}}" class="RQcode"></image> | ||||
| </navigator> | </navigator> | ||||
| <view wx:if="{{!ifSetUserInfo}}"> | |||||
| <image src="{{rqCode}}" class="RQcode"></image> | |||||
| </view> | |||||
| <view class="memberBox"> | <view class="memberBox"> | ||||
| <view class="memberCode">会员码:{{userId}}</view> | |||||
| <view class="memberCode">会员码:{{ifSetUserInfo ? userId : '加入会员查看会员码,享受更多折扣优惠'}}</view> | |||||
| <view class="user-phone" bindtap='gotograde'> | <view class="user-phone" bindtap='gotograde'> | ||||
| <text class="my">我的成长值:{{score}}</text> | <text class="my">我的成长值:{{score}}</text> | ||||
| <!-- <text class="chengzhang_h"></text> --> | <!-- <text class="chengzhang_h"></text> --> | ||||
| @@ -56,6 +76,7 @@ | |||||
| <!-- <text class="my">更多成长值</text> --> | <!-- <text class="my">更多成长值</text> --> | ||||
| <text class="view" style='color:{{view}}'>更多成长值</text> | <text class="view" style='color:{{view}}'>更多成长值</text> | ||||
| </view> | </view> | ||||
| <view bindtap='gotointegralmall'> | <view bindtap='gotointegralmall'> | ||||
| <text class="integral">我的积分:{{credit}}</text> | <text class="integral">我的积分:{{credit}}</text> | ||||
| <text class="my my_line">|</text> | <text class="my my_line">|</text> | ||||
| @@ -231,6 +231,10 @@ Page({ | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/user' | url: '/index/user' | ||||
| }); | }); | ||||
| } else if (that.data.mineFlag == 'passCar') { | |||||
| wx.switchTab({ | |||||
| url: '/index/passCar' | |||||
| }); | |||||
| } else if (that.data.mineFlag == 'index') { | } else if (that.data.mineFlag == 'index') { | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: app.globalData.goHomeUrl | url: app.globalData.goHomeUrl | ||||
| @@ -243,7 +247,7 @@ Page({ | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/index/searchbar/detail/index?id=${that.data.id}` | url: `/pages/index/searchbar/detail/index?id=${that.data.id}` | ||||
| }) | }) | ||||
| } else { | |||||
| }else { | |||||
| wx.showToast({ | wx.showToast({ | ||||
| title: res.data.msg, | title: res.data.msg, | ||||
| icon: "success", | icon: "success", | ||||