|
@@ -34,7 +34,7 @@
|
|
|
</view>
|
|
|
<view class="content-nav-item-icon-text">停车缴费</view>
|
|
|
</view>
|
|
|
- <view class="content-nav-item" @click="$refs.uToast.show({title: '建设中'})">
|
|
|
+ <view class="content-nav-item" @click="openPage('pages/favourableActivity/favourableActivity')">
|
|
|
<view class="content-nav-item-icon-wrap">
|
|
|
<u-image src="../../static/img/index-content-nav-02.png" width="95rpx" height="95rpx" mode="heightFix"></u-image>
|
|
|
</view>
|
|
@@ -168,6 +168,27 @@
|
|
|
知道了
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
+ <!-- 缴费方式-->
|
|
|
+ <u-modal
|
|
|
+ v-model="payWayPop"
|
|
|
+ :title-style="{color: '#404040'}"
|
|
|
+ title="缴费方式"
|
|
|
+ :show-confirm-button="false"
|
|
|
+ :show-cancel-button="false">
|
|
|
+ <view class="slot-content">
|
|
|
+ <view class="pay-way">
|
|
|
+ <view class="pay-way-item" @click="gyBankPay">
|
|
|
+ <image src="../../static/img/gy-bank-pay-icon.png" mode=""></image>
|
|
|
+ <view>贵州银行</view>
|
|
|
+ </view>
|
|
|
+ <view class="pay-way-item" @click="wechatPay">
|
|
|
+ <image src="../../static/img/wechat-pay-icon.png" mode=""></image>
|
|
|
+ <view>微信支付</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <button class="pay-way-close-btn" @click="payWayPop = false">关闭</button>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
<u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -209,7 +230,11 @@
|
|
|
],
|
|
|
contractStatus:'',
|
|
|
vehicleId:'',
|
|
|
- recordList:[]
|
|
|
+ recordList:[],
|
|
|
+ // 支付方式
|
|
|
+ payWayPop: false,
|
|
|
+ // 订单号
|
|
|
+ curOrderList: []
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -296,31 +321,34 @@
|
|
|
});
|
|
|
},
|
|
|
goPay(orderId){
|
|
|
- let orderList=[];
|
|
|
- orderList.push(orderId);
|
|
|
- this.$u.api.payGzbank({orderList: orderList}).then(res=>{
|
|
|
- let payUrl = res.data.url;
|
|
|
- this.currentPayUrl=encodeURIComponent(res.data.url);
|
|
|
- // return;
|
|
|
- this.$u.route({
|
|
|
- url: 'pages/payLists/pay',
|
|
|
- params: {
|
|
|
- currentPayUrl:this.currentPayUrl
|
|
|
- }
|
|
|
- });
|
|
|
- }).catch(err=>{
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: err.msg,
|
|
|
- type: 'error',
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- // this.$u.route({
|
|
|
- // url: 'pages/payPage/payPage',
|
|
|
- // params: {
|
|
|
- // orderId: orderId
|
|
|
- // }
|
|
|
+ this.payWayPop = true
|
|
|
+ this.curOrderList = []
|
|
|
+ this.curOrderList.push(orderId)
|
|
|
+ // let orderList=[];
|
|
|
+ // orderList.push(orderId);
|
|
|
+ // this.$u.api.payGzbank({orderList: orderList}).then(res=>{
|
|
|
+ // let payUrl = res.data.url;
|
|
|
+ // this.currentPayUrl=encodeURIComponent(res.data.url);
|
|
|
+ // // return;
|
|
|
+ // this.$u.route({
|
|
|
+ // url: 'pages/payLists/pay',
|
|
|
+ // params: {
|
|
|
+ // currentPayUrl:this.currentPayUrl
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }).catch(err=>{
|
|
|
+ // this.$refs.uToast.show({
|
|
|
+ // title: err.msg,
|
|
|
+ // type: 'error',
|
|
|
+ // });
|
|
|
// });
|
|
|
+
|
|
|
+ // // this.$u.route({
|
|
|
+ // // url: 'pages/payPage/payPage',
|
|
|
+ // // params: {
|
|
|
+ // // orderId: orderId
|
|
|
+ // // }
|
|
|
+ // // });
|
|
|
},
|
|
|
//
|
|
|
onRoadInfo(item){
|
|
@@ -356,8 +384,84 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
+ },
|
|
|
+ gyBankPay() {
|
|
|
+ this.$u.api.payGzbank({orderList: this.curOrderList}).then(res=>{
|
|
|
+ let payUrl = res.data.url;
|
|
|
+ this.currentPayUrl=encodeURIComponent(res.data.url);
|
|
|
+ this.$u.route({
|
|
|
+ url: 'pages/payLists/pay',
|
|
|
+ params: {
|
|
|
+ currentPayUrl: this.currentPayUrl
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 微信支付
|
|
|
+ wechatPay() {
|
|
|
+ const openId = this.$store.state.vuex_wxinfo.openId
|
|
|
+ if (openId) {
|
|
|
+ this.getWXPay(this.curOrderList)
|
|
|
+ } else {
|
|
|
+ this.getCode()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getWXPay(list){
|
|
|
+ let params = {
|
|
|
+ orderList: list,
|
|
|
+ openid: this.$store.state.vuex_wxinfo.openId
|
|
|
+ };
|
|
|
+ await this.$wxApi.config();
|
|
|
+ this.$pay.wechatPay(params).then(res =>{
|
|
|
+ if(res.code == 0){
|
|
|
+ // 成功
|
|
|
+ this.$u.route({
|
|
|
+ url:'/',
|
|
|
+ });
|
|
|
+ }else if(res.code == 1){
|
|
|
+ // 取消
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: '/pages/userCenter/myOrder/myOrder'
|
|
|
+ // })
|
|
|
+ }else if(res.code == 2){
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '支付失败,请检查!',
|
|
|
+ type: 'error',
|
|
|
+ // url: '/pages/user/index'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCode () {
|
|
|
+ var local = window.location.href // 获取页面url
|
|
|
+ let locationLocaturl = window.location.search;
|
|
|
+ this.code = getUrlParams(locationLocaturl,"code"); // 截取code
|
|
|
+ if (this.code == null || this.code === '') { // 如果没有code,则去请求
|
|
|
+ window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.config.wxAppid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&#wechat_redirect`
|
|
|
+ } else {
|
|
|
+ this.handleGetWXInfo(this.code) //把code传给后台获取用户信息
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleGetWXInfo (code) { // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
|
|
|
+ let _this = this
|
|
|
+ this.$u.api.getWXInfo(code).then((res) => {
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.$u.vuex('vuex_wxinfo', res.data);
|
|
|
+ // 继续支付
|
|
|
+ this.getWXPay(this.currentItem)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|