接口调取完成
parent
c037848d0f
commit
1bd8e6489f
|
@ -112,7 +112,6 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 缓存状态栏+标题栏的高度
|
|
||||||
const query = wx.createSelectorQuery().in(this)
|
const query = wx.createSelectorQuery().in(this)
|
||||||
query.select('.posi-sticky').boundingClientRect((rect) => {
|
query.select('.posi-sticky').boundingClientRect((rect) => {
|
||||||
console.log(rect.height);
|
console.log(rect.height);
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pad-zy20">
|
<view class="pad-zy20" style="width: 100%;">
|
||||||
<view class="pad-sx20" :style="{width: newWidth+'px'}">
|
<view class="pad-sx20" :style="{width: newWidth+'px'}" v-if="secendCateList.length>0">
|
||||||
<swiper-tab-jl :list="secendCateList" v-model="activeIndex" @changeEv="clickTab" itemColor="#FFFFFF"></swiper-tab-jl>
|
<swiper-tab-jl :list="secendCateList" v-model="activeIndex" @changeEv="clickTab" itemColor="#FFFFFF"></swiper-tab-jl>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" @scrolltolower="scrollBottomEv" :style="{height: scrollHeight +'px'}">
|
<scroll-view scroll-y="true" @scrolltolower="scrollBottomEv" :style="{height: scrollHeight +'px'}">
|
||||||
<view class=" posir" style="padding-bottom: 220rpx;">
|
<view class=" posir" style="padding-bottom: 220rpx;">
|
||||||
<view class="disac bbt-d9 pad-sx30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index">
|
<view class="disac bbt-d9 pad-sx30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index">
|
||||||
<image class="radius30 flexs borbot-cc" :src="item.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image>
|
<image class="radius30 flexs borbot-cc" :src="item.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image>
|
||||||
<view class="width100 disjb fc mar-z20" style="height: 240rpx;">
|
<view class="width100 disjb fc mar-z20" style="height: 240rpx;">
|
||||||
<view class="fon30 colb clips2">{{item.title}}</view>
|
<view class="fon30 colb clips2">{{item.title}}</view>
|
||||||
|
@ -65,44 +65,10 @@
|
||||||
current:0,
|
current:0,
|
||||||
scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50,
|
scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50,
|
||||||
newWidth:uni.getSystemInfoSync().windowWidth,
|
newWidth:uni.getSystemInfoSync().windowWidth,
|
||||||
cateList:[
|
cateList:[], //分类导航列表
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
// {id:1,title:'推荐套装'},
|
|
||||||
],
|
|
||||||
activeIndex:0,
|
activeIndex:0,
|
||||||
secendCateList:[
|
secendCateList:[],
|
||||||
{title:'标题一'},
|
dataList:[], //商品列表
|
||||||
{title:'标题二标题二'},
|
|
||||||
{title:'标题三'},
|
|
||||||
{title:'标题四'},
|
|
||||||
{title:'标题五'},
|
|
||||||
{title:'标题六标题六标题六'},
|
|
||||||
{title:'标题七'},
|
|
||||||
{title:'标题八'},
|
|
||||||
{title:'标题九'},
|
|
||||||
],
|
|
||||||
dataList:[
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题',price:199},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
|
||||||
],
|
|
||||||
page:1,
|
page:1,
|
||||||
size:10,
|
size:10,
|
||||||
total:0,
|
total:0,
|
||||||
|
@ -126,14 +92,16 @@
|
||||||
methods: {
|
methods: {
|
||||||
// 查询商品列表
|
// 查询商品列表
|
||||||
checkShopList(id){
|
checkShopList(id){
|
||||||
|
console.log(id,'分类id2')
|
||||||
this.ifLoading = true;
|
this.ifLoading = true;
|
||||||
let params = {
|
let params = {
|
||||||
page:this.page,// query 否 1 页数
|
page:this.page,// query 否 1 页数
|
||||||
size:this.size,// query 否 10 每页数量
|
size:this.size,// query 否 10 每页数量
|
||||||
pid:id
|
category_id:id
|
||||||
}
|
}
|
||||||
this.$requst.post('/api/spu/list',params).then(res=>{
|
this.$requst.post('/api/spu/list',params).then(res=>{
|
||||||
if(res.code==0) {
|
if(res.code==0) {
|
||||||
|
console.log(res,'商品列表')
|
||||||
this.total = res.data.total;
|
this.total = res.data.total;
|
||||||
if(this.page==1) this.dataList = [];
|
if(this.page==1) this.dataList = [];
|
||||||
if(res.data.list.length) {
|
if(res.data.list.length) {
|
||||||
|
@ -152,6 +120,7 @@
|
||||||
this.ifLoading = false;
|
this.ifLoading = false;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询左侧分类列表
|
// 查询左侧分类列表
|
||||||
checkShopCate(){
|
checkShopCate(){
|
||||||
this.$requst.post('/api/spu/category',{hasChildren:1}).then(res=>{
|
this.$requst.post('/api/spu/category',{hasChildren:1}).then(res=>{
|
||||||
|
@ -172,6 +141,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollBottomEv(){
|
scrollBottomEv(){
|
||||||
console.log('触底了');
|
console.log('触底了');
|
||||||
if(this.total!=this.dataList.length) {
|
if(this.total!=this.dataList.length) {
|
||||||
|
@ -179,48 +149,47 @@
|
||||||
this.checkShopList(this.pid);
|
this.checkShopList(this.pid);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 一级分类选择
|
// 一级分类选择
|
||||||
chooseCate(index,id) {
|
chooseCate(index,id) {
|
||||||
this.current = index;
|
this.current = index;
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.pid = id;
|
this.pid = id;
|
||||||
|
console.log(this.pid,'分类id')
|
||||||
// if(this.activeIndex>this.cateList[index].child.length-1) {
|
// if(this.activeIndex>this.cateList[index].child.length-1) {
|
||||||
// this.activeIndex = this.cateList[index].child.length-1;
|
// this.activeIndex = this.cateList[index].child.length-1;
|
||||||
// }
|
// }
|
||||||
if(this.cateList[index].child) {
|
if(this.cateList[index].child) {
|
||||||
this.secendCateList = this.cateList[index].child;
|
this.secendCateList = this.cateList[index].child;
|
||||||
|
this.activeIndex = 0;
|
||||||
|
this.pid = this.secendCateList[0].id;
|
||||||
} else {
|
} else {
|
||||||
this.secendCateList = [
|
this.secendCateList = [];
|
||||||
{title:'标题一'},
|
|
||||||
{title:'标题二标题二'},
|
|
||||||
{title:'标题三'},
|
|
||||||
{title:'标题四'},
|
|
||||||
{title:'标题五'},
|
|
||||||
{title:'标题六标题六标题六'},
|
|
||||||
{title:'标题七'},
|
|
||||||
{title:'标题八'},
|
|
||||||
{title:'标题九'},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
this.checkShopList(id);
|
this.checkShopList(this.pid);
|
||||||
},
|
},
|
||||||
|
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesB/shop-detail/shop-detail'
|
url:'/pagesB/shop-detail/shop-detail?id='+id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
addCartEv(id) {
|
addCartEv(id) {
|
||||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
||||||
if(res.code==0) {
|
if(res.code==0) {
|
||||||
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
|
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
|
||||||
} else {
|
} else {
|
||||||
this.$toolAll.tools.showToast(res.msg)
|
this.$toolAll.tools.showToast(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// tab点击事件
|
// tab点击事件
|
||||||
clickTab(index){
|
clickTab(index){
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
|
this.pid = this.secendCateList[this.activeIndex].id;
|
||||||
|
this.checkShopList(this.pid);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,34 +8,36 @@
|
||||||
<swiper-tab-jl :list="tagList" v-model="activeIndex" @changeEv="tabTap" itemColor="#FFFFFF"></swiper-tab-jl>
|
<swiper-tab-jl :list="tagList" v-model="activeIndex" @changeEv="tabTap" itemColor="#FFFFFF"></swiper-tab-jl>
|
||||||
</view>
|
</view>
|
||||||
<swiper :style="{height: swiperHeight + 'px'}" class="fon30" style="background-color: #f4f4f4;" :current="activeIndex" @change="swiperChange">
|
<swiper :style="{height: swiperHeight + 'px'}" class="fon30" style="background-color: #f4f4f4;" :current="activeIndex" @change="swiperChange">
|
||||||
<swiper-item v-for="(item,index) in dataList.length" :key="index" class="pad-s30">
|
<swiper-item v-for="(item,index) in dataList" :key="index" class="pad-s30">
|
||||||
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
|
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
|
||||||
<!-- 列表数据 -->
|
<!-- 列表数据 -->
|
||||||
<view class="radius20 bacf pad-zy30 mar-x25 mar-zy40" @tap="goDetail" v-for="(item1,index1) in dataList[index]" :key="index1">
|
<view class="radius20 bacf pad-zy30 mar-x25 mar-zy40" @tap="goDetail(item1.id)" v-for="(item1,index1) in dataList[index]" :key="index1">
|
||||||
<view class="disjbac bbot pad30" style="margin: 0 -30rpx;">
|
<view class="disjbac bbot pad30" style="margin: 0 -30rpx;">
|
||||||
<view class="">订单号:2928392832</view>
|
<view class="">订单号:{{item1.coding}}</view>
|
||||||
<view class="" :style="{color: ['#f83030','#f83030','#f83030','#a0a0a0','#a0a0a0'][0]}">{{['已下单','制作中','已发货','已完成','已取消'][0]}}</view>
|
<view class="" :style="{color: ['#f83030','#f83030','#f83030','#a0a0a0','#a0a0a0'][0]}">{{item1.status_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjb borbot pad-sx30" v-for="(item2,index2) in 2" :key="index2">
|
<view class="disjb borbot pad-sx30" v-for="(item2,index2) in item1.skus" :key="index2">
|
||||||
<image class="mar-y30 flexs radius40" src="https://s6.jpg.cm/2022/05/06/Lx4T45.jpg" mode="" style="width: 210rpx;height: 210rpx;"></image>
|
<image class="mar-y30 flexs radius40" :src="item2.spu_cover" mode="" style="width: 210rpx;height: 210rpx;"></image>
|
||||||
<view class="width100 disjb fc" style="height: 210rpx;">
|
<view class="width100 disjb fc" style="height: 210rpx;">
|
||||||
<view class="clips2 fon24">{{item1.title}}</view>
|
<view class="clips2 fon24">{{item2.spu_name}}</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:{{item1.title}}</view>
|
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:{{item2.sku_unit}}</view>
|
||||||
<view class="disjbac ">
|
<view class="disjbac ">
|
||||||
<view class="textc bold">¥{{$toolAll.tools.changeNum(item1.price)}}</view>
|
<view class="textc bold">¥{{$toolAll.tools.changeNum(item2.price)}}</view>
|
||||||
<view class="fon24" style="color: #8c8c9b;">x1</view>
|
<view class="fon24" style="color: #8c8c9b;">x{{item2.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac tbot pad30" style="margin: 0 -30rpx;">
|
<view class="disjbac tbot pad30" style="margin: 0 -30rpx;">
|
||||||
<view class="bold" style="color: #f83030;">合计:¥2390.00</view>
|
<view class="bold" style="color: #f83030;">合计:¥{{item1.original_price}}</view>
|
||||||
<!-- <view class="btn" @tap.stop="cancleEv">取消订单</view> -->
|
<view class="btn" @tap.stop="cancleEv(item1.coding)" v-if="item1.status == 'order_placed'">取消订单</view>
|
||||||
<view class="btn csbtn" @tap.stop="buyEv">再次购买</view>
|
<view class="btn csbtn" @tap.stop="buyEv(index1)" v-if="item1.status == 'completed' || item1.status == 'cancel'">再次购买</view>
|
||||||
|
<view class="btn csbtn" @tap.stop="affirmEv(item1.id)" v-if="item1.status == 'shipped' || item1.status == 'arrived'">确认收货</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pad-sx40" v-if="total==dataList.length"><pitera textStr="—— 到底啦 ——"></pitera></view>
|
<view class="pad-sx40" v-if="total==totalAll"><pitera textStr="—— 到底啦 ——"></pitera></view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
|
@ -62,51 +64,24 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tagList:[
|
tagList:[
|
||||||
{title:'全部'},
|
{title:'全部',tag:'all'},
|
||||||
{title:'已下单'},
|
{title:'已下单',tag:'order_placed'},
|
||||||
{title:'制作中'},
|
{title:'制作中',tag:'makeing'},
|
||||||
{title:'已发货'},
|
{title:'已发货',tag:'shipped'},
|
||||||
{title:'已完成'},
|
{title:'已完成',tag:'completed'},
|
||||||
{title:'已取消'},
|
{title:'已取消',tag:'cancel'},
|
||||||
],
|
],
|
||||||
activeIndex:0,
|
activeIndex:0,
|
||||||
dataList:[
|
dataList:[[],[],[],[],[],[]],
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
flag:true,
|
flag:true,
|
||||||
swiperHeight:uni.getSystemInfoSync().windowHeight,
|
swiperHeight:uni.getSystemInfoSync().windowHeight,
|
||||||
newTop:uni.getSystemInfoSync().statusBarHeight + 50,
|
newTop:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||||
ifLoading:false,
|
ifLoading:false,
|
||||||
total:0
|
total:0,
|
||||||
|
totalAll:0,
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
tag: 'all'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
|
@ -117,34 +92,115 @@
|
||||||
if(op.index) {
|
if(op.index) {
|
||||||
this.activeIndex = op.index;
|
this.activeIndex = op.index;
|
||||||
}
|
}
|
||||||
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tabTap(e) {
|
tabTap(e) {
|
||||||
this.activeIndex = e;
|
this.activeIndex = e;
|
||||||
|
this.page = 1;
|
||||||
|
this.dataList = [[],[],[],[],[],[]];
|
||||||
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
this.activeIndex = e.detail.current;
|
this.activeIndex = e.detail.current;
|
||||||
},
|
},
|
||||||
scrollBottomEv(e) {
|
scrollBottomEv(e) {
|
||||||
this.ifLoading = true;
|
this.ifLoading = true;
|
||||||
this.total = 0;
|
|
||||||
|
let pageSize = Math.floor(this.totalAll/this.size)
|
||||||
|
if(this.page < pageSize){
|
||||||
|
this.page++;
|
||||||
|
this.getOrderList();
|
||||||
|
}else if(this.page == pageSize){
|
||||||
|
this.page++;
|
||||||
|
this.getOrderList();
|
||||||
|
this.total = this.totalAll;
|
||||||
|
}else{
|
||||||
|
this.ifLoading = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.ifLoading = false;
|
this.ifLoading = false;
|
||||||
this.total = this.dataList.length;
|
|
||||||
},2000)
|
},2000)
|
||||||
},
|
},
|
||||||
|
// 获取订单列表
|
||||||
|
getOrderList(){
|
||||||
|
let params = {
|
||||||
|
page: this.page,
|
||||||
|
size: this.size,
|
||||||
|
tag: this.tagList[this.activeIndex].tag
|
||||||
|
}
|
||||||
|
this.$requst.get('/api/user/order',params).then(res=>{
|
||||||
|
if(res.data.length!=0){
|
||||||
|
this.totalAll = res.data.total;
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
let dataObj = {
|
||||||
|
id: item.id, //id
|
||||||
|
coding: item.coding, //订单号
|
||||||
|
original_price: item.original_price, //总价
|
||||||
|
status: item.status, //订单状态英文
|
||||||
|
status_text: item.status_text, //订单状态中文
|
||||||
|
skus: item.skus //订单详情
|
||||||
|
}
|
||||||
|
this.dataList[this.activeIndex].push(dataObj)
|
||||||
|
})
|
||||||
|
console.log(this.dataList[this.activeIndex],'订单列表')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 去详情
|
// 去详情
|
||||||
goDetail(){
|
goDetail(id){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesB/order-detail/order-detail'
|
url:'/pagesB/order-detail/order-detail?id='+id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消订单
|
// 取消订单
|
||||||
cancleEv(){
|
cancleEv(coding){
|
||||||
console.log('取消订单');
|
let params = {
|
||||||
|
order_coding: coding //订单号
|
||||||
|
}
|
||||||
|
this.$requst.post('/api/order/cancel',params).then(res=>{
|
||||||
|
if(res.code==0) {
|
||||||
|
this.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
|
||||||
|
this.dataList = [[],[],[],[],[],[]];
|
||||||
|
this.page = 1;
|
||||||
|
this.getOrderList();
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 确认收货
|
||||||
|
affirmEv(id){
|
||||||
|
let params = {
|
||||||
|
order_id: id //订单号
|
||||||
|
}
|
||||||
|
this.$requst.post('/api/order/accepted',params).then(res=>{
|
||||||
|
if(res.code==0) {
|
||||||
|
this.$toolAll.tools.showToast('确认收货成功(*^▽^*)');
|
||||||
|
this.dataList = [[],[],[],[],[],[]];
|
||||||
|
this.page = 1;
|
||||||
|
this.getOrderList();
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 再次购买
|
// 再次购买
|
||||||
buyEv(){
|
buyEv(index){
|
||||||
|
let buyList = [];
|
||||||
|
let newArr = this.dataList[this.activeIndex][index];
|
||||||
|
newArr.skus.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
sku_coding: item.coding,
|
||||||
|
num: item.num
|
||||||
|
}
|
||||||
|
buyList.push(obj);
|
||||||
|
})
|
||||||
|
uni.setStorageSync('buyList',buyList);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesB/settlement/settlement'
|
||||||
|
})
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesB/settlement/settlement'
|
url:'/pagesB/settlement/settlement'
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,41 +6,41 @@
|
||||||
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="">订单编号</view>
|
<view class="">订单编号</view>
|
||||||
<view class="bold">2928392832</view>
|
<view class="bold">{{orderDetail.coding}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-sx30">
|
<view class="disjbac mar-sx30">
|
||||||
<view class="">下单时间</view>
|
<view class="">下单时间</view>
|
||||||
<view class="bold">2021-11-30 23:30</view>
|
<view class="bold">{{orderDetail.status_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="">订单状态</view>
|
<view class="">订单状态</view>
|
||||||
<view class="bold">已发货</view>
|
<view class="bold">{{orderDetail.coding}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
||||||
<view class="">订单信息</view>
|
<view class="">订单信息</view>
|
||||||
<view class="disjb bbot pad-sx30" v-for="(item,index) in 2" :key="index">
|
<view class="disjb bbot pad-sx30" v-for="(item,index) in orderDetail.skus" :key="index">
|
||||||
<image class="mar-y30 flexs radius30" src="https://s6.jpg.cm/2022/05/06/Lx4T45.jpg" mode="" style="width: 210rpx;height: 210rpx;"></image>
|
<image class="mar-y30 flexs radius30" src="https://s6.jpg.cm/2022/05/06/Lx4T45.jpg" mode="" style="width: 210rpx;height: 210rpx;"></image>
|
||||||
<view class="width100 disjb fc line-h40" style="height: 210rpx;">
|
<view class="width100 disjb fc line-h40" style="height: 210rpx;">
|
||||||
<view class="clips2 fon24">于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 </view>
|
<view class="clips2 fon24">{{item.spu_name}} </view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:盒</view>
|
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:{{item.sku_unit}}</view>
|
||||||
<view class="disjbac ">
|
<view class="disjbac ">
|
||||||
<view class="textc bold">¥{{$toolAll.tools.changeNum(2000)}}</view>
|
<view class="textc bold">¥{{item.price}}</view>
|
||||||
<view class="fon24" style="color: #8c8c9b;">x1</view>
|
<view class="fon24" style="color: #8c8c9b;">x{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disje pad-s30">总计:<text class="fon36 bold textc" style="margin-top: -6rpx;">¥4000</text></view>
|
<view class="disje pad-s30">总计:<text class="fon36 bold textc" style="margin-top: -6rpx;">¥{{orderDetail.original_price}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
|
||||||
<view class="mar-x30">联系信息</view>
|
<view class="mar-x30">联系信息</view>
|
||||||
<view class="bold">徐卫 546546515315</view>
|
<view class="bold">{{orderDetail.contacts}} {{orderDetail.phone}}</view>
|
||||||
<view class="fon24">
|
<view class="fon24">
|
||||||
<view class="mar-sx10" style="color: #8c8c9b;">四川省成都市双店路奥园广场3期1419号</view>
|
<view class="mar-sx10" style="color: #8c8c9b;">{{orderDetail.address}}</view>
|
||||||
<view class="" style="color: #8c8c9b;">婚期:2022-12-23</view>
|
<view class="" style="color: #8c8c9b;">婚期:{{orderDetail.wedding_date}}</view>
|
||||||
<view class="mar-s10" style="color: #8c8c9b;">希望到货时间:2022-12-21</view>
|
<view class="mar-s10" style="color: #8c8c9b;">希望到货时间:{{orderDetail.expected_delivery_date}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="posixzy bacf pad-sx20 pad-zy50" style="box-shadow: 0rpx -2rpx 10rpx rgba(0, 0, 0, 0.06);">
|
<view class="posixzy bacf pad-sx20 pad-zy50" style="box-shadow: 0rpx -2rpx 10rpx rgba(0, 0, 0, 0.06);">
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
orderDetail: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
|
@ -72,9 +72,22 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDetail(id){
|
getDetail(id){
|
||||||
this.$requst.post('/api/spu/detail',{id}).then(res=>{
|
this.$requst.post('/api/user/order-detail',{id}).then(res=>{
|
||||||
if(res.code==1) {
|
if(res.code==0) {
|
||||||
|
let dataObj = {
|
||||||
|
coding: res.data.coding, //订单号
|
||||||
|
created_at: res.data.created_at, //下单时间
|
||||||
|
status_text: res.data.status_text, //订单状态
|
||||||
|
expected_delivery_date: res.data.expected_delivery_date, //期望到货时间
|
||||||
|
wedding_date: res.data.wedding_date, //婚期
|
||||||
|
original_price: res.data.original_price, //总价
|
||||||
|
contacts: res.data.contacts, //收件人姓名
|
||||||
|
address: res.data.address, //收件地址
|
||||||
|
phone: res.data.phone, //联系电话
|
||||||
|
skus: res.data.skus //订单详情列表
|
||||||
|
}
|
||||||
|
this.orderDetail = dataObj;
|
||||||
|
console.log(this.orderDetail,'订单详情2')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
console.log(uni.getStorageSync('buyList'),'缓存数组')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 提交
|
// 提交
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
this.getDetail(op.id);
|
this.getDetail(op.id);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 查询详情事件
|
// 查询详情事件
|
||||||
getDetail(id){
|
getDetail(id){
|
||||||
this.$requst.post('/api/spu/detail',{id}).then(res=>{
|
this.$requst.post('/api/spu/detail',{id}).then(res=>{
|
||||||
|
@ -81,6 +82,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 立即购买
|
// 立即购买
|
||||||
buyEv(id){
|
buyEv(id){
|
||||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
||||||
|
@ -94,6 +96,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加入购物车
|
// 加入购物车
|
||||||
addCartEv(id) {
|
addCartEv(id) {
|
||||||
if(this.$toolAll.tools.judgeAuth()) {
|
if(this.$toolAll.tools.judgeAuth()) {
|
||||||
|
|
Loading…
Reference in New Issue