shish il y a 11 mois
Parent
commit
1a571ef7a6

+ 2 - 6
ghsApp/src/admin/shop/add.vue

@@ -80,7 +80,7 @@
 				</tui-list-cell>
 				<tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
 					<view class="tui-title">地址</view>
-					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" @input="modifyShow" placeholder="请填写地址" />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
 					<view class="tui-title">地址</view>
@@ -90,7 +90,7 @@
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌</view>
-					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便找你)" @input="modifyShow" />
+					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便找你)" />
 				</tui-list-cell>
 
 				<tui-list-cell class="line-cell" :hover="false">
@@ -442,15 +442,11 @@ export default {
 			const cityIndex = districtStr.indexOf('市');
 			this.form.dist = cityIndex !== -1 ? districtStr.substring(cityIndex + 1) : districtStr;
 		},
-		modifyShow(){
-			this.form.showAddress = this.form.city+this.form.address+this.form.floor
-		},
 		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)

+ 2 - 2
ghsApp/src/pagesClient/member/detail.vue

@@ -69,8 +69,8 @@
                 </view>
                 <view style="margin-bottom:20upx;color:#333333">{{userInfo.superInfo && userInfo.superInfo.name ? userInfo.superInfo.name : ''}} {{userInfo.mobile}}</view>
                 <view>
-                  <text v-if="!$util.isEmpty(userInfo.city)" style="margin-right:15upx;">{{userInfo.city}}</text>
-                  {{userInfo.dist}}{{userInfo.address}}{{userInfo.floor}}<block v-if="userInfo.fullAddress!=userInfo.showAddress && userInfo.showAddress!=''">({{ userInfo.showAddress }})</block>
+                  <text v-if="!$util.isEmpty(userInfo.city) || !$util.isEmpty(userInfo.dist)" style="margin-right:15upx;">{{userInfo.city}}{{userInfo.dist}}</text>
+                  {{userInfo.address}}{{userInfo.floor}}<block v-if="userInfo.fullAddress!=userInfo.showAddress && userInfo.showAddress!=''">({{ userInfo.showAddress }})</block>
                   <i class="iconfont iconbianji" style="font-size:25upx;margin-left:20upx;"></i>
                 </view>
             </view>

+ 14 - 18
ghsApp/src/pagesClient/member/modify.vue

@@ -10,7 +10,7 @@
 				</tui-list-cell>
 				<tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
 					<view class="tui-title">地址</view>
-					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" @input="modifyShow" placeholder="请填写地址" />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
 					<view class="tui-title">地址</view>
@@ -20,7 +20,7 @@
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌</view>
-					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" @input="modifyShow" />
+					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)"/>
 				</tui-list-cell>
 			</view>
 			<view class="confirm-btn">
@@ -75,6 +75,8 @@ export default {
 		let prevPage = pages[ pages.length - 2 ];
 		//订单列表页修改客户地址,返回时不刷新
 		prevPage.$vm.fromDetail = {status:1}
+		//返回到客户详情页需要刷新
+		prevPage.$vm.needRefresh = 1
 
 		if(this.option.name){
 			uni.setNavigationBarTitle({ title: this.option.name })
@@ -98,9 +100,6 @@ export default {
 			this.region.lat = ''
 			this.region.long = ''
 		},
-		modifyShow(){
-			this.form.showAddress = this.form.city+this.form.address+this.form.floor
-		},
 		selectRegion() {
 			if (!this.form.city) {
 				this.$msg('请先选择城市!')
@@ -124,19 +123,16 @@ export default {
 		},
 		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}
-				uni.showLoading({mask:true})
-				modifyAddress(this.form).then(res=>{
-					if(res.code == 1){
-						that.$msg('修改成功')
-						setTimeout(() => {
-							uni.navigateBack({})
-						}, 1200)
-					}
-				})
+			this.form.id = this.option.id ? this.option.id : 0
+			this.form = {...this.form, ...this.region}
+			uni.showLoading({mask:true})
+			modifyAddress(this.form).then(res=>{
+				if(res.code == 1){
+					that.$msg('修改成功')
+					setTimeout(() => {
+						uni.navigateBack({})
+					}, 1200)
+				}
 			})
 		},
 		formSubmit(e) {

+ 4 - 8
ghsApp/src/pagesClient/official/apply.vue

@@ -22,7 +22,7 @@
         <tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
 					<view class="tui-title">所在地址</view>
 					<input v-model="form.address" placeholder-class="phcolor"
-          placeholder-style="color:#CCCCCC" class="tui-input" name="address" @input="modifyShow" placeholder="请填写" />
+          placeholder-style="color:#CCCCCC" class="tui-input" name="address" placeholder="请填写" />
 				</tui-list-cell>
 				<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
 					<view class="tui-title">所在地址</view>
@@ -32,7 +32,7 @@
 				</tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false" >
           <div class="tui-title">楼号门牌</div>
-          <input v-model="form.floor" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="floor" placeholder="选填" @input="modifyShow"  />
+          <input v-model="form.floor" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="floor" placeholder="选填" />
         </tui-list-cell>
       </view>
 
@@ -252,9 +252,6 @@ export default {
 			}
 			this.showRegion = true
 		},
-    modifyShow(){
-			this.form.showAddress = this.form.city+this.form.address+this.form.floor
-		},
     changeAreaFn(e) {
 			let locationStr = e.location
 			let fruits = locationStr.split(",").map(fruit => fruit.trim())
@@ -262,9 +259,9 @@ export default {
 			this.form.latitude = fruits[1]
 			this.form.longitude = fruits[0]
 			this.form.showAddress = e.address
-      this.form.address = e.name
+			this.form.address = e.name
 
-      // 提取地区信息,按遇到第一个"市"字后,把"市"后面的字符串作为地区
+      		// 提取地区信息,按遇到第一个"市"字后,把"市"后面的字符串作为地区
 			const districtStr = e.district || '';
 			const cityIndex = districtStr.indexOf('市');
 			this.form.dist = cityIndex !== -1 ? districtStr.substring(cityIndex + 1) : districtStr;
@@ -304,7 +301,6 @@ export default {
     },
     confirmFn () {
       let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
-      this.form.showAddress = this.form.city+this.form.address+this.form.floor
       uni.showLoading({mask:true})
       applyRegister({
         hdShopAdminId: this.option.hdShopAdminId,

+ 4 - 3
hdApp/src/admin/member/detail.vue

@@ -75,10 +75,10 @@
             <text class="contact-label">地址</text>
             <view class="contact-value address-text">
               <text class="address-main">
-                <text v-if="!$util.isEmpty(data.city)" class="city-name">{{data.city}} </text>
-                {{data.dist}}{{data.address}}{{data.floor}}
+                <text v-if="!$util.isEmpty(data.city) || !$util.isEmpty(data.dist)" class="city-name">{{data.city}}{{data.dist}}</text>
+                {{data.address}}{{data.floor}}
               </text>
-              <text v-if="data.showAddress && !$util.isEmpty(data.showAddress)" class="show-address">{{data.showAddress}}</text>
+              <text v-if="!$util.isEmpty(data.showAddress) && data.showAddress!=data.fullAddress" class="show-address">{{data.showAddress}}</text>
             </view>
           </view>
 
@@ -1176,6 +1176,7 @@ export default {
           .address-main {
             .city-name {
               color: #666;
+              margin-right:10upx;
             }
           }
           

+ 20 - 23
hdApp/src/admin/member/modify.vue

@@ -10,7 +10,7 @@
 				</tui-list-cell>
 				<tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
 					<view class="tui-title">地址</view>
-					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" @input="modifyShow" placeholder="请填写地址" />
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
 				</tui-list-cell>
 				<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
 					<view class="tui-title">地址</view>
@@ -20,7 +20,7 @@
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title ">门牌</view>
-					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" @input="modifyShow" />
+					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" />
 				</tui-list-cell>
 			</view>
 			<view class="confirm-btn">
@@ -73,7 +73,6 @@ export default {
 		}
 	},
 	methods: {
-		//...mapActions(['setUserShopAll']),
 		init() {
 			getHasMap().then(res=>{
 				this.hasMap = res.data.hasMap
@@ -89,12 +88,9 @@ export default {
 			this.region.lat = 0
 			this.region.long = 0
 		},
-		modifyShow(){
-			this.form.showAddress = this.form.city+this.form.address+this.form.floor
-		},
 		selectRegion() {
 			if (!this.form.city) {
-				this.$msg('请选择城市')
+				this.$msg('请选择城市')
 				return false
 			}
 			this.showRegion = true
@@ -103,26 +99,27 @@ export default {
 			this.form.address = e.name
 			let locationStr = e.location
 			let fruits = locationStr.split(",").map(fruit => fruit.trim())
+			this.region.lat = fruits[1]||''
+			this.region.long = fruits[0]||''
+			this.form.showAddress = e.address||''
 
-			this.region.lat = fruits[1]
-			this.region.long = fruits[0]
-			this.form.showAddress = e.address
+			// 提取地区信息,按遇到第一个"市"字后,把"市"后面的字符串作为地区
+			const districtStr = e.district || '';
+			const cityIndex = districtStr.indexOf('市');
+			this.form.dist = cityIndex !== -1 ? districtStr.substring(cityIndex + 1) : districtStr;
 		},
 		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}
-				uni.showLoading({mask:true})
-				modifyAddress(this.form).then(res=>{
-					if(res.code == 1){
-						that.$msg('修改成功')
-						setTimeout(() => {
-							uni.navigateBack({})
-						}, 1200)
-					}
-				})
+			this.form.id = this.option.id ? this.option.id : 0
+			this.form = {...this.form,...this.region}
+			uni.showLoading({mask:true})
+			modifyAddress(this.form).then(res=>{
+				if(res.code == 1){
+					that.$msg('修改成功')
+					setTimeout(() => {
+						uni.navigateBack({})
+					}, 1200)
+				}
 			})
 		},
 		formSubmit(e) {