Эх сурвалжийг харах

评论页面修改代码;
修改新技师资料页面;

郭鹏飞 8 сар өмнө
parent
commit
470d114f99

+ 2 - 2
src/api/index.js

@@ -205,7 +205,7 @@ export function confirmOrder(data) {
 export function commentOrder(data) {
     return request({
         method: 'post',
-        url: '/api/comment/v1/wx/add',
+        url: '/tCommentUser/wx/add',
         data
     });
 }
@@ -426,7 +426,7 @@ export function confirm(data) {
     });
 }
 
-// 商户提前完成
+// 商户评价客户
 export function tCommentUser(data) {
     return request({
         method: 'post',

+ 5 - 0
src/components/upload/index.vue

@@ -33,6 +33,11 @@ export default {
 			type: [String, Number],
 			default: uni.$u.props.upload.height
 		},
+        // 文件大小限制,单位为byte
+		maxSize: {
+			type: [String, Number],
+            default: uni.$u.props.upload.maxSize
+		},
 		maxCount: {
 			type: Number,
 			default: 5

+ 236 - 72
src/pages/demo/apply.vue

@@ -8,106 +8,162 @@
                 :labelStyle="{ color: '#333', fontWeight: 500, marginBottom: '10rpx' }"
 				:model="form" :rules="rules"
 			>
-                <view class="section-title">确认信息</view>
+                <view class="section-title">基本信息</view>
                 <view class="card-box">
-                    <u-form-item label="真实姓名" prop="realName">
-                        <u-input v-model="form.realName" placeholder="请输入真实姓名" border="none" class="custom-input"></u-input>
+                    <u-form-item label="真实姓名" prop="cName">
+                        <u-input v-model="form.cName" placeholder="请输入真实姓名" border="none" class="custom-input"></u-input>
                     </u-form-item>
-                    <u-form-item label="性别" prop="gender">
-                        <u-radio-group v-model="form.gender" activeColor="#00cba3">
-                            <u-radio label="男" name="男" customStyle="margin-right: 30px"></u-radio>
-                            <u-radio label="女" name="女"></u-radio>
+                    <u-form-item label="性别" prop="nSex">
+                        <u-radio-group v-model="form.nSex" activeColor="#00cba3">
+                            <u-radio label="男" :name="1" customStyle="margin-right: 30px"></u-radio>
+                            <u-radio label="女" :name="0"></u-radio>
                         </u-radio-group>
                     </u-form-item>
-                    <u-form-item label="从业年份" prop="years">
-                        <u-input v-model="form.years" placeholder="请输入从业年份 如:5" border="none"
+                    <u-form-item label="手机号" prop="cPhone">
+                        <u-input v-model="form.cPhone" placeholder="请输入手机号" border="none" class="custom-input"></u-input>
+                    </u-form-item>
+                    <u-form-item label="入驻城市" prop="city" @click="show = true">
+                        <u-input v-model="form.city" readonly placeholder="请选择城市" border="none"
                             class="custom-input"></u-input>
                     </u-form-item>
+                    <u-form-item label="近期生活照" prop="cImgList">
+                        <Upload
+                            @fileList="onUpload($event, 'cImgList')"
+                        />
+                    </u-form-item>
                 </view>
 
-                <view class="section-title">确认账户信息</view>
+                <view class="section-title">详细信息</view>
                 <view class="card-box">
-                    <u-form-item label="结算户名" prop="accountName">
-                        <u-input v-model="form.accountName" placeholder="请输入结算银行户主姓名" border="none"
+                    <u-form-item label="昵称" prop="cNickName">
+                        <u-input v-model="form.cNickName" placeholder="请输入昵称" border="none"
                             class="custom-input"></u-input>
                     </u-form-item>
-                    <u-form-item label="开户行" prop="bankName">
-                        <u-input v-model="form.bankName" placeholder="请输入开户名称" border="none" class="custom-input"></u-input>
+                    <u-form-item label="头像" prop="cPortrait">
+                        <Upload
+                            :maxCount="1"
+                            @fileList="onUpload($event, 'cPortrait')"
+                        />
+                    </u-form-item>
+                    <u-form-item label="所在位置" prop="address" @click="onSelAddr">
+                        <u-input v-model="address" readonly placeholder="请选择工作所在位置" border="none" class="custom-input"></u-input>
                     </u-form-item>
-                    <u-form-item label="结算账号" prop="accountNo">
-                        <u-input v-model="form.accountNo" placeholder="请输入结算银行账号" border="none"
-                            class="custom-input"></u-input>
+                    <u-form-item label="个人简介" prop="cJianjie">
+                        <u--textarea v-model="form.cJianjie" placeholder="请输入个人简介" border="none"
+                            class="custom-input"></u--textarea>
                     </u-form-item>
                 </view>
 
-                <view class="section-title">上传身份证正反面</view>
+                <view class="section-title">上传身份证正反面 <text class="sub-tip">*最多3张</text></view>
                 <view class="card-box">
-                    <u-form-item prop="idCard">
-                        <u-input v-model="form.idCard" placeholder="请输入身份证号码" border="none" class="custom-input"></u-input>
-                    </u-form-item>
+                    <Upload
+                        :maxCount="3"
+                        @fileList="onUpload($event, 'cSfzImg')"
+                    />
 
-                    <view class="id-upload-row">
-                        <Upload
-                            name="idCardFront"
-                            width="auto"
-                            height="220rpx"
-                            :maxCount="1"
-                            @fileList="onUpload($event, 'idCardFront')"
-                        >
-                            <view class="upload-block" slot="content">
-                                <view class="icon-bg"><u-icon name="camera-fill" color="#fff" size="20"></u-icon></view>
-                                <text class="up-text">身份证人像面</text>
-                            </view>
-                        </Upload>
+                    <template v-if="0">
+                        <view class="id-upload-row">
+                            <Upload
+                                name="idCardFront"
+                                width="auto"
+                                height="220rpx"
+                                :maxCount="1"
+                                @fileList="onUpload($event, 'idCardFront')"
+                            >
+                                <view class="upload-block" slot="content">
+                                    <view class="icon-bg"><u-icon name="camera-fill" color="#fff" size="20"></u-icon></view>
+                                    <text class="up-text">身份证人像面</text>
+                                </view>
+                            </Upload>
+                            <Upload
+                                name="idCardBack"
+                                width="auto"
+                                height="220rpx"
+                                :maxCount="1"
+                                @fileList="onUpload($event, 'idCardBack')"
+                            >
+                                <view class="upload-block" slot="content">
+                                    <view class="icon-bg"><u-icon name="camera-fill" color="#fff" size="20"></u-icon></view>
+                                    <text class="up-text">身份证国徽面</text>
+                                </view>
+                            </Upload>
+                        </view>
                         <Upload
-                            name="idCardBack"
+                            name="idCardHand"
                             width="auto"
                             height="220rpx"
                             :maxCount="1"
-                            @fileList="onUpload($event, 'idCardBack')"
+                            @fileList="onUpload($event, 'idCardHand')"
                         >
-                            <view class="upload-block" slot="content">
+                            <view class="upload-block full-width" slot="content">
                                 <view class="icon-bg"><u-icon name="camera-fill" color="#fff" size="20"></u-icon></view>
-                                <text class="up-text">身份证国徽面</text>
+                                <text class="up-text">手持身份证照片</text>
                             </view>
                         </Upload>
-                    </view>
-
-                    
-                    <Upload
-                        name="idCardHand"
-                        width="auto"
-                        height="220rpx"
-                        :maxCount="1"
-                        @fileList="onUpload($event, 'idCardHand')"
-                    >
-                        <view class="upload-block full-width" slot="content">
-                            <view class="icon-bg"><u-icon name="camera-fill" color="#fff" size="20"></u-icon></view>
-                            <text class="up-text">手持身份证照片</text>
-                        </view>
-                    </Upload>
+                    </template>
 
                     <!-- 隐藏的表单项,用于校验图片 -->
-                    <u-form-item prop="idCardFront" style="display: none;"></u-form-item>
-                    <u-form-item prop="idCardBack" style="display: none;"></u-form-item>
+                    <u-form-item prop="cSfzImg" style="display: none;"></u-form-item>
                 </view>
 
                 <view class="section-title">
-                    上传资格证书 <text class="sub-tip">*最多15张</text>
+                    上传资格证书 
                 </view>
                 <view class="card-box">
                     <Upload
-                        :maxCount="15"
+                        :maxCount="1"
                         @fileList="onUpload($event, 'certification')"
                     />
+                    <!-- 隐藏的表单项,用于校验图片 -->
+                    <u-form-item prop="certification" style="display: none;"></u-form-item>
                 </view>
 
-                <view class="section-title">上传商家资质</view>
+                <view class="section-title">上传营业执照</view>
                 <view class="card-box">
                     <Upload
-                        :maxCount="15"
-                        @fileList="onUpload($event, 'business')"
+                        :maxCount="1"
+                        @fileList="onUpload($event, 'businessLicense')"
                     />
+                    <!-- 隐藏的表单项,用于校验图片 -->
+                    <u-form-item prop="businessLicense" style="display: none;"></u-form-item>
+                </view>
+
+                <view class="section-title">上传无犯罪证明</view>
+                <view class="card-box">
+                    <Upload
+                        :maxCount="1"
+                        @fileList="onUpload($event, 'noCrime')"
+                    />
+                    <!-- 隐藏的表单项,用于校验图片 -->
+                    <u-form-item prop="noCrime" style="display: none;"></u-form-item>
+                </view>
+
+                <view class="section-title">上传承诺书信息</view>
+                <view class="card-box">
+                    <u-form-item label="承诺书" prop="commitment">
+                        <Upload
+                            accept="file"
+                            :maxSize="10240"
+                            :maxCount="2"
+                            @fileList="onUpload($event, 'commitment')"
+                        />
+                    </u-form-item>
+                    <u-form-item label="承诺录音" prop="recording">
+                        <Upload
+                            accept="file"
+                            :maxSize="10240"
+                            :maxCount="2"
+                            @fileList="onUpload($event, 'recording')"
+                        />
+                    </u-form-item>
+                    <u-form-item label="承诺录像" prop="videoRecording">
+                        <Upload
+                            accept="file"
+                            :maxSize="51200"
+                            :maxCount="2"
+                            @fileList="onUpload($event, 'videoRecording')"
+                        />
+                    </u-form-item>
                 </view>
             </u--form>
 
@@ -118,10 +174,20 @@
                 ></u-button>
             </view>
         </view>
+
+        <!-- 城市选择 -->
+        <u-picker :show="show" :columns="[cityList]" keyName="label" 
+            @cancel="show = false" @confirm="onSelect"
+        ></u-picker>
     </view>
 </template>
 
 <script>
+import {
+    getCityList,
+    getProjectList,
+    getMerchantData,
+} from '@/api/index';
 import Upload from '@/components/upload/index.vue';
 export default {
     components: {
@@ -130,43 +196,141 @@ export default {
     data() {
         return {
             form: {
-                realName: '',
-                gender: '男',
-                years: '',
-                accountName: '',
-                bankName: '',
-                accountNo: '',
-                idCard: ''
+                cName: '',
+                nSex: 0,
             },
             rules: {
 				city: [
 					{
 						required: true,
-						message: '请输入首选城市',
+						message: '请选择城市',
+						trigger: ['blur', 'change']
+					}
+				],
+				cName: [
+					{
+						required: true,
+						message: '请输入您的姓名',
+						trigger: ['blur', 'change']
+					}
+				],
+				cNickName: [
+					{
+						required: true,
+						message: '请输入您的昵称',
+						trigger: ['blur', 'change']
+					}
+				],
+				cPhone: [
+					{
+						required: true,
+						message: '请输入手机号',
 						trigger: ['blur', 'change']
+					},
+                    {
+                        pattern: /^1([3589]\d|4[01456879]|6[0-9]|7[0-8])\d{8}$/, 
+                        message: '请输入正确的手机号格式', 
+                        trigger: ['blur', 'change']
 					}
 				],
+				address: [
+					{
+						required: true,
+						message: '请选择位置',
+						trigger: ['blur', 'change']
+					}
+				],
+				cJianjie: [
+					{
+						required: true,
+						message: '请填写您的简介',
+						trigger: ['blur', 'change']
+					}
+				],
+                cSfzImg: [{ required: true, message: '请上传身份证', trigger: ['change'] }],
+                cImgList: [{ required: true, message: '最少上传一张生活照片', trigger: ['change'] }],
+                cPortrait: [{ required: true, message: '请上传头像', trigger: ['change'] }],
 				// 针对隐藏表单项的校验规则
-				idCardBack: [{ required: true, message: '请上传身份证国徽面', trigger: ['change'] }],
-				idCardFront: [{ required: true, message: '请上传身份证人像面', trigger: ['change'] }],
+				// idCardBack: [{ required: true, message: '请上传身份证国徽面', trigger: ['change'] }],
             },
+            query: {},
+            // 城市选择
+            show: false,
+            cityList: [],
         };
+    },
+    computed: {
+        address() {
+            return (this.form.address || '') + (this.form.name || '');
+        }
+    },
+    onLoad(query) {
+        this.query = query;
+        if (query.id) this.getData();
+        this.getCity();
     },
 	onReady() {
 		// 页面加载完成后为表单设置规则
 		this.$refs.uForm.setRules(this.rules);
 	},
     methods: {
+        getData() {
+            let params = {
+                cOpenId: uni.getStorageSync('wx_copenid')
+            }
+            getMerchantData(params).then(res => {
+                let data = res.data.data;
+                this.form = data;
+            });
+        },
+        getCity() {
+            getCityList().then(res => {
+                this.cityList = res.data.data.map(({
+                    deptId,
+                    deptName
+                }) => ({
+                    value: deptId,
+                    label: deptName
+                }))
+            });
+        },
+        onSelAddr() {
+            uni.chooseLocation({
+                success: res => {
+                    this.form.name = res.name;
+                    this.form.address = res.address;
+                    this.form.latitude = res.latitude;
+                    this.form.longitude = res.longitude;
+                }
+            });
+        },
+        onSelect(e) {
+            this.form = {
+                ...this.form,
+                city: e.value[0].label,
+                deptId: e.value[0].value,
+            }
+            this.show = false;
+        },
         // upload事件
         onUpload(e, t) {
             this.form[t] = e.map(item => item.url);
         },
         onSubmit() {
 			this.$refs.uForm.validate().then(res => {
-				uni.$u.toast('校验通过')
+                let api = netStaffAdd;
+                if (this.query.id) api = netStaffUpdate;
+                api().then(ares => {
+                    uni.$u.toast(ares.data.msg);
+                    if (ares.data.code == 200) {
+                        setTimeout(() => {
+                            uni.navigateBack();
+                        }, 1000);
+                    }
+                });
 			}).catch(errors => {
                 console.log(errors)
-                let f = errors.some(item => ['idCardBack', 'idCardFront'].indexOf(item.field) !== -1);
+                let f = errors.some(item => ['cSfzImg', 'certification', 'businessLicense', 'noCrime'].indexOf(item.field) !== -1);
 				if (f) uni.$u.toast(errors[0].message);
 			})
 		}

+ 11 - 26
src/pages/my/indent.vue

@@ -1,8 +1,6 @@
 <template>
 	<view class="info">
-		<view class="popup" v-if="isDisable"></view>
 		<view class="content" >
-		
 			<view class="title">
 				基 本 信 息
 			</view>
@@ -123,10 +121,15 @@
 					/>
 				</view>
 			</view>
-			<view class="submits">
-				<button style="margin: 30rpx 0" type="primary" @click="submit">提交</button>
+			<view class="footer-bar">
+				<u-button type="primary" shape="circle" text="提交" color="#2cb8d4"
+					@click="submit"
+					customStyle=""
+				></u-button>
+				<!-- <button style="margin: 30rpx 0" type="primary" @click="submit">提交</button> -->
 			</view>
 		</view>
+		<view class="popup" v-if="isDisable"></view>
 	</view>
 </template>
 
@@ -147,9 +150,9 @@
 		},
 		data() {
 			return {
-				isDisable:false,
-				cityList:[],
-				show:false,
+				isDisable: false,
+				cityList: [],
+				show: false,
 				type: 'text',
 				token: '',
 				uploadId: '',
@@ -367,9 +370,6 @@
 				getMerchantData(openid).then(res => {
 					let data = res.data.data
 					this.form = data
-					if(data.nTong && data.nTong == 0 || data.nTong == 1 ){
-						this.isDisable = true
-					}
 					// this.form.cBhList = data.cBhList
 				})
 			},
@@ -395,7 +395,7 @@
 	.info{
 		width: 100%;
 		height: auto;
-		padding-top: 20rpx;
+		padding: 20rpx 30rpx 120rpx;
 		position: relative;
 		.popup{
 			width: 100%;
@@ -445,7 +445,6 @@
 	}
 
 	.content {
-		padding: 0 30rpx;
 
 		.page-section-title {
 			font-size: 32rpx;
@@ -531,20 +530,6 @@
 			}
 		}
 
-		.submits {
-			width: 100%;
-			background-color: #fff;
-			border-top: 1px solid #b8b6b6;
-			text-align: center;
-			z-index: 10;
-
-			button {
-				width: 80%;
-				display: inline-block;
-				background-color: #2cb8d4;
-			}
-		}
-
 		.heads {
 			.uploadImg {
 				width: 200rpx;

+ 51 - 48
src/pages/order/comment.vue

@@ -24,10 +24,10 @@
 						{{item.value}}
 					</view>
 				</view>
-				<!-- <view class="star" v-if="title !== '商户'">
+				<view class="star" v-if="title !== '商户'">
 					评分:
 					<u-rate v-model="nStar" inactiveIcon="thumb-up"></u-rate>
-				</view> -->
+				</view>
 
 			</view>
 			<view class="btn_box" v-if="title == '商户'">
@@ -45,7 +45,7 @@
 	import {
 		commentOrder,
 		tCommentUser
-	} from '../../api/index.js'
+	} from '@/api/index.js'
 	export default {
 		data() {
 			return {
@@ -86,6 +86,23 @@
 				]
 			}
 		},
+		onLoad(options) {
+			this.orderId = options.cId
+			this.orderNo = options.orderNo
+
+			this.jsId = options.cJsId
+			this.name = options.cNickName
+
+			this.title = options.title
+			this.openId = options.cOpenId
+		},
+		watch: {
+			txt(txt) {
+				if (txt.indexOf('\n') != -1) { //敲了回车键了
+					uni.hideKeyboard() //收起软键盘
+				}
+			}
+		},
 		methods: {
 			addComment(item) {
 				this.comment = this.comment + ' ' + ' ' + item.value
@@ -94,42 +111,43 @@
 				this.text = this.text + ' ' + ' ' + item.value
 			},
 			submit() {
-				let data = {}
-				if (this.comment.trim() == '') {
-					return
+				if (this.comment.trim() == '') return;
+				let params = {
+					orderId: this.orderId,
+					orderNo: this.orderNo,
+					jsId: this.jsId,
+					name: this.name,
+					nickName: 'xiaoxiao',
+
+					star: this.nStar,
+					text: this.comment.trim(),
 				}
-				data.cText = this.comment.trim(),
-					data.orderId = this.orderId,
-					data.cJsid = this.jsId,
-					data.orderNo = this.orderNo,
-					data.name = this.name,
-					data.nStar = this.nStar,
-					commentOrder(data).then(res => {
-						if (res.data.code == 200) {
-							uni.showToast({
-								title: '评论成功',
-							})
-							setTimeout(() => {
-								// uni.switchTab({
-								// 	url: '/pages/order/order'
-								// })
-								uni.navigateBack()
-							}, 1000)
-						} else {
-							uni.showToast({
-								title: res.data.msg,
-							})
-						}
-					})
+				commentOrder(params).then(res => {
+					if (res.data.code == 200) {
+						uni.showToast({
+							title: '评论成功',
+						})
+						setTimeout(() => {
+							// uni.switchTab({
+							// 	url: '/pages/order/order'
+							// })
+							uni.navigateBack()
+						}, 1000)
+					} else {
+						uni.showToast({
+							title: res.data.msg,
+						})
+					}
+				})
 			},
 			//商户评价客户
 			jsSubmit() {
 				let data = {}
 				data.text = this.text.trim(),
-					data.jsId = this.jsId,
-					data.orderNo = this.orderNo,
-					data.name = this.name,
-					data.openId = this.openId
+				data.jsId = this.jsId,
+				data.orderNo = this.orderNo,
+				data.name = this.name,
+				data.openId = this.openId
 				tCommentUser(data).then(res => {
 					if (res.data.code == 200) {
 						uni.showToast({
@@ -145,21 +163,6 @@
 					}
 				})
 			}
-		},
-		onLoad(options) {
-			this.orderNo = options.orderNo,
-				this.jsId = options.cJsId,
-				this.orderId = options.cId,
-				this.name = options.cNickName
-			this.title = options.title
-			this.openId = options.cOpenId
-		},
-		watch: {
-			txt(txt) {
-				if (txt.indexOf('\n') != -1) { //敲了回车键了
-					uni.hideKeyboard() //收起软键盘
-				}
-			}
 		}
 	}
 </script>

+ 3 - 3
src/pages/staff/index.vue

@@ -113,8 +113,7 @@
 				</u-grid>
 			</view>
 		</view>
-		<view class="work">
-		</view>
+		<view class="work"></view>
 		<!-- 分销码弹窗 -->
 		<view class="qr_code" @click="qrCodeShow" v-if="isQrcodeShow">
 			<view class="img_box">
@@ -186,7 +185,8 @@
 				orderNum: 0,
 				isAddBlank: false,
 				active: 0,
-				tabList: [{
+				tabList: [
+					{
 						label: '全部',
 						value: 1
 					},