fix: app 0元购

This commit is contained in:
whitechiina 2025-10-18 15:07:02 +08:00
parent 6fcfd499d0
commit 163728334c
5 changed files with 48 additions and 32 deletions

View File

@ -20,7 +20,7 @@
}, },
{ {
"customPlaygroundType" : "device", "customPlaygroundType" : "device",
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]

View File

@ -226,6 +226,7 @@
// //
import bRxCommodityItem from '@/components/b-rx-commodity-item/b-rx-commodity-item.vue'; import bRxCommodityItem from '@/components/b-rx-commodity-item/b-rx-commodity-item.vue';
import { launchWechatMiniProgram } from '@/utils/index.js'; import { launchWechatMiniProgram } from '@/utils/index.js';
import webView from '@/static/js/uni.webview.1.5.2.js'
let self; let self;
export default { export default {
@ -438,25 +439,32 @@
// //
createFoodOrder(from).then(res => { createFoodOrder(from).then(res => {
console.log(res.adta)
let redirect_url = '/pages/restaurant/order/order-details/details'; let redirect_url = '/pages/restaurant/order/order-details/details';
uni.hideLoading(); uni.hideLoading();
if (res.data.is_zero_pay) { if (res.data.is_zero_pay) {
uni.showLoading({ title: '支付成功, 跳转订单页' }); uni.showLoading({ title: '支付成功, 跳转订单页' });
setTimeout(() => { if (this.GetIsApp) {
this.$wx.miniProgram.getEnv((wx) => { setTimeout(() => {
if (this.$wx.miniprogram) { uni.webView.reLaunch({
this.$wx.miniProgram.navigateTo({ url: '/pages/goods/order_list/index'
url: `/pages/goods/order_list/index` });
}); uni.hideLoading();
} else { }, 1000)
window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/goods/order_list/index`; } else {
} setTimeout(() => {
}) this.$wx.miniProgram.getEnv((wx) => {
uni.hideLoading(); if (this.$wx.miniprogram) {
}, 1000) this.$wx.miniProgram.navigateTo({
url: `/pages/goods/order_list/index`
});
} else {
window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/goods/order_list/index`;
}
})
uni.hideLoading();
}, 1000)
}
} else { } else {
if (this.GetIsApp) { if (this.GetIsApp) {
launchWechatMiniProgram(res.data.miniProgramOrgId, 0, res.data.prePayTn); launchWechatMiniProgram(res.data.miniProgramOrgId, 0, res.data.prePayTn);

View File

@ -248,6 +248,7 @@
} from '@/request/restaurant/index.js'; } from '@/request/restaurant/index.js';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { launchWechatMiniProgram } from '@/utils/index.js'; import { launchWechatMiniProgram } from '@/utils/index.js';
import webView from '@/static/js/uni.webview.1.5.2.js'
let self; let self;
export default { export default {
@ -449,24 +450,32 @@
FormInfor.products = JSON.parse(FormInfor.products) FormInfor.products = JSON.parse(FormInfor.products)
createFoodOrder(FormInfor).then(res => { createFoodOrder(FormInfor).then(res => {
uni.hideLoading();
let redirect_url = '/pages/restaurant/order/order-details/details'; let redirect_url = '/pages/restaurant/order/order-details/details';
uni.hideLoading(); uni.hideLoading();
if (res.data.is_zero_pay) { if (res.data.is_zero_pay) {
uni.showLoading({ title: '支付成功, 跳转订单页' }); uni.showLoading({ title: '支付成功, 跳转订单页' });
setTimeout(() => { if (this.GetIsApp) {
this.$wx.miniProgram.getEnv((wx) => { setTimeout(() => {
if (this.$wx.miniprogram) { uni.webView.reLaunch({
this.$wx.miniProgram.navigateTo({ url: '/pages/goods/order_list/index'
url: `/pages/goods/order_list/index` });
}); uni.hideLoading();
}else { }, 1000)
window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/goods/order_list/index`; } else {
} setTimeout(() => {
}) this.$wx.miniProgram.getEnv((wx) => {
uni.hideLoading(); if (this.$wx.miniprogram) {
}, 1000) this.$wx.miniProgram.navigateTo({
url: `/pages/goods/order_list/index`
});
}else {
window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/goods/order_list/index`;
}
})
uni.hideLoading();
}, 1000)
}
} else { } else {
if (this.GetIsApp) { if (this.GetIsApp) {
launchWechatMiniProgram(res.data.miniProgramOrgId, 0, res.data.prePayTn); launchWechatMiniProgram(res.data.miniProgramOrgId, 0, res.data.prePayTn);

View File

@ -208,8 +208,6 @@ class Request {
config['header']['form-type'] = 'app'; config['header']['form-type'] = 'app';
} }
config['header']['form-type'] = 'app';
console.log(cityInfor, '定位信息头') console.log(cityInfor, '定位信息头')
if (cityInfor?.adcode) { if (cityInfor?.adcode) {
// config['header']['city'] = encodeURIComponent(cityInfor['city']); // config['header']['city'] = encodeURIComponent(cityInfor['city']);

File diff suppressed because one or more lines are too long