litian
2024-02-29 cfdb5dd5655a2970f06b648ac28ea480f1c858ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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() {
 
  }
})