const _Http = getApp().globalData.http; let sa_projectid = ""; Page({ data: { defeatreason: "", type: "其他", actions: [{ name: "价格" }, { name: "品牌" }, { name: "商务" }, { name: "地域" }, { name: "其他" }], show: false }, onLoad(options) { sa_projectid = options.id; }, //开始选择跟进方式 openSelect() { this.setData({ show: true }) }, //取消选择 onCancel() { this.setData({ show: false }) }, //确定选择 onSelect({ detail }) { this.setData({ type: detail.name }) this.onCancel(); }, //文本域输入 onInput(e) { this.setData({ defeatreason: e.detail.value }) }, submit() { _Http.basic({ "id": 20230706152904, "content": { sa_projectid, "defeatreason": this.data.defeatreason, defeattype: this.data.type } }).then(res => { console.log("失败", res) wx.showToast({ title: res.msg == '成功' ? '已失败' : res.msg, icon: "none", mask: true }); if (res.msg == '成功') { let page = getCurrentPages()[getCurrentPages().length - 2]; page.getDetail() setTimeout(() => { wx.navigateBack() }, 500) } }) } })