yiming
2024-06-21 f5932f85898de7284c9f16d314b4a1c572b31c73
pages/bibliographyList/index.js
@@ -8,6 +8,7 @@
     * 页面的初始数据
     */
    data: {
      personalDataEmail: '',
      hiddenmodalput: false,
      name: "",
      phoneNum: '',
@@ -67,6 +68,8 @@
          });
        },
      })
      this.ceShi()
    },
    /**
@@ -151,8 +154,8 @@
        },
        fields: {
          jsek_link: [],
          content: [],
          subtitle: [],
          content: [],
          fileType: [],
          jsek_resource: [],
          freeFile: [],
@@ -165,7 +168,7 @@
        })
        this.setData({
          higherList: res.datas,
          higherTotal: res.total
          higherTotal: res.total.le
        })
        this.setData({
          loading: false, //开启骨架屏加载
@@ -420,34 +423,24 @@
        Md5: item.datas.freeFile.FileList[0].Md5,
        dialogBox: true
      })
      // wx.showModal({
      //   title: '请输入邮箱',
      //   content: '',
      //   confirmColor: '#ff6c00',
      //   cancelColor: '#949494',
      //   placeholderText: '请输入邮箱号',
      //   editable: true,
      //   complete: (res) => {
      //     if (res.cancel) {
      //       console.log('取消');
      //     }
      //     if (res.confirm) {
      //       this.setData({
      //         input: res.content
      //       })
      //       this.confirmM()
      //     }
      // wx.scanCode({
      //   success: res => {
      //     console.log(res);
      //   }
      // })
    },
    // 弹窗取消
    closeDialog() {
      this.setData({
        dialogBox: false
        dialogBox: false,
        // input: ''
      })
    },
    //提交
    confirmM(e) {
      wx.showLoading({
        title: '发送中...',
      })
      const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input);
      if (isEmailValid && this.data.input) {
        this.setData({
@@ -458,6 +451,7 @@
          md5s: [this.data.Md5]
        }
        app.MG.file.sendFileWithEmail(query).then(res => {
          wx.hideLoading()
          if (res) {
            wx.showToast({
              icon: 'success',
@@ -477,5 +471,26 @@
      this.setData({
        input: e.detail.value
      })
    },
    ceShi() {
      let that = this;
      // 获取Storage中的数据
      wx.getStorage({
        key: 'website-front-userInfo',
        success(res) {
          let datas = JSON.parse(res.data)
          console.log(datas.Email);
          let personalData = JSON.parse(datas.data)
          that.setData({
            input: datas.Email
          })
          console.log(that.data.value);
        },
        fail(err) {
          console.error(err);
        }
      });
    }
  })