Commit 0fb85020 authored by 罗超's avatar 罗超

1

parent 03ae6b51
......@@ -58,6 +58,9 @@
"appid" : "wxbb033190e0ffa5db",
"UniversalLinks" : ""
}
},
"oauth" : {
"univerify" : {}
}
}
}
......@@ -76,21 +79,23 @@
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"optimization":{
"subPackages":true
}
},
"mp-alipay" : {
"component2" : true,
"usingComponents" : true,
"appid" : "2021002181604459",
"plugins" : {
"plugins" : {}
},
// 使用到的插件
// "subscribeMsg" : {
// 订阅消息插件
// "version" : "*", // 目前只支持设置 * 拉取当前上架最新版本
// "provider" : "2021001155639035" // 消息订阅插件 appid
// }
}
},
"mp-baidu" : {
"usingComponents" : true
},
......
......@@ -74,9 +74,6 @@
<!-- #ifdef MP-WEIXIN -->
<view class="btn" @click="submitOrder"> 去支付 </view>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view class="btn" @click="submitOrderAli"> 去支付 </view>
<!-- #endif -->
</view>
</view>
</view>
......@@ -247,132 +244,6 @@ export default {
});
},
// #endif
// #ifdef MP-ALIPAY
submitOrderAli() {
if (!this.Consignee) {
uni.showToast({
title: "请输入联系人姓名",
icon: "none",
});
return;
}
if (!this.ConsigneeMobile) {
uni.showToast({
title: "请输入手机号",
icon: "none",
});
return;
}
uni.showLoading({
title: "支付中...",
});
this.request2(
{
url: "/api/AppletDining/SetAppletTicketOrderInfo",
data: {
...this.ticketdData,
Final_Price: this.Final_Price,
Consignee: this.Consignee,
ConsigneeMobile: this.ConsigneeMobile,
GuestList: this.GuestList,
},
},
(res) => {
uni.hideLoading();
if (res.resultCode === 1) {
let that = this;
console.log(res.data.template_message_list);
SubscribeMsgAli(res.data.template_message_list, () => {
if (that.Final_Price === 0) {
uni.redirectTo({
url: "/pages/jiuzhai/allorderList",
});
return;
}
that.querenAli(res.data.OrderId);
});
// uni.requestSubscribeMessage({
// tmplIds: res.data.template_message_list,
// success: (res) => {
// console.log("订阅成功", res);
// },
// fail: (err) => {
// console.log("订阅失败", err);
// },
// complete(_res) {
// if (that.Final_Price === 0) {
// uni.redirectTo({
// url: "/pages/jiuzhai/allorderList",
// });
// return;
// }
// that.queren(res.data.OrderId);
// },
// });
}
},
(err) => {
uni.hideLoading();
}
);
},
querenAli(OrderId) {
let url = "/api/WeChatPay/GetDmcPayInfo";
let GoodsName = this.ticketdData.TicketName;
GoodsName = GoodsName.slice(0, 10);
this.request2(
{
url: url,
data: {
OrderId: OrderId,
GoodsName: GoodsName,
OrderPayType: 1,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
this.orderInfo = JSON.parse(res.data);
console.log(171, this.orderInfo);
this.Pay();
}
);
},
PayAli() {
let that = this;
uni.requestPayment({
provider: "alipay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + that.Final_Price,
});
}, 100);
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/allorderList",
});
}, 100);
},
});
},
// #endif
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment