|
@@ -18,7 +18,10 @@ Page({
|
|
|
rankData: {},
|
|
|
share: false,
|
|
|
studyLog: [],
|
|
|
- height: ''
|
|
|
+ height: '',
|
|
|
+ productionData: {},
|
|
|
+ num2: 0,
|
|
|
+ productionMore: ''
|
|
|
},
|
|
|
|
|
|
lower: function (e) {
|
|
@@ -36,7 +39,15 @@ Page({
|
|
|
// }
|
|
|
},
|
|
|
|
|
|
+ setgrade: function (e) {
|
|
|
+ //console.log(this.setGrade)
|
|
|
+ this.setGrade.showPopup()
|
|
|
+ },
|
|
|
+
|
|
|
onLoad: function (options) {
|
|
|
+ //获取更改年级组件
|
|
|
+ this.setGrade = this.selectComponent("#set-grade");
|
|
|
+ console.log(this.setGrade)
|
|
|
//获取分享过来的值跳转页面
|
|
|
const ind = options.ind;
|
|
|
const postsId = options.postId || '';
|
|
@@ -53,6 +64,23 @@ Page({
|
|
|
this.setData({left: 200 });
|
|
|
}
|
|
|
}
|
|
|
+ /* 分享 */
|
|
|
+ const columnId = util.column('6').columnId;
|
|
|
+ this.distinction(2, columnId, 1, 2, res => {
|
|
|
+ if(res.data.success) {
|
|
|
+ console.log(res.data.data)
|
|
|
+ this.setData({
|
|
|
+ productionData: res.data.data
|
|
|
+ })
|
|
|
+ if(res.data.data) {
|
|
|
+ if(res.data.data.totalSize > 2) {
|
|
|
+ this.setData({
|
|
|
+ productionMore: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
onShow: function () {
|
|
|
//登录页信息
|
|
@@ -101,5 +129,52 @@ Page({
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ /* 区分答疑和分享 */
|
|
|
+ distinction: function(type, columnId, pageNo, pageSize, success) {
|
|
|
+ login.getOpenidSessionKey(function(res) {
|
|
|
+ //console.log(res.data.data.uid);
|
|
|
+ APIClient.getProductionSchedule({
|
|
|
+ uid: res.data.data.uid
|
|
|
+ }, {
|
|
|
+ "type": type,
|
|
|
+ "category": columnId,
|
|
|
+ "pageNo": pageNo,
|
|
|
+ "pageSize": pageSize
|
|
|
+ }).success(success)
|
|
|
+ }, function() {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
|
|
|
+ showCancel: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log('用户点击确定')
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /*点击加载更多*/
|
|
|
+ onMyEvent: function(e){
|
|
|
+ const columnId = util.column('6').columnId;
|
|
|
+ this.data.num2++
|
|
|
+ this.setData({
|
|
|
+ num: this.data.num2
|
|
|
+ })
|
|
|
+ this.distinction(2, columnId, 1, 5*this.data.num2, res => {
|
|
|
+ if(res.data.success) {
|
|
|
+ console.log(res.data.data)
|
|
|
+ this.setData({
|
|
|
+ productionData: res.data.data,
|
|
|
+ })
|
|
|
+ if(5*this.data.num2 > res.data.data.totalSize) {
|
|
|
+ this.setData({
|
|
|
+ productionMore: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
})
|