fix: 修复了一些东西,新增了方法
This commit is contained in:
32
App.vue
32
App.vue
@@ -4,6 +4,7 @@
|
||||
} from './request/api/api'
|
||||
import { webSocketManager } from '@/utils/ws/websocket.js';
|
||||
import {checkDev} from "@/utils/utils";
|
||||
import {bindUserApi} from "@/request/api/salesperson";
|
||||
export default {
|
||||
// //初始化状态-如果登录过,保持登录状态
|
||||
onLaunch: async function() {
|
||||
@@ -100,14 +101,41 @@
|
||||
return {};
|
||||
|
||||
const scene = decodeURIComponent(e.query.scene)
|
||||
// 这里接收扫码参数
|
||||
if (scene) {
|
||||
// 判断scene中是否包含sal_id
|
||||
let isSalespersonId = decodeURIComponent(e.query.scene).includes('sal_id');
|
||||
const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_')
|
||||
uni.setStorageSync('stores_id', scene[1])
|
||||
if (scene[1]) {
|
||||
uni.setStorageSync('stores_id', scene[1])
|
||||
uni.setStorageSync('store_id', scene[1])
|
||||
}
|
||||
// uni.setStorageSync('stores_id', scene[1])
|
||||
const st_id = decodeURIComponent(e.query.scene).split('&')
|
||||
let store_id = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_')
|
||||
store_id = decodeURIComponent(store_id[1]).split('&')
|
||||
const doctors_id = decodeURIComponent(e.query.scene).split('=')
|
||||
if (store_id[0] !== 'undefined') {
|
||||
uni.setStorageSync('stores_id', store_id[0])
|
||||
uni.setStorageSync('store_id', store_id[0])
|
||||
}
|
||||
uni.setStorageSync('doctors_id', st_id[0].split('su_id=')[1])
|
||||
if (isSalespersonId) {
|
||||
uni.setStorageSync('sal_id', st_id[1].split('sal_id=')[1])
|
||||
}
|
||||
uni.setStorageSync('st_id', doctors_id[2])
|
||||
// console.log(scene[1], '4444');
|
||||
|
||||
let userId = uni.getStorageSync('user_id')
|
||||
if (isSalespersonId && userId) {
|
||||
bindUserApi({
|
||||
user_id: userId,
|
||||
salesperson_id: st_id[1].split('sal_id=')[1],
|
||||
}).then((res) => {
|
||||
console.log('userId', userId, st_id[0].split('su_id=')[1], res);
|
||||
})
|
||||
}
|
||||
// console.log(st_id, '4444111111111');
|
||||
// console.log(scene, '4444');
|
||||
}
|
||||
// const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_')
|
||||
// console.log(scene, '11111');
|
||||
|
||||
Reference in New Issue
Block a user