瀏覽代碼

评价及列表,投诉,首页数据渲染,套餐购买数量bug修改

huangzhe 3 年之前
父節點
當前提交
c310785b57

+ 5 - 0
src/core/apiUrl.js

xqd
@@ -69,6 +69,11 @@ const apiUrl = {
         favorite_batch_remove: '/api/user/favorite-batch-remove',
         config: 'api/user/config',
         is_clerk: 'api/user/is-clerk-user',
+		
+		//hxj新增
+		evaluate_list:'api/order-comments/list',
+		del_evaluate:'api/order-comments/del',
+		suggestion:'api/user/submit-suggestion',
     },
     article: {
         list: 'api/default/article-list',

+ 45 - 43
src/pages/index/hxj_index_component.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -3,15 +3,13 @@
 		<view class="swiper_cent">
 			<swiper style="height: 900rpx;" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="1000"
 				@change="swiperChange">
-				<swiper-item v-for="(item,index) in 3" :key="index">
-					<image src="https://t17.9026.com/web/statics/image/index/1.png" style="width: 100%;height: 900rpx;"
-						mode=""></image>
+				<swiper-item v-for="(item,index) in homePages[0].data.banners" :key="index" @click="goPage(item.url)">
+					<image :src="item.picUrl" style="width: 100%;height: 900rpx;" mode=""></image>
 				</swiper-item>
 			</swiper>
 			<view class="swiper_zhishi">
-				<view :class="swiperKey===i?'view_active':''" v-for="(item1,i) in 3" :key="i"></view>
+				<view :class="swiperKey===i?'view_active':''" v-for="(item1,i) in homePages[0].data.banners.length" :key="i"></view>
 			</view>
-
 		</view>
 		<view class="link">
 			<view>
@@ -28,14 +26,14 @@
 			<view class="subtitle">臻选整装 · 安全无甲醛 · 7天入住</view>
 		</view>
 		<view class="lg_list">
-			<view class="item" v-for="(item,index) in jdlg" :key="index"
-				@click="goPage('/pages/case/projectInfo?id=9')">
-				<image class="imgBox" :src="`https://t17.9026.com/web/statics/image/index/${item.cover_image}.png`">
+			<view class="item" v-for="(item,index) in homePages[5].data.list" :key="index"
+				@click="goPage(item.type=='goods'?`/pages/goods/goods?id=${item.id}`:`/pages/case/projectInfo?id=${item.id}`)">
+				<image class="imgBox" :src="item.cover_pic">
 				</image>
 				<view class="b_card main-between">
 					<view class="left">
-						<view class="title">{{item.title}}</view>
-						<view class="desc">{{item.sub_title}}</view>
+						<view class="title t-omit" style="width: 420rpx;">{{item.name}}</view>
+						<view class="desc t-omit" style="width: 420rpx;">{{item.subtitle}}</view>
 					</view>
 					<view class="right">
 						<view class="price"><text class="rmb">¥</text><text>{{item.price}}</text><text
@@ -57,15 +55,15 @@
 
 		</view>
 		<view class="coupon main-left">
-			<view class="item main-left" v-for="(item,index) in 2" :key="index">
+			<view class="item main-left" v-for="(item,index) in homePages[6].data.coupon_list" :key="index" @click="goPage(`/pages/coupon/list/list`)">
 				<view class="Wb">
 					<view>
 						<view class="title_2">定制优享礼券 <text class="hjx-tc-B19D60 hjx-ts-21 hxj-ml-10">立即领取</text></view>
 						<view class="desc_2">新用户礼遇</view>
 					</view>
 					<view>
-						<view class="price"><text>¥</text>100</view>
-						<view class="yxq">有效期至2021-12-31</view>
+						<view class="price"><text>¥</text>{{item.sub_price}}</view>
+						<view class="yxq">有效期至{{item.end_time.split(' ')[0]}}</view>
 					</view>
 				</view>
 			</view>
@@ -118,8 +116,7 @@
 		<view class="main-between link mt_20">
 			<view class="title1">
 				限时团购
-				<image class="coupon_1"
-					src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode="">
+				<image class="coupon_1" src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode="">
 				</image>
 				<text class="coupon_sub">TUANGOU</text>
 			</view>
@@ -155,10 +152,11 @@
 			</swiper>
 		</view>
 		<view class="link main-left">
-			<view class="title1" style="margin-right: 61rpx;">荟享自营</view>
-			<view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view>
+			<!-- <view class="title1" style="margin-right: 61rpx;">荟享自营</view>
 			<view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view>
 			<view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view>
+			<view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view> -->
+			<view class="title1" style="margin-right: 61rpx;" :style="{'color':bottom_goods_index===index?'':'#A7A7A7'}" v-for="(item,index) in homePages[11].data.catList" @click="selectCat(index)">{{item.menuName}}</view>
 			<image class="tyx" src="https://t17.9026.com/web/statics/image/index/tyx.png" mode=""></image>
 		</view>
 		<view class="hxzy">
@@ -175,15 +173,15 @@
 				</view>
 			</view>
 			<view class="dir-left-wrap bottom">
-				<view class="item" v-for="(item,index) in 4" :key="index"
-					@click="goPage(`/pages/goods/goods?id=${18+index}`)">
+				<view class="item" v-for="(item,index) in homePages[11].data.catList[bottom_goods_index].goodsList" :key="index"
+					@click="goPage(`/pages/goods/goods?id=${item.id}`)">
 					<view>
-						<image class="cover" :src="`https://t17.9026.com/web/statics/image/index/${index+10}.png`"
+						<image class="cover" :src="item.cover_pic"
 							mode=""></image>
 					</view>
-					<view class="title_2">马蒂斯系列 烟灰缸/首饰盘</view>
-					<view class="desc_2">细节控 · 创意</view>
-					<view class="price" style="margin-top: 27rpx;"><text class="rmb">¥</text><text>258</text><text
+					<view class="title_2 t-omit" style="width: 320rpx;">{{item.name}}</view>
+					<view class="desc_2">{{item.sales}}</view>
+					<view class="price" style="margin-top: 27rpx;"><text class="rmb">¥</text><text>{{item.price}}</text><text
 							class="dw">元</text></view>
 				</view>
 			</view>
@@ -207,19 +205,21 @@
 		components: {
 			appScrollList
 		},
-		props:{
+		props: {
 			homePages: {
-			  type: Object,
-			  default() {
-			    return {
-			      navs: [],
-			    };
-			  },
+				type: Object,
+				default () {
+					return {
+						navs: [],
+					};
+				},
 			},
 		},
 		data() {
 			return {
+				pageData: '',
 				swiperKey: 0, //轮播位置
+				bottom_goods_index:0, //底部商品分类索引
 				list: [
 
 					{
@@ -265,23 +265,25 @@
 						cover_image: 'temporary/jhk-1634284367308'
 					}
 				],
-				qwe: [{
-					'title': '兴城人居',
-					'cover_image': 'jhk-1634283667210'
-				}, {
-					'title': '世龙广场',
-					'cover_image': 'jhk-1634284372084'
-				}, {
-					'title': '新中式',
-					'cover_image': 'jhk-1634283687206'
-				}]
+				qwe: [
+					{
+						'title': '兴城人居',
+						'cover_image': 'jhk-1634283667210'
+					}, {
+						'title': '世龙广场',
+						'cover_image': 'jhk-1634284372084'
+					}, {
+						'title': '新中式',
+						'cover_image': 'jhk-1634283687206'
+					}, 
+				]
 
 			}
 		},
-		created() {
-			this.$store.dispatch('user/isEnterSales', false);
-		},
 		methods: {
+			selectCat(index){
+				this.bottom_goods_index=index
+			},
 			swiperChange(e) {
 				console.log(e.detail.current)
 				this.swiperKey = e.detail.current

+ 1 - 1
src/pages/index/index.vue

xqd
@@ -30,7 +30,7 @@
                           :is_storage="is_storage" :theme="getTheme" :page_id="page_id" :is_required="is_required"
                           :coupon_req="coupon_req"></app-diy-page> -->
 
-			<hxj-index :home-pages="homePages"></hxj-index>
+			<hxj-index :home-pages="homePages.navs[0].template.data[1].data.list[0].data"></hxj-index>
 		</template>
 		<!-- <app-buy-prompt :isShowAttention="isShowAttention" v-if="config.is_purchase_frame === 1"></app-buy-prompt> -->
 		<app-attr :goods="attrGoods.goods" :attrGroupList="attrGoods.goods.attr_groups" :theme="getTheme"

+ 2 - 2
src/pages/order/index/index.vue

xqd
@@ -359,9 +359,9 @@ export default {
         },
         // 订单评价
         appraise(e) {
-			console.log('qweqweqew',e) 
             uni.navigateTo({
-                url: `/pages/order/appraise/appraise?id=${e.id}`
+                // url: `/pages/order/appraise/appraise?id=${e.id}`
+				url: `/pages/user-center/evaluate/evaluate?id=${e.id}`
             })
         },
         getClerkCode(e) {

+ 47 - 32
src/pages/user-center/about-mall/ComplaintsSuggestions.vue

xqd xqd xqd
@@ -5,7 +5,7 @@
 				<view class="main-left cross-center title">
 					整体评价
 				</view>
-				<textarea class="evalClass"  placeholder-class="evalphlVal" value="" maxlength="30" placeholder="请写下您想咨询的问题或投诉建议,以便更好的为您解决。" />
+				<textarea class="evalClass" v-model="content" auto-height placeholder-class="evalphlVal"  maxlength="200" placeholder="请写下您想咨询的问题或投诉建议,以便更好的为您解决。" />
 			</view>
 		</view>
 		<view class="evalContent">
@@ -15,33 +15,48 @@
 				</view>
 			</view>
 		</view>
-		<view class="uploddimg" @click="uploadImg">
-			<image src="https://t17.9026.com/web/statics/image/user-center/takePicture.png" mode=""></image>
-			<view class="text">上传图片</view>
+
+		<view class='uploddimg'>
+			<app-upload-image  @imageEvent='imageEvent' :count="3" :maxNum='3'></app-upload-image>
 		</view>
 		
-		<button class="tij">提交</button>
+		<button class="tij" @click="submit">提交</button>
 	</view>
 </template>
 
 <script>
+	import AppUploadImage from "@/components/basic-component/app-upload-image/app-upload-image.vue";
 	export default {
+		components: {
+			'app-upload-image': AppUploadImage,
+		},
 		data() {
 			return {
-				
+				content:'',
+				imgs:[]
 			};
 		},
 		methods:{
-			uploadImg(){
-				uni.chooseImage({
-				    count: 6, //默认9
-				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-				    sourceType: ['album','camera'], //从相册选择
-				    success:(res)=> {
-				        console.log(JSON.stringify(res.tempFilePaths));
-				    }
-				});
-			}
+			submit(){
+				this.$request({
+					url:this.$api.user.suggestion,
+					data:{
+						content:this.content,
+						imgs:this.imgs
+					},
+					method:'post'
+				}).then(res=>{
+					if(res.code===0){
+						uni.showToast({
+							title:'成功'
+						})
+					}
+				})
+			},
+			// 上传图片
+			imageEvent(e) {
+				this.imgs = e.imageList;
+			},
 		}
 	}
 </script>
@@ -61,32 +76,32 @@
 		color: #FFFFFF;
 	}
 	.uploddimg{
-		width: 187rpx;
-		height: 126rpx;
-		background: #F4F4F4;
+		// width: 187rpx;
+		// height: 126rpx;
+		// background: #F4F4F4;
 		opacity: 0.8;
 		border-radius: 8rpx;
 		margin: 56rpx 36rpx;
 		padding-top: 31rpx;
-		image{
-			width: 48rpx;
-			height: 38rpx;
-			display: block;
-			margin: 0 auto 14rpx;
-		}
-		.text{
-			text-align: center;
-			font-size: 20rpx;
-			font-weight: 500;
-			color: #666666;
-		}
+		// image{
+		// 	width: 48rpx;
+		// 	height: 38rpx;
+		// 	display: block;
+		// 	margin: 0 auto 14rpx;
+		// }
+		// .text{
+		// 	text-align: center;
+		// 	font-size: 20rpx;
+		// 	font-weight: 500;
+		// 	color: #666666;
+		// }
 	}
 	.evalContent{
 		background-color: #fff;
 		margin-top: 16rpx;
 		.evalClass{
 			width: 678rpx;
-			height: 171rpx;
+			min-height: 171rpx;
 			background: #F8F8F8;
 			border-radius: 6rpx;
 			margin: 24rpx auto 0;

+ 195 - 63
src/pages/user-center/evaluate/evaluate.vue

xqd xqd xqd
@@ -1,56 +1,170 @@
 <template>
-	<view >
-		<view class="main-left evaObj">
-			<image src="https://t17.9026.com/web/statics/image/sale/1.png" mode=""></image>
-			<view class="main-between-y">
-				<view class="title">几度米黄色真皮沙发组合,可调节桦木皮艺转角沙发</view>
-				<view class="main-between cross-center">
-					<view class="price">¥2466.00</view>
-					<view class="num">x1</view>
+	<app-layout>
+		<view v-if="is_show">
+			<form>
+				<view v-for='(item,index) in appraiseData' :key='index'>
+					<view class="main-left evaObj">
+						<image mode="aspectFill" :src='item.goods_pic_url'></image>
+						<view class="main-between-y">
+							<view class="title t-omit-two">{{item.goods_name}}</view>
+							<view class="main-between cross-center">
+								<view class="price">¥2466.00</view>
+								<view class="num">x1</view>
+							</view>
+						</view>
+					</view>
+					<view class="evalContent">
+						<view class="item">
+							<view class="main-left cross-center title">
+								<image class="icon"
+									src="https://t17.9026.com/web/statics/image/user-center/evaluate1.png" mode="">
+								</image>整体评价
+							</view>
+							<textarea class="evalClass" placeholder-class="evalphlVal" v-model="item.content" maxlength="30" auto-height
+								placeholder="为了我们更好的反馈,请您填写整体评价" />
+						</view>
+						<view class="item">
+							<view class="main-left cross-center title">
+								<image class="icon"
+									src="https://t17.9026.com/web/statics/image/user-center/evaluate2.png" mode="">
+								</image>材质质量
+							</view>
+							<textarea class="evalClass" placeholder-class="evalphlVal" v-model="item.quality_comment" maxlength="30" auto-height
+								placeholder="为了我们更好的反馈,请您填写材质质量" />
+						</view>
+						<view class="item">
+							<view class="main-left cross-center title">
+								<image class="icon"
+									src="https://t17.9026.com/web/statics/image/user-center/evaluate3.png" mode="">
+								</image>商品风格
+							</view>
+							<textarea class="evalClass" placeholder-class="evalphlVal" v-model="item.style_comment" maxlength="30" auto-height
+								placeholder="为了我们更好的反馈,请您填写材质质量" />
+						</view>
+					</view>
+					<!-- <view class="uploddimg">
+						<image src="https://t17.9026.com/web/statics/image/user-center/takePicture.png" mode=""></image>
+						<view class="text">上传图片</view>
+					</view> -->
+					<view class='image-box'>
+						<app-upload-image :sign='item.id' @imageEvent='imageEvent' :count="3" :maxNum='maxNum'>
+						</app-upload-image>
+					</view>
 				</view>
-			</view>
+				<button class="tij" @click="formSubmit">提交</button>
+			</form>
 		</view>
-		<view class="evalContent">
-			<view class="item">
-				<view class="main-left cross-center title">
-					<image class="icon" src="https://t17.9026.com/web/statics/image/user-center/evaluate1.png" mode=""></image>整体评价
-				</view>
-				<textarea class="evalClass"  placeholder-class="evalphlVal" value="" maxlength="30" placeholder="为了我们更好的反馈,请您填写整体评价" />
-			</view>
-			<view class="item">
-				<view class="main-left cross-center title">
-					<image class="icon" src="https://t17.9026.com/web/statics/image/user-center/evaluate2.png" mode=""></image>材质质量
-				</view>
-				<textarea class="evalClass"  placeholder-class="evalphlVal" value="" maxlength="30" placeholder="为了我们更好的反馈,请您填写材质质量" />
-			</view>
-			<view class="item">
-				<view class="main-left cross-center title">
-					<image class="icon" src="https://t17.9026.com/web/statics/image/user-center/evaluate3.png" mode=""></image>商品风格
-				</view>
-				<textarea class="evalClass"  placeholder-class="evalphlVal" value="" maxlength="30" placeholder="为了我们更好的反馈,请您填写材质质量" />
-			</view>
-		</view>
-		<view class="uploddimg" >
-			<image src="https://t17.9026.com/web/statics/image/user-center/takePicture.png" mode=""></image>
-			<view class="text">上传图片</view>
-		</view>
-		
-		<button class="tij">提交</button>
-	</view>
+	</app-layout>
 </template>
 
 <script>
+	import AppUploadImage from "@/components/basic-component/app-upload-image/app-upload-image.vue";
 	export default {
+		components: {
+			'app-upload-image': AppUploadImage,
+		},
 		data() {
 			return {
-				
+				id: null,
+				maxNum: 6, //最大图片上传数量
+				appraiseData: [],
+				is_show: false,
 			};
+		},
+		onLoad(options) {
+			this.$commonLoad.onload(options);
+			this.id = options.id;
+			this.getOrderDetail();
+		},
+		methods: {
+			// 上传图片
+			imageEvent(e) {
+				let sign = e.sign;
+				let imageList = e.imageList;
+				this.appraiseData.forEach(item => {
+					if (item.id === sign) {
+						item.pic_list = imageList;
+						return false;
+					}
+				});
+				this.appraiseData = this.appraiseData;
+			},
+			formSubmit() {
+				uni.showLoading({
+					title: '提交中'
+				});
+				this.$request({
+					url: this.$api.order.appraise,
+					method: 'post',
+					data: {
+						appraiseData: JSON.stringify(this.appraiseData),
+						order_id: this.id,
+					},
+				}).then(response => {
+					uni.hideLoading();
+					if (response.code === 0) {
+						uni.redirectTo({
+							url: `/pages/order/appraise-finish/index?id=${this.id}`,
+						});
+					} else {
+						uni.showModal({
+							title: '',
+							content: response.msg,
+							showCancel: false
+						})
+					}
+				}).catch(() => {
+					uni.hideLoading();
+				});
+			},
+			getOrderDetail() {
+				this.$showLoading();
+				this.$request({
+					url: this.$api.order.detail,
+					data: {
+						id: this.id
+					}
+				}).then(res => {
+					this.$hideLoading();
+					if (res.code === 0) {
+						let detail = res.data.detail;
+						let appraise = [];
+						detail.detail.forEach(function(item) {
+							appraise.push({
+								id: item.id,
+								goods_pic_url: item.goods_info.pic_url ? item.goods_info.pic_url :
+									item.goods.goodsWarehouse.cover_pic,
+								goods_name: item.goods.goodsWarehouse.name,
+								content: '',
+								quality_comment:'',
+								style_comment:'',
+								pic_list: [],
+								grade_level: 3,
+							})
+						});
+						this.appraiseData = appraise;
+						this.is_show = true;
+					} else {
+						uni.showModal({
+							title: '',
+							content: res.msg,
+							showCancel: false,
+						});
+						// uni.navigateBack();
+					}
+				}).catch(() => {
+					self.$hideLoading();
+				});
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.tij{
+	.image-box{
+		padding: 40rpx 0 0 36rpx;
+	}
+	.tij {
 		width: 678rpx;
 		height: 90rpx;
 		background: #A18353;
@@ -59,7 +173,8 @@
 		font-weight: bold;
 		color: #FFFFFF;
 	}
-	.uploddimg{
+
+	.uploddimg {
 		width: 187rpx;
 		height: 126rpx;
 		background: #F4F4F4;
@@ -67,67 +182,84 @@
 		border-radius: 8rpx;
 		margin: 56rpx 36rpx;
 		padding-top: 31rpx;
-		image{
+
+		image {
 			width: 48rpx;
 			height: 38rpx;
 			display: block;
 			margin: 0 auto 14rpx;
 		}
-		.text{
+
+		.text {
 			text-align: center;
 			font-size: 20rpx;
 			font-weight: 500;
 			color: #666666;
 		}
 	}
-	.evalContent{
+
+	.evalContent {
 		background-color: #fff;
 		margin-top: 16rpx;
-		.evalClass{
+
+		.evalClass {
 			width: 678rpx;
-			height: 171rpx;
+			min-height: 171rpx;
 			background: #F8F8F8;
 			border-radius: 6rpx;
 			margin: 24rpx auto 0;
 		}
-		/deep/.evalphlVal{
+
+		/deep/.evalphlVal {
 			font-size: 28rpx;
 			font-weight: 500;
 			color: #999999;
 			padding: 33rpx 31rpx;
 		}
-		.item{
+
+		.item {
 			padding: 40rpx 36rpx 0;
-		.title{
-			font-size: 30rpx;
-			font-weight: bold;
-			color: #222222;
+
+			.title {
+				
+				font-size: 30rpx;
+				font-weight: bold;
+				color: #222222;
+			}
+
+			.icon {
+				width: 32rpx;
+				height: 32rpx;
+				margin-right: 11rpx;
+			}
 		}
-		.icon{
-			width: 32rpx;
-			height: 32rpx;
-			margin-right: 11rpx;
-		}}
 	}
-	.evaObj{
-		padding: 37rpx 37rpx 0;
+
+	.evaObj {
+		padding: 37rpx 37rpx 20px;
 		background-color: #fff;
-		image{
-			width: 111rpx;height: 110rpx;
+
+		image {
+			width: 111rpx;
+			height: 110rpx;
 			margin-right: 24rpx;
 		}
-		.title{
+
+		.title {
+			width: 530rpx;
 			font-size: 26rpx;
-			
+
 			font-weight: 500;
 			color: #666666;
 		}
-		.price{
+
+		.price {
 			font-size: 24rpx;
 			font-weight: 500;
 			color: #222222;
 		}
-		.num{
+
+		.num {
 			font-size: 22rpx;
 			font-family: PingFang SC;
 			font-weight: 500;

+ 265 - 176
src/pages/user-center/evaluate/list.vue

xqd
@@ -1,204 +1,293 @@
 <template>
-	<view class="page">
-		<view class="box" v-for="(item,index) in evaluateList" :key="index">
-			<view class="main-between cross-center header">
-				<view class="cross-center head">
-					<image src="https://t17.9026.com/web/statics/image/sale/1.png" mode=""></image>
-					周先生
-				</view>
-				<view class="main-between cross-center">
-					<view class="date">2021-11-17</view>
-					<image class="del" src="https://t17.9026.com/web/statics/image/user-center/del.png" mode="" @click="delEval(index)"></image>
-				</view>
-			</view>
-			<view class="center" :style="{'height':item.isSpread?'auto':'174rpx'}">
-				<view class="main-between cross-center">
-					<view class="title">整体评价</view>
-					<view class="isopen cross-center" @click="Spread(index,1)" v-show="!item.isSpread">
-						展开
-						<image src="https://t17.9026.com/web/statics/image/user-center/arrow-bottom.png" mode=""></image>
+	<app-layout>
+		<view class="page">
+			<view class="box" v-for="(item,index) in evaluateList" :key="index">
+				<view class="main-between cross-center header">
+					<view class="cross-center head">
+						<image :src="userInfo.avatar" mode=""></image>
+						{{userInfo.nickname}}
+					</view>
+					<view class="main-between cross-center">
+						<view class="date">
+							{{item.is_virtual===0?item.virtual_time.split(' ')[0]:item.created_at.split(' ')[0]}}</view>
+						<image class="del" src="https://t17.9026.com/web/statics/image/user-center/del.png" mode=""
+							@click="delEval(index,item.id)"></image>
 					</view>
 				</view>
-				<view class="center-text">基本上任何一件服装都包含了来自可能多达数十位供应商的零部件和服务</view>
-				<view class="center-img"><image v-for="(item, index) in 5" :key="index" src="https://t17.9026.com/web/statics/image/user-center/1.png" mode=""></image></view>
-				<view class="main-between goods" >
-					<view class="main-left desc">
-						<image class="goods-img" src="https://t17.9026.com/web/statics/image/user-center/1.png" mode=""></image>
-						<view>
-							<view class="title">兴城人居ins居家占位套餐</view>
-							<view class="price">
-								<text class="company">¥</text>
-								2466.00
-							</view>
+				<view class="center" :style="{'height':item.isSpread?'auto':'140rpx'}">
+					<view class="main-between cross-center">
+						<view class="title">整体评价</view>
+						<view class="isopen cross-center" @click="Spread(index,1)" v-show="!item.isSpread">
+							展开
+							<image src="https://t17.9026.com/web/statics/image/user-center/arrow-bottom.png" mode="">
+							</image>
 						</view>
 					</view>
-					<view class="isopen cross-center" @click="Spread(index,0)">
-						收起
-						<image src="https://t17.9026.com/web/statics/image/user-center/arrow-top.png" mode=""></image>
-					</view>
+					<view class="center-text">{{item.content}}</view>
+
+					<template v-show="item.isSpread">
+						<view class="main-between cross-center">
+							<view class="title">材料质量</view>
+						</view>
+						<view class="center-text">{{item.quality_comment}}</view>
+
+						<view class="main-between cross-center">
+							<view class="title">商品风格</view>
+						</view>
+						<view class="center-text">{{item.style_comment}}</view>
+						<view class="center-img">
+							<image v-for="(item1, index1) in item.pic_url" :key="index1" :src="item1" mode=""></image>
+						</view>
+						<view class="main-between goods">
+							<view class="main-left desc">
+								<image class="goods-img" :src="item.cover_img" mode=""></image>
+								<view>
+									<view class="title t-omit">{{item.goods_name}}</view>
+									<view class="price">
+										<text class="company">¥</text>
+										{{item.order_amount}}
+									</view>
+								</view>
+							</view>
+							<view class="isopen cross-center" @click="Spread(index,0)">
+								收起
+								<image src="https://t17.9026.com/web/statics/image/user-center/arrow-top.png" mode="">
+								</image>
+							</view>
+						</view>
+					</template>
 				</view>
 			</view>
+
+			<view class="no-more">没有更多了...</view>
 		</view>
-		
-		<view class="no-more">没有更多了...</view>
-	</view>
+	</app-layout>
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			evaluateList:[
-				{
-					isSpread:false
-				},
-				{
-					isSpread:false
-				}
-			]
-		};
-	},
-	methods:{
-		delEval(index){
-			uni.showModal({
-				title: '提示',
-				content: '确定删除这条评价吗',
-				success: (res)=> {
-					if (res.confirm) {
-						console.log('用户点击确定');
-						this.evaluateList.splice(index,1)
-					} else if (res.cancel) {
-						console.log('用户点击取消');
-					}
-				}
-			});
+	import {
+		mapState
+	} from "vuex"
+	export default {
+		data() {
+			return {
+				page: 1,
+				evaluateList: []
+			};
+		},
+		computed: {
+			...mapState({
+				userInfo: state => state.user.info,
+			})
+		},
+		onLoad() {
+			this.getData()
+		},
+		onReachBottom() {
+			this.page++
+			this.getData()
 		},
-		Spread(index,i){
-			i?this.evaluateList[index].isSpread=true:this.evaluateList[index].isSpread=false
+		methods: {
+			getData() {
+				this.$showLoading()
+				this.$request({
+					url: `${this.$api.user.evaluate_list}&page=${this.page}`,
+					method: 'post'
+				}).then(res => {
+					if (res.code === 0) {
+						let evaluateList = res.data.list
+						for (let i = 0; i < evaluateList.length; i++) {
+							evaluateList[i].isSpread = false
+							evaluateList[i].pic_url = JSON.parse(evaluateList[i].pic_url)
+						}
+						if (this.page === 1) {
+							this.evaluateList = evaluateList
+						} else {
+							this.evaluateList = this.evaluateList.concat(evaluateList)
+						}
+					}
+					this.$hideLoading()
+				}).catch(rej => {
+					this.$hideLoading()
+				})
+			},
+			delEval(index,id) {
+				uni.showModal({
+					title: '提示',
+					content: '确定删除这条评价吗',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							this.$request({
+								url:this.$api.user.del_evaluate,
+								data:{
+									id:id
+								},
+								method:'post'
+							}).then(res=>{
+								if(res.code===0){
+									uni.showToast({
+										title:'删除成功',
+									})
+									this.evaluateList.splice(index, 1)
+								}else{
+									uni.showToast({
+										title:'删除失败',
+									})
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			},
+			Spread(index, i) {
+				i ? this.evaluateList[index].isSpread = true : this.evaluateList[index].isSpread = false
+			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss" scoped>
-.page {
-	padding-top: 22rpx;
-	background: #f6f6f6;
-}
-.box {
-	width: 678rpx;
-	height: auto;
-	background: #ffffff;
-	border-radius: 6rpx;
-	padding: 26rpx 31rpx;
-	margin: 0 auto 20rpx;
-
-	.header {
-		padding-bottom: 21rpx;
-		border-bottom: 1px solid #eaeaea;
-		.head {
-			max-width: 500rpx;
-			height: 48rpx;
-			background: #f6f6f6;
-			border-radius: 24rpx;
-			padding: 0 17rpx;
-			overflow: hidden;
-			image {
-				width: 32rpx;
-				height: 32rpx;
-				margin-right: 14rpx;
-				border-radius: 50%;
-			}
-			font-size: 24rpx;
-			font-weight: 500;
-			color: #666666;
-		}
-		.date {
-			font-size: 22rpx;
-			font-weight: 500;
-			color: #222222;
-			margin-right: 30rpx;
-		}
-		.del {
-			width: 36rpx;
-			height: 36rpx;
-		}
+	.page {
+		padding-top: 22rpx;
+		background: #f6f6f6;
 	}
-	.center {
-		padding: 37rpx 0 10rpx;
-		height: 174rpx;
-		overflow: hidden;
-		.title {
-			font-size: 30rpx;
-			font-weight: bold;
-			color: #222222;
-		}
-		.isopen {
-			font-size: 24rpx;
-			font-weight: bold;
-			color: #a18353;
-			image {
-				width: 19rpx;
-				height: 12rpx;
-				margin-left: 8rpx;
+
+	.box {
+		width: 678rpx;
+		height: auto;
+		background: #ffffff;
+		border-radius: 6rpx;
+		padding: 26rpx 31rpx;
+		margin: 0 auto 20rpx;
+
+		.header {
+			padding-bottom: 21rpx;
+			border-bottom: 1px solid #eaeaea;
+
+			.head {
+				max-width: 500rpx;
+				height: 48rpx;
+				background: #f6f6f6;
+				border-radius: 24rpx;
+				padding: 0 17rpx;
+				overflow: hidden;
+
+				image {
+					width: 32rpx;
+					height: 32rpx;
+					margin-right: 14rpx;
+					border-radius: 50%;
+				}
+
+				font-size: 24rpx;
+				font-weight: 500;
+				color: #666666;
 			}
-		}
-		.center-text {
-			margin-top: 20rpx;
-			font-size: 24rpx;
-			font-weight: 500;
-			color: #999999;
-			line-height: 34rpx;
-		}
-		.center-img {
-			margin-top: 28rpx;
-			image {
-				width: 146rpx;
-				height: 96rpx;
-				border-radius: 12rpx;
-				margin-right: 15rpx;
+
+			.date {
+				font-size: 22rpx;
+				font-weight: 500;
+				color: #222222;
+				margin-right: 30rpx;
+			}
+
+			.del {
+				width: 36rpx;
+				height: 36rpx;
 			}
 		}
-		.goods{
-			padding-top: 42rpx;
-			border-top: 1rpx solid #EAEAEA;
-			.desc{
-				width: 511rpx;
-				height: 141rpx;
-				background: #F8F8F8;
-				border-radius: 6rpx;
-				padding: 18rpx 24rpx;
-				.goods-img{
-					width: 101rpx;
-					height: 99rpx;
-					border-radius: 8rpx;
-					margin-right: 21rpx;
+
+		.center {
+			padding: 20rpx 0 10rpx;
+			height: 174rpx;
+			overflow: hidden;
+
+			.title {
+				margin-top: 17rpx;
+				font-size: 30rpx;
+				font-weight: bold;
+				color: #222222;
+			}
+
+			.isopen {
+				font-size: 24rpx;
+				font-weight: bold;
+				color: #a18353;
+
+				image {
+					width: 19rpx;
+					height: 12rpx;
+					margin-left: 8rpx;
 				}
-				.title{
-					font-size: 26rpx;
-					font-weight: 500;
-					color: #222222;
-					line-height: 46rpx;
+			}
+
+			.center-text {
+				margin-top: 20rpx;
+				font-size: 24rpx;
+				font-weight: 500;
+				color: #999999;
+				line-height: 34rpx;
+			}
+
+			.center-img {
+				margin-top: 28rpx;
+
+				image {
+					width: 146rpx;
+					height: 96rpx;
+					border-radius: 12rpx;
+					margin-right: 15rpx;
 				}
-				.price{
-					font-size: 24rpx;
-					font-weight: 500;
-					color: #FC3737;
-					line-height: 36rpx;
-					.company{
-						
+			}
+
+			.goods {
+				padding-top: 42rpx;
+				border-top: 1rpx solid #EAEAEA;
+
+				.desc {
+					width: 511rpx;
+					height: 141rpx;
+					background: #F8F8F8;
+					border-radius: 6rpx;
+					padding: 18rpx 24rpx;
+
+					.goods-img {
+						width: 101rpx;
+						height: 99rpx;
+						border-radius: 8rpx;
+						margin-right: 21rpx;
+					}
+
+					.title {
+						width: 335rpx;
+						font-size: 26rpx;
+						font-weight: 500;
+						color: #222222;
+						line-height: 46rpx;
+					}
+
+					.price {
+						font-size: 24rpx;
+						font-weight: 500;
+						color: #FC3737;
+						line-height: 36rpx;
+
+						.company {}
 					}
 				}
+
 			}
-			
 		}
 	}
-}
-.no-more{
-	font-size: 24rpx;
-	font-weight: 500;
-	color: #666666;
-	margin-top: 37rpx;
-	text-align: center;
-}
+
+	.no-more {
+		font-size: 24rpx;
+		font-weight: 500;
+		color: #666666;
+		margin-top: 37rpx;
+		text-align: center;
+	}
 </style>

+ 2 - 2
src/plugins/composition/components/app-bd-info/app-bd-info.vue

xqd
@@ -11,13 +11,13 @@
 							<text class="rmb">{{total}}</text>
 							<text class="decimal">.00</text>
 						</text>
-						<text class="price-line"><text>¥</text>3000.00</text>
+						<text class="price-line"><text>¥</text>{{info.min_composition_price}}</text>
 					</view>
 					<view class="main-between">
 						<view class="main-left">
 							<view class="tag">{{info.tag}}</view>
 							<view class="tag">全款</view>
-							<view class="tag">满200减10</view>
+							<!-- <view class="tag">满200减10</view> -->
 						</view>
 					</view>
 				</view>

+ 41 - 32
src/plugins/composition/components/app-list/app-list.vue

xqd xqd xqd xqd xqd
@@ -27,7 +27,7 @@
 							<view class="price"><text class="ought_price">¥{{goods.max_price}}</text><text class="paid_price" v-show="goods.total_price">实付:¥<text>{{goods.total_price}}</text></text></view>
 						</view>
 					</view>
-					<app-add-subtract :xStyle="2" :stock="goods.stock" :good_id="goods.id" :value="goods.choose_attr.number" @change="addsubChange($event,goods,index,index1)"></app-add-subtract>
+					<app-add-subtract :xStyle="2" :stock="goods.stock" :good_id="goods.id" :min="1" :value="goods.choose_attr.number" @change="addsubChange($event,goods,index,index1,0)"></app-add-subtract>
                 </view>                    
                 <view class="item-goods main-between" v-for="(goods,idx) in item.goods_list" :key="goods.id">
 					<view class="main-left">
@@ -54,7 +54,7 @@
                         <view class="price"><text class="ought_price">¥{{goods.max_price}}</text><text class="paid_price" v-show="goods.total_price">实付:¥<text>{{goods.total_price}}</text></text></view>
                     </view>
 					</view>
-					<app-add-subtract :xStyle="2" :stock="goods.stock" :good_id="goods.id" :value="goods.choose_attr.number" @change="addsubChange($event,goods,index,idx)"></app-add-subtract>
+					<app-add-subtract :xStyle="2" :stock="goods.stock" :good_id="goods.id" :min="0" :value="goods.choose_attr.number" @change="addsubChange($event,goods,index,idx,1)"></app-add-subtract>
                 </view>
                 <view class="app-price">
                     <template v-if="item.total_price && hidden">
@@ -152,11 +152,13 @@
 			appAddSubtract
         },
         methods: {
-			addsubChange(e,goods,index,index1){
-				console.log('数量',e,goods)
-				this.list[index].host_list[index1].choose_attr.number=e.number
-				
-				this.$emit("updateList",this.list);
+			addsubChange(e,goods,index,index1,ss){
+				if(ss===0){//固定商品
+					this.list[index].host_list[index1].choose_attr.number=e.number
+				}else{//搭配商品
+					this.list[index].goods_list[index1].choose_attr.number=e.number
+				}
+				this.count();
 			},
             // 规格选择
             check({item}) {
@@ -188,8 +190,11 @@
                         }
                         if(that.list[that.index].type == 2) {
                             v.choose_goods = true;
-                            that.list[that.index].host_list[0].choose_goods = true
-                            that.list[that.index].host_list[0].opacity = 0.3
+							for (let i = 0; i < that.list[that.index].host_list.length; i++) {
+								let item=that.list[that.index].host_list[i]
+								item.choose_goods = true
+								item.opacity = 0.3
+							}
                         }
                         that.count();
                         that.$forceUpdate();
@@ -296,35 +301,39 @@
                     }
                 }else if(that.list[i].type == 2) {
                     that.list[i].total_price = 0;
-                    if(that.list[i].host_list[0].choose_attr) {
-                        that.list[i].total_price = +that.list[i].host_list[0].choose_attr.price - +that.list[i].host_list[0].price
-                        that.list[i].host_list[0].total_price = +that.list[i].host_list[0].choose_attr.price - +that.list[i].host_list[0].price
-                        that.max_discount += +that.list[i].host_list[0].price
-                        if(that.list[i].host_list[0].total_price < 0) {
-                            that.list[i].host_list[0].total_price = 0
-                        }else {
-                            that.list[i].host_list[0].total_price = +that.list[i].host_list[0].total_price.toFixed(2);
-                        }
-                        that.total += +that.list[i].host_list[0].total_price
-                    }else {
-                        that.noAttrList.push(that.list[i].host_list[0])
-                    }
+					for (let k = 0; k < that.list[i].host_list.length; k++) {
+						let item=that.list[i].host_list[k]
+						if(item.choose_attr) {
+							that.list[i].total_price = (+item.choose_attr.price - +item.price)*item.choose_attr.number
+							item.total_price = (+item.choose_attr.price - +item.price)*item.choose_attr.number
+							that.max_discount += (+item.price)*item.choose_attr.number
+							if(item.total_price < 0) {
+								item.total_price = 0
+							}else {
+								item.total_price = +item.total_price.toFixed(2);
+							}
+							that.total += +item.total_price
+						}else {
+							that.noAttrList.push(item)
+						}
+					}
                     for(let x in that.list[i].goods_list) {
-                        if(that.list[i].goods_list[x].choose_goods && that.list[i].goods_list[x].choose_attr) {
-                            that.list[i].goods_list[x].total_price = +that.list[i].goods_list[x].choose_attr.price - +that.list[i].goods_list[x].price
-                            that.max_discount += +that.list[i].goods_list[x].price
-                            if(that.list[i].goods_list[x].total_price < 0) {
-                                that.list[i].goods_list[x].total_price = 0
+						let item=that.list[i].goods_list[x]
+                        if(item.choose_goods && item.choose_attr) {
+                            item.total_price = (+item.choose_attr.price - +item.price)*item.choose_attr.number
+                            that.max_discount += (+item.price)*item.choose_attr.number
+                            if(item.total_price < 0) {
+                                item.total_price = 0
                             }else {
-                                that.list[i].goods_list[x].total_price = +that.list[i].goods_list[x].total_price.toFixed(2);
+                                item.total_price = +item.total_price.toFixed(2);
                             }
-                            that.total += +that.list[i].goods_list[x].total_price
+                            that.total += +item.total_price
                             if(that.list[i].total_price > 0) {
-                                that.list[i].total_price += +that.list[i].goods_list[x].total_price
+                                that.list[i].total_price += +item.total_price
                             }
                         }
-                        if(that.list[i].goods_list[x].choose_goods && that.list[i].goods_list[x].choose_attr == null ) {
-                            that.noAttrList.push(that.list[i].goods_list[x])
+                        if(item.choose_goods && item.choose_attr == null ) {
+                            that.noAttrList.push(item)
                         }
                     }
                     if(that.list[i].total_price < 0) {

+ 32 - 25
src/plugins/composition/detail/detail.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -136,7 +136,7 @@
 								}
 								arr.goods_list.push({
 									id: that.list[i].host_list[0].goods_id,
-									num: 1,
+									num: that.list[i].host_list[0].choose_attr.number,
 									goods_attr_id: that.list[i].host_list[0].choose_attr.goods_attr_id,
 									attr: []
 								})
@@ -154,7 +154,7 @@
 									}
 									arr.goods_list.push({
 										id: that.list[i].goods_list[y].goods_id,
-										num: 1,
+										num: that.list[i].goods_list[y].choose_attr.number,
 										goods_attr_id: that.list[i].goods_list[y].choose_attr.goods_attr_id,
 										attr: attr
 									})
@@ -166,20 +166,25 @@
 								composition_id: that.list[i].id,
 								goods_list: []
 							}
-							if (that.list[i].host_list.length > 0 && that.list[i].host_list[0].choose_goods) {
-								for (let x in that.list[i].host_list[0].choose_attr.attr_list) {
-									attr.push({
-										attr_id: that.list[i].host_list[0].choose_attr.attr_list[x].attr_id,
-										attr_group_id: that.list[i].host_list[0].choose_attr.attr_list[x]
-											.attr_group_id,
-									})
+							if (that.list[i].host_list.length > 0) {
+								for (let k = 0; k < that.list[i].host_list.length; k++) {
+									let item=that.list[i].host_list[k]
+									if(item.choose_goods){
+										for (let x in item.choose_attr.attr_list) {
+											attr.push({
+												attr_id: item.choose_attr.attr_list[x].attr_id,
+												attr_group_id: item.choose_attr.attr_list[x]
+													.attr_group_id,
+											})
+										}
+										arr.goods_list.push({
+											id: item.goods_id,
+											num: item.choose_attr.number,
+											goods_attr_id: item.choose_attr.goods_attr_id,
+											attr: attr
+										})
+									}
 								}
-								arr.goods_list.push({
-									id: that.list[i].host_list[0].goods_id,
-									num: 1,
-									goods_attr_id: that.list[i].host_list[0].choose_attr.goods_attr_id,
-									attr: attr
-								})
 							}
 							let noChoose = true;
 							for (let y in that.list[i].goods_list) {
@@ -195,7 +200,7 @@
 									}
 									arr.goods_list.push({
 										id: that.list[i].goods_list[y].goods_id,
-										num: 1,
+										num: that.list[i].goods_list[y].choose_attr.number,
 										goods_attr_id: that.list[i].goods_list[y].choose_attr.goods_attr_id,
 										attr: attr
 									})
@@ -206,13 +211,13 @@
 							}
 						}
 					}
-					if (list[0].composition_list.length == 0) {
-						uni.showToast({
-							title: '请选择套餐',
-							icon: 'none',
-							duration: 1000
-						});
-					} else {
+					// if (list[0].composition_list.length == 0) {
+					// 	uni.showToast({
+					// 		title: '请选择套餐',
+					// 		icon: 'none',
+					// 		duration: 1000
+					// 	});
+					// } else {
 						for (let i in list[0].composition_list) {
 							if (list[0].composition_list[i].goods_list.length == 1) {
 								list[0].composition_list.splice(i, 1)
@@ -220,7 +225,7 @@
 						}
 						if (list[0].composition_list.length == 0) {
 							uni.showToast({
-								title: '请选择搭配商品',
+								title: '请选择至少一个搭配商品',
 								icon: 'none',
 								duration: 1000
 							});
@@ -232,6 +237,8 @@
 									list[0].goods_list.push(list[0].composition_list[j].goods_list[y])
 								}
 							}
+							console.log('this.list',this.list)
+							console.log('list',list)
 							let jump_url = `/pages/order-submit/order-submit?mch_list=${JSON.stringify(list)}`;
 							jump_url +=
 								`&preview_url=${encodeURIComponent(this.$api.composition.order_preview)}&submit_url=${encodeURIComponent(this.$api.composition.order_submit)}&plugin=composition`;
@@ -240,7 +247,7 @@
 								url: jump_url,
 							});
 						}
-					}
+					// }
 				}
 			},
 			close() {