修复微信支付

main
Frontend-徐志烘 1 year ago
parent 7d8978687f
commit 7057a880b4

@ -4,7 +4,7 @@
//基础地址 //基础地址
// export const BASE_URL = 'https://h5.zhenpin.yhd.la/' // export const BASE_URL = 'https://h5.zhenpin.yhd.la/'
// export const BASE_URL = 'https://h3.zhenpin.yhd.la/' // export const BASE_URL = 'https://h3.zhenpin.yhd.la/'
export const BASE_URL = 'https://h3.zhenpin.yhd.la/' export const BASE_URL = 'https://h5.zhenpin.yhd.la/'
export const BASE_URLS = 'http://47.97.35.139:19260/' export const BASE_URLS = 'http://47.97.35.139:19260/'
export const BASE_URLSS = 'http://47.97.35.139:19270/' export const BASE_URLSS = 'http://47.97.35.139:19270/'
//微信appid //微信appid

@ -296,8 +296,13 @@
}) })
} }
const myGps = () => { const myGps = () => {
longitude.value=uni.getStorageSync('longitude') longitude.value=0
latitude.value = uni.getStorageSync('latitude') latitude.value =0
setTimeout(()=>{
longitude.value=uni.getStorageSync('longitude')
latitude.value = uni.getStorageSync('latitude')
},500)
console.log(longitude.value,latitude.value);
console.log("返回中心点"); console.log("返回中心点");
} }
const iiii = () => { const iiii = () => {

@ -89,6 +89,7 @@ export const storindex = defineStore('storindex', () => {
p.value = 0 p.value = 0
} else { } else {
console.log("out_trade_no", res); console.log("out_trade_no", res);
console.log('这是订单号'+res);
const res1 = await getWxPlay({ const res1 = await getWxPlay({
appId: appid, appId: appid,
phone: uni.getStorageSync('phoneNumber'), phone: uni.getStorageSync('phoneNumber'),
@ -114,7 +115,7 @@ export const storindex = defineStore('storindex', () => {
console.log('用户付款成功', res2); console.log('用户付款成功', res2);
//获取扫码后的设备id和手机号验证传入订单信息启动设备 //获取扫码后的设备id和手机号验证传入订单信息启动设备
const res4 = await ({ const res4 = await start({
mid: uni.getStorageSync('mid'), mid: uni.getStorageSync('mid'),
price: 100, price: 100,
time: times.value, time: times.value,
@ -147,9 +148,10 @@ export const storindex = defineStore('storindex', () => {
}) })
//不为200或者0的时候启动失败并提示原因。 //不为200或者0的时候启动失败并提示原因。
} else { } else {
console.log(res4);
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: `${res4.data.statusText},请在我的页面联系客服解决`, title: `请在我的页面联系客服解决`,
duration: 1200, duration: 1200,
success: async (res) => { success: async (res) => {
p.value = 0 p.value = 0
@ -399,9 +401,10 @@ export const storindex = defineStore('storindex', () => {
}) })
} else { } else {
p.value = 0 p.value = 0
console.log(res4);
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: `${res4.data.statusText},请在我的页面联系客服解决`, title: `请在我的页面联系客服解决`,
duration: 1200, duration: 1200,
success: (res) => { success: (res) => {
uni.setStorageSync('orderid', orderid.value) uni.setStorageSync('orderid', orderid.value)

@ -1,5 +1,5 @@
"use strict"; "use strict";
const BASE_URL = "https://h3.zhenpin.yhd.la/"; const BASE_URL = "https://h5.zhenpin.yhd.la/";
const BASE_URLS = "http://47.97.35.139:19260/"; const BASE_URLS = "http://47.97.35.139:19260/";
const BASE_URLSS = "http://47.97.35.139:19270/"; const BASE_URLSS = "http://47.97.35.139:19270/";
const appid = "wxc5f11d5f96fbd989"; const appid = "wxc5f11d5f96fbd989";

@ -116,8 +116,13 @@ const _sfc_main = {
}); });
}; };
const myGps = () => { const myGps = () => {
longitude.value = common_vendor.index.getStorageSync("longitude"); longitude.value = 0;
latitude.value = common_vendor.index.getStorageSync("latitude"); latitude.value = 0;
setTimeout(() => {
longitude.value = common_vendor.index.getStorageSync("longitude");
latitude.value = common_vendor.index.getStorageSync("latitude");
}, 500);
console.log(longitude.value, latitude.value);
console.log("返回中心点"); console.log("返回中心点");
}; };
const iiii = () => { const iiii = () => {

@ -54,6 +54,7 @@ const storindex = common_vendor.defineStore("storindex", () => {
p.value = 0; p.value = 0;
} else { } else {
console.log("out_trade_no", res); console.log("out_trade_no", res);
console.log("这是订单号" + res);
const res1 = await api_api.getWxPlay({ const res1 = await api_api.getWxPlay({
appId: common_baseurl.appid, appId: common_baseurl.appid,
phone: common_vendor.index.getStorageSync("phoneNumber"), phone: common_vendor.index.getStorageSync("phoneNumber"),
@ -75,7 +76,7 @@ const storindex = common_vendor.defineStore("storindex", () => {
//付款成功进入执行启动设备 //付款成功进入执行启动设备
success: async (res2) => { success: async (res2) => {
console.log("用户付款成功", res2); console.log("用户付款成功", res2);
const res4 = await { const res4 = await api_api.start({
mid: common_vendor.index.getStorageSync("mid"), mid: common_vendor.index.getStorageSync("mid"),
price: 100, price: 100,
time: times.value, time: times.value,
@ -83,7 +84,7 @@ const storindex = common_vendor.defineStore("storindex", () => {
orderId: orderid.value, orderId: orderid.value,
phone: common_vendor.index.getStorageSync("phoneNumber"), phone: common_vendor.index.getStorageSync("phoneNumber"),
openId: common_vendor.index.getStorageSync("openid") openId: common_vendor.index.getStorageSync("openid")
}; });
console.log(res4); console.log(res4);
if (res4.code == 200 || res4.code == 0) { if (res4.code == 200 || res4.code == 0) {
common_vendor.index.showToast({ common_vendor.index.showToast({
@ -106,9 +107,10 @@ const storindex = common_vendor.defineStore("storindex", () => {
} }
}); });
} else { } else {
console.log(res4);
common_vendor.index.showToast({ common_vendor.index.showToast({
icon: "none", icon: "none",
title: `${res4.data.statusText},请在我的页面联系客服解决`, title: `请在我的页面联系客服解决`,
duration: 1200, duration: 1200,
success: async (res3) => { success: async (res3) => {
p.value = 0; p.value = 0;
@ -352,9 +354,10 @@ const storindex = common_vendor.defineStore("storindex", () => {
}); });
} else { } else {
p.value = 0; p.value = 0;
console.log(res4);
common_vendor.index.showToast({ common_vendor.index.showToast({
icon: "none", icon: "none",
title: `${res4.data.statusText},请在我的页面联系客服解决`, title: `请在我的页面联系客服解决`,
duration: 1200, duration: 1200,
success: (res2) => { success: (res2) => {
common_vendor.index.setStorageSync("orderid", orderid.value); common_vendor.index.setStorageSync("orderid", orderid.value);

Loading…
Cancel
Save