litian
2024-02-29 cfdb5dd5655a2970f06b648ac28ea480f1c858ed
docs: y
2个文件已修改
36个文件已添加
1512 ■■■■■ 已修改文件
app.json 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/data.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/activateProduct/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/activateProduct/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/certificate/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/certificate/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/components/user-center-card/index.wxml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/components/user-center-card/index.wxss 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/downloads/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/downloads/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/feedBack/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/feedBack/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/feedBackSubmit/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/feedBackSubmit/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.js 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myCollection/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myCollection/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/index.js 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/index.wxml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/index.wxss 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/massageDetail/index.js 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/massageDetail/index.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/massageDetail/index.wxml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myMassage/massageDetail/index.wxss 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myOrder/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/myOrder/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/publishBooks/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/publishBooks/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/sampleBooks/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/sampleBooks/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/teacherCertification/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/teacherCertification/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/testLogin/index.js 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/testLogin/index.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/testLogin/index.wxml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/testLogin/index.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/personal/notification1.png 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -31,7 +31,21 @@
    "pages/order/fill-tracking-no/index",
    "pages/order/delivery-detail/index",
    "pages/order/invoice/index",
    "pages/usercenter/name-edit/index"
    "pages/usercenter/name-edit/index",
    "pages/teacherCertification/index",
    "pages/personalCenter/index",
    "pages/personalCenter/myOrder/index",
    "pages/personalCenter/myCollection/index",
    "pages/personalCenter/myMassage/index",
    "pages/personalCenter/myMassage/massageDetail/index",
    "pages/personalCenter/feedBack/index",
    "pages/personalCenter/feedBackSubmit/index",
    "pages/personalCenter/certificate/index",
    "pages/personalCenter/publishBooks/index",
    "pages/personalCenter/sampleBooks/index",
    "pages/personalCenter/downloads/index",
    "pages/personalCenter/activateProduct/index",
    "pages/testLogin/index"
  ],
  "tabBar": {
    "custom": true,
custom-tab-bar/data.js
@@ -23,6 +23,6 @@
  {
    icon: 'person',
    text: '个人中心',
    url: 'pages/usercenter/index',
    url: 'pages/personalCenter/index',
  },
];
pages/personalCenter/activateProduct/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/activateProduct/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/activateProduct/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/activateProduct/index.wxml-->
<text>pages/personalCenter/activateProduct/index.wxml</text>
pages/personalCenter/certificate/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/certificate/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/certificate/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/certificate/index.wxml-->
<text>pages/personalCenter/certificate/index.wxml</text>
pages/personalCenter/components/user-center-card/index.wxml
New file
@@ -0,0 +1,33 @@
<view class="user-center-card">
  <!-- 未登录的情况 -->
  <block wx:if="{{currAuthStep === AuthStepType.ONE}}">
    <view class="user-center-card__header" bind:tap="gotoUserEditPage">
      <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
      <view class="user-center-card__header__name">{{'请登录'}}</view>
      <view class="setting">
        <image src="/static/images/personal/setting.png" mode="heightFix" class="img" />
        <text>设置</text>
      </view>
    </view>
  </block>
  <!-- 已登录但未授权用户信息情况 -->
  <block wx:if="{{currAuthStep === AuthStepType.TWO}}">
    <view class="user-center-card__header">
      <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
      <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
      <!-- 需要授权用户信息,通过slot添加弹窗 -->
      <view class="user-center-card__header__transparent" wx:if="{{isNeedGetUserInfo}}">
        <slot name="getUserInfo" />
      </view>
      <!-- 不需要授权用户信息,仍然触发gotoUserEditPage事件 -->
      <view class="user-center-card__header__transparent" bind:tap="gotoUserEditPage" wx:else></view>
    </view>
  </block>
  <!-- 已登录且已经授权用户信息的情况 -->
  <block wx:if="{{currAuthStep === AuthStepType.THREE}}">
    <view class="user-center-card__header" bind:tap="gotoUserEditPage">
      <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.avatarUrl || defaultAvatarUrl}}" />
      <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
    </view>
  </block>
</view>
pages/personalCenter/components/user-center-card/index.wxss
New file
@@ -0,0 +1,60 @@
.user-center-card {
  background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
  background-size: cover;
  background-repeat: no-repeat;
  padding: 0 24rpx;
}
.user-center-card__header {
  margin-top: 160rpx;
  margin-bottom: 30rpx;
  margin-left: 20rpx;
  height: 96rpx;
  line-height: 48rpx;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  color: #333;
  position: relative;
}
.user-center-card__header__avatar {
  width: 96rpx;
  height: 96rpx;
  border-radius: 48rpx;
  overflow: hidden;
}
.user-center-card__header__name {
  font-size: 36rpx;
  line-height: 48rpx;
  color: #333;
  font-weight: bold;
  margin-left: 24rpx;
  margin-right: 16rpx;
}
.user-center-card__header__transparent {
  position: absolute;
  left: 0;
  top: 0;
  background-color: transparent;
  height: 100%;
  width: 100%;
}
.user-center-card__icon {
  line-height: 96rpx;
}
.setting {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.setting .img {
  height: 34rpx;
  width: 34rpx;
  margin-right: 10rpx;
}
pages/personalCenter/downloads/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/downloads/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/downloads/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/downloads/index.wxml-->
<text>pages/personalCenter/downloads/index.wxml</text>
pages/personalCenter/feedBack/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/feedBack/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/feedBack/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/feedBack/index.wxml-->
<text>pages/personalCenter/feedBack/index.wxml</text>
pages/personalCenter/feedBackSubmit/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/feedBackSubmit/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/feedBackSubmit/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/feedBackSubmit/index.wxml-->
<text>pages/personalCenter/feedBackSubmit/index.wxml</text>
pages/personalCenter/index.js
New file
@@ -0,0 +1,200 @@
const app = getApp()
const menuData = [
  {
    title: '我的订单',
    icon: '/static/images/personal/order.png',
    url: '/pages/personalCenter/myOrder/index',
    type: 'order',
  },
  {
    title: '激活商品',
    icon: '/static/images/personal/jihuo.png',
    url: '/pages/personalCenter/activateProduct/index',
    type: 'activateProduct',
  },
  {
    title: '我的证书',
    icon: '/static/images/personal/certificate.png',
    url: '/pages/personalCenter/certificate/index',
    type: 'certificate',
  },
  {
    title: '我的收藏',
    icon: '/static/images/personal/wodeshoucang.png',
    url: '/pages/personalCenter/myCollection/index',
    type: 'collection',
  },
  {
    title: '我的下载',
    icon: '/static/images/personal/download.png',
    url: '/pages/personalCenter/downloads/index',
    type: 'download',
  },
  {
    title: '样书申请',
    icon: '/static/images/personal/yangshushenqing.png',
    url: '/pages/personalCenter/sampleBooks/index',
    type: 'sampleBook',
  },
  {
    title: '出书申请',
    icon: '/static/images/personal/chushu.png',
    url: '/pages/personalCenter/publishBooks/index',
    type: 'publishBooks',
  },
  {
    title: '我的上传',
    icon: '/static/images/personal/upload.png',
    url: '',
    type: 'upload',
  }
];
const moreMenu = [
  {
    title: '我的消息',
    icon: '/static/images/personal/notification.png',
    url: '/pages/personalCenter/myMassage/index',
    type: 'message',
  },
  {
    title: '建议与反馈',
    icon: '/static/images/personal/feedback.png',
    url: '/pages/personalCenter/feedback/index',
    type: 'feedback',
  }
];
const moreMenu1 = [
  {
    title: '关于我们',
    icon: '/static/images/personal/about.png',
    url: '',
    type: 'aboutUs',
  },
  {
    title: '联系我们',
    icon: '/static/images/personal/contact.png',
    url: '',
    type: 'contact',
  }
];
Page({
  /**
   * 页面的初始数据
   */
  data: {
    show: false,
    userInfo: {
      avatarUrl:
        'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/avatar/avatar-1.jpg',
      nickName: 'TDesign',
      phoneNumber: '13438358888',
    },
    currAuthStep: 1,
    teacherState: {
      state: '',
      reasonTxt: '',
    },
    integral: 0,
    menuData,
    moreMenu,
    moreMenu1
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (wx.getStorageSync(app.config.userInfoKey)) {
      this.setData({
        show: true,
        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      })
      if (typeof this.getTabBar === 'function' && this.getTabBar()) {
        this.getTabBar().setData({
          selected: 4 //这个数字是当前页面在tabBar中list数组的索引
        })
      }
      this.getTeacherInfo()
    } else {
      wx.navigateTo({
        url: "/pages/testLogin/index",
      });
    }
  },
  /**
 * 生命周期函数--监听页面隐藏
 */
  onHide() {
    this.setData({
      show: false
    })
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    this.init();
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  //教师信息
  getTeacherInfo() {
    const data = {
      start: 0,
      size: 10,
      topicIdOrRefCode: 'teacherRoleApproval',
      appRefCode: app.config.appRefCode,
      sort: {
        type: 'Desc',
        field: 'CreateDate'
      }
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      console.log(this.data.userInfo, "userInfo")
      const resData = res.datas.find((i) => i.appUserCreator.userId == this.data.userInfo.userId)
      if (resData) {
        this.setData({
          teacherState: {
            state: resData.state,
            reasonTxt: resData.feedBack != null ? JSON.parse(resData.feedBack).reason : ''
          }
        })
      }
    })
  },
  //点击目录
  toPages(item) {
    console.log(item)
    let info = item.target.dataset.info
    if (info.url) {
      wx.navigateTo({
        url: info.url
      })
    } else {
      wx.showToast({
        title: "建设中",
        icon: 'none',
        duration: 2000
      })
    }
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/index.wxml-->
<text>pages/personalCenter/index.wxml</text>
pages/personalCenter/myCollection/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/myCollection/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/myCollection/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/myCollection/index.wxml-->
<text>pages/personalCenter/myCollection/index.wxml</text>
pages/personalCenter/myMassage/index.js
New file
@@ -0,0 +1,155 @@
import moment from 'moment'
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list: [],
    //分页
    page: 1,
    limit: 10,
    pageTotalCount: 0,
    bottomLoading: false,
    isMoreData: false,
    // 返回顶部
    isBackTop: false,
    setScrollValue: 0,
    skeletonLoding: true,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getDataList(false);
  },
  getDataList(isReachBottom) {
    app.MG.app.getAppMessageList({
      appRefCode: app.config.appRefCode,
      start: this.data.page * this.data.limit - this.data.limit,
      size: this.data.limit,
      sort: {
        type: "Desc",
        field: "CreateDate"
      }
    })
      .then(res => {
        try {
          if (res.datas.length > 0) {
            res.datas.forEach((item) => {
              item.createDate = moment(item.createDate).format("YYYY-MM-DD HH:mm");
            });
            let dataList = res.datas;
            //触底加载新数据并保留老数据
            if (isReachBottom) {
              dataList = [...this.data.list, ...dataList] //将新数据加入老数据中
            }
            this.setData({
              list: dataList,
              pageTotalCount: res.total,
              bottomLoading: false,
              isMoreData: dataList.length > 0 ? false : true,
              skeletonLoding: false,
            })
          } else {
            this.setData({
              skeletonLoding: false,
            })
          }
        } catch (error) {
          console.log(error)
        }
      })
  },
  toList(itemData) {
    let info = itemData.currentTarget.dataset.info;
    wx.navigateTo({
      url: "/pages/personalCenter/myMassage/massageDetail/index?id=" + info.id,
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    if (this._freshing) return
    this.setData({
      page: 1,
      limit: 10,
      pageTotalCount: 0,
      bottomLoading: false,
      isMoreData: false
    })
    this._freshing = true;
    this.setData({
      triggered: false,
    })
    this.getDataList(false);
    this._freshing = false
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
    this.setData({
      bottomLoading: true,
      isMoreData: false
    })
    let bool = false;
    if (this.data.pageTotalCount > this.data.list.length) {
      bool = true;
      this.setData({
        page: this.data.page + 1,
      })
    } else {
      setTimeout(() => {
        this.setData({
          bottomLoading: false,
          isMoreData: true
        })
      }, 100)
      return false;
    }
    this.getDataList(bool);
  },
  // 监听滚动距离
  onPageScroll(e) {
    if (e && e.scrollTop >= 1000) {
      this.setData({
        isBackTop: true
      })
    } else {
      this.setData({
        isBackTop: false
      })
    }
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/myMassage/index.wxml
New file
@@ -0,0 +1,35 @@
<view class="container" wx:if="{{!skeletonLoding}}">
  <scroll-view class="scroll content" bind:scroll="onPageScroll" model:scroll-top="{{setScrollValue}}" scroll-y refresher-enabled="{{true}}" lower-threshold="{{200}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bindrefresherpulling="{{refresh.onPulling}}" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom">
    <view slot="refresher" class="refresh-container">
      <view class="loading">
        <t-loading theme="circular" size="40rpx" text="正在刷新..." class="wrapper" />
      </view>
    </view>
    <view class="pageInfo" wx:if="{{list.length > 0}}">
      <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index">
        <view class="icon">
          <t-image src="/static/images/personal/notification1.png" mode="heightFix" class="img" />
        </view>
        <view class="item-con" data-info="{{item}}" bindtap="toList">
          <view class="titleBox">
            <view class="item-title">{{item.name}}</view>
            <view class="createDate">{{item.createDate}}</view>
          </view>
          <view class="description">
            {{item.description}}
          </view>
        </view>
      </view>
    </view>
    <view wx:if="{{list.length == 0}}" class="empyt">
      <t-empty icon="folder-open" description="暂无数据" />
    </view>
    <view class="bottom-loading" wx:if="{{bottomLoading}}">
      <t-loading theme="circular" size="40rpx" text="加载中..." class="wrapper" />
    </view>
    <view class="bottom-loading" style="color: #ccc;font-size: 28rpx;" wx:if="{{isMoreData}}">
      <text>没有更多了</text>
    </view>
  </scroll-view>
  <t-back-top theme="round" wx:if="{{isBackTop}}" text="顶部" bind:to-top="onToTop"></t-back-top>
</view>
pages/personalCenter/myMassage/index.wxss
New file
@@ -0,0 +1,60 @@
.pageInfo {
  padding: 40rpx 20rpx;
}
.content-item {
  padding: 20rpx 0;
  border-bottom: 1px solid #EDEDED;
  display: flex;
}
.content-item .icon {
  width: 58rpx;
  height: 58rpx;
}
.content-item .icon .img {
  width: 100%;
  height: 100%;
}
.item-con {
  flex: 1;
  margin-left: 30rpx;
}
.titleBox {
  display: flex;
  justify-content: space-between
}
.titleBox .item-title {
  font-weight: bold;
}
.createDate {
  font-size: 24rpx;
  color: #949494;
}
.description {
  font-size: 24rpx;
  height: 88rpx;
  line-height: 40rpx;
  display: -webkit-box;
  margin-top: 20rpx;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.refresh-container {
  margin: 0 auto;
}
.bottom-loading,
.loading {
  padding: 20rpx;
  text-align: center;
}
pages/personalCenter/myMassage/massageDetail/index.js
New file
@@ -0,0 +1,79 @@
const app = getApp();
import moment from 'moment'
Page({
  /**
   * 页面的初始数据
   */
  data: {
    dataInfo: {}
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getDataInfo(options.id)
  },
  getDataInfo(id) {
    app.MG.app.getMessage({
      messageId: id
    })
      .then(res => {
        res.createDate = moment(res.createDate).format("YYYY-MM-DD HH:mm");
        this.setData({
          dataInfo: res,
        })
      })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/myMassage/massageDetail/index.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "我的消息",
  "usingComponents": {}
}
pages/personalCenter/myMassage/massageDetail/index.wxml
New file
@@ -0,0 +1,8 @@
<view class="container">
  <view>
    <view class="name">{{dataInfo.name}}</view>
    <view class="createDate">{{dataInfo.createDate}}</view>
    <view class="description">{{dataInfo.description}}</view>
    <rich-text space="emsp" nodes="{{dataInfo.content}}" class="content" />
  </view>
</view>
pages/personalCenter/myMassage/massageDetail/index.wxss
New file
@@ -0,0 +1,28 @@
.container {
  padding: 20rpx;
}
.name {
  text-align: center;
  font-size: 32rpx;
  font-weight: bold;
}
.createDate {
  margin-top: 20rpx;
  color: #999;
  text-align: center;
  font-size: 28rpx;
}
.description {
  padding: 30rpx 0;
  color: #999;
  font-size: 28rpx;
  line-height: 40rpx;
}
.content {
  font-size: 28rpx;
  line-height: 40rpx;
}
pages/personalCenter/myOrder/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/myOrder/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/myOrder/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/myOrder/index.wxml-->
<text>pages/personalCenter/myOrder/index.wxml</text>
pages/personalCenter/publishBooks/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/publishBooks/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/publishBooks/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/publishBooks/index.wxml-->
<text>pages/personalCenter/publishBooks/index.wxml</text>
pages/personalCenter/sampleBooks/index.js
New file
@@ -0,0 +1,66 @@
// pages/personalCenter/sampleBooks/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personalCenter/sampleBooks/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personalCenter/sampleBooks/index.wxml-->
<text>pages/personalCenter/sampleBooks/index.wxml</text>
pages/teacherCertification/index.js
New file
@@ -0,0 +1,66 @@
// pages/teacherCertification/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/teacherCertification/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/teacherCertification/index.wxml-->
<text>pages/teacherCertification/index.wxml</text>
pages/testLogin/index.js
New file
@@ -0,0 +1,132 @@
// pages/testLogin/index.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    textName: "18892081234",
    textPassword: "xA123456",
    loading: false,
    userInfo: {
      name: "",
      icon: ""
    }
  },
  // 登录
  onLogin() {
    this.setData({
      loading: true
    })
    const data = {
      loginName: this.data.textName,
      password: this.data.textPassword,
      appRefCode: app.config.appRefCode,
      platform: "Mobile",
    };
    app.MG.identity.loginByPassword(data).then(res => {
      if (res && res.status == "Ok") {
        this.setData({
          loginInfo: JSON.stringify(res)
        })
        wx.setStorageSync(app.config.tokenKey, res.token);
        this.getUserInfo()
      } else {
        wx.showToast({
          title: res.message || "手机号或密码错误",
          icon: "error",
          duration: 2000
        })
      }
    });
  },
  // 获取用户信息
  // 获取登录用户身份
  getUserInfo() {
    app.MG.identity.getCurrentAppUser().then(res => {
      // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认)
      if (res) {
        console.log(res, "user");
        let defaultUser = {};
        let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword')
        let WeChatInfo = res.infoList.find((item) => item.type === "WeChat");
        if (WeChatInfo) {
          defaultUser = {
            nickName: WeChatInfo.name,
            avatarUrl: WeChatInfo.icon,
            userId: res.userId
          }
        }
        if (secretData) {
          defaultUser = {
            nickName: secretData.credential,
            avatarUrl: "../../static/images/index/tab.png",
            userId: res.userId
          }
        }
        this.setData({
          userInfo: defaultUser,
          loading: false
        })
        wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo));
      }
      wx.switchTab({
        url: '/pages/home/home'
      })
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  }
})
pages/testLogin/index.json
New file
@@ -0,0 +1,6 @@
{
  "usingComponents": {
    "t-input": "tdesign-miniprogram/input/input",
    "t-button": "tdesign-miniprogram/button/button"
  }
}
pages/testLogin/index.wxml
New file
@@ -0,0 +1,8 @@
<!--pages/testLogin/index.wxml-->
<view>
  <t-input label="用户账号" placeholder="请输入用户名" model:value="{{textName}}" suffixIcon="{{ { name: 'user-avatar', ariaLabel: '通讯录' } }}"></t-input>
  <t-input label="用户密码" placeholder="请输入密码" type="password" model:value="{{textPassword}}" clearable />
</view>
<view class="button-example">
  <t-button theme="primary" loading="{{loading}}"  bindtap="onLogin" size="large" block>立即登录</t-button>
</view>
pages/testLogin/index.wxss
New file
@@ -0,0 +1,4 @@
/* pages/testLogin/index.wxss */
.button-example {
  margin: 60rpx 32rpx;
}
static/images/personal/notification1.png