点赞 聊天

This commit is contained in:
Mr.jiang 2024-07-24 22:24:15 +08:00
parent fde458e48c
commit 7c702cd4c3
3 changed files with 10 additions and 13 deletions

View File

@ -208,6 +208,7 @@
msg: 'Hello' msg: 'Hello'
} }
}, },
// protocols: ['protocol1'],
header: { header: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },

View File

@ -54,8 +54,8 @@
<image @click="tozuozhe(list)" class="userAvatar" :src="list.artificerImg" mode="aspectFill"></image> <image @click="tozuozhe(list)" class="userAvatar" :src="list.artificerImg" mode="aspectFill"></image>
<!-- 2.点赞 --> <!-- 2.点赞 -->
<view class="list-view" @click="cLike(list.sfdz);" style="opacity: 0.9; margin-top: 17px;"> <view class="list-view" @click="cLike(list.sfdz);" style="opacity: 0.9; margin-top: 17px;">
<image v-if="list.sfdz=='1'" src="@/static/img/index/xin.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image> <image v-if="list.sfdz==1" src="@/static/img/index/xin.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
<image v-if="list.sfdz=='0'" src="@/static/img/index/xin-2.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image> <image v-if="list.sfdz==0" src="@/static/img/index/xin-2.png" style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;" :class="{'likeNumActive':list.sfdz}">{{list.dzs}}</text> <text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;" :class="{'likeNumActive':list.sfdz}">{{list.dzs}}</text>
</view> </view>
<!-- 3.评论 --> <!-- 3.评论 -->
@ -125,6 +125,7 @@
}, },
data() { data() {
return { return {
isLiked:false,
dianzhan:0, dianzhan:0,
showPopup:false, showPopup:false,
ccRef: null, ccRef: null,
@ -806,15 +807,12 @@
shipinquanId:this.dataList[this.k].id, shipinquanId:this.dataList[this.k].id,
} }
// this.dataList[this.k].sfdz = !this.dataList[this.k].sfdz // this.dataList[this.k].sfdz = !this.dataList[this.k].sfdz
if(this.dataList[this.k].sfdz=='1'){ if(this.dataList[this.k].sfdz=='0'){
this.$Request.post("/app/shipinquan/addDianzan", data).then(res => { this.$Request.post("/app/shipinquan/addDianzan", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
// this.dataList[this.k].dzs += 1; this.dataList[this.k].dzs += 1;
// this.dataList[this.k].sfdz = '0'; this.dataList[this.k].sfdz = '1';
const video = this.dataList[this.k].dzs;
sss=video.dzs += 1;
} else { } else {
this.dataList[this.k].sfdz ='0'
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
@ -823,13 +821,11 @@
}); });
}else{// }else{//
this.dataList[this.k].sfdz ='0'
this.$Request.post("/app/shipinquan/delDianzan", data).then(res => { this.$Request.post("/app/shipinquan/delDianzan", data).then(res => {
if (res.code == 0) { if (res.code == 0) {
const video = this.dataList[this.k]; this.dataList[this.k].dzs -= 1;
sss=video.dzs -= 1; this.dataList[this.k].sfdz = '0';
} else { } else {
this.dataList[this.k].sfdz ='0'
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'

View File

@ -587,7 +587,7 @@ export function uploadFileUrl(){
} }
export function getWsBaseUrl(){ export function getWsBaseUrl(){
return config('WSHOST'); return config('APIHOST');
} }