From e7405bb543d28c8e81402e7219575b83146942d4 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期五, 15 九月 2023 09:55:20 +0800
Subject: [PATCH] 司机我的提交遗漏
---
pages/driver-page/drvier-my/drvier-my.vue | 379 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 288 insertions(+), 91 deletions(-)
diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue
index f3ce250..6697c68 100644
--- a/pages/driver-page/drvier-my/drvier-my.vue
+++ b/pages/driver-page/drvier-my/drvier-my.vue
@@ -1,24 +1,29 @@
<template>
<view class="driver-my">
- <view class="driver-banner">
- <view class="navgation">鎴戠殑</view>
- <view class="avatar">
- <view class="avatar-imgage"
- style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;">
+ <view class=""
+ style="height: 446rpx;width: 100%;">
+ <view class="driver-banner">
+ <view class="navgation">鎴戠殑</view>
+ <view class="avatar">
+ <view class="avatar-imgage"
+ :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/driverava.png)`, backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }">
+ </view>
+ <view class="avatar-name">{{ userInfo.name || '' }}</view>
+ <view class="edit-button"><u-button type="primary"
+ @click="editBtnClick"
+ shape="circle"
+ plain>缂栬緫涓汉璧勬枡</u-button></view>
</view>
- <view class="avatar-name">{{ userInfo.name || '' }}</view>
- <view class="edit-button"><u-button type="primary"
- @click="editBtnClick"
- shape="circle"
- plain>缂栬緫涓汉璧勬枡</u-button></view>
</view>
+ </view>
+ <view class="information-block">
<view class="personal-information">
<view class="personal-information-block">
<view class="block-main">
<view class="information-line"
@click="">
<view class="line-label">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/personalicon.png"
+ <image :src="`${onlineurl}/appimg/image/banner/personalicon.png`"
mode="widthFix"></image>
<view class="label-text">韬唤璇佸彿</view>
</view>
@@ -29,7 +34,7 @@
</view>
<view class="information-line">
<view class="line-label">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/phonenum.png"
+ <image :src="`${onlineurl}/appimg/image/banner/phonenum.png`"
mode="widthFix"></image>
<view class="label-text">鎵嬫満鍙�</view>
</view>
@@ -40,7 +45,7 @@
</view>
<view class="information-line">
<view class="line-label">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/carnum.png"
+ <image :src="`${onlineurl}/appimg/image/banner/carnum.png`"
mode="widthFix"></image>
<view class="label-text">杞︾墝鍙�</view>
</view>
@@ -51,7 +56,7 @@
</view>
<view class="information-line">
<view class="line-label">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/axisnum.png"
+ <image :src="`${onlineurl}/appimg/image/banner/axisnum.png`"
mode="widthFix"></image>
<view class="label-text">杞﹁酱鏁�</view>
</view>
@@ -60,15 +65,25 @@
<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.axleNum"></u-icon> -->
</view>
</view>
+ <view class="information-line">
+ <view class="line-label">
+ <image :src="`${onlineurl}/appimg/image/banner/axisnum.png`"
+ mode="widthFix"></image>
+ <view class="label-text">杞︾墝棰滆壊</view>
+ </view>
+ <view class="information-value">
+ {{ userInfo.vehicleColour || '' }}
+ <!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.axleNum"></u-icon> -->
+ </view>
+ </view>
<view class="information-line last">
<view class="line-label">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/weighnum.png"
+ <image :src="`${onlineurl}/appimg/image/banner/weighnum.png`"
mode="widthFix"></image>
<view class="label-text">浣撻噸</view>
</view>
<view class="information-value">
{{ userInfo.weight || '' }}
- <!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.weight"></u-icon> -->
</view>
</view>
</view>
@@ -80,7 +95,7 @@
<view class="information-body">
<view class="car-img">
<view class="label-title">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/carimg.png"
+ <image :src="`${onlineurl}/appimg/image/banner/carimg.png`"
mode="widthFix"></image>
<view class="label-text">杞﹁締鐓х墖</view>
</view>
@@ -97,7 +112,31 @@
</view>
<view class="car-img">
<view class="label-title">
- <image src="https://mx.jzeg.cn:9095/appimg/image/banner/cardimg.png"
+ <image :src="`${onlineurl}/appimg/image/banner/cardimg.png`"
+ mode="widthFix"></image>
+ <view class="label-text">杞﹀ご杞﹀熬杞﹁韩鐓х墖</view>
+ </view>
+ <view class="img-container special">
+ <view class="img-container_item"
+ v-for="item in userInfo.bodyCarImg">
+ <u--image :showLoading="true"
+ :src="BaseUrl+item"
+ width="80px"
+ height="80px"
+ @click="imageClickCarBody(item)">
+ <view slot="error"
+ style="font-size: 24rpx;">鍔犺浇澶辫触</view>
+ </u--image>
+ </view>
+ </view>
+ <view style="display: flex;align-items: center;height: 100%; width: 150rpx;"
+ v-if='userInfo.bodyCarImg?(userInfo.bodyCarImg.length===0?true:false):true'>
+ 鏆傛棤鍥剧墖
+ </view>
+ </view>
+ <view class="car-img">
+ <view class="label-title">
+ <image :src="`${onlineurl}/appimg/image/banner/cardimg.png`"
mode="widthFix"></image>
<view class="label-text">琛岄┒璇佺収鐗�</view>
</view>
@@ -116,49 +155,42 @@
</view>
</view>
<view class="loginout">
+ <view class="loginout-main"><u-button text="閲嶇疆瀵嗙爜"
+ type="primary"
+ @click="initPwd"
+ shape="circle"
+ plain></u-button></view>
<view class="loginout-main"><u-button text="閫�鍑虹櫥褰�"
type="primary"
@click="logout"
shape="circle"
plain></u-button></view>
</view>
- <!-- <view class="personal-information-form">
- <u--form labelPosition="left" :model="userInfo" ref="form1">
- <u-form-item labelWidth="20%" label="濮撳悕" ref="item1">
- <u--input v-model="userInfo.name" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item labelWidth="20%" label="韬唤璇佸彿" ref="item1">
- <u--input v-model="userInfo.idCard" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item labelWidth="20%" label="鎵嬫満鍙�" ref="item1">
- <u--input v-model="userInfo.phone" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item labelWidth="20%" label="杞︾墝鍙�" ref="item1">
- <u--input v-model="userInfo.carNo" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item labelWidth="20%" label="浣撻噸" ref="item1">
- <u--input v-model="userInfo.weight" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item v-model="userInfo.axleNum" labelWidth="20%" label="杞﹁酱鏁�" ref="item1">
- <u--input border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
- </u-form-item>
- <u-form-item labelWidth="20%" label="杞﹁締鐓х墖" ref="item1">
- <u--image :showLoading="true" :src="userInfo.carImg != null ? BaseUrl + userInfo.carImg : ''" width="80px" height="80px" @click="imageClick(1)">
- <view slot="error" style="font-size: 24rpx;">鍔犺浇澶辫触</view>
- </u--image>
- </u-form-item>
- <u-form-item labelWidth="25%" label="琛岄┒璇佺収鐗�" ref="item1">
- <u--image :showLoading="true" :src="userInfo.drivingImg != null ? BaseUrl + userInfo.drivingImg : ''" width="80px" height="80px" @click="imageClick(2)">
- <view slot="error" style="font-size: 24rpx;">鍔犺浇澶辫触</view>
- </u--image>
- </u-form-item>
- </u--form>
- <view class="push-information-button">
- <u-button text="淇敼涓汉璧勬枡" type="primary" @click="editBtnClick"></u-button>
- <u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout"></u-button>
- </view> -->
- <!-- <view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view> -->
- <!-- </view> -->
+ <!-- 寮曞椤� -->
+ <view class="noob-tour"
+ style="margin-top: 80rpx;">
+ <combined-title title="鎿嶄綔鎸囧紩"></combined-title>
+ <u-cell-group>
+ <u-cell title="鏂版墜鎸囧紩"
+ name='1'
+ :clickable="true"
+ @click="noobTour">
+ <u-badge type="primary"
+ value="01"
+ slot='icon'></u-badge>
+ <u-icon slot="value"
+ name="arrow-right"
+ size="30"
+ color="#b8b8b8"></u-icon>
+ </u-cell>
+ </u-cell-group>
+ </view>
+ <!-- 鍥剧墖棰勮寮瑰嚭妗� -->
+ <view class="previewImage-container">
+ <previewImage ref="previewImage"
+ :imgs="driverTourImgList"
+ :saveBtn='false'></previewImage>
+ </view>
<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
<view class="previewImage-container">
@@ -210,12 +242,37 @@
inputAlign="left"></u--input>
</u-form-item>
<u-form-item labelWidth="20%"
+ label="淇敼瀵嗙爜"
+ prop="password">
+ <u--input v-model="editUserInfo.password"
+ border="none"
+ inputAlign="left"></u--input>
+ </u-form-item>
+ <u-form-item labelWidth="20%"
label="杞︾墝鍙�"
prop="carNo"
required>
<u--input v-model="editUserInfo.carNo"
border="none"
inputAlign="left"></u--input>
+ </u-form-item>
+ <u-form-item labelWidth="20%"
+ label="杞︾墝棰滆壊"
+ required
+ prop="vehicleColour">
+ <u-radio-group v-model="editUserInfo.vehicleColour"
+ placement="row"
+ size="30"
+ shape="circle"
+ iconSize="20">
+ <u-radio labelSize="14px"
+ size="20px"
+ :customStyle="{ marginBottom: '8px' }"
+ v-for="(item, index) in radiolist2"
+ :key="index"
+ :label="item.name"
+ :name="item.value"></u-radio>
+ </u-radio-group>
</u-form-item>
<u-form-item labelWidth="20%"
label="浣撻噸"
@@ -249,6 +306,23 @@
height="150"
:previewFullImage="true"></u-upload>
</u-form-item>
+ <u-form-item prop="bodyofcarJpg"
+ label="杞﹀ご杞﹀熬杞﹁韩鐓х墖"
+ labelWidth="20%"
+ required
+ @click="beforeRead">
+ <u-upload :fileList="fileList3"
+ deletable
+ @afterRead="afterRead"
+ @delete="deletePic"
+ name="3"
+ multiple
+ :maxCount="3"
+ width="250"
+ height="150"
+ :previewFullImage="true">
+ </u-upload>
+ </u-form-item>
<u-form-item labelWidth="25%"
label="琛岄┒璇佺収鐗�"
ref="item1"
@@ -280,14 +354,32 @@
@confirm="logoutConfirm"
@cancel="logoutCancel"></u-modal>
</view>
+ <view class="initPwdModal">
+ <u-modal :show="initPwdShow"
+ title="閲嶇疆瀵嗙爜"
+ showCancelButton
+ content="鍒濆瀵嗙爜灏嗗彉鏇翠负123456,鏄惁纭閲嶇疆"
+ @confirm="initPwdConfirm"
+ @cancel="initPwdCancel"></u-modal>
+ </view>
</view>
</template>
<script>
import { customerId, userInfo, redirectLogin } from '@/utils/status';
import { BaseUrl } from '@/api/publicInterface.js';
- import { mapMutations } from 'vuex';
+ import { mapMutations, mapState } from 'vuex';
+ import { onlineurl } from '@/api/request.js'
+ import combinedTitle from '@/components/combined-title/combined-title.vue';
+ import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
export default {
+ components: {
+ combinedTitle,
+ previewImage
+ },
+ computed: {
+ ...mapState(['driverTourImgList']),
+ },
data() {
return {
// 鑾峰彇鐨勫徃鏈鸿鎯�
@@ -304,7 +396,10 @@
drivingImg: '',
axleNum: '',
weight: '',
- userId: ''
+ userId: '',
+ vehicleColour: '',
+ bodyofcarJpg: '',
+ password: ''
},
rules: {
name: {
@@ -346,8 +441,22 @@
weight: {
type: 'number',
required: true,
- message: '璇峰~鍐欎綋閲�',
- trigger: ['blur', 'change']
+ trigger: ['blur', 'change'],
+ transform(value) {
+ return Number(value);
+ },
+ validator: (rule, value, callback) => {
+ if (!value) {
+ callback(new Error('璇峰~鍐欎綋閲�'))
+ } else if (value > 200) {
+ callback(new Error('璇峰~鍐欏悎鐞嗕綋閲�'))
+ } else {
+ callback()
+ }
+ }
+ },
+ password: {
+ required: false,
},
carNo: [{
type: 'string',
@@ -366,6 +475,12 @@
trigger: ['change', 'blur']
}
],
+ vehicleColour: {
+ type: 'string',
+ required: true,
+ message: '璇烽�夋嫨杞︾墝棰滆壊',
+ trigger: ['blur', 'change']
+ },
axleNum: [{
transform(value) {
return Number(value);
@@ -382,6 +497,12 @@
message: '璇蜂笂浼犺溅杈嗗浘鐗�',
trigger: ['blur', 'change']
},
+ bodyofcarJpg: {
+ type: 'string',
+ required: true,
+ message: '璇蜂笂浼犺溅杈嗗浘鐗�',
+ trigger: ['blur', 'change']
+ },
drivingImg: {
type: 'string',
required: true,
@@ -392,6 +513,9 @@
src: '',
fileList1: [],
fileList2: [],
+ // 杞﹀ご杞﹁韩杞﹀熬鐓х墖
+ fileList3: [],
+ carBody: [],
// 淇敼淇℃伅寮瑰嚭妗�
editDriverPopupShow: false,
// previewImage
@@ -401,7 +525,22 @@
logoutShow: false,
logoutTitle: '鎻愮ず',
logoutContent: '鏄惁纭閫�鍑�',
- BaseUrl
+ BaseUrl,
+ onlineurl,
+ radiolist2: [{
+ name: '榛勮壊',
+ value: '榛勮壊'
+ },
+ {
+ name: '榛勭豢鑹�',
+ value: '榛勭豢鑹�'
+ },
+ {
+ name: '钃濊壊',
+ value: '钃濊壊'
+ }
+ ],
+ initPwdShow: false
};
},
onShow() {
@@ -411,7 +550,7 @@
this.$refs.editRef.setRules(this.rules);
},
methods: {
- ...mapMutations(['changeisUploadimg']),
+ ...mapMutations(['changeisUploadimg', 'changeisLogin']),
init() {
this.getUserEntity();
},
@@ -421,24 +560,41 @@
});
this.$reqGet('getUserEntity').then(res => {
uni.hideLoading();
- this.userInfo = res.data;
+ this.editUserInfo = this.userInfo = res.data;
+ this.userInfo.bodyCarImg = this.userInfo.bodyofcarJpg ? this.userInfo.bodyofcarJpg.split(',') :
+ [];
+ console.log(this.userInfo.bodyCarImg);
+ this.editUserInfo.password = ""
uni.setStorageSync('carImg', this.userInfo.carImg);
uni.setStorageSync('drivingImg', this.userInfo.drivingImg);
+ uni.setStorageSync('bodyofcarJpg', this.userInfo.bodyofcarJpg)
if (this.fileList1.length == 0) {
+
this.fileList1.push({
url: `${BaseUrl}${this.userInfo.carImg}`
- });
+ })
}
if (this.fileList2.length == 0) {
+ if (!this.userInfo.drivingImg) return
this.fileList2.push({
url: `${BaseUrl}${this.userInfo.drivingImg}`
});
}
- Object.keys(this.editUserInfo).map(item => {
- if (res.data[item]) {
- this.editUserInfo[item] = res.data[item];
+ if (this.fileList3.length == 0) {
+ if (!this.userInfo.bodyofcarJpg) return
+ if (this.userInfo.bodyofcarJpg.indexOf(',') !== -1) {
+ let bodyofcarJpg = this.userInfo.bodyofcarJpg.split(',')
+ bodyofcarJpg.forEach(v => {
+ this.fileList3.push({
+ url: `${BaseUrl}${v}`
+ });
+ })
+ } else {
+ this.fileList3.push({
+ url: `${BaseUrl}${this.userInfo.bodyofcarJpg}`
+ });
}
- });
+ }
});
},
// 淇敼鎸夐挳鐐瑰嚮
@@ -446,13 +602,17 @@
this.editDriverPopupShow = true;
},
imageClick(index) {
- // 閫氳繃index鍒囨崲鍥剧墖
- console.log('鍒囨崲鍥剧墖', index);
if (index == 1) {
this.previewImageSrc = this.userInfo.carImg;
} else {
this.previewImageSrc = this.userInfo.drivingImg;
}
+ this.$nextTick(() => {
+ this.previewImageShow = true;
+ });
+ },
+ imageClickCarBody(url) {
+ this.previewImageSrc = url;
this.$nextTick(() => {
this.previewImageShow = true;
});
@@ -498,9 +658,6 @@
url: BaseUrl + '/admin/sys-file/uploadUnToken',
filePath: url,
name: 'file',
- // formData: {
- // user: 'test'
- // },
success: res => {
if (num == 1) {
this.editUserInfo.carImg = JSON.parse(res.data).data.url;
@@ -509,6 +666,12 @@
} else if (num == 2) {
this.editUserInfo.drivingImg = JSON.parse(res.data).data.url;
uni.setStorageSync('drivingImg', JSON.parse(res.data).data.url);
+ resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
+ } else if (num == 3) {
+ let imageUrl = JSON.parse(res.data).data.url
+ this.carBody.push(imageUrl)
+ uni.setStorageSync('bodyofcarJpg', this.carBody.join(','));
+ this.editUserInfo.bodyofcarJpg = this.carBody.join(',')
resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
}
}
@@ -538,7 +701,8 @@
this.editUserInfo = {
...this.editUserInfo,
carImg: uni.getStorageSync('carImg'),
- drivingImg: uni.getStorageSync('drivingImg')
+ drivingImg: uni.getStorageSync('drivingImg'),
+ bodyofcarJpg: uni.getStorageSync('bodyofcarJpg')
};
this.$refs.editRef
.validate()
@@ -562,20 +726,48 @@
this.$u.toast('淇敼澶辫触');
});
},
+ initPwd() {
+ this.initPwdShow = true
+ },
+ initPwdConfirm() {
+ this.initPwdShow = false
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ });
+ this.editUserInfo.password = '123456';
+ this.editUserInfo.carImg = uni.getStorageSync('carImg');
+ this.editUserInfo.drivingImg = uni.getStorageSync('drivingImg')
+ this.$reqPost('updateUser', this.editUserInfo, 'json').then(res => {
+ uni.hideLoading()
+ if (res.code == 0) {
+ uni.showToast({
+ title: '閲嶇疆鎴愬姛',
+ duration: 2000,
+ icon: 'success'
+ })
+ } else {
+ this.$u.toast(res.msg ? res.msg : '淇敼澶辫触');
+ }
+ }).catch(err => {
+ this.$u.toast('淇敼澶辫触');
+ });
+ },
+ initPwdCancel() {
+ this.initPwdShow = false
+ },
logout() {
this.logoutShow = true;
},
logoutConfirm() {
redirectLogin();
+ this.changeisLogin(false)
+ this.$store.dispatch('websocketOnClose')
},
logoutCancel() {
this.logoutShow = false;
},
- // 璺宠浆鍙戣繍缁熻椤甸潰
- statistics() {
- uni.navigateTo({
- url: '/pages/customer-page/customer-my/faYunstatistics/faYunstatistics'
- });
+ noobTour() {
+ this.$refs.previewImage.open('https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj1.jpg')
}
}
};
@@ -589,15 +781,10 @@
align-items: center;
}
- .statistics {
- margin-top: vww(10);
- margin-bottom: vww(10);
- }
-
::v-deep.driver-my {
width: 100%;
margin: 0 auto;
- padding-bottom: vww(60);
+ padding-bottom: vww(100);
.driver-banner {
width: 100%;
@@ -650,17 +837,21 @@
top: vww(4);
}
}
+ }
+
+ .information-block {
+ width: 100%;
.personal-information {
width: 100%;
display: flex;
justify-content: center;
position: relative;
- top: vww(20);
+ top: vww(-20);
&-block {
width: 690rpx;
- height: 478rpx;
+ height: 550rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
border-radius: 20rpx;
@@ -716,12 +907,11 @@
.car-information {
width: 100%;
position: relative;
- top: vww(410);
@include flex justify-content: center;
.information-main {
width: 690rpx;
- height: 552rpx;
+ height: 828rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
border-radius: 20rpx;
@@ -740,7 +930,7 @@
.label-title {
@include flex;
- width: 220rpx;
+ width: 300rpx;
height: 100rpx;
.label-text {
@@ -753,6 +943,13 @@
height: 50rpx;
}
}
+
+ .special {
+ width: 100%;
+ flex-wrap: wrap;
+ height: 100%;
+ @include flex;
+ }
}
}
}
@@ -764,7 +961,7 @@
@include flex;
justify-content: center;
position: relative;
- bottom: vww(-430);
+ top: vww(20);
.loginout-main {
width: 84%;
@@ -795,7 +992,7 @@
.editDriverPopup-container {
.u-popup {
.u-transition {
- height: 75%;
+ height: 80%;
.u-popup__content {
overflow: scroll !important;
--
Gitblit v1.9.1