zhangdan 4 gadi atpakaļ
vecāks
revīzija
8ac8883041

+ 7 - 5
pages/index/userInfo.vue

@@ -3,8 +3,7 @@
 		<view class="content-form">
 			<view class="form-data">
 				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="time" label="用户类型:" required>
-							<!-- <view v-if="userDetailInfo">{{form.addressType}}</view> -->
+						<u-form-item prop="addressType" label="用户类型:" required>
 							<v-select ref="addressType" placeholder="请选择用户类型" @itemChange="chooseType" code="ORDER_ADDRESS_TYPE" style="width: 100%"></v-select>	
 						</u-form-item>
 						<u-form-item prop="contactName" label="用户名称:" required>
@@ -83,7 +82,7 @@
 		},
 		onLoad(option) {
 			console.log(option,option.id,'ppppppppp')
-			this.userDetailInfo={}
+			// this.userDetailInfo={}
 			this.getDetailData()
 			// 查看
 			// if(option && option.id){
@@ -104,8 +103,10 @@
 			getDetailData(){
 				userDetail().then(res=>{
 					if(res.status==200){
+						this.$u.vuex('vuex_userInfoData',res.data)
 						this.userDetailInfo=res.data
 						this.$refs.addressType.setVal(res.data.addressType)
+						this.form.addressType=res.data.addressType
 						this.form.contactMobile=res.data.contactMobile
 						this.form.contactName=res.data.contactName
 						this.form.contactAddress=res.data.contactAddress
@@ -113,8 +114,7 @@
 						this.imageHeader=res.data.imageHeader
 						this.form.lat=res.data.latitude
 						this.form.lng=res.data.longitude
-						
-						console.log(res)
+						console.log(res,'------------------------res')
 					}
 				})
 			},
@@ -201,6 +201,7 @@
 			},
 			// 提交
 			submit(){
+				console.log(this.form.addressType,'-------------this.form.addressType')
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						console.log('验证通过');
@@ -211,6 +212,7 @@
 							})
 							return false
 						}
+						
 						const testVal=/^1[34578]\d{9}$/
 						if (!testVal.test(this.form.contactMobile)) {
 							uni.showToast({

+ 18 - 9
pages/index/yuyue.vue

@@ -346,7 +346,11 @@
 			},
 			// 提交
 			submit(){
+				this.rubbishTypeList=[]
+				console.log('-------------提交')
 				this.$refs.uForm.validate(valid => {
+					const params= Object.assign(this.userDetailInfo, this.form,{userId:this.userId})
+					console.log('-------------校验')
 					if (valid) {
 						if(this.time ==''){
 							uni.showToast({
@@ -355,6 +359,7 @@
 							})
 							return false
 						}
+						console.log('-------------时间校验')
 						if(this.form.info ==''){
 							uni.showToast({
 								title: '请选择用户信息',
@@ -362,6 +367,7 @@
 							})
 							return false
 						}
+						console.log('-------------用户校验')
 						if(this.checkWeightType ==''){
 							uni.showToast({
 								title: '请选择预估重量',
@@ -369,6 +375,17 @@
 							})
 							return false
 						}
+						console.log('-------------重量校验')
+						if(this.rubbishTypeListData){
+							this.rubbishTypeListData.map(item=>{
+								if(item.check==true){
+									this.rubbishTypeList.push(item.code)
+								}
+							})
+							console.log(this.rubbishTypeListData,this.rubbishTypeList,'--------选中垃圾分类')
+							params.rubbishTypeList=this.rubbishTypeList
+						}
+						console.log(params,'----------params垃圾类型')
 						if(this.rubbishTypeList ==[]){
 							uni.showToast({
 								title: '请选择回收分类',
@@ -376,7 +393,7 @@
 							})
 							return false
 						}
-						const params= Object.assign(this.userDetailInfo, this.form,{userId:this.userId})
+						console.log(params,'----------params垃圾类型')
 						if(this.time){
 							params.reserveDateBegin=this.reserveDateBegin
 							params.reserveDateEnd=this.reserveDateEnd
@@ -387,14 +404,6 @@
 						if(this.photograph){
 							params.imageList=this.photograph
 						}
-						if(this.rubbishTypeListData){
-							this.rubbishTypeListData.map(item=>{
-								if(item.check==true){
-									this.rubbishTypeList.push(item.code)
-								}
-							})
-							params.rubbishTypeList=this.rubbishTypeList
-						}
 						console.log(params,'------------参数')
 						yuyueInfoSave(params).then(res=>{
 							if(res.status==200){

+ 2 - 2
pages/order/index.vue

@@ -63,10 +63,10 @@
 			}
 		},
 		onLoad() {
-			this.getOrderListData()
+			// this.getOrderListData()
 		},
 		onShow() {
-			// this.getOrderListData()
+			this.getOrderListData()
 			checkLogin().then(res => {
 				this.hasLogin=res.status==200
 				if(this.hasLogin){

+ 5 - 2
pages/userCenter/index.vue

@@ -7,8 +7,9 @@
 			</view>
 			<view class="user-info">
 				<view>
-					<view v-if="hasLogin" class="user-info-item">{{userData.name ? userData.name :''}}</view>
-					<view v-if="hasLogin" class="user-info-item">{{userData.mobile? userData.mobile:''}}</view>
+					<view v-if="hasLogin" class="user-info-item">{{name ? name :''}}</view>
+					<open-data type="userNickName" class="user-info-item" v-if="!name && hasLogin"></open-data>
+					<view v-if="hasLogin" class="user-info-item">{{mobile? mobile:''}}</view>
 					<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 				</view>
 				<view>
@@ -32,6 +33,8 @@
 		data() {
 			return {
 				hasLogin: false,
+				name:this.$store.state.vuex_userInfoData.contactName,
+				mobile:this.$store.state.vuex_userInfoData.contactMobile,
 				userData: {},
 				price:'500元',  // 交易金额
 				version: '1.0.0' // 小程序版本