|
@@ -65,6 +65,7 @@ export default {
|
|
|
proportion:50, //显式比例
|
|
|
headList:[],
|
|
|
showUserInput:false, //是否显示手机号留电弹窗
|
|
|
+ repeatFlag:false, //防止重复请求
|
|
|
name:'', //用户称呼
|
|
|
tel:'', //手机号
|
|
|
verifyCode:'',//验证码
|
|
@@ -88,6 +89,7 @@ export default {
|
|
|
return false;
|
|
|
}else{
|
|
|
this.getIdData();
|
|
|
+ this.likeOrView()
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -257,7 +259,10 @@ export default {
|
|
|
},
|
|
|
share(){
|
|
|
if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- wx.miniProgram.navigateTo({url: '/pages/transfer/transfer?event=openCustomerServiceChat&houseId='+this.houseId})
|
|
|
+ Toast({
|
|
|
+ message: '请点击右上角发起分享',
|
|
|
+ });
|
|
|
+ // wx.miniProgram.navigateTo({url: '/pages/transfer/transfer?event=openCustomerServiceChat&houseId='+this.houseId})
|
|
|
}else{
|
|
|
// window.location.href = shottingImg;
|
|
|
var textArea = document.createElement("textarea");
|
|
@@ -285,11 +290,25 @@ export default {
|
|
|
}else if(type==2){//不喜欢
|
|
|
params.likeed = 0
|
|
|
}
|
|
|
+ if(this.repeatFlag){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.repeatFlag = true;
|
|
|
// params.userId = this.userId;
|
|
|
const res = await requestConfig('add', params);
|
|
|
- if (res.success) {
|
|
|
+ if (res.success && type) {
|
|
|
this.layoutStruct.clickLike = params.likeed;
|
|
|
+ if(this.total){
|
|
|
+ if(type==1){
|
|
|
+ this.likeCount = this.likeCount + 1
|
|
|
+ }else{
|
|
|
+ this.unlikedCount = this.unlikedCount + 1
|
|
|
+ }
|
|
|
+ this.total ++;
|
|
|
+ this.proportion = parseInt((this.likeCount / (this.likeCount + this.unlikedCount))*100);
|
|
|
+ }
|
|
|
}
|
|
|
+ this.repeatFlag = false;
|
|
|
},
|
|
|
async getIdData(){
|
|
|
let userId = this.userId || '';
|
|
@@ -297,7 +316,7 @@ export default {
|
|
|
id: this.id,
|
|
|
brandId: $config.brandId,
|
|
|
houseId:this.houseId,
|
|
|
- userId,
|
|
|
+ // userId,
|
|
|
type:'QIANCE',
|
|
|
};
|
|
|
if(this.shareUserId){//分享时 不带用户id
|
|
@@ -317,8 +336,8 @@ export default {
|
|
|
this.likeCount = this.layoutStruct.liked;//喜欢的人数
|
|
|
this.unlikedCount = this.layoutStruct.unliked;//不喜欢人数
|
|
|
this.total = this.layoutStruct.total;//总人数
|
|
|
- if(this.total){
|
|
|
- this.proportion = parseInt((this.likeCount / this.total)*100);
|
|
|
+ if((this.likeCount + this.unlikedCount)>0){
|
|
|
+ this.proportion = parseInt((this.likeCount / (this.likeCount + this.unlikedCount))*100);
|
|
|
}
|
|
|
// this.number = single.landCode
|
|
|
this.form = single.layoutStruct[0];
|