提交 扫码功能

This commit is contained in:
有果 2026-05-18 10:41:39 +08:00
parent 25ca4ccb31
commit 3dc1d71dc0
2 changed files with 58 additions and 11 deletions

View File

@ -86,9 +86,12 @@ export default {
this.globalData.statusBarHeight = statusBarHeight || 20;
// #endif
// authCode url
console.log(window.location.href,"window.location.href")
const authCode = getQueryParam('authCode');
const sfId = getQueryParam('sfId');
const lockerId = getQueryParam('lockerId');
if(lockerId) {
uni.setStorageSync("lockerId", lockerId);
}
if(sfId) {
uni.setStorageSync("sfId", sfId);
}

View File

@ -1521,10 +1521,10 @@ const shareParams = {
url: `/pages/index/index?siteId=${state.value.siteId}&lockerId=${state.value.lockerId}`,
supportShare: 'YES'
}
setTimeout(() => {
console.log(Object.keys(SFUIP))
SFUIP.shareToWx(shareParams)
},3000)
// setTimeout(() => {
// console.log(Object.keys(SFUIP))
// SFUIP.shareToWx(shareParams)
// },3000)
if (params.q) {
let urlParams = decodeURIComponent(params.q);
@ -1541,12 +1541,13 @@ setTimeout(() => {
if (parseUrlRes.mediatorId) uni.setStorageSync('mediatorId', parseUrlRes.mediatorId);
}
//lockerId
let url = window.location.href;
if(parseUrlParams(url).lockerId){
// let url = window.location.href;
// if(parseUrlParams(url).lockerId){
}
// }
debugger
uni.$on('homeSiteId', (data) => {
if (data.id) {
state.value.siteId = data.id
@ -1560,9 +1561,53 @@ setTimeout(() => {
getLocation().then(() => {
// getSiteDetail()
});
const lockerId = uni.getStorageSync('lockerId')
if(lockerId){
state.value.lockerId = lockerId;
getLockerByLockerId();
}else{
getSiteDetail()
}
});
//
const getLockerByLockerId = async () => {
uni.showLoading();
//
reset();
state.value.lockerId = uni.getStorageSync('lockerId');
//
const lockerRes = await getSiteApi.GetLockerById({ lockerId: state.value.lockerId })
if(lockerRes.code == 200 ){
// siteId lockerId
if(lockerRes.data?.siteId){
//
state.value.selectUnitRow = lockerRes.data;
state.value.siteId = lockerRes.data.siteId;
const siteRes = await getSiteApi.GetUnitTypeBySiteId({ siteId: state.value.siteId })
if(siteRes.code == 200){
unitTypeData.value = siteRes.data
// .filter(item => item.hasAvailableLocker);
state.value.active = unitTypeData.value.findIndex(item => item.id == lockerRes.data.unitTypeId);
state.value.unitTypeId = lockerRes.data.unitTypeId;
startDriver();
isWaitingAppointment(true);
getLockerById();
}
}
}else{
uni.showToast({
title: lockerRes.msg,
icon: 'none',
duration: 2000
})
}
uni.hideLoading();
uni.removeStorageSync('lockerId')
}
onUnload(() => {
uni.$off('homeSiteId');
if(driverObj){
@ -1586,7 +1631,6 @@ const getLockerById = () => {
getSiteApi.GetLockerById({ lockerId: state.value.lockerId }).then((res) => {
if (res.code === 200) {
state.value.lockData = res.data;
console.log(state.value.lockData,"siteData");
if (state.value.lockData.isPreSale) {
//
state.value.zhuangxiuzhong = true;