多规格商品下单错误

zh
jjj 4 years ago
parent 700293e4d6
commit 712cbd1b52

@ -10,9 +10,10 @@
</view> --> </view> -->
<view class="live-item bg-white" v-for="(item,index) in liveVideos" :key="index"> <view class="live-item bg-white" v-for="(item,index) in liveVideos" :key="index">
<view class="live-main-pic"> <view class="live-main-pic">
<u-lazy-load threshold="-100" :image="item.cover" :loading-img="IMAGE_URL + '/null05.png'" :index="index" :error-img="IMAGE_URL + '/null05.png'" @click="toLiveDetail(item.id,item.isLive)"></u-lazy-load> <u-lazy-load threshold="-100" :image="judgeCover(item.cover)" :loading-img="IMAGE_URL + '/null05.png'" :index="index" :error-img="IMAGE_URL + '/null05.png'" @click="toLiveDetail(item.id,item.isLive)"></u-lazy-load>
<view class="icon text-white flex"> <view class="icon text-white flex">
<text class="cuIcon-playfill"></text> <image class="liveStatus" v-if="item.isLive === 1" src="../static/play.gif"></image>
<text class="cuIcon-playfill" v-else></text>
<text style="padding: 0 8rpx;">{{item.look}}人看过</text> <text style="padding: 0 8rpx;">{{item.look}}人看过</text>
</view> </view>
</view> </view>
@ -97,7 +98,7 @@
onAbort() { onAbort() {
console.log('onAbort') console.log('onAbort')
}, },
getFollowList() { getFollowList() {
this.$u.post("/api/v1/live/live/follow_list", { this.$u.post("/api/v1/live/live/follow_list", {
page: this.page1, page: this.page1,
limit: this.limit1 limit: this.limit1
@ -144,6 +145,14 @@
url:`/pages/livePlayback/livePlayback?id=${id}&isLive=${isLive}` url:`/pages/livePlayback/livePlayback?id=${id}&isLive=${isLive}`
// url: "/pages/livePlayback/livePlayback?id=" + id // url: "/pages/livePlayback/livePlayback?id=" + id
}) })
},
judgeCover (val) {
let arr = val.split('/')
if (arr[0] === 'http:') {
return val
}
return this.IMAGE_URL + val
} }
} }
@ -167,6 +176,9 @@
image { image {
background-color: #FFFFFF; background-color: #FFFFFF;
}
.liveStatus{
width: 32rpx;
} }
.icon { .icon {

@ -154,18 +154,18 @@
<view class="flex justify-between align-center goods_box"> <view class="flex justify-between align-center goods_box">
<view class="goods_icon"> <view class="goods_icon">
<text>正品保障</text> <text>正品保障</text>
</view> </view>
<view class="goods_icon_hr"> <view class="goods_icon_hr">
</view> </view>
<view class="goods_icon"> <view class="goods_icon">
<text v-if="goodsDetail.storehouse === 1"></text> <text v-if="goodsDetail.storehouse === 1"></text>
<text v-if="goodsDetail.storehouse === 2"></text> <text v-if="goodsDetail.storehouse === 2"></text>
<text v-if="goodsDetail.storehouse ===3"></text> <text v-if="goodsDetail.storehouse ===3"></text>
</view> </view>
<view class="goods_icon_hr"> <view class="goods_icon_hr">
</view> </view>
<view class="goods_icon"> <view class="goods_icon">
<text v-if="addressList.length > 1">{{addressList[addressList.length-1]}}</text> <text v-if="addressList.length > 1">{{addressList[addressList.length-1]}}</text>
@ -274,18 +274,18 @@
<view class="text-black" style="line-height: 80rpx;font-size: 28rpx;padding: 0 20rpx;">图文详情</view> <view class="text-black" style="line-height: 80rpx;font-size: 28rpx;padding: 0 20rpx;">图文详情</view>
<view class="video" v-if="goodsDetail.video"> <view class="video" v-if="goodsDetail.video">
<video :src="IMAGE_URL+goodsDetail.video.url" style="width: 100%;display: block;" controls></video> <video :src="IMAGE_URL+goodsDetail.video.url" style="width: 100%;display: block;" controls></video>
</view> </view>
<view class="detail-pics brandFirstImg" v-if="brandFirstImg"> <view class="detail-pics brandFirstImg" v-if="brandFirstImg">
<u-lazy-load threshold="-100" :image="IMAGE_URL+brandFirstImg" <u-lazy-load threshold="-100" :image="IMAGE_URL+brandFirstImg"
:index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load> :index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load>
</view> </view>
<view class="detail-pics"> <view class="detail-pics">
<u-lazy-load threshold="-100" :image="IMAGE_URL+item.url" v-for="(item,index) in pictures" :key="index" <u-lazy-load threshold="-100" :image="IMAGE_URL+item.url" v-for="(item,index) in pictures" :key="index"
:index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load> :index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load>
</view> </view>
<view class="detail-pics brandLastImg" v-if="brandLastImg"> <view class="detail-pics brandLastImg" v-if="brandLastImg">
<u-lazy-load threshold="-100" :image="IMAGE_URL+brandLastImg" <u-lazy-load threshold="-100" :image="IMAGE_URL+brandLastImg"
:index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load> :index="index" :loading-img="IMAGE_URL + '/null05.png'" :error-img="IMAGE_URL + '/null05.png'" ></u-lazy-load>
</view> </view>
</view> </view>
</view> </view>
@ -500,8 +500,8 @@
dynamics: [], //, dynamics: [], //,
showBtn: false, // showBtn: false, //
addressList: [], addressList: [],
address: null, address: null,
brandFirstImg:'',// brandFirstImg:'',//
brandLastImg:'',// brandLastImg:'',//
} }
}, },
@ -521,6 +521,9 @@
if (options.q !== undefined) { if (options.q !== undefined) {
let url = decodeURIComponent(options.q) let url = decodeURIComponent(options.q)
options.id = url.split("/")[6]; options.id = url.split("/")[6];
if( url.split("/")[7] != undefined){
this.$store.commit('setinvite', url.split("/")[7]);
}
} }
if (uni.getStorageSync("userInfo").roleLevel) { if (uni.getStorageSync("userInfo").roleLevel) {
this.roleLevel = uni.getStorageSync("userInfo").roleLevel this.roleLevel = uni.getStorageSync("userInfo").roleLevel
@ -606,7 +609,7 @@
this.showSpecs = flag this.showSpecs = flag
}, },
// //
getGoodsDetail() { getGoodsDetail() {
this.$u.post('/api/v1/goods/detail/summary', { this.$u.post('/api/v1/goods/detail/summary', {
userID: uni.getStorageSync("userInfo").id, userID: uni.getStorageSync("userInfo").id,
@ -618,25 +621,34 @@
this.$u.toast(res.data.msg); this.$u.toast(res.data.msg);
return return
} }
this.goodsDetail = res.data.data this.goodsDetail = res.data.data
// type // type
if(res.data.data.notice.type === 1){ if(res.data.data.notice.type === 1){
this.brandFirstImg = res.data.data.notice.img this.brandFirstImg = res.data.data.notice.img
this.brandLastImg = '' this.brandLastImg = ''
}else if(res.data.data.notice.type === 2){ }else if(res.data.data.notice.type === 2){
this.brandFirstImg = '' this.brandFirstImg = ''
this.brandLastImg = res.data.data.notice.img this.brandLastImg = res.data.data.notice.img
}else{ }else{
this.brandFirstImg = res.data.data.notice.img this.brandFirstImg = res.data.data.notice.img
this.brandLastImg = res.data.data.notice.img this.brandLastImg = res.data.data.notice.img
} }
// //
if (this.goodsDetail.attributes.length === 1 && this.goodsDetail.attributes[0].children.length === 1) { if (this.goodsDetail.attributes.length === 1 && this.goodsDetail.attributes[0].children.length === 1) {
this.selectName[0] = this.goodsDetail.attributes[0].children[0].name this.selectName[0] = this.goodsDetail.attributes[0].children[0].name
this.selectArr[0] = this.goodsDetail.attributes[0].children[0].id this.selectArr[0] = this.goodsDetail.attributes[0].children[0].id
this.subIndex[0] = 0 this.subIndex[0] = 0
}
if (this.goodsDetail.attributes.length > 1) {
let arr = []
if (this.goodsDetail.attributes[0].children[0].id < this.goodsDetail.attributes[1].children[0].id) {
this.goodsDetail.attributes.forEach((item) => {
arr.unshift(item)
})
this.$set(this.goodsDetail, 'attributes', arr)
}
} }
console.log(res.data.data) console.log(res.data.data)
this.swiperImgList = res.data.data.mainPhotos this.swiperImgList = res.data.data.mainPhotos
@ -664,7 +676,7 @@
for (let i in this.goodsDetail.sku) { for (let i in this.goodsDetail.sku) {
this.shopItemInfo[this.goodsDetail.sku[i].combineId.split(",").reverse().join(",")] = this.goodsDetail.sku[i]; //便 this.shopItemInfo[this.goodsDetail.sku[i].combineId.split(",").reverse().join(",")] = this.goodsDetail.sku[i]; //便
} }
console.log(this.shopItemInfo) // console.log(this.shopItemInfo)
this.checkItem(); this.checkItem();
}, },
@ -679,7 +691,7 @@
return return
} }
this.pictures = res.data.data.list this.pictures = res.data.data.list
}); });
}, },
@ -729,10 +741,11 @@
} }
}, },
// //
createOrder() { createOrder() {
console.log(this.sku_id)
console.log(this.checkedSku) console.log(this.checkedSku)
if (!this.sku_id) { if (!this.sku_id) {
this.$u.toast("请选择商品规格") this.$u.toast("请选择商品规格")
@ -802,13 +815,13 @@
this.checkedSku = this.selectName.join(",") this.checkedSku = this.selectName.join(",")
this.checkItem(); this.checkItem();
}, },
checkItem() { checkItem() {
let option = this.goodsDetail.attributes let option = this.goodsDetail.attributes
let result = [] // let result = [] //
for (let i in option) { for (let i in option) {
result[i] = this.selectArr[i] ? this.selectArr[i] : ''; result[i] = this.selectArr[i] ? this.selectArr[i] : '';
} }
// console.log(result) console.log(option)
for (let i in option) { for (let i in option) {
let last = result[i]; //last let last = result[i]; //last
for (let k in option[i].children) { for (let k in option[i].children) {
@ -827,13 +840,14 @@
} }
this.$forceUpdate(); // this.$forceUpdate(); //
}, },
isMay(result) { isMay(result) {
console.log(this.shopItemInfo, result)
for (var i in result) { for (var i in result) {
if (result[i] == '') { if (result[i] == '') {
return true; //true return true; //true
} }
} }
// console.log(this.shopItemInfo[result]) console.log(this.shopItemInfo[result])
return this.shopItemInfo[result].inventory == 0 ? false : true; //truefalse return this.shopItemInfo[result].inventory == 0 ? false : true; //truefalse
}, },
chooseAddress(e) { chooseAddress(e) {
@ -886,9 +900,9 @@
handClick(val) { handClick(val) {
console.log(val) console.log(val)
wx.previewImage({ wx.previewImage({
current: this.swiperList[val], // http current: this.swiperList[val], // http
urls: this.swiperList // http urls: this.swiperList // http
}) })
}, },
@ -962,19 +976,19 @@
.goods_box { .goods_box {
.goods_icon { .goods_icon {
text-align: center; text-align: center;
color: #CCCCCC; color: #CCCCCC;
width: 120rpx; width: 120rpx;
image { image {
width: 52rpx; width: 52rpx;
margin: 0 auto; margin: 0 auto;
} }
} }
.goods_icon_hr{ .goods_icon_hr{
flex: 1; flex: 1;
height: 1rpx; height: 1rpx;
border-bottom: 1rpx dashed #CCCCCC; border-bottom: 1rpx dashed #CCCCCC;
} }
@ -1388,4 +1402,4 @@
content: none; content: none;
border-radius: 0; border-radius: 0;
} }
</style> </style>

@ -34,7 +34,7 @@
<view class="flex flex-direction justify-around text-white btns-con"> <view class="flex flex-direction justify-around text-white btns-con">
<!-- 视频转发功能接口需要改动最好详情接口把所有数据返回要么前端将数据全部带出去接收者进入页面是加判断是否有参数接收有则修改vuex状态管理中视频详情的值 --> <!-- 视频转发功能接口需要改动最好详情接口把所有数据返回要么前端将数据全部带出去接收者进入页面是加判断是否有参数接收有则修改vuex状态管理中视频详情的值 -->
<!-- <button class="btn-item" open-type="share"><text class="cuIcon-forwardfill"></text></button> --> <!-- <button class="btn-item" open-type="share"><text class="cuIcon-forwardfill"></text></button> -->
<button class="btn-item" @tap="showCommentsModel"><text class="cuIcon-commentfill"></text></button> <!-- <button class="btn-item" @tap="showCommentsModel"><text class="cuIcon-commentfill"></text></button> -->
<button class="btn-item" @tap="setPraiseVideo"><text class="cuIcon-likefill" :class="videoDetail.isPraise?'red':''"></text></button> <button class="btn-item" @tap="setPraiseVideo"><text class="cuIcon-likefill" :class="videoDetail.isPraise?'red':''"></text></button>
</view> </view>
</view> </view>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Loading…
Cancel
Save