litian
2025-03-17 5b19b0e39a91e566a835460bf1213e7b3a0582b9
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -5,18 +5,18 @@
Page({
  data: {
    userInfo: null,
    active: 0,
    active: '0',
    description: "", //申请规则
    teacherInfo: {
      workInfo: null,
      schoolName: "",
      courseName: "",
      detailedAddress: ""
      address: ""
    },
    contactInfo: {
      fullName: "",
      user: "",
      phone: "",
      detailedAddress: ""
      address: ""
    },
    phoneError: false,
    paperBookList: [], //样书单纸质书
@@ -48,9 +48,9 @@
        that.setData({
          'teacherInfo.schoolName': JSON.parse(that.data.userInfo.data).schoolName,
          'teacherInfo.courseName': JSON.parse(that.data.userInfo.data).courseName,
          'contactInfo.fullName': JSON.parse(that.data.userInfo.data).fullName,
          'contactInfo.user': JSON.parse(that.data.userInfo.data).fullName,
          'contactInfo.phone': JSON.parse(that.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(that.data.userInfo.data).detailedAddress,
          'contactInfo.address': JSON.parse(that.data.userInfo.data).detailedAddress,
        })
      } else {
        wx.showModal({
@@ -154,6 +154,7 @@
          'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
        })
      }
    })
  },
  //获取当前已申请次数(电子)
@@ -187,7 +188,7 @@
  //姓名
  onFullNameInput(e) {
    this.setData({
      "contactInfo.fullName": e.detail.value,
      "contactInfo.user": e.detail.value,
    });
  },
  //输入手机号
@@ -209,13 +210,11 @@
      });
    }
  },
  onAddressInput() {
  onAddressInput(e) {
    this.setData({
      "contactInfo.detailedAddress": e.detail.value,
      "contactInfo.address": e.detail.value,
    });
  },
  submit() {
    let that = this;
    if (that.data.bookList.length > 0) {
@@ -253,7 +252,7 @@
          refType: 'applyBook'
        }
      } else {
        if (!(that.data.contactInfo.fullName && that.data.contactInfo.phone && that.data.contactInfo.detailedAddress)) {
        if (!(that.data.contactInfo.user && that.data.contactInfo.phone && that.data.contactInfo.address)) {
          wx.showToast({
            title: "请将收货人信息填写完整!",
            icon: 'none',
@@ -263,7 +262,7 @@
        }
        const mailAddress = JSON.stringify(that.data.contactInfo)
        that.setData({
          'teacherInfo.detailedAddress': mailAddress
          'teacherInfo.address': mailAddress
        })
        data = {
@@ -411,14 +410,14 @@
  // 监听页面软键盘弹起手动推动页面
  scrollToInput(keyboardHeight, scrollTop) {
    this.setData({
      keyboardHeight,
      keyboardHeight: keyboardHeight ? keyboardHeight + 300 : 0,
    });
    if (scrollTop) {
      try {
        this.getScrollOffset().then((lastScrollTop) => {
          wx.pageScrollTo({
            // 如果已经存在滚动,在此基础上继续滚
            scrollTop: lastScrollTop ? lastScrollTop + scrollTop : scrollTop,
            scrollTop: lastScrollTop ? lastScrollTop + scrollTop + 100 : scrollTop + 200,
            duration: 300,
          });
        });