|
|
|
@ -21,7 +21,7 @@ |
|
|
|
<swiper class="swiper" @change="gridSwiper" :circular="true"> |
|
|
|
<swiper-item v-for="(item,index ) in goodsDate.gallery_list" :key="index"> |
|
|
|
<view class="swiper-item"> |
|
|
|
<image :src="item.img_url" class="swiper-item-image" mode=""></image> |
|
|
|
<image :src="item.img_url" class="swiper-item-image" mode="" @click="clickImg(index)"></image> |
|
|
|
<!-- <img src="" alt="" class="swiper-item-image"> --> |
|
|
|
<!-- <image src="../../static/img/play.png" class="vedio_play" mode="" ></image> --> |
|
|
|
</view> |
|
|
|
@ -207,11 +207,13 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="productImage"> |
|
|
|
<view class="productImage_title">Product lmage gallery</view> |
|
|
|
<view class="productImage_image" v-html="goodsDate.goods_desc"> |
|
|
|
<!-- {{goodsDate.goods_desc}} --> |
|
|
|
<!-- <image :src="goodsDate.goods_img" mode=""></image> --> |
|
|
|
</view> |
|
|
|
<template v-if="goodsDate.goods_desc"> |
|
|
|
<view class="productImage_title">Product lmage gallery</view> |
|
|
|
<view class="productImage_image" v-html="goodsDate.goods_desc"> |
|
|
|
<!-- {{goodsDate.goods_desc}} --> |
|
|
|
<!-- <image :src="goodsDate.goods_img" mode=""></image> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view class="recommend recommend1" v-if="goodsDate.category_list"> |
|
|
|
<view class="recommend_title">Other options</view> |
|
|
|
<scroll-view class="spike1 " scroll-x="true" :show-scrollbar="false"> |
|
|
|
@ -245,7 +247,7 @@ |
|
|
|
<text>US$314.00</text> |
|
|
|
</view> |
|
|
|
<view class="footer_right"> |
|
|
|
<button @click="addCart">ADD TO CART</button> |
|
|
|
<button @click="isCart=true">ADD TO CART</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="mask" @click="isCart=false,isSecurity=false" v-show="isCart || isSecurity"></view> |
|
|
|
@ -284,7 +286,7 @@ |
|
|
|
<view class="addCard" v-show="isCart"> |
|
|
|
<image src="/static/img/close1.png" mode="" class="addCard_close"></image> |
|
|
|
<scroll-view class="spike1 " scroll-x="true" :show-scrollbar="false"> |
|
|
|
<image :src="item.img_url" mode="" class="addCard_scroll" v-for="(item,index) in goodsDate.gallery_list" :key="index" ></image> |
|
|
|
<image :src="item.img_url" mode="" class="addCard_scroll" v-for="(item,index) in goodsDate.gallery_list" :key="index" @click="clickImg(index)"></image> |
|
|
|
</scroll-view> |
|
|
|
<view class="addCard_body"> |
|
|
|
<view >{{goodsDate.goods_name}} </view> |
|
|
|
@ -322,9 +324,9 @@ |
|
|
|
</view> --> |
|
|
|
<view class="quantity"> |
|
|
|
<text>Quantity</text> |
|
|
|
<uni-number-box background="#FFFFFF">1</uni-number-box> |
|
|
|
<uni-number-box background="#FFFFFF" v-model="cartQuery.goods_number" :min="1"></uni-number-box> |
|
|
|
</view> |
|
|
|
<button>ADD TO CART</button> |
|
|
|
<button @click="addCart">ADD TO CART</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -360,6 +362,7 @@ |
|
|
|
goods_attr_list:[ |
|
|
|
{goods_attr_id:''} |
|
|
|
], |
|
|
|
// 获取该分类的其他商品的请求参数 |
|
|
|
catQuery:{ |
|
|
|
_action:'getgoods', |
|
|
|
cat:'', |
|
|
|
@ -367,11 +370,55 @@ |
|
|
|
page_size:10 |
|
|
|
}, |
|
|
|
catList:[], |
|
|
|
isReachBottom:true |
|
|
|
|
|
|
|
isReachBottom:true, |
|
|
|
// 添加到购物车请求参数 |
|
|
|
cartQuery:{ |
|
|
|
_action:'addtocart', |
|
|
|
goods_id:'', |
|
|
|
goods_parent_id:0, |
|
|
|
goods_number:1, |
|
|
|
goods_attr_id:'', |
|
|
|
goods_is_package:0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
// 添加到购物车 |
|
|
|
addCart(){ |
|
|
|
if(this.goods_attr_list.length==0){ |
|
|
|
uni.showToast({ |
|
|
|
title:'Please select the product specification', |
|
|
|
icon:'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
}else{ |
|
|
|
let goods_attr_id='' |
|
|
|
this.goods_attr_list.map(item=>{ |
|
|
|
goods_attr_id+=item.goods_attr_id+',' |
|
|
|
}) |
|
|
|
this.cartQuery.goods_attr_id=goods_attr_id.substring(0,goods_attr_id.lastIndexOf(',')); |
|
|
|
} |
|
|
|
defaultRequest2(this.cartQuery).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
if(res.error==0){ |
|
|
|
uni.showToast({ |
|
|
|
title:'Successfully added', |
|
|
|
icon:'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 点击预览图片 |
|
|
|
clickImg(index) { |
|
|
|
wx.previewImage({ |
|
|
|
urls: this.info, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了 |
|
|
|
current: index, // 当前显示图片的http链接,默认是第一个 |
|
|
|
indicator:'number', |
|
|
|
success: function(res) {}, |
|
|
|
fail: function(res) {}, |
|
|
|
complete: function(res) {}, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 其他商品详情 |
|
|
|
goDetails(id){ |
|
|
|
uni.navigateTo({ |
|
|
|
@ -404,6 +451,7 @@ |
|
|
|
// 选择规格 |
|
|
|
selectAttr(attr_id,goods_attr_id,index){ |
|
|
|
let data={attr_id:attr_id,goods_attr_id:goods_attr_id} |
|
|
|
if(this.goods_attr_list[0].goods_attr_id=='')this.goods_attr_list=[] |
|
|
|
if(this.goods_attr_list.length==0){ |
|
|
|
this.goods_attr_list.push(data) |
|
|
|
}else{ |
|
|
|
@ -482,20 +530,23 @@ |
|
|
|
this.goodsDate=res.data |
|
|
|
this.goodsDate.gallery_list.map(item=>{ |
|
|
|
item.content='' |
|
|
|
this.info.push(item.img_url) |
|
|
|
}) |
|
|
|
this.goodsDate.attr_list.map(item=>{ |
|
|
|
if(item.attr_name=="Color"){ |
|
|
|
this.colorNum=item.goods_attrs.length |
|
|
|
} |
|
|
|
}) |
|
|
|
if(this.goodsDate.attr_list){ |
|
|
|
this.goodsDate.attr_list.map(item=>{ |
|
|
|
if(item.attr_name=="Color"){ |
|
|
|
this.colorNum=item.goods_attrs.length |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.goods_attr_list=[] |
|
|
|
} |
|
|
|
|
|
|
|
this.catQuery.cat=res.data.cat_id |
|
|
|
this.getCatList(0) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
addCart(){ |
|
|
|
this.isCart=true |
|
|
|
}, |
|
|
|
//当录播有视屏时 |
|
|
|
gridSwiper(e){ |
|
|
|
// if(e.detail.current==1){ |
|
|
|
@ -511,6 +562,7 @@ |
|
|
|
}, |
|
|
|
onLoad(e) { |
|
|
|
this.query.goods_id=e.goods_id |
|
|
|
this.cartQuery.goods_id=e.goods_id |
|
|
|
this.getDate() |
|
|
|
this.user_info=uni.getStorageSync('user_info') |
|
|
|
if(this.user_info.isLogin){ |
|
|
|
@ -1200,7 +1252,7 @@ |
|
|
|
width: 100%; |
|
|
|
min-height: 788rpx; |
|
|
|
margin-bottom: 62rpx; |
|
|
|
background-color: #999999; |
|
|
|
// background-color: #999999; |
|
|
|
|
|
|
|
image{ |
|
|
|
width: 100%; |
|
|
|
@ -1210,7 +1262,7 @@ |
|
|
|
.productImage_image1{ |
|
|
|
width: 100%; |
|
|
|
height: 532rpx; |
|
|
|
background-color: #999999; |
|
|
|
// background-color: #999999; |
|
|
|
image{ |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
|