闫增涛
2024-04-02 aef06b129be7a3a12ac097db8e372b0cb33c6c42
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;font-size: 24rpx;',
    placeholderstyle: 'font-size:28rpx',
    dialogKey: '',
    showWithInput: false,
@@ -61,16 +61,15 @@
      })
    },
    async feedBack() {
      const token = wx.getStorageSync('jsek-token')
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          success: (res) => {
            console.log(res);
          }
        })
      }
      // 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,
@@ -97,23 +96,25 @@
    },
    // 确定
    async 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);
      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: '请输入反馈反馈内容',
@@ -122,4 +123,4 @@
      await this.feedBack()
    }
  },
})
})