Commit fd14700b authored by 罗超's avatar 罗超

1

parent c7b01eee
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
{ {
"path": "pages/favorite/favorite" "path": "pages/favorite/favorite"
}, },
{
"path": "pages/favorite/favoriteKotra"
},
{ {
"path": "pages/card/index/index" "path": "pages/card/index/index"
}, },
...@@ -75,20 +78,20 @@ ...@@ -75,20 +78,20 @@
} }
] ]
}, },
{ // {
"root": "pages/live", // "root": "pages/live",
// "plugins": { // // "plugins": {
// "live-player-plugin": { // // "live-player-plugin": {
// "version": "1.3.0", // // "version": "1.3.0",
// "provider": "wx2b03c6e691cd7370" // // "provider": "wx2b03c6e691cd7370"
// } // // }
// // },
// "pages": [{
// "path": "index"
// }, {
// "path": "share"
// }]
// }, // },
"pages": [{
"path": "index"
}, {
"path": "share"
}]
},
{ {
"root": "pages/user-center", "root": "pages/user-center",
"pages": [{ "pages": [{
......
<template> <template>
<view class="favoriteStyle" :style="{'height':contentHeight}" v-if="!isloading"> <view
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mainColor'></u-tabs> class="favoriteStyle"
<template > :style="{ height: contentHeight }"
<u-empty v-if="current==0&& goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty> v-if="!isloading"
<view v-if="current==0 && goodslist.length>0" style=" >
<u-tabs
:list="list"
:is-scroll="false"
:current="current"
@change="change"
:active-color="mainColor"
></u-tabs>
<template>
<u-empty
v-if="current == 0 && goodslist.length == 0"
text="没有任何收藏商品哦~"
mode="favor"
></u-empty>
<view
v-if="current == 0 && goodslist.length > 0"
style="
height: calc(100vh - 50px); height: calc(100vh - 50px);
width: calc(100vw - 20px); width: calc(100vw - 20px);
margin-left: 10px; margin-left: 10px;
overflow: hidden; overflow: hidden;
padding-top: 10px; padding-top: 10px;
"> "
>
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
:enable-back-to-top="true" :enable-back-to-top="true"
:enable-flex="true" :enable-flex="true"
@scrolltolower="lower" @scrolltolower="lower"
style="height: 100%; padding-bottom: 0px;" style="height: 100%; padding-bottom: 0px"
> >
<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 goodslist" :key="ci"> <u-col span="6" v-for="(cx, ci) in goodslist" :key="ci">
<view class="good" @click="clickHandler(cx)"> <view class="good" @click="clickHandler(cx)">
...@@ -26,14 +42,17 @@ ...@@ -26,14 +42,17 @@
<image <image
mode="aspectFit" mode="aspectFit"
:src="cx.CoverImage" :src="cx.CoverImage"
style="width: 100%; height: 100%;" style="width: 100%; height: 100%"
/> />
</view> </view>
<view class="good-name">{{ cx.Name }}</view> <view class="good-name">{{ cx.Name }}</view>
<view class="good-info" v-if="setting&&setting.is_show_korea==0"> <view
<view class="price" :style="{ color: mainColor }">¥{{ class="good-info"
cx.SellingPrice v-if="setting && setting.is_show_korea == 0"
}}</view> >
<view class="price" :style="{ color: mainColor }"
>¥{{ cx.SellingPrice }}</view
>
<view class="sell">已售{{ cx.SalesNum }}</view> <view class="sell">已售{{ cx.SalesNum }}</view>
<view class="cart" @click.stop="showSkuHandler(cx)"> <view class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" /> <u-icon name="cart-o" size="40" :color="mainColor" />
...@@ -52,71 +71,88 @@ ...@@ -52,71 +71,88 @@
bg-color="#f3f4f6" bg-color="#f3f4f6"
/> />
</scroll-view> </scroll-view>
<u-empty v-if="current==0&& goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty> <u-empty
v-if="current == 0 && goodslist.length == 0"
text="没有任何收藏商品哦~"
mode="favor"
></u-empty>
</view> </view>
<view v-show="current==1" style=" <view
v-show="current == 1"
style="
height: calc(100vh - 50px); height: calc(100vh - 50px);
width: calc(100vw - 20px); width: calc(100vw - 20px);
margin-left: 10px; margin-left: 10px;
overflow: hidden; overflow: hidden;
padding-top: 10px; padding-top: 10px;
"> "
<u-empty v-if="current==1&& topiclist.length==0" text="没有任何收藏主题哦~" mode="favor"></u-empty> >
<u-empty
v-if="current == 1 && topiclist.length == 0"
text="没有任何收藏主题哦~"
mode="favor"
></u-empty>
</view> </view>
</template> </template>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku> <good-sku
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth> v-if="showSku"
:option-type="2"
borderRadius="20"
v-model="showSku"
:good="sku"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "../../components/auth/index.vue"; import auth from "../../components/auth/index.vue";
import goodSku from '../../components/goods/goodsku.vue'; import goodSku from "../../components/goods/goodsku.vue";
export default { export default {
data() { data() {
return { return {
pageTitle:'我的收藏', pageTitle: "我的收藏",
loading: true, loading: true,
contentHeight:0, contentHeight: 0,
showAuth:false, showAuth: false,
mainColor:'', mainColor: "",
list:[ list: [{ name: "商品" }, { name: "专题" }],
{name: '商品'}, msg: {
{name: '专题'},
],
msg:{
pageIndex: 1, pageIndex: 1,
pageSize:10, pageSize: 10,
Name:'' Name: "",
}, },
sku: {}, sku: {},
showSku: false, showSku: false,
goodslist:[], goodslist: [],
topiclist:[], topiclist: [],
current:0, current: 0,
page_count:1, page_count: 1,
status: "loadmore", status: "loadmore",
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
setting: {} setting: {},
} };
}, },
components:{ components: {
auth, auth,
goodSku, goodSku,
}, },
created(){ created() {
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.setting = uni.getStorageSync("basedata").mall.setting; this.setting = uni.getStorageSync("basedata").mall.setting;
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route; let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title ? wx.getStorageSync("basedata").bar_title
: []; : [];
...@@ -129,53 +165,49 @@ ...@@ -129,53 +165,49 @@
title: this.pageTitle, title: this.pageTitle,
}); });
}, },
onLoad(){ onLoad() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: "",
}; };
this.showAuth = true; this.showAuth = true;
} else{ } else {
this.init(); this.init();
} }
}, },
methods: { methods: {
// 购物车 // 购物车
showSkuHandler(g) { showSkuHandler(g) {
g.id= g.Id g.id = g.Id;
console.log('g', g); console.log("g", g);
this.sku = g; this.sku = g;
this.showSku = true; this.showSku = true;
}, },
change(index) { change(index) {
this.current = index; this.current = index;
if(index==1){ if (index == 1) {
this.gettopic();
this.gettopic() } else if (index == 0) {
}else if(index==0){
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.goodslist = []; this.goodslist = [];
this.init() this.init();
} }
}, },
init(){ init() {
uni.showLoading({ uni.showLoading({
title: '加载中' title: "加载中",
}); });
this.request2( this.request2(
{ {
url: '/api/AppletUser/GetUserCollectionPageList', url: "/api/AppletUser/GetUserCollectionPageList",
data: this.msg data: this.msg,
}, },
res => { (res) => {
uni.hideLoading(); uni.hideLoading();
if(res.resultCode==1){ if (res.resultCode == 1) {
this.goodslist = this.goodslist.concat(res.data.pageData); this.goodslist = this.goodslist.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if (this.page_count == 1) { if (this.page_count == 1) {
...@@ -185,15 +217,14 @@ ...@@ -185,15 +217,14 @@
} }
); );
}, },
gettopic(){ //专题数据 gettopic() {
//专题数据
uni.showLoading({ uni.showLoading({
title: '加载中' title: "加载中",
}); });
setTimeout(()=>{ setTimeout(() => {
uni.hideLoading(); uni.hideLoading();
},1000) }, 1000);
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
...@@ -201,12 +232,12 @@ ...@@ -201,12 +232,12 @@
this.init(); this.init();
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth(){ gbAuth() {
uni.navigateBack() uni.navigateBack();
}, },
clickHandler(cx) { clickHandler(cx) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/goods/goods?GoodsId='+cx.Id, url: "/pages/goods/goods?GoodsId=" + cx.Id,
}); });
}, },
lower(e) { lower(e) {
...@@ -218,27 +249,27 @@ ...@@ -218,27 +249,27 @@
this.status = "nomore"; this.status = "nomore";
} }
}, },
} },
} };
</script> </script>
<style> <style>
.favoriteStyle{ .favoriteStyle {
background: #f3f4f6; background: #f3f4f6;
} }
.favoriteStyle .u-good-list .good { .favoriteStyle .u-good-list .good {
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
margin-bottom: 10px; margin-bottom: 10px;
} }
.favoriteStyle .u-good-list .good .good-img { .favoriteStyle .u-good-list .good .good-img {
width: calc(50vw - 15px); width: calc(50vw - 15px);
height: calc(50vw - 15px); height: calc(50vw - 15px);
display: block; display: block;
} }
.favoriteStyle .u-good-list .good .good-name { .favoriteStyle .u-good-list .good .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
...@@ -248,26 +279,26 @@ ...@@ -248,26 +279,26 @@
font-size: 13px; font-size: 13px;
margin: 7px 10px; margin: 7px 10px;
height: 36px; height: 36px;
} }
.favoriteStyle .u-good-list .good .good-info { .favoriteStyle .u-good-list .good .good-info {
display: flex; display: flex;
margin: 7px 10px; margin: 7px 10px;
margin-top: 0; margin-top: 0;
align-items: flex-end; align-items: flex-end;
padding-bottom: 5px; padding-bottom: 5px;
} }
.favoriteStyle .u-good-list .good .good-info .price { .favoriteStyle .u-good-list .good .good-info .price {
font-size: 14px; font-size: 14px;
color: #ff4544; color: #ff4544;
flex: 1; flex: 1;
} }
.favoriteStyle .u-good-list .good .good-info .sell { .favoriteStyle .u-good-list .good .good-info .sell {
font-size: 11px; font-size: 11px;
color: gray; color: gray;
flex: 1; flex: 1;
} }
.favoriteStyle .u-good-list .good .good-info .cart { .favoriteStyle .u-good-list .good .good-info .cart {
width: 40rpx; width: 40rpx;
text-align: right; text-align: right;
} }
</style> </style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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