You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
4.5 KiB
Vue

<template>
<view class="main-box">
<u-toast ref="uToast"></u-toast>
<u-album :urls="[seriesData.coverImg]" :singleSize="368"></u-album>
<view class="title">
<image src="../../static/image/usa/left.png"></image>
<text class="word">{{ $t("seriesData.detail") }}</text>
<image src="../../static/image/usa/right.png"></image>
</view>
<view class="collectionList" v-if="collectionList">
<view
v-for="(item, index) in collectionList"
:key="index"
class="list-item"
>
<view class="listbox" @click="goDetail(item)">
<image class="coverImg" :src="item.coverImg"></image>
<view class="info">
<view class="name">{{ item.name }}</view>
<view class="intro">{{ item.intro }}</view>
</view>
</view>
</view>
</view>
<view class="bottom-btn">
<u-button :loading="loading" class="btn" @click="receive">{{
$t("seriesData.recive")
}}</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
seriesData: {},
collectionList: [],
loading: false,
};
},
onShow() {
this.seriesData = uni.getStorageSync("seriesData");
this.collectionList = uni.getStorageSync("collectionList");
console.log(this.seriesData, 1111);
},
methods: {
// 跳转详情
goDetail(item) {
uni.navigateTo({
url: `/pages/index/detail/detail?collectionUID=${item.collectionUID}`,
});
},
async receive() {
this.loading = true;
let data = {
seriesUuid: this.seriesData.seriesUuid,
};
let res = await this.$api.usa.receive(data);
if (res.status === 0) {
this.loading = false;
this.$refs.uToast.show({
type: "success",
position: "top",
message: this.$t("seriesData.success"),
duration: 2000,
iconUrl: "https://cdn.uviewui.com/uview/demo/toast/success.png",
complete() {
uni.redirectTo({
url: "/pages/mine/usamine/index",
});
},
});
} else {
this.loading = false;
uni.$u.toast(res.msg);
}
},
},
};
</script>
<style lang="scss">
page {
background: url("../../static/image/start/new_bg.png") no-repeat;
background-size: 100% 100%;
background-attachment: fixed;
height: 100vh;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.main-box {
position: absolute;
left: 50%;
transform: translate(-50%);
padding: 14px 5px 14px 5px;
}
/deep/ .u-album__row__wrapper {
image {
border-radius: 4px;
}
}
.title {
font-size: 17px;
color: #3e6944;
text-align: center;
margin-top: 24px;
image {
width: 32px;
height: 13px;
}
.word {
margin: 0 10px;
}
}
.collectionList {
margin-top: 15px;
overflow-y: scroll;
height: 130px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.list-item {
width: 100%;
height: 96px;
border-radius: 4px;
box-shadow: 0px 2px 4px 0px #e4e4e4;
margin-top: 10px;
background: #fff;
border-radius: 4px;
padding: 12px 16px;
box-sizing: border-box;
.listbox {
display: flex;
align-items: center; /* Add this line */
.coverImg {
width: 72px;
height: 72px;
border-radius: 4px;
}
.info {
flex: 1; /* Add this line */
margin-left: 8px;
.name {
font-size: 16px;
color: #000000;
//
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.intro {
font-size: 14px;
color: #999999;
margin-top: 4px;
//
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
}
}
.bottom-btn {
margin-top: 20px;
height: 70px;
width: 100%;
background: #ffffff;
//
box-shadow: 0px 2px 4px 0px #e4e4e4;
display: flex;
justify-content: center;
align-items: center;
.btn {
width: 214px;
height: 40px;
//
background: linear-gradient(90deg, #489552 0%, #3e6944 100%);
color: #fff;
border-radius: 20px;
}
}
/deep/ .u-toast__content{
width: 85%;
transform: translateY(-291.75px) !important;
}
</style>