baijunde hai 1 ano
pai
achega
57a4724d00

+ 187 - 0
components/product/refund.vue

@@ -0,0 +1,187 @@
+<template>
+  <view class="popup" @tap="closePopup">
+    <view class="model" @tap.stop>
+      <view class="title">
+        <text>退款规则</text>
+				<image src="/static/index/cut.png" mode="" @tap="closePopup"></image>
+      </view>
+      <view class="popup-body">
+				<view class="tag">
+					<view class="tips">
+						退款标签
+					</view>
+					<view class="item" v-for="(item,index) in tagList" :key="index" @click="selectTag(item,index)">
+						{{item.name}}
+						<image src="/static/product/select.png" mode="" v-if="tagCurrent == index"></image>
+						<image src="/static/product/round.png" mode="" v-else></image>
+					</view>
+				</view>
+				<view class="tag">
+					<view class="tips">
+						退款是否商家确认
+					</view>
+					<view class="item" v-for="(item,index) in verifyList" :key="index" @click="selectverify(item,index)">
+						{{item.name}}
+						<image src="/static/product/select.png" mode="" v-if="verifyCurrent == index"></image>
+						<image src="/static/product/round.png" mode="" v-else></image>
+					</view>
+				</view>
+      </view>
+      <view class="foot">
+        <view class="cancel" @tap="closePopup">取消</view>
+        <view class="sub" @tap="confirm">确定</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      tagList:[
+				{
+					name:'随时退',
+					refundLabel:1
+				},
+				{
+					name:'过期自动退',
+					refundLabel:2
+				}
+			],
+			tagCurrent:null,
+			verifyList:[
+				{
+					name:'需要确认',
+					refundConfirm:1
+				},
+				{
+					name:'无需确认',
+					refundConfirm:0
+				}
+			],
+			verifyCurrent:null,
+			refundLabel:[],
+			refundConfirm:[],
+			
+    };
+  },
+  methods: {
+    closePopup() {
+      this.$emit('close');
+    },
+    confirm() {
+			if(this.refundLabel.length ==0 || this.refundConfirm.length ==0 ){
+				console.log('5555')
+				uni.showToast({
+					title: '请选择退款规则',
+					icon:'none'
+				});
+			}else{
+				this.$emit('confirm', {
+				  refundLabel: this.refundLabel,
+				  refundConfirm: this.refundConfirm
+				});
+				this.closePopup();
+			}
+     
+    },
+		selectTag(item,index){
+			this.tagCurrent = index
+			this.refundLabel = item
+		},
+		selectverify(item,index){
+			this.verifyCurrent = index
+			this.refundConfirm = item
+		}
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.popup {
+  width: 100vw;
+  height: 100vh;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.4);
+  display: flex;
+  align-items: end;
+  z-index: 99;
+	.model{
+		width: 100%;
+		background-color: #fff;
+		border-radius: 20rpx 20rpx 0rpx 0rpx;
+		padding: 0rpx 24rpx;
+		padding-bottom: 20rpx;
+		.title {
+			width: 100%;
+			height: 86rpx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			position: relative;
+			border-bottom: 1px solid #eeeeee;
+			margin-bottom: 24rpx;
+		
+			image {
+				width: 40rpx;
+				height: 40rpx;
+				position: absolute;
+				right: 0px;
+			}
+		}
+		.popup-body{
+			.tag{
+				margin-bottom: 24rpx;
+				.tips{
+					font-size: 28rpx;
+				}
+				.item{
+					width: 100%;
+					height: 70rpx;
+					font-size: 26rpx;
+					border-bottom: 1px solid #EEEEEE;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					image{
+						width: 28rpx;
+						height: 28rpx;
+					}
+				}
+			}
+		}
+		.foot{
+			display: flex;
+			justify-content: space-between;
+			border-top: 1px solid #eeeeee;
+			padding-top: 16rpx;
+			.cancel{
+				width: 324rpx;
+				height: 76rpx;
+				border-radius: 54rpx;
+				border: 1px solid #CCCCCC;
+				font-size: 28rpx;
+				color: #999999;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+			.sub{
+				width: 324rpx;
+				height: 76rpx;
+				background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);
+				border-radius: 54rpx;
+				border: 1px solid #CCCCCC;
+				font-size: 28rpx;
+				color: #ffffff;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+		}
+	}
+}
+</style>

+ 0 - 146
components/product/select_date.vue

@@ -1,146 +0,0 @@
-<template>
-  <view class="popup" @tap="closePopup">
-    <view class="model" @tap.stop>
-      <view class="title">
-        <text>选择时间段</text>
-				<image src="/static/index/cut.png" mode="" @click="isAddGroup = false"></image>
-      </view>
-      <view class="popup-body">
-        <view class="time-picker">
-          <text>开始时间</text>
-         <!-- <picker mode="date" :value="startTime" @change="onStartTimeChange">
-            <view class="picker">{{ startTime }}</view>
-          </picker> -->
-        </view>
-        <view class="time-picker">
-          <text>结束时间</text>
-          <!-- <picker mode="date" :value="endTime" @change="onEndTimeChange">
-            <view class="picker">{{ endTime }}</view>
-          </picker> -->
-        </view>
-      </view>
-      <view class="foot">
-        <view @tap="closePopup">取消</view>
-        <view @tap="confirm">确定</view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      startTime: '开始时间',
-      endTime: '结束时间'
-    };
-  },
-  methods: {
-    closePopup() {
-      this.$emit('close');
-    },
-    confirm() {
-      this.$emit('confirm', {
-        startTime: this.startTime,
-        endTime: this.endTime
-      });
-      this.closePopup();
-    },
-    onStartTimeChange(e) {
-      this.startTime = e.detail.value;
-    },
-    onEndTimeChange(e) {
-      this.endTime = e.detail.value;
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.popup {
-  width: 100vw;
-  height: 100vh;
-  position: fixed;
-  top: 0;
-  left: 0;
-  background: rgba(0, 0, 0, 0.4);
-  display: flex;
-  align-items: end;
-  z-index: 99;
-	.model{
-		width: 100%;
-		background-color: #fff;
-		border-radius: 20rpx 20rpx 0rpx 0rpx;
-		padding: 0rpx 24rpx;
-		padding-bottom: 20rpx;
-		.title {
-			width: 100%;
-			height: 86rpx;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			position: relative;
-			border-bottom: 1px solid #eeeeee;
-			margin-bottom: 24rpx;
-		
-			image {
-				width: 40rpx;
-				height: 40rpx;
-				position: absolute;
-				right: 0px;
-			}
-		}
-		.foot{
-			
-		}
-	}
-}
-
-.popup-content {
-  background-color: #fff;
-  width: 80%;
-  border-radius: 10px;
-  overflow: hidden;
-}
-
-.popup-header {
-  padding: 20px;
-  border-bottom: 1px solid #eee;
-  text-align: center;
-  font-size: 18px;
-  font-weight: bold;
-}
-
-.popup-body {
-  padding: 20px;
-}
-
-.time-picker {
-  margin-bottom: 20px;
-}
-
-.time-picker text {
-  display: block;
-  margin-bottom: 10px;
-  font-size: 16px;
-}
-
-.picker {
-  padding: 10px;
-  border: 1px solid #eee;
-  border-radius: 5px;
-  text-align: center;
-}
-
-.popup-footer {
-  display: flex;
-  justify-content: space-between;
-  padding: 10px;
-  border-top: 1px solid #eee;
-}
-
-.popup-footer button {
-  flex: 1;
-  margin: 0 5px;
-}
-</style>

+ 0 - 139
components/refund.vue

@@ -1,139 +0,0 @@
-<template>
-	<view class="popup-mask" @click.stop="closeRefund">
-		<view class="popup-content" @tap.stop>
-			<view class="popup-header">
-				<text>退款规则</text>
-			</view>
-			<view class="popup-body">
-				<view class="refund-rule">
-					<text class="label">退款标签</text>
-					<view class="">
-						随时退
-					</view>
-					<view class="">
-						过期自动退
-					</view>
-					<!-- <radio-group @change="onRefundLabelChange">
-            <label class="radio-item">
-              <radio value="随时退" :checked="refundLabel === '随时退'" /> 随时退
-            </label>
-            <label class="radio-item">
-              <radio value="过期自动退" :checked="refundLabel === '过期自动退'" /> 过期自动退
-            </label>
-          </radio-group> -->
-				</view>
-
-				<view class="refund-confirm">
-					<text class="label">退款是否商家确认</text>
-					<view class="">
-						需要确认
-					</view>
-					<view class="">
-						无需确认
-					</view>
-					<!-- <radio-group @change="onRefundConfirmChange">
-            <label class="radio-item">
-              <radio value="需要确认" :checked="refundConfirm === '需要确认'" /> 需要确认
-            </label>
-            <label class="radio-item">
-              <radio value="无需确认" :checked="refundConfirm === '无需确认'" /> 无需确认
-            </label>
-          </radio-group> -->
-				</view>
-			</view>
-			<view class="popup-footer">
-				<!-- <button @tap="closePopup">取消</button> -->
-				<button @tap.stop="save">确定</button>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		name: 'refund',
-		data() {
-			return {
-				refundLabel: '随时退', // 默认选择的退款标签
-				refundConfirm: '需要确认' // 默认选择的退款确认方式
-			};
-		},
-		methods: {
-			closeRefund() {
-				this.$emit('closeRule');
-			},
-			save() {
-				console.log('444')
-				// 触发 confirm 事件,并传递选择的退款规则
-				this.$emit('saveRule', {
-					refundLabel: this.refundLabel,
-					refundConfirm: this.refundConfirm
-				});
-			},
-		}
-	};
-</script>
-
-<style>
-	.popup-mask {
-		position: fixed;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		background-color: rgba(0, 0, 0, 0.5);
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		z-index: 99;
-	}
-
-	.popup-content {
-		background-color: #fff;
-		width: 80%;
-		border-radius: 10px;
-		overflow: hidden;
-	}
-
-	.popup-header {
-		padding: 20px;
-		border-bottom: 1px solid #eee;
-		text-align: center;
-		font-size: 18px;
-		font-weight: bold;
-	}
-
-	.popup-body {
-		padding: 20px;
-	}
-
-	.refund-rule,
-	.refund-confirm {
-		margin-bottom: 20px;
-	}
-
-	.label {
-		display: block;
-		margin-bottom: 10px;
-		font-size: 16px;
-		font-weight: bold;
-	}
-
-	.radio-item {
-		display: flex;
-		align-items: center;
-		margin-bottom: 10px;
-	}
-
-	.popup-footer {
-		display: flex;
-		justify-content: space-between;
-		padding: 10px;
-		border-top: 1px solid #eee;
-	}
-
-	.popup-footer button {
-		flex: 1;
-		margin: 0 5px;
-	}
-</style>

+ 18 - 22
package.json

@@ -1,23 +1,19 @@
 {
-  "name": "locallivingservicesuniapp",
-  "version": "1.0.0",
-  "description": "JeecgBoot - APP移动解决方案,采用uniapp框架,一份代码多终端适配,同时支持APP、小程序、H5!实现了与[JeecgBoot低代码平台](https://github.com/jeecgboot/jeecg-boot)完美对接!目前已经实现登录、用户信息、通讯录、公告、移动首页、九宫格等基础功能,更多功能请自己扩展。",
-  "main": "main.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "keywords": [],
-  "author": "",
-  "license": "ISC",
-  "repository": {
-    "type": "git",
-    "url": "http://39.101.143.165:8090/hxl13994548489/LocalLivingServicesUniapp.git"
-  },
-  "devDependencies": {
-    "query-string": "^9.1.1"
-  },
-  "dependencies": {
-    "echarts": "^5.6.0",
-    "uview-ui": "^1.8.8"
-  }
-}
+    "id": "dengrq-datetime-picker",
+    "name": "日期时间选择器组件",
+    "displayName": "日期时间选择器组件",
+    "version": "1.0.6",
+    "description": "适用于 uni-app 的日期时间选择器组件,兼容 H5 和小程序。支持多种日期模式,包括年月日 / 年月日时分秒 / 年月 / 年份 / 时分秒 / 时分,支持配置默认选中日期与最小最大日期范围。",
+    "keywords": [
+        "日期选择器",
+        "时间选择器",
+        "日期时间选择器",
+        "日期范围选择"
+    ],
+    "dcloudext": {
+        "category": [
+            "前端组件",
+            "通用组件"
+        ]
+    }
+}

+ 144 - 97
pages/product/creatProduct.vue

@@ -15,7 +15,7 @@
 					<view class="label">
 						商品分类<span>*</span>
 					</view>
-					<view class="picker" @click="isSelectType = true">
+					<view class="picker" @click="selectProductType">
 						<span v-if="showText == ''">选择商品分类</span>
 						<span v-else style="color: #333333;">{{showText}}</span>
 						<u-icon name="arrow-right"></u-icon>
@@ -36,7 +36,7 @@
 					<view class="tips">
 						支持jpg、png格式,尺寸为00px*00px
 					</view>
-					<u-upload ref="uUpload" :action="action" :file-list="fileList" max-count="1" width="140rpx"
+					<u-upload ref="uUpload" :action="action" :file-list="fmImageList" max-count="1" width="140rpx"
 						height="140rpx"></u-upload>
 				</view>
 				<view class="item upload">
@@ -46,7 +46,8 @@
 					<view class="tips">
 						支持jpg、png格式,尺寸为00px*00px,最多20张
 					</view>
-					<u-upload :action="action" :file-list="fileList" max-count="20" width="140rpx" height="140rpx"></u-upload>
+					<u-upload ref="dUpload" :action="action" :file-list="xqImage" max-count="20" width="140rpx"
+						height="140rpx"></u-upload>
 				</view>
 				<view class="item">
 					<view class="label">
@@ -80,34 +81,6 @@
 					</view>
 				</view>
 			</view>
-			<!-- <u-form :model="form" ref="uForm" v-if="schedule ==1"
-				style="background-color: #fff;padding: 16rpx;border-radius: 16rpx;">
-				<view class="titl">
-					基础信息
-				</view>
-				<u-form-item style="display: flex;">
-					<label>
-						商品分类 <span style="color: red;">*</span>
-					</label>
-					<picker v-model="form.sex" :range="genderOptions" range-key="label" @change="onGenderChange">
-						<view class="">{{ form.sex || '请选择分类' }}</view>
-					</picker>
-				</u-form-item>
-				<u-form-item label="商品名称" label-width="200"><u-input v-model="form.intro" /></u-form-item>
-				<u-form-item label="商品封面图" label-width="200">
-					<u-upload :action="action" :file-list="fileList"></u-upload>
-				</u-form-item>
-				<u-form-item label="商品详情图" label-width="200">
-					<u-upload :action="action" :file-list="fileList"></u-upload>
-				</u-form-item>
-				<u-form-item label="原价" label-width="200"><u-input v-model="form.intro" /></u-form-item>
-				<u-form-item label="实际售价" label-width="200"><u-input v-model="form.intro" /></u-form-item>
-				<u-form-item label="组合套餐" label-width="200">
-					<view class="" @click="goGroup">
-						设置组合套餐
-					</view>
-				</u-form-item>
-			</u-form> -->
 			<view class="form" v-if="schedule == 2">
 				<view class="titl ">
 					售卖/使用信息
@@ -150,9 +123,14 @@
 					<view class="label">
 						退款规则
 					</view>
-					<view class="picker set">
-						请选择
-						<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
+					<view class="picker set" @click="isRefund = true">
+						<view class="" v-if="showRule" style="color: #333333;">
+							{{showRule}}
+						</view>
+						<view class="" v-else>
+							请选择
+							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
+						</view>
 					</view>
 				</view>
 				<view class="item upload">
@@ -181,8 +159,8 @@
 				</view>
 			</view>
 		</view>
-		<selectDate @confirm="handleConfirm" @close="closeSelectDate" v-if="isSelectDate" />
-		<refund v-if="isRefund" saveRule="saveFound" @closeRule="cutRule" />
+		<DateSelector @confirm="handleConfirm" @close="closeSelectDate" v-if="isSelectDate" />
+		<refund v-if="isRefund" @confirm="saveFound" @close="cutRule" />
 		<view class="popup" v-if="isSelectType">
 			<view class="model">
 				<view class="title">
@@ -220,87 +198,117 @@
 </template>
 
 <script>
-	import selectDate from '@/components/product/select_date.vue'
-	import refund from '@/components/refund.vue'
+	// import DateSelector from '@/components/product/select_date.vue'
+	import refund from '@/components/product/refund.vue'
 	export default {
 		components: {
-			selectDate,
+			// DateSelector,
 			refund
 		},
 		data() {
 			return {
 				form: {
-					productName: '',
-					productImage: '',
-					intro: '',
-					sex: '',
-					checked: false,
-					num: 0
+					// categoryId:'',
+					// productName: '',
+					// productImage: '',
+					// checked: null,
+					// num: 0,
+					// refundLabel:null,
+					// refundConfirm:null
 				},
+				fmImageList: [], //封面图
+				xqImage: [], //详情图
+				showRule: '', //显示退款规则文字
 				action: 'http://192.168.0.52:8080/jeecg-boot/sys/common/upload', //图片上传地址
-				checkboxList: [{
-						name: '苹果',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '雪梨',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '柠檬',
-						checked: false,
-						disabled: false
-					}
-				],
-				genderOptions: [{
-						label: '男',
-						value: 'male'
-					},
-					{
-						label: '女',
-						value: 'female'
-					},
-					{
-						label: '其他',
-						value: 'other'
-					}
-				],
 				schedule: 1, //进度
 				fileList: [],
 				selectedTime: null,
 				isSelectDate: false,
 				isRefund: false,
-				selectedRules: null,
 				isSelectType: false,
 				treeLeft: [], //一级列表
 				treeCenter: [], //二级列表
 				treeRight: [], //三级列表
-				currentLeft: null, //一级选中
-				currentCenter: null, //二级选中
-				currentRight: null, //三级选中
+				currentLeft: 0, //一级选中
+				currentCenter: 0, //二级选中
+				currentRight: 0, //三级选中
 				productType: [], //选中的商品分类id
 				selectTypeList: [], //选中的商品分类名称
 				showText: ''
 			}
 		},
 		methods: {
-			onGenderChange(event) {
-				const selectedIndex = event.detail.value;
-				this.form.sex = this.genderOptions[selectedIndex].label;
-				this.selectedGenderLabel = this.genderOptions[selectedIndex].label;
-			},
 			//下一步
 			next() {
-				this.schedule += 1
-				let files = [];
-				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
-				files = this.$refs.uUpload.lists.filter(val => {
-					return val.progress == 100;
-				})
-				this.form.productImage = files[0].response.message
-				console.log(this.form.productImage)
+				//封面图处理
+				if (this.$refs.uUpload.lists.length > 0) {
+					let files = [];
+					// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
+					files = this.$refs.uUpload.lists.filter(val => {
+						return val.progress == 100;
+					})
+					this.form.productImage = files[0].response.message
+				}
+				// 详情图处理
+				if (this.$refs.dUpload.lists.length > 0) {
+					let files = [];
+					// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
+					files = this.$refs.dUpload.lists.filter(val => {
+						return val.progress == 100;
+					})
+					let temp = []
+					files.map(item => {
+						temp.push(item.response.message)
+					})
+					this.form.detailImages = temp.join(',')
+				}
+				//基础信息必填提示
+					console.log(this.form)
+				if (!this.form.categoryId) {
+					uni.showToast({
+						title: '请选择商品分类',
+						icon: 'none'
+					});
+					return
+				}
+				if (!this.form.productName) {
+					uni.showToast({
+						title: '请输入商品名称',
+						icon: 'none'
+					});
+					return
+				}
+				if (!this.form.productImage) {
+					uni.showToast({
+						title: '请上传商品封面图',
+						icon: 'none'
+					});
+					return
+				}
+				if (!this.form.detailImages) {
+					uni.showToast({
+						title: '请上传商品详情图',
+						icon: 'none'
+					});
+					return
+				}
+				if (!this.form.price) {
+					uni.showToast({
+						title: '请输入商品原价',
+						icon: 'none'
+					});
+					return
+				}
+				if (!this.form.detailImages) {
+					uni.showToast({
+						title: '请输入商品售价',
+						icon: 'none'
+					});
+					return
+				}else{
+					this.schedule += 1
+				}
+			
 			},
 			// 跳转至组合商品页
 			goGroup() {
@@ -336,9 +344,17 @@
 					url: '/pages/product/rule'
 				})
 			},
+			// 保存退款规则
 			saveFound(rules) {
-				this.selectedRules = rules; // 保存退款规则
-				this.selectedRules = false
+				console.log(rules)
+				this.form.refundConfirm = rules.refundConfirm.refundConfirm
+				this.form.refundLabel = rules.refundLabel.refundLabel
+				let value1 = []
+				value1.push(rules.refundConfirm.name, rules.refundLabel.name)
+				this.showRule = value1.join("·")
+				// console.log(this.showRule)
+				// this.selectedRules = rules; 
+				this.isRefund = false
 			},
 			cutRule() {
 				this.isRefund = false
@@ -360,7 +376,7 @@
 					if (res.data.code == 0) {
 						this.treeCenter = res.data.result
 						if (this.treeCenter[0]) {
-							this.getRightTree(this.treeCenter[0].id)
+							// this.getRightTree(this.treeCenter[0].id)
 						}
 					}
 				})
@@ -373,28 +389,47 @@
 					}
 				})
 			},
-			//选中一级
-			selectLeft(item, index) {
+			selectProductType() {
+				this.isSelectType = true
 				this.showText = ''
 				this.productType = []
 				this.selectTypeList = []
+				this.currentLeft = null
+				this.currentCenter = null
+				this.currentRight = null
+			},
+			//选中一级
+			selectLeft(item, index) {
 				this.currentLeft = index
 				this.currentCenter = null
 				this.currentRight = null
+				this.treeCenter = []
+				this.treeRight = []
+				this.productType = []
+				this.selectTypeList = []
 				this.productType.push(item.id)
 				this.selectTypeList.push(item.name)
 				this.getCenterTree(item.id)
 			},
 			//选中二级
 			selectRight(item, index) {
+				this.getRightTree(this.treeCenter[0].id)
 				this.currentCenter = index
 				this.currentRight = null
+				if (this.selectTypeList.length >= 2) {
+					this.productType.splice(1, 2)
+					this.selectTypeList.splice(1, 2)
+				}
 				this.productType.push(item.id)
 				this.selectTypeList.push(item.name)
 				this.getRightTree(item.id)
 			},
 			//选中三级
 			selectLast(item, index) {
+				if (this.selectTypeList.length >= 3) {
+					this.productType.splice(2, 1)
+					this.selectTypeList.splice(2, 1)
+				}
 				this.productType.push(item.id)
 				this.selectTypeList.push(item.name)
 				this.currentRight = index
@@ -402,6 +437,7 @@
 			//确定分类
 			selectType() {
 				this.isSelectType = false
+				this.form.categoryId = this.productType.join(',')
 				this.showText = this.selectTypeList.join('·')
 			},
 			//关闭选择分类弹窗
@@ -411,6 +447,16 @@
 		},
 		mounted() {
 			this.getLeftTree()
+		},
+		onLoad(options) {
+			if (options.data) {
+				let objStr = decodeURIComponent(options.data); // 获取并解码参数
+				let obj = JSON.parse(objStr); // 将字符串转换回对象
+
+				this.form.productGroups = obj
+				console.log(this.form.productGroups); 
+			}
+
 		}
 	}
 </script>
@@ -457,6 +503,7 @@
 			width: 100%;
 			flex: 1;
 			padding: 24rpx;
+			overflow-y: auto;
 
 			.titl {
 				width: 100%;
@@ -630,7 +677,7 @@
 
 				.tree {
 					display: flex;
-					max-height: 546rpx;
+					height: 546rpx;
 
 					.left {
 						overflow-y: auto;

+ 26 - 22
pages/product/group.vue

@@ -14,13 +14,13 @@
 					组合套餐
 				</view>
 				<view class="list" v-for="(item,index) in groupList" :key="index">
-					<view class="name">{{item.name}}</view>
-					<view class="single" v-for="(row,ind) in item.singleList">
+					<view class="name">{{item.groupName}}</view>
+					<view class="single" v-for="(row,ind) in item.singleProduct">
 						<view class="single_name">
-							{{row.name}}
+							{{row.productName}}
 						</view>
 						<view class="single_price">
-							{{row.num}}{{row.unit}}/{{row.price}}元
+							{{row.quantity}}{{row.unit}}/{{row.price}}元
 							<!-- <span class="cuIcon-deletefill"></span> -->
 							<span @click="remove(index,ind)">删除</span>
 						</view>
@@ -70,16 +70,16 @@
 				</view>
 				<view class="inp">
 					<view class="single">
-						名称<u-input v-model="single.name" placeholder="请输入单品名称" />
+						名称<u-input v-model="singleProduct.productName" placeholder="请输入单品名称" />
 					</view>
 					<view class="single">
-						数量<u-input v-model="single.num" placeholder="请输入数量" />
+						数量<u-input v-model="singleProduct.quantity" placeholder="请输入数量" />
 					</view>
 					<view class="single">
-						单位<u-input v-model="single.unit" placeholder="请输入单位" />
+						单位<u-input v-model="singleProduct.unit" placeholder="请输入单位" />
 					</view>
 					<view class="single">
-						价格<u-input v-model="single.price" placeholder="请输入价格" />
+						价格<u-input v-model="singleProduct.price" placeholder="请输入价格" />
 					</view>
 				</view>
 				<view class="btn">
@@ -100,9 +100,9 @@
 				groupList: [],
 				isAddGroup: false,
 				isAddSingle: false,
-				single: {
-					name: '',
-					num: '',
+				singleProduct: {
+					productName: '',
+					quantity: '',
 					unit: '',
 					price: ''
 				},
@@ -115,8 +115,8 @@
 				if (this.name !== '') {
 					this.isAddGroup = false
 					this.groupList.push({
-						name: this.name,
-						singleList: []
+						groupName: this.name,
+						singleProduct: []
 					})
 					this.name = ''
 					this.isAddSingle = true
@@ -141,28 +141,28 @@
 			cancelSingle() {
 				this.isAddSingle = false
 				this.isAddGroup = false
-				this.single = {
-					name: '',
-					num: '',
+				this.singleProduct = {
+					productName: '',
+					quantity: '',
 					unit: '',
 					price: ''
 				}
 			},
 			//确定添加单品
 			subSingle() {
-				this.groupList[this.singleIndex].singleList.push(this.single)
+				this.groupList[this.singleIndex].singleProduct.push(this.singleProduct)
 				this.isAddGroup = false
 				this.isAddSingle = false
-				this.single = {
-					name: '',
-					num: '',
+				this.singleProduct = {
+					productName: '',
+					quantity: '',
 					unit: '',
 					price: ''
 				}
 			},
 			//删除单品
 			remove(index, ind) {
-				this.groupList[index].singleList.splice(ind, 1)
+				this.groupList[index].singleProduct.splice(ind, 1)
 			},
 			//删除商品组
 			deleteGroup(index){
@@ -176,7 +176,11 @@
 			},
 			//保存
 			save(){
-				console.log(this.groupList)
+				// console.log(this.groupList)
+				let objStr = JSON.stringify(this.groupList);
+				uni.navigateTo({
+					url: `/pages/product/creatProduct?data=${encodeURIComponent(objStr)}`
+				})
 			}
 		}
 	}