更新
This commit is contained in:
@@ -6,7 +6,7 @@ export default {
|
|||||||
latitude: 39.5426,
|
latitude: 39.5426,
|
||||||
longitude: 116.23292,
|
longitude: 116.23292,
|
||||||
},
|
},
|
||||||
appId: "wxed3e2914d6aa4d52",
|
appId: "wx9995c9f495efa82e",
|
||||||
hasLocationAuth: true,
|
hasLocationAuth: true,
|
||||||
},
|
},
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
},
|
},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
/* 微信小程序特有相关 */ "appid": "wxed3e2914d6aa4d52",
|
/* 微信小程序特有相关 */ "appid": "wx9995c9f495efa82e",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -201,6 +201,34 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
serviceIllustrate() {
|
||||||
|
this.$refs.popupIllustrate.open("bottom");
|
||||||
|
},
|
||||||
|
async createCOrder() {
|
||||||
|
let isHas = this.hasLocationAuthHandle(() => {
|
||||||
|
this.getById(this.siteInfo);
|
||||||
|
});
|
||||||
|
if (!isHas) return;
|
||||||
|
let isBeyond = await this.beyondDistance();
|
||||||
|
if (!isBeyond) return;
|
||||||
|
if (!this.checkParams()) return;
|
||||||
|
serve
|
||||||
|
.createCOrder({
|
||||||
|
targetApp: "SAAS",
|
||||||
|
orderType: "REAL_ORDER",
|
||||||
|
orderSource: "WECHAT_MINIAPPS",
|
||||||
|
orderMethod: "SITE_SCAN",
|
||||||
|
suppleMark: 0,
|
||||||
|
version: 1,
|
||||||
|
createSource: "XOIL_DRIVER_WECHAT_APPLET",
|
||||||
|
...this.params,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code !== 20000) return;
|
||||||
|
this.wxPay(res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 定位权限是否开启检测
|
||||||
hasLocationAuthHandle(callback = () => {}) {
|
hasLocationAuthHandle(callback = () => {}) {
|
||||||
const appInstance = getApp();
|
const appInstance = getApp();
|
||||||
let { hasLocationAuth } = appInstance.globalData;
|
let { hasLocationAuth } = appInstance.globalData;
|
||||||
@@ -225,47 +253,33 @@ export default {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
serviceIllustrate() {
|
// 距离检测
|
||||||
this.$refs.popupIllustrate.open("bottom");
|
async beyondDistance() {
|
||||||
},
|
let { juli, siteName, siteId, id } = this.siteInfo;
|
||||||
createCOrder() {
|
|
||||||
let isHas = this.hasLocationAuthHandle(() => {
|
|
||||||
this.getById(this.siteInfo);
|
|
||||||
});
|
|
||||||
if (!isHas) return;
|
|
||||||
if (!this.beyondDistance()) return;
|
|
||||||
if (!this.checkParams()) return;
|
|
||||||
serve
|
|
||||||
.createCOrder({
|
|
||||||
targetApp: "SAAS",
|
|
||||||
orderType: "REAL_ORDER",
|
|
||||||
orderSource: "WECHAT_MINIAPPS",
|
|
||||||
orderMethod: "SITE_SCAN",
|
|
||||||
suppleMark: 0,
|
|
||||||
version: 1,
|
|
||||||
createSource: "XOIL_DRIVER_WECHAT_APPLET",
|
|
||||||
...this.params,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
if (res.code !== 20000) return;
|
|
||||||
this.wxPay(res.data);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
beyondDistance() {
|
|
||||||
let { juli, siteName } = this.siteInfo;
|
|
||||||
if (juli > 10000) {
|
if (juli > 10000) {
|
||||||
uni.showModal({
|
let firstRes = await this.$utils.obtainLocationHandle();
|
||||||
title: siteName,
|
let { latitude, longitude } = firstRes;
|
||||||
content: "您与加油站距离较远,请到达加油站与加油员确认金额后付款",
|
let secondRes = await serve.getById({
|
||||||
confirmText: "导航到站",
|
id: siteId || id,
|
||||||
cancelText: "我知道了",
|
latitude,
|
||||||
success: (res) => {
|
longitude,
|
||||||
if (res.confirm) {
|
|
||||||
this.openMap();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
return false;
|
if (secondRes.code !== 20000) return false;
|
||||||
|
if (secondRes.data.juli > 10000) {
|
||||||
|
uni.showModal({
|
||||||
|
title: siteName,
|
||||||
|
content: "您与加油站距离较远,请到达加油站与加油员确认金额后付款",
|
||||||
|
confirmText: "导航到站",
|
||||||
|
cancelText: "我知道了",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.openMap();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -385,7 +399,7 @@ export default {
|
|||||||
marketPrice: item.marketPrice,
|
marketPrice: item.marketPrice,
|
||||||
sitePriceId: item.priceId,
|
sitePriceId: item.priceId,
|
||||||
});
|
});
|
||||||
// item.oilsBars数据结构为['','',''] 此处不适用 转化下为[{},{},{}]
|
// item.oilsBars数据结构为['','',''] 此处不适用 转化为[{},{},{}]
|
||||||
spear[item.oilProductCode] = item.oilsBars.reduce((prev, item) => {
|
spear[item.oilProductCode] = item.oilsBars.reduce((prev, item) => {
|
||||||
prev.push({
|
prev.push({
|
||||||
label: item,
|
label: item,
|
||||||
|
|||||||
Reference in New Issue
Block a user