You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
278 lines
5.7 KiB
278 lines
5.7 KiB
3 years ago
|
<template>
|
||
|
<view class="body">
|
||
|
<view class="bar">
|
||
|
<image src="../../static/111(1).png" mode=""></image>
|
||
|
</view>
|
||
|
<view class="title">
|
||
|
創意で価値を作ろう!
|
||
|
</view>
|
||
|
<block v-for="(item,index) in list" :key="index">
|
||
|
<view class="item" v-if="list.length>=1&&index==0" @click="detail(item.id)">
|
||
|
<!-- style="background:url('../../static/bird.png') no-repeat" -->
|
||
|
|
||
|
<view class="itempic" :style="{backgroundImage:`url(${item.thumbnail})`}">
|
||
|
<view class="left-cover">
|
||
|
<image v-if="!item.whetherLike" @click.stop="like(item.id)" src="../../static/heat.png" mode=""></image>
|
||
|
<image v-if="item.whetherLike" @click.stop="unlike(item.id)" src="../../static/278.png" mode=""></image>
|
||
|
<view class="number">
|
||
|
{{item.likeNumInt}}
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="text">
|
||
|
{{item.collectionName}}
|
||
|
</view>
|
||
|
<view class="textname">
|
||
|
{{item.artistName}} ¥{{item.price}}
|
||
|
</view>
|
||
|
</view>
|
||
|
</block>
|
||
|
<view class="content">
|
||
|
<block v-for="(item,index) in list" :key="item.id">
|
||
|
<view class="item" v-if="list.length>=1&&index>=1" @click="detail(item.id)">
|
||
|
<!-- style="background:url('../../static/bird.png') no-repeat" -->
|
||
|
<view class="itempic" :style="{backgroundImage:`url(${item.thumbnail})`}">
|
||
|
<view class="left-cover">
|
||
|
<image v-if="!item.whetherLike" @click.stop="like(item.id)" src="../../static/heat.png" mode=""></image>
|
||
|
<image v-if="item.whetherLike" @click.stop="unlike(item.id)" src="../../static/278.png" mode=""></image>
|
||
|
<view class="number">
|
||
|
{{item.likeNumInt}}
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="text">
|
||
|
{{item.collectionName}}
|
||
|
</view>
|
||
|
<view class="textname">
|
||
|
{{item.artistName}} #{{item.issueNumber}}
|
||
|
</view>
|
||
|
</view>
|
||
|
</block>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
list: []
|
||
|
};
|
||
|
},
|
||
|
onShow() {
|
||
|
this.homePage();
|
||
|
},
|
||
|
methods: {
|
||
|
//查询主页信息
|
||
|
async homePage() {
|
||
|
const res = await this.$myRequest({
|
||
|
url: '/api/foreignAuth/homePage',
|
||
|
header: {
|
||
|
token: uni.getStorageSync("token"),
|
||
|
Authorization: uni.getStorageSync("Authorization"),
|
||
|
},
|
||
|
})
|
||
|
if(res.data.code==200){
|
||
|
this.list = res.data.data
|
||
|
}
|
||
|
|
||
|
},
|
||
|
//跳转详情页
|
||
|
detail(id){
|
||
|
uni.navigateTo({
|
||
|
url:"./workshow?id="+id
|
||
|
})
|
||
|
},
|
||
|
//点赞
|
||
|
async like(id){
|
||
|
const res = await this.$myRequest({
|
||
|
url: '/api/foreignAuth/giveLike?id='+id,
|
||
|
header: {
|
||
|
token: uni.getStorageSync("token"),
|
||
|
Authorization: uni.getStorageSync("Authorization"),
|
||
|
},
|
||
|
})
|
||
|
if(res.data.code==200){
|
||
|
uni.showToast({
|
||
|
title: "点赞成功"
|
||
|
})
|
||
|
this.homePage();
|
||
|
}else{
|
||
|
uni.showToast({
|
||
|
title: res.data.msg
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
//取消点赞
|
||
|
async unlike(id){
|
||
|
const res = await this.$myRequest({
|
||
|
url: '/api/foreignAuth/donPraise?id='+id,
|
||
|
header: {
|
||
|
token: uni.getStorageSync("token"),
|
||
|
Authorization: uni.getStorageSync("Authorization"),
|
||
|
},
|
||
|
})
|
||
|
if(res.data.code==200){
|
||
|
uni.showToast({
|
||
|
title: "取消点赞成功"
|
||
|
})
|
||
|
this.homePage();
|
||
|
}else{
|
||
|
uni.showToast({
|
||
|
title: res.data.msg
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss">
|
||
|
.body {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
background-color: #000000;
|
||
|
min-height: 1340rpx;
|
||
|
font-family: Arial-Regular;
|
||
|
|
||
|
.bar {
|
||
|
background: url(../../static/bar.png);
|
||
|
width: 750rpx;
|
||
|
height: 358rpx;
|
||
|
background-repeat: no-repeat;
|
||
|
background-size: 100% 100%;
|
||
|
-moz-background-size: 100% 100%;
|
||
|
display: flex;
|
||
|
justify-content: flex-end;
|
||
|
|
||
|
image {
|
||
|
margin-right: 36rpx;
|
||
|
width: 64rpx;
|
||
|
height: 64rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.title {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
justify-content: center;
|
||
|
align-items: center;
|
||
|
color: #FFFFFF;
|
||
|
font-size: 32rpx;
|
||
|
}
|
||
|
|
||
|
.item {
|
||
|
color: #FFFFFF;
|
||
|
width: 678rpx;
|
||
|
height: 830rpx;
|
||
|
background-color: #1C1C1C;
|
||
|
border-radius: 44rpx;
|
||
|
margin-top: 48rpx;
|
||
|
|
||
|
|
||
|
.itempic {
|
||
|
width: 678rpx;
|
||
|
height: 678rpx;
|
||
|
background-repeat: no-repeat;
|
||
|
background-size: cover;
|
||
|
overflow: hidden;
|
||
|
border-radius:22rpx;
|
||
|
.left-cover {
|
||
|
|
||
|
margin-top: 36rpx;
|
||
|
width: 118rpx;
|
||
|
height: 48rpx;
|
||
|
border-radius: 8rpx;
|
||
|
background:rgba(0,0,0,0.5);
|
||
|
display: flex;
|
||
|
justify-content: center;
|
||
|
font-size: 28rpx;
|
||
|
align-items: center;
|
||
|
margin-left: 36rpx;
|
||
|
image {
|
||
|
width: 28rpx;
|
||
|
height: 28rpx;
|
||
|
}
|
||
|
|
||
|
.number {
|
||
|
|
||
|
margin-left: 8rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.text {
|
||
|
font-size: 32rpx;
|
||
|
margin-left: 24rpx;
|
||
|
margin-top: 28rpx;
|
||
|
}
|
||
|
|
||
|
.textname {
|
||
|
margin-top: 26rpx;
|
||
|
font-size: 32rpx;
|
||
|
margin-left: 24rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.content {
|
||
|
display: flex;
|
||
|
margin-top: 48rpx;
|
||
|
flex-wrap: wrap;
|
||
|
|
||
|
.item {
|
||
|
color: #FFFFFF;
|
||
|
width: 324rpx;
|
||
|
height: 446rpx;
|
||
|
background-color: #1C1C1C;
|
||
|
border-radius: 24rpx;
|
||
|
margin-left: 36rpx;
|
||
|
|
||
|
.itempic {
|
||
|
width: 324rpx;
|
||
|
height: 324rpx;
|
||
|
background-repeat: no-repeat;
|
||
|
background-size: cover;
|
||
|
overflow: hidden;
|
||
|
border-radius:12rpx;
|
||
|
|
||
|
.left-cover {
|
||
|
margin-top: 18rpx;
|
||
|
width: 94rpx;
|
||
|
height: 40rpx;
|
||
|
background:rgba(0,0,0,0.5);
|
||
|
border-radius: 8rpx;
|
||
|
display: flex;
|
||
|
justify-content: center;
|
||
|
font-size: 24rpx;
|
||
|
align-items: center;
|
||
|
margin-left: 24rpx;
|
||
|
|
||
|
image {
|
||
|
width: 24rpx;
|
||
|
height: 24rpx;
|
||
|
}
|
||
|
|
||
|
.number {
|
||
|
|
||
|
margin-left: 8rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.text {
|
||
|
font-size: 28rpx;
|
||
|
margin-left: 24rpx;
|
||
|
margin-top: 16rpx;
|
||
|
}
|
||
|
|
||
|
.textname {
|
||
|
margin-top: 16rpx;
|
||
|
font-size: 28rpx;
|
||
|
margin-left: 24rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</style>
|