Quellcode durchsuchen

支付宝2小程序

yxb
DESKTOP-2IO5MST\huting vor 1 Jahr
Ursprung
Commit
674de72d90
5 geänderte Dateien mit 144 neuen und 19 gelöschten Zeilen
  1. 2
    0
      App.vue
  2. 15
    10
      pages.json
  3. 26
    3
      pages/index/index.vue
  4. 59
    0
      subpackage/after-sale/empty.vue
  5. 42
    6
      subpackage/orders/payment/payment.vue

+ 2
- 0
App.vue Datei anzeigen

@@ -186,11 +186,13 @@
method: "POST",
showLoading: true,
};
// #ifdef MP-WEIXIN
request(getGlobalParam, options).then((res) => {
const result = stringToJson(res.bizContent);
setItem('globalParam', result.data)
console.log("配置", result);
});
// #endif
},



+ 15
- 10
pages.json Datei anzeigen

@@ -88,20 +88,25 @@
"enablePullDownRefresh": false
}
}, {
"path": "pages/zaweb/zaweb",
"style": {
"navigationBarTitleText": "在线签约",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/zaweb/zaweb",
"style" :
{
"navigationBarTitleText": "在线签约",
"enablePullDownRefresh": false
}
}
],
],
"subPackages": [{
"root": "subpackage/after-sale", //售后相关
"pages": [{
"path": "empty",
"style": {
"navigationBarTitleText": "支付",
"enablePullDownRefresh": false
}
},
{
"path": "inventory-equipment",
"style": {
"navigationBarTitleText": "库存设备统计",

+ 26
- 3
pages/index/index.vue Datei anzeigen

@@ -405,9 +405,32 @@
// .catch((err) => {
// console.log(err);
// });
uni.navigateTo({
url: "/subpackage/orders/payment/payment?token=445dff5be89c4dcaa89386d1c390930a&openId=0e716af635634d749a981524cc6146a5&orderId=20231016175113823159477&qdOrderNo=20231016175113823159477"
})
// uni.navigateTo({
// url: "/subpackage/orders/payment/payment?token=445dff5be89c4dcaa89386d1c390930a&openId=0e716af635634d749a981524cc6146a5&orderId=20231016175113823159477&qdOrderNo=20231016175113823159477"
// })
// uni.navigateTo({
// url: "/subpackage/orders/sign/sign-up-ali?token=dcb93cca0dde44cdb444b6afab95b66e&openId=c3e66c33299e4faea553ba32a028418c&orderId=20231017142743224495637&qdOrderNo=20231017142747520101000029802083"
// })
my.navigateToMiniProgram({
appId: '2021004124602167', // 16 位
path: `/subpackage/orders/payment/payment?qdOrderNo=1&type=3&orderId=1&isPay=1`,
query: {
a: 'foo',
b: 'bar',
},
envVersion: "develop",
extraData: {
x: {
y: 'z',
},
},
success: function (res) {
console.log(res);
},
fail: function (err) {
console.log(err);
}
});
};

//轮播跳转

+ 59
- 0
subpackage/after-sale/empty.vue Datei anzeigen

@@ -0,0 +1,59 @@
<template>
</template>

<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue";
const state = reactive({
qdOrderNo: "", //渠道订单编号
orderId: "",
isPay: "",
openId: "",
id: "",
clientFee: "",
code: "",
token: ""
});
onLoad((option : any) => {
state.orderId = option.orderId;
state.qdOrderNo = option.qdOrderNo;
state.isPay = option.isPay;
state.token = option.token;
state.openId = option.openId;
console.log("option11111", option)
if (state.isPay == "1") {
// 为1时跳转到2小程序支付
my.navigateToMiniProgram({
appId: '2021004124602167', // 16 位
path: `/subpackage/orders/payment/payment?qdOrderNo=${state.qdOrderNo}&openId=${state.openId}&token=${state.token}&type=3&orderId=${state.orderId}&isPay=${state.isPay}`,
query: {
a: 'foo',
b: 'bar',
},
envVersion: "develop",
extraData: {
x: {
y: 'z',
},
},
success: function (res) {
console.log(res);
},
fail: function (err) {
console.log(err);
}
});
} else {
const param = `https://qtzl.etcjz.cn/order/#/pages/payment/payment?qdOrderNo=${state.qdOrderNo}&type=3`
const params = encodeURIComponent(JSON.stringify(param))
console.log('支付结果查询params', params)
uni.navigateTo({
url: `/subpackage/personal-center/webview?url=` + params
})
}

});
</script>

<style>
</style>

+ 42
- 6
subpackage/orders/payment/payment.vue Datei anzeigen

@@ -49,6 +49,7 @@
clientFee: "",
code: "",
qdOrderNo: "", //渠道订单编号
isPay: "",
});
onLoad((option : any) => {
console.log("option11111", option)
@@ -57,6 +58,7 @@
setItem('accessToken', option.token);
setItem(StorageKeys.Token, option.token);
setItem('openId', option.openId);
state.isPay = option.isPay;
});

const savaHandle = () => {
@@ -108,12 +110,46 @@
request(checkOrderStatus, optionsaliquery).then((res) => {
console.log('支付结果查询:', res)
// 支付完成跳转到h5
const param = `https://qtzl.etcjz.cn/order/#/pages/payment/payment?qdOrderNo=${state.qdOrderNo}&type=3`
const params = encodeURIComponent(JSON.stringify(param))
console.log('支付结果查询params', params)
uni.navigateTo({
url: `/subpackage/personal-center/webview?url=` + params
})
// const param = `https://qtzl.etcjz.cn/order/#/pages/payment/payment?qdOrderNo=${state.qdOrderNo}&type=3`
// const params = encodeURIComponent(JSON.stringify(param))
// console.log('支付结果查询params', params)
// uni.navigateTo({
// url: `/subpackage/personal-center/webview?url=` + params
// })
if (state.isPay == "1") {
my.navigateToMiniProgram({
appId: '2021004102619032', // 16 位
path: `/subpackage/after-sale/empty?qdOrderNo=${state.qdOrderNo}&type=3&orderId=${state.orderId}isPay=2`,
query: {
a: 'foo',
b: 'bar',
},
extraData: {
x: {
y: 'z',
},
},
success: function (res) {
console.log(res);
},
fail: function (err) {
console.log(err);
}
});
}

// my.navigateBackMiniProgram({
// extraData: {
// 'qdOrderNo': state.qdOrderNo,
// 'type': 3
// },
// success: (res) => {
// console.log(res)
// },
// fail: (err) => {
// console.log(err)
// }
// });
})
},
fail: res => {

Laden…
Abbrechen
Speichern