浏览代码

选择商品分页

zhanghui 1 年之前
父节点
当前提交
ff1cf82bb1

+ 6 - 6
pages/groupbuying/publish_good_list/index.vue

@@ -37,7 +37,7 @@ components: {
 },
 data () {
 	return {
-		vGoodsIdList:[],
+		vGoodsList:[],
 		productList:[],
 		current:0,
 		height:'',
@@ -57,14 +57,14 @@ onShow(){
 },
 methods: {
 
-	returnVGoodIds(){
+	returnVGoods(){
 		let arr=[];
-		this.vGoodsIdList=[];
+		this.vGoodsList=[];
 		for (let i =0;i<this.productList.length;i++){
-			arr = this.$refs.MescrollItem[i].getvGoodsIdList();
-			this.vGoodsIdList = this.vGoodsIdList.concat(arr)
+			arr = this.$refs.MescrollItem[i].getvGoodsList();
+			this.vGoodsList = this.vGoodsList.concat(arr)
 		}
-		return  this.vGoodsIdList
+		return  this.vGoodsList
 	},
 
 

+ 8 - 2
pages/groupbuying/publish_good_list/module/mescrollUni-item.vue

@@ -93,8 +93,14 @@
 
 		methods: {
 
-			getvGoodsIdList(){
-				return this.vGoodsIdList
+			getvGoodsList(){
+				let arr = []
+				this.list.forEach(e=>{
+					if (this.vGoodsIdList.indexOf(e.id) !==-1){
+						arr.push(e)
+					}
+				})
+				return arr
 			},
 
 

+ 15 - 13
pages/groupbuying/publish_group/index.vue

@@ -332,8 +332,8 @@ export default {
 		},
 		close () {
 			this.addGoodPopupShow = false
-			this.grouponReqData.goodsIds =this.$refs.publish_good_list.returnVGoodIds();
-			 console.log('close',this.grouponReqData.goodsIds);
+			this.selectGoodList =this.$refs.publish_good_list.returnVGoods();
+			 console.log('close',this.selectGoodList);
 		},
 		addGood () {
 			this.addGoodPopupShow = true
@@ -407,16 +407,16 @@ export default {
 					title: that.$t(`请选择自提点`)
 				});
 			}
-			if (this.grouponReqData.goodsIds.length < 1) {
+			if (this.selectGoodList.length < 1) {
 				return that.$util.Tips({
 					title: that.$t(`请添加商品`)
 				});
 			}
-			// let goodsIds = [];
-			// this.selectGoodList.forEach(e => {
-			// 	goodsIds.push(e.id);
-			// 	that.grouponReqData.goodsIds = goodsIds;
-			// })
+			let goodsIds = [];
+			this.selectGoodList.forEach(e => {
+				goodsIds.push(e.id);
+				that.grouponReqData.goodsIds = goodsIds;
+			})
 			uni.showLoading({
 				title: that.$t(`发布中`),
 				mask: true
@@ -445,13 +445,15 @@ export default {
 		padding: 20rpx 0;
 	}
 	.image-box{
-		width: 32rpx;
-		height: 32rpx;
+		width: 34rpx;
+		height: 34rpx;
+		margin-right: 30rpx;
+
 	}
 	.image-box image{
-		width: 32rpx;
-		height: 32rpx;
-		margin-right: 30rpx;
+		width: 34rpx;
+		height: 34rpx;
+
 	}
 
 .fontcolor {