shish il y a 2 ans
Parent
commit
626eeedfb6

+ 7 - 24
ghsApp/src/admin/shop/add.vue

@@ -71,11 +71,9 @@
 					<view class="tui-placeholder" v-else>请选择</view>
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">地址</view>
-					<view class="tui-input" v-if="form.address">{{ form.address }}</view>
-					<view class="tui-placeholder" v-else>请填写详细地址</view>
-					<input v-model="form.address" name="address" hidden />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌</view>
@@ -174,8 +172,6 @@
 		</form>
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
-		<!-- 选择地区 -->
-		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
 	</view>
 </template>
 
@@ -210,6 +206,7 @@ export default {
 				province: '',
 				city: '',
 				address: '',
+				showAddress:'',
 				floor: '',
 				open: 1,
 				openType: 0, // openType: 0. 表示 24小时营业 1. 表示 xx ~ xx
@@ -273,8 +270,6 @@ export default {
 					Object.keys(this.form).forEach((i, index) => {
 						this.form[i] = data[i]
 					})
-					this.region.lat = data.lat
-					this.region.long = data.long
 
 					this.visible = this.form.open == 1 ? true : false
 					this.openTimeVisible = true
@@ -347,20 +342,6 @@ export default {
 				this.end_time = '18:00'
 			}
 		},
-		// 选择地址
-		selectRegion() {
-			if (!this.form.city) {
-				this.$msg('请先选择城市!')
-				return false
-			}
-			this.showRegion = true
-		},
-		changeAreaFn(e) {
-			this.form.address = e.title
-			this.region.lat = e.location.lat
-			this.region.long = e.location.lng
-		},
-		// 省市联动
 		openAddres() {
 			this.$refs.simpleAddress.open()
 		},
@@ -368,14 +349,16 @@ export default {
 			this.form.province = e.provinceName
 			this.form.city = e.cityName
 			this.form.address = ''
-			this.region.lat = 0
-			this.region.long = 0
+			this.form.showAddress = ''
+			this.region.lat = 10
+			this.region.long = 11
 		},
 		confirmFn() {
 			let hostFn = this.option.id ? update : add
 			if (this.option.id) {
 				this.form.id = this.option.id
 			}
+			this.form.showAddress = this.form.city+this.form.address+this.form.floor
 			this.form = {...this.form,...this.region}
 			uni.showLoading({mask:true})
 			hostFn(this.form).then(res => {

+ 6 - 26
hdApp/src/admin/member/modify.vue

@@ -9,11 +9,9 @@
 					<view class="tui-placeholder" v-else>请选择</view>
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">地址</view>
-					<view class="tui-input" v-if="form.address">{{ form.address }}</view>
-					<view class="tui-placeholder" v-else>请填写详细地址</view>
-					<input v-model="form.address" name="address" hidden />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌</view>
@@ -27,8 +25,6 @@
 		</form>
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
-		<!-- 选择地区 -->
-		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
 	</view>
 </template>
 
@@ -81,21 +77,6 @@ export default {
 		init() {
 
 		},
-		// 选择城市
-		selectRegion() {
-			if (!this.form.city) {
-				this.$msg('请先选择城市!')
-				return false
-			}
-			this.showRegion = true
-		},
-		changeAreaFn(e) {
-			this.form.address = e.title
-			this.form.showAddress = e.address
-			this.region.lat = e.location.lat
-			this.region.long = e.location.lng
-		},
-		//省市联动
 		openAddres() {
 			this.$refs.simpleAddress.open()
 		},
@@ -103,11 +84,12 @@ export default {
 			this.form.province = e.provinceName
 			this.form.city = e.cityName
 			this.form.address = ''
-			this.region.lat = 0
-			this.region.long = 0
+			this.region.lat = 10
+			this.region.long = 11
 		},
 		confirmFn() {
 			let that = this
+			this.form.showAddress = this.form.city+this.form.address+this.form.floor
 			that.$util.confirmModal({content:'确认修改?'},() => {
 				this.form.id = this.option.id ? this.option.id : 0
 				this.form = {...this.form,...this.region}
@@ -122,9 +104,7 @@ export default {
 				})
 			})
 		},
-		// 表单验证
 		formSubmit(e) {
-			// 表单规则
 			let rules = [
 				{
 					name: 'province',
@@ -144,7 +124,7 @@ export default {
 			} else {
 				this.$msg(checkRes)
 			}
-		},
+		}
 	}
 }
 </script>

+ 0 - 11
hdApp/src/admin/order/workOrder.vue

@@ -191,16 +191,6 @@ export default {
 			this.payWayindex = index
       this.form.payWay = this.payWayList[index].id
 		},
-    //计算客户距离和运费
-    changeAddress() {
-      return false
-      let lat = this.$refs.appDelivery.region.latitude
-      let long = this.$refs.appDelivery.region.longitude
-      getUserDistance({ lat: lat, lng: long }).then(res => {
-        this.freightPrice = res.data.fee
-        this.showDistance = res.data.showDistance
-      })
-    },
     confirmToSubmit () {
       let that = this
 
@@ -240,7 +230,6 @@ export default {
       modifyPrice = modifyPrice.toFixed(2)
       //这里前后顺序有影响哦,不要随意调动
       that.form = {...that.form,...that.$refs.appDelivery.form}
-
       that.$util.confirmModal({content:'确认提交?'},() => {
           uni.showLoading({mask:true})
           let name = that.kindSelectedData.name ? that.kindSelectedData.name : ''

+ 5 - 28
hdApp/src/admin/shop/add.vue

@@ -73,11 +73,9 @@
 					<view class="tui-placeholder" v-else>请选择</view>
 					<input v-model="form.province" name="province" hidden />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">所在地址</view>
-					<view class="tui-input" v-if="form.address">{{ form.address }}</view>
-					<view class="tui-placeholder" v-else>请填写详细地址</view>
-					<input v-model="form.address" name="address" hidden />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌号</view>
@@ -110,8 +108,6 @@
 		</form>
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
-		<!-- 选择地区 -->
-		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
 	</view>
 </template>
 
@@ -162,12 +158,10 @@ export default {
 				default:0,
 				superWx:[]
 			},
-			showRegion: false,
 			region: {
-				lat: 0,
-				long: 0
+				lat: 10,
+				long: 11
 			},
-			regionData: [],
 			cityPickerValueDefault: [0, 0],
 			img: [],
       		headers:{token:''},
@@ -220,8 +214,6 @@ export default {
 					Object.keys(this.form).forEach((i, index) => {
 						this.form[i] = data[i]
 					})
-					this.region.lat = data.lat
-					this.region.long = data.long
 
 					// 营业时间初始化
 					this.visible = this.form.open == 1 ? true : false
@@ -270,24 +262,10 @@ export default {
 				this.end_time = '18:00'
 			}
 		},
-		selectRegion() {
-			if (!this.form.city) {
-				this.$msg('请先选择城市!')
-				return false
-			}
-			this.showRegion = true
-		},
 		_resultData(val) {
 			console.log(val)
 			this.form.img = val;
 		},
-		changeAreaFn(e) {
-			this.form.address = e.title
-			this.region.lat = e.location.lat
-			this.region.long = e.location.lng
-			this.form.showAddress = e.address
-		},
-		// 省市联动
 		openAddres() {
 			this.$refs.simpleAddress.open()
 		},
@@ -295,8 +273,6 @@ export default {
 			this.form.province = e.provinceName
 			this.form.city = e.cityName
 			this.form.address = ''
-			this.region.lat = 0
-			this.region.long = 0
 		},
 		confirmFn() {
 			let hostFn = this.option.id ? update : add
@@ -307,6 +283,7 @@ export default {
 			if(Array.isArray(this.form.superWx) && !this.$util.isEmpty(this.form.superWx)){
 				superWx = this.form.superWx[0]
 			}
+			this.form.showAddress = this.form.city+this.form.address+this.form.floor
 			this.form = {...this.form,...this.region,superWx:superWx}
 			uni.showLoading({mask:true})
 			hostFn(this.form).then(res => {

+ 9 - 21
hdApp/src/components/app-delivery-modify.vue

@@ -65,15 +65,14 @@
           <view class="tui-input" v-if="form.province || form.city" >{{ form.province + '-' + form.city }}</view> <view class="tui-placeholder" v-else>请选择</view>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+        <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">详细地址</view>
-          <view class="tui-input" v-if="form.address">{{ form.address }}</view>
-          <view class="tui-placeholder" v-else>请填写地址</view>
+          <input v-model="form.address" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="address" placeholder="请填写地址" @input="changeAddress()" />
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">门牌号</view>
-          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
+          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" @input="changeFloor()" />
         </tui-list-cell>
 
       </template>
@@ -100,9 +99,6 @@
     <!-- 省市联动 -->
     <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
 
-    <!-- 选择详细地址 -->
-    <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
-
   </view>
 </template>
 
@@ -220,6 +216,12 @@ export default {
 		}
 	},
   methods: {
+    changeAddress(){
+      this.form.showAddress = this.form.city+this.form.address+this.form.floor
+    },
+    changeFloor(){
+      this.form.showAddress = this.form.city+this.form.address+this.form.floor
+    },
     changeFillMobile(){
       this.fillMobile = this.fillMobile == 0 ? 1 : 0
     },
@@ -233,20 +235,6 @@ export default {
     selTimeFn(e) {
       this.form.reachDate = e.detail.value;
     },
-    // 选择地址
-    selRegionFn() {
-      if (!this.form.city) {
-        this.$msg("请选择城市");
-        return false;
-      }
-      this.showRegion = true;
-    },
-    changeAreaFn(e) {
-      this.form.address = e.title;
-      this.form.showAddress = e.address;
-      this.form.lat = e.location.lat;
-      this.form.long = e.location.lng;
-    },
     timeTodaySelFn(index) {
       this.form.reachPeriod = index;
     },

+ 12 - 28
hdApp/src/components/app-delivery.vue

@@ -32,7 +32,7 @@
       <tui-list-cell class="line-cell" :hover="false">
         <view class="tui-title required">订花人姓名</view>
         <input v-model="form.bookName" placeholder-class="phcolor" placeholder-style="color:#ccc;" style="width:282upx;" class="tui-input" name="bookName" placeholder="请填写姓名" />
-        <button class="admin-button-com default middle" @click="form.bookName='游客'" style="margin-right:10upx;">填"游客"</button>
+        <button class="admin-button-com default middle" @click="form.bookName='游客'" style="margin-right:10upx;">填游客</button>
       </tui-list-cell>
 
       <tui-list-cell class="line-cell" :hover="false">
@@ -63,15 +63,14 @@
           <view class="tui-input" v-if="form.province || form.city" >{{ form.province + '-' + form.city }}</view> <view class="tui-placeholder" v-else>请选择</view>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+        <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">详细地址</view>
-          <view class="tui-input" v-if="form.address">{{ form.address }}</view>
-          <view class="tui-placeholder" v-else>请填写地址</view>
+          <input v-model="form.address" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="address" placeholder="请填写地址" @input="changeAddress()" />
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">楼号门牌</view>
-          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="选填" />
+          <view class="tui-title">楼号门牌</view>
+          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="选填" @input="changeFloor()" />
         </tui-list-cell>
 
       </template>
@@ -94,13 +93,8 @@
       </tui-list-cell>
 
     </view>
-
     <!-- 省市联动 -->
     <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
-
-    <!-- 选择详细地址 -->
-    <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
-
   </view>
 </template>
 
@@ -145,7 +139,7 @@ export default {
         remark: "",
         anonymity:0
       },
-      region: {latitude: 0,longitude: 0},
+      region: {latitude:10,longitude:11},
       regionTree:[],
       cityPickerValueDefault: [0, 0],
       timeOptions: [
@@ -169,12 +163,17 @@ export default {
           }
         })
 
-
       }
     })
 
   },
   methods: {
+    changeAddress(){
+      this.form.showAddress = this.form.city+this.form.address+this.form.floor
+    },
+    changeFloor(){
+      this.form.showAddress = this.form.city+this.form.address+this.form.floor
+    },
     bindTimeChange(event){
       let val = event.detail.value
       let before = Number(val[0])
@@ -185,21 +184,6 @@ export default {
     selTimeFn(e) {
       this.form.reachDate = e.detail.value;
     },
-    // 选择地址
-    selRegionFn() {
-      if (!this.form.city) {
-        this.$msg("请选择城市");
-        return false;
-      }
-      this.showRegion = true;
-    },
-    changeAreaFn(e) {
-      this.form.address = e.title;
-      this.form.showAddress = e.address;
-      this.region.latitude = e.location.lat;
-      this.region.longitude = e.location.lng;
-      this.$emit("changeAddress", e);
-    },
     timeTodaySelFn(index) {
       this.form.reachPeriod = index;
     },