From 1ebf13fcff1d64f0ab9f1981cd60ad3194a2d29c Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期五, 27 九月 2024 11:10:00 +0800 Subject: [PATCH] zf --- packageBookService/pages/bookServices/detail/components/suggest/suggest.js | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/suggest/suggest.js b/packageBookService/pages/bookServices/detail/components/suggest/suggest.js index b79c95e..0722ecd 100644 --- a/packageBookService/pages/bookServices/detail/components/suggest/suggest.js +++ b/packageBookService/pages/bookServices/detail/components/suggest/suggest.js @@ -16,7 +16,7 @@ }, data: { - inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx', + inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx;', placeholderstyle: 'font-size:28rpx', dialogKey: '', showWithInput: false, @@ -60,17 +60,16 @@ textvalue: e.detail.value }) }, - feedBack() { - const token = wx.getStorageSync('jsek-token') - if (!token) { - return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', - success: (res) => { - console.log(res); - } - }) - } - this.closeDialog() + async feedBack() { + // const token = wx.getStorageSync('jsek-token') + // if (!token) { + // return wx.getUserProfile({ + // desc: '鐢ㄦ埛鐧诲綍', + // success: (res) => { + // console.log(res); + // } + // }) + // } let content = { source: this.data.ratevalue, phone: this.data.inputvalue, @@ -86,39 +85,42 @@ newDataListRequest: [] } - app.MG.ugc.newTopicMessage(query).then((res) => { + await app.MG.ugc.newTopicMessage(query).then((res) => { wx.showToast({ title: '鎻愪氦鎴愬姛', icon: 'success', duration: 2000 }) + this.closeDialog() }) }, // 纭畾 - confirmSuggest() { - const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.inputvalue); + async confirmSuggest() { + const telephoneCheck = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ + const istelePhone = telephoneCheck.test(this.data.inputvalue) + const textvalue = this.data.textvalue.trim() if (!this.data.ratevalue) { return wx.showToast({ icon: "error", title: '璇烽�夋嫨璇勫垎', }) - } else if (!this.data.inputvalue) { + } else if (!this.data.inputvalue.length) { return wx.showToast({ icon: "error", title: '璇峰~鍐欒仈绯绘柟寮�', }) - } else if (!isPhoneNumber) { + } else if (!istelePhone) { return wx.showToast({ icon: "error", title: '璇疯緭鍏ユ纭仈绯绘柟寮�', }) - } else if (!this.data.textvalue) { + } else if (!textvalue.length) { return wx.showToast({ icon: 'error', - title: '璇疯緭鍏ュ弽棣堝弽棣堝唴瀹�', + title: '璇疯緭鍏ュ弽棣堝唴瀹�', }) } - this.feedBack() + await this.feedBack() } }, -}) +}) \ No newline at end of file -- Gitblit v1.9.1