diff --git a/components/tab-bar/myCenter.vue b/components/tab-bar/myCenter.vue
index f7095db..d32d216 100644
--- a/components/tab-bar/myCenter.vue
+++ b/components/tab-bar/myCenter.vue
@@ -14,7 +14,7 @@
{{schoolName}} ›
+ @tap.stop="navigatorTo('qiehuan')">{{schoolName1}} ›
切换校区
@@ -220,6 +220,7 @@
export default {
data() {
return {
+ schoolName1:'',
areaList: [],
schoolShop: [],
workerCounts: 0,
@@ -281,10 +282,6 @@
avatarText() {
return (this.userName || '张').slice(0, 1)
},
- schoolName() {
- const area = this.getArea()
- return uni.getStorageSync('schoolName') || area.title || '沧州师范学院'
- },
milkTeaCount() {
return Math.max(1, Math.round((Number(this.savedMoney) || 0) / 5))
},
@@ -591,6 +588,8 @@
},
init() {
this.applyCachedMyCenterImages()
+ const area = this.getArea()
+ this.schoolName1 = area.title
this.schoolShop = this.normalizeShopList(uni.getStorageSync('schoolShop'))
this.worker = uni.getStorageSync('worker')
let shopId = uni.getStorageSync('shopId')
@@ -661,6 +660,22 @@
},
onClickArea(item) {
uni.setStorageSync('area', JSON.stringify(item))
+ const area = this.getArea()
+ this.schoolName1 = uni.getStorageSync('schoolName') || area.title || '沧州师范学院'
+ this.tui.request("/worker/admin/add", "POST", {
+ userId: uni.getStorageSync('id'),
+ isChangeArea: 1,
+ region: area.id
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result != null) {
+ uni.setStorageSync('worker', res.result)
+ }
+ } else {
+ this.tui.toast(res.message)
+ }
+ uni.hideLoading()
+ }).catch((res) => {})
this.areaKeyword = ''
this.tui.toast('切换成功')
this.$refs.areaPopup.close()