47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const API_api = require("../../API/api.js");
|
|
const _sfc_main = {
|
|
__name: "test",
|
|
setup(__props) {
|
|
const onButton = () => {
|
|
my.request({
|
|
url: API_api.apiImageUrl + "/api/Alipay/payment/create",
|
|
method: "GET",
|
|
data: {
|
|
id: "47"
|
|
},
|
|
header: {
|
|
"Content-Type": "application/json",
|
|
// 确保设置正确的 Content-Type
|
|
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
|
},
|
|
success: function(result) {
|
|
console.log(result);
|
|
console.log(result.data.data);
|
|
my.tradePay({
|
|
tradeNO: result.data.data,
|
|
success: (res) => {
|
|
console.log("成功调用");
|
|
console.log(res);
|
|
},
|
|
fail: (res) => {
|
|
my.alert({
|
|
content: JSON.stringify(res)
|
|
});
|
|
console.log("失败");
|
|
console.log(res);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.o(onButton)
|
|
};
|
|
};
|
|
}
|
|
};
|
|
wx.createPage(_sfc_main);
|