guhongwei 2 년 전
부모
커밋
60b4092992
3개의 변경된 파일26개의 추가작업 그리고 15개의 파일을 삭제
  1. 23 13
      pagesHome/order/detail.vue
  2. 2 1
      pagesRest/activity/info.vue
  3. 1 1
      pagesRest/recom/index.vue

+ 23 - 13
pagesHome/order/detail.vue

@@ -356,16 +356,25 @@
 						}
 						// 显示最低价格的规格信息,不考虑库存问题
 						if (data.specs && data.specs.length > 0) {
-							// 规格排序
-							let indexSpecs = data.specs.sort(function(a, b) {
-								let i, j;
-								if (a.price) i = 'price'
-								else i = 'sell_money'
-								if (b.price) j = 'price'
-								else j = 'sell_money'
-								return a[i] - b[j];
+							data.specs = data.specs.filter(i => i.status == '0');
+							data.specs.sort((a, b) => {
+								return b.sort - a.sort
 							})
-							that.$set(that, `infospecs`, indexSpecs[0])
+							const lowPrice = Math.min.apply(Math, data.specs.map(item => item.price || item
+								.sell_money))
+							let indexSpecs = data.specs.find(i => i.price == lowPrice || i.sell_money == lowPrice)
+							// 规格排序
+							// let indexSpecs = data.specs.sort(function(a, b) {
+							// 	// return a.sort - b.sort
+							// 	let i, j;
+							// 	if (a.price) i = 'price'
+							// 	else i = 'sell_money'
+							// 	if (b.price) j = 'price'
+							// 	else j = 'sell_money'
+							// 	return a[i] - b[j];
+							// })
+							// console.log(indexSpecs);
+							that.$set(that, `infospecs`, indexSpecs)
 						}
 						that.$set(that, `info`, data);
 						// 优惠
@@ -375,7 +384,8 @@
 						if (act) that.$set(that.discount, `full_fold`, act.text.split(';'));
 						await that.searchOther();
 						// 查询规格
-						await that.searchSpecs(data.specs);
+						// await that.searchSpecs(data.specs);
+						await that.searchSpecs(data.specs, that.infospecs);
 						// 查询评价数
 						await that.searchRate(data);
 					}
@@ -387,10 +397,10 @@
 				}
 			},
 			// 查询规格
-			searchSpecs(e) {
+			searchSpecs(e, data) {
 				const that = this;
 				if (e.length > 0) {
-					let data = e.find(i => i.num > 0);
+					// let data = e.find(i => i.num > 0);
 					let dataIndex = e.findIndex(i => i._id == data._id);
 					if (data) {
 						let specsInfo = that.group_config.find(i => i.spec._id == data._id)
@@ -787,7 +797,7 @@
 				.money {
 					font-size: 20px;
 					padding: 0 1vw 0 0;
-					color:  var(--fFB1Color);
+					color: var(--fFB1Color);
 					font-weight: bold;
 
 					text {

+ 2 - 1
pagesRest/activity/info.vue

@@ -111,7 +111,8 @@
 				let info = {
 					skip: that.skip,
 					limit: that.limit,
-					platform_act: that.id
+					platform_act: that.id,
+					status: '0'
 				}
 				let res = await that.$api(`/goodsJoinAct`, 'GET', {
 					...info,

+ 1 - 1
pagesRest/recom/index.vue

@@ -233,7 +233,7 @@
 
 						.image {
 							width: 100%;
-							height: 30vh;
+							height: 40vw;
 							border-radius: 10px;
 							box-shadow: 0 0 5px #f1f1f1;
 						}