整理点调接口事件API常用事件方法
目录
倒计时事件
setTimeout(function(){
this.loadingShow = false
}, 1000);
弹窗提示事件
// 封装好的提示
showToast(title) {
uni.showToast({
title: title,
icon: "none",
duration: 2000,
});
},
弹窗修改
<u-modal
title="修改名称"
v-model="RenameShow"
show-confirm-button
confirm-color="#495AFF"
confirm-text="确定"
show-cancel-button
cancel-color="#808080"
@confirm="RenameConfirm"
>
<view class="modal-con">
<input placeholder="请输入新的名称" v-model="newName" />
</view>
</u-modal>
//data
RenameShow: false, //志愿重命名弹窗
//方法
editName() {
this.RenameShow = true;
},
// 重命名
RenameConfirm() {
if (!this.newName) {
this.showToast("请输入新的名称");
return;
}
let json = {
recordId:this.volunteer_info.recordId,
idealId:this.volunteer_info.idealId,
type:3,
idealName:this.newName
};
console.log('json',json)
const URL = getApp().globalData.appApi + '/gk/uptIdeal'
this.$http.post_request(json,URL,res=>{
console.log(res)
if(res.rc == '0'){
this.showToast("重命名成功");
this.volunteer_info.idealName = this.newName
// this.newName = ""; //置空
}
})
},