| | |
| | | <view class="top-img-container">
|
| | | <image :src="dto.cover" class="top-img" mode="aspectFill"></image>
|
| | | <view class="icon-container">
|
| | | <image src="../../../static/common/icon-sc.png" @click="collectItem(dto)" class="icon-sc"></image>
|
| | | <image v-if="!dto.collection" src="../../../static/common/icon-sc.png" @click="collectItem(dto)"
|
| | | class="icon-sc"></image>
|
| | | <image v-if="dto.collection" src="../../../static/common/icon-sc.png" @click="collectItem(dto)"
|
| | | class="icon-sc"></image>
|
| | |
|
| | |
|
| | | <!-- <view class="num">12</view>-->
|
| | | </view>
|
| | | <view class="icon-container">
|
| | |
| | | </view>
|
| | | <view class="trade-info-container">
|
| | | <view class="title flex">
|
| | | <view class="level m-r-15">{{ dto.levelStr || '-' }}级</view>
|
| | | <view class="level m-r-15">{{ dto.levelStr || '-' }}</view>
|
| | | <view class="">
|
| | | {{ dto.name || '-' }}
|
| | | </view>
|
| | |
| | | }
|
| | | },
|
| | | methods: {
|
| | | async collectItem(dto){
|
| | | await this.$message.confirm('是否添加到收藏')
|
| | | async collectItem(dto) {
|
| | | await this.$message.confirm(`是否${dto.collection?'移除':'添加到'}收藏`)
|
| | | this.$message.showLoading()
|
| | | const {
|
| | | code,
|
| | | data
|
| | | } = await this.$http.request('post', '/api/collect/add', {
|
| | | data: {
|
| | | flowerId: dto.id
|
| | | }
|
| | | })
|
| | | } = await this.$http.request(dto.collection ? "get" : 'post', dto.collection ? '/api/collect/delete' :
|
| | | '/api/collect/add', {
|
| | | data: {
|
| | | flowerId: dto.id
|
| | | },
|
| | | params: {
|
| | | id: dto.id
|
| | | }
|
| | | })
|
| | | if (code === 0) {
|
| | | this.$message.showToast('收藏成功')
|
| | | this.$message.showToast('操作成功')
|
| | | dto.collection = !dto.collection
|
| | | this.$forceUpdate()
|
| | | }
|
| | | |
| | |
|
| | | this.$message.hideLoading()
|
| | | },
|
| | | async submitShopping(dto) {
|
| | |
| | | position: absolute;
|
| | | top: 20rpx;
|
| | | width: 80rpx;
|
| | | left: 40rpx;
|
| | | right: 140rpx;
|
| | | height: 80rpx;
|
| | | background: rgba(0, 0, 0, 0);
|
| | |
|
| | | background: rgba(0, 0, 0, 0.42);
|
| | | border-radius: 50%;
|
| | | display:flex;
|
| | | |
| | | .icon-sc {
|
| | | width: 54rpx;
|
| | | height: 54rpx;
|
| | |
| | | }
|
| | |
|
| | | .icon-container:last-child {
|
| | | left: 100rpx;
|
| | | right: 20rpx;
|
| | | }
|
| | |
|
| | | // .icon-container:first-child {
|