Commit 2a94633b authored by 黄媛媛's avatar 黄媛媛

update

parent 3d831121
...@@ -4,11 +4,10 @@ ...@@ -4,11 +4,10 @@
<u-grid-item <u-grid-item
v-for="(c, i) in d" v-for="(c, i) in d"
:key="i" :key="i"
@click="clickHandler(c.page_url)" @click="clickHandler(c)"
> >
<image <image
:src="getIconLink(c.IconPath)" :src="getIconLink(c.IconPath)"
mode="widthFix"
style="width: 80rpx; height: 80rpx;" style="width: 80rpx; height: 80rpx;"
/> />
<text class="grid-text">{{ c.Name }}</text> <text class="grid-text">{{ c.Name }}</text>
...@@ -26,10 +25,8 @@ export default { ...@@ -26,10 +25,8 @@ export default {
}; };
}, },
methods: { methods: {
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id });
url: url,
});
}, },
}, },
}; };
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<div <div
class="adbox" class="adbox"
v-if="d[tid].advert_pic" v-if="d[tid].advert_pic"
@click="clickHandler(d[tid].advert_url)"
> >
<image <image
mode="aspectFit" mode="aspectFit"
...@@ -23,13 +22,13 @@ ...@@ -23,13 +22,13 @@
/> />
</div> </div>
<div v-for="(c, i) in sd" :key="i"> <div v-for="(c, i) in sd" :key="i">
<div class="sec-title">{{ c.Name }}</div> <div @click="clickHandler(c)" class="sec-title">{{ c.Name }}</div>
<u-grid :column-num="3" :border="false"> <u-grid :column-num="3" :border="false">
<template v-if="c.ChildList && c.ChildList.length > 0"> <template v-if="c.ChildList && c.ChildList.length > 0">
<u-grid-item <u-grid-item
v-for="(cc, ci) in c.ChildList" v-for="(cc, ci) in c.ChildList"
:key="ci" :key="ci"
@click="clickHandler(c.page_url)"
> >
<image <image
:src="c.IconPath" :src="c.IconPath"
...@@ -81,8 +80,11 @@ export default { ...@@ -81,8 +80,11 @@ export default {
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(e) { clickHandler(item) {
uni.navigateTo({ url: e }); let Id1=this.d[this.tid].Id;
let Id2=item.Id;
let CategoryIds=Id1+','+Id2;
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
} }
}, },
}; };
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
:enable-flex="true" :enable-flex="true"
:style="{ height: '100%', padding: '0 0 0 10px' }" :style="{ height: '100%', padding: '0 0 0 10px' }"
> >
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx.page_url)"> <view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img"> <view class="good-img">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /> <image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
</view> </view>
...@@ -141,8 +141,8 @@ export default { ...@@ -141,8 +141,8 @@ export default {
this.g = []; this.g = [];
this.init(); this.init();
}, },
clickHandler(e) { clickHandler(item) {
uni.navigateTo({ url: e }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
}, },
init() { init() {
this.CategoryIdsList=[]; this.CategoryIdsList=[];
......
<template> <template>
<view class="catsstyle2"> <view class="catsstyle2">
<view class="item" v-for="(x, index) in d" :key="index" @click="goUrl" :data-url='x.page_url'> <view class="item" v-for="(x, index) in d" :key="index" @click="clickHandler(x)" :data-url='x.page_url'>
<view class="left">{{x.Name}}</view> <view class="left">{{x.Name}}</view>
<view class="right"> <view class="right">
<image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" /> <image :src="getIconLink(x.IconPath)" style="width:100%;height:100%" mode="aspectFit" />
...@@ -15,7 +15,10 @@ export default { ...@@ -15,7 +15,10 @@ export default {
methods: { methods: {
goUrl(e){ goUrl(e){
uni.navigateTo({url:e.mp.currentTarget.dataset.url}) uni.navigateTo({url:e.mp.currentTarget.dataset.url})
} },
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+item.Id });
},
}, },
}; };
</script> </script>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
> >
<u-row gutter="20"> <u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci"> <u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx.page_url)"> <view class="good" @click="clickHandler(cx)">
<view class="good-img"> <view class="good-img">
<image <image
mode="aspectFit" mode="aspectFit"
...@@ -93,8 +93,8 @@ export default { ...@@ -93,8 +93,8 @@ export default {
this.init(); this.init();
this.active=i this.active=i
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ url: url }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
}, },
init() { init() {
this.isover = false; this.isover = false;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
class="good" class="good"
v-for="(cx, ci) in g" v-for="(cx, ci) in g"
:key="ci" :key="ci"
@click="clickHandler(cx.page_url)" @click="clickHandler(cx)"
> >
<div class="good-img"> <div class="good-img">
<image <image
...@@ -115,8 +115,8 @@ export default { ...@@ -115,8 +115,8 @@ export default {
this.g = []; this.g = [];
this.init(); this.init();
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ url: url }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
}, },
init() { init() {
this.isover = false; this.isover = false;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<div <div
class="adbox" class="adbox"
v-if="d[tid].advert_pic" v-if="d[tid].advert_pic"
@click="clickHandler(d[tid].advert_url)"
> >
<image <image
mode="aspectFit" mode="aspectFit"
...@@ -24,10 +23,10 @@ ...@@ -24,10 +23,10 @@
/> />
</div> </div>
<div <div
class="item" class="item gg"
v-for="(x, index) in sd" v-for="(x, index) in sd"
:key="index" :key="index"
@click="clickHandler(x.page_url)" @click="clickHandler(x)"
> >
<div class="left">{{ x.Name }}</div> <div class="left">{{ x.Name }}</div>
<div class="right"> <div class="right">
...@@ -71,8 +70,11 @@ export default { ...@@ -71,8 +70,11 @@ export default {
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ url: url }); let Id1=this.d[this.tid].Id;
let Id2=item.Id;
let CategoryIds=Id1+','+Id2;
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}, },
}, },
}; };
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<u-grid-item <u-grid-item
v-for="(c, i) in sd" v-for="(c, i) in sd"
:key="i" :key="i"
@click="clickHandler(c.page_url)" @click="clickHandler(c)"
> >
<image <image
class="imgclass" class="imgclass"
...@@ -70,8 +70,11 @@ export default { ...@@ -70,8 +70,11 @@ export default {
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ url: url }); let Id1=this.d[this.tid].Id;
let Id2=item.Id;
let CategoryIds=Id1+','+Id2;
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}, },
}, },
}; };
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
> >
<u-row gutter="10"> <u-row gutter="10">
<u-col span="6" v-for="(cx, ci) in g" :key="ci"> <u-col span="6" v-for="(cx, ci) in g" :key="ci">
<div class="good" @click="clickHandler(cx.page_url)"> <div class="good" @click="clickHandler(cx)">
<div class="good-img"> <div class="good-img">
<image <image
mode="aspectFit" mode="aspectFit"
...@@ -129,8 +129,8 @@ export default { ...@@ -129,8 +129,8 @@ export default {
this.g = []; this.g = [];
this.init(); this.init();
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ url: url }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
}, },
computSecondHeight() { computSecondHeight() {
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
:enable-flex="true" :enable-flex="true"
:style="{ height: '100%', padding: '0 0 0 10px' }" :style="{ height: '100%', padding: '0 0 0 10px' }"
> >
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(url)"> <view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img"> <view class="good-img">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /> <image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
</view> </view>
...@@ -141,8 +141,8 @@ export default { ...@@ -141,8 +141,8 @@ export default {
this.g = []; this.g = [];
this.init(); this.init();
}, },
clickHandler(e) { clickHandler(item) {
uni.navigateTo({ url: e }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
}, },
init() { init() {
this.CategoryIdsList=[]; this.CategoryIdsList=[];
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<view <view
class="adbox" class="adbox"
v-if="d[tid].advert_pic" v-if="d[tid].advert_pic"
@click="clickHandler(d[tid].advert_url)"
> >
<image <image
mode="aspectFit" mode="aspectFit"
...@@ -23,13 +22,14 @@ ...@@ -23,13 +22,14 @@
/> />
</view> </view>
<view v-for="(x, index) in sd" :key="index"> <view v-for="(x, index) in sd" :key="index">
<view class="sec-title">{{ x.Name }}</view> <view @click="clickHandler(x)" class="sec-title">{{ x.Name }}
</view>
<template v-if="x.ChildList && x.ChildList.length > 0"> <template v-if="x.ChildList && x.ChildList.length > 0">
<view <view
class="item" class="item"
v-for="(cx, ci) in x.ChildList" v-for="(cx, ci) in x.ChildList"
:key="ci" :key="ci"
@click="clickHandler"
:data-url="cx.page_url" :data-url="cx.page_url"
> >
<view class="left">{{ c.Name }}</view> <view class="left">{{ c.Name }}</view>
...@@ -82,8 +82,11 @@ export default { ...@@ -82,8 +82,11 @@ export default {
this.page = 1; this.page = 1;
this.sd = this.d[this.tid].ChildList; this.sd = this.d[this.tid].ChildList;
}, },
clickHandler(e) { clickHandler(item) {
uni.navigateTo({ url: e }); let Id1=this.d[this.tid].Id;
let Id2=item.Id;
let CategoryIds=Id1+','+Id2;
uni.navigateTo({ url: '/pages/goods/list?CategoryIds='+CategoryIds });
}, },
}, },
}; };
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<view class="u-good-list"> <view class="u-good-list">
<u-row gutter="20"> <u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci"> <u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx.page_url)"> <view class="good" @click="clickHandler(cx)">
<view class="good-img"> <view class="good-img">
<image <image
mode="aspectFill" mode="aspectFill"
:src="cx.cover_pic" :src="cx.CoverImage"
style="width: 100%; height: 100%;" style="width: 100%; height: 100%;"
/> />
</view> </view>
<view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.name }}</view> <view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.Name }}</view>
<view class="good-info"> <view class="good-info">
<view class="price" :style="{ color: mainColor }">{{ <view class="price" :style="{ color: mainColor }">
cx.price_content {{cx.SellingPrice}}</view>
}}</view> <!-- v-if="setting.is_show_sales_num=='1'" -->
<view class="sell" v-if="setting.is_show_sales_num=='1'">{{ cx.sales }}</view> <view class="sell">已售{{ cx.SalesNum }}</view>
<view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)"> <view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" /> <u-icon name="cart-o" size="40" :color="mainColor" />
</view> </view>
...@@ -67,10 +67,9 @@ export default { ...@@ -67,10 +67,9 @@ export default {
initConfig() { initConfig() {
this.setting = uni.getStorageSync("basedata").mall.setting this.setting = uni.getStorageSync("basedata").mall.setting
}, },
clickHandler(url) { clickHandler(item) {
uni.navigateTo({ console.log("GoodsId",item)
url: url, uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
});
}, },
showSkuHandler(g) { showSkuHandler(g) {
this.sku = g; this.sku = g;
......
...@@ -3,33 +3,33 @@ ...@@ -3,33 +3,33 @@
<view class="sortbox"> <view class="sortbox">
<view <view
class="item" class="item"
@click="change(1, -1)" @click="change(0)"
:style="{ color: sortStatus == 1 ? mainColor : '#222' }" :style="{ color: msg.OrderBy == 0 ? mainColor : '#222' }"
>综合</view >综合</view
> >
<view <view
class="item" class="item"
@click="change(2, -1)" @click="change(1)"
:style="{ color: sortStatus == 2 ? mainColor : '#222' }" :style="{ color: msg.OrderBy == 1 ? mainColor : '#222' }"
>最新</view >最新</view
> >
<view <view
class="item" class="item"
:style="{ color: sortStatus == 3 ? mainColor : '#222' }" :style="{ color: msg.OrderBy == 2 || msg.OrderBy==3 ? mainColor : '#222' }"
style="display: flex; justify-content: center;" style="display: flex; justify-content: center;"
@click="change(3, sortStatus != 3 ? 1 : sortType == 1 ? 2 : 1)" @click="change(2,1)"
> >
<text>价格</text> <text>价格</text>
<u-icon <u-icon
:name="sortShowType == 1 ? 'ascending' : 'descending'" :name="msg.OrderBy == 2 ? 'descending' : 'ascending'"
size="36" size="36"
:color="sortStatus == 3 ? mainColor : '#222'" :color="msg.OrderBy == 2 || msg.OrderBy==3 ? mainColor : '#222'"
></u-icon> ></u-icon>
</view> </view>
<view <view
class="item" class="item"
@click="change(4, -1)" @click="change(4)"
:style="{ color: sortStatus == 4 ? mainColor : '#222' }" :style="{ color: msg.OrderBy == 4 ? mainColor : '#222' }"
>销量</view >销量</view
> >
</view> </view>
...@@ -108,18 +108,31 @@ export default { ...@@ -108,18 +108,31 @@ export default {
old: { old: {
scrollTop: 0, scrollTop: 0,
}, },
coupon_id:0 coupon_id:0,
msg:{
pageIndex:1,
pageSize:14,
Name:'',
GoodsType:0,
CategoryIds:'',
OrderBy:0,
},
newsortType:1,
}; };
}, },
components:{ components:{
goodlist goodlist
}, },
onLoad(option) { onLoad(option) {
console.log("option",option)
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.catId = option.cat_id; this.catId = option.cat_id;
if(option.coupon_id!=undefined){ if(option.coupon_id!=undefined){
this.coupon_id = option.coupon_id //优惠券带过来的参数 this.coupon_id = option.coupon_id //优惠券带过来的参数
} }
if(option.CategoryIds){
this.msg.CategoryIds=option.CategoryIds;
}
}, },
mounted() { mounted() {
this.init(); this.init();
...@@ -135,54 +148,77 @@ export default { ...@@ -135,54 +148,77 @@ export default {
}); });
}, },
change(sort, t) { change(sort, t) {
(this.sort = sort), (this.sortType = t), (this.page = 1);
if (sort == 3) { if(t){
this.sortShowType = t; if(this.msg.OrderBy==2){
} else { this.msg.OrderBy=3;
this.sortShowType = 1; }else{
} this.msg.OrderBy=2;
}
}else{
this.msg.OrderBy=sort;
}
this.g = []; this.g = [];
this.init(); this.init();
this.sortStatus = sort;
}, },
init() { init() {
this.isover = false; this.isover = false;
this.loading = true; this.loading = true;
this.showLoading = this.page != 1; this.showLoading = this.msg.pageIndex != 1;
this.request( this.request2(
{ {
url: "", url: '/api/AppletGoods/GetAppletGoodsPageList',
data: { data: this.msg
r: "api/default/goods-list", },
page: this.page, res => {
cat_id: this.catId, console.log("res",res);
sort: this.sort, this.isloading = false;
sort_type: this.sortType, if(res.resultCode==1){
keyword: "", this.g = this.g.concat(res.data.pageData);
coupon_id: this.coupon_id, this.page_count = res.data.pageCount;
}, if (this.page_count == 1) {
}, this.isover = true;
(res) => { this.status = "nomore";
this.showLoading = true; } else {
this.g = this.g.concat(res.data.list); this.status = "loadmore";
this.page_count = res.data.pagination.page_count; }
if (this.page_count == 1) { }
this.isover = true;
this.status = "nomore"; uni.hideNavigationBarLoading();
} else { }
this.status = "loadmore"; );
} // this.request(
this.loading = false; // {
} // url: "",
); // data: {
// r: "api/default/goods-list",
// page: this.page,
// cat_id: this.catId,
// sort: this.sort,
// sort_type: this.sortType,
// keyword: "",
// coupon_id: this.coupon_id,
// },
// },
// (res) => {
// this.showLoading = true;
// 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.status = "nomore";
// } else {
// this.status = "loadmore";
// }
// this.loading = false;
// }
// );
}, },
lower(e) { lower(e) {
if (this.page < this.page_count) { if (this.msg.pageIndex < this.page_count) {
if (!this.loading) {
this.status = "loading"; this.status = "loading";
this.page++; this.msg.pageIndex++;
this.init(); this.init();
}
} else { } else {
this.isover = true; this.isover = true;
this.status = "nomore"; this.status = "nomore";
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="orderindexStyle" :style="{ height: contentHeight }"> <view class="orderindexStyle" :style="{ height: contentHeight }">
<u-tabs <u-tabs
:list="list" :list="list"
:is-scroll="false" name="Name"
:current="current" :current="current"
@change="change" @change="change"
:active-color="mainColor" :active-color="mainColor"
...@@ -184,14 +184,7 @@ export default { ...@@ -184,14 +184,7 @@ export default {
return { return {
pageTitle: "我的订单", pageTitle: "我的订单",
current: 0, current: 0,
list: [ list: [],
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待评价" },
{ name: "已完成" },
{ name: "已取消" }
],
mainColor: "", mainColor: "",
contentHeight: 0, contentHeight: 0,
page: 1, page: 1,
...@@ -204,6 +197,17 @@ export default { ...@@ -204,6 +197,17 @@ export default {
goodData: [], goodData: [],
showGoodList: false, showGoodList: false,
isover: false, isover: false,
msg:{
pageIndex:1,
pageSize:15,
OrderId:0,
OrderType:0,
DeliveryMethod:0,
StartTime:'',
EndTime:'',
OrderStatus:0,
OrderNo:'',
},
}; };
}, },
created() { created() {
...@@ -230,11 +234,33 @@ export default { ...@@ -230,11 +234,33 @@ export default {
this.current = option.status; this.current = option.status;
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)
}
}
);
},
change(index) { change(index) {
this.current = index; this.current = index;
this.page = 1; this.msg.OrderStatus=this.list[index].Id;
this.msg.pageIndex = 1;
this.g = []; this.g = [];
this.loading = true; this.loading = true;
this.init(); this.init();
...@@ -242,29 +268,47 @@ export default { ...@@ -242,29 +268,47 @@ export default {
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){
}, console.log("res",res)
}, this.loading = false;
(res) => { this.g = this.g.concat(res.data.pageData);
this.loading = false; this.page_count = res.data.page_count;
this.g = this.g.concat(res.data.list); if (this.page_count == 1) {
this.page_count = res.data.pagination.page_count; this.isover = true;
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.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;
......
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