@@ -166,6 +166,10 @@ | |||
import filter from '@/components/filter/filter.vue'; | |||
import { source } from "@/utils/network/difference"; | |||
import { vehiclePlateColor, vehiclePlateColorPai, getVehiclePlateColorPaiShow } from "@/datas/vehiclePlateColor.js"; | |||
import { useUserStore } from "@/stores/user"; | |||
const userStore = useUserStore(); | |||
const { saveUserInfo } = userStore; | |||
const height = ref(null); | |||
const top = ref(null); | |||
const margin = ref(null); | |||
@@ -244,9 +248,9 @@ | |||
.then((res) => { | |||
console.log('用户信息', res) | |||
let data = res | |||
saveUserInfo(data) | |||
state.accountInfoVo = data; | |||
console.log("获取用户信息", data); | |||
console.log("获取用户信息", getItem('userInfo')); | |||
}) | |||
.catch((err) => { | |||
console.log(err); |
@@ -31,6 +31,7 @@ export const useUserStore = defineStore("userStore", { | |||
access_token: "", | |||
//openId | |||
openId: "", | |||
userInfo: '', | |||
}), | |||
getters: {}, | |||
@@ -41,6 +42,10 @@ export const useUserStore = defineStore("userStore", { | |||
this.access_token = token; | |||
setItem(StorageKeys.Token, token); | |||
}, | |||
saveUserInfo(userInfo) { | |||
this.userInfo = userInfo; | |||
setItem('userInfo', userInfo); | |||
}, | |||
//设置openId | |||
saveOpenId(openId) { |
@@ -59,11 +59,15 @@ | |||
import { reactive, ref } from "vue"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
import { requestNew } from "@/utils/network/request.js"; | |||
import { customerQuery } from "@/utils/network/api.js"; | |||
import { customerQuery, etcChange } from "@/utils/network/api.js"; | |||
import { setItem, getItem } from "../../utils/storage"; | |||
import { | |||
getCredentialType | |||
} from "@/datas/credentialType.js"; | |||
import { useUserStore } from "@/stores/user"; | |||
const userStore = useUserStore(); | |||
const { saveUserInfo } = userStore; | |||
const state = reactive({ | |||
personArr: ref([]), | |||
uniArr: ref([]), | |||
@@ -86,7 +90,7 @@ | |||
.then((res) => { | |||
console.log('用户信息', res) | |||
state.allData = res | |||
const customerId = getItem('customerObj') ? getItem('customerObj')['customerId'] : "" | |||
const customerId = getItem('userInfo') ? getItem('userInfo')['customerId'] : "" | |||
console.log('customerId====111',customerId) | |||
state.customerId = customerId | |||
for (var i = 0; i < res.length; i++) { | |||
@@ -121,8 +125,7 @@ | |||
content: '确定选择账户', | |||
success: function (res) { | |||
if (res.confirm) { | |||
setItem('customerObj', choiceData[0]) | |||
uni.navigateBack() | |||
switchCustomer(choiceData[0]) | |||
} else if (res.cancel) { | |||
console.log('用户点击取消'); | |||
} | |||
@@ -131,6 +134,21 @@ | |||
console.log("choiceData", choiceData) | |||
} | |||
const switchCustomer = (choiceData) => { | |||
requestNew(etcChange, { | |||
customerId: choiceData.customerId | |||
}) | |||
.then((res) => { | |||
console.log('用户信息', res) | |||
let userInfo = getItem('userInfo'); | |||
userInfo.customerId = choiceData.customerId; | |||
saveUserInfo(userInfo); | |||
uni.navigateBack() | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
} | |||
</script> | |||
<style scoped lang="scss"> |
@@ -370,6 +370,7 @@ export const couponQuery = "/iaw/issue/equityLink/pageEquityDetail" //根据手 | |||
export const queryActiveInfo = "/iaw/api/secondActive/queryActiveInfo" //查询激活信息 | |||
//ETC产品状态名单查询 | |||
export const etcChange = "/iaw/portal/etcChange" | |||
export const selectproductlist = "/iaw/app/issue/state/selectproductlist" //ETC产品状态名单查询 | |||
export const stateDetail = "/iaw/app/issue/state/detail" //查询推广发行产品管理详情 | |||
//设备升级 |