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