前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >调接口事件API常用事件方法

调接口事件API常用事件方法

作者头像
痴心阿文
发布2022-11-18 18:39:06
2590
发布2022-11-18 18:39:06
举报

 整理点调接口事件API常用事件方法

目录

倒计时事件

弹窗提示事件

弹窗修改

倒计时事件

代码语言:javascript
复制
			setTimeout(function(){ 
				this.loadingShow = false 
			}, 1000);

弹窗提示事件

代码语言:javascript
复制
			// 封装好的提示
			showToast(title) {
			      uni.showToast({
			        title: title,
			        icon: "none",
			        duration: 2000,
			      });
			},

弹窗修改

代码语言:javascript
复制
		<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>
代码语言:javascript
复制
//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 = ""; //置空
					}
			    }) 
			},
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-06-12,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档