扫码打开小程序并开锁功能
This commit is contained in:
parent
976432989c
commit
ac07fbc0b7
@ -183,7 +183,7 @@
|
|||||||
let arrBikeData = [];
|
let arrBikeData = [];
|
||||||
const showBikeInfo = ref(false);
|
const showBikeInfo = ref(false);
|
||||||
const bikeData = ref({});
|
const bikeData = ref({});
|
||||||
const onLoadData = ref(null)
|
const onLoadData = ref({})
|
||||||
let ismount = false;
|
let ismount = false;
|
||||||
let arrSiteData = []
|
let arrSiteData = []
|
||||||
|
|
||||||
@ -201,6 +201,7 @@
|
|||||||
console.log("p===>" + JSON.stringify(p))
|
console.log("p===>" + JSON.stringify(p))
|
||||||
onLoadData.value = p;
|
onLoadData.value = p;
|
||||||
} else if (query.number) {
|
} else if (query.number) {
|
||||||
|
console.log("query" + JSON.stringify(query))
|
||||||
onLoadData.value['number'] = query.number;
|
onLoadData.value['number'] = query.number;
|
||||||
onLoadData.value['_tbScancodeApproach_'] = query._tbScancodeApproach_;
|
onLoadData.value['_tbScancodeApproach_'] = query._tbScancodeApproach_;
|
||||||
}
|
}
|
||||||
@ -219,16 +220,10 @@
|
|||||||
if (!oUser) {
|
if (!oUser) {
|
||||||
tologin();
|
tologin();
|
||||||
}
|
}
|
||||||
map.addOrder(onLoadData.value["number"], (res) => {
|
map.addOrder(onLoadData.value["number"], false, (res) => {
|
||||||
console.log("00000000000000000000", res);
|
console.log("00000000000000000000", res);
|
||||||
if (!res) {
|
if (res) {
|
||||||
setTimeout(() => {
|
getOrder();
|
||||||
bikeCode = null;
|
|
||||||
getOrder();
|
|
||||||
}, 1000);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
showWorn.value = true;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@
|
|||||||
const agreed = ref([{
|
const agreed = ref([{
|
||||||
value: true // true 表示选中
|
value: true // true 表示选中
|
||||||
}]);
|
}]);
|
||||||
const onLoadData = ref(null)
|
const onLoadData = ref({})
|
||||||
import {
|
import {
|
||||||
onLoad
|
onLoad
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
@ -242,11 +242,12 @@
|
|||||||
let url = "/pages/user/home/home"
|
let url = "/pages/user/home/home"
|
||||||
let q = "";
|
let q = "";
|
||||||
if (onLoadData.value) {
|
if (onLoadData.value) {
|
||||||
url += '?number=' + onLoadData.value['number'] + "&_tbScancodeApproach_=scan"
|
url += '?number=' + onLoadData.value['number'] + "&_tbScancodeApproach_=" + onLoadData.value[
|
||||||
|
'_tbScancodeApproach_']
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/user/home/home"
|
url: url
|
||||||
})
|
})
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
const options = getUrlParams(result);
|
const options = getUrlParams(result);
|
||||||
bikeCode = options["number"];
|
bikeCode = options["number"];
|
||||||
if (type == "ride") {
|
if (type == "ride") {
|
||||||
addOrder(bikeCode, (res) => {
|
addOrder(bikeCode, true, (res) => {
|
||||||
console.log("00000000000000000000", res);
|
console.log("00000000000000000000", res);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import config from "./config.js";
|
import config from "./config.js";
|
||||||
import {
|
import {
|
||||||
showModelMessage,jkcBaseDecode
|
showModelMessage,
|
||||||
|
jkcBaseDecode
|
||||||
} from "./tools.js";
|
} from "./tools.js";
|
||||||
import {
|
import {
|
||||||
callOrdereApi
|
callOrdereApi
|
||||||
@ -10,7 +11,7 @@ const imgPath = config.imgPath;
|
|||||||
|
|
||||||
export const sdkKey = '22095eb86ca9e318c404f9f4a31b20d5';
|
export const sdkKey = '22095eb86ca9e318c404f9f4a31b20d5';
|
||||||
|
|
||||||
export function getMap (mapid, instance) {
|
export function getMap(mapid, instance) {
|
||||||
return uni.createMapContext(mapid, {
|
return uni.createMapContext(mapid, {
|
||||||
this: instance.proxy
|
this: instance.proxy
|
||||||
});
|
});
|
||||||
@ -78,8 +79,8 @@ export function addLine(scolor, arrPoints) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//创建订单
|
//创建订单
|
||||||
export function addOrder(bikeCode, callback) {
|
export function addOrder(bikeCode, jumpFlag, callback) {
|
||||||
const oUser =JSON.parse(jkcBaseDecode(uni.getStorageSync("wechat_user")));
|
const oUser = JSON.parse(jkcBaseDecode(uni.getStorageSync("wechat_user")));
|
||||||
if (!oUser) {
|
if (!oUser) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/user/login/wx_login"
|
url: "/pages/user/login/wx_login"
|
||||||
@ -92,10 +93,10 @@ export function addOrder(bikeCode, callback) {
|
|||||||
userId,
|
userId,
|
||||||
bikeCode
|
bikeCode
|
||||||
}
|
}
|
||||||
saveRide(params, 1, callback)
|
saveRide(params, 1, jumpFlag, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveRide(params, icnt, callback) {
|
function saveRide(params, icnt, jumpFlag, callback) {
|
||||||
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
@ -107,21 +108,22 @@ function saveRide(params, icnt, callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showModelMessage(message);
|
showModelMessage(message);
|
||||||
if(callback) callback(false);
|
if (callback) callback(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(callback)callback(true);
|
if (callback) callback(true);
|
||||||
setTimeout(() => {
|
if (jumpFlag) {
|
||||||
uni.navigateTo({
|
setTimeout(() => {
|
||||||
url: "/pages/user/home/home"
|
uni.navigateTo({
|
||||||
})
|
url: "/pages/user/home/home"
|
||||||
}, 1000)
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加面
|
//添加面
|
||||||
export function addPolygon (scolor, fcolor, arrPoints) {
|
export function addPolygon(scolor, fcolor, arrPoints) {
|
||||||
return {
|
return {
|
||||||
points: arrPoints,
|
points: arrPoints,
|
||||||
fillColor: fcolor,
|
fillColor: fcolor,
|
||||||
@ -129,4 +131,4 @@ export function addPolygon (scolor, fcolor, arrPoints) {
|
|||||||
strokeColor: scolor,
|
strokeColor: scolor,
|
||||||
zIndex: 11
|
zIndex: 11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user