vue中的mescroll搜索运用及各种填坑处理

2020-06-12 20:52:23易采站长站整理

};
},
components:{FastChoice,PopUp,scale, SearchContent},
watch: {
keyword () {
if (!this.keyword){
return;
}
}
},
mounted() {
this.protocolAjax();
},
methods: {
//邀请
inviteClick (item) {
//点击邀请过的不予操作
if(this.successInvite.indexOf(item.hwUserId) > -1 || item.inviteStatus){
return;
}
this.isScale = true;
this.userId = item.hwUserId;
this.scaleDesc = '邀请成功后你可获取该用户部分收益,选择双方都认可的分成比例可以提高邀请成功率哦~';
this.scaleBtn = '发送邀请';
this.scaleCount = '50%';//邀请比例统一为50%
},
//点击发送邀请
sendAjaxClick (value){
this.scaleValue = value;
this.popuShow = true;
this.isScale = false;
this.isActive = true;
this.sencond = 5 ;
this.timer();
},
//5s时间倒计时
timer() {
if (this.sencond > 0) {
this.btntxt="已阅读同意并确认邀请("+this.sencond+"s)";
this.sencond--;
t=setTimeout(this.timer, 1000);
} else{
this.isActive = false;
this.sencond = 5;
this.btntxt="已阅读同意并确认邀请";
}
},
//已阅读同意并确认
confirmProtocol () {
if(this.isActive){
return false;
}
this.sendAjax();
},
//发送邀请请求
sendAjax () {
console.log(this.scaleValue);
let dd = this.scaleValue.toString();
this.$request.post(_basePath + '/activity/page20191018/inviteArtist.html',{userId: this.userId,shareRate:this.scaleValue}).then((res) => {
this.successInvite.push(this.userId) ;
mui.toast("已发送邀请,对方接受后会通知你哦",2000);
this.closeActionClick();
}).catch(() => {})
},
//关闭操作协议弹窗
closeActionClick() {
this.popuShow = false;
clearTimeout(t);//清除倒计时
},
//关闭分成比例弹窗
closeScale () {
this.isScale = false;
},
clear () {
this.keyword = "";
this.$refs["input"].focus();
},
protocolAjax () {
this.$request.post(_basePath + '/activity/page20191018/queryProtocol.html',{type:0}).then((res) => {
this.protocolTitle = res.title;
this.protocolCon = res.content;
}).catch(() => {})
}
},
};
</script>
<style lang="scss" scoped>
@import "search";