Browse Source

商品详情页初始化

yuxingxing 2 years ago
parent
commit
92150ef767
4 changed files with 3416 additions and 1967 deletions
  1. 3 4
      api/home.js
  2. 13 13
      components/productWindow/index.vue
  3. 1141 1950
      pages/goods_details/index.vue
  4. 2259 0
      pages/goods_details/index_mall.vue

+ 3 - 4
api/home.js

@@ -2,7 +2,6 @@
 
 import request from "@/utils/request.js";
 
-/* 首页 */
 // 查询轮播数据
 export function getAdsList(data) {
 	return request.get("v1/re/ads/list",data);
@@ -38,9 +37,9 @@ export function getGoodsInfo(data) {
 	return request.get("v1/re/goodsInfo/page",data);
 }
 
-// 爆款专区商品列表查询
-export function get6(data) {
-	return request.get("v1/re/goodsInfo/page",data);
+// 商品详情
+export function getGoodsDetail(data) {
+	return request.get("v1/re/goodsInfo/detail",data);
 }
 
 // 商品推荐商品列表查询

+ 13 - 13
components/productWindow/index.vue

@@ -4,22 +4,22 @@
 			:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt?'join':'') + ' ' + (iScart?'joinCart':'')">
 			<view class="textpic acea-row row-between-wrapper">
 				<view class="pictrue" @click="showImg()">
-					<image :src="attr.productSelect.image" ></image>
+					<image :src="attr.productSelect.goodsCover" ></image>
 				</view>
 				<view class="text">
 					<view class="line1">
-						{{ attr.productSelect.store_name }}
+						{{ attr.productSelect.goodsName }}
 					</view>
 					<view class="money font-color">
 						<view class="acea-row row-middle">
-							{{$t(`¥`)}}<text class="num">{{ attr.productSelect.price }}</text>
+							{{$t(`¥`)}}<text class="num">{{ attr.productSelect.salePrice }}</text>
 							<text class='vip-money'
 								v-if="is_vip>0 && attr.productSelect.vip_price">{{$t(`¥`)}}{{attr.productSelect.vip_price}}</text>
 							<view class="vipImg" v-if="is_vip>0 && attr.productSelect.vip_price">
 								<image src="../../static/images/svip.gif"></image>
 							</view>
 						</view>
-						<text class="stock" v-if='isShow'>{{$t(`库存`)}}: {{ attr.productSelect.stock }}</text>
+						<text class="stock" v-if='isShow'>{{$t(`库存`)}}: {{ attr.productSelect.totalStock }}</text>
 						<text class='stock' v-if="limitNum">{{type ? $t(`库存`) : $t(`限量`)}}: {{attr.productSelect.quota}}</text>
 					</view>
 				</view>
@@ -27,13 +27,13 @@
 			</view>
 			<view class="rollTop">
 				<view class="productWinList">
-					<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
-						<view class="title">{{ item.attr_name }}</view>
+					<view class="item">
+						<view class="title">选择规格</view>
 						<view class="listn acea-row row-middle">
-							<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
-								v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)"
+							<view class="itemn" :class="1 === 1 ? 'on' : ''"
+								v-for="(itemn, indexn) in attr.productAttr" @click="tapAttr(itemn, indexn)"
 								:key="indexn">
-								{{ itemn.attr }}
+								{{ itemn.spceName }}
 							</view>
 						</view>
 					</view>
@@ -53,10 +53,10 @@
 						<view class='item num acea-row row-middle'>
 							<input type="number" v-model="attr.productSelect.cart_num"
 								data-name="productSelect.cart_num"
-								@input="bindCode(attr.productSelect.cart_num)"></input>
+								@input="bindCode(attr.productSelect.cart_num)"/>
 						</view>
 						<view v-if="iSplus" class="item plus acea-row row-center-wrapper" :class="
-				      attr.productSelect.cart_num >= attr.productSelect.stock
+				      attr.productSelect.cart_num >= attr.productSelect.totalStock
 				        ? 'on'
 				        : ''
 				    " @click="CartNumAdd">
@@ -132,8 +132,8 @@
 		methods: {
 			getpreviewImage: function() {
 				uni.previewImage({
-					urls: this.attr.productSelect.image.split(','),
-					current: this.attr.productSelect.image
+					urls: this.attr.productSelect.slideshowList,
+					current: this.attr.productSelect.slideshowList[0]
 				});
 			},
 			goCat: function() {

File diff suppressed because it is too large
+ 1141 - 1950
pages/goods_details/index.vue


File diff suppressed because it is too large
+ 2259 - 0
pages/goods_details/index_mall.vue


Some files were not shown because too many files changed in this diff