| | |
| | | }, |
| | | |
| | | data: { |
| | | inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx', |
| | | placeholderstyle: 'font-size:28rpx', |
| | | dialogKey: '', |
| | | showWithInput: false, |
| | | showTextAndTitleWithInput: false, |
| | | inputvalue: '', |
| | | textvalue: '', |
| | | ratevalue: 0, |
| | | phoneError: false, |
| | | textError: false, |
| | | }, |
| | | methods: { |
| | |
| | | this.setData({ |
| | | inputvalue: e.detail.value |
| | | }) |
| | | 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(e.detail.value); |
| | | if (this.data.phoneError === isPhoneNumber) { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | }); |
| | | } |
| | | }, |
| | | // 文本框改变 |
| | | textareaChange(e) { |
| | |
| | | feedBack() { |
| | | const token = wx.getStorageSync('jsek-token') |
| | | if (!token) { |
| | | // return wx.showToast({ |
| | | // icon: 'error', |
| | | // title: '请先登录', |
| | | // }) |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | success: (res) => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.closeDialog() |
| | | let content = { |
| | | source: this.data.ratevalue, |
| | | phone: this.data.inputvalue, |
| | |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | this.closeDialog() |
| | | }) |
| | | }, |
| | | // 确定 |
| | | confirmSuggest() { |
| | | if (!this.data.inputvalue) { |
| | | return this.setData({ |
| | | phoneError: true |
| | | }) |
| | | } |
| | | if (!this.data.textvalue || this.data.ratevalue) { |
| | | 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); |
| | | if (!this.data.ratevalue) { |
| | | return wx.showToast({ |
| | | success: 'error', |
| | | title: '请填写完整表单', |
| | | icon: "error", |
| | | title: '请选择评分', |
| | | }) |
| | | } else if (!this.data.inputvalue) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: '请填写联系方式', |
| | | }) |
| | | } else if (!isPhoneNumber) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: '请输入正确联系方式', |
| | | }) |
| | | } else if (!this.data.textvalue) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请输入反馈反馈内容', |
| | | }) |
| | | } |
| | | this.feedBack() |