Bläddra i källkod

[停车][修改]:[下拉刷新的修改]

tags/C.7.1.0
meo 6 år sedan
förälder
incheckning
9be3d1cf79
3 ändrade filer med 115 tillägg och 115 borttagningar
  1. +11
    -12
      ext.json
  2. +103
    -102
      pages/passCar/passCar.js
  3. +1
    -1
      project.config.json

+ 11
- 12
ext.json Visa fil

@@ -3,29 +3,28 @@
"attr": { "attr": {
"imgProxy": [ "imgProxy": [
{ {
"newUrl": "https://ciformall.youlane.cn/img",
"newUrl": "https://ctest.malls.iformall.com/img",
"orgUrl": "https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn" "orgUrl": "https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn"
}, },
{ {
"newUrl": "https://ciformall.youlane.cn/img1",
"newUrl": "https://ctest.malls.iformall.com/img1",
"orgUrl": "https://s3.cn-northwest-1.amazonaws.com.cn" "orgUrl": "https://s3.cn-northwest-1.amazonaws.com.cn"
}, },
{ {
"newUrl": "https://ciformall.youlane.cn/img2",
"newUrl": "https://ctest.malls.iformall.com/img2",
"orgUrl": "https://wx.qlogo.cn" "orgUrl": "https://wx.qlogo.cn"
} }
], ],
"configUrl": "https://ciformall.youlane.cn/C/api",
"configUrl": "https://ctest.malls.iformall.com/C/api",
"etcpAppId": "wx192b7d2e8dcbefd0", "etcpAppId": "wx192b7d2e8dcbefd0",
"socketUrl": "wss://mp.youlane.cn/W/ws",
"etcpVersion": "release", "etcpVersion": "release",
"etcpCallbackUrl": "https://ciformall.youlane.cn/api/carCallback/etcpPaidCallback",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback",
"ifHaveWebSocket": "0", "ifHaveWebSocket": "0",
"ifHaveCarModular": "1" "ifHaveCarModular": "1"
}, },
"name": "富茂客官开发",
"weappId": "wxea71200db93d756b",
"appVersion": "C.4.5.106"
"name": "富茂客",
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0"
}, },
"debug": false, "debug": false,
"tabBar": { "tabBar": {
@@ -61,10 +60,10 @@
"window": { "window": {
"backgroundTextStyle": "dark", "backgroundTextStyle": "dark",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "WeChat",
"navigationBarBackgroundColor": "#fff"
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF"
}, },
"extAppid": "wxea71200db93d756b",
"extAppid": "wx649b3be73c1afe47",
"extEnable": true, "extEnable": true,
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {


+ 103
- 102
pages/passCar/passCar.js Visa fil

@@ -36,7 +36,7 @@ Page({
/** /**
* 车牌轮播滑动 * 车牌轮播滑动
*/ */
onSlideChangeEnd: function(e) {
onSlideChangeEnd: function (e) {
var that = this; var that = this;
/** /**
* 获得当前的车牌号码 * 获得当前的车牌号码
@@ -48,13 +48,13 @@ Page({
/** /**
* 获得停车费用 * 获得停车费用
*/ */
if (that.data.scroll && app.globalData.etcpToken) {
if (that.data.scroll) {
that.getStopFee(listCardNum); that.getStopFee(listCardNum);
} }
}, },
//停车费用为0 //停车费用为0
paySuccess: function() {
paySuccess: function () {
wx.showModal({ wx.showModal({
title: '支付成功', title: '支付成功',
content: '请尽快离场', content: '请尽快离场',
@@ -62,15 +62,15 @@ Page({
}) })
}, },
gotomange: function() {
gotomange: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/managelicenseplate/managelicenseplate', url: '/pages/managelicenseplate/managelicenseplate',
}) })
}, },
bindfail: function(res) {
bindfail: function (res) {
console.log(res) console.log(res)
}, },
gotoetcp: function() {
gotoetcp: function () {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: that.data.etcpAppId, appId: that.data.etcpAppId,
extraData: this.data.extraData, extraData: this.data.extraData,
@@ -78,19 +78,19 @@ Page({
path: "pages/main/main", path: "pages/main/main",
}) })
}, },
showquan: function() {
showquan: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/passCar/couponList/couponList', url: '/pages/passCar/couponList/couponList',
}) })
}, },
gotodetail: function(e) {
gotodetail: function (e) {
wx.showModal({ wx.showModal({
title: '缴费规则', title: '缴费规则',
content: e.target.dataset.rule, content: e.target.dataset.rule,
showCancel: false, showCancel: false,
}) })
}, },
onShow: function(options) {
onShow: function (options) {
var that = this; var that = this;
that.setData({ that.setData({
etcpAppId: extConfig.attr.etcpAppId, etcpAppId: extConfig.attr.etcpAppId,
@@ -109,9 +109,7 @@ Page({
* 才会进行券和车牌的绑定 * 才会进行券和车牌的绑定
*/ */
if (wx.getStorageSync("chosed") && that.data.quanid) { if (wx.getStorageSync("chosed") && that.data.quanid) {
if (app.globalData.etcpToken){
that.getStopFee(that.data.listCardNum);
}
that.getStopFee(that.data.listCardNum);
that.bindCoupon(that.data.quanid); that.bindCoupon(that.data.quanid);
wx.setStorage({ wx.setStorage({
key: 'chosed', key: 'chosed',
@@ -134,7 +132,7 @@ Page({
}); });
} }
}, },
onLoad: function(options) {
onLoad: function (options) {
var that = this; var that = this;
/** /**
* 获得分享小程序的 * 获得分享小程序的
@@ -142,11 +140,11 @@ Page({
* desc * desc
*/ */
Http.get({ Http.get({
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
.then(res => { .then(res => {
let weapNote = JSON.parse(res.data.weapNote); let weapNote = JSON.parse(res.data.weapNote);
that.setData({ that.setData({
@@ -162,7 +160,7 @@ Page({
that.setData({ that.setData({
scene: scene scene: scene
}); });
if (app.globalData.token) {} else {
if (app.globalData.token) { } else {
// app.getLocation(); // app.getLocation();
that.userLogin() that.userLogin()
} }
@@ -170,7 +168,7 @@ Page({
/** /**
* 用户登录 * 用户登录
*/ */
userLogin: function() {
userLogin: function () {
var that = this; var that = this;
// 登录 // 登录
wx.login({ wx.login({
@@ -178,7 +176,7 @@ Page({
code code
}) => { }) => {
wx.getSystemInfo({ wx.getSystemInfo({
success: function(res) {
success: function (res) {
that.setData({ that.setData({
systemInfo: JSON.stringify(res) systemInfo: JSON.stringify(res)
}) })
@@ -203,9 +201,9 @@ Page({
}; };
} }
Http.post({ Http.post({
url: config.api.login,
data: usrdata
})
url: config.api.login,
data: usrdata
})
.then(res => { .then(res => {
app.globalData.token = res.data.token; app.globalData.token = res.data.token;
Http.setToken(res.data.token); Http.setToken(res.data.token);
@@ -218,7 +216,7 @@ Page({
data: {} data: {}
}); });
}) })
.then(res => {})
.then(res => { })
.catch(err => { .catch(err => {
if (err.code == 11004) { if (err.code == 11004) {
// 用户昵称未授权 // 用户昵称未授权
@@ -239,28 +237,28 @@ Page({
/** /**
* 检查用户是否有车 * 检查用户是否有车
*/ */
checkUserCarStatus: function() {
checkUserCarStatus: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.userCarCount,
data: {}
}).then(res => {
if (res.data > 0) {
// 用户名下有车
app.globalData.phone = res.data.phone;
app.globalData.supportCar = true;
// 共同登录
that.userCarLogin();
}
})
.catch(err => {})
url: config.api.userCarCount,
data: {}
}).then(res => {
if (res.data > 0) {
// 用户名下有车
app.globalData.phone = res.data.phone;
app.globalData.supportCar = true;
// 共同登录
that.userCarLogin();
}
})
.catch(err => { })
}, },
jumpToAdd: function() {
jumpToAdd: function () {
wx.navigateTo({ wx.navigateTo({
url: `/pages/addPark/addPark?flags=managepalte` url: `/pages/addPark/addPark?flags=managepalte`
}); });
}, },
passc: function() {
passc: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/ques/ques', url: '/pages/ques/ques',
}) })
@@ -270,7 +268,7 @@ Page({
/** /**
* 券绑定车牌 * 券绑定车牌
*/ */
bindCoupon: function(quanid) {
bindCoupon: function (quanid) {
var that = this; var that = this;
/** /**
* etcp * etcp
@@ -288,9 +286,9 @@ Page({
}; };
var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData; var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
Http.post({ Http.post({
url: config.api.getCarCoupon,
data: postCouponData
})
url: config.api.getCarCoupon,
data: postCouponData
})
.then(res => { .then(res => {
that.initUsrCarList(); that.initUsrCarList();
}) })
@@ -307,7 +305,7 @@ Page({
/** /**
* 选择优惠券 * 选择优惠券
*/ */
gotoquan: function() {
gotoquan: function () {
let that = this; let that = this;
if (that.data.quanid) { if (that.data.quanid) {
wx.navigateTo({ wx.navigateTo({
@@ -325,17 +323,17 @@ Page({
getList() { getList() {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
data: {
pageNum: 1,
pageSize: 8,
couponOrderStatus: 0
}
}).then(res => {
that.setData({
couponList: res.data.list
});
})
url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
data: {
pageNum: 1,
pageSize: 8,
couponOrderStatus: 0
}
}).then(res => {
that.setData({
couponList: res.data.list
});
})
.catch(err => { .catch(err => {
console.log(err) console.log(err)
}) })
@@ -345,7 +343,7 @@ Page({
/** /**
* 共同登录 * 共同登录
*/ */
init: function(carNumber) {
init: function (carNumber) {
var that = this; var that = this;
app.parkInitCallback = token => { app.parkInitCallback = token => {
that.initPark(); that.initPark();
@@ -355,9 +353,9 @@ Page({
* 判断是否授权手机号 * 判断是否授权手机号
*/ */
Http.get({ Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => { .then(res => {
Http.post({ Http.post({
url: config.api.carInit, url: config.api.carInit,
@@ -407,7 +405,7 @@ Page({
} }
}, },
bindCar: function(carNum) {
bindCar: function (carNum) {
var that = this; var that = this;
// ETCP // ETCP
var etcpData = { var etcpData = {
@@ -419,9 +417,9 @@ Page({
}; };
var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData; var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
Http.post({ Http.post({
url: config.api.bindCar,
data: postData
})
url: config.api.bindCar,
data: postData
})
.then(res => { .then(res => {
that.setData({ that.setData({
addCar: null addCar: null
@@ -431,7 +429,7 @@ Page({
title: "提示", title: "提示",
showCancel: false, showCancel: false,
content: "绑车牌成功!", content: "绑车牌成功!",
success: function() {}
success: function () { }
}); });
}) })
.catch(error => { .catch(error => {
@@ -439,19 +437,19 @@ Page({
title: "提示", title: "提示",
showCancel: false, showCancel: false,
content: error.data.message, content: error.data.message,
success: function() {}
success: function () { }
}); });
}); });
}, },
/** /**
* 车场信息获取 * 车场信息获取
*/ */
initPark: function() {
initPark: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getParkInfo,
data: {}
})
url: config.api.getParkInfo,
data: {}
})
.then(res => { .then(res => {
that.setData({ that.setData({
park: res.data park: res.data
@@ -471,11 +469,11 @@ Page({
/** /**
* 车场状态获取 * 车场状态获取
*/ */
getParkStatus: function() {
getParkStatus: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getParkStatus,
})
url: config.api.getParkStatus,
})
.then(res => { .then(res => {
console.log(res) console.log(res)
}) })
@@ -492,30 +490,30 @@ Page({
/** /**
* 绑定车获取 * 绑定车获取
*/ */
initUsrCarList: function(flag) {
initUsrCarList: function (flag) {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getUserCarList,
data: {}
}).then(res => {
url: config.api.getUserCarList,
data: {}
}).then(res => {
that.setData({
carList: res.data
});
/**
* flag ==flags
* 表示从首页onShow进来的
*/
if (flag == "flags" && res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
that.setData({ that.setData({
carList: res.data
});
if (res.data&&res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
that.setData({
listCardNum: listCardNum,
current: 0
})
/**
* 获得停车费用
*/
if (app.globalData.etcpToken){
that.getStopFee(listCardNum);
}
}
})
listCardNum: listCardNum
})
/**
* 获得停车费用
*/
that.getStopFee(listCardNum);
}
})
.catch(err => { .catch(err => {
wx.showToast({ wx.showToast({
title: err.message, title: err.message,
@@ -529,20 +527,20 @@ Page({
/** /**
* 获得停车费用修改 * 获得停车费用修改
*/ */
getStopFee: function(carNumber) {
getStopFee: function (carNumber) {
let that = this; let that = this;
let postData = let postData =
app.globalData.parkVendor == 1 ? { app.globalData.parkVendor == 1 ? {
etcpToken: app.globalData.etcpToken, etcpToken: app.globalData.etcpToken,
carNumber: carNumber carNumber: carNumber
} : { } : {
carNumber: carNumber,
outCarId: outCarId
};
carNumber: carNumber,
outCarId: outCarId
};
Http.post({ Http.post({
url: config.api.getCarStopFee,
data: postData
})
url: config.api.getCarStopFee,
data: postData
})
.then(res => { .then(res => {
console.log(res) console.log(res)
var extraDataStr = { var extraDataStr = {
@@ -576,9 +574,12 @@ Page({
/** /**
* 下拉刷新 * 下拉刷新
*/ */
onPullDownRefresh: function(e) {
onPullDownRefresh: function (e) {
let that = this; let that = this;
that.initUsrCarList("flags"); that.initUsrCarList("flags");
that.setData({
current:0
})
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
} }
}); });

+ 1
- 1
project.config.json Visa fil

@@ -14,7 +14,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.5.0", "libVersion": "2.5.0",
"appid": "wxb11603577a84a86d",
"appid": "wxfa336cad86ed598d",
"projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",


Laddar…
Avbryt
Spara