|
@@ -1,33 +1,16 @@
|
|
|
<template>
|
|
|
<div class="mianBox">
|
|
|
- <van-row class="contentBox">
|
|
|
+ <van-row class="contentBox" v-if="loading">
|
|
|
<van-row>
|
|
|
<van-col span="24" class="logo"><van-image width="75" height="75" :src="require('../img/logo.png')" /></van-col>
|
|
|
<van-col span="24" class="introduce">中国东信智慧园区平台</van-col>
|
|
|
<van-col span="24" class="money">{{data.money}}</van-col>
|
|
|
<van-col span="24" class="order_money">订单金额(元)</van-col>
|
|
|
</van-row>
|
|
|
- <!-- <van-row class="order_wrap">
|
|
|
- <van-row>
|
|
|
- <van-col span="8" class="left">用途</van-col>
|
|
|
- <van-col span="16" class="right">充值</van-col>
|
|
|
- </van-row>
|
|
|
- <van-row>
|
|
|
- <van-col span="8" class="left">收款单位</van-col>
|
|
|
- <van-col span="16"class="right">中国东信智慧园区平台</van-col>
|
|
|
- </van-row>
|
|
|
- <van-row>
|
|
|
- <van-col span="8" class="left">订单编号</van-col>
|
|
|
- <van-col span="16" class="right">12345678910123124565</van-col>
|
|
|
- </van-row>
|
|
|
- <van-row>
|
|
|
- <van-col span="8" class="left">订单时间</van-col>
|
|
|
- <van-col span="16" class="right">2021-09-27 15:00:00</van-col>
|
|
|
- </van-row>
|
|
|
- </van-row> -->
|
|
|
<div class="pay_wrap">
|
|
|
<van-button class="pay" color="#F22E3C" @tap="pay">支付</van-button>
|
|
|
<button class="pay" open-type="launchApp" app-parameter="appData" @error="launchAppError" v-if="data.userId">返回APP</button>
|
|
|
+ <!-- <button class="pay" open-type="launchApp" app-parameter="appData" @error="launchAppError" >返回APP<navigator open-type="exit" target="miniProgram" style="margin:30px 0;display: block;">退出程序</navigator></button> -->
|
|
|
</div>
|
|
|
<van-toast id="van-toast" />
|
|
|
<!-- <van-overlay :show="show" @click="show = false" /> -->
|
|
@@ -40,6 +23,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading:false,
|
|
|
data:{
|
|
|
money:undefined,
|
|
|
openid:null,
|
|
@@ -69,7 +53,7 @@
|
|
|
if(data.scene == "3"){
|
|
|
//console.log("app进入 -->支付页")
|
|
|
_this.data={
|
|
|
- money:data.money,
|
|
|
+ money:Number(data.money).toFixed(2),
|
|
|
channelId:data.channelId,
|
|
|
userId:data.userId,
|
|
|
scene:data.scene,
|
|
@@ -88,7 +72,7 @@
|
|
|
app:false,
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ _this.loading = true
|
|
|
_this.data.app = false
|
|
|
_this.pay()
|
|
|
|
|
@@ -103,10 +87,6 @@
|
|
|
pay(){
|
|
|
let _this = this
|
|
|
if(_this.data.openid && _this.data.openid != 'null' ){
|
|
|
- // Toast(1,_this.data.money)
|
|
|
- // uni.redirectTo({
|
|
|
- // url: `../over/index?type=游客`
|
|
|
- // });
|
|
|
if(_this.data.userId){//app用户充值
|
|
|
//console.log("app用户充值")
|
|
|
requestGet("dxtop/staff/one",
|
|
@@ -114,11 +94,10 @@
|
|
|
"id":_this.data.userId,
|
|
|
},
|
|
|
).then(res =>{
|
|
|
-
|
|
|
if(res[1].data.data){
|
|
|
requestPost("dxtop/order/callUnifiedPay",
|
|
|
{
|
|
|
- "money": _this.data.money,
|
|
|
+ "money": Number(_this.data.money).toFixed(2),
|
|
|
"topPayType": "W06",
|
|
|
"payType": "2",
|
|
|
"channelId":_this.data.channelId,
|
|
@@ -126,28 +105,28 @@
|
|
|
"scene":_this.data.scene,
|
|
|
"openId":_this.data.openid,
|
|
|
}
|
|
|
- ).then(res => {
|
|
|
- if(res[1].data?.status == "ERROR"){
|
|
|
- if(res[1].data?.code == 500){
|
|
|
- if(res[1].data.msg == "acct参数错误"){
|
|
|
+ ).then(res2 => {
|
|
|
+ if(res2[1].data?.status == "ERROR"){
|
|
|
+ if(res2[1].data?.code == 500){
|
|
|
+ if(res2[1].data.msg == "acct参数错误"){
|
|
|
Toast("华为、Android10系统,需要开启微信的“浮窗”和“允许在其他上层应用上打开”这两个权限")
|
|
|
}else{
|
|
|
- Toast(res[1].data.msg)
|
|
|
+ Toast(res2[1].data.msg)
|
|
|
}
|
|
|
}else{
|
|
|
- Toast(res[1].data.msg)
|
|
|
+ Toast(res2[1].data.msg)
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
- if(res[1].data){
|
|
|
- let data = JSON.parse(res[1].data.data)
|
|
|
+ if(res2[1].data){
|
|
|
+ let data = JSON.parse(res2[1].data.data)
|
|
|
uni.requestPayment({
|
|
|
timeStamp: data.timeStamp,
|
|
|
nonceStr: data.nonceStr,
|
|
|
package: data.package,
|
|
|
signType: data.signType,
|
|
|
paySign: data.paySign,
|
|
|
- success: function (res) {
|
|
|
+ success: function (res3) {
|
|
|
//console.log('success:' + JSON.stringify(res));
|
|
|
uni.redirectTo({
|
|
|
url: `../over/index`
|
|
@@ -169,131 +148,9 @@
|
|
|
})
|
|
|
}else{
|
|
|
Toast("请使用'中国东信'APP途径进行充值")
|
|
|
- // requestPost("dxtop/order/callUnifiedPay",
|
|
|
- // {
|
|
|
- // "money": _this.data.money,
|
|
|
- // "topPayType": "W06",
|
|
|
- // "payType": "2",
|
|
|
- // "channelName":"小程序游客充值",
|
|
|
- // "scene":2,
|
|
|
- // "openId":_this.data.openid,
|
|
|
- // }
|
|
|
- // ).then(res => {
|
|
|
-
|
|
|
- // if(res[1].data.code == 500){
|
|
|
- // Toast(res[1].data.msg)
|
|
|
- // }else{
|
|
|
- // if(res[1].data){
|
|
|
- // let data = JSON.parse(res[1].data.data)
|
|
|
- // uni.requestPayment({
|
|
|
- // timeStamp: data.timeStamp,
|
|
|
- // nonceStr: data.nonceStr,
|
|
|
- // package: data.package,
|
|
|
- // signType: data.signType,
|
|
|
- // paySign: data.paySign,
|
|
|
- // success: function (res) {
|
|
|
- // console.log('success:' + JSON.stringify(res));
|
|
|
- // uni.redirectTo({
|
|
|
- // url: `../over/index?type=游客`
|
|
|
- // });
|
|
|
- // },
|
|
|
- // fail: function (err) {
|
|
|
- // console.log('fail:' + JSON.stringify(err));
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // })
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // else if(this.data.channelId){//"后台扫码充值"
|
|
|
- // console.log("后台扫码充值",this.data.channelId)
|
|
|
- // requestPost("dxtop/order/callUnifiedPay",
|
|
|
- // {
|
|
|
- // "money": this.data.money,
|
|
|
- // "topPayType": "W06",
|
|
|
- // "payType": "2",
|
|
|
- // "channelId":this.data.channelId,
|
|
|
- // "userId":'',
|
|
|
- // "scene":2,
|
|
|
- // "openId":this.data.openid,
|
|
|
- // }
|
|
|
- // ).then(res => {
|
|
|
- // console.log(res,121212)
|
|
|
- // if(res[1].data){
|
|
|
- // let data = JSON.parse(res[1].data.msg)
|
|
|
- // uni.requestPayment({
|
|
|
- // timeStamp: data.timeStamp,
|
|
|
- // nonceStr: data.nonceStr,
|
|
|
- // package: data.package,
|
|
|
- // signType: data.signType,
|
|
|
- // paySign: data.paySign,
|
|
|
- // success: function (res) {
|
|
|
- // console.log('success:' + JSON.stringify(res));
|
|
|
- // },
|
|
|
- // fail: function (err) {
|
|
|
- // // Toast({
|
|
|
- // // message:JSON.stringify(err),
|
|
|
- // // overlay:true,
|
|
|
- // // });
|
|
|
- // console.log('fail:' + JSON.stringify(err));
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // }else{//历史记录充值
|
|
|
- // // Toast("小程序历史记录进入充值暂未开放...")
|
|
|
- // // return false
|
|
|
- // console.log("历史记录充值")
|
|
|
- // requestPost("dxtop/order/callUnifiedPay",
|
|
|
- // {
|
|
|
- // "money": this.data.money,
|
|
|
- // "topPayType": "W06",
|
|
|
- // "payType": "2",
|
|
|
- // "channelId":56,
|
|
|
- // "userId":'',
|
|
|
- // "scene":2,
|
|
|
- // "openId":this.data.openid,
|
|
|
- // }
|
|
|
- // ).then(res => {
|
|
|
- // if(res[1].data){
|
|
|
- // let data = JSON.parse(res[1].data.msg)
|
|
|
- // uni.requestPayment({
|
|
|
- // timeStamp: data.timeStamp,
|
|
|
- // nonceStr: data.nonceStr,
|
|
|
- // package: data.package,
|
|
|
- // signType: data.signType,
|
|
|
- // paySign: data.paySign,
|
|
|
- // success: function (res) {
|
|
|
- // console.log('success:' + JSON.stringify(res));
|
|
|
- // },
|
|
|
- // fail: function (err) {
|
|
|
- // // Toast({
|
|
|
- // // message:JSON.stringify(err),
|
|
|
- // // overlay:true,
|
|
|
- // // });
|
|
|
- // console.log('fail:' + JSON.stringify(err));
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}else{
|
|
|
//console.log("去授权页",JSON.stringify(_this.data))
|
|
|
uni.redirectTo({
|