Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui

master
Yer 2023-09-05 11:28:26 +08:00
commit 4b635735ae
1 changed files with 57 additions and 34 deletions

View File

@ -1,9 +1,10 @@
<template>
<div class="wrapper">
<card _Title="近期收藏" :_Tabs="favoriteWay" @_Change="change" :_Size="16" v-if="!homePage" />
<card _Title="近期收藏" :_Size="16" :_Tabs="favoriteWay" @_Change="change" _More="全部收藏" _Src="/home/Favorites" v-else></card>
<card _Title="近期收藏" :_Size="16" :_Tabs="favoriteWay" @_Change="change" _More="全部收藏" _Src="/home/Favorites" v-else>
</card>
<div v-if="list.length">
<template v-for="(item) in list">
<div v-for="(item, index) in list" :key="index">
<div class="goodsItem" :key="item.skuId">
<div class="goodsImg hover-pointer" v-if="params.type === 'GOODS'">
<img :src="item.image" />
@ -11,24 +12,26 @@
<div class="goodsImg hover-pointer" v-else>
<img :src="item.storeLogo" />
</div>
<div class="goodsTitle hover-color" v-if="params.type === 'GOODS'" @click="buynow(item.skuId, item.goodsId)">
<div class="goodsTitle hover-color" v-if="params.type === 'GOODS'" @click="buynow(item.skuId, item.goodsId,item.id)">
{{ item.goodsName }}
</div>
<div v-else class="goodsTitle hover-pointer">
<div v-else class="goodsTitle hover-pointer" @click="buynow(item.skuId, item.goodsId,item.id)" >
{{ item.storeName }}
<Tag color="error" class="operated" v-if="item.selfOperated"></Tag>
</div>
<div class="goodsPrice">
<span v-if="params.type === 'GOODS'">{{ item.price | unitPrice('') }}</span>
<Tag color="error" v-if="item.selfOperated"></Tag>
</div>
<div class="goodsBuy">
<Button size="small" type="primary" @click="buynow(item.skuId, item.goodsId)" v-if="params.type === 'GOODS'"></Button>
<Button size="small" type="primary" @click="buynow(item.skuId, item.goodsId)"
v-if="params.type === 'GOODS'">立即购买</Button>
<Button size="small" type="primary" @click="goShop(item.id)" v-else></Button>
<Button size="small" v-if="params.type === 'GOODS'" @click="cancel(item.skuId)"></Button>
<Button size="small" v-if="params.type === 'STORE'" @click="cancelStore(item.id)"></Button>
</div>
</div>
</template>
</div>
<Spin size="large" fix v-if="spinShow"></Spin>
</div>
<empty v-else />
@ -106,12 +109,23 @@ export default {
}
});
},
buynow (skuId, goodsId) { //
let url = this.$router.resolve({
buynow(skuId, goodsId,storeId) { //
console.log(this.params.type)
let url
if (this.params.type === 'STORE') {
url = this.$router.resolve({
path: '/Merchant',
query: { 'id': storeId }
})
} else {
url = this.$router.resolve({
path: '/goodsDetail',
query: { skuId, goodsId }
})
}
window.open(url.href, '_blank')
},
goShop(id) { //
let url = this.$router.resolve({
@ -137,9 +151,15 @@ export default {
.goodsTitle {
margin: 0 6px;
}
.operated {
margin-left: 10px;
}
.wrapper {
margin-bottom: 40px;
}
.goodsItem {
display: flex;
height: 60px;
@ -170,12 +190,15 @@ export default {
white-space: nowrap;
}
}
.goodsBuy {
margin-left: 80px;
>* {
margin: 0 4px;
}
}
.page-size {
text-align: right;
}