提交 扫码功能
This commit is contained in:
parent
25ca4ccb31
commit
3dc1d71dc0
5
App.vue
5
App.vue
@ -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);
|
||||
}
|
||||
|
||||
@ -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()
|
||||
});
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user