Commit 70318f23 authored by 黄媛媛's avatar 黄媛媛

update

parent e9999eb7
<template> <template>
<view class="catstyle11" style="height: 100%;"> <view class="catstyle11" style="height: 100%;">
<view class="left-slider"> <view class="left-slider"><sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar></view>
<sidebar <view class="right-slider">
:active="tid" <view class="adbox" v-if="d[tid].advert_pic && d[tid].advert_pic.length > 0" @click="clickHandler(d[tid].advert_url)">
name="Name" <image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
:active-color="mainColor" </view>
:border="false" <view class="second-box">
:list="d" <view class="second">
@change="changeHandler" <view
></sidebar> class="item"
</view> :style="{
<view class="right-slider"> 'border-color': stid == i ? mainColor : '#999',
<view color: stid == i ? mainColor : '#999'
class="adbox" }"
v-if="d[tid].advert_pic && d[tid].advert_pic.length>0" v-for="(x, i) in d[tid].ChildList"
@click="clickHandler(d[tid].advert_url)" :key="i"
> @click="clickSecondHandler(i)"
<image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" /> >
</view> {{ x.Name }}
<view class="second-box"> </view>
<view class="second"> </view>
<view </view>
class="item"
:style="{
'border-color': stid == i ? mainColor : '#999',
color: stid == i ? mainColor : '#999',
}"
v-for="(x, i) in d[tid].ChildList"
:key="i"
@click="clickSecondHandler(i)"
>{{ x.Name }}</view>
</view>
</view>
<view :style="{'height':scrollHeight}"> <view :style="{ height: scrollHeight }">
<scroll-view <scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%', padding: '0 0 0 10px' }">
:scroll-y="true" <view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
@scrolltolower="lower" <view class="good-img"><image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /></view>
:enable-back-to-top="true" <view class="good-info">
:enable-flex="true" <view class="good-name">{{ cx.name }}</view>
:style="{ height: '100%', padding: '0 0 0 10px' }" <view class="goodprice">
> <view class="left">
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)"> <view v-if="cx.level_price">
<view class="good-img"> <van-tag plain color="#f39800">会员价</van-tag>
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /> <span class="vip">{{ cx.level_price }}</span>
</view> </view>
<view class="good-info"> <view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view>
<view class="good-name">{{ cx.name }}</view> <view class="sell">{{ cx.sales }}</view>
<view class="goodprice"> </view>
<view class="left"> <view @click.stop="showSkuHandler(cx)" class="right"><u-icon name="cart-circle-o" size="44" :color="mainColor" /></view>
<view v-if="cx.vip_price"> </view>
<van-tag plain color="#f39800">会员价</van-tag> </view>
<span class="vip">{{cx.level_price}}</span> </view>
</view> <u-divider contentPosition="center" v-if="isover" :margin-top="20" :margin-bottom="20">没有更多商品了</u-divider>
<view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view> </scroll-view>
<view class="sell">{{ cx.price }}</view> </view>
</view> </view>
<view class="right"> <good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
<u-icon name="cart-circle-o" size="44" :color="mainColor" /> </view>
</view>
</view>
</view>
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
>没有更多商品了</u-divider>
</scroll-view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import sidebar from "../sidebar/index"; import sidebar from '../sidebar/index';
import goodSku from '../goods/goodsku';
export default { export default {
props: ["d", "h"], props: ['d', 'h'],
data() { data() {
return { return {
mainColor: "", mainColor: '',
page: 1, page: 1,
page_count: 1, page_count: 1,
mh: 0, mh: 0,
g: [], g: [],
isover: false, isover: false,
loading: false, loading: false,
tid: 0, tid: 0,
stid: 0, stid: 0,
active: 0, active: 0,
scrollHeight: "calc(100% - 33px)", scrollHeight: 'calc(100% - 33px)',
msg:{ msg: {
pageIndex: 1, pageIndex: 1,
pageSize:14, pageSize: 14,
Name:'', Name: '',
GoodsType:0, GoodsType: 0,
CategoryIds:'', CategoryIds: '',
OrderBy:1, OrderBy: 1,
UserId:0, UserId: 0
},
CategoryIdsList:[],
CategoryIds1:'',
CategoryIds2:'',
};
},
components: {
sidebar
},
created() {
this.mainColor = this.$uiConfig.mainColor;
if (this.d[this.tid].advert_pic && this.d[this.tid].advert_pic.length > 0) {
this.scrollHeight += " - (100vw - 105px / 3.37))";
} else {
this.scrollHeight += ")";
}
},
mounted() {
this.CategoryIdsList=[];
this.CategoryIds1=this.d[0].Id;
this.CategoryIds2=this.d[0].ChildList[0].Id;
this.init();
},
methods: {
changeHandler(i) {
this.active=i;
this.CategoryIds1=this.d[i].Id;
this.CategoryIds2=this.d[i].ChildList[0].Id;
this.msg.page = 1;
this.tid = i;
this.stid = 0;
this.g = [];
this.init();
},
clickSecondHandler(i) {
let tid=this.tid;
this.CategoryIds2=this.d[tid].ChildList[i].Id;
this.stid = i;
this.msg.page = 1;
this.g = [];
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
},
init() {
this.CategoryIdsList=[];
this.CategoryIdsList.push(this.CategoryIds1,this.CategoryIds2);
this.msg.CategoryIds=this.CategoryIdsList.join(',');
this.isover = false;
this.loading = true;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsPageListForZY',
data: this.msg
}, },
res => { CategoryIdsList: [],
this.loading = false; CategoryIds1: '',
console.log("resggg",res); CategoryIds2: '',
if(res.resultCode==1){ sku: {},
this.g = this.g.concat(res.data.pageData); showSku: false
this.page_count = res.data.pageCount; };
if (this.page_count == 1 || this.page_count==0) { },
this.isover = true; components: {
sidebar,goodSku
},
created() {
this.mainColor = this.$uiConfig.mainColor;
if (this.d[this.tid].advert_pic && this.d[this.tid].advert_pic.length > 0) {
this.scrollHeight += ' - (100vw - 105px / 3.37))';
} else {
this.scrollHeight += ')';
}
},
mounted() {
this.CategoryIdsList = [];
this.CategoryIds1 = this.d[0].Id;
this.CategoryIds2 = this.d[0].ChildList[0].Id;
this.init();
},
methods: {
// 购物车
showSkuHandler(g) {
console.log('g', g);
this.sku = g;
this.showSku = true;
},
changeHandler(i) {
this.active = i;
this.CategoryIds1 = this.d[i].Id;
this.CategoryIds2 = this.d[i].ChildList[0].Id;
this.msg.page = 1;
this.tid = i;
this.stid = 0;
this.g = [];
this.init();
},
clickSecondHandler(i) {
let tid = this.tid;
this.CategoryIds2 = this.d[tid].ChildList[i].Id;
this.stid = i;
this.msg.page = 1;
this.g = [];
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.Id });
},
init() {
this.CategoryIdsList = [];
this.CategoryIdsList.push(this.CategoryIds1, this.CategoryIds2);
this.msg.CategoryIds = this.CategoryIdsList.join(',');
this.isover = false;
this.loading = true;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsPageListForZY',
data: this.msg
},
res => {
this.loading = false;
console.log('resggg', res);
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count == 0) {
this.isover = true;
}
} }
uni.hideNavigationBarLoading();
}
);
// this.isover = false;
// this.loading = true;
// this.request(
// {
// url: "",
// data: {
// r: "api/default/goods-list",
// page: this.page,
// cat_id: this.d[this.tid].child[this.stid].id
// }
// },
// res => {
// this.g = this.g.concat(res.data.list);
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// this.loading = false;
// }
// );
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
if (!this.loading) {
this.msg.pageIndex++;
this.init();
} }
} else {
uni.hideNavigationBarLoading(); this.isover = true;
} }
); }
// this.isover = false; }
// this.loading = true;
// this.request(
// {
// url: "",
// data: {
// r: "api/default/goods-list",
// page: this.page,
// cat_id: this.d[this.tid].child[this.stid].id
// }
// },
// res => {
// this.g = this.g.concat(res.data.list);
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// this.loading = false;
// }
// );
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
if (!this.loading) {
this.msg.pageIndex++;
this.init();
}
} else {
this.isover = true;
}
}
}
}; };
</script> </script>
<style> <style>
.catstyle11 { .catstyle11 {
display: flex; display: flex;
} }
.catstyle11 .left-slider { .catstyle11 .left-slider {
width: 85px; width: 85px;
height: 100%; height: 100%;
background: #f5f5f5; background: #f5f5f5;
} }
.catstyle11 .right-slider { .catstyle11 .right-slider {
padding: 10px 0; padding: 10px 0;
height: 100%; height: 100%;
width: 1px; width: 1px;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
} }
.catstyle11 .good { .catstyle11 .good {
border-bottom: 1rpx solid #f1f1f1; border-bottom: 1rpx solid #f1f1f1;
display: flex; display: flex;
padding: 10px 0; padding: 10px 0;
margin-right: 16px; margin-right: 16px;
} }
.catstyle11 .good .good-img { .catstyle11 .good .good-img {
width: 77px; width: 77px;
height: 77px; height: 77px;
} }
.catstyle11 .good .good-info .good-name { .catstyle11 .good .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-bottom: 3px; margin-bottom: 3px;
font-size: 14px; font-size: 14px;
height: 36px; height: 36px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.catstyle11 .good .good-info { .catstyle11 .good .good-info {
margin-left: 5px; margin-left: 5px;
width: 1px; width: 1px;
flex: 1; flex: 1;
min-height: 70px; min-height: 70px;
} }
.catstyle11 .good .good-info .goodprice { .catstyle11 .good .good-info .goodprice {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
} }
.catstyle11 .good .good-info .left { .catstyle11 .good .good-info .left {
flex: 1; flex: 1;
width: 1px; width: 1px;
} }
.catstyle11 .good .good-info .right { .catstyle11 .good .good-info .right {
width: 30px; width: 30px;
height: 30px; height: 30px;
display: flex; display: flex;
justify-items: right; justify-items: right;
align-items: flex-end; align-items: flex-end;
} }
.catstyle11 .good .good-info .left .vip { .catstyle11 .good .good-info .left .vip {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
color: #f39800; color: #f39800;
} }
.catstyle11 .good .good-info .goodprice .left .price { .catstyle11 .good .good-info .goodprice .left .price {
font-size: 16px; font-size: 16px;
} }
.catstyle11 .good .good-info .goodprice .left .sell { .catstyle11 .good .good-info .goodprice .left .sell {
font-size: 12px; font-size: 12px;
color: gray; color: gray;
} }
.catstyle11 .right-slider .adbox { .catstyle11 .right-slider .adbox {
width: 100%; width: 100%;
height: calc(100vw - 105px / 3.37); height: calc(100vw - 105px / 3.37);
} }
.catstyle11 .second-box { .catstyle11 .second-box {
width: 100%; width: 100%;
overflow-x: auto; overflow-x: auto;
} }
.catstyle11 .second { .catstyle11 .second {
padding: 10px 0; padding: 10px 0;
margin: 0 10px; margin: 0 10px;
white-space: nowrap; white-space: nowrap;
background: #fff; background: #fff;
overflow-x: auto; overflow-x: auto;
} }
.catstyle11 .second .item { .catstyle11 .second .item {
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
padding: 5px 10px; padding: 5px 10px;
height: 23px; height: 23px;
line-height: 23rpx; line-height: 23rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 23px; border-radius: 23px;
border: 1px solid transparent; border: 1px solid transparent;
font-size: 12px; font-size: 12px;
} }
</style> </style>
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<view style="padding: 10px 0; background: #fff;"> <view style="padding: 10px 0; background: #fff;">
<u-tabs <u-tabs
:list="list" :list="list"
:is-scroll="false"
:current="current" :current="current"
name="Name"
@change="change" @change="change"
:active-color="mainColor" :active-color="mainColor"
bg-color="#FFF" bg-color="#FFF"
...@@ -221,15 +221,7 @@ export default { ...@@ -221,15 +221,7 @@ export default {
return { return {
pageTitle: "我的订单", pageTitle: "我的订单",
current: 0, current: 0,
list: [ list: [],
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待收货" },
{ name: "待评价" },
// { name: "已完成" },
// { name: "已取消" },
],
mainColor: "", mainColor: "",
contentHeight: 0, contentHeight: 0,
page: 1, page: 1,
...@@ -252,6 +244,17 @@ export default { ...@@ -252,6 +244,17 @@ export default {
padding: "0 30rpx", padding: "0 30rpx",
}, },
template_message: [], template_message: [],
msg:{
pageIndex:1,
pageSize:15,
OrderId:0,
OrderType:0,
DeliveryMethod:0,
StartTime:'',
EndTime:'',
OrderStatus:0,
OrderNo:'',
},
}; };
}, },
created() { created() {
...@@ -280,8 +283,30 @@ export default { ...@@ -280,8 +283,30 @@ export default {
this.current = option.status || -1; this.current = option.status || -1;
this.loading = true; this.loading = true;
this.init(); this.init();
this.getOrderStatus();
}, },
methods: { methods: {
getOrderStatus() {
this.request2(
{
url: '/api/order/GetOrderStatusEnumList',
data: {}
},
res => {
uni.hideNavigationBarLoading();
if(res.resultCode==1){
this.isloading = false;
this.list = res.data;
let obj={
Name:'全部',
Id:0,
}
this.list.unshift(obj)
console.log("this.list",this.list)
}
}
);
},
redirectToDetail(id) { redirectToDetail(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/order/order-detail?id=" + id, url: "/pages/order/order-detail?id=" + id,
...@@ -315,43 +340,61 @@ export default { ...@@ -315,43 +340,61 @@ export default {
}); });
}, },
change(index) { change(index) {
this.current = index; this.current = index;
this.page = 1; this.msg.OrderStatus=this.list[index].Id;
this.g = []; this.msg.pageIndex = 1;
this.loading = true; this.g = [];
this.init(); this.loading = true;
this.init();
}, },
init() { init() {
this.isover = false; this.isover = false;
let h = this.apiheader(); let h = this.apiheader();
this.request( this.request2(
{ {
url: "", url: '/api/AppletOrder/GetAppletGoodsMyOrderPageList',
header: h, data: this.msg
data: { },
r: "api/order/list", res => {
status: this.current, uni.hideNavigationBarLoading();
page: this.page, if(res.resultCode==1){
}, this.loading = false;
}, this.g = this.g.concat(res.data.pageData);
(res) => { this.page_count = res.data.page_count;
this.loading = false; if (this.page_count == 1) {
this.g = this.g.concat(res.data.list); this.isover = true;
this.template_message = res.data.template_message; }
this.page_count = res.data.pagination.page_count; }
if (this.page_count == 1) { }
this.isover = true; );
} // this.request(
} // {
); // url: "",
// header: h,
// data: {
// r: "api/order/list",
// status: this.current,
// page: this.page,
// },
// },
// (res) => {
// this.loading = false;
// this.g = this.g.concat(res.data.list);
// this.template_message = res.data.template_message;
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// }
// );
}, },
lower(e) { lower(e) {
if (this.page < this.page_count) { if (this.msg.pageIndex < this.page_count) {
this.page++; this.msg.pageIndex++;
this.init(); this.init();
} else { } else {
this.isover = true; this.isover = true;
} }
}, },
cancel(e, index) { cancel(e, index) {
this.showModal = true; this.showModal = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment