master
parent
fce22b48c2
commit
bfc54c0006
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="pad-x140">
|
<view class="pad-x140">
|
||||||
<scroll-view scroll-y @scrolltolower="touchBottomEv" :style="{height: scrolViewheigh + 'px'}">
|
<scroll-view scroll-y @scrolltolower="touchBottomEv" :style="{height: scrolViewheigh + 'px'}">
|
||||||
|
<view class="fon42 col0 mar-sx30">购物车</view>
|
||||||
<view v-for="(item,index) in dataList" :key="index"
|
<view v-for="(item,index) in dataList" :key="index"
|
||||||
class="item-box display-between-center">
|
class="item-box display-between-center">
|
||||||
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
||||||
|
@ -282,21 +283,22 @@
|
||||||
this.total = res.data.total;
|
this.total = res.data.total;
|
||||||
if(res.data.list.length){
|
if(res.data.list.length){
|
||||||
res.data.list.forEach(item=>{
|
res.data.list.forEach(item=>{
|
||||||
let newspec = [];
|
console.log(item,286);
|
||||||
if(item.sku.spec_text.length){
|
// let newspec = [];
|
||||||
item.sku.spec_text.forEach(itemspec=>{
|
// if(item.sku.spec_text.length){
|
||||||
for (let key in itemspec) {
|
// item.sku.spec_text.forEach(itemspec=>{
|
||||||
newspec.push(`${key}:${itemspec[key]}`);
|
// for (let key in itemspec) {
|
||||||
}
|
// newspec.push(`${key}:${itemspec[key]}`);
|
||||||
})
|
// }
|
||||||
}
|
// })
|
||||||
|
// }
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
coding:item.sku.coding,
|
coding:item.sku.coding,
|
||||||
isActive:false,
|
isActive:false,
|
||||||
imgSrc:item.spu.spu_cover,
|
imgSrc:item.spu.spu_cover,
|
||||||
title:item.spu_name,
|
title:item.spu_name,
|
||||||
specs:newspec,
|
specs:item.sku.spec_text,
|
||||||
// price:this.$toolAll.tools.changeNum(item.price*1),
|
// price:this.$toolAll.tools.changeNum(item.price*1),
|
||||||
price:item.price,
|
price:item.price,
|
||||||
reckonPrice:item.price,
|
reckonPrice:item.price,
|
||||||
|
@ -304,6 +306,7 @@
|
||||||
}
|
}
|
||||||
this.dataList.push(obj);
|
this.dataList.push(obj);
|
||||||
})
|
})
|
||||||
|
this.dataList.concat(this.dataList);
|
||||||
} else {
|
} else {
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,11 +229,19 @@
|
||||||
let screenIndex = this.screenList.findIndex(item=>item.mainTitle==title);
|
let screenIndex = this.screenList.findIndex(item=>item.mainTitle==title);
|
||||||
if(screenIndex==0){
|
if(screenIndex==0){
|
||||||
// 设置分类id
|
// 设置分类id
|
||||||
this.categoryId = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
if(childrenIndex==0){
|
||||||
|
this.categoryId = '';
|
||||||
|
} else {
|
||||||
|
this.categoryId = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(screenIndex==1){
|
if(screenIndex==1){
|
||||||
// 设置限时优惠
|
// 设置限时优惠
|
||||||
this.activityStr = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
if(childrenIndex==0){
|
||||||
|
this.activityStr = '';
|
||||||
|
} else {
|
||||||
|
this.activityStr = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 将当前选择的类别下的数组置空
|
// 将当前选择的类别下的数组置空
|
||||||
this.temporaryCate[mainIndex] = [];
|
this.temporaryCate[mainIndex] = [];
|
||||||
|
@ -253,6 +261,12 @@
|
||||||
// 删除选中的分类列表
|
// 删除选中的分类列表
|
||||||
delCate(index){
|
delCate(index){
|
||||||
this.chooseCateList.splice(index,1);
|
this.chooseCateList.splice(index,1);
|
||||||
|
if(index==0){//清空分类id
|
||||||
|
this.categoryId = '';
|
||||||
|
}
|
||||||
|
if(index==1){//清空活动限时字段
|
||||||
|
this.activityStr = '';
|
||||||
|
}
|
||||||
// 清除选中
|
// 清除选中
|
||||||
this.screenList.forEach((item1,index1)=>{
|
this.screenList.forEach((item1,index1)=>{
|
||||||
item1.childrenList.forEach((item2,index2)=>{
|
item1.childrenList.forEach((item2,index2)=>{
|
||||||
|
|
|
@ -146,14 +146,6 @@
|
||||||
return this.$toolAll.tools.operationEv(price1, expressPrice, '+', 2);
|
return this.$toolAll.tools.operationEv(price1, expressPrice, '+', 2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
|
||||||
var shareObj = {
|
|
||||||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
|
||||||
path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=${this.orderList[0].category_id}&share_id=${this.checkGrounpId}&invite_code=${uni.getStorageSync('invite_code')}&shareCate=${this.orderList[0].cateNum}&checkGrounpId=${this.orderList[0].checkGrounpId}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
|
||||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
|
||||||
};
|
|
||||||
return shareObj;
|
|
||||||
},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.checkChoose();//调用检测地址
|
this.checkChoose();//调用检测地址
|
||||||
},
|
},
|
||||||
|
@ -276,6 +268,11 @@
|
||||||
this.$requst.post('/api/order/paid',{order_coding:info.coding}).then(res=>{
|
this.$requst.post('/api/order/paid',{order_coding:info.coding}).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
this.$toolAll.tools.showToast('支付成功');
|
this.$toolAll.tools.showToast('支付成功');
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesA/myOrder/myOrder?index=2'
|
||||||
|
})
|
||||||
|
},2000)
|
||||||
} else this.$toolAll.tools.showToast(res.msg);
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<image @tap="goDetail(item1.id)" :src="item2.sku_cover" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
<image @tap="goDetail(item1.id)" :src="item2.sku_cover" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
||||||
<view @tap="goDetail(item1.id)" class="width100 disjb fc" style="height: 224rpx;">
|
<view @tap="goDetail(item1.id)" class="width100 disjb fc" style="height: 224rpx;">
|
||||||
<view class="fon28 col3 bold clips2 line-h50">{{item2.spu_name}}</view>
|
<view class="fon28 col3 bold clips2 line-h50">{{item2.spu_name}}</view>
|
||||||
<view class="disac">
|
<view class="disac fw">
|
||||||
<view class="order-sy mar-y40" v-for="(item3,index3) in item2.spec_info" :key="index3">{{item3}}</view>
|
<view class="order-sy mar-y40" v-for="(item3,index3) in item2.spec_info" :key="index3">{{item3}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="colpeili disjbac"><span class="order-price">¥{{item2.price}}</span><span class="fon24">x{{item2.num}}</span></view>
|
<view class="colpeili disjbac"><span class="order-price">¥{{item2.price}}</span><span class="fon24">x{{item2.num}}</span></view>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<image :src="item.sku_cover" class="flexs" mode="aspectFill" style="width: 224rpx; height: 224rpx;"></image>
|
<image :src="item.sku_cover" class="flexs" mode="aspectFill" style="width: 224rpx; height: 224rpx;"></image>
|
||||||
<view class="width100 disjb fc" style="height: 224rpx;">
|
<view class="width100 disjb fc" style="height: 224rpx;">
|
||||||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||||
<view class="orderDetail-sku disac" v-if="item.spec_info.length">
|
<view class="orderDetail-sku disac fw" v-if="item.spec_info.length">
|
||||||
<view class="mar-y40" v-for="(item2,index2) in item.spec_info" :key="index2">{{item2}}</view>
|
<view class="mar-y40" v-for="(item2,index2) in item.spec_info" :key="index2">{{item2}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mar-s10">
|
<view class="mar-s10">
|
||||||
|
|
Loading…
Reference in New Issue