瀏覽代碼

停车模块更新

shopAdd
HolyKnightIX 2 年之前
父節點
當前提交
23c568fa0e
共有 15 個檔案被更改,包括 470 行新增35 行删除
  1. +2
    -0
      app.json
  2. +4
    -0
      config/config.js
  3. +26
    -24
      ext.json
  4. +63
    -3
      index/passCar.js
  5. +17
    -6
      index/passCar.wxml
  6. +2
    -1
      pages/coupon/detail/index.wxml
  7. +125
    -0
      pages/passCar/showDetail/showDetail.js
  8. +9
    -0
      pages/passCar/showDetail/showDetail.json
  9. +43
    -0
      pages/passCar/showDetail/showDetail.wxml
  10. +8
    -0
      pages/passCar/showDetail/showDetail.wxss
  11. +119
    -0
      pages/passCar/showList/showList.js
  12. +9
    -0
      pages/passCar/showList/showList.json
  13. +14
    -0
      pages/passCar/showList/showList.wxml
  14. +28
    -0
      pages/passCar/showList/showList.wxss
  15. +1
    -1
      project.config.json

+ 2
- 0
app.json 查看文件

@@ -46,6 +46,8 @@
"pages/orderquanma/index",
"pages/passCar/couponList/couponList",
"pages/passCar/couponDetail/couponDetail",
"pages/passCar/showList/showList",
"pages/passCar/showDetail/showDetail",
"pages/managelicenseplate/managelicenseplate",
"pages/payrule/payrule",
"pages/grade/grade",


+ 4
- 0
config/config.js 查看文件

@@ -180,6 +180,10 @@ var config = {
* 联合登录
*/
carInit: "/car/init",
/**
* 停车支付订单列表
*/
carPayOrderList: "/car/payOrderList",
/**
* 绑车牌
*/


+ 26
- 24
ext.json 查看文件

@@ -2,44 +2,35 @@
"ext": {
"attr": {
"car": {
"tjd": {
"payPath": "",
"tjdAppId": "wx6945d1bda68d7993"
},
"etcp": {
"payPath": "pages/pay/order-pay-open/main",
"etcpAppId": "wxc07f9d67923d676d",
"etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback"
},
"bolink": {
"payPath": "pages/park/park",
"bolinkAppId": "wxbd08b4baa10fcc1d"
},
"version": "release"
"etcpAppId": "wx192b7d2e8dcbefd0",
"etcpVersion": "release",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback"
}
},
"mchId": "1604439800",
"imgProxy": [
{
"newUrl": "https://c.malls.iformall.com/img",
"newUrl": "https://ctest.malls.iformall.com/img",
"orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com"
},
{
"newUrl": "https://c.malls.iformall.com/img1",
"newUrl": "https://ctest.malls.iformall.com/img1",
"orgUrl": "https://formall.oss-accelerate.aliyuncs.com"
},
{
"newUrl": "https://c.malls.iformall.com/img2",
"newUrl": "https://ctest.malls.iformall.com/img2",
"orgUrl": "https://wx.qlogo.cn"
}
],
"configUrl": "https://c.malls.iformall.com/C/api",
"ifStoreApp": "0",
"configUrl": "https://ctest.malls.iformall.com/C/api",
"businessSwitch": "1",
"ifHaveWebSocket": "0",
"ifHaveCarModular": "0"
"ifHaveCarModular": "1"
},
"name": "金茂悦茂邻荟",
"weappId": "wx7c9c7122a91946a7",
"appVersion": "C.5.1.1"
"name": "金泸商务",
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0"
},
"debug": false,
"tabBar": {
@@ -75,7 +66,8 @@
"selectedIconPath": "assets/images/user-a.png"
}
],
"custom": true
"color": "#abb1be",
"selectedColor": "#b2743d"
},
"window": {
"backgroundTextStyle": "dark",
@@ -83,7 +75,17 @@
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF"
},
"extAppid": "wx7c9c7122a91946a7",
"plugins": {
"auto-points-plugin": {
"version": "1.3.0",
"provider": "wxfab2bf944bfc4da6"
},
"live-player-plugin": {
"version": "1.3.4",
"provider": "wx2b03c6e691cd7370"
}
},
"extAppid": "wx649b3be73c1afe47",
"extEnable": true,
"permission": {
"scope.userLocation": {


+ 63
- 3
index/passCar.js 查看文件

@@ -54,6 +54,7 @@ Page({
generalPayPath: '',
generalExtraData: {},
goHomeUrl: "",
supportPay: ""
},
getMoreList(e) {
let totalNum = this.data.ticketList.length;
@@ -192,6 +193,33 @@ Page({
}
},

callPay(data) {
wx.requestPayment({
timeStamp: data.timeStamp,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType ? data.signType : "MD5",
paySign: res.data.paySign,
success: res => {
wx.showLoading({
title: '订单正在处理中...',
})
this.showList()
},
fail: res => {
wx.hideLoading();
wx.showToast({
title: '支付失败',
icon: 'error'
})
/**
* 支付失败,需要更新订单的状态
*/
},
complete: res => { }
});
},

//停车费用为0
paySuccess: function () {
wx.showModal({
@@ -201,6 +229,22 @@ Page({
})
},

// supportPay等于1时
goToPay() {
Http.post({
url: '/car/createPayOrder',
data: {
carNumber: this.data.listCardNum,
carFee: String(this.data.stopFees.remainingFee * 100)
}
}).then(res => {
const data = res.data
this.callPay(data)
}).catch(err => {

})
},

gotomange: function () {
wx.navigateTo({
url: '/pages/managelicenseplate/managelicenseplate',
@@ -236,6 +280,13 @@ Page({
url: '/pages/passCar/couponList/couponList',
})
},

showList: function () {
wx.navigateTo({
url: '/pages/passCar/showList/showList',
})
},

gotodetail: function (e) {
wx.showModal({
title: '缴费规则',
@@ -631,6 +682,15 @@ Page({
if (res.data.token) {
app.globalData.etcpToken = res.data.token;
}
if (res.data.supportPay && res.data.supportPay == 1) {
that.setData({
supportPay: 1
})
} else {
that.setData({
supportPay: 0
})
}
/**
* 获得停车费用
*/
@@ -912,7 +972,8 @@ Page({
},
timecha: res.data.duration
});
} else {
} else { // *#06#

// var extraDataStr = {
// params: {
// token: app.globalData.etcpToken,
@@ -934,8 +995,7 @@ Page({
generalAppId: res.data.appId,
generalPayPath: res.data.payPath,
generalExtraData: res.data.extraData,
extraDataFlag: JSON.stringify(res.data.extraData),

extraDataFlag: JSON.stringify(res.data.extraData)
});
console.log(that.data.extraDataFlag, "123456789")
}


+ 17
- 6
index/passCar.wxml 查看文件

@@ -60,28 +60,28 @@
系统提示:
</view> -->
<!-- 停车费用大于0 etcp -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==1}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==1&&supportPay!=1}}">
<navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{etcpAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}">
立即支付
</navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view>
<!-- 停车费用大于0 tjd -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==2}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==2&&supportPay!=1}}">
<navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{tjdAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}">
立即支付
</navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view>
<!-- 停车费用大于0 bolink -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==5}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==5&&supportPay!=1}}">
<navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{bolinkAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}">
立即支付
</navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor5" bindtap='gotoCarMini'>立即支付</view>
</view>
<!-- 通用停车 -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag!='{}'}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag!='{}'&&supportPay!=1}}">
<navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" extra-data='{{generalExtraData}}' version="{{carMiniVersion}}">
立即支付
</navigator>
@@ -89,7 +89,7 @@
</view>


<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag=='{}'}}">
<view class="buy-view" wx:if="{{stopFees.orderId && stopFees.remainingFee>0 && parkVendor!=1 && parkVendor!=2 && parkVendor!=3 && parkVendor!=4 && parkVendor!=5 && extraDataFlag=='{}' && supportPay!=1}}">
<navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" version="{{carMiniVersion}}">
立即支付
</navigator>
@@ -97,7 +97,10 @@
</view>

<!-- 停车费用为0 -->
<view wx:if="{{stopFees.remainingFee==0}}" class='buy' bindtap='paySuccess'>立即支付</view>
<!-- // && stopFees.remainingFee>0 -->
<view wx:if="{{supportPay && supportPay==1}}" class='buy' bindtap='goToPay'>立即支付</view>

<!-- <view wx:if="{{stopFees.remainingFee==0}}" class='buy' bindtap='paySuccess'>立即支付</view> -->
</view>

<!-- 没有车牌的时候显示 -->
@@ -109,6 +112,14 @@
<text class='carNumber'>车辆入场后,才能绑车牌</text>
</view>
<view class='bottonBox'>
<view class='textStyle' bindtap='showList'>
<image src='{{tingcheHr}}'></image>
我的支付订单
<view class='detail'>
<image src='{{jianUrl}}'></image>
</view>
</view>

<view class='textStyle' bindtap='showquan'>
<image src='{{tingcheHr}}'></image>
我的停车券


+ 2
- 1
pages/coupon/detail/index.wxml 查看文件

@@ -164,7 +164,8 @@
<text class='btnTxt'>首页</text>
</button>
<button form-type="submit" disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.type!=11&&data.type!=8&&data.type!=50&&data.type!=51&&priceAndStockObj.salePrice/100!=0&&priceAndStockObj.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}">
<text class='txt'>{{priceAndStockObj.salePrice/100}}元</text>马上购买</button>
<text class='txt'>{{priceAndStockObj.salePrice/100}}元</text>马上购买
</button>
<button wx:if="{{data.type==11&&priceAndStockObj.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" data-shippingtype="2" class="home">配送到家
</button>
<button wx:if="{{data.type==11&&priceAndStockObj.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" data-shippingtype="1" class="arrive">到店自提


+ 125
- 0
pages/passCar/showDetail/showDetail.js 查看文件

@@ -0,0 +1,125 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
let config = require("../../../config/config.js");
let Http = require("../../../utils/HttpBasics");
const util = require("../../../utils/util");
let app = getApp();
const imgurl = require("../../../utils/imgurl");
Page({

/**
* 页面的初始数据
*/
data: {
navigationBarHeight,
detail: {}
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const detail = JSON.parse(options.item)
detail.payTime = this.timestampToTime(detail.payTime)
detail.createTime = this.timestampToTime(detail.createTime)
detail.updateTime = this.timestampToTime(detail.updateTime)
this.setData({
detail: detail
})
},

/**
* @description 根据时间戳获取时间
* @param {*} timestamp 必传,number类型,时间戳数据(10位及以下,10位至13位)
* @param {*} format 选传,string类型,提供以下时间格式:YYYY-MM-DD hh:mm:ss、YYYY/MM/DD hh:mm:ss、YYYY.MM.DD hh:mm:ss、YYYY MM DD hh:mm:ss、YYYY年MM月DD日 hh:mm:ss、YYYY-MM-DD、YYYY/MM/DD、YYYY.MM.DD、YYYY MM DD、YYYY年MM月DD日;若不传,则默认为:YYYY-MM-DD
* @returns 根据要求的时间格式
* @version V 1.0, Created by YWQ, 2022.10.20
*/
timestampToTime(timestamp, format) {
//时间戳为10位需*1000,时间戳为13位不需乘1000
const length = timestamp.length
if (length <= 10) {
var date = new Date(timestamp * 1000)
} else {
var date = new Date(timestamp)
}
let Y = String(date.getFullYear())
let M = String(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
let D = String(date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
let h = String(date.getHours() + 1 < 10 ? '0' + (date.getHours()) : date.getHours())
let m = String(date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
let s = String(date.getSeconds() + 1 < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
// return Y + M + D + h + m + s
if (format == "YYYY-MM-DD hh:mm:ss") {
return Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY/MM/DD hh:mm:ss") {
return Y + "/" + M + "/" + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY.MM.DD hh:mm:ss") {
return Y + "." + M + "." + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY MM DD hh:mm:ss") {
return Y + " " + M + " " + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY年MM月DD日 hh:mm:ss") {
return Y + "年" + M + "月" + D + "日" + " " + h + ":" + m + ":" + s
} else if (format == "YYYY-MM-DD") {
return Y + "-" + M + "-" + D
} else if (format == "YYYY/MM/DD") {
return Y + "/" + M + "/" + D
} else if (format == "YYYY.MM.DD") {
return Y + "." + M + "." + D
} else if (format == "YYYY MM DD") {
return Y + " " + M + " " + D
} else if (format == "YYYY年MM月DD日") {
return Y + "年" + M + "月" + D + "日"
} else {
return Y + "-" + M + "-" + D
}
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide() {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload() {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage() {

}
})

+ 9
- 0
pages/passCar/showDetail/showDetail.json 查看文件

@@ -0,0 +1,9 @@
{
"usingComponents": {
"i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index",
"navbar": "../../../components/navbar/navbar"
},
"navigationBarTitleText": "支付订单详情",
"navigationBarBackgroundColor": "#F4F5F9"
}

+ 43
- 0
pages/passCar/showDetail/showDetail.wxml 查看文件

@@ -0,0 +1,43 @@
<navbar back home text="支付订单详情"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<view class="detail">
<view>
车牌号:{{detail.carNumber}}
</view>
<view>
支付金额:{{detail.payAmount}}
</view>
<view>
支付时间:{{detail.payTime}}
</view>
<view>
创建时间:{{detail.createTime}}
</view>
<view>
更新时间:{{detail.updateTime}}
</view>
<view>
微信生成的订单号:{{detail.transactionId}}
</view>
<view>
车场订单号:{{detail.parkOrderNo}}
</view>
<view>
商户收款账户:{{detail.merchantAccount}}
</view>
<view>
商户编号:{{detail.merchantId}}
</view>
<view>
商户名称:{{detail.merchantName}}
</view>
<view>
是否已通知车场:{{detail.parkNotify == 1 ? '是' : '否'}}
</view>
<view>
通知失败原因:{{detail.notifyFailReason}}
</view>
<view>
通知重试次数:{{detail.notifyCount}}
</view>
</view>

+ 8
- 0
pages/passCar/showDetail/showDetail.wxss 查看文件

@@ -0,0 +1,8 @@
/* pages/passCar/showDetail/showDetail.wxss */
.detail {
padding: 40rpx;
}

.detail view {
margin-bottom: 50rpx;
}

+ 119
- 0
pages/passCar/showList/showList.js 查看文件

@@ -0,0 +1,119 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
let config = require("../../../config/config.js");
let Http = require("../../../utils/HttpBasics");
const util = require("../../../utils/util");
let app = getApp();
const imgurl = require("../../../utils/imgurl");
Page({

/**
* 页面的初始数据
*/
data: {
navigationBarHeight,
carPayOrderList: [],
pageNum: '1'
},

getList(pageNum) {
const that = this
Http.get({
url: config.api.carPayOrderList + `?pageNum=${pageNum}&pageSize=10`,
}).then(res => {
console.log(res, 'res');
if (pageNum == 1) {
const tempArr = res.data.list
tempArr.forEach(item => {
item.payAmount = this.getPayNumber(item.payAmount)
})
that.setData({
carPayOrderList: res.data.list
})
} else {
const tempArr = that.data.carPayOrderList
res.data.list.forEach(item => {
item.payAmount = this.getPayNumber(item.payAmount)
tempArr.push(item)
})
that.setData({
carPayOrderList: tempArr
})
}

}).catch(err => {

})
},

getPayNumber(num) {
return (num / 100).toFixed(2) + "元"
},

goDetial(e) {
const item = JSON.stringify(e.currentTarget.dataset.item)
wx.navigateTo({
url: `/pages/passCar/showDetail/showDetail?item=${item}`,
})
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList(this.data.pageNum)
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide() {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload() {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
const that = this;
that.data.pageNum++;
that.setData({
pageNum: that.data.pageNum
});
that.getList(that.data.pageNum);
},

/**
* 用户点击右上角分享
*/
onShareAppMessage() {

}
})

+ 9
- 0
pages/passCar/showList/showList.json 查看文件

@@ -0,0 +1,9 @@
{
"usingComponents": {
"i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index",
"navbar": "../../../components/navbar/navbar"
},
"navigationBarTitleText": "支付订单",
"navigationBarBackgroundColor": "#F4F5F9"
}

+ 14
- 0
pages/passCar/showList/showList.wxml 查看文件

@@ -0,0 +1,14 @@
<navbar back home text="支付订单"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<view class="list">
<view class="item" wx:for="{{carPayOrderList}}" wx:key="index">
<view data-item="{{item}}" bindtap="goDetial">
<view class="child">车牌号:{{item.carNumber}}</view>
<view class="child">支付金额:{{item.payAmount}}</view>
<view>支付时间:{{item.payTime}}</view>
<view class="detail">
查看详情
</view>
</view>
</view>
</view>

+ 28
- 0
pages/passCar/showList/showList.wxss 查看文件

@@ -0,0 +1,28 @@
/* pages/passCar/showList.wxss */
page {
background-color: #dfdfdf;
}

.list {

padding: 40rpx;
}

.list .item {
position: relative;
background-color: #fff;
margin-bottom: 40rpx;
border-radius: 20rpx;
padding: 20rpx;
}

.list .item .child {
margin-bottom: 20rpx;
}

.list .item .detail {
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
}

+ 1
- 1
project.config.json 查看文件

@@ -34,7 +34,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.11.2",
"appid": "wx453ae0d37f3550d0",
"appid": "wxfa336cad86ed598d",
"projectname": "C",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},


Loading…
取消
儲存