litian
2024-03-27 ccf200b60ad213343a13d36c17c5ee5ac5cd7b7a
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -1,4 +1,6 @@
import { worksDataBytool } from "../../../../assets/js/toolClass.js";
import {
  worksDataBytool
} from "../../../../assets/js/toolClass.js";
const app = getApp();
Page({
  data: {
@@ -16,6 +18,7 @@
      phone: "",
      detailedAddress: ""
    },
    phoneError: false,
    paperBookList: [], //样书单纸质书
    electronicBookList: [], //样书单电子书
    ebookCount: 0,
@@ -58,12 +61,7 @@
      this.getSelectBookCount();
      this.getSelectPaperBookCount();
      this.getPaperType();
    } else {
      wx.navigateTo({
        url: "/pages/testLogin/index",
      });
    }
  },
  tabClick(item) {
@@ -84,7 +82,9 @@
  },
  getElectronType() {
    app.MG.resource.getCmsTypeByRefCode({ refCodes: ['jsek_electronicSampleBook'] }).then((res) => {
    app.MG.resource.getCmsTypeByRefCode({
      refCodes: ['jsek_electronicSampleBook']
    }).then((res) => {
      this.setData({
        description: res[0].description,
        'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
@@ -132,6 +132,31 @@
        })
      })
  },
  //姓名
  onFullNameInput(e) {
    this.setData({
      "contactInfo.fullName": e.detail.value,
    });
  },
  //输入手机号
  onPhoneInput(e) {
    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) {
      this.setData({
        phoneError: !isPhoneNumber,
        "contactInfo.phone": e.detail.value,
      });
    }
  },
  onAddressInput() {
    this.setData({
      "contactInfo.detailedAddress": e.detail.value,
    });
  },
  submit() {
    let that = this;
@@ -178,7 +203,6 @@
          })
          return
        }
        const mailAddress = JSON.stringify(that.data.contactInfo)
        that.setData({
          'teacherInfo.detailedAddress': mailAddress
@@ -223,8 +247,7 @@
                  wx.navigateTo({
                    url: "/packagePersonal/pages/sampleBooks/index?stateTab=1&tabActive=" + that.data.active,
                  });
                } else if (res.cancel) {
                }
                } else if (res.cancel) {}
              }
            })
          })
@@ -271,8 +294,7 @@
            })
            wx.setStorageSync("paperBookList", pList);
          }
        } else if (res.cancel) {
        }
        } else if (res.cancel) {}
      }
    })
  },