css
litian
2024-04-12 75c63ae6c5cb34c777c9fb3b375379952f7995b4
pages/personalCenter/feedBackSubmit/index.js
@@ -68,11 +68,18 @@
    const {
      phoneError
    } = this.data;
    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 (phoneError === isPhoneNumber) {
    if (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 (phoneError === isPhoneNumber) {
        this.setData({
          phoneError: !isPhoneNumber,
          mannder: e.detail.value,
        });
      }
    } else {
      this.setData({
        phoneError: !isPhoneNumber,
        mannder: e.detail.value,
        phoneError: false,
        mannder: ''
      });
    }
  },
@@ -97,16 +104,7 @@
      if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') {
        this.data.lock = true;
        wx.showToast({
          title: "反馈内容不能为空",
          icon: 'none',
          duration: 1000
        })
        return
      }
      if (this.data.phoneError) {
        this.data.lock = true;
        wx.showToast({
          title: "联系方式格式不正确",
          title: "联系方式不能为空",
          icon: 'none',
          duration: 1000
        })
@@ -121,6 +119,10 @@
        })
        return
      }
      if (this.data.phoneError) {
        this.data.lock = true;
        return
      }
      let submitData = {
        content: this.data.content.replace(/^\s*|\s*$/g, ""),