瀏覽代碼

upload

newCard
HolyKnightIX 2 年之前
父節點
當前提交
3c5744ad47
共有 4 個檔案被更改,包括 209 行新增106 行删除
  1. +145
    -90
      index/passCar.js
  2. +34
    -11
      index/user.js
  3. +25
    -4
      index/user.wxml
  4. +5
    -1
      pages/getphoneInfo/index.js

+ 145
- 90
index/passCar.js 查看文件

@@ -253,8 +253,17 @@ Page({
},

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) {
@@ -283,14 +292,32 @@ Page({
}
},
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 () {
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) {
this.setData({
goHomeUrl: app.globalData.goHomeUrl
})
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 2
})
}
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({
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 {
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 () {
console.log(111)
@@ -376,39 +416,45 @@ Page({
})
},
onLoad: function (options) {

var that = this;
/**
* 获得分享小程序的
* title
* desc
*/

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 => { })
},
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 () {
wx.navigateTo({


+ 34
- 11
index/user.js 查看文件

@@ -13,7 +13,6 @@ Page({
* 页面的初始数据
*/
data: {

mch_id: mch_id,
businessSwitch: businessSwitch,
goUrl: "",
@@ -63,6 +62,7 @@ Page({
placeholder: '',
userAvatarUrl: "",
userName: "",
ifSetUserInfo: false
},
suerService() {
console.log("打开客服")
@@ -107,14 +107,25 @@ Page({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
that.setData({
ifSetUserInfo: true
})
return
}).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() {
Http.get({
@@ -138,15 +149,27 @@ Page({
* 跳转到成长值的页面
*/
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 () {
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');
}
if (res.confirm) {
wx.setStorageSync('ifSetUserInfo', 2) // 已完成手机号授权
wx.navigateTo({
url: '/pages3/setUserInfo/index',
})
}
wx.setStorageSync('ifSetUserInfo', 2) // 已完成手机号授权
}
})
}


+ 25
- 4
index/user.wxml 查看文件

@@ -13,12 +13,28 @@
</view>
<view class="top-content" wx:if="{{ifStoreApp!=1}}">
<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> -->
<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 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> -->
<p class="name">{{userName}}</p>
<!-- 会员等级 -->
@@ -26,6 +42,7 @@
<text class='chengzhang '>{{levelName}}</text>
</view> -->
</view>

<!-- -->
<view class="user_phone" wx:if="{{curPhone}}" style="margin-top:20rpx;" bindtap='gotoPhoneInfo'>
<!-- <text class="my">我的手机号:</text> -->
@@ -44,11 +61,14 @@
</navigator>
</view>
<view class="user_growth_box">
<navigator url="/pages/specialcourtesy/specialcourtesy">
<navigator wx:if="{{ifSetUserInfo}}" url="/pages/specialcourtesy/specialcourtesy">
<image src="{{rqCode}}" class="RQcode"></image>
</navigator>
<view wx:if="{{!ifSetUserInfo}}">
<image src="{{rqCode}}" class="RQcode"></image>
</view>
<view class="memberBox">
<view class="memberCode">会员码:{{userId}}</view>
<view class="memberCode">会员码:{{ifSetUserInfo ? userId : '加入会员查看会员码,享受更多折扣优惠'}}</view>
<view class="user-phone" bindtap='gotograde'>
<text class="my">我的成长值:{{score}}</text>
<!-- <text class="chengzhang_h"></text> -->
@@ -56,6 +76,7 @@
<!-- <text class="my">更多成长值</text> -->
<text class="view" style='color:{{view}}'>更多成长值</text>
</view>
<view bindtap='gotointegralmall'>
<text class="integral">我的积分:{{credit}}</text>
<text class="my my_line">|</text>


+ 5
- 1
pages/getphoneInfo/index.js 查看文件

@@ -231,6 +231,10 @@ Page({
wx.switchTab({
url: '/index/user'
});
} else if (that.data.mineFlag == 'passCar') {
wx.switchTab({
url: '/index/passCar'
});
} else if (that.data.mineFlag == 'index') {
wx.switchTab({
url: app.globalData.goHomeUrl
@@ -243,7 +247,7 @@ Page({
wx.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${that.data.id}`
})
} else {
}else {
wx.showToast({
title: res.data.msg,
icon: "success",


Loading…
取消
儲存