Commit 5de73be78e1f1e0ba56b33d2a4f6cb28c19672a2
1 parent
cdceeb8b
1、2.3.1.驾驶员运单时取消上传卸车照片2、2.3.2.处理场所扫码-取消拍照上传3、2.3.3.身份选择修改-直接进入页面
Showing
5 changed files
with
71 additions
and
18 deletions
garbage-removal/dist.zip deleted
100644 → 0
No preview for this file type
garbage-removal/src/main.js
| ... | ... | @@ -4,7 +4,9 @@ import * as Pinia from 'pinia'; |
| 4 | 4 | import piniaPersistUni from "pinia-plugin-persist-uni"; |
| 5 | 5 | import { createSSRApp } from "vue"; |
| 6 | 6 | import mixin from './common/mixin'; |
| 7 | -import Vconsole from 'vconsole' | |
| 7 | + | |
| 8 | +// app调试组件 | |
| 9 | +// import Vconsole from 'vconsole' | |
| 8 | 10 | |
| 9 | 11 | // 引入uView对小程序分享的mixin封装 |
| 10 | 12 | import mpShare from '@/uview-plus/libs/mixin/mpShare.js'; |
| ... | ... | @@ -50,10 +52,12 @@ export function createApp() { |
| 50 | 52 | const app = createSSRApp(App); |
| 51 | 53 | const pinia = Pinia.createPinia() |
| 52 | 54 | app.use(uviewPlus) |
| 55 | + // app调试组件 | |
| 56 | + // new Vconsole(); | |
| 57 | + | |
| 53 | 58 | // 配置uView |
| 54 | 59 | // 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置 |
| 55 | 60 | // 需要在app.use(uview-plus)之后执行 |
| 56 | - new Vconsole(); | |
| 57 | 61 | uni.$u.setConfig({ |
| 58 | 62 | // 修改$u.config对象的属性 |
| 59 | 63 | config: { | ... | ... |
garbage-removal/src/pages/login/code.vue
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | |
| 17 | 17 | <script setup> |
| 18 | 18 | import { sendCode, userLogin } from "@/apis/user.js"; |
| 19 | +import { setRequestToken } from '@/utils/request/request.js'; | |
| 19 | 20 | import { useMainStore } from '@/stores/index.js'; |
| 20 | 21 | import { onLoad } from "@dcloudio/uni-app"; |
| 21 | 22 | import { getCurrentInstance, ref } from "vue"; |
| ... | ... | @@ -70,17 +71,61 @@ const noCaptcha = () => { |
| 70 | 71 | // 校验验证码 |
| 71 | 72 | const checkVerifyNum = (code) => { |
| 72 | 73 | userLogin({ loginType: 0, tel: iphoneNumber.value, code: code }).then(res => { |
| 73 | - console.log(res); | |
| 74 | + // console.log(res); | |
| 74 | 75 | // 登录成功 |
| 75 | 76 | if (res.data.code===200) { |
| 76 | 77 | verifyFlag.value = false; |
| 77 | 78 | store.tempToken = res.data.data.token |
| 79 | + if (res.data.data.token) { | |
| 80 | + setRequestToken(res.data.data.token) | |
| 81 | + } | |
| 78 | 82 | store.userName = res.data.data.name; |
| 83 | + store.userInfo.userName = res.data.data.name; | |
| 79 | 84 | store.userPhone = res.data.data.loginPhone; |
| 80 | 85 | if(res.data.data.testUser){ |
| 81 | - uni.navigateTo({ | |
| 82 | - url: `/pages/wode-info/wode-info-choose/index?ruleVos= ${encodeURIComponent(JSON.stringify(res.data.data.ruleVos))}&userName=${encodeURIComponent(res.data.data.name)}` | |
| 83 | - }); | |
| 86 | + // uni.navigateTo({ | |
| 87 | + // url: `/pages/wode-info/wode-info-choose/index?ruleVos= ${encodeURIComponent(JSON.stringify(res.data.data.ruleVos))}&userName=${encodeURIComponent(res.data.data.name)}`"" | |
| 88 | + // }); | |
| 89 | + if (store.tempToken) { | |
| 90 | + store.token = store.tempToken | |
| 91 | + store.tempToken = ""; | |
| 92 | + } | |
| 93 | + const ruleVos = res.data.data.ruleVos; | |
| 94 | + if(ruleVos!=null && ruleVos.length>0){ | |
| 95 | + // console.log(store.userInfo); | |
| 96 | + //默认用户 | |
| 97 | + store.userType = ruleVos[0].userType; | |
| 98 | + store.userInfo.userType = ruleVos[0].userType; | |
| 99 | + store.userInfo.ruleVos = ruleVos; | |
| 100 | + //判断是哪种角色 | |
| 101 | + for(let rule of ruleVos){ | |
| 102 | + store.userInfo.transportCompanyName = null; | |
| 103 | + // console.log(rule) | |
| 104 | + if(rule.userType==="处置场所负责人"){ | |
| 105 | + store.userType = rule.userType; | |
| 106 | + store.userInfo.userType = rule.userType; | |
| 107 | + store.userInfo.transportCompanyName = rule.transportCompanyName; | |
| 108 | + uni.$u.route({ | |
| 109 | + type: "switchTab", | |
| 110 | + url: `pages/order/index`, | |
| 111 | + }) | |
| 112 | + } | |
| 113 | + if(rule.userType==="运输企业负责人"){ | |
| 114 | + store.userType = rule.userType; | |
| 115 | + store.userInfo.userType = rule.userType; | |
| 116 | + store.userInfo.transportCompanyName = rule.transportCompanyName; | |
| 117 | + } | |
| 118 | + if(rule.userType==="清运车辆驾驶员"){ | |
| 119 | + store.userType = rule.userType; | |
| 120 | + store.userInfo.userType = rule.userType; | |
| 121 | + store.userInfo.transportCompanyName = rule.transportCompanyName; | |
| 122 | + } | |
| 123 | + } | |
| 124 | + } | |
| 125 | + uni.$u.route({ | |
| 126 | + type: "switchTab", | |
| 127 | + url: `/pages/home/index`, | |
| 128 | + }) | |
| 84 | 129 | }else{ |
| 85 | 130 | uni.$u.toast("该手机无法登录,不是投放点管理员"); |
| 86 | 131 | } | ... | ... |
garbage-removal/src/pages/order-info/order-disposal/scan-detail/index.vue
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | v-model="details.garCarryingWeight" @change="handlerInputChange"></up-input> |
| 57 | 57 | </view> |
| 58 | 58 | </view> |
| 59 | - <view class="scan-upload-fill-image-box"> | |
| 59 | + <!-- <view class="scan-upload-fill-image-box"> | |
| 60 | 60 | <view class="scan-upload-fill-image-label"> |
| 61 | 61 | <view> |
| 62 | 62 | 全景照片 |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | @afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="maxCount" |
| 71 | 71 | :previewFullImage="true"></u-upload> |
| 72 | 72 | </view> |
| 73 | - </view> | |
| 73 | + </view> --> | |
| 74 | 74 | </view> |
| 75 | 75 | <view class="scan-submit-button-box" v-if="isNew"> |
| 76 | 76 | <view class="scan-submit-button-btn"> |
| ... | ... | @@ -96,10 +96,12 @@ |
| 96 | 96 | ref, |
| 97 | 97 | onMounted |
| 98 | 98 | } from 'vue'; |
| 99 | + | |
| 99 | 100 | const details = ref({}); |
| 100 | 101 | const fileList = ref([]); |
| 101 | 102 | const isDeletable = ref(false); |
| 102 | 103 | const maxCount = computed(() => isDeletable.value ? 3 : fileList.value.length); |
| 104 | + | |
| 103 | 105 | // 删除图片 |
| 104 | 106 | const deletePic = (event) => { |
| 105 | 107 | fileList.value.splice(event.index, 1); |
| ... | ... | @@ -123,6 +125,11 @@ |
| 123 | 125 | window.takeLocationCallBack = takeLocalCallBack |
| 124 | 126 | }) |
| 125 | 127 | |
| 128 | + onLoad((options) => { | |
| 129 | + // 获取定位信息 | |
| 130 | + takeLocation(); | |
| 131 | + }); | |
| 132 | + | |
| 126 | 133 | const takeLocation = () => { |
| 127 | 134 | console.log("获取定位信息"); |
| 128 | 135 | // 获取定位信息 |
| ... | ... | @@ -133,8 +140,6 @@ |
| 133 | 140 | const isNew = ref(false) |
| 134 | 141 | // 新增图片 |
| 135 | 142 | const afterRead = async (event) => { |
| 136 | - // 获取定位信息 | |
| 137 | - takeLocation(); | |
| 138 | 143 | // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 |
| 139 | 144 | let lists = [].concat(event.file); |
| 140 | 145 | let fileListLen = fileList.value.length; |
| ... | ... | @@ -179,6 +184,7 @@ |
| 179 | 184 | console.log(val); |
| 180 | 185 | } |
| 181 | 186 | const handlerSubmit = async () => { |
| 187 | + | |
| 182 | 188 | // 校验参数 |
| 183 | 189 | let params = { |
| 184 | 190 | ...details.value, |
| ... | ... | @@ -223,9 +229,9 @@ |
| 223 | 229 | uni.$u.toast("请输入车辆载重"); |
| 224 | 230 | return false; |
| 225 | 231 | } |
| 226 | - if (!validateImage(params.fillImageList)) { | |
| 227 | - return false; | |
| 228 | - } | |
| 232 | + // if (!validateImage(params.fillImageList)) { | |
| 233 | + // return false; | |
| 234 | + // } | |
| 229 | 235 | |
| 230 | 236 | if (typeof(location.value.latitude) === 'undefined') { |
| 231 | 237 | console.log('定位获取失败', ); | ... | ... |
garbage-removal/src/pages/order-info/order-driver/detail/index.vue
| ... | ... | @@ -147,13 +147,13 @@ |
| 147 | 147 | :previewFullImage="true" :isReadOnly="true"></u-upload> |
| 148 | 148 | </view> |
| 149 | 149 | </view> |
| 150 | - <view class="order-detail-container-header-item"> | |
| 150 | +<!-- <view class="order-detail-container-header-item"> | |
| 151 | 151 | <text class=" order-detail-container-header-title">卸车照片:</text> |
| 152 | 152 | <view class="order-detail-container-header-content"> |
| 153 | 153 | <u-upload width="180" height="130" :fileList="putDownImages" name="3" multiple :maxCount="20" |
| 154 | 154 | :previewFullImage="true" :isReadOnly="true"></u-upload> |
| 155 | 155 | </view> |
| 156 | - </view> | |
| 156 | + </view> --> | |
| 157 | 157 | </view> |
| 158 | 158 | <view v-else class="empty-image" |
| 159 | 159 | style="width: 100%; display: flex; justify-content: center; align-items: center;"> |
| ... | ... | @@ -386,13 +386,11 @@ const createQrCodeValid = (val) => { |
| 386 | 386 | const handleUploadImage = (orderId, putType) => { |
| 387 | 387 | const data = dataGram.value; |
| 388 | 388 | uni.showActionSheet({ |
| 389 | - itemList: ['上传装车图片', '上传卸车图片'], | |
| 389 | + itemList: ['上传装车图片'], | |
| 390 | 390 | success: function (res) { |
| 391 | 391 | console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); |
| 392 | 392 | if(res.tapIndex === 0){ |
| 393 | 393 | uni.$u.route(`pages/order-info/order-driver/upload/index?orderId=${orderId}&carPlate=${data.garHandlerCarCode}&driver=${store.userInfo.userName}&putType=putOnImages`) |
| 394 | - }else{ | |
| 395 | - uni.$u.route(`pages/order-info/order-driver/upload/index?orderId=${orderId}&carPlate=${data.garHandlerCarCode}&driver=${store.userInfo.userName}&putType=putDownImages`) | |
| 396 | 394 | } |
| 397 | 395 | }, |
| 398 | 396 | fail: function (res) { | ... | ... |