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

update

parent e9999eb7
<template>
<view class="catstyle11" style="height: 100%;">
<view class="left-slider">
<sidebar
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
></sidebar>
</view>
<view class="left-slider"><sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar></view>
<view class="right-slider">
<view
class="adbox"
v-if="d[tid].advert_pic && d[tid].advert_pic.length>0"
@click="clickHandler(d[tid].advert_url)"
>
<view class="adbox" v-if="d[tid].advert_pic && d[tid].advert_pic.length > 0" @click="clickHandler(d[tid].advert_url)">
<image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
</view>
<view class="second-box">
......@@ -24,63 +11,52 @@
class="item"
:style="{
'border-color': stid == i ? mainColor : '#999',
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>
>
{{ x.Name }}
</view>
</view>
</view>
<view :style="{'height':scrollHeight}">
<scroll-view
:scroll-y="true"
@scrolltolower="lower"
:enable-back-to-top="true"
:enable-flex="true"
:style="{ height: '100%', padding: '0 0 0 10px' }"
>
<view :style="{ height: scrollHeight }">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%', padding: '0 0 0 10px' }">
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
</view>
<view class="good-img"><image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /></view>
<view class="good-info">
<view class="good-name">{{ cx.name }}</view>
<view class="goodprice">
<view class="left">
<view v-if="cx.vip_price">
<view v-if="cx.level_price">
<van-tag plain color="#f39800">会员价</van-tag>
<span class="vip">{{cx.level_price}}</span>
<span class="vip">{{ cx.level_price }}</span>
</view>
<view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view>
<view class="sell">{{ cx.price }}</view>
</view>
<view class="right">
<u-icon name="cart-circle-o" size="44" :color="mainColor" />
<view class="sell">{{ cx.sales }}</view>
</view>
<view @click.stop="showSkuHandler(cx)" class="right"><u-icon name="cart-circle-o" size="44" :color="mainColor" /></view>
</view>
</view>
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
>没有更多商品了</u-divider>
<u-divider contentPosition="center" v-if="isover" :margin-top="20" :margin-bottom="20">没有更多商品了</u-divider>
</scroll-view>
</view>
</view>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
</view>
</template>
<script>
import sidebar from "../sidebar/index";
import sidebar from '../sidebar/index';
import goodSku from '../goods/goodsku';
export default {
props: ["d", "h"],
props: ['d', 'h'],
data() {
return {
mainColor: "",
mainColor: '',
page: 1,
page_count: 1,
mh: 0,
......@@ -90,43 +66,51 @@ export default {
tid: 0,
stid: 0,
active: 0,
scrollHeight: "calc(100% - 33px)",
msg:{
scrollHeight: 'calc(100% - 33px)',
msg: {
pageIndex: 1,
pageSize:14,
Name:'',
GoodsType:0,
CategoryIds:'',
OrderBy:1,
UserId:0,
pageSize: 14,
Name: '',
GoodsType: 0,
CategoryIds: '',
OrderBy: 1,
UserId: 0
},
CategoryIdsList:[],
CategoryIds1:'',
CategoryIds2:'',
CategoryIdsList: [],
CategoryIds1: '',
CategoryIds2: '',
sku: {},
showSku: false
};
},
components: {
sidebar
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))";
this.scrollHeight += ' - (100vw - 105px / 3.37))';
} else {
this.scrollHeight += ")";
this.scrollHeight += ')';
}
},
mounted() {
this.CategoryIdsList=[];
this.CategoryIds1=this.d[0].Id;
this.CategoryIds2=this.d[0].ChildList[0].Id;
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.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;
......@@ -134,20 +118,20 @@ export default {
this.init();
},
clickSecondHandler(i) {
let tid=this.tid;
this.CategoryIds2=this.d[tid].ChildList[i].Id;
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 });
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.CategoryIdsList = [];
this.CategoryIdsList.push(this.CategoryIds1, this.CategoryIds2);
this.msg.CategoryIds = this.CategoryIdsList.join(',');
this.isover = false;
this.loading = true;
this.request2(
......@@ -157,14 +141,13 @@ export default {
},
res => {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
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) {
if (this.page_count == 1 || this.page_count == 0) {
this.isover = true;
}
}
uni.hideNavigationBarLoading();
......
......@@ -8,8 +8,8 @@
<view style="padding: 10px 0; background: #fff;">
<u-tabs
:list="list"
:is-scroll="false"
:current="current"
name="Name"
@change="change"
:active-color="mainColor"
bg-color="#FFF"
......@@ -221,15 +221,7 @@ export default {
return {
pageTitle: "我的订单",
current: 0,
list: [
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待收货" },
{ name: "待评价" },
// { name: "已完成" },
// { name: "已取消" },
],
list: [],
mainColor: "",
contentHeight: 0,
page: 1,
......@@ -252,6 +244,17 @@ export default {
padding: "0 30rpx",
},
template_message: [],
msg:{
pageIndex:1,
pageSize:15,
OrderId:0,
OrderType:0,
DeliveryMethod:0,
StartTime:'',
EndTime:'',
OrderStatus:0,
OrderNo:'',
},
};
},
created() {
......@@ -280,8 +283,30 @@ export default {
this.current = option.status || -1;
this.loading = true;
this.init();
this.getOrderStatus();
},
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) {
uni.navigateTo({
url: "/pages/order/order-detail?id=" + id,
......@@ -316,7 +341,8 @@ export default {
},
change(index) {
this.current = index;
this.page = 1;
this.msg.OrderStatus=this.list[index].Id;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
......@@ -324,30 +350,47 @@ export default {
init() {
this.isover = false;
let h = this.apiheader();
this.request(
this.request2(
{
url: "",
header: h,
data: {
r: "api/order/list",
status: this.current,
page: this.page,
},
url: '/api/AppletOrder/GetAppletGoodsMyOrderPageList',
data: this.msg
},
(res) => {
res => {
uni.hideNavigationBarLoading();
if(res.resultCode==1){
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;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.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) {
if (this.page < this.page_count) {
this.page++;
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.init();
} else {
this.isover = 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