Commit cf257520cada734441493395b8d1ea4ea5c4fa93
1 parent
fb77e9f7
feat: 压缩图片
Showing
8 changed files
with
31 additions
and
12 deletions
garbage-removal/src/pages/home/index.vue
| @@ -114,12 +114,12 @@ | @@ -114,12 +114,12 @@ | ||
| 114 | <view class="empty-text-title"> | 114 | <view class="empty-text-title"> |
| 115 | {{ prompt }} | 115 | {{ prompt }} |
| 116 | </view> | 116 | </view> |
| 117 | - <view class="empty-text-content" v-if="userType == '用户'"> | 117 | + <view class="empty-text-content"> |
| 118 | 房屋装饰装修过程中产生的砖瓦、木材、熟料等废弃物 | 118 | 房屋装饰装修过程中产生的砖瓦、木材、熟料等废弃物 |
| 119 | </view> | 119 | </view> |
| 120 | - <view class="empty-text-box" v-if="userType == '用户'"> | 120 | + <view class="empty-text-box"> |
| 121 | <view class=" empty-text-box-button"> | 121 | <view class=" empty-text-box-button"> |
| 122 | - 立即清运 | 122 | + {{ userType == '用户' ? '立即清运' : '角色切换' }} |
| 123 | </view> | 123 | </view> |
| 124 | </view> | 124 | </view> |
| 125 | </view> | 125 | </view> |
| @@ -137,11 +137,11 @@ import { useMainStore } from "@/stores/index.js"; | @@ -137,11 +137,11 @@ import { useMainStore } from "@/stores/index.js"; | ||
| 137 | import { onLoad, onShow } from '@dcloudio/uni-app'; | 137 | import { onLoad, onShow } from '@dcloudio/uni-app'; |
| 138 | import { computed, ref } from 'vue'; | 138 | import { computed, ref } from 'vue'; |
| 139 | const mainStore = useMainStore() | 139 | const mainStore = useMainStore() |
| 140 | -const userType = computed(() => mainStore.userType) | 140 | +const userType = computed(() => mainStore.userType); |
| 141 | const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单') | 141 | const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单') |
| 142 | // 定义最大积分 | 142 | // 定义最大积分 |
| 143 | let maxScore = 5 | 143 | let maxScore = 5 |
| 144 | -const maxStar = ref([]) | 144 | +const maxStar = ref([]); |
| 145 | const lightHeight = ref();//胶囊按钮信息 | 145 | const lightHeight = ref();//胶囊按钮信息 |
| 146 | const topMargin = ref(null);//状态栏高度 | 146 | const topMargin = ref(null);//状态栏高度 |
| 147 | const musicheadHeight = ref(); | 147 | const musicheadHeight = ref(); |
| @@ -309,7 +309,7 @@ const handleCleanClick = () => { | @@ -309,7 +309,7 @@ const handleCleanClick = () => { | ||
| 309 | // 用户已登录但是没有清运地址的情况 | 309 | // 用户已登录但是没有清运地址的情况 |
| 310 | if (userType.value == '用户') { | 310 | if (userType.value == '用户') { |
| 311 | uni.showModal({ | 311 | uni.showModal({ |
| 312 | - title: '', | 312 | + title: '提示', |
| 313 | content: prompt.value, | 313 | content: prompt.value, |
| 314 | success: function (res) { | 314 | success: function (res) { |
| 315 | if (res.confirm) { | 315 | if (res.confirm) { |
| @@ -321,6 +321,20 @@ const handleCleanClick = () => { | @@ -321,6 +321,20 @@ const handleCleanClick = () => { | ||
| 321 | } | 321 | } |
| 322 | } | 322 | } |
| 323 | }); | 323 | }); |
| 324 | + } else { | ||
| 325 | + uni.showModal({ | ||
| 326 | + title: '提示', | ||
| 327 | + content: '是否进行身份切换?', | ||
| 328 | + success: function (res) { | ||
| 329 | + if (res.confirm) { | ||
| 330 | + uni.$u.route({ | ||
| 331 | + url: `pages/wode/choose/index?ruleVos= ${encodeURIComponent(JSON.stringify([{ userType: '用户' }, mainStore.userInfo]))}`, | ||
| 332 | + }) | ||
| 333 | + } else if (res.cancel) { | ||
| 334 | + console.log('用户点击取消'); | ||
| 335 | + } | ||
| 336 | + } | ||
| 337 | + }); | ||
| 324 | } | 338 | } |
| 325 | } | 339 | } |
| 326 | return | 340 | return |
garbage-removal/src/pages/wode/choose/index.vue
| @@ -106,11 +106,16 @@ const handlerClick = (val) => { | @@ -106,11 +106,16 @@ const handlerClick = (val) => { | ||
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | const submit = (userType) => { | 108 | const submit = (userType) => { |
| 109 | - setRequestToken(store.tempToken) | 109 | + // 临时token的作用是在用户为选择完身份时判断 如果用户为选择身份则不会把在请求中携带token |
| 110 | + if (store.tempToken) { | ||
| 111 | + setRequestToken(store.tempToken) | ||
| 112 | + } | ||
| 110 | updateUserInfo({ garUserType: userType }).then(res => { | 113 | updateUserInfo({ garUserType: userType }).then(res => { |
| 111 | if (res.data.success) { | 114 | if (res.data.success) { |
| 112 | - store.token = store.tempToken | ||
| 113 | - store.tempToken = ""; | 115 | + if (store.tempToken) { |
| 116 | + store.token = store.tempToken | ||
| 117 | + store.tempToken = ""; | ||
| 118 | + } | ||
| 114 | store.userType = userType; | 119 | store.userType = userType; |
| 115 | store.userInfo = unitInfo.value[userType] | 120 | store.userInfo = unitInfo.value[userType] |
| 116 | uni.$u.route({ | 121 | uni.$u.route({ |
garbage-removal/src/pages/wode/index.vue
| @@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
| 15 | </view> | 15 | </view> |
| 16 | </view> | 16 | </view> |
| 17 | </view> | 17 | </view> |
| 18 | - <view class="u-m-t-20"> | 18 | + <view class="u-m-t-20" style="background-color: white;"> |
| 19 | <u-cell-group> | 19 | <u-cell-group> |
| 20 | <u-cell icon="map" iconStyle="font-size:28rpx" @click="handleAddressManager" title="地 址 管 理"></u-cell> | 20 | <u-cell icon="map" iconStyle="font-size:28rpx" @click="handleAddressManager" title="地 址 管 理"></u-cell> |
| 21 | </u-cell-group> | 21 | </u-cell-group> |
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | </u-cell-group> --> | 30 | </u-cell-group> --> |
| 31 | </view> | 31 | </view> |
| 32 | 32 | ||
| 33 | - <view class="u-m-t-40"> | 33 | + <view class="u-m-t-40" style="background-color: white;"> |
| 34 | <u-cell-group> | 34 | <u-cell-group> |
| 35 | <u-cell class="logout-cell" icon="setting" iconStyle="font-size:28rpx" @click="handleLoginOut" | 35 | <u-cell class="logout-cell" icon="setting" iconStyle="font-size:28rpx" @click="handleLoginOut" |
| 36 | title="退 出 登 录"></u-cell> | 36 | title="退 出 登 录"></u-cell> |
| @@ -151,7 +151,7 @@ const handleLoginOut = () => { | @@ -151,7 +151,7 @@ const handleLoginOut = () => { | ||
| 151 | 151 | ||
| 152 | .manager-info-transport-company-name { | 152 | .manager-info-transport-company-name { |
| 153 | display: flex; | 153 | display: flex; |
| 154 | - color: white; | 154 | + color: $u-main-color; |
| 155 | line-height: 80rpx; | 155 | line-height: 80rpx; |
| 156 | } | 156 | } |
| 157 | </style> | 157 | </style> |
garbage-removal/src/static/image/driver.png
garbage-removal/src/static/image/garbage.png
garbage-removal/src/static/image/handler.png
garbage-removal/src/static/image/st_pic.png
garbage-removal/src/static/image/user.png