Browse Source

Merge branch 'master' of http://39.101.143.165:8090/hxl13994548489/LocalLivingServicesUniapp

baijunde 1 month ago
parent
commit
84fd206998

+ 17 - 15
pages/coupon/creatDiscount.vue

@@ -40,14 +40,14 @@
 
 					</view>
 				</view>
-				<view class="item">
+				<!-- <view class="item">
 					<view class="label">
 						库存
 					</view>
 					<view class="picker">
 						<u-input v-model="form.number" placeholder="输入库存" />
 					</view>
-				</view>
+				</view> -->
 				<view class="item">
 					<view class="label">
 						有效时间
@@ -445,19 +445,21 @@ export default {
 					icon: 'none'
 				});
 				return
-			} else if (!this.form.number) {
-				uni.showToast({
-					title: '请输入库存',
-					icon: 'none'
-				});
-				return
-			}  else if (this.form.number == '0' || this.form.number == 0) {
-				uni.showToast({
-					title: '库存不能为0',
-					icon: 'none'
-				});
-				return
-			} else if (!this.form.beginTime && !this.form.endTime) {
+			} 
+			// else if (!this.form.number) {
+			// 	uni.showToast({
+			// 		title: '请输入库存',
+			// 		icon: 'none'
+			// 	});
+			// 	return
+			// }  else if (this.form.number == '0' || this.form.number == 0) {
+			// 	uni.showToast({
+			// 		title: '库存不能为0',
+			// 		icon: 'none'
+			// 	});
+			// 	return
+			// } 
+			else if (!this.form.beginTime && !this.form.endTime) {
 				uni.showToast({
 					title: '请选择有效时间',
 					icon: 'none'

+ 17 - 15
pages/coupon/creatReduction.vue

@@ -39,14 +39,14 @@
 
 					</view>
 				</view>
-				<view class="item">
+				<!-- <view class="item">
 					<view class="label">
 						库存
 					</view>
 					<view class="picker">
 						<u-input v-model="form.number" placeholder="输入库存" />
 					</view>
-				</view>
+				</view> -->
 				<view class="item">
 					<view class="label">
 						有效时间
@@ -450,19 +450,21 @@ export default {
 					icon: 'none'
 				});
 				return
-			}  else if (!this.form.number) {
-				uni.showToast({
-					title: '请输入库存',
-					icon: 'none'
-				});
-				return
-			}  else if (this.form.number == '0' || this.form.number == 0) {
-				uni.showToast({
-					title: '库存不能为0',
-					icon: 'none'
-				});
-				return
-			} else if (this.form.couponWay == null) {
+			}  
+			// else if (!this.form.number) {
+			// 	uni.showToast({
+			// 		title: '请输入库存',
+			// 		icon: 'none'
+			// 	});
+			// 	return
+			// }  else if (this.form.number == '0' || this.form.number == 0) {
+			// 	uni.showToast({
+			// 		title: '库存不能为0',
+			// 		icon: 'none'
+			// 	});
+			// 	return
+			// } 
+			else if (this.form.couponWay == null) {
 				uni.showToast({
 					title: '请选择领取方式',
 					icon: 'none'

+ 38 - 27
pages/index/shop.vue

@@ -24,7 +24,7 @@
 								:disabled="true"></u-rate>
 							<span>{{shopData.grade}}分</span>
 						</view>
-						<span :style="{color:btnList[typeIndex].color}">{{btnList[typeIndex].name}}</span>
+						<span v-if="typeIndex !== null" :style="{color:btnList[typeIndex].color}">{{btnList[typeIndex].name}}</span>
 					</view>
 				</view>
 				<view class="address">
@@ -83,7 +83,7 @@
 				</view>
 				<view class="center">
 					<image :src="btnList[currentIndex].image" mode="" v-show="shopStatus == 1"></image>
-					<span>{{btnList[currentIndex].tip}}</span>
+					<span>{{ resultTip || (btnList[currentIndex] && btnList[currentIndex].tip) }}</span>
 					<view class="error" v-show="shopStatus == 4">
 						当前门店还存在有效服务券<br />
 						暂时无法关闭门店
@@ -124,28 +124,28 @@
 						type:3,
 						class:"close",
 						tip:"该店铺已暂停营业",
-						image:"/static/index/close.png",
-						content:"	",
-						color:"#999999"
-					},
-					{
-						name: '解约下线',
-						type: 4,
-						class:"close",
-						tip:"谢谢光临,该店铺已下架",
 						image:"/static/index/rest.png",
 						content:"	",
 						color:"#FF8024"
 					},
-					{
-						name: '门店歇业',
-						type: 5,
-						class:"rest",
-						tip:"当前门店已歇业",
-						image:"/static/index/rest.png",
-						content:"当前门店确定歇业?",
-						color:"#FF8024"
-					},
+					// {
+					// 	name: '解约下线',
+					// 	type: 4,
+					// 	class:"close",
+					// 	tip:"谢谢光临,该店铺已下架",
+					// 	image:"/static/index/rest.png",
+					// 	content:"	",
+					// 	color:"#FF8024"
+					// },
+					// {
+					// 	name: '门店歇业',
+					// 	type: 5,
+					// 	class:"rest",
+					// 	tip:"当前门店已歇业",
+					// 	image:"/static/index/rest.png",
+					// 	content:"当前门店确定歇业?",
+					// 	color:"#FF8024"
+					// },
 				],
 				currentIndex: 0,
 				isPopup: false,
@@ -154,8 +154,9 @@
 				count: 5,
 				shopData: {},
 				shopStatus: null,
-				typeIndex: 0,
+				typeIndex: null,
 				id: '',
+				resultTip:''
 			}
 		},
 		methods: {
@@ -183,8 +184,10 @@
 					this.$http.post("/merchant/localMerchantInfo/editStatus", data).then(res => {
 						if (res.data.code == 200) {
 							this.isPopup = false
-							this.isSuccess = true
-							this.getShopData()
+							// 解决页面闪烁状态问题
+							this.getShopData().then(() => {
+                this.isSuccess = true
+            	})
 						}else {
               uni.showToast({
                 icon: 'none',
@@ -194,13 +197,21 @@
 					})
 			},
 			getShopData() {
-				this.$http.get("/merchant/localMerchantInfo/queryById?id=" + this.id).then(res => {
+				return  this.$http.get("/merchant/localMerchantInfo/queryById?id=" + this.id).then(res => {
 					if (res.data.code == 200) {
 						this.shopData = res.data.result
+						this.resultTip = ''
 						this.shopStatus = res.data.result.merchantStatus
-						const index=this.btnList.findIndex(item => item.type == this.shopStatus);
-						this.typeIndex = index
-						this.currentIndex=index
+						let tempStatus = this.shopStatus
+						if (tempStatus === 5) {
+							this.resultTip = '当前时间不在营业时间范围内,已自动歇业。'
+							tempStatus = 3
+						}
+						const index=this.btnList.findIndex(item => item.type == tempStatus);
+						if (index > -1) {
+								this.typeIndex = index
+								this.currentIndex=index
+						}
 					}
 				})
 			},

+ 1 - 1
pages/login/settled.vue

@@ -363,7 +363,7 @@
 				iconPath: '../../static/boiaoji.png'
 			})] : []
 			let storageData = uni.getStorageSync('address');
-			// this.form.address = storageData.address
+			 this.form.address = storageData.address
 			this.form.latitude = storageData.lat || 37.855068;
 			this.form.longitude = storageData.lng ||  112.536392
 		},

+ 1 - 1
pages/order/record.vue

@@ -23,7 +23,7 @@
 			<view class="client"  v-for="(item,index) in list.afterSaleReasonVo" :key="index">
 				<view class="title">
 					<view class="img" v-if="item.refundType == 0">
-						<image :src="item.userAvatar" alt="" />
+						<image :src="item.userAvatar || '/static/order/img_personal.png'" alt="" />
 					</view>
 					<view class="img" v-else>
 						<image :src="item.logo" alt="" />

+ 1 - 1
pages/product/index.vue

@@ -65,7 +65,7 @@
 					<view class="data">
 						<span>{{ item.productName }}</span>
 						<!-- <span>售卖时间:{{item.time}}</span> -->
-						<view class="repertory"><span @click.stop="goUser(item)">销量:{{ item.soldQuantity }}</span></view>
+						<view class="repertory"><span>销量:{{ item.soldQuantity }}</span></view>
 						<!-- <view class="repertory">库存:{{ item.stockQuantity }} <span
 								@click.stop="goUser(item)">销量:{{ item.soldQuantity }}</span> </view> -->
 						<view class="price">

+ 9 - 9
pages/store/businessInfor.vue

@@ -64,9 +64,9 @@
 					<view class="title">地理位置</view>
 					<view class=" booder-top" style="padding-bottom: 16upx" :style="{ display: mapIsHidden }"
 						@click="selectAddress">
-						<tdmap 
-							:allowSelection="false" 
-							:showCoordinates="false" 
+						<tdmap
+							:allowSelection="false"
+							:showCoordinates="false"
 							:key="mapKey"
 						></tdmap>
 					</view>
@@ -80,7 +80,7 @@
 			<button class="cu-btn round line-gray  shadow" @click="back()">取消</button>
 			<button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交</button>
 		</view>
-		<u-picker v-model="show" mode="time" :default-time="date" @confirm="selectTime" style="z-index: 999 !important;"></u-picker>
+		<u-picker v-model="show" mode="time" :default-time="date||''" @confirm="selectTime" style="z-index: 999 !important;"></u-picker>
 	</view>
 </template>
 
@@ -120,7 +120,7 @@
 				mapIsHidden: 'block', // 修复:初始为block,确保地图容器显示
 				mapKey: 1,
 				// 修复:初始化savedLocation为合法对象,避免undefined
-				savedLocation: { lng: 112.55, lat: 37.87 } 
+				savedLocation: { lng: 112.55, lat: 37.87 }
 			};
 		},
 		onLoad(data) {
@@ -130,7 +130,7 @@
 				obj.photo = obj.photo ? obj.photo.split(',').filter(id => id !== '') : [];
 				this.form = obj;
 				this.date = this.form.openingTime;
-				
+
 				// 修复:从obj中赋值坐标,确保数字类型
 				if (obj.longitude && obj.latitude) {
 					this.savedLocation = {
@@ -154,14 +154,14 @@
 						uni.showToast({ icon:'none', title:res.data.message });
 					}
 				});
-			
+
 			// 修复:安全获取存储的地址,避免da为undefined
 			let da = uni.getStorageSync("address") || {};
 			// console.log(da)
 			// 核心:确保lng/lat是合法数字,兜底默认值
 			const lng = Number(da.lng) || 112.55;
 			const lat = Number(da.lat) || 37.87;
-			
+
 			// 更新savedLocation(触发子组件props更新)
 			this.savedLocation = {
 				lng: lng,
@@ -171,7 +171,7 @@
 			uni.setStorageSync('mapMarkData',this.savedLocation)
 			this.latitude = lat;
 			this.longitude = lng;
-			
+
 			// 优化:仅当坐标变化时更新mapKey,避免频繁刷新
 			if (lng !== 112.55 || lat !== 37.87) {
 				this.mapKey += 1;

+ 12 - 10
pages/store/selectTdMap.vue

@@ -36,7 +36,7 @@
 							<view class="result-address">{{ result.address }}</view>
 						</view>
 						
-						<view class="manage" @click.stop="submitSelectedResult">确定</view>
+						<view class="manage" @click.stop="confirmResult(result)">确定</view>
 					</view>
 				</scroll-view>
 			</view>
@@ -201,17 +201,19 @@
 				console.log('地图已定位到:', lng, lat, result.name);
 			},
 			
-			// 提交选中的结果
-			submitSelectedResult() {
-				if (!this.selectedResult) {
-					uni.showToast({
-						title: '请先选择一个位置',
-						icon: 'none'
-					});
+			// 确定并提交结果(选中+提交一步完成)
+			confirmResult(result) {
+				if (result) {
+					this.selectedResult = result;
+					this.submit(result);
 					return;
 				}
-				
-				this.submit(this.selectedResult);
+			
+			},
+			
+			// 提交选中的结果
+			submitSelectedResult() {
+				this.confirmResult(this.selectedResult);
 			},
 			
 			// 判断结果是否被选中

BIN
static/order/img_personal.png