单位名称

master
jevononlie 6 months ago
parent cc2f809f60
commit 3f9c7d1772

@ -45,7 +45,7 @@ const isBooking = computed(() => {
})
//
const isShowUnit = computed(() => {
const flag = memberStore.profile?.clientType == 2 ? true : false
const flag = unitList.value.length ? true : false
return flag
})
const unitList = ref([])
@ -53,21 +53,6 @@ const unitIndex = ref(0)
const bindUnitPickerChange = (e: any) => {
unitIndex.value = e.detail.value
}
onLoad(async () => {
const categoryListStore = categoryStore.categoryVal
categoryList = Object.assign([], categoryListStore)
if (isShowUnit.value) {
const params = {
mobilePhone: memberStore.profile?.phone
}
const res = await getUnitListAPI(params)
unitList.value = res.data
}
})
onShow(() => {
init()
})
const init = async () => {
//
const productCode = uni.getStorageSync('productCode')
@ -83,6 +68,16 @@ const init = async () => {
await getMemberAddressData()
//
await getNearbySite()
//
await getUnitList()
}
//
const getUnitList = async () => {
const params = {
mobilePhone: memberStore.profile?.phone
}
const res = await getUnitListAPI(params)
unitList.value = res.data
}
//
const isTriggered = ref(false)
@ -171,6 +166,13 @@ const getMemberAddressData = async () => {
})
}
}
onLoad(async () => {
const categoryListStore = categoryStore.categoryVal
categoryList = Object.assign([], categoryListStore)
})
onShow(() => {
init()
})
//
const activeWeightKey = ref(0)
const handleWeightChange = (val) => {
@ -333,7 +335,7 @@ const handlePopClose = (item) => {
<switch color="#3775F6" :checked="isUnit" @change="switchUnitChange" style="transform:scale(0.7)" />
</view>
<view class="uni-list-cell" v-if="isUnit">
<view class="uni-list-cell-left">单位名称</view>
<view class="uni-list-cell-left">单位名称</view>
<view class="uni-list-cell-db">
<picker @change="bindUnitPickerChange" :value="unitIndex" :range="unitList">
<view class="uni-input">{{ unitList[unitIndex] }}</view>

@ -14,11 +14,6 @@ const isLogin = computed(() => {
const token = memberStore.profile?.token
return !!token
})
//
const isShowUnit = computed(() => {
const flag = memberStore.profile?.clientType == 2 ? true : false
return flag
})
const banlance = ref(0)
const avatar = ref('')
@ -180,10 +175,6 @@ const handleJump = (type) => {
<uni-icons type="settings" color="#3775F6" size="20"></uni-icons>
<view class="label"> 设置 </view>
</navigator>
<button hover-class="none" class="item flex-version" v-if="isShowUnit">
<view class="label">单位</view>
<view class="version">{{ memberStore.profile?.clientUnitName }}</view>
</button>
<button hover-class="none" class="item flex-version">
<view class="label">版本</view>
<view class="version">{{ version }}</view>

Loading…
Cancel
Save