litian
2024-04-09 6608a6839d771d38640988e3ee496ecdd91765a4
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -46,6 +46,18 @@
          'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress,
        })
      } else {
        wx.showModal({
          title: '尊敬的用户,您好!', //提示的标题
          content: '请先进行教师认证?', //提示的内容
          success: function (res) {
            if (res.confirm) {
              wx.navigateTo({
                url: "/packageDomain/pages/teacherCertification/index",
              });
            }
          }
        })
      }
      if (wx.getStorageSync("paperBookList")) {
        this.setData({
@@ -146,11 +158,17 @@
    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,
          "contactInfo.phone": e.detail.value,
        });
      }
    } else {
      this.setData({
        phoneError: !isPhoneNumber,
        "contactInfo.phone": e.detail.value,
        phoneError: false,
      });
    }
  },
@@ -234,13 +252,13 @@
                electronicBookList: [],
                bookList: [],
              })
              wx.setStorageSync("electronicBookList", []);
              wx.removeStorageSync("electronicBookList")
            } else {
              that.setData({
                paperBookList: [],
                bookList: [],
              })
              wx.setStorageSync("paperBookList", []);
              wx.removeStorageSync("paperBookList")
            }
            wx.showModal({
              title: '提示!', //提示的标题