|
|
@ -14,26 +14,35 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="operate"> |
|
|
|
<view class="operateItem" @click="likeFn"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/dianzan_nor.png" mode=""></image> |
|
|
|
<!-- <image src="/static/images/index/dianzan_cli.png" mode=""></image> --> |
|
|
|
<view class="operateWith"> |
|
|
|
<view class="operateItem" @click="likeFn"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/dianzan_nor.png" mode="" v-if="!operateInfo.upvote"></image> |
|
|
|
<image src="/static/images/index/dianzan_cli.png" mode="" v-else></image> |
|
|
|
</view> |
|
|
|
<view class="txt">点赞</view> |
|
|
|
</view> |
|
|
|
<view class="txt">点赞</view> |
|
|
|
</view> |
|
|
|
<view class="operateItem" @click="createCollectFn"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/shoucang_nor.png" mode=""></image> |
|
|
|
<!-- <image src="/static/images/index/shoucang_cli.png" mode=""></image> --> |
|
|
|
|
|
|
|
<view class="operateWith"> |
|
|
|
<view class="operateItem" @click="createCollectFn"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/shoucang_nor.png" mode="" v-if="!operateInfo.collect"></image> |
|
|
|
<image src="/static/images/index/shoucang_cli.png" mode="" v-else></image> |
|
|
|
</view> |
|
|
|
<view class="txt">收藏</view> |
|
|
|
</view> |
|
|
|
<view class="txt">收藏</view> |
|
|
|
</view> |
|
|
|
<view class="operateItem"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/fenxiang_nor.png" mode=""></image> |
|
|
|
|
|
|
|
<view class="operateWith"> |
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
<view class="operateItem" @click="createRetransmissionFn"> |
|
|
|
<view class="icon"> |
|
|
|
<image src="/static/images/index/fenxiang_nor.png" mode=""></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="txt">分享</view> |
|
|
|
</view> |
|
|
|
<view class="txt">分享</view> |
|
|
|
<!-- #endif --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="videolist"> |
|
|
@ -53,11 +62,12 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import videoItem from '../comp/videoItem' |
|
|
|
import { publicGetvideo, createUpvote, getlikesCollection, createCollect } from '@/config/api.js' |
|
|
|
import { publicGetvideo, createUpvote, getlikesCollection, createCollect, createRetransmission, deleteUpvote, deleteRetransmission } from '@/config/api.js' |
|
|
|
export default { |
|
|
|
components: { videoItem }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
operateInfo: {}, |
|
|
|
id: '', |
|
|
|
vdoDetail: {}, |
|
|
|
params: {} |
|
|
@ -79,19 +89,33 @@ |
|
|
|
// 查否点赞收藏 |
|
|
|
async getlikesCollection() { |
|
|
|
const {data: res} = await getlikesCollection(this.params) |
|
|
|
this.operateInfo = res |
|
|
|
}, |
|
|
|
// 点赞 |
|
|
|
async likeFn() { |
|
|
|
const {data: res} = await createUpvote(this.params) |
|
|
|
if(this.operateInfo.upvote) { |
|
|
|
await deleteUpvote({upvoteId: this.operateInfo.upvoteId,mobile: this.vuex_userInfo.mobile}) |
|
|
|
}else { |
|
|
|
await createUpvote(this.params) |
|
|
|
} |
|
|
|
this.getlikesCollection() |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
// 收藏 |
|
|
|
async createCollectFn() { |
|
|
|
const {data: res} = await createCollect(this.params) |
|
|
|
if(this.operateInfo.collect) { |
|
|
|
await deleteRetransmission({mobile: this.vuex_userInfo.mobile, CollectId: this.operateInfo.collectId}) |
|
|
|
}else { |
|
|
|
await createCollect(this.params) |
|
|
|
} |
|
|
|
this.getlikesCollection() |
|
|
|
}, |
|
|
|
// 转发 |
|
|
|
async createRetransmissionFn() { |
|
|
|
const {data: res} = await createRetransmission(this.params) |
|
|
|
this.getlikesCollection() |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -115,10 +139,15 @@ |
|
|
|
} |
|
|
|
.operate { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
// justify-content: space-between; |
|
|
|
.operateWith { |
|
|
|
flex: 1; |
|
|
|
|
|
|
|
} |
|
|
|
.operateItem { |
|
|
|
width: 188rpx; |
|
|
|
height: 132rpx; |
|
|
|
margin: 0 auto; |
|
|
|
background: #FFFFFF; |
|
|
|
border-radius: 16rpx; |
|
|
|
display: flex; |
|
|
|