Commit fd14700b authored by 罗超's avatar 罗超

1

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