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,7 +4,9 @@ import * as Pinia from 'pinia'; | ||
| 4 | import piniaPersistUni from "pinia-plugin-persist-uni"; | 4 | import piniaPersistUni from "pinia-plugin-persist-uni"; |
| 5 | import { createSSRApp } from "vue"; | 5 | import { createSSRApp } from "vue"; |
| 6 | import mixin from './common/mixin'; | 6 | import mixin from './common/mixin'; |
| 7 | -import Vconsole from 'vconsole' | 7 | + |
| 8 | +// app调试组件 | ||
| 9 | +// import Vconsole from 'vconsole' | ||
| 8 | 10 | ||
| 9 | // 引入uView对小程序分享的mixin封装 | 11 | // 引入uView对小程序分享的mixin封装 |
| 10 | import mpShare from '@/uview-plus/libs/mixin/mpShare.js'; | 12 | import mpShare from '@/uview-plus/libs/mixin/mpShare.js'; |
| @@ -50,10 +52,12 @@ export function createApp() { | @@ -50,10 +52,12 @@ export function createApp() { | ||
| 50 | const app = createSSRApp(App); | 52 | const app = createSSRApp(App); |
| 51 | const pinia = Pinia.createPinia() | 53 | const pinia = Pinia.createPinia() |
| 52 | app.use(uviewPlus) | 54 | app.use(uviewPlus) |
| 55 | + // app调试组件 | ||
| 56 | + // new Vconsole(); | ||
| 57 | + | ||
| 53 | // 配置uView | 58 | // 配置uView |
| 54 | // 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置 | 59 | // 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置 |
| 55 | // 需要在app.use(uview-plus)之后执行 | 60 | // 需要在app.use(uview-plus)之后执行 |
| 56 | - new Vconsole(); | ||
| 57 | uni.$u.setConfig({ | 61 | uni.$u.setConfig({ |
| 58 | // 修改$u.config对象的属性 | 62 | // 修改$u.config对象的属性 |
| 59 | config: { | 63 | config: { |
garbage-removal/src/pages/login/code.vue
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | 16 | ||
| 17 | <script setup> | 17 | <script setup> |
| 18 | import { sendCode, userLogin } from "@/apis/user.js"; | 18 | import { sendCode, userLogin } from "@/apis/user.js"; |
| 19 | +import { setRequestToken } from '@/utils/request/request.js'; | ||
| 19 | import { useMainStore } from '@/stores/index.js'; | 20 | import { useMainStore } from '@/stores/index.js'; |
| 20 | import { onLoad } from "@dcloudio/uni-app"; | 21 | import { onLoad } from "@dcloudio/uni-app"; |
| 21 | import { getCurrentInstance, ref } from "vue"; | 22 | import { getCurrentInstance, ref } from "vue"; |
| @@ -70,17 +71,61 @@ const noCaptcha = () => { | @@ -70,17 +71,61 @@ const noCaptcha = () => { | ||
| 70 | // 校验验证码 | 71 | // 校验验证码 |
| 71 | const checkVerifyNum = (code) => { | 72 | const checkVerifyNum = (code) => { |
| 72 | userLogin({ loginType: 0, tel: iphoneNumber.value, code: code }).then(res => { | 73 | userLogin({ loginType: 0, tel: iphoneNumber.value, code: code }).then(res => { |
| 73 | - console.log(res); | 74 | + // console.log(res); |
| 74 | // 登录成功 | 75 | // 登录成功 |
| 75 | if (res.data.code===200) { | 76 | if (res.data.code===200) { |
| 76 | verifyFlag.value = false; | 77 | verifyFlag.value = false; |
| 77 | store.tempToken = res.data.data.token | 78 | store.tempToken = res.data.data.token |
| 79 | + if (res.data.data.token) { | ||
| 80 | + setRequestToken(res.data.data.token) | ||
| 81 | + } | ||
| 78 | store.userName = res.data.data.name; | 82 | store.userName = res.data.data.name; |
| 83 | + store.userInfo.userName = res.data.data.name; | ||
| 79 | store.userPhone = res.data.data.loginPhone; | 84 | store.userPhone = res.data.data.loginPhone; |
| 80 | if(res.data.data.testUser){ | 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 | }else{ | 129 | }else{ |
| 85 | uni.$u.toast("该手机无法登录,不是投放点管理员"); | 130 | uni.$u.toast("该手机无法登录,不是投放点管理员"); |
| 86 | } | 131 | } |
garbage-removal/src/pages/order-info/order-disposal/scan-detail/index.vue
| @@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
| 56 | v-model="details.garCarryingWeight" @change="handlerInputChange"></up-input> | 56 | v-model="details.garCarryingWeight" @change="handlerInputChange"></up-input> |
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | - <view class="scan-upload-fill-image-box"> | 59 | + <!-- <view class="scan-upload-fill-image-box"> |
| 60 | <view class="scan-upload-fill-image-label"> | 60 | <view class="scan-upload-fill-image-label"> |
| 61 | <view> | 61 | <view> |
| 62 | 全景照片 | 62 | 全景照片 |
| @@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
| 70 | @afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="maxCount" | 70 | @afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="maxCount" |
| 71 | :previewFullImage="true"></u-upload> | 71 | :previewFullImage="true"></u-upload> |
| 72 | </view> | 72 | </view> |
| 73 | - </view> | 73 | + </view> --> |
| 74 | </view> | 74 | </view> |
| 75 | <view class="scan-submit-button-box" v-if="isNew"> | 75 | <view class="scan-submit-button-box" v-if="isNew"> |
| 76 | <view class="scan-submit-button-btn"> | 76 | <view class="scan-submit-button-btn"> |
| @@ -96,10 +96,12 @@ | @@ -96,10 +96,12 @@ | ||
| 96 | ref, | 96 | ref, |
| 97 | onMounted | 97 | onMounted |
| 98 | } from 'vue'; | 98 | } from 'vue'; |
| 99 | + | ||
| 99 | const details = ref({}); | 100 | const details = ref({}); |
| 100 | const fileList = ref([]); | 101 | const fileList = ref([]); |
| 101 | const isDeletable = ref(false); | 102 | const isDeletable = ref(false); |
| 102 | const maxCount = computed(() => isDeletable.value ? 3 : fileList.value.length); | 103 | const maxCount = computed(() => isDeletable.value ? 3 : fileList.value.length); |
| 104 | + | ||
| 103 | // 删除图片 | 105 | // 删除图片 |
| 104 | const deletePic = (event) => { | 106 | const deletePic = (event) => { |
| 105 | fileList.value.splice(event.index, 1); | 107 | fileList.value.splice(event.index, 1); |
| @@ -123,6 +125,11 @@ | @@ -123,6 +125,11 @@ | ||
| 123 | window.takeLocationCallBack = takeLocalCallBack | 125 | window.takeLocationCallBack = takeLocalCallBack |
| 124 | }) | 126 | }) |
| 125 | 127 | ||
| 128 | + onLoad((options) => { | ||
| 129 | + // 获取定位信息 | ||
| 130 | + takeLocation(); | ||
| 131 | + }); | ||
| 132 | + | ||
| 126 | const takeLocation = () => { | 133 | const takeLocation = () => { |
| 127 | console.log("获取定位信息"); | 134 | console.log("获取定位信息"); |
| 128 | // 获取定位信息 | 135 | // 获取定位信息 |
| @@ -133,8 +140,6 @@ | @@ -133,8 +140,6 @@ | ||
| 133 | const isNew = ref(false) | 140 | const isNew = ref(false) |
| 134 | // 新增图片 | 141 | // 新增图片 |
| 135 | const afterRead = async (event) => { | 142 | const afterRead = async (event) => { |
| 136 | - // 获取定位信息 | ||
| 137 | - takeLocation(); | ||
| 138 | // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 | 143 | // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 |
| 139 | let lists = [].concat(event.file); | 144 | let lists = [].concat(event.file); |
| 140 | let fileListLen = fileList.value.length; | 145 | let fileListLen = fileList.value.length; |
| @@ -179,6 +184,7 @@ | @@ -179,6 +184,7 @@ | ||
| 179 | console.log(val); | 184 | console.log(val); |
| 180 | } | 185 | } |
| 181 | const handlerSubmit = async () => { | 186 | const handlerSubmit = async () => { |
| 187 | + | ||
| 182 | // 校验参数 | 188 | // 校验参数 |
| 183 | let params = { | 189 | let params = { |
| 184 | ...details.value, | 190 | ...details.value, |
| @@ -223,9 +229,9 @@ | @@ -223,9 +229,9 @@ | ||
| 223 | uni.$u.toast("请输入车辆载重"); | 229 | uni.$u.toast("请输入车辆载重"); |
| 224 | return false; | 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 | if (typeof(location.value.latitude) === 'undefined') { | 236 | if (typeof(location.value.latitude) === 'undefined') { |
| 231 | console.log('定位获取失败', ); | 237 | console.log('定位获取失败', ); |
garbage-removal/src/pages/order-info/order-driver/detail/index.vue
| @@ -147,13 +147,13 @@ | @@ -147,13 +147,13 @@ | ||
| 147 | :previewFullImage="true" :isReadOnly="true"></u-upload> | 147 | :previewFullImage="true" :isReadOnly="true"></u-upload> |
| 148 | </view> | 148 | </view> |
| 149 | </view> | 149 | </view> |
| 150 | - <view class="order-detail-container-header-item"> | 150 | +<!-- <view class="order-detail-container-header-item"> |
| 151 | <text class=" order-detail-container-header-title">卸车照片:</text> | 151 | <text class=" order-detail-container-header-title">卸车照片:</text> |
| 152 | <view class="order-detail-container-header-content"> | 152 | <view class="order-detail-container-header-content"> |
| 153 | <u-upload width="180" height="130" :fileList="putDownImages" name="3" multiple :maxCount="20" | 153 | <u-upload width="180" height="130" :fileList="putDownImages" name="3" multiple :maxCount="20" |
| 154 | :previewFullImage="true" :isReadOnly="true"></u-upload> | 154 | :previewFullImage="true" :isReadOnly="true"></u-upload> |
| 155 | </view> | 155 | </view> |
| 156 | - </view> | 156 | + </view> --> |
| 157 | </view> | 157 | </view> |
| 158 | <view v-else class="empty-image" | 158 | <view v-else class="empty-image" |
| 159 | style="width: 100%; display: flex; justify-content: center; align-items: center;"> | 159 | style="width: 100%; display: flex; justify-content: center; align-items: center;"> |
| @@ -386,13 +386,11 @@ const createQrCodeValid = (val) => { | @@ -386,13 +386,11 @@ const createQrCodeValid = (val) => { | ||
| 386 | const handleUploadImage = (orderId, putType) => { | 386 | const handleUploadImage = (orderId, putType) => { |
| 387 | const data = dataGram.value; | 387 | const data = dataGram.value; |
| 388 | uni.showActionSheet({ | 388 | uni.showActionSheet({ |
| 389 | - itemList: ['上传装车图片', '上传卸车图片'], | 389 | + itemList: ['上传装车图片'], |
| 390 | success: function (res) { | 390 | success: function (res) { |
| 391 | console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); | 391 | console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); |
| 392 | if(res.tapIndex === 0){ | 392 | if(res.tapIndex === 0){ |
| 393 | uni.$u.route(`pages/order-info/order-driver/upload/index?orderId=${orderId}&carPlate=${data.garHandlerCarCode}&driver=${store.userInfo.userName}&putType=putOnImages`) | 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 | fail: function (res) { | 396 | fail: function (res) { |