提交im 优化app 中余额支付

master
lemon橪 2022-04-02 18:32:01 +08:00
parent c756223363
commit 201ee840d5
5 changed files with 98 additions and 69 deletions

View File

@ -6,11 +6,11 @@ export default {
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址 downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址 shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态) appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转 scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看 iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址 logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
customerServiceMobile:"13161366885", //客服电话 customerServiceMobile:"13161366885", //客服电话
customerServiceEmail:"lili@lili.com" //客服邮箱 customerServiceEmail:"lili@lili.com", //客服邮箱
imWebSrc:"https://im.pickmall.cn" //IM地址
}; };

View File

@ -2,8 +2,8 @@
"name" : "lili商城", "name" : "lili商城",
"appid" : "__UNI__C100675", "appid" : "__UNI__C100675",
"description" : "", "description" : "",
"versionName" : "4.2.4", "versionName" : "4.2.4.1",
"versionCode" : 4000240, "versionCode" : 4000241,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {

View File

@ -227,12 +227,17 @@
// APP/NATIVE/JSAPI/H5 // APP/NATIVE/JSAPI/H5
const paymentClient = this.paymentClient; const paymentClient = this.paymentClient;
uni.showLoading({
title: "正在唤起支付...",
mask:true
});
// #ifdef APP-PLUS // #ifdef APP-PLUS
//APP pay //APP pay
// //
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then( await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
(signXml) => { (signXml) => {
uni.hideLoading();
// //
if (!signXml.data.success) { if (!signXml.data.success) {
uni.showToast({ uni.showToast({
@ -245,19 +250,24 @@
let payForm = signXml.data.result; let payForm = signXml.data.result;
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay"; let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
uni.requestPayment({
provider: paymentType, if(paymentMethod === "WALLET"){
orderInfo: payForm, uni.showToast({
success: (e) => { icon: "none",
console.log(e); title: "支付成功!",
});
this.callback(paymentMethod)
}
else{
uni.requestPayment({
provider: paymentType,
orderInfo: payForm || '',
success: (e) => {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "支付成功!", title: "支付成功!",
}); });
this.callback(paymentMethod) this.callback(paymentMethod)
}, },
fail: (e) => { fail: (e) => {
console.log(this); console.log(this);
@ -269,6 +279,7 @@
}, },
}); });
} }
}
); );
//APP pay //APP pay
// #endif // #endif

View File

@ -382,7 +382,6 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
import popupAddress from "./product/popup/address"; // import popupAddress from "./product/popup/address"; //
import shares from "@/components/m-share/index"; // import shares from "@/components/m-share/index"; //
import popups from "@/components/popups/popups"; // import popups from "@/components/popups/popups"; //
import setup from "./product/popup/popup"; import setup from "./product/popup/popup";
export default { export default {
components: { components: {
@ -528,6 +527,7 @@ export default {
}, },
computed: { computed: {
// udesk IM
IM() { IM() {
return this.IMLink + this.storeDetail.merchantEuid; return this.IMLink + this.storeDetail.merchantEuid;
}, },
@ -708,40 +708,49 @@ export default {
}, },
linkMsgDetail() { linkMsgDetail() {
if (this.storeDetail.merchantEuid) { // lili
uni.navigateTo({ uni.navigateTo({
url: `/pages/tabbar/home/web-view?src=${this.IM}`, url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
}); });
} else {
// // udesk
// #ifdef MP-WEIXIN // if (this.storeDetail.merchantEuid) {
const params = { // uni.navigateTo({
storeName: this.storeDetail.storeName, // url: `/pages/tabbar/home/web-view?src=${this.IM}`,
goodsName: this.goodsDetail.goodsName, // });
goodsId: this.goodsDetail.goodsId, // }
goodsImg: this.goodsDetail.thumbnail,
price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
// originalPrice: this.goodsDetail.original || this.goodsDetail.price, //
uuid: storage.getUuid(), // // #ifdef MP-WEIXIN
token: storage.getAccessToken(), // const params = {
sign: this.storeDetail.yzfSign, // storeName: this.storeDetail.storeName,
mpSign: this.storeDetail.yzfMpSign, // goodsName: this.goodsDetail.goodsName,
}; // goodsId: this.goodsDetail.goodsId,
uni.navigateTo({ // goodsImg: this.goodsDetail.thumbnail,
url: // price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
"/pages/product/customerservice/index?params=" + // // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
encodeURIComponent(JSON.stringify(params)), // uuid: storage.getUuid(),
}); // token: storage.getAccessToken(),
// #endif // sign: this.storeDetail.yzfSign,
// #ifndef MP-WEIXIN // mpSign: this.storeDetail.yzfMpSign,
const sign = this.storeDetail.yzfSign; // };
uni.navigateTo({ // uni.navigateTo({
url: // url:
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + // "/pages/product/customerservice/index?params=" +
sign, // encodeURIComponent(JSON.stringify(params)),
}); // });
// #endif // // #endif
} // // #ifndef MP-WEIXIN
// const sign = this.storeDetail.yzfSign;
// uni.navigateTo({
// url:
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
// sign,
// });
// // #endif
}, },
// 1999 --> [1999,00] // 1999 --> [1999,00]
formatPrice(val) { formatPrice(val) {

View File

@ -5,9 +5,13 @@
</template> </template>
<script> <script>
import configs from "@/config/config";
import storage from "@/utils/storage";
export default { export default {
data() { data() {
return { return {
configs,
storage,
webviewStyles: { webviewStyles: {
progress: { progress: {
color: this.$lightColor, color: this.$lightColor,
@ -17,7 +21,12 @@ export default {
}; };
}, },
onLoad(params) { onLoad(params) {
this.src = decodeURIComponent(params.src); params.IM
? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${
params.IM
}`)
: (this.src = decodeURIComponent(params.src));
console.log(this.src);
}, },
}; };
</script> </script>