Browse Source

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

baijunde 2 months ago
parent
commit
75f22c46ff

+ 2 - 2
common/router/modules/routes.js

@@ -611,8 +611,8 @@ const routes = [{
 		},
 	},
 	{
-		path: '/pages/groupMeal/goods/form-step1',
-		name: 'groupMealGoodsFormStep1',
+		path: '/pages/groupMeal/goods/form',
+		name: 'groupMealGoodsForm',
 		meta: {
 			title: '编辑商品1',
 		},

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "掌柜生活商户版",
     "appid" : "__UNI__E0EA6E1",
     "description" : "",
-    "versionName" : "1.1.7.2",
-    "versionCode" : 1172,
+    "versionName" : "1.1.9.2",
+    "versionCode" : 1192,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 86 - 112
pages/coupon/coupon.vue

@@ -7,7 +7,8 @@
 					<span class="cuIcon-back" @click="back"></span>
 				</view>
 				<span class="center">商家优惠券</span>
-				<view class="head_right" v-if='currentTab'>
+				 <!-- v-if='currentTab' -->
+				<view class="head_right">
 					<!-- <span class="cuIcon-search" @click="goSearch"></span> -->
 					<view class="manage" @click="manage">
 						添加
@@ -24,18 +25,18 @@
 				</view>
 			</view>
 		</view>
-		<mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
+		<mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList1" @down="downCallback" @init="mescrollInit" :use="false">
 
 			<!-- 代金券列表 -->
 			<view class="coupon-card" v-for="(item, index) in dataList[`couponList${currentTab}`]" :key="item.id"
 				@click="handleDetail(item.id)" :class="{ 'disabled': item.status === 'expired' }">
 				<!-- 顶部标题栏 -->
 				<view class="card-header"
-					:style="currentTab == 0 ? 'background: #EFFFFE' : currentTab == 1 ? 'background: #F4FAFF ' : 'background: #FFF7F3'">
-					<image style=" vertical-align: top" :src="`/static/coupon/titlebg${currentTab + 1}.png`" mode="">
+					:style="currentTab == 0 ? 'background: #F4FAFF ' : 'background: #FFF7F3'">
+					<image style=" vertical-align: top" :src="`/static/coupon/titlebg${currentTab + 2}.png`" mode="">
 					</image>
 					<view class="status" v-if="item.delFlag == '1'"
-						:style="currentTab == 0 ? 'color: #2DAC9F' : currentTab == 1 ? 'color: #4183BC' : 'color: #DB6332'">
+						:style="currentTab == 0 ? 'color: #4183BC' : 'color: #DB6332'">
 						销售中
 					</view>
 					<view class="status" v-else>{{ item.delFlag == '0' ? '待上架' : item.delFlag == '3' ? '已失效' : '' }}
@@ -44,19 +45,15 @@
 				<view class="flex" style="padding: 14rpx 18rpx;">
 					<!-- 优惠券金额 -->
 					<view class="amount-section">
-						<text class="amount" v-if="currentTab == 0">{{ item.parValue }}</text>
-						<text class="amount" v-else :style="currentTab == 1 ? 'color: #278BE5' : 'color: #FB5308'">{{
+						<text class="amount" :style="currentTab == 0 ? 'color: #278BE5' : 'color: #FB5308'">{{
                             item.contentInfo }}</text>
-						<text class="unit" v-if="currentTab == 2">折</text>
+						<text class="unit" v-if="currentTab == 1">折</text>
 						<text class="unit" v-else>元</text>
-						<view class="use-condition" v-if="currentTab == 0 && item.voucherWay == '1'">售价{{
-                            item.voucherWayInfo
-                            }}元</view>
-						<view class="use-condition" v-if="currentTab == 1 && item.contentConditions !== '0'">满{{
+						<view class="use-condition" v-if="currentTab == 0 && item.contentConditions !== '0'">满{{
                             item.contentConditions }}元可抵扣</view>
-						<view class="use-condition" v-if="currentTab == 2 && item.contentConditions !== '0'">满{{
+						<view class="use-condition" v-if="currentTab == 1 && item.contentConditions !== '0'">满{{
                             item.contentConditions }}元可使用</view>
-						<view class="use-condition" v-if="currentTab !== 0 && item.contentConditions == '0'">不限制条件使用
+						<view class="use-condition" v-if="item.contentConditions == '0'">不限制条件使用
 						</view>
 					</view>
 
@@ -64,20 +61,14 @@
 					<view class="info-section">
 						<view class="info-item">
 							<text class="dot">•</text>
-							<text class="label" v-if="currentTab == 0">获取方式:</text>
-							<text class="label" v-else>领取限制:</text>
-							<text class="value" v-if="currentTab == 0">{{ item.voucherWay == '1' ? '购买' : '消费满' +
-                                item.voucherWayInfo + '元可领取' }}</text>
-							<text class="value" v-else>{{ item.couponWay == '1' ? '所有人可领取' : '本店消费可领' }}</text>
+							<text class="label">领取限制:</text>
+							<text class="value">{{ item.couponWay == '1' ? '所有人可领取' : '本店消费可领' }}</text>
 						</view>
 						<view class="info-item">
 							<text class="dot">•</text>
-							<text class="label" v-if="currentTab == 0">使用条件:</text>
-							<text class="label" v-else>适用范围:</text>
-							<text class="value" v-if="currentTab == 0">{{ item.conditions == '0' ? '不限制' : '最低消费' +
-                                item.conditions + '元' }}</text>
-							<text class="value" v-else>{{
-                                item.couponRange == '1' ? '本店可用' : item.couponRange == '2' ? '部分分类商品可用' : '部分分类商品不可用'
+							<text class="label">适用范围:</text>
+							<text class="value">{{
+                                item.couponRange == '1' ? '全店可用' : item.couponRange == '2' ? '部分分类商品可用' : '部分分类商品不可用'
                                 }}</text>
 						</view>
 						<view class="info-item">
@@ -90,9 +81,8 @@
 
 				<!-- 数量统计 -->
 				<view class="stats-section flex"
-					:class="currentTab == 0 ? 'backg-color1' : currentTab == 1 ? 'backg-color2' : 'backg-color3'">
-					<text class="stat-item" v-if="currentTab == 0 && item.voucherWay == '1'">已购买:{{ item.payNumber }}</text>
-					<text class="stat-item" v-else>已领取:{{ item.payNumber }}</text>
+					:class="currentTab == 0 ? 'backg-color2' : 'backg-color3'">
+					<text class="stat-item">已领取:{{ item.receivedCount }}</text>
 					<text class="stat-item">已使用:{{ item.useNumber }}</text>
 					<text class="stat-item">总库存:{{ item.number }}</text>
 				</view>
@@ -102,7 +92,7 @@
 					<text class="action-btn" v-if="item.delFlag == '0' || item.delFlag == '3'"
 						@click.stop="handleAction('up', item)">上架</text>
 					<text class="action-btn" v-if="item.delFlag == '1'" @click.stop="handleAction('down', item)">下架</text>
-					<text class="action-btn" v-if="item.delFlag == '1' && item.voucherWay !== 1"
+					<text class="action-btn" v-if="item.delFlag == '1'"
 						@click.stop="handleAction('grant', item)">发放</text>
 					<text class="action-btn" v-if="item.delFlag == '0' || item.delFlag == '3'"
 						@click.stop="handleEdit(item.id)">编辑</text>
@@ -155,9 +145,10 @@
 					}
 				],
 				currentTab: 0,
-				tabList: [{
-						name: '代金券'
-					},
+				tabList: [
+					// {
+					// 	name: '代金券'
+					// },
 					{
 						name: '满减券'
 					},
@@ -178,6 +169,8 @@
 				reductionList: [],
 				discountList: [],
 				selectRow: {},
+				listRequestId: 0,
+				isFirstShow: true,
 				upOption: {
 					page: {
 						num: 0,
@@ -194,45 +187,43 @@
 			closePaymentPopup() {
 				this.showPaymentPopup = false
 			},
-			getList(page) {
-				this.$http.post('/merchant/localVoucherInfo/list', {
+			getList1(page) {
+				const tab = this.currentTab
+				const listKey = 'couponList' + tab
+				const requestId = this.listRequestId
+				this.$http.post('/merchant/localCouponInfo/list', {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
+					type: Number(tab) + Number(1),
 					pageSize: page.size,
 					pageNo: page.num
 				}).then(res => {
+					if (requestId !== this.listRequestId || tab !== this.currentTab) return
 					if (res.data.success) {
-						if (res.data.result.records == null && page.num == 1) {
-							this.dataList.couponList0 = []
+						const records = res.data.result.records || []
+						if (page.num === 1) {
+							this.dataList[listKey] = records
 						} else {
-							this.dataList.couponList0 = res.data.result.pages ? this.dataList.couponList0.concat(res.data.result
-								.records) : this.dataList.couponList0
+							this.dataList[listKey] = this.dataList[listKey].concat(records)
 						}
-
-						this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
+						this.mescroll.endSuccess(records.length, res.data.result.total)
 						uni.showTabBar()
 					} else {
-						this.dataList.couponList0 = []
+						if (page.num === 1) {
+							this.dataList[listKey] = []
+						}
 						this.mescroll.endErr()
+						this.$tip.error(res.data.message)
 					}
 				}).catch(() => {
-					this.mescroll.endErr()
-				})
-			},
-			getList1(page) {
-				this.$http.post('/merchant/localCouponInfo/list', {
-					merchantId: uni.getStorageSync(USER_INFO).merchantId,
-					type: this.currentTab,
-					pageSize: page.size,
-					pageNo: page.num
-				}).then(res => {
-					if (res.data.success) {
-						this.dataList['couponList' + this.currentTab] = res.data.result.pages ? this.dataList['couponList' + this
-							.currentTab].concat(res.data.result.records) : this.dataList['couponList' + this.currentTab]
-					} else {
-						this.$tip.error(res.data.message);
+					if (requestId === this.listRequestId) {
+						this.mescroll.endErr()
 					}
 				})
 			},
+			downCallback() {
+				this.dataList['couponList' + this.currentTab] = []
+				this.mescroll.resetUpScroll()
+			},
 			//返回
 			back() {
 				uni.navigateBack({
@@ -250,27 +241,16 @@
 						content: type == 'up' ? '当前优惠券确定上架?' : '当前优惠券确定下架?',
 						success: (res) => {
 							if (res.confirm) {
-								let upDown = ['/merchant/localVoucherInfo/editUpper', '/merchant/localCouponInfo/editUpper',
-									'/merchant/localCouponInfo/editUpper'
-								]
-								this.$http.get(upDown[this.currentTab], {
+								this.$http.get('/merchant/localCouponInfo/editUpper', {
 									params: {
 										id: item.id,
 										delFlag: type == 'up' ? '1' : '0'
 									}
 								}).then(res => {
 									if (res.data.success) {
-										let page = {
-											num: 1,
-											size: 10
-										}
-										if (this.currentTab == 0) {
-											this.dataList.couponList0 = []
-											this.getList(page)
-										} else {
-											this.dataList['couponList' + this.currentTab] = []
-											this.getList1(page)
-										}
+										this.listRequestId++
+										this.dataList['couponList' + this.currentTab] = []
+										this.mescroll && this.mescroll.resetUpScroll()
 									} else {
 										if (res.data.message == "当前优惠卷上架需重新设置有效时间") {
 											this.showPaymentPopup = true
@@ -300,7 +280,7 @@
 					beginTime: this.selectRow.beginTime,
 					endTime: this.selectRow.endTime,
 					consumerId: this.selectRow.id,
-					type: this.currentTab == '0' ? '3' : this.currentTab
+					type: String(this.currentTab + 1)
 				}
 				if (e[0].value == 1) {
 					uni.navigateTo({
@@ -315,17 +295,29 @@
 			},
 			manage() {
 				
-				if (this.currentTab == '0') {
-					uni.navigateTo({
-						url: '/pages/coupon/creatcoupon'
-					})
-				}
-				if (this.currentTab == '1') {
+				// if (this.currentTab == '0') {
+				// 	uni.navigateTo({
+				// 		url: '/pages/coupon/creatcoupon'
+				// 	})
+				// }
+				// if (this.currentTab == '1') {
+				// 	uni.navigateTo({
+				// 		url: '/pages/coupon/creatReduction'
+				// 	})
+				// }
+				// if (this.currentTab == '2') {
+				// 	uni.navigateTo({
+				// 		url: '/pages/coupon/creatDiscount'
+				// 	})
+				// }
+				
+				
+				if (this.currentTab == 0) {
 					uni.navigateTo({
 						url: '/pages/coupon/creatReduction'
 					})
 				}
-				if (this.currentTab == '2') {
+				if (this.currentTab == 1) {
 					uni.navigateTo({
 						url: '/pages/coupon/creatDiscount'
 					})
@@ -334,45 +326,28 @@
 
 			},
 			onTabChange(index) {
-				this.dataList={
-					couponList0: [],
-					couponList1: [],
-					couponList2: [],
-				}
-				let page = {
-					num: 1,
-					size: 10
-				}
+				if (this.currentTab === index) return
+				this.listRequestId++
 				this.currentTab = index
-				if (index == 0) {
-					this.getList(page)
-				} else {
-					this.getList1(page)
-
-				}
+				this.dataList['couponList' + index] = []
+				this.mescroll && this.mescroll.resetUpScroll()
 			},
 			// 详情
 			handleDetail(id) {
 				uni.navigateTo({
-					url: `/pages/coupon/couponDetail?id=${id}&tab=${this.currentTab}`
+					url: `/pages/coupon/couponDetail?id=${id}&tab=${this.currentTab+1}`
 				})
 			},
 			mescrollInit(mescroll) {
 				this.mescroll = mescroll;
 			},
 			handleEdit(id) {
-				// TODO: 实现编辑逻辑
-				if (this.currentTab == '0') {
-					uni.navigateTo({
-						url: `/pages/coupon/creatcoupon?id=${id}`
-					})
-				}
-				if (this.currentTab == '1') {
+				if (this.currentTab == 0) {
 					uni.navigateTo({
 						url: `/pages/coupon/creatReduction?id=${id}`
 					})
 				}
-				if (this.currentTab == '2') {
+				if (this.currentTab == 1) {
 					uni.navigateTo({
 						url: `/pages/coupon/creatDiscount?id=${id}`
 					})
@@ -381,21 +356,20 @@
 			}
 		},
 		onLoad(options) {
-			if (options && options.tab) {
-				this.currentTab = options.tab
+			if (options && options.tab !== undefined && options.tab !== '') {
+				this.currentTab = Number(options.tab)
 			} else {
 				this.currentTab = 0
 			}
 		},
 		onShow() {
-			let page = {
-				num: 1,
-				size: 10
-			}
 			this.showPaymentPopup = false
-			// if (this.currentTab == 1 || this.currentTab == 2) {
-			// 	this.getList1(page)
-			// }
+			if (this.isFirstShow) {
+				this.isFirstShow = false
+				return
+			}
+			this.dataList['couponList' + this.currentTab] = []
+			this.mescroll && this.mescroll.resetUpScroll()
 		},
 	}
 </script>

+ 25 - 10
pages/coupon/couponDetail.vue

@@ -17,7 +17,7 @@
                 <view class="card-header"
                     :style="currentTab == 0 ? 'background: #EFFFFE' : currentTab == 1 ? 'background: #F4FAFF ' : 'background: #FFF7F3'">
                     <image style=" vertical-align: top"
-                        :src="`../../static/coupon/titlebg${Number(currentTab) + 1}.png`" mode=""> </image>
+                        :src="`../../static/coupon/titlebg${Number(currentTab) +1}.png`" mode=""> </image>
                     <view class="status" v-if="couponList.delFlag == '1'"
                         :style="currentTab == 0 ? 'color: #2DAC9F' : currentTab == 1 ? 'color: #4183BC' : 'color: #DB6332'">
                         销售中
@@ -78,7 +78,7 @@
                 <view class="stats-section flex"
                     :class="currentTab == 0 ? 'backg-color1' : currentTab == 1 ? 'backg-color2' : 'backg-color3'">
                     <text class="stat-item" v-if="currentTab == 0">已购买:{{ couponList.payNumber }}</text>
-                    <text class="stat-item" v-else>已领取:{{ couponList.payNumber }}</text>
+                    <text class="stat-item" v-else>已领取:{{ couponList.receivedCount }}</text>
                     <text class="stat-item">已使用:{{ couponList.useNumber }}</text>
                     <text class="stat-item">总库存:{{ couponList.number }}</text>
                 </view>
@@ -185,6 +185,19 @@ export default {
                 delta: 1
             });
         },
+        goCouponList() {
+            const listTab = Number(this.currentTab) > 0 ? Number(this.currentTab) - 1 : 0
+            setTimeout(() => {
+                const pages = getCurrentPages()
+                if (pages.length > 1) {
+                    uni.navigateBack()
+                } else {
+                    uni.redirectTo({
+                        url: `/pages/coupon/coupon?tab=${listTab}`
+                    })
+                }
+            }, 500)
+        },
         deleteFun() {
             uni.showModal({
                 title: '删除优惠券',
@@ -194,10 +207,11 @@ export default {
                         if (this.currentTab == 0) {
                             this.$http.get('/merchant/localVoucherInfo/delete?id=' + this.productId).then(res => {
                                 if (res.data.success) {
-                                    this.$tip.error(res.data.message || '删除成功');
-                                    uni.navigateTo({
-                                        url: `/pages/coupon/coupon`
+                                    uni.showToast({
+                                        title: res.data.message || '删除成功',
+                                        icon: 'none'
                                     })
+                                    this.goCouponList()
                                 }
                                 else {
                                     this.$tip.error(res.data.message);
@@ -205,12 +219,13 @@ export default {
                             })
                         }
                         else {
-                            this.$http.delete('/merchant/localCouponInfo/delete?id=' + this.productId).then(res => {
+                            this.$http.delete(`/merchant/localCouponInfo/delete?id=${this.productId}&type=${this.currentTab}`).then(res => {
                                 if (res.data.success) {
-                                    this.$tip.error(res.data.message || '删除成功');
-                                    uni.navigateTo({
-                                        url: `/pages/coupon/coupon?tab=${this.currentTab}`
+                                    uni.showToast({
+                                        title: res.data.message || '删除成功',
+                                        icon: 'none'
                                     })
+                                    this.goCouponList()
                                 }
                                 else {
                                     this.$tip.error(res.data.message);
@@ -233,7 +248,7 @@ export default {
     onLoad(options) {
         if (options) {
             this.productId = options.id
-            this.currentTab = options.tab
+            this.currentTab = Number(options.tab) || 0
         }
     },
     onShow() {

+ 55 - 40
pages/coupon/creatDiscount.vue

@@ -155,9 +155,9 @@
 							form.couponDescription.length : 0 }}</span>
 						/500
 					</view>
-					<view class="tips">
+					<!-- <view class="tips">
 						支持jpg,png格式,最多上传5张,每张图片大小不得超过5M。
-					</view>
+					</view> -->
 					<!-- <view class="grid col-4 grid-square flex-sub booder-top">
 						<view class="bg-img" v-for="(item, index) in headPhotoImg" :key="index" @tap="ViewImage"
 							:data-url="headPhotoImg[index]">
@@ -172,8 +172,8 @@
 
 						</view>
 					</view> -->
-					<u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
-						@on-remove="detailsRemove" max-count="5" width="140rpx" height="140rpx"></u-upload>
+					<!-- <u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
+						@on-remove="detailsRemove" max-count="5" width="140rpx" height="140rpx"></u-upload> -->
 				</view>
 
 			</view>
@@ -223,7 +223,7 @@ export default {
 				contentInfo: '',
 				couponRange: '',
 				couponRangeInfo: [],
-				couponPhoto: [],
+				// couponPhoto: [],
 				type: '2',
 				contentConditions: ''
 			},
@@ -238,14 +238,27 @@ export default {
 		}
 	},
 	methods: {
+		goBackToList(listTab = 1) {
+			this.$store.state.shopSelectedIds = []
+			setTimeout(() => {
+				const pages = getCurrentPages()
+				if (pages.length > 1) {
+					uni.navigateBack()
+				} else {
+					uni.redirectTo({
+						url: `/pages/coupon/coupon?tab=${listTab}`
+					})
+				}
+			}, 500)
+		},
 		//上传详情图
-		detailsSuccess(res, index, lists) {
-			this.xqImage = lists
+		// detailsSuccess(res, index, lists) {
+		// 	this.xqImage = lists
 		
-		},
-		detailsRemove(index, lists) {
-			this.xqImage = lists
-		},
+		// },
+		// detailsRemove(index, lists) {
+		// 	this.xqImage = lists
+		// },
 		groupChange(e) {
 			// e=='1'?this.couponWayInfo2='':this.couponWayInfo1=''
 			this.form.couponWay = e == '1' ? '1' : '2'
@@ -473,20 +486,23 @@ export default {
 			
 			else {
 				
-				let temp = []
-				console.log(this.xqImage)
-				if ( this.xqImage.length > 0) {
-					this.xqImage.forEach((item => {
-						temp.push( configService.apiUrl +'/'+item.response.message)
-					}))
-				}
+				// let temp = []
+				// if (this.xqImage.length > 0) {
+				// 	this.xqImage.forEach((item) => {
+				// 		if (item.response && item.response.message) {
+				// 			temp.push(configService.apiUrl + '/' + item.response.message)
+				// 		} else if (item.url) {
+				// 			temp.push(item.url)
+				// 		}
+				// 	})
+				// }
 				
 				
 				let data = {
 					repeatClaim: this.form.repeatClaim ? '1' : '2',
 					couponRangeInfo: this.form.couponRangeInfo.length > 0 ? this.form.couponRangeInfo.join(',') : null,
 					// couponPhoto: this.form.couponPhoto.length > 0 ? this.form.couponPhoto.join(',') : null
-						couponPhoto:temp.length > 0 ? temp.join(',') : null
+						// couponPhoto:temp.length > 0 ? temp.join(',') : null
 				}
 				if (this.productId == '') {
 					this.$http.post("/merchant/localCouponInfo/add", { ...this.form, ...data, merchantId: uni.getStorageSync(USER_INFO).merchantId }).then(res => {
@@ -495,14 +511,13 @@ export default {
 								title: '添加成功',
 								icon: 'none'
 							});
-							this.$store.state.shopSelectedIds=[]
-
-							uni.navigateTo({
-								url: '/pages/coupon/coupon'
-							})
+							this.goBackToList(1)
 						}
 						else {
-							this.$tip.error(res.data.message);
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none'
+							});
 						}
 					})
 				} else {
@@ -513,13 +528,13 @@ export default {
 								title: '编辑成功',
 								icon: 'none'
 							});
-							this.$store.state.shopSelectedIds=[]
-							uni.navigateTo({
-								url: '/pages/coupon/coupon'
-							})
+							this.goBackToList(1)
 						}
 						else {
-							this.$tip.error(res.data.message);
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none'
+							});
 						}
 					})
 				}
@@ -532,18 +547,18 @@ export default {
 				if (res.data.success) {
 					res.data.result.couponRangeInfo = res.data.result.couponRangeInfo ? res.data.result.couponRangeInfo.split(',').filter(id => id) : []
 					// res.data.result.couponPhoto = res.data.result.couponPhoto!== null && res.data.result.couponPhoto.length>0? res.data.result.couponPhoto.split(',').filter(id => id) : []
-					if(res.data.result.couponPhoto){
-						let xqtemp = []
-						xqtemp = res.data.result.couponPhoto.split(',')
-						xqtemp.map(item => {
-							this.xqImage.push({
-								url: item
-							})
-						})
-					}
+					// if(res.data.result.couponPhoto){
+					// 	let xqtemp = []
+					// 	xqtemp = res.data.result.couponPhoto.split(',')
+					// 	xqtemp.map(item => {
+					// 		this.xqImage.push({
+					// 			url: item
+					// 		})
+					// 	})
+					// }
 					res.data.result.couponWay = res.data.result.couponWay ? res.data.result.couponWay + '' : ''
 					res.data.result.repeatClaim = res.data.result.repeatClaim && res.data.result.repeatClaim == '1' ? true : false
-					this.headPhotoImg=res.data.result.couponPhoto
+					// this.headPhotoImg=res.data.result.couponPhoto
 					this.showDate = res.data.result.beginTime + '-' + res.data.result.endTime
 					this.form = res.data.result
 				}

+ 123 - 46
pages/coupon/creatReduction.vue

@@ -28,11 +28,12 @@
 								<text class="section-limit" >0元即不限制金额</text>
 							</text>
 							<view class="flex align-center"><u-input v-model="form.contentConditions"
-									placeholder="输入金额" />元</view>
+									placeholder="输入金额" @input="(val) => handleAmountInput(val, 'contentConditions', true)" />元</view>
 						</view>
 						<view style="width: 46%;">
 							<text class="section-title" style="font-weight: 500;">减</text>
-							<view class="flex align-center"><u-input v-model="form.contentInfo" placeholder="输入金额" />元
+							<view class="flex align-center"><u-input v-model="form.contentInfo" placeholder="输入金额"
+									@input="(val) => handleAmountInput(val, 'contentInfo', false)" />元
 							</view>
 						</view>
 
@@ -152,9 +153,9 @@
 							form.couponDescription.length : 0 }}</span>
 						/500
 					</view>
-					<view class="tips">
+					<!-- <view class="tips">
 						支持jpg,png格式,最多上传5张,每张图片大小不得超过5M。
-					</view>
+					</view> -->
 					<!-- <view class="grid col-4 grid-square flex-sub booder-top">
 						<view class="bg-img" v-for="(item, index) in headPhotoImg" :key="index" @tap="ViewImage"
 							:data-url="headPhotoImg[index]">
@@ -170,8 +171,8 @@
 						</view>
 					</view> -->
 					
-					<u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
-						@on-remove="detailsRemove" max-count="5" width="140rpx" height="140rpx"></u-upload>
+					<!-- <u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
+						@on-remove="detailsRemove" max-count="5" width="140rpx" height="140rpx"></u-upload> -->
 				</view>
 
 			</view>
@@ -199,8 +200,8 @@ export default {
 	},
 	data() {
 		return {
-			action: configService.apiUrl + '/sys/common/upload', //图片上传地址
-				xqImage: [], //详情图回显
+			// action: configService.apiUrl + '/sys/common/upload', //图片上传地址
+				// xqImage: [], //详情图回显
 			headPhotoImg: [],
 			showApplication: false,
 			columns1: [{
@@ -219,7 +220,7 @@ export default {
 				// conditionsUse: null,
 				couponRange: '',
 				couponRangeInfo: [],
-				couponPhoto: [],
+				// couponPhoto: [],
 				type:'1',
 				contentConditions:''
 			},
@@ -234,19 +235,32 @@ export default {
 		}
 	},
 	methods: {
+		goBackToList(listTab = 0) {
+			this.$store.state.shopSelectedIds = []
+			setTimeout(() => {
+				const pages = getCurrentPages()
+				if (pages.length > 1) {
+					uni.navigateBack()
+				} else {
+					uni.redirectTo({
+						url: `/pages/coupon/coupon?tab=${listTab}`
+					})
+				}
+			}, 500)
+		},
 		 // 阻止键盘弹出
 		    preventKeyboard(e) {
 					 e.preventDefault(); 
 		     e.stopPropagation(); // 阻止默认事件(键盘弹出)
 		    },
 		//上传详情图
-		detailsSuccess(res, index, lists) {
-			this.xqImage = lists
+		//detailsSuccess(res, index, lists) {
+		//	this.xqImage = lists
 		
-		},
-		detailsRemove(index, lists) {
-			this.xqImage = lists
-		},
+		//},
+		// detailsRemove(index, lists) {
+		// 	this.xqImage = lists
+		// },
 		groupChange(e) {
 			// e=='1'?this.couponWayInfo2='':this.couponWayInfo1=''
 			this.form.couponWay = e == '1' ? '1' : '2'
@@ -359,6 +373,44 @@ export default {
 				url: '/pages/coupon/activity?params=' + encodeURIComponent(JSON.stringify(this.form.couponRangeInfo))
 			})
 		},
+		handleAmountInput(val, field, allowZero = false) {
+			this.$nextTick(() => {
+				if (!val && val !== 0) {
+					this.form[field] = ''
+					return
+				}
+				let value = val.toString().replace(/[^\d.]/g, '')
+				const dotIndex = value.indexOf('.')
+				if (dotIndex !== -1) {
+					value = value.slice(0, dotIndex + 1) + value.slice(dotIndex + 1).replace(/\./g, '')
+				}
+				const parts = value.split('.')
+				if (parts.length === 2 && parts[1].length > 2) {
+					value = parts[0] + '.' + parts[1].slice(0, 2)
+				}
+				if (value.startsWith('0') && value.length > 1 && value[1] !== '.') {
+					value = value.replace(/^0+/, '') || '0'
+				}
+				if (!allowZero && value !== '' && parseFloat(value) === 0) {
+					uni.showToast({
+						title: '减免金额必须大于0',
+						icon: 'none'
+					})
+					this.form[field] = ''
+					return
+				}
+				this.form[field] = value
+			})
+		},
+		isValidAmount(value, allowZero = false) {
+			if (value === '' || value === null || value === undefined) return false
+			const str = String(value)
+			if (!/^\d+(\.\d{1,2})?$/.test(str)) return false
+			const num = parseFloat(str)
+			if (isNaN(num) || num < 0) return false
+			if (allowZero) return num >= 0
+			return num > 0
+		},
 		//提交审核
 		submit() {
 				console.log('++++')
@@ -368,15 +420,33 @@ export default {
 					icon: 'none'
 				});
 				return
-			} else if (this.form.contentConditions=='') {
+			} else if (this.form.contentConditions === '') {
 				uni.showToast({
 					title: '请输入满减金额',
 					icon: 'none'
 				});
 				return
-			}  else if (!this.form.contentInfo) {
+			} else if (!this.isValidAmount(this.form.contentConditions, true)) {
 				uni.showToast({
-					title: '请输入金额',
+					title: '满减金额只能输入0或正数',
+					icon: 'none'
+				});
+				return
+			} else if (!this.form.contentInfo) {
+				uni.showToast({
+					title: '请输入减免金额',
+					icon: 'none'
+				});
+				return
+			} else if (!this.isValidAmount(this.form.contentInfo, false)) {
+				uni.showToast({
+					title: '减免金额只能输入正数',
+					icon: 'none'
+				});
+				return
+			} else if (parseFloat(this.form.contentConditions) > 0 && parseFloat(this.form.contentInfo) > parseFloat(this.form.contentConditions)) {
+				uni.showToast({
+					title: '减免金额不能大于满减门槛',
 					icon: 'none'
 				});
 				return
@@ -417,49 +487,56 @@ export default {
 				});
 				return
 			} else {
-				let temp = []
-				console.log(this.xqImage)
-				if ( this.xqImage.length > 0) {
-					this.xqImage.forEach((item => {
-						temp.push( configService.apiUrl +'/'+item.response.message)
-					}))
-				}
+				// let temp = []
+				// if (this.xqImage.length > 0) {
+				// 	this.xqImage.forEach((item) => {
+				// 		if (item.response && item.response.message) {
+				// 			temp.push(configService.apiUrl + '/' + item.response.message)
+				// 		} else if (item.url) {
+				// 			temp.push(item.url)
+				// 		}
+				// 	})
+				// }
 				
 				
 				let data={
 					repeatClaim:this.form.repeatClaim?'1':'2',
 					couponRangeInfo:this.form.couponRangeInfo.length > 0 ? this.form.couponRangeInfo.join(',') : null,
-					couponPhoto:temp.length > 0 ? temp.join(',') : null
+					// couponPhoto:temp.length > 0 ? temp.join(',') : null
 				}
 			
 				
 				if (this.productId == '') {
-					this.$http.post("/merchant/localCouponInfo/add", { ...this.form,...data, merchantId: uni.getStorageSync(USER_INFO).merchantId }).then(res => {
+					this.$http.post("/merchant/localCouponInfo/add", { ...this.form, ...data, merchantId: uni.getStorageSync(USER_INFO).merchantId }).then(res => {
 						if (res.data.code == 200) {
 							uni.showToast({
 								title: '添加成功',
 								icon: 'none'
 							});
 
-							this.$store.state.shopSelectedIds=[]
-							uni.navigateTo({
-								url: '/pages/coupon/coupon'
-							})
+							this.goBackToList(0)
+						}else{
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none'
+							});
 						}
 					})
 				} else {
 					this.form.productId = this.productId
-					this.$http.post("/merchant/localCouponInfo/edit", {...this.form,...data}).then(res => {
+					this.$http.post("/merchant/localCouponInfo/edit", {...this.form, ...data}).then(res => {
 						if (res.data.code == 200) {
 							uni.showToast({
 								title: '编辑成功',
 								icon: 'none'
 							});
-							this.$store.state.shopSelectedIds=[]
-							uni.navigateTo({
-								url: '/pages/coupon/coupon'
-							})
+							this.goBackToList(0)
 
+						}else{
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none'
+							});
 						}
 					})
 				}
@@ -473,18 +550,18 @@ export default {
 					res.data.result.couponRangeInfo = res.data.result.couponRangeInfo ? res.data.result.couponRangeInfo.split(',').filter(id => id) : []
 					// res.data.result.couponPhoto = res.data.result.couponPhoto!== null && res.data.result.couponPhoto.length>0? res.data.result.couponPhoto.split(',').filter(id => id) : []
 	
-					if(res.data.result.couponPhoto){
-						let xqtemp = []
-						xqtemp = res.data.result.couponPhoto.split(',')
-						xqtemp.map(item => {
-							this.xqImage.push({
-								url: item
-							})
-						})
-					}
+					// if(res.data.result.couponPhoto){
+					// 	let xqtemp = []
+					// 	xqtemp = res.data.result.couponPhoto.split(',')
+					// 	xqtemp.map(item => {
+					// 		this.xqImage.push({
+					// 			url: item
+					// 		})
+					// 	})
+					// }
 					res.data.result.couponWay = res.data.result.couponWay ? res.data.result.couponWay + '' : ''
 					res.data.result.repeatClaim = res.data.result.repeatClaim && res.data.result.repeatClaim=='1'? true: false
-					this.headPhotoImg=res.data.result.couponPhoto
+					// this.headPhotoImg=res.data.result.couponPhoto
 					this.showDate = res.data.result.beginTime + '-' + res.data.result.endTime
 					this.form = res.data.result
 				}

+ 7 - 2
pages/coupon/usersList.vue

@@ -7,7 +7,7 @@
             :style="currentTab == '0' ? 'background: #EFFFFE' : currentTab == '1' ? 'background: #F4FAFF;' : 'background: #FFF7F3;'">
             <image :src="`/static/coupon/userBg${Number(currentTab) + 1}.png`" mode="">
             </image>
-            <text class="">{{ name }}</text>
+            <text class="coupon-name">{{ name }}</text>
         </view>
 
         <view class="coupon-header">
@@ -154,7 +154,7 @@ position: relative;
         width: 347rpx;
         height: 56rpx;
     }
-    text{
+    .coupon-name {
         position: absolute;
         color: #FFFFFF;
         left: 22rpx;
@@ -162,6 +162,11 @@ position: relative;
         height: 56rpx;
         line-height: 56rpx;
         text-align: center;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        padding: 0 16rpx;
+        box-sizing: border-box;
     }
 }
 

+ 1 - 1
pages/finance/withdrawal.vue

@@ -423,7 +423,7 @@ export default {
 
 ::v-deep {
   .u-delete-icon {
-    background-color: rgb(0, 0, 0, 0.6) !important;
+    background-color: rgba(0, 0, 0, 0.6) !important;
   }
 }
 </style>

+ 667 - 0
pages/groupMeal/goods/form.vue

@@ -0,0 +1,667 @@
+<template>
+	<view class="page-container" :class="{ 'step2-page': currentStep === 2 }">
+		<u-navbar title="新建团餐" :autoBack="true" :placeholder="true"></u-navbar>
+
+		<!-- 第一步:基础信息 -->
+		<view v-show="currentStep === 1" class="form-card">
+			<view class="section-title">基础信息</view>
+			<u-form :model="baseForm" ref="baseFormRef" :rules="baseRules"
+				labelPosition="left" labelWidth="auto"
+				:error-type="['toast', 'border-bottom']"
+			>
+				<u-form-item prop="category" label="商品分类" required borderBottom @click="show = true">
+					<u-input v-model="baseForm.categoryName" class="form-input" disabled placeholder="去设置" height="41" inputAlign="right"></u-input>
+					<u-icon slot="right" name="arrow-right" color="#C7C6CA"></u-icon>
+				</u-form-item>
+
+				<u-form-item prop="name" label="商品名称" required borderBottom>
+					<u-input v-model="baseForm.name" placeholder="请输入商品名称" height="41" inputAlign="right"></u-input>
+				</u-form-item>
+
+				<u-form-item prop="productImage" label="商品封面图" required labelPosition="top">
+					<view class="upload-content">
+						<view class="upload-tip">支持jpg、png格式,建议尺寸为750px*750px,上传1-4张</view>
+						<u-upload
+							:action="uploadAction"
+							:file-list="fileList.cover"
+							:form-data="uploadFormData"
+							:max-count="4"
+							:multiple="true"
+							width="140"
+							height="140"
+							preview-full-image
+							@on-success="onCoverSuccess"
+							@on-remove="onCoverRemove"
+						/>
+					</view>
+				</u-form-item>
+
+				<u-form-item prop="detailImages" label="商品详情图" required borderBottom labelPosition="top">
+					<view class="upload-content">
+						<view class="upload-tip">支持jpg、png格式,最多20张</view>
+						<u-upload
+							:action="uploadAction"
+							:file-list="fileList.detail"
+							:form-data="uploadFormData"
+							:max-count="20"
+							:multiple="true"
+							width="140"
+							height="140"
+							preview-full-image
+							@on-success="onDetailSuccess"
+							@on-remove="onDetailRemove"
+						/>
+					</view>
+				</u-form-item>
+
+				<u-form-item prop="price" label="团餐价" required borderBottom>
+					<u-input type="digit" height="41" :clearable="false"
+						inputAlign="right"
+						placeholder="请输入团餐价"
+						v-model.number="baseForm.price"
+						@input="onInput($event, 'price')"
+					></u-input>
+					<text slot="right" class="input-suffix">元</text>
+				</u-form-item>
+
+				<u-form-item prop="sellingPrice" label="售价" required :borderBottom="true">
+					<u-input type="digit" height="41" :clearable="false"
+						inputAlign="right" placeholder="请输入商品售价"
+						v-model.number="baseForm.sellingPrice"
+						@input="onInput($event, 'sellingPrice')"
+					></u-input>
+					<text slot="right" class="input-suffix">元</text>
+				</u-form-item>
+			</u-form>
+		</view>
+
+		<!-- 第二步:菜品信息 -->
+		<u-form v-show="currentStep === 2" :model="dishForm" :rules="dishRules" ref="dishFormRef" :error-type="['toast', 'border-bottom']">
+			<u-collapse ref="collapseRef"
+				:value="activeNames"
+				@change="onCollapseChange">
+				<u-collapse-item
+					:class="{ active: activeNames == category.id }"
+					v-for="(category, catIndex) in dishForm.dishCategories"
+					:key="category.id"
+					:name="category.id"
+				>
+					<view slot="title" class="collapse-title">
+						<text>{{ category.name }}</text>
+						<text class="num" v-if="isEditedShow(category)">({{ category.items.length }})</text>
+					</view>
+
+					<view class="collapse-content">
+						<view class="dish-item" v-for="(dish, dishIndex) in category.items" :key="dish.id">
+							<view class="dish-header">
+								<view class="dish-title">
+									<u-image width="32rpx" height="32rpx" src="/static/icon/icon_edit.png"></u-image>
+									<text>{{ category.name }}{{ dishIndex + 1 }}</text>
+								</view>
+								<view class="dish-actions">
+									<u-button v-if="dishIndex === category.items.length - 1"
+										type="primary" size="mini"
+										hover-class="none"
+										:custom-style="{
+											color: '#2D88F4',
+											border: '1rpx solid #2D88F4',
+											background: 'rgba(45,136,244,0.1)',
+										}"
+										@click="addDish(category.id)"
+									>
+										<view class="text">
+											<u-image width="32rpx" height="32rpx" src="/static/icon/icon_plus.png"></u-image>
+											<text>添加</text>
+										</view>
+									</u-button>
+									<u-button v-if="category.items.length > 1"
+										type="error" size="mini"
+										hover-class="none"
+										:custom-style="{
+											color: '#FF6067',
+											border: '1rpx solid #FF6067',
+											background: 'rgba(255,96,103,0.1)',
+										}"
+										@click="removeDish(category.id, dish.id)"
+									>
+										<view class="text">
+											<u-image width="32rpx" height="32rpx" src="/static/icon/icon_del.png"></u-image>
+											<text>删除</text>
+										</view>
+									</u-button>
+								</view>
+							</view>
+							<view class="dish-form">
+								<u-form-item label="名称" :prop="`dishCategories.${catIndex}.items.${dishIndex}.name`" :required="isRequired(dish, dishIndex)">
+									<u-input v-model="dish.name" height="41" placeholder="请输入" inputAlign="right"></u-input>
+								</u-form-item>
+								<u-form-item label="价格" :prop="`dishCategories.${catIndex}.items.${dishIndex}.price`" :required="isRequired(dish, dishIndex)">
+									<u-input v-model.number="dish.price" type="digit" height="41" placeholder="输入金额" :clearable="false" inputAlign="right"></u-input>
+									<text slot="right" style="color: #333333;">元</text>
+								</u-form-item>
+								<u-form-item label="描述" :prop="`dishCategories.${catIndex}.items.${dishIndex}.description`" :required="isRequired(dish, dishIndex)">
+									<u-input v-model="dish.description" height="41" placeholder="请描述菜品的使用素材" inputAlign="right"></u-input>
+								</u-form-item>
+							</view>
+						</view>
+					</view>
+				</u-collapse-item>
+			</u-collapse>
+		</u-form>
+
+		<view class="footer-bar" :class="{ 'footer-bar--dual': currentStep === 2 }">
+			<u-button v-if="currentStep === 2"
+				:custom-style="{
+					width: '205rpx',
+					fontWeight: '400',
+					fontSize: '28rpx',
+					color: '#449AFF',
+					border: '1rpx solid #449AFF',
+					background: '#fff',
+					marginRight: '24rpx'
+				}"
+				@click="goPrevStep"
+			>上一步</u-button>
+			<u-button v-if="currentStep === 1" type="primary" @click="goNextStep">下一步</u-button>
+			<u-button v-if="currentStep === 2"
+				:custom-style="{
+					fontWeight: '400',
+					fontSize: '28rpx',
+					color: '#FFFFFF',
+					background: 'linear-gradient(90deg, #77B6FF 0%, #449AFF 100%)',
+				}"
+				@click="submit"
+			>提交审核</u-button>
+		</view>
+
+		<u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
+	</view>
+</template>
+
+<script>
+import configService from '@/common/service/config.service';
+
+let dishIdCounter = 100;
+
+export default {
+	data() {
+		return {
+			currentStep: 1,
+			show: false,
+			uploadAction: configService.apiUrl + '/sys/common/upload',
+			imageHttp: configService.apiUrl + '/',
+			uploadFormData: { biz: 'temp' },
+			baseForm: {
+				name: '',
+				category: '',
+				categoryName: '',
+				productImage: '',
+				detailImages: '',
+				price: '',
+				sellingPrice: '',
+			},
+			dishForm: {
+				dishCategories: [
+					{ id: 1, name: '荤菜', isActive: false, items: [{ id: dishIdCounter++, name: '', price: '', description: '' }] },
+					{ id: 2, name: '素菜', isActive: false, items: [{ id: dishIdCounter++, name: '', price: '', description: '' }] },
+					{ id: 3, name: '主食', isActive: false, items: [{ id: dishIdCounter++, name: '', price: '', description: '' }] },
+					{ id: 4, name: '汤', isActive: false, items: [{ id: dishIdCounter++, name: '', price: '', description: '' }] },
+					{ id: 5, name: '其他', isActive: false, items: [{ id: dishIdCounter++, name: '', price: '', description: '' }] },
+				],
+			},
+			query: {},
+			fileList: {
+				cover: [],
+				detail: [],
+			},
+			actionSheetList: [],
+			activeNames: [1],
+			dishRules: {},
+			baseRules: {
+				name: [{ required: true, message: '请输入名称', trigger: ['blur', 'change'] }],
+				category: [{ required: true, message: '请选择分类', trigger: ['blur', 'change'] }],
+				price: [
+					{ required: true, type: 'number', message: '请输入团餐价格', trigger: ['blur', 'change'] },
+					{
+						asyncValidator: (rule, value, callback) => {
+							if (this.baseForm.sellingPrice && value > this.baseForm.sellingPrice) {
+								callback(new Error('团餐价格不能大于商品售价'));
+							} else {
+								callback();
+							}
+						},
+						trigger: ['blur', 'change']
+					},
+				],
+				sellingPrice: [
+					{ required: true, type: 'number', message: '请输入商品售价', trigger: ['blur', 'change'] },
+					{
+						asyncValidator: (rule, value, callback) => {
+							if (this.baseForm.price && value < this.baseForm.price) {
+								callback(new Error('商品售价不能小于团餐价格'));
+							} else {
+								callback();
+							}
+						},
+						trigger: ['blur', 'change']
+					},
+				],
+				productImage: [{ required: true, message: '请上传商品封面图', trigger: ['blur', 'change'] }],
+				detailImages: [{ required: true, message: '请上传商品详情图片', trigger: ['blur', 'change'] }],
+			},
+		};
+	},
+	watch: {
+		'dishForm.dishCategories': {
+			handler() {
+				if (this.currentStep === 2) {
+					this.$nextTick(() => {
+						this.updateValidationRules();
+					});
+				}
+			},
+			deep: true
+		}
+	},
+	onLoad(query) {
+		if (query.id) {
+			this.query = query;
+			this.getData();
+		}
+		this.getClassData();
+	},
+	onReady() {
+		this.$refs.baseFormRef.setRules(this.baseRules);
+	},
+	methods: {
+		getData() {
+			this.$http.get('/groupmeal/gmCustomerPackage/queryById', { params: { id: this.query.id } }).then(res => {
+				if (res.data.code === 200) {
+					const data = res.data.result;
+					this.baseForm = {
+						...data,
+						categoryName: ''
+					};
+					this.fileList = {
+						cover: data.productImage.split(',').map(item => ({ url: item })),
+						detail: data.detailImages.split(',').map(item => ({ url: item })),
+					};
+					if (data.gmMerchantPackageDetails && data.gmMerchantPackageDetails.length > 0) {
+						this.dishForm.dishCategories.forEach(category => {
+							const items = data.gmMerchantPackageDetails.filter(b => b.category == category.id);
+							if (items.length > 0) {
+								category.items = items;
+							}
+						});
+					}
+					this.$nextTick(() => {
+						const matched = this.actionSheetList.find(item => item.value == data.category);
+						if (matched) {
+							this.baseForm.categoryName = matched.text;
+						}
+					});
+				}
+			});
+		},
+		getClassData() {
+			this.$http.get('/groupmeal/gmMerchantPackage/getGroupMealCategory', {}).then(res => {
+				if (res.data.code === 200) {
+					this.actionSheetList = res.data.result.map(item => ({
+						text: item.name,
+						value: item.code
+					}));
+					if (this.baseForm.category) {
+						const matched = this.actionSheetList.find(item => item.value == this.baseForm.category);
+						if (matched) {
+							this.baseForm.categoryName = matched.text;
+						}
+					}
+				}
+			});
+		},
+		actionSheetCallback(e) {
+			this.baseForm.category = e.value;
+			this.baseForm.categoryName = e.text;
+		},
+		onInput(value, key) {
+			let filtered = value.replace(/[^\d.]/g, '');
+			filtered = filtered.replace(/^\./g, '');
+			filtered = filtered.replace(/\.{2,}/g, '.');
+			const parts = filtered.split('.');
+			if (parts.length > 1) {
+				filtered = parts[0] + '.' + (parts[1].slice(0, 2) || '');
+			}
+			this.$nextTick(() => {
+				this.baseForm[key] = !filtered ? filtered : filtered - 0;
+			});
+		},
+		processImageList(lists, formKey) {
+			const urls = lists.map(item => {
+				if (item.response && item.response.message) {
+					return this.imageHttp + item.response.message;
+				}
+				if (item.url) {
+					return item.url;
+				}
+				return '';
+			}).filter(Boolean);
+			this.baseForm[formKey] = urls.join(',');
+		},
+		onCoverSuccess(res, index, lists) {
+			this.fileList.cover = lists;
+			this.processImageList(lists, 'productImage');
+		},
+		onCoverRemove(index, lists) {
+			this.fileList.cover = lists;
+			this.processImageList(lists, 'productImage');
+		},
+		onDetailSuccess(res, index, lists) {
+			this.fileList.detail = lists;
+			this.processImageList(lists, 'detailImages');
+		},
+		onDetailRemove(index, lists) {
+			this.fileList.detail = lists;
+			this.processImageList(lists, 'detailImages');
+		},
+		goNextStep() {
+			this.$refs.baseFormRef.validate(valid => {
+				if (valid) {
+					this.currentStep = 2;
+					this.$nextTick(() => {
+						this.updateValidationRules();
+						uni.pageScrollTo({ scrollTop: 0, duration: 0 });
+					});
+				}
+			});
+		},
+		goPrevStep() {
+			this.currentStep = 1;
+			this.$nextTick(() => {
+				uni.pageScrollTo({ scrollTop: 0, duration: 0 });
+			});
+		},
+		isEdited(dish) {
+			return !!(dish.name || dish.price || dish.description);
+		},
+		isRequired(dish, dishIndex) {
+			return dishIndex === 0 || this.isEdited(dish);
+		},
+		shouldValidate(dish) {
+			return this.isEdited(dish);
+		},
+		isComplete(dish) {
+			const name = (dish.name || '').trim();
+			const description = (dish.description || '').trim();
+			const price = dish.price;
+			return !!(name && description && (price === 0 || price));
+		},
+		isEditedShow(category) {
+			if (!this.query.id) return false;
+			return category.items.some(item => this.isEdited(item));
+		},
+		updateValidationRules() {
+			if (!this.$refs.dishFormRef) return;
+
+			const newRules = {};
+			this.dishForm.dishCategories.forEach((category, catIndex) => {
+				category.items.forEach((dish, dishIndex) => {
+					if (this.shouldValidate(dish)) {
+						const nameProp = `dishCategories.${catIndex}.items.${dishIndex}.name`;
+						const priceProp = `dishCategories.${catIndex}.items.${dishIndex}.price`;
+						const descProp = `dishCategories.${catIndex}.items.${dishIndex}.description`;
+
+						newRules[nameProp] = [{ required: true, message: '请输入名称', trigger: ['blur', 'change'] }];
+						newRules[priceProp] = [{ required: true, type: 'number', message: '请输入价格', trigger: ['blur', 'change'] }];
+						newRules[descProp] = [{ required: true, message: '请输入描述', trigger: ['blur', 'change'] }];
+					}
+				});
+			});
+
+			this.dishRules = newRules;
+			this.$refs.dishFormRef.setRules(this.dishRules);
+		},
+		onCollapseChange(names) {
+			this.activeNames = names;
+		},
+		addDish(categoryId) {
+			const category = this.dishForm.dishCategories.find(c => c.id === categoryId);
+			if (category) {
+				category.items.push({
+					id: dishIdCounter++,
+					name: '',
+					price: '',
+					description: ''
+				});
+			}
+		},
+		removeDish(categoryId, dishId) {
+			const category = this.dishForm.dishCategories.find(c => c.id === categoryId);
+			if (category && category.items.length > 1) {
+				const index = category.items.findIndex(d => d.id === dishId);
+				if (index > -1) {
+					category.items.splice(index, 1);
+				}
+			}
+		},
+		buildDetails() {
+			const details = [];
+			this.dishForm.dishCategories.forEach(category => {
+				if (!category.items || !Array.isArray(category.items)) return;
+				category.items.forEach((item) => {
+					if (this.isEdited(item)) {
+						details.push({
+							category: category.id,
+							name: item.name,
+							price: item.price,
+							description: item.description
+						});
+					}
+				});
+			});
+			return details;
+		},
+		submit() {
+			this.updateValidationRules();
+			const hasCompleteDish = this.dishForm.dishCategories.some(category =>
+				category.items.some(item => this.isComplete(item))
+			);
+			if (!hasCompleteDish) {
+				this.$tip.error('请至少添加一个完整的菜品信息');
+				return;
+			}
+			this.$refs.dishFormRef.validate().then(() => {
+				const { categoryName, ...baseData } = this.baseForm;
+				const details = this.buildDetails();
+				if (details.length === 0) {
+					this.$tip.error('请至少添加一个完整的菜品信息');
+					return;
+				}
+				const params = {
+					...baseData,
+					gmMerchantPackageDetails: [...details]
+				};
+				this.$http.post('/groupmeal/gmMerchantPackage/submit', params).then(res => {
+					if (res.data.code === 200) {
+						uni.showToast({
+							title: res.data.message || '提交成功',
+							icon: 'none'
+						});
+						setTimeout(() => {
+							uni.navigateBack({ delta: 1 });
+						}, 500);
+					} else {
+						this.$tip.error(res.data.message);
+					}
+				});
+			}).catch(errors => {
+				console.log('校验失败', errors);
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+$uni-text-color: #303133;
+$uni-color-primary: #2979ff;
+
+.page-container {
+	min-height: 100vh;
+	background-color: #f5f5f5;
+
+	&.step2-page {
+		padding-bottom: 160rpx;
+	}
+
+	.section-title {
+		font-weight: 500;
+		font-size: 30rpx;
+		color: #333333;
+	}
+
+	::v-deep .u-collapse-item {
+		margin-bottom: 16rpx;
+		.u-collapse-head {
+			padding: 20rpx 32rpx;
+			background-color: #fff;
+		}
+		&.active {
+			.u-collapse-body {
+				height: auto !important;
+			}
+		}
+	}
+
+	.collapse-title {
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #333333;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		.num {
+			padding: 0 10rpx;
+		}
+	}
+
+	.collapse-content {
+		.dish-item {
+			margin-top: 16rpx;
+			padding: 20rpx 32rpx;
+			background: #FFFFFF;
+			box-shadow: 0 2rpx 8rpx 0 rgba(214,225,237,0.1);
+			border: 1rpx solid #F0F3F5;
+			border-radius: 16rpx;
+			.dish-header {
+				margin-bottom: 20rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.dish-title {
+					font-size: 28rpx;
+					color: #333333;
+					display: flex;
+					align-items: center;
+				}
+				.dish-actions {
+					display: flex;
+					gap: 16rpx;
+					::v-deep .u-btn {
+						font-weight: 400;
+						font-size: 22rpx;
+					}
+					.text {
+						display: flex;
+						align-items: center;
+						text {
+							line-height: 1;
+							margin-left: 4rpx;
+						}
+					}
+				}
+			}
+			.dish-form {
+				padding: 6rpx 16rpx;
+				border-radius: 8rpx;
+				background: #F7F8FC;
+			}
+			::v-deep .u-form-item {
+				padding: 16rpx 0;
+				line-height: 1;
+				.u-form-item--left__content {
+					flex: none;
+				}
+			}
+		}
+	}
+}
+
+.form-card {
+	margin: 24rpx;
+	padding: 20rpx 24rpx;
+	background-color: #fff;
+	border-radius: 16rpx;
+
+	::v-deep .u-form-item {
+		padding: 16rpx 0;
+		line-height: 1;
+		.u-form-item--left__content {
+			flex: none;
+			.u-form-item--left__content--required {
+				color: #fa3534;
+				left: auto;
+				right: 0;
+			}
+		}
+	}
+
+	.form-input {
+		pointer-events: none;
+	}
+	::v-deep .uni-input-input:disabled {
+		pointer-events: none;
+	}
+
+	.input-suffix {
+		color: #232832;
+		font-size: 26rpx;
+		margin-left: 10rpx;
+	}
+
+	.upload-content {
+		width: 100%;
+
+		.upload-tip {
+			font-weight: 400;
+			font-size: 20rpx;
+			color: #999999;
+			margin-bottom: 20rpx;
+		}
+
+		::v-deep .u-add-tips {
+			margin-top: 10rpx;
+		}
+	}
+}
+
+.footer-bar {
+	::v-deep .u-btn {
+		width: 100%;
+		height: 76rpx;
+		font-weight: 400;
+		font-size: 28rpx;
+		color: #449AFF;
+		border-radius: 54rpx;
+		border: 1rpx solid #449AFF;
+		background: #FFFFFF;
+		&::after {
+			display: none;
+		}
+	}
+
+	&--dual {
+		display: flex;
+		align-items: center;
+	}
+}
+</style>

+ 10 - 10
pages/groupMeal/goods/list.vue

@@ -80,23 +80,23 @@
 								</view>
 								<!-- 根据模式和状态显示不同操作 -->
 								<view class="goods-actions">
-									<u-button 
-										v-if="!isManaging && currentStatusTab === 2" 
-										type="primary" plain
-										@click="editGoods(goods)"
-									>编辑</u-button>
 									<u-checkbox v-if="isManaging" :name="goods.id" shape="circle" v-model="goods.checked" @change="onSelect"></u-checkbox>
 								</view>
 							</view>
 							<!-- 其它操作 -->
 							<view class="other-actions">
+								<u-button
+									v-if="!isManaging && currentStatusTab === 2" 
+									type="primary" plain
+									@click="editGoods(goods)"
+								>编辑</u-button>
 								<u-button 
 									v-if="!isManaging && currentStatusTab === 2 && goods.reviewStatus == 1" 
 									type="primary" plain
 									@click="handleAction('publish', goods)"
 								>上架</u-button>
 								<u-button 
-									v-if="!isManaging && [0,1].indexOf(currentStatusTab) !== -1" 
+									v-if="!isManaging && currentStatusTab == 0" 
 									type="primary" plain
 									@click="handleAction('unpublish', goods)"
 								>下架</u-button>
@@ -128,7 +128,7 @@
 			</u-checkbox-group>
 			
 			<view class="action-buttons">
-				<template v-if="currentStatusTab === 0 || currentStatusTab === 1">
+				<template v-if="currentStatusTab === 0">
 					<u-button type="primary" @click="handleBatchAction('unpublish')">下架</u-button>
 				</template>
 				<template v-if="currentStatusTab === 2">
@@ -235,7 +235,7 @@ export default {
 			else if (this.currentStatusTab == 1) {
 				params = {
 					...params,
-					status: 0,
+					status: null,
 					reviewStatus: 0,
 				}
 			}
@@ -328,14 +328,14 @@ export default {
 		addGoods() {
 			this.isManaging = false;
 			uni.navigateTo({
-				url: '/pages/groupMeal/goods/form-step1'
+				url: '/pages/groupMeal/goods/form'
 			});
 		},
 		// 编辑商品
 		editGoods(goods) {
 			this.isManaging = false;
 			uni.navigateTo({
-				url: '/pages/groupMeal/goods/form-step1?id=' + goods.id
+				url: '/pages/groupMeal/goods/form?id=' + goods.id
 			});
 		},
 		// 单选

+ 52 - 7
pages/groupMeal/orders/order-alist.vue

@@ -53,7 +53,7 @@
 						v-model="selectedOrders"
 						@change="onSelect"
 					>
-						<view class="order-item" v-for="item in data" :key="item.orderId">
+						<view class="order-item" v-for="item in data" :key="item.hostOrderId">
 							<view class="order-header">
 								<view class="location-box">
 									<view class="location-info">
@@ -68,8 +68,11 @@
 										</view>
 									</view>
 									<view class="location-address">
-										<view class="atext">{{ item.address }}</view>
-										<view class="btext">{{ item.region }}</view>
+										<view>
+											<view class="atext">{{ item.address }}</view>
+											<view class="btext">{{ item.region }}</view>
+										</view>
+										<view style="font-size: 24rpx;">{{ item.createTime }}</view>
 									</view>
 								</view>
 								<view class="order-actions" >
@@ -203,14 +206,36 @@ export default {
 			});
 		},
 		onSelect(e) {
-			this.selectedOrders = e;
-			// 控制全选
-			this.isAllSelected = e.length === this.$refs.listScroll.dataList.length;
+			console.log('选择的是', e)
+			if(e.length > 0) {
+				let allOrders = this.$refs.listScroll.dataList;
+				const result = allOrders.filter(item => e.includes(item.hostOrderId))
+				let arr = []
+				if(result && result.length > 0){
+					result.forEach(item => {
+						item.merchantPackageOrderDTOS.forEach(sub => {
+							arr.push(sub.merchantOrderIds)
+						})
+					})
+					this.selectedOrders = arr;
+					// 控制全选
+					this.isAllSelected = result.length === this.$refs.listScroll.dataList.length?true: false
+				}
+			} else {
+				this.selectedOrders = []
+				this.isAllSelected = false
+			}
 		},
 		onSelectAll(e) {
 			let allOrders = this.$refs.listScroll.dataList;
 			if (e.value) {
-				this.selectedOrders = allOrders.map(order => order.orderId);
+				let arr = []
+				allOrders.forEach(item => {
+					item.merchantPackageOrderDTOS.forEach(sub => {
+						arr.push(sub.merchantOrderIds)
+					})
+				})
+				this.selectedOrders = arr;
 			} else {
 				this.selectedOrders = [];
 			}
@@ -218,6 +243,23 @@ export default {
 				item.checked = e.value;
 			});
 		},
+		itemSelected(e, item) {
+			item.checked = !item.checked
+			console.log(123123, this.$refs.listScroll.dataList)
+			// let allOrders = this.$refs.listScroll.dataList;
+			// const result = allOrders.filter(item => e.checked)
+			// let arr = []
+			// if(result && result.length > 0){
+			// 	result.forEach(item => {
+			// 		item.merchantPackageOrderDTOS.forEach(sub => {
+			// 			arr.push(sub.merchantOrderIds)
+			// 		})
+			// 	})
+			// 	this.selectedOrders = arr;
+			// 	// 控制全选
+			// 	this.isAllSelected = result.length === this.$refs.listScroll.dataList.length?true: false
+			// }
+		},
 		// 完成某种操作后,清空数据
 		onClearSel() {
 			this.selectedOrders = []; 
@@ -344,6 +386,9 @@ export default {
 			}
 			.location-address {
 				margin-top: 10rpx;
+				display: flex;
+				align-items: flex-end;
+				justify-content: space-between;
 				.atext {
 					font-weight: 500;
 					font-size: 26rpx;

+ 28 - 0
pages/index/full.vue

@@ -40,6 +40,17 @@
 				</view>
 			</view>
 		</view>
+		<view class="function">
+			<view class="title">
+				设置
+			</view>
+			<view class="fun_box">
+				<view class="item"style="margin: 0px;" @click="loginOut">
+					<image src="@/static/login/tuichu.png" mode=""></image>
+					退出
+				</view>
+			</view>
+		</view>
 
 		<!-- 弹窗 -->
 		<Modal ref="myModal"
@@ -52,6 +63,7 @@
 
 <script>
 import Modal from '@/components/modal/index.vue';
+	import api from "@/api/api";
 export default {
 	components: {
 		Modal,
@@ -132,6 +144,22 @@ export default {
 		}
 	},
 	methods: {
+		loginOut(){
+			uni.showModal({
+				title: '提示',
+				content: '是否确认退出当前账号?',
+				success: (res) => {
+					if (res.confirm) {
+						api.logout().then(res=>{
+							uni.clearStorageSync();
+							uni.navigateTo({
+								url: `/pages/login/login`
+							});
+						})
+					}
+				}
+			});
+		},
 		storeFunc(item) {
 			// 需要先报名
 			if (item.name === '团餐活动') {

+ 7 - 11
pages/index/index.vue

@@ -20,7 +20,7 @@
 		        <span>{{ numberOrders }}</span>订单数
 		      </view>
 		      <view class="item">
-		        <span>{{ income }}</span>收益(元)
+		        <span>{{ turnover }}</span>营业总额(元)
 		      </view>
 		      <view class="item" @click="goUser">
 		        <span>{{ newCustomer || 0 }}</span>新客
@@ -115,7 +115,7 @@
 			return {
 				numberOrders: "", //订单
 				newCustomer: "", //新客
-				income: "", //收益
+				turnover: "", //营业总额
 				name: "",
 				num: 222,
 				msg: [],
@@ -172,12 +172,12 @@
 			},
 			gettodayData() {
 				this.$http
-					.get("/merchant/app/home/todayData?merchantId=" + this.merchantId, {})
+					.get("/merchant/account/todayOverview", {})
 					.then((res) => {
 						if (res.data.code == 200) {
-							this.income = res.data.result.income;
-							// this.newCustomer = res.data.result.newCustomer
+							this.turnover = res.data.result.turnover;
 							this.numberOrders = res.data.result.numberOrders;
+							this.newCustomer = res.data.result.newCustomer;
 						}
 					});
 			},
@@ -193,12 +193,8 @@
 						}
 					});
 			},
-			getNum() {
-				let data = {};
-				this.$http.post("/newCustomer/count", data).then((res) => {
-					this.newCustomer = res.data.result.newCustomerCount;
-				});
-			},
+			// getNum 已合并到 gettodayData,新客由 /merchant/account/todayOverview 返回
+			getNum() {},
 			//获取商户是否完善店铺信息
 			getStroeStatus() {
 				this.$http

+ 11 - 11
pages/order/details.vue

@@ -95,19 +95,19 @@
 				<view class="title">
 					订单信息
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.orderId">
 					<span>订单号 :</span>
 					{{product.orderId?product.orderId:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.buyTime">
 					<span>下单时间:</span>
 					{{product.buyTime?product.buyTime:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.buyTime">
 					<span>联系方式:</span>
 					{{product.phone?product.phone:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.payTime">
 					<span >付款时间:</span>
 					{{product.payTime?product.payTime:'--'}}
 				</view>
@@ -122,31 +122,31 @@
 				<view class="title">
 					订单信息
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.orderId">
 					<span>订单号:</span>
 					{{product.orderId?product.orderId:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.tradeId">
 					<span>支付流水号:</span>
 					{{product.tradeId?product.tradeId:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.linkName">
 					<span>提交人:</span>
 					{{product.linkName?product.linkName:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.phone">
 					<span>联系电话:</span>
 					{{product.phone?product.phone:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.buyTime">
 					<span>下单时间:</span>
 					{{product.buyTime?product.buyTime:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.payTime">
 					<span>付款时间:</span>
 					{{product.payTime?product.payTime:'--'}}
 				</view>
-				<view class="data">
+				<view class="data" v-if="product.useTime">
 					<span>使用时间:</span>
 					{{product.useTime?product.useTime:'--'}}
 				</view>

+ 37 - 24
pages/order/index.vue

@@ -162,7 +162,7 @@
 					</view>
 				</view>
 				<view class="time">
-					<view class="time_left">
+					<view class="time_left" v-if='item.orderStateTimeName && item.orderStateTime'>
 						{{item.orderStateTimeName}}:{{item.orderStateTime}}
 					</view>
 					<view class="time_right" @click.stop="goRecord(item)" v-if="item.auditType =='0'">
@@ -501,6 +501,7 @@
 			},
 			mescrollInit(mescroll) {
 				this.mescroll = mescroll;
+				mescroll.optDown.use = false;
 			},
 			InputBlur(e) {
 				this.search = e.detail.value
@@ -551,7 +552,7 @@
 			goRecord(item) {
 				console.log(item)
 				uni.navigateTo({
-					url: '/pages/order/record?orderId=' + item.orderId
+					url: '/pages/order/record?orderId=' + item.id
 				})
 			},
 			//跳转至服务订单详情页
@@ -577,11 +578,14 @@
 					this.orderList.forEach(item => {
 						item.isShow = false
 					})
-					console.log(this.orderList)
-					this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
+					if (this.mescroll) {
+						this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
+					}
 					uni.showTabBar()
 				}).catch(() => {
-					this.mescroll.endErr()
+					if (this.mescroll) {
+						this.mescroll.endErr()
+					}
 				})
 			},
 			geDetail(item) {
@@ -602,10 +606,14 @@
 				}
 				this.$http.post("/ts/merchant/serviceOrder", data).then(res => {
 						this.serviceList = this.serviceList.concat(res.data.result.records)
-						this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
+						if (this.mescroll) {
+							this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
+						}
 					})
 					.catch(() => {
-						this.mescroll.endErr()
+						if (this.mescroll) {
+							this.mescroll.endErr()
+						}
 					})
 
 			},
@@ -985,31 +993,36 @@
 				})
 			}
 		},
-		mounted() {
-			this.mescroll.optDown.use = false
-			// this.getList()
-		},
 		onShow() {
-			let that = this
+			const app = getApp()
+			if (app.globalData) {
+				const { currentIndex, tabIndex } = app.globalData
+				if (currentIndex !== '' && currentIndex != null) {
+					this.currentIndex = currentIndex
+				}
+				if (tabIndex !== '' && tabIndex != null) {
+					this.tabIndex = tabIndex
+				}
+				app.globalData.currentIndex = ''
+				app.globalData.tabIndex = ''
+			}
+			const that = this
 			uni.getStorage({
 				key: 'login_user_info',
-				success: function(res) {
+				success(res) {
 					that.merchantId = res.data.merchantId
 					that.serviceList = []
 					that.orderList = []
-					let page = {
-						num: 1,
-						size: 10
-					}
-					that.getList(page)
-					that.getserviceList(page)
+					const page = { num: 1, size: 10 }
+					that.$nextTick(() => {
+						if (that.tabIndex == 0) {
+							that.getList(page)
+						} else if (that.tabIndex == 1) {
+							that.getserviceList(page)
+						}
+					})
 				}
 			})
-			const app = getApp();
-      this.currentIndex=app.globalData.currentIndex
-			this.tabIndex=app.globalData.tabIndex
-			app.globalData.currentIndex=''
-			app.globalData.tabIndex=''
 		},
 	}
 </script>

+ 41 - 14
pages/product/creatProduct.vue

@@ -27,7 +27,9 @@
 						商品名称<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input :disabled="tabIndex==1" v-model="form.productName" placeholder="输入商品名称" />
+						
+						<!-- tabIndex==1 -->
+						<u-input :disabled="form.isUpdatePrice==0" v-model="form.productName" placeholder="输入商品名称" />
 					</view>
 				</view>
 				<view class="item">
@@ -74,7 +76,9 @@
 						原价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input :disabled="tabIndex==1" v-model="form.price" placeholder="输入商品原价" />
+						
+						<!-- tabIndex==1 -->
+						<u-input type="digit" :disabled="form.isUpdatePrice==0" v-model="form.price" placeholder="输入商品原价" @input="onPriceInput($event, 'price')" />
 					</view>
 					<view class="unit">
@@ -85,7 +89,7 @@
 						实际售价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input type="num" :disabled="form.isUpdatePrice==0" v-model="form.soldPrice" placeholder="输入客户实际支付价" />
+						<u-input type="digit" :disabled="form.isUpdatePrice==0" v-model="form.soldPrice" placeholder="输入客户实际支付价" @input="onPriceInput($event, 'soldPrice')" />
 					</view>
 					<view class="unit">
@@ -193,14 +197,14 @@
 							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>
-					<view class="item">
+					<!-- <view class="item">
 						<view class="label">
 							库存<span>*</span>
 						</view>
 						<view class="picker set">
 							<u-input type="number" v-model="form.stockQuantity" placeholder="输入库存数量" />
 						</view>
-					</view>
+					</view> -->
 					<view class="item">
 						<view class="label">
 							可用时间<span>*</span>
@@ -374,6 +378,8 @@
 				// 商品分组列表
 				showGroupPicker: false,
 				groupOptions: [],
+				// 防止提交审核重复提交
+				submitLoading: false
 			}
 		},
 		mounted() {
@@ -407,6 +413,22 @@
 			this.updateRangeTime()
 		},
 		methods: {
+			// 价格输入:仅允许非负数字和小数,整数部分不超过7位
+			onPriceInput(value, key) {
+				let filtered = String(value).replace(/[^\d.]/g, '');
+				filtered = filtered.replace(/^\./g, '');
+				filtered = filtered.replace(/\.{2,}/g, '.');
+				const parts = filtered.split('.');
+				const integerPart = parts[0].slice(0, 7);
+				if (parts.length > 1) {
+					filtered = integerPart + '.' + (parts[1].slice(0, 2) || '');
+				} else {
+					filtered = integerPart;
+				}
+				this.$nextTick(() => {
+					this.form[key] = filtered;
+				});
+			},
 			//全选
 			allSelect() {
 				this.all = true
@@ -638,7 +660,7 @@
 				})
 			},
 			selectProductType() {
-				if (this.tabIndex == '0') {
+				if (this.tabIndex == '0' || this.form.isUpdatePrice == 1) {
 					this.isSelectType = true
 					this.showText = ''
 					this.productType = []
@@ -727,17 +749,20 @@
 			//提交审核
 			submit() {
 				console.log(this.form)
-				this.form.specItems = this.selectProductSunItem
-				this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
-				if (!this.form.saleStartDate) {
+				if(this.submitLoading) {
 					uni.showToast({
-						title: '请设置售卖时间',
+						title: '正在提交数据,请勿重复提交!',
 						icon: 'none'
 					});
 					return
-				} else if (!this.form.stockQuantity) {
+				}
+				this.submitLoading = true
+				this.form.specItems = this.selectProductSunItem
+				this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
+				
+				if (!this.form.saleStartDate) {
 					uni.showToast({
-						title: '请输入商品库存',
+						title: '请设置售卖时间',
 						icon: 'none'
 					});
 					return
@@ -758,6 +783,7 @@
 					if (this.productId == '') {
 						this.$http.post("/app/product/add", this.form).then(res => {
 							if (res.data.code == 200) {
+								this.submitLoading = false
 								uni.showToast({
 									title: '添加成功',
 									icon: 'none'
@@ -770,24 +796,25 @@
 									key: 'group',
 								});
 							} else {
+								this.submitLoading = false
 								uni.showToast({
 									title: res.data.message,
 									icon: 'none'
 								});
 							}
-
-
 						})
 					} else {
 						this.form.productId = this.productId
 						this.$http.post("/app/product/edit", this.form).then(res => {
 							if (res.data.code == 200) {
+								this.submitLoading = false
 								uni.showToast({
 									title: '编辑成功',
 									icon: 'none'
 								});
 								this.back()
 							} else {
+								this.submitLoading = false
 								uni.showToast({
 									icon: 'none',
 									title: res.data.message

+ 19 - 16
pages/product/creatStandard.vue

@@ -89,10 +89,11 @@
 				productName: '',
 				productList: [],
 				merchantId: '',
+				_isFirstShow: true,
 				api: {
-        	url: '/app/product/purveyor/list',
-        	method: 'GET'
-      	},
+				url: '/app/product/purveyor/list',
+				method: 'GET'
+				},
       	initParams: {},
 			}
 		},
@@ -189,27 +190,29 @@
     	},
 		},
 		onShow() {
-			
-			let that = this
-			uni.getStorage({
-				key: 'login_user_info',
-				success: function(res) {
-					that.merchantId = res.data.merchantId
-					that.getProductList()
-				}
-			})
+			if (this._isFirstShow) {
+				this._isFirstShow = false;
+			} else {
+				this.getProductList();
+			}
 			uni.removeStorage({
 				key: 'smdate',
 			});
 			uni.removeStorage({
 				key: 'group',
 			});
-
 		},
 		onLoad() {
-  	  // 初始化列表
-  	  this.getProductList();
-  	}
+			const userInfo = uni.getStorageSync('login_user_info');
+			if (userInfo) {
+				this.merchantId = userInfo.merchantId;
+			}
+			this.initParams = {
+				merchantId: this.merchantId,
+				productStatus: this.productStatus,
+				productName: this.productName
+			};
+		}
 		// async onShow() {
 		// 	let that = this
 		// 	uni.getStorage({

+ 4 - 3
pages/product/details.vue

@@ -90,12 +90,13 @@
 				<view class="data">
 					<span class="span">售卖时间</span>{{form.saleStartDate ? form.saleStartDate.slice(0,10) : ''}}-{{form.saleEndDate ? form.saleEndDate.slice(0,10) : ''}}
 				</view>
-				<view class="data">
+				<!-- <view class="data">
 					<span class="span">库存</span>{{form.stockQuantity}}
-				</view>
+				</view> -->
 				<view class="data">
 					<span class="span">可用时间</span>
-					<view class="" v-if="form.availableStartDate">
+					<view v-if="form.useType == 3">长期有效</view>
+					<view class="" v-else-if="form.availableStartDate">
 						{{form.availableStartDate.slice(0,10)}}-{{form.availableEndDate.slice(0,10)}}
 					</view>
 					<view class="" v-else>

+ 66 - 40
pages/product/index.vue

@@ -17,9 +17,9 @@
 
 			<div class="tab-container">
 				<div class="tab-item" :class="tabIndex == 1 ? 'active' : ''"
-					@click="tabIndex = 1; productName = ''; productStatus = 0; getProductList(); getStatus()">品牌标品</div>
+					@click="switchTab(1)">品牌标品</div>
 				<div class="tab-item" :class="tabIndex == 0 ? 'active' : ''"
-					@click="tabIndex = 0; productName = ''; productStatus = 0; getProductList(); getStatus()">自有商品</div>
+					@click="switchTab(0)">自有商品</div>
 			</div>
 
 			<view class="search">
@@ -130,7 +130,7 @@
 				<view class="center">
 					<view class="error" v-if="canBeDelete">
 						是否将所选商品删除?<br />
-						<span style="font-size: 28rpx;color: #666666;margin-top: 16rpx;">删除后需要重新添加品牌标品</span>
+						<span style="font-size: 28rpx;color: #666666;margin-top: 16rpx;">删除后需要重新添加自有商品</span>
 
 					</view>
 					<view class="error" v-else>
@@ -253,6 +253,19 @@ export default {
 			this.getProductList()
 			// 这里可以添加其他逻辑
 		},
+		// 切换品牌标品 / 自有商品
+		switchTab(index) {
+			if (this.tabIndex === index) return
+			this.tabIndex = index
+			this.productName = ''
+			this.currentIndex = 0
+			this.productStatus = 0
+			this.isManage = false
+			this.isAll = false
+			this.productList = []
+			this.getProductList()
+			this.getStatus()
+		},
 		//切换分类
 		selectType(item, index) {
 			if (!this.isManage) {
@@ -299,53 +312,53 @@ export default {
 				url: '/pages/product/creatProduct?productId=' + item.productId + '&tabIndex=' + this.tabIndex
 			})
 		},
+		getSelectedProducts() {
+			return this.productList.filter(item => item.select)
+		},
+		showSelectRequiredToast() {
+			uni.showToast({
+				title: '至少选择一个商品',
+				icon: 'none'
+			})
+		},
 		select(item) {
 			item.select = !item.select
-			this.productHandleList.push(item.productId)
+			this.isAll = this.productList.length > 0 && this.productList.every(i => i.select)
 		},
 		//批量上下架status:0下架。1上架
 		deletes(status) {
-			let that = this
-			// this.productStatus == 0 ?this.isSell = true:this.isDelist = true
+			const selectedList = this.getSelectedProducts().map(item => ({
+				productId: item.productId,
+				productStatus: status,
+				productType: this.tabIndex
+			}))
+			if (!selectedList.length) {
+				this.showSelectRequiredToast()
+				return
+			}
 			if (this.productStatus == 0) {
+				this.sellProducts = selectedList
 				this.isSell = true
-				this.productList.forEach(item => {
-					if (item.select) {
-						this.sellProducts.push({
-							productId: item.productId,
-							productStatus: status
-						})
-					}
-
-				})
 			} else {
+				this.delistList = selectedList
 				this.isDelist = true
-				this.productList.forEach(item => {
-					if (item.select) {
-						this.delistList.push({
-							productId: item.productId,
-							productStatus: status
-						})
-					}
-
-				})
 			}
 		},
 		//批量删除
 		remove() {
-			this.productList.forEach((item => {
-				if (item.select) {
-					this.productHandleList.push(item.productId)
-				}
-
-			}))
+			this.productHandleList = this.getSelectedProducts().map(item => item.productId)
+			if (!this.productHandleList.length) {
+				this.showSelectRequiredToast()
+				return
+			}
 			this.isDelete = true
-			// this.getProductList()
 		},
 		removeProduct() {
-			let ids = []
-			ids = this.productHandleList.join(',')
-			console.log(ids)
+			if (!this.productHandleList.length) {
+				this.showSelectRequiredToast()
+				return
+			}
+			const ids = this.productHandleList.join(',')
 			this.$http.get("/app/product/deleteBatch?ids=" + ids,)
 				.then(res => {
 					if (res.data.code == 200) {
@@ -359,7 +372,7 @@ export default {
 						this.productHandleList = []
 						this.isManage = false
 						this.isAll = false
-						
+
 					} else {
 						this.isDelete = false
 						this.productHandleList = []
@@ -414,19 +427,25 @@ export default {
 
 			this.delistList.push({
 				productId: item.productId,
-				productStatus: 0
+				productStatus: 0,
+				productType:this.tabIndex
+				// productType = 自有或者标品(1: 标品, 0: 自有
 			})
 			this.isDelist = true
 		},
 		//下架商品
 		delistProduct() {
+			if (!this.delistList.length) {
+				this.showSelectRequiredToast()
+				return
+			}
 			this.$http.post("/app/product/shelves", this.delistList)
 				.then(res => {
 					if (res.data.code == 200) {
 						this.getProductList()
 						this.getStatus()
 						uni.showToast({
-							title: '下架成功',
+							title: res.data.message,
 							duration: 2000,
 							icon: 'none'
 						});
@@ -455,19 +474,26 @@ export default {
 			// } else {
 				this.sellProducts.push({
 					productId: item.productId,
-					productStatus: 1
+					productStatus: 1,
+					// productStatus: 2
+					productType:this.tabIndex
+					// productType = 自有或者标品(1: 标品, 0: 自有
 				})
 				this.isSell = true
 			// }
 		},
 		sellProduct() {
+			if (!this.sellProducts.length) {
+				this.showSelectRequiredToast()
+				return
+			}
 			this.$http.post("/app/product/shelves", this.sellProducts)
 				.then(res => {
 					if (res.data.code == 200) {
 						this.getProductList()
 						this.getStatus()
 						uni.showToast({
-							title: '上架成功',
+							title: res.data.message,
 							duration: 2000,
 							icon: 'none'
 						});
@@ -1106,4 +1132,4 @@ export default {
 		background-size: contain;
 	}
 }
-</style>
+</style>

+ 17 - 13
pages/store/addHours.vue

@@ -249,19 +249,23 @@ export default {
             let interfaceData = data.id ? "/merchant/localMerchantTime/edit" : "/merchant/localMerchantTime/add"
             
             this.$http.post(interfaceData, data).then(res => {
-                if (res.data.success) {
-                    this.$tip.success(res.data.result || '成功')
-                    uni.navigateBack({
-                        delta: 1, // 返回的页面数,默认为1
-                        success: () => {
-                            const pages = getCurrentPages();
-                            pages[pages.length-1].$vm.$forceUpdate();
-                        }
-                    })
-                }
-                else {
-                    this.$tip.error(res.data.message);
-                }
+				if (res.data.code == 200) {
+					uni.showToast({
+						icon:'none',
+						title:res.data.message || '成功'
+					})
+					setTimeout(()=>{
+						uni.navigateBack({
+							delta: 1 // 返回的页面数,默认为1
+						})
+					},1000)
+				} else {
+					uni.showToast({
+						icon:'none',
+						title:res.data.message
+					})
+					
+				}
             })
         },
 

+ 125 - 46
pages/store/advertising.vue

@@ -19,9 +19,11 @@
 						<view class="business-img ">
 							<view class="uni-uploader__file" v-if="video">
 								<view class="uploader_video">
-									<uni-icons class="icon iconfont icon-cuo" type="trash-filled" size="20"
-										@tap="delectVideo"></uni-icons>
 									<video :src="video" class="video-container"></video>
+									<cover-view class="delete-video-icon" @tap="delectVideo">
+												<!-- <uni-icons class="icon iconfont icon-cuo" type="trash-filled" size="20"  color="#ffffff"></uni-icons> -->
+										<cover-image class="delete-icon-img" src="/static/ad/close.png"></cover-image>
+									</cover-view>
 								</view>
 							</view>
 							<image v-else src="/static/store/upload2.png" mode="" @tap="chooseVideo()"></image>
@@ -54,7 +56,7 @@
 						</view>
 						
 					</view> -->
-					<shmily-drag-image v-model="form.photo" :addImage="ChooseImage" :delImage="delImage"></shmily-drag-image>
+					<shmily-drag-image v-model="form.photo" :number="20" :addImage="ChooseImage" :delImage="delImage"></shmily-drag-image>
 					<view class="business-prompt">
 						最多上传20张,每张大小不超过5M,建议宽高比9:16
 					</view>
@@ -62,7 +64,7 @@
 			</view>
 		</view>
 		<view class="padding flex sub-bottom" style="justify-content: space-around;">
-			<button class="cu-btn round line-gray shadow" @click="$Router.push({ name: 'settings' })"
+			<button class="cu-btn round line-gray shadow" @click="back()"
 				style="width: 205rpx;">取消</button>
 			<button style="width:443rpx;background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);border-radius:53rpx ;"
 				class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
@@ -121,6 +123,9 @@
 			}
 		},
 		methods: {
+			back() {
+				uni.navigateBack()
+			},
 			 addImage() {
 			      // 将图片地址添加到图片数组
 			      this.list.push('http://web.shmily.ren/shmily-drag-image/static/4.jpg')
@@ -173,34 +178,44 @@
 				})
 			},
 			ChooseImage() {
+				const remain = 20 - this.form.photo.length
+				if (remain <= 0) {
+					uni.showToast({ title: '最多20张图', icon: 'none' })
+					return
+				}
 				uni.chooseImage({
-					// count: 4, //默认9
+					count: remain,
 					sizeType: ['compressed'],
 					sourceType: ['album'], //从相册选择
 					success: (res) => {
 						if (res) {
+							console.log('上传图片', res)
 							// this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
-							uni.uploadFile({
-								url: configService.apiUrl + '/sys/common/upload',
-								filePath: res.tempFilePaths[0],
-								name: "file",
-								formData: {
-									'biz': 'temp',
-								},
-								success: (files) => {
-									let data = JSON.parse(files.data);
-									if (data.success) {
-										if (this.form.photo.length != 0) {
-											// this.photoList = this.photoList.concat(res.tempFilePaths)
-											this.form.photo.push(configService.apiUrl + '/' + data.message)
-
-										} else {
-											// this.photoList =res.tempFilePaths
-											this.form.photo = [configService.apiUrl + '/' + data.message]
+							if(res.tempFilePaths && res.tempFilePaths.length > 0) {
+								res.tempFilePaths.forEach(item => {
+									uni.uploadFile({
+										url: configService.apiUrl + '/sys/common/upload',
+										filePath: item,
+										name: "file",
+										formData: {
+											'biz': 'temp',
+										},
+										success: (files) => {
+											let data = JSON.parse(files.data);
+											if (data.success) {
+												if (this.form.photo.length != 0) {
+													// this.photoList = this.photoList.concat(res.tempFilePaths)
+													this.form.photo.push(configService.apiUrl + '/' + data.message)
+									
+												} else {
+													// this.photoList =res.tempFilePaths
+													this.form.photo = [configService.apiUrl + '/' + data.message]
+												}
+											}
 										}
-									}
-								}
-							})
+									})
+								})
+							}
 						}
 
 					}
@@ -212,16 +227,50 @@
 					current: e.currentTarget.dataset.url
 				});
 			},
-			chooseVideo() {
-				// 上传视频
-				console.log('上传视频')
-				uni.chooseVideo({
-					sourceType: ['camera', 'album'],
-					success: (res) => {
-						this.video = res.tempFilePath;
-					}
-				})
-			},
+      chooseVideo() {
+      	// 上传视频
+      	console.log('上传视频')
+      	uni.chooseVideo({
+      		sourceType: ['camera', 'album'],
+      		success: (res) => {
+      			uni.showLoading({
+      				title: '上传中...'
+      			})
+      			uni.uploadFile({
+      				url: configService.apiUrl + '/sys/common/upload',
+      				filePath: res.tempFilePath,
+      				name: "file",
+      				formData: {
+      					'biz': 'temp',
+      				},
+      				success: (files) => {
+      					uni.hideLoading()
+      					let data = JSON.parse(files.data);
+      					if (data.success) {
+      						this.video = configService.apiUrl + '/' + data.message
+      						uni.showToast({
+      							title: '上传成功',
+      							icon: 'success'
+      						})
+      					} else {
+      						uni.showToast({
+      							title: data.message || '上传失败',
+      							icon: 'none'
+      						})
+      					}
+      				},
+      				fail: (err) => {
+      					uni.hideLoading()
+      					uni.showToast({
+      						title: '上传失败',
+      						icon: 'none'
+      					})
+      					console.error('视频上传失败', err)
+      				}
+      			})
+      		}
+      	})
+      },
 			sumbit() {
 				let data = {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
@@ -231,20 +280,22 @@
 				console.log(this.form.photo)
 				if (this.form.videoStatus == null) {
 					this.$http.post('/merchant/LocalMerchantOperate/add', data).then(res => {
-						if (res.data.success) {
+						if (res.data.code == 200) {
 							uni.showToast({
 								icon:'none',
-								title:res.data.result || '成功'
-							})
-							
-							uni.navigateBack({
-								delta: 1 // 返回的页面数,默认为1
+								title:res.data.message || '成功'
 							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta: 1 // 返回的页面数,默认为1
+								})
+							},1000)
 						} else {
 							uni.showToast({
 								icon:'none',
 								title:res.data.message
 							})
+							
 						}
 					})
 				} else {
@@ -252,19 +303,22 @@
 						...data,
 						id: this.form.videoId
 					}).then(res => {
-						if (res.data.success) {
+						if (res.data.code == 200) {
 							uni.showToast({
 								icon:'none',
-								title:res.data.result || '成功'
-							})
-							uni.navigateBack({
-								delta: 1 // 返回的页面数,默认为1
+								title:res.data.message || '成功'
 							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta: 1 // 返回的页面数,默认为1
+								})
+							},1000)
 						} else {
 							uni.showToast({
 								icon:'none',
 								title:res.data.message
 							})
+							
 						}
 					})
 				}
@@ -377,6 +431,7 @@
 		padding-bottom: 7px;
 
 		.uploader_video {
+			position: relative;
 			width: 310upx;
 			height: 210upx;
 		}
@@ -409,6 +464,7 @@
 		bottom: 0;
 		background: #FFFFFF;
 		border-top: 1px solid #EEEEEE;
+		z-index: 99;
 	}
 
 	.uni-uploader__img {
@@ -435,6 +491,29 @@
 		border-bottom-left-radius: 20upx;
 	}
 
+	.icon-delete-red {
+		color: red;
+	}
+
+	.delete-video-icon {
+		position: absolute;
+		right: 0upx;
+		top: 0upx;
+		width: 40upx;
+		height: 40upx;
+		background-color: rgba(0, 0, 0, 0.4);
+		border-radius: 0 0 0 10rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		z-index:9999;
+	}
+
+	.delete-icon-img {
+		width: 24upx;
+		height: 24upx;
+	}
+
 	.business-hours {
 		padding: 27upx 22upx;
 		background: #F7F8FC;

+ 36 - 29
pages/store/brandMessage.vue

@@ -31,7 +31,7 @@
             </form>
         </view>
         <view class="padding flex sub-bottom">
-            <button class="cu-btn round line-gray  shadow" @click="$Router.push({ name: 'settings' })">取消</button>
+            <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>
     </view>
@@ -58,6 +58,9 @@ export default {
         }
     },
     methods: {
+		back() {
+			uni.navigateBack()
+		},
         async businessChange() {
             let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
                 count: 1,
@@ -99,39 +102,43 @@ export default {
             if(this.form.logoStatus==null){
                 // this.$http.post('/merchant/localMerchantBrand/add',data).then(res => {
 									this.$http.post('/merchant/localMerchantBrand/addNew',data).then(res => {
-                    if (res.data.success) {
-												uni.showToast({
-													icon:'none',
-													title:'成功'
-												})
-                        uni.navigateBack({
-                            delta: 1 // 返回的页面数,默认为1
-                        })
-                    }
-                    else {
-												uni.showToast({
-													icon:'none',
-													title:res.data.message
-												})
+                    if (res.data.code == 200) {
+                    	uni.showToast({
+                    		icon:'none',
+                    		title:res.data.message || '成功'
+                    	})
+                    	setTimeout(()=>{
+                    		uni.navigateBack({
+                    			delta: 1 // 返回的页面数,默认为1
+                    		})
+                    	},1000)
+                    } else {
+                    	uni.showToast({
+                    		icon:'none',
+                    		title:res.data.message
+                    	})
+                    	
                     }
                 })
             }
             else{
                 this.$http.post('/merchant/localMerchantBrand/edit',{...data,id:this.form.logoId}).then(res => {
-                    if (res.data.success) {
-												uni.showToast({
-													icon:'none',
-													title:res.data.result || '成功'
-												})
-                        uni.navigateBack({
-                            delta: 1 // 返回的页面数,默认为1
-                        })
-                    }
-                    else {
-											uni.showToast({
-												icon:'none',
-												title:res.data.message
-											})
+                    if (res.data.code == 200) {
+                    	uni.showToast({
+                    		icon:'none',
+                    		title:res.data.message || '成功'
+                    	})
+                    	setTimeout(()=>{
+                    		uni.navigateBack({
+                    			delta: 1 // 返回的页面数,默认为1
+                    		})
+                    	},1000)
+                    } else {
+                    	uni.showToast({
+                    		icon:'none',
+                    		title:res.data.message
+                    	})
+                    	
                     }
                 })
             }

+ 9 - 7
pages/store/businessInfor.vue

@@ -77,8 +77,8 @@
 			</view>
 		</view>
 		<view class="padding flex sub-bottom">
-			<button class="cu-btn round line-gray  shadow" @click="$Router.push({ name: 'settings' })">取消</button>
-			<button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click.native="sumbit">提交</button>
+			<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" @confirm="selectTime" style="z-index: 999 !important;"></u-picker>
 	</view>
@@ -179,7 +179,7 @@
 		},
 		methods: {
 			back() {
-				uni.navigateTo({ url: '/pages/store/settings' });
+				uni.navigateBack();
 			},
 			selectAddress() {
 				uni.navigateTo({ url: '/pages/store/selectTdMap?url=' + '/pages/store/businessInfor' });
@@ -261,9 +261,11 @@
 				this.$http
 					.post("/merchant/localMerchantInfo/shopEdit", { ...data })
 					.then((res) => {
-						if (res.data.success) {
-							uni.showToast({ title: '提交成功', icon: 'none' });
-							uni.navigateTo({ url: '/pages/store/settings' });
+						if (res.data.code == 200) {
+							uni.showToast({ title: res.data.message || '提交成功', icon: 'none' });
+							setTimeout(() => {
+								uni.navigateBack();
+							}, 500);
 						} else {
 							uni.showToast({ title: res.data.message, icon: 'none' });
 						}
@@ -274,7 +276,7 @@
 					.delete("/merchant/localMerchantTime/delete?id=" + val.id)
 					.then((res) => {
 						if (res.data.success) {
-							uni.showToast({ title: '提交成功', icon: 'none' });
+							uni.showToast({ title: '删除成功', icon: 'none' });
 							this.$http
 								.get("/merchant/localMerchantTime/list?merchantId=" + uni.getStorageSync(USER_INFO).merchantId)
 								.then((res) => {

+ 130 - 47
pages/store/businessQua.vue

@@ -79,7 +79,7 @@
 
 
 		<view class="padding flex " v-if="this.form.specialStatus !== 0">
-			<button class="cu-btn round line-gray  shadow" @click="$Router.push({ name: 'settings' })">取消</button>
+			<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>
 		<ba-tree-picker ref="treePicker" :multiple='true' @select-change="selectChange" title="选择分类" :localdata="treeData"
@@ -104,6 +104,7 @@
 				treeLeft: [], //一级列表
 				showText: '',
 				classifyList: [],
+				categoryId: '',
 				qualificationNameMap: []
 			}
 		},
@@ -115,25 +116,84 @@
 			if (data.params) {
 				let obj = JSON.parse(decodeURIComponent(data.params));
 				this.form = obj
-				this.qualificationNameMap = this.form.qualificationNameListDTOS;
-				this.qualificationNameMap.forEach((item) => {
-					this.showText += item.categoryName + ' / '
-					item.qualificationNameCategoryDTOS?.forEach((row) => {
-						// row.special = '';
-						row.imgList = [];
-						row.imgList.push({
-							url: row.special,
-						});
+				console.log('onLoad',obj)
+				const list = this.form.qualificationNameListDTOS || []
+				if (list.length) {
+					this.classifyList = list.map((item) => item.categoryId).filter(Boolean)
+					this.categoryId = this.classifyList.join(',')
+					list.forEach((item) => {
+						this.showText += item.categoryName + ' / '
 					});
-				});
-				// this.specialImg = obj.special
+					this.qualificationNameMap = this.normalizeQualificationNameMap(
+						this.classifyList,
+						this.showText,
+						list
+					)
+				} else if (this.form.categoryId) {
+					this.categoryId = this.form.categoryId
+					this.classifyList = this.form.categoryId.split(',').filter(Boolean)
+					if (this.form.categoryName) {
+						this.showText = this.form.categoryName
+					}
+					this.selectClassify()
+				}
 			}
 		},
 		methods: {
+			back() {
+				uni.navigateBack()
+			},
+			parseCategoryNames(categoryNames) {
+				if (!categoryNames) return []
+				return String(categoryNames).split(' / ').map((name) => name.trim()).filter(Boolean)
+			},
+			normalizeQualificationNameMap(classifyList, categoryNames, apiResult = []) {
+				const nameList = this.parseCategoryNames(categoryNames)
+				const apiMap = {}
+				;(apiResult || []).forEach((item) => {
+					const id = item?.categoryId
+					if (id !== undefined && id !== null && id !== '') {
+						apiMap[String(id)] = item
+					}
+				})
+
+				return (classifyList || []).filter(Boolean).map((categoryId, index) => {
+					const id = String(categoryId)
+					const categoryName = nameList[index] || apiMap[id]?.categoryName || ''
+					const apiItem = apiMap[id]
+					let qualificationNameCategoryDTOS = (apiItem?.qualificationNameCategoryDTOS || []).filter(Boolean)
+
+					if (!qualificationNameCategoryDTOS.length) {
+						const special = apiItem?.special || ''
+						qualificationNameCategoryDTOS = [{
+							categoryId: id,
+							categoryName,
+							qualificationName: categoryName,
+							special,
+							imgList: special ? [{ url: special }] : []
+						}]
+					} else {
+						qualificationNameCategoryDTOS = qualificationNameCategoryDTOS.map((row) => ({
+							...row,
+							categoryId: row.categoryId || id,
+							categoryName: row.categoryName || categoryName,
+							special: row.special || '',
+							imgList: row.imgList || (row.special ? [{ url: row.special }] : [])
+						}))
+					}
+
+					return {
+						categoryId: id,
+						categoryName,
+						special: apiItem?.special || '',
+						qualificationNameCategoryDTOS
+					}
+				})
+			},
 			getTree() {
 				this.$http.get('/sys/category/loadTreeRoot?pcode=' + 'c09' + '&async=' + false).then(res => {
-					this.treeData = res.data.result
-					console.log(this.treeData)
+					// 只展示一级分类,去掉子级
+					this.treeData = (res.data.result || []).map(({ children, ...item }) => item)
 				})
 			},
 			showPicker() {
@@ -149,8 +209,8 @@
 			},
 			//监听选择(ids为数组)
 			selectChange(ids, names) {
-				console.log(ids, names)
 				this.classifyList = ids
+				this.categoryId = ids.join(',')
 				this.showText = names
 				this.selectClassify()
 			},
@@ -160,13 +220,12 @@
 				let categoryNames = this.showText
 				this.$http.get('/localQualificationClassifica/localQualificationClassifica/getByCategoryId?categoryIds=' +
 					categoryIds + '&merchantId=' + merchantId + '&categoryNames=' + categoryNames).then(res => {
-					this.qualificationNameMap = res.data.result
-					this.qualificationNameMap.forEach((item) => {
-						item.qualificationNameCategoryDTOS?.forEach((row) => {
-							row.special = row.special ? row.special : '';
-							row.imgList = [];
-						});
-					});
+					const apiResult = res.data.result || []
+					this.qualificationNameMap = this.normalizeQualificationNameMap(
+						this.classifyList,
+						this.showText,
+						apiResult
+					)
 				})
 			},
 
@@ -205,9 +264,9 @@
 							success: (files) => {
 								let data = JSON.parse(files.data);
 								if (data.success) {
-									// this.specialImg = configService.apiUrl + '/' + data.message
-									row.special = configService.apiUrl + '/' + data.message
-
+									const imageUrl = configService.apiUrl + '/' + data.message
+									this.$set(row, 'special', imageUrl)
+									this.$set(row, 'imgList', [{ url: imageUrl }])
 								}
 							}
 						});
@@ -218,44 +277,65 @@
 				let hasEmptyImage = false;
 				this.qualificationNameMap.forEach((item) => {
 					item.qualificationNameCategoryDTOS?.forEach((row) => {
-						console.log(row);
-						// if (row.imgList[0]?.response) {
-						//   row.special = import.meta.env.VITE_GLOB_DOMAIN_URL + '/' + row.imgList[0].response.message;
-						// }
-
-						// 检查图片是否为空
 						if (!row.special) {
 							hasEmptyImage = true;
 						}
 					});
 				});
+				const categoryId = this.categoryId ||
+					this.classifyList.filter(Boolean).join(',') ||
+					this.qualificationNameMap.map((item) => item.categoryId).filter(Boolean).join(',')
+				if (!categoryId) {
+					uni.showToast({
+						icon: 'none',
+						title: '请选择分类'
+					})
+					return
+				}
+				const categoryIds = categoryId.split(',').filter(Boolean)
+				const categoryNames = this.parseCategoryNames(this.showText)
+				const qualificationNameListDTOS = this.qualificationNameMap.map((item, index) => {
+					const qualificationNameCategoryDTOS = (item.qualificationNameCategoryDTOS || []).map((row) => ({
+						categoryId: row.categoryId,
+						categoryName: row.categoryName,
+						qualificationName: row.qualificationName,
+						special: row.special || row.imgList?.[0]?.url || ''
+					}))
+					const specialImages = qualificationNameCategoryDTOS
+						.map((row) => row.special)
+						.filter(Boolean)
+					return {
+						categoryId: item.categoryId || categoryIds[index] || categoryId,
+						categoryName: item.categoryName || categoryNames[index] || '',
+						special: item.special || specialImages.join(',') || null,
+						// qualificationNameCategoryDTOS
+					}
+				})
 				let data = {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
 					merchantUserId: this.form.merchantUserId,
 					merchantUserName: this.form.merchantUserName,
-					// special: this.specialImage[0].url,
-					qualificationNameListDTOS: this.qualificationNameMap,
+					categoryId,
+					qualificationNameListDTOS,
 					source: 1,
 				};
-				console.log(data);
-
+				
+				
 				if (hasEmptyImage) {
-					// message.error('请上传全部图片');
 					uni.showToast({
 						icon: 'none',
-						message: '请上传全部图片'
+						title: '请上传全部图片'
 					})
 				} else {
 					if (this.form.specialStatus == null) {
 						this.$http.post('/merchant/localMerchantSpecial/add', data).then(res => {
-							if (res.data.success) {
+							if (res.data.code == 200) {
 								uni.showToast({
 									icon:'none',
-									title:res.data.result || '成功'
-								})
-								uni.navigateBack({
-									delta: 1 // 返回的页面数,默认为1
+									title:res.data.message || '成功'
 								})
+								
+								
 							} else {
 								uni.showToast({
 									icon:'none',
@@ -269,19 +349,22 @@
 							...data,
 							id: this.form.specialId
 						}).then(res => {
-							if (res.data.success) {
+							if (res.data.code == 200) {
 								uni.showToast({
 									icon:'none',
-									title:res.data.result || '成功'
-								})
-								uni.navigateBack({
-									delta: 1 // 返回的页面数,默认为1
+									title:res.data.message || '成功'
 								})
+								setTimeout(()=>{
+									uni.navigateBack({
+										delta: 1 // 返回的页面数,默认为1
+									})
+								},1000)
 							} else {
 								uni.showToast({
 									icon:'none',
 									title:res.data.message
 								})
+								
 							}
 						})
 					}

+ 13 - 8
pages/store/editStore.vue

@@ -238,17 +238,22 @@
 					...this.form,
 					headPhoto: this.form.headPhoto.join(',')
 				}).then(res => {
-					if (res.data.success) {
-						// this.$tip.success(res.data.result || '成功')
+					if (res.data.code == 200) {
 						uni.showToast({
-							title: '提交成功',
-							icon: 'none'
-						});
-						uni.navigateTo({
-							url: '/pages/index/shop'
+							icon:'none',
+							title:res.data.message || '成功'
 						})
+						setTimeout(()=>{
+							uni.navigateBack({
+								delta: 1 // 返回的页面数,默认为1
+							})
+						},1000)
 					} else {
-						this.$tip.error(res.data.message);
+						uni.showToast({
+							icon:'none',
+							title:res.data.message
+						})
+						
 					}
 				})
 			},

+ 35 - 36
pages/store/headPhoto.vue

@@ -16,18 +16,15 @@
 					</view>
 					<view class="grid col-4 grid-square flex-sub booder-top">
 						<view class="bg-img" v-for="(item, index) in form.photo" :key="index" @tap="ViewImage"
-							:data-url="form.headPhoto[index]">
+							:data-url="item">
 							<image :src="item" mode="aspectFill"></image>
 							<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
 								<text class='cuIcon-close'></text>
 							</view>
 						</view>
-						<view class="grid col-4 grid-square flex-sub booder-top" >
-							<view class="solids" @tap="ChooseImage" >
-								<text class='cuIcon-cameraadd'></text>
-							</view>
+						<view class="solids" @tap="ChooseImage" >
+							<text class='cuIcon-cameraadd'></text>
 						</view>
-						
 					</view>
 					
 					
@@ -38,7 +35,7 @@
 			</view>
 		</view>
 		<view class="padding flex sub-bottom" style="justify-content: space-around;">
-			<button class="cu-btn round line-gray shadow" @click="$Router.push({ name: 'settings' })"
+			<button class="cu-btn round line-gray shadow" @click="back()"
 				style="width: 205rpx;">取消</button>
 			<button style="width:443rpx;background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);border-radius:53rpx ;"
 				class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
@@ -77,8 +74,9 @@
 		async onLoad(data) {
 			if (data.params) {
 				let obj = JSON.parse(decodeURIComponent(data.params));
+				console.log('111111',obj)
 				// this.video = obj.video ? obj.video : ''
-				obj.photo = obj.photo ? obj.headPhoto.split(',').filter(id => id !== '') : []
+				obj.photo = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
 				this.form = obj
 				
 			}
@@ -97,6 +95,12 @@
 			}
 		},
 		methods: {
+			syncHeadPhoto() {
+				this.form.headPhoto = (this.form.photo || []).join(',')
+			},
+			back() {
+				uni.navigateBack()
+			},
 			hoursChange(index) {
 				const queryString = encodeURIComponent(JSON.stringify({
 					index,
@@ -108,7 +112,6 @@
 
 			},
 			DelImg(e) {
-				
 				uni.showModal({
 					title: '提示',
 					content: '确定要删除?',
@@ -116,10 +119,8 @@
 					confirmText: '确定',
 					success: res => {
 						if (res.confirm) {
-							console.log(this.form)
-							// this.photoList.splice(e.currentTarget.dataset.index, 1)
 							this.form.photo.splice(e.currentTarget.dataset.index, 1)
-
+							this.syncHeadPhoto()
 						}
 					}
 				})
@@ -142,19 +143,11 @@
 								success: (files) => {
 									let data = JSON.parse(files.data);
 									if (data.success) {
-										let temp = this.form.headPhoto.split(',')
-										if (this.form.headPhoto.split(',').length > 0) {
-											// this.photoList = this.photoList.concat(res.tempFilePaths)
-											this.form.photo.push(configService.apiUrl + '/' + data.message)
-											this.form.headPhoto+(configService.apiUrl + '/' + data.message)
-											temp.push(configService.apiUrl + '/' + data.message)
-											 this.form.headPhoto = temp.join(',')
-											console.log(this.form.headPhoto)
-										} else {
-												console.log('22222')
-											// this.photoList =res.tempFilePaths
-											this.form.headPhoto = [configService.apiUrl + '/' + data.message]
+										if (!this.form.photo) {
+											this.form.photo = []
 										}
+										this.form.photo.push(configService.apiUrl + '/' + data.message)
+										this.syncHeadPhoto()
 									}
 								}
 							})
@@ -165,48 +158,54 @@
 			},
 			ViewImage(e) {
 				uni.previewImage({
-					urls: this.form.headPhoto,
+					urls: this.form.photo,
 					current: e.currentTarget.dataset.url
 				});
 			},
 			sumbit() {
 				let data = {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
-					headPhoto: this.form.headPhoto,
+					headPhoto: (this.form.photo || []).join(','),
 					id:this.form.headPhotoId
 				}
 				if (this.form.headPhotoStatus == null) {
 					this.$http.post('merchant/localMerchantHeadPhoto/add', data).then(res => {
-						if (res.data.success) {
+						if (res.data.code == 200) {
 							uni.showToast({
 								icon:'none',
-								title:'提交成功'
-							})
-							uni.navigateBack({
-								delta: 1 // 返回的页面数,默认为1
+								title:res.data.message || '成功'
 							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta: 1 // 返回的页面数,默认为1
+								})
+							},1000)
 						} else {
 							uni.showToast({
 								icon:'none',
 								title:res.data.message
 							})
+							
 						}
 					})
 				} else {
 					this.$http.post('merchant/localMerchantHeadPhoto/edit',data).then(res => {
-						if (res.data.success) {
+						if (res.data.code == 200) {
 							uni.showToast({
 								icon:'none',
-								title:'提交成功'
-							})
-							uni.navigateBack({
-								delta: 1 // 返回的页面数,默认为1
+								title:res.data.message || '成功'
 							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta: 1 // 返回的页面数,默认为1
+								})
+							},1000)
 						} else {
 							uni.showToast({
 								icon:'none',
 								title:res.data.message
 							})
+							
 						}
 					})
 				}

+ 1 - 1
pages/store/selectTdMap.vue

@@ -321,7 +321,7 @@
 				uni.request({
 					url: `https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(JSON.stringify(postStr))}&type=query&tk=${this.tk}`,
 					success: (res) => {
-						if (res.statusCode === 200 && res.data) {
+						if (res.data.code == 200 && res.data) {
 							this.searchResults = res.data.pois.map(item => ({
 								...item,
 								location: item.lonlat

+ 7 - 7
pages/store/settings.vue

@@ -43,9 +43,7 @@
 						{{ tag }}
 					</text>
 				</view>
-				<view v-if="val.label == '其他'" style="padding-left: 42upx;" @click="jumpOther">
-					
-				</view>
+				<!-- <view v-if="val.label == '其他'" style="padding-left: 42upx;" @click="jumpOther"></view> -->
 			</view>
 			
 		</view>
@@ -123,10 +121,12 @@
 						}, {
 							label: '服务设施',
 							status: ' '
-						},  {
-							label: '其他',
-							status: ' '
-						},],
+						},  
+						// {
+						// 	label: '其他',
+						// 	status: ' '
+						// },
+						],
 					}
 
 				],

BIN
static/ad/close.png


BIN
static/login/tuichu.png