浏览代码

新增各个页面

Limengbo 6 年之前
父节点
当前提交
ba40300556

+ 11 - 24
compontents/chat/chat.js

@@ -1,23 +1,6 @@
 // compontents/chat/chat.js
 
 Component({
-  relations: {
-    '../discuss/discuss': {
-      type: 'child', // 关联的目标节点应为子节点
-      linked: function(target) {
-        // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后
-        console.log(target)
-      },
-      linkChanged: function(target) {
-        // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后
-        console.log(target)
-      },
-      unlinked: function(target) {
-        // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
-        console.log(target)
-      }
-    }
-  },
   /**
    * 组件的属性列表
    */
@@ -38,6 +21,10 @@ Component({
       type: String,
       value: '' 
     },
+    columnType: {
+      type: String,
+      value: '' 
+    },
   },
 
   /**
@@ -55,8 +42,9 @@ Component({
   methods: {
     uploadImage (e) {
       const type = this.properties.type;
+      const columnType = this.properties.columnType;
       wx.navigateTo({
-        url: '../input_content/input_content?type=' + type
+        url: '../input_content/input_content?type=' + type + '&columnType=' + columnType 
       })
     },
     listenerButtonPreviewImage: function(e) {
@@ -81,14 +69,13 @@ Component({
       const postId = e.currentTarget.dataset.postsid;
       this.share.showPopup(postId);
     },
-    _getAllLi: function(){
-      // 使用getRelationNodes可以获得nodes数组,包含所有已关联的custom-li,且是有序的
-      var nodes = this.getRelationNodes('../discuss/discuss');
-      console.log(nodes);
+    examine: function () {
+      //console.log(1)
+      var myEventDetail = {} // detail对象,提供给事件监听函数
+      var myEventOption = {} // 触发事件的选项
+      this.triggerEvent('myevent', myEventDetail, myEventOption)
     }
   },
   ready: function(){
-    this._getAllLi()
-    this.share = this.selectComponent("#share");
   }
 })

+ 1 - 1
compontents/chat/chat.wxml

@@ -42,7 +42,7 @@
             </view>
             <discuss discussData="{{item.replyList}}" uid="{{item.userId}}" postsId="{{item.id}}" id="discuss" type="{{type}}"/>
         </view>
-        <view class="more">查看更多</view>
+        <view class="more" bindtap="examine">查看更多</view>
     </view>
     <view class="no-con" wx:if="{{!productionData.list && type == 2}}">
         <view class="state">你还没有上传作品</view>

+ 6 - 3
compontents/lesson_list/lessonList.js

@@ -4,14 +4,16 @@ Component({
    * 组件的属性列表
    */
   properties: {
-
+    lessonData: {
+      type: Array,
+      value: []
+    }
   },
 
   /**
    * 组件的初始数据
    */
   data: {
-    arr: ['钻石', '四季', '踏雪寻梅', '鹅鹅鹅', 'aaa'],
     flag: false,
     animationData: {},
   },
@@ -22,11 +24,12 @@ Component({
   methods: {
     onTap (e) {
       let flage = e.target.dataset.flag;
+      const height = this.properties.lessonData.length * 70;
       if(flage){
         this.util(flage, '270rpx');
         this.setData({'flag': false})
       } else {
-        this.util(flage, '400rpx');
+        this.util(flage, height + 'rpx');
         this.setData({'flag': true})
       }
     },

+ 5 - 6
compontents/lesson_list/lessonList.wxml

@@ -9,14 +9,13 @@
         </view>
     </view>
     <view class=" timer-shaft " animation="{{animationData}}">
-        <view class="art-lesson" wx:for="{{arr}}" wx:key="{{index}}" >
+        <view class="art-lesson" wx:for="{{lessonData}}" wx:key="{{index}}" >
             <view class="graph">
-                <view class="yuan check"></view>
-                <view class="long-line check {{(arr.length - 1 == index) || (index == 3 && !flag) ? 'none' : ''}}" ></view>
+                <view class="yuan {{item.isStudy ? 'check' : 'no-check'}} "></view>
             </view>
-            <view class="art-con">
-                <text>{{item}}</text>
-                <text>28分钟前</text>
+            <view class="{{item.isStudy ? 'art-con' : 'art-con-color'}}">
+                <text >{{item.title}}</text>
+                <text>{{item.isStudy ? '28分钟前' : '未学习'}}</text>
             </view>
         </view>
     </view>

+ 12 - 0
compontents/lesson_list/lessonList.wxss

@@ -60,6 +60,14 @@
     color: #444;
 }
 
+.art-con-color {
+    display: flex;
+    justify-content: space-between;
+    margin-left: 53rpx;
+    font-size: 28rpx;
+    color: #878787;
+}
+
 .graph {
     position: absolute;
     left: 0;
@@ -88,6 +96,10 @@
     background: #48bdfb;
 }
 
+.no-check {
+    border: 2rpx solid #878787;
+}
+
 .nocheck {
     background: #878787;
 }

+ 54 - 0
compontents/preview/preview.js

@@ -0,0 +1,54 @@
+// compontents/lesson_list/lessonList.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    materialData: {
+      type: Array,
+      value: []
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    animationData: {},
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onTap (e) {
+      let flage = e.target.dataset.flag;
+      const height = this.properties.materialData.length * 70;
+      if(flage){
+        this.util(flage, '270rpx');
+        this.setData({'flag': false})
+      } else {
+        this.util(flage, height + 'rpx');
+        this.setData({'flag': true})
+      }
+    },
+    /* 创建动画并执行 */
+    util (flag, height) {
+      // 创建动画实例   
+      var animation = wx.createAnimation({  
+        duration: 200,  //动画时长  
+        timingFunction: "linear", //线性  
+        delay: 0  //0则不延迟  
+      });
+      
+      this.animation = animation;
+
+      animation.height(height).step();
+
+      this.setData({  
+        animationData: animation.export()  
+      })  
+    }
+  }
+})

+ 4 - 0
compontents/preview/preview.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 42 - 0
compontents/preview/preview.wxml

@@ -0,0 +1,42 @@
+<!--compontents/lesson_list/lessonList.wxml-->
+
+
+<view class="material">
+    <view class="this-week">
+        <image src="../../pages/image/study.png"></image>
+        <view class="lesson-name">
+            <text>学习资料</text>
+            <text>本周和历史学习资料</text>
+        </view>
+    </view>
+    <view class="material-con" animation="{{animationData}}">
+        <view class="art-img" wx:for="{{materialData}}" wx:key="{{index}}">
+            <text>{{item.warePath}}</text>
+            <text>点击预览</text>
+        </view>
+    </view>
+    <text class="unfold" data-flag="{{flag}}" bindtap="onTap">展开</text>
+</view>
+
+<!-- <view class="lesson-list">
+    <view class="this-week">
+        <image src="../../pages/image/courseware.png"></image>
+        <view class="lesson-name">
+            <text>课件列表</text>
+            <text>本周推荐课已经完成了</text>
+        </view>
+    </view>
+    <view class=" timer-shaft " animation="{{animationData}}">
+        <view class="art-lesson" wx:for="{{lessonData}}" wx:key="{{index}}" >
+            <view class="graph" wx:if="{{!item.isStudy}}">
+                <view class="yuan check"></view>
+                <view class="long-line check {{(lessonData.length - 1 == index) || (index == 4 && !flag) ? 'none' : ''}}" ></view>
+            </view>
+            <view class="{{item.isStudy ? 'art-con' : 'art-con-color'}}">
+                <text >{{item.title}}</text>
+                <text>{{item.isStudy ? '28分钟前' : '未学习'}}</text>
+            </view>
+        </view>
+    </view>
+    <text class="unfold" data-flag="{{flag}}" bindtap="onTap">展开</text>
+</view> -->

+ 65 - 0
compontents/preview/preview.wxss

@@ -0,0 +1,65 @@
+/* compontents/lesson_list/lessonList.wxss */
+
+.material {
+  width: 100%;
+  margin: 20rpx 0;
+  border-radius: 25rpx;
+  padding: 20rpx 0;
+  box-sizing: border-box;
+  background: #fff;
+  position: relative;
+}
+
+.this-week {
+    display: flex;
+    padding: 0 25rpx;
+    box-sizing: border-box;
+}
+
+.this-week image {
+  width: 86rpx;
+  height: 86rpx;
+}
+.lesson-name {
+    display: flex;
+    flex-direction: column;
+    margin: 8rpx  16rpx;
+}
+
+.lesson-name text:nth-child(1) {
+    height: 38rpx;
+    font-size: 32rpx;
+    font-weight: 600;
+}
+
+.lesson-name text:nth-child(2) {
+    height: 30rpx;
+    margin-top: 10rpx;
+    font-size: 24rpx;
+    color: #C3C3C3;
+}
+
+/* 预览图片 */
+.material-con {
+    height: 270rpx;
+    margin: 0 0 68rpx 10rpx;
+    padding: 0 25rpx;
+    overflow: hidden;
+}
+
+.art-img {
+    display: flex;
+    justify-content: space-between;
+    margin-left: 53rpx;
+    font-size: 28rpx;
+    color: #444;
+    margin-top: 30rpx;
+}
+
+.unfold {
+    position: absolute;
+    right: 28rpx;
+    bottom: 24rpx;
+    font-size: 28rpx;
+    color: #93AAFA;
+}

+ 1 - 0
compontents/tarbar/tarbar.js

@@ -78,6 +78,7 @@ Component({
   },
   ready() {
     let options = util.getUrl();
+    console.log(options)
     if(options.ind) {
       this.setData({ navBtnSelectIdx: options.ind});
     }

+ 80 - 33
pages/art/art.js

@@ -9,12 +9,58 @@ Page({
     flag: false,
     productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
-  methods: {
-    shareImage: function(e) {
-      console.log(e.target.dataset.flag)
-    }
+  /* 区分答疑和分享 */
+  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,
+        "columnId": 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){
+    let type = e.currentTarget.dataset.type;
+    let num = e.currentTarget.dataset.num;
+    num++;
+    const columnId = util.column('6').columnId;
+    this.distinction(type, columnId, 1, 5*num, res => {
+      if(res.data.success) {
+        console.log(res.data.data)
+        if(type == 1) {
+          this.setData({
+            questionsData: res.data.data,
+          })
+        }
+        if(type == 2) {
+          this.setData({
+            productionData: res.data.data,
+          })
+        }
+        
+      }
+    });
   },
 
   onLoad: function (options) {
@@ -25,35 +71,9 @@ Page({
   },
 
   onShow: function () {
-    /* 区分答疑和分享 */
-    let distinction = (type, success) => {
-      login.getOpenidSessionKey(function(res) {
-        //console.log(res.data.data.uid);
-        APIClient.getProductionSchedule({
-          uid: res.data.data.uid
-        }, {
-          "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
-          "pageNo": 1,
-          "pageSize": 6
-        }).success(success)
-      }, function() {
-        wx.showModal({
-          title: '提示',
-          content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
-          showCancel: false,
-          success: function (res) {
-            if (res.confirm) {
-              console.log('用户点击确定')
-            } else if (res.cancel) {
-              console.log('用户点击取消')
-            }
-          }
-        })
-      });
-    };
+    const columnId = util.column('6').columnId;
     /* 分享 */
-    distinction(2, res => {
+    this.distinction(2, columnId, 1, 2, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
@@ -63,7 +83,7 @@ Page({
       
     });
     /* 答疑 */
-    distinction(1, res => {
+    this.distinction(1, columnId, 1, 2, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
@@ -71,6 +91,33 @@ Page({
         })
       }
     });
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 6
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
+        this.setData({
+          courseData: res.data.data
+        })
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+    });
   },
   /* 转发*/
   onShareAppMessage: function (ops) {

+ 1 - 0
pages/art/art.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 13 - 122
pages/art/art.wxml

@@ -7,140 +7,31 @@
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
           <!-- 科学艺术 -->
           <view class="art">
-            <target/>
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
 
-            <lessonList/>
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
 
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
-            <!--<view class="works">
-                <view class="title">
-                    <image src="../image/xing.png" class="xing"></image>
-                    <text class="">作品分享</text>
-                    <image src="../image/xing.png" class="xing"></image>
-                    <text class="uploading" bindtap="uploadImage">分享作品</text>
-                </view>
-                <view >
-                    <view class="share-con" wx:for="{{productionData.list}}" wx:key="{{index}}">
-                        <view class="head">
-                            <view class="head-img">
-                                <image src="{{item.featureMap.headImgUrl}}"></image>
-                            </view>    
-                            <view class="lesson-name">
-                                <text>{{item.featureMap.wechatName}}</text>
-                                <text style="height: 100%">{{item.title}}</text>
-                            </view>
-                            <view class="share-up-box" bindtap="shareImage">
-                                <image class="share_up" src="../image/share_up.png"></image>
-                            </view>
-                        </view>
-                        <view class="picture">
-                            <block wx:for="{{item.imagesList}}" wx:for-item="items" wx:key="{{items.id}}">
-                            <image src="{{items.path}}" bindtap="listenerButtonPreviewImage" data-img="{{items.path}}"></image>
-                            </block>
-                        </view>
-                        <view class="icon">
-                            <view>
-                                <image src="../image/zan.png" class="zan"></image>
-                                <text>{{item.postsAttributeInfo ? item.postsAttributeInfo.favors : '0'}}</text>
-                            </view>
-                            <view>
-                                <image src="../image/weatch.png" class="weatch"></image>
-                                <text>{{item.postsAttributeInfo ? item.postsAttributeInfo.views : '0'}}</text>
-                            </view>
-                            <view>
-                                <image src="../image/discuss.png" class="discuss"></image>
-                                <text>{{item.replyCount}}</text>
-                            </view>
-                        </view>
-                        <chat chatData="{{item.replyList}}" uid="{{item.userId}}" postsId="{{item.id}}"/> 
-                    </view>
-                    <view class="more">查看更多</view>
-                </view>
-                <view class="no-con" style="display: none;">
-                    <view class="state">你还没有上传作品</view>
-                    <view class="upload-works">
-                        <image src="../image/work_box.png" class="work-box"></image>
-                        <image src="../image/uploading_works.png" class="uploading-works"></image>
-                        <text>上传作品</text>
-                    </view>
-                </view>
-            </view>-->
             <chat 
                 productionData="{{productionData}}" 
                 title="作品分享"
                 query="分享作品"
-                type="2"/>
+                type="2"
+                columnType="6"
+                bind:myevent="onMyEvent"
+                data-type="2"
+                data-num="0"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
-            
-            <!-- <view class="share">
-                <view class="title">
-                    <image src="../image/xing.png" class="xing"></image>
-                    <text class="">答疑讨论</text>
-                    <image src="../image/xing.png" class="xing"></image>
-                </view>
-                <view >
-                    <view class="questions">
-                        <view class="head">
-                            <view class="head-img">
-                                <image src="../image/medal.png"></image>
-                            </view>
-                            <view class="lesson-name">
-                                <text>李佳怡</text>
-                                <text style="height: 100%">第一次发作品,请大家多多关注第一次发作品,请大家多多关注,第一次发作品,请大家多多关注,第一次发作品,请大家多多关注</text>
-                            </view>
-                            <view class="dian"></view>
-                        </view>
-                        <view class="icon">
-                            <view>
-                                <image src="../image/zan.png" class="zan"></image>
-                                <text>534</text>
-                            </view>
-                            <view>
-                                <image src="../image/weatch.png" class="weatch"></image>
-                                <text>1534</text>
-                            </view>
-                            <view>
-                                <image src="../image/discuss.png" class="discuss"></image>
-                                <text>534</text>
-                            </view>
-                        </view>
-                    </view>
-                    <view class="more">查看更多</view>
-                </view>
-                <view class="no-con" style="display: none;">
-                    <view class="state">你还没有提问过问题</view>
-                    <view class="upload-works">
-                        <image src="../image/work_box.png" class="work-box"></image>
-                        <image src="../image/questions.png" class="uploading-works"></image>
-                        <text>提问问题</text>
-                    </view>
-                </view>
-            </view> -->
-
+                type="1"
+                columnType="6"
+                bind:myevent="onMyEvent"
+                data-type="1"
+                data-num="0"/>
 
             <view class="questions-one">
                 <image src="../image/q_discuss.png" ></image>

+ 33 - 40
pages/chinese/chinese.js

@@ -7,33 +7,29 @@ const login = require('../../utils/loginSchedule.js');
 Page({
   data: {
     flag: false,
-    productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
   methods: {
-    shareImage: function(e) {
-      console.log(e.target.dataset.flag)
-    }
+
   },
 
   onLoad: function (options) {
-    //分享按钮
-    wx.showShareMenu({
-      withShareTicket: true
-    })
+   
   },
 
   onShow: function () {
+    const columnId = util.column('3').columnId;
     /* 区分答疑和分享 */
-    let distinction = (type, success) => {
+    let distinction = (type, columnId, success) => {
       login.getOpenidSessionKey(function(res) {
         //console.log(res.data.data.uid);
         APIClient.getProductionSchedule({
           uid: res.data.data.uid
         }, {
           "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+          "columnId": columnId,
           "pageNo": 1,
           "pageSize": 6
         }).success(success)
@@ -52,44 +48,41 @@ Page({
         })
       });
     };
-    /* 分享 */
-    distinction(2, res => {
+    /* 答疑 */
+    distinction(1, columnId, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
-          productionData: res.data.data,
+          questionsData: res.data.data,
         })
       }
-      
     });
-    /* 答疑 */
-    distinction(1, res => {
-      if(res.data.success) {
-        console.log(res.data.data)
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 3
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
         this.setData({
-          questionsData: res.data.data,
+          courseData: res.data.data
         })
-      }
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
     });
   },
-  /* 转发*/
-  onShareAppMessage: function (ops) {
-    if (ops.from === 'button') {
-      // 来自页面内转发按钮
-      console.log(ops.target)
-    }
-    const postId = ops.target.dataset.postid;
-    return {
-      title: '小学王者班',
-      path: `pages/transmit/transmit?ind=7&postId=${postId}`,
-      success: function (res) {
-        // 转发成功
-        console.log("转发成功:" + JSON.stringify(res));
-      },
-      fail: function (res) {
-        // 转发失败
-        console.log("转发失败:" + JSON.stringify(res));
-      }
-    }
-  },
 })

+ 1 - 0
pages/chinese/chinese.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 8 - 27
pages/chinese/chinese.wxml

@@ -1,43 +1,24 @@
-<!--pages/art/art.wxml-->
+<!--pages/chinese/chinese.wxml-->
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
-          <!-- 科学艺术 -->
-          <view class="art">
-            <target/>
+          <!--中文  -->
+          <view class="chinese">
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
 
-            <lessonList/>
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
 
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
-            
-            <view>语文</view>
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
+                type="1"
+                columnType="3"/>
 
 
             <view class="questions-one">

+ 2 - 212
pages/chinese/chinese.wxss

@@ -1,6 +1,6 @@
-/* pages/art/art.wxss */
+/* pages/chinese/chinese.wxss */
 
-.art {
+.chinese {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
@@ -48,216 +48,6 @@
     color: #C3C3C3;
 }
 
-
-/* 预览图片 */
-.material-con {
-    margin-left: 10rpx;
-    padding: 0 25rpx;
-}
-
-.art-img {
-    display: flex;
-    justify-content: space-between;
-    margin-left: 53rpx;
-    font-size: 28rpx;
-    color: #444;
-    margin-top: 30rpx;
-}
-
-/* 分享评论 */
-.works,
-.share {
-    padding: 16rpx 25rpx;
-}
-
-.works .title,
-.share .title {
-    position:relative;
-    width: 100%;
-    text-align: center;
-    font-size: 32rpx;
-    font-weight: 600;
-    border-bottom: 2rpx #878787 solid;
-    padding-bottom: 16rpx;
-    background: #fff;
-}
-
-.xing {
-    width: 20rpx;
-    height: 20rpx;
-    margin: 0 10rpx;
-}
-
-.uploading {
-    position: absolute;
-    right: 0;
-    top: 10rpx;
-    font-size: 24rpx;
-}
-
-.share-con,
-.questions {
-    position:relative;
-    margin-top: 28rpx;
-    padding-bottom: 58rpx;
-    border-bottom: 2rpx #878787 solid;
-}
-
-.share-con .head {
-    position:relative;
-    padding:20rpx 0;
-}
-
-.head-img {
-    width: 86rpx;
-    height: 86rpx;
-    float: left;  
-    margin-right: 18rpx; 
-}
-
-.head-img image {
-    width: 100%;
-    height: 100%;
-    border-radius: 50%;
-}
-
-
-.picture {
-    display: flex;
-    justify-content: center;    
-    margin: 24rpx 112rpx 17rpx 103rpx;
-
-}
-.picture image {
-     width: 236rpx;
-     height: 176rpx;
-     border-radius: 15rpx;
- }
-
-.picture image:nth-child(2) {
-    margin-left: 8rpx;
-}
-
-.share_up {
-    position: absolute;
-    right: 0;
-    top: 20rpx;
-    height: 19rpx;
-    width: 19rpx;
-}
-
-.icon {
-    display: flex;
-    align-items: center;
-    margin: 0 112rpx 17rpx 103rpx;
-}
-
-.icon view {
-    display: flex;
-    align-items: center;
-    margin-right: 60rpx;
-}
-
-.icon .zan {
-    width: 26rpx;
-    height: 23rpx;
-}
-
-.icon .weatch {
-    width: 30rpx;
-    height: 23rpx;
-}
-
-.icon .discuss {
-    width: 32rpx;
-    height: 29rpx;  
-}
-
-.icon view text {
-    font-size: 24rpx;
-    color: #878787;
-    margin-left: 14rpx;
-}
-
-
-.more {
-    margin-top: 18rpx;
-    font-size: 28rpx;
-    text-align: center;
-    color: #787878;
-}
-
-.no-con {
-    margin: 50rpx 0 ;
-}
-
-.state {
-    text-align: center;
-    font-size: 24rpx;
-    color: #C0C0C0;
-}
-
-.upload-works {
-    position: relative;
-    width: 212rpx;
-    height: 212rpx;
-    margin: 0 auto;
-}
-
-.work-box {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 212rpx;
-    height: 212rpx;
-}
-
-.uploading-works {
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    z-index: 1;
-    width: 67rpx;
-    height: 51rpx;
-    transform: translate(-50%, -50%);
-}
-
-.upload-works text {
-    position: absolute;
-    left: 50%;
-    top: 70%;
-    z-index: 1;
-    font-size: 24rpx;
-    color: #C0C0C0;
-    transform: translate(-50%);
-}
-
-
-
-
-
- 
- /* 答疑讨论 */
- .questions {
-    padding-bottom: 28rpx;
-}
-
- .questions .head {
-    padding:20rpx 0;
-    position: relative;
- }
-
-
-.dian {
-     position: absolute;
-     right: 45rpx;
-     top: 40rpx;
-     width: 20rpx;
-     height: 20rpx;
-     border-radius: 50%;
-     background: #FD025F;
- }
-
  /* 标题定位到顶部 */
  .adsorb {
   position: fixed;

+ 34 - 41
pages/english/english.js

@@ -7,35 +7,31 @@ const login = require('../../utils/loginSchedule.js');
 Page({
   data: {
     flag: false,
-    productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
   methods: {
-    shareImage: function(e) {
-      console.log(e.target.dataset.flag)
-    }
+
   },
 
   onLoad: function (options) {
-    //分享按钮
-    wx.showShareMenu({
-      withShareTicket: true
-    })
+
   },
 
   onShow: function () {
+    const columnId = util.column('4').columnId;
     /* 区分答疑和分享 */
-    let distinction = (type, success) => {
+    let distinction = (type, columnId, success) => {
       login.getOpenidSessionKey(function(res) {
         //console.log(res.data.data.uid);
         APIClient.getProductionSchedule({
           uid: res.data.data.uid
         }, {
           "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+          "columnId": columnId,
           "pageNo": 1,
-          "pageSize": 6
+          "pageSize": 2
         }).success(success)
       }, function() {
         wx.showModal({
@@ -52,44 +48,41 @@ Page({
         })
       });
     };
-    /* 分享 */
-    distinction(2, res => {
+    /* 答疑 */
+    distinction(1, columnId, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
-          productionData: res.data.data,
+          questionsData: res.data.data,
         })
       }
-      
     });
-    /* 答疑 */
-    distinction(1, res => {
-      if(res.data.success) {
-        console.log(res.data.data)
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 4
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
         this.setData({
-          questionsData: res.data.data,
+          courseData: res.data.data
         })
-      }
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
     });
   },
-  /* 转发*/
-  onShareAppMessage: function (ops) {
-    if (ops.from === 'button') {
-      // 来自页面内转发按钮
-      console.log(ops.target)
-    }
-    const postId = ops.target.dataset.postid;
-    return {
-      title: '小学王者班',
-      path: `pages/transmit/transmit?ind=7&postId=${postId}`,
-      success: function (res) {
-        // 转发成功
-        console.log("转发成功:" + JSON.stringify(res));
-      },
-      fail: function (res) {
-        // 转发失败
-        console.log("转发失败:" + JSON.stringify(res));
-      }
-    }
-  },
 })

+ 1 - 0
pages/english/english.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 8 - 27
pages/english/english.wxml

@@ -1,43 +1,24 @@
-<!--pages/art/art.wxml-->
+<!--pages/english/english.wxml-->
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
-          <!-- 科学艺术 -->
-          <view class="art">
-            <target/>
+          <!-- 英语分级阅读 -->
+          <view class="english">
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
 
-            <lessonList/>
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
 
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
-
-            <view>英语</view>
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
+                type="1"
+                columnType="4"/>
 
 
             <view class="questions-one">

+ 2 - 212
pages/english/english.wxss

@@ -1,6 +1,6 @@
-/* pages/art/art.wxss */
+/* pages/english/english.wxss */
 
-.art {
+.english {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
@@ -48,216 +48,6 @@
     color: #C3C3C3;
 }
 
-
-/* 预览图片 */
-.material-con {
-    margin-left: 10rpx;
-    padding: 0 25rpx;
-}
-
-.art-img {
-    display: flex;
-    justify-content: space-between;
-    margin-left: 53rpx;
-    font-size: 28rpx;
-    color: #444;
-    margin-top: 30rpx;
-}
-
-/* 分享评论 */
-.works,
-.share {
-    padding: 16rpx 25rpx;
-}
-
-.works .title,
-.share .title {
-    position:relative;
-    width: 100%;
-    text-align: center;
-    font-size: 32rpx;
-    font-weight: 600;
-    border-bottom: 2rpx #878787 solid;
-    padding-bottom: 16rpx;
-    background: #fff;
-}
-
-.xing {
-    width: 20rpx;
-    height: 20rpx;
-    margin: 0 10rpx;
-}
-
-.uploading {
-    position: absolute;
-    right: 0;
-    top: 10rpx;
-    font-size: 24rpx;
-}
-
-.share-con,
-.questions {
-    position:relative;
-    margin-top: 28rpx;
-    padding-bottom: 58rpx;
-    border-bottom: 2rpx #878787 solid;
-}
-
-.share-con .head {
-    position:relative;
-    padding:20rpx 0;
-}
-
-.head-img {
-    width: 86rpx;
-    height: 86rpx;
-    float: left;  
-    margin-right: 18rpx; 
-}
-
-.head-img image {
-    width: 100%;
-    height: 100%;
-    border-radius: 50%;
-}
-
-
-.picture {
-    display: flex;
-    justify-content: center;    
-    margin: 24rpx 112rpx 17rpx 103rpx;
-
-}
-.picture image {
-     width: 236rpx;
-     height: 176rpx;
-     border-radius: 15rpx;
- }
-
-.picture image:nth-child(2) {
-    margin-left: 8rpx;
-}
-
-.share_up {
-    position: absolute;
-    right: 0;
-    top: 20rpx;
-    height: 19rpx;
-    width: 19rpx;
-}
-
-.icon {
-    display: flex;
-    align-items: center;
-    margin: 0 112rpx 17rpx 103rpx;
-}
-
-.icon view {
-    display: flex;
-    align-items: center;
-    margin-right: 60rpx;
-}
-
-.icon .zan {
-    width: 26rpx;
-    height: 23rpx;
-}
-
-.icon .weatch {
-    width: 30rpx;
-    height: 23rpx;
-}
-
-.icon .discuss {
-    width: 32rpx;
-    height: 29rpx;  
-}
-
-.icon view text {
-    font-size: 24rpx;
-    color: #878787;
-    margin-left: 14rpx;
-}
-
-
-.more {
-    margin-top: 18rpx;
-    font-size: 28rpx;
-    text-align: center;
-    color: #787878;
-}
-
-.no-con {
-    margin: 50rpx 0 ;
-}
-
-.state {
-    text-align: center;
-    font-size: 24rpx;
-    color: #C0C0C0;
-}
-
-.upload-works {
-    position: relative;
-    width: 212rpx;
-    height: 212rpx;
-    margin: 0 auto;
-}
-
-.work-box {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 212rpx;
-    height: 212rpx;
-}
-
-.uploading-works {
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    z-index: 1;
-    width: 67rpx;
-    height: 51rpx;
-    transform: translate(-50%, -50%);
-}
-
-.upload-works text {
-    position: absolute;
-    left: 50%;
-    top: 70%;
-    z-index: 1;
-    font-size: 24rpx;
-    color: #C0C0C0;
-    transform: translate(-50%);
-}
-
-
-
-
-
- 
- /* 答疑讨论 */
- .questions {
-    padding-bottom: 28rpx;
-}
-
- .questions .head {
-    padding:20rpx 0;
-    position: relative;
- }
-
-
-.dian {
-     position: absolute;
-     right: 45rpx;
-     top: 40rpx;
-     width: 20rpx;
-     height: 20rpx;
-     border-radius: 50%;
-     background: #FD025F;
- }
-
  /* 标题定位到顶部 */
  .adsorb {
   position: fixed;

+ 19 - 12
pages/input_content/input_content.js

@@ -4,6 +4,7 @@ const app = getApp();
 const url = require('../../utils/const.js');
 const APIClient = require('../../utils/APIClient.js');
 const login = require('../../utils/loginSchedule.js');
+const utils = require('../../utils/util.js');
 
 const HOST = url.apiUrl;
 
@@ -16,7 +17,8 @@ Page({
     tempFilePath: [],
     imgId: [],
     textValue: '',
-    type: ''
+    //type: '',
+    //columnType: ''
   },
 
   /**
@@ -92,7 +94,11 @@ Page({
   },
   //点击发送
   send: function() {
-    if(this.data.imgId.length == 0 && this.data.type == 2){
+    const type = utils.getUrl().type;
+    const columnType = utils.getUrl().columnType;
+    const columnId = utils.column(columnType).columnId;
+    const columnName = utils.column(columnType).columnName;
+    if(this.data.imgId.length == 0 && type == 2){
       wx.showModal({
         title: '提示',
         content: '请上传分享的作品',
@@ -108,12 +114,13 @@ Page({
     } 
     let data = {
       "title": this.data.textValue,
-      "type": this.data.type,
-      "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
-      "columnType": "6",
-      "columnNames": "艺术",
+      "type": type,
+      "columnId": columnId,
+      "columnType": columnType,
+      "columnNames": columnName,
     };
-    if(this.data.type == 2){
+    console.log(data);
+    if(type == 2){
       data.imagesStrList = this.data.imgId
     }
     login.getOpenidSessionKey(function(res) {
@@ -122,9 +129,9 @@ Page({
         uid: res.data.data.uid
       }, data).success(res => {
         console.log(res)
-        if(res.data.success) {
+        if(res.data.success) {  
           wx.redirectTo({
-            url: '../art/art?ind=7'
+            url: utils.url(columnType)
           })
         }
       })      
@@ -171,9 +178,9 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.setData({
-      type: options.type
-    })
+    // this.setData({
+    //   type: options.type
+    // })
   },
 
   /**

+ 33 - 41
pages/language/language.js

@@ -7,35 +7,30 @@ const login = require('../../utils/loginSchedule.js');
 Page({
   data: {
     flag: false,
-    productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
   methods: {
-    shareImage: function(e) {
-      console.log(e.target.dataset.flag)
-    }
+
   },
 
   onLoad: function (options) {
-    //分享按钮
-    wx.showShareMenu({
-      withShareTicket: true
-    })
   },
 
   onShow: function () {
+    const columnId = util.column('1').columnId;
     /* 区分答疑和分享 */
-    let distinction = (type, success) => {
+    let distinction = (type, columnId, success) => {
       login.getOpenidSessionKey(function(res) {
         //console.log(res.data.data.uid);
         APIClient.getProductionSchedule({
           uid: res.data.data.uid
         }, {
           "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+          "columnId": columnId,
           "pageNo": 1,
-          "pageSize": 6
+          "pageSize": 2
         }).success(success)
       }, function() {
         wx.showModal({
@@ -52,44 +47,41 @@ Page({
         })
       });
     };
-    /* 分享 */
-    distinction(2, res => {
+    /* 答疑 */
+    distinction(1, columnId, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
-          productionData: res.data.data,
+          questionsData: res.data.data,
         })
       }
-      
     });
-    /* 答疑 */
-    distinction(1, res => {
-      if(res.data.success) {
-        console.log(res.data.data)
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 1
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
         this.setData({
-          questionsData: res.data.data,
+          courseData: res.data.data
         })
-      }
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
     });
   },
-  /* 转发*/
-  onShareAppMessage: function (ops) {
-    if (ops.from === 'button') {
-      // 来自页面内转发按钮
-      console.log(ops.target)
-    }
-    const postId = ops.target.dataset.postid;
-    return {
-      title: '小学王者班',
-      path: `pages/transmit/transmit?ind=7&postId=${postId}`,
-      success: function (res) {
-        // 转发成功
-        console.log("转发成功:" + JSON.stringify(res));
-      },
-      fail: function (res) {
-        // 转发失败
-        console.log("转发失败:" + JSON.stringify(res));
-      }
-    }
-  },
 })

+ 1 - 0
pages/language/language.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 8 - 27
pages/language/language.wxml

@@ -1,43 +1,24 @@
-<!--pages/art/art.wxml-->
+<!--pages/language/language.wxml-->
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
-          <!-- 科学艺术 -->
-          <view class="art">
-            <target/>
+          <!-- 语文 -->
+          <view class="language">
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
 
-            <lessonList/>
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
 
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
-
-            <view>中文</view>
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
+                type="1"
+                columnType="1"/>
 
 
             <view class="questions-one">

+ 2 - 190
pages/language/language.wxss

@@ -1,6 +1,6 @@
-/* pages/art/art.wxss */
+/* pages/language/language.wxss */
 
-.art {
+.language {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
@@ -48,194 +48,6 @@
     color: #C3C3C3;
 }
 
-
-/* 预览图片 */
-.material-con {
-    margin-left: 10rpx;
-    padding: 0 25rpx;
-}
-
-.art-img {
-    display: flex;
-    justify-content: space-between;
-    margin-left: 53rpx;
-    font-size: 28rpx;
-    color: #444;
-    margin-top: 30rpx;
-}
-
-/* 分享评论 */
-.works,
-.share {
-    padding: 16rpx 25rpx;
-}
-
-.works .title,
-.share .title {
-    position:relative;
-    width: 100%;
-    text-align: center;
-    font-size: 32rpx;
-    font-weight: 600;
-    border-bottom: 2rpx #878787 solid;
-    padding-bottom: 16rpx;
-    background: #fff;
-}
-
-.xing {
-    width: 20rpx;
-    height: 20rpx;
-    margin: 0 10rpx;
-}
-
-.uploading {
-    position: absolute;
-    right: 0;
-    top: 10rpx;
-    font-size: 24rpx;
-}
-
-.share-con,
-.questions {
-    position:relative;
-    margin-top: 28rpx;
-    padding-bottom: 58rpx;
-    border-bottom: 2rpx #878787 solid;
-}
-
-.share-con .head {
-    position:relative;
-    padding:20rpx 0;
-}
-
-.head-img {
-    width: 86rpx;
-    height: 86rpx;
-    float: left;  
-    margin-right: 18rpx; 
-}
-
-.head-img image {
-    width: 100%;
-    height: 100%;
-    border-radius: 50%;
-}
-
-
-.picture {
-    display: flex;
-    justify-content: center;    
-    margin: 24rpx 112rpx 17rpx 103rpx;
-
-}
-.picture image {
-     width: 236rpx;
-     height: 176rpx;
-     border-radius: 15rpx;
- }
-
-.picture image:nth-child(2) {
-    margin-left: 8rpx;
-}
-
-.share_up {
-    position: absolute;
-    right: 0;
-    top: 20rpx;
-    height: 19rpx;
-    width: 19rpx;
-}
-
-.icon {
-    display: flex;
-    align-items: center;
-    margin: 0 112rpx 17rpx 103rpx;
-}
-
-.icon view {
-    display: flex;
-    align-items: center;
-    margin-right: 60rpx;
-}
-
-.icon .zan {
-    width: 26rpx;
-    height: 23rpx;
-}
-
-.icon .weatch {
-    width: 30rpx;
-    height: 23rpx;
-}
-
-.icon .discuss {
-    width: 32rpx;
-    height: 29rpx;  
-}
-
-.icon view text {
-    font-size: 24rpx;
-    color: #878787;
-    margin-left: 14rpx;
-}
-
-
-.more {
-    margin-top: 18rpx;
-    font-size: 28rpx;
-    text-align: center;
-    color: #787878;
-}
-
-.no-con {
-    margin: 50rpx 0 ;
-}
-
-.state {
-    text-align: center;
-    font-size: 24rpx;
-    color: #C0C0C0;
-}
-
-.upload-works {
-    position: relative;
-    width: 212rpx;
-    height: 212rpx;
-    margin: 0 auto;
-}
-
-.work-box {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 212rpx;
-    height: 212rpx;
-}
-
-.uploading-works {
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    z-index: 1;
-    width: 67rpx;
-    height: 51rpx;
-    transform: translate(-50%, -50%);
-}
-
-.upload-works text {
-    position: absolute;
-    left: 50%;
-    top: 70%;
-    z-index: 1;
-    font-size: 24rpx;
-    color: #C0C0C0;
-    transform: translate(-50%);
-}
-
-
-
-
-
  
  /* 答疑讨论 */
  .questions {

+ 31 - 40
pages/mathematics/mathematics.js

@@ -7,33 +7,27 @@ const login = require('../../utils/loginSchedule.js');
 Page({
   data: {
     flag: false,
-    productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
   methods: {
-    shareImage: function(e) {
-      console.log(e.target.dataset.flag)
-    }
   },
 
   onLoad: function (options) {
-    //分享按钮
-    wx.showShareMenu({
-      withShareTicket: true
-    })
   },
 
   onShow: function () {
+    const columnId = util.column('2').columnId;
     /* 区分答疑和分享 */
-    let distinction = (type, success) => {
+    let distinction = (type, columnId, success) => {
       login.getOpenidSessionKey(function(res) {
         //console.log(res.data.data.uid);
         APIClient.getProductionSchedule({
           uid: res.data.data.uid
         }, {
           "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+          "columnId": columnId,
           "pageNo": 1,
           "pageSize": 6
         }).success(success)
@@ -52,44 +46,41 @@ Page({
         })
       });
     };
-    /* 分享 */
-    distinction(2, res => {
+    /* 答疑 */
+    distinction(1, columnId, res => {
       if(res.data.success) {
         console.log(res.data.data)
         this.setData({
-          productionData: res.data.data,
+          questionsData: res.data.data,
         })
       }
-      
     });
-    /* 答疑 */
-    distinction(1, res => {
-      if(res.data.success) {
-        console.log(res.data.data)
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 2
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
         this.setData({
-          questionsData: res.data.data,
+          courseData: res.data.data
         })
-      }
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
     });
   },
-  /* 转发*/
-  onShareAppMessage: function (ops) {
-    if (ops.from === 'button') {
-      // 来自页面内转发按钮
-      console.log(ops.target)
-    }
-    const postId = ops.target.dataset.postid;
-    return {
-      title: '小学王者班',
-      path: `pages/transmit/transmit?ind=7&postId=${postId}`,
-      success: function (res) {
-        // 转发成功
-        console.log("转发成功:" + JSON.stringify(res));
-      },
-      fail: function (res) {
-        // 转发失败
-        console.log("转发失败:" + JSON.stringify(res));
-      }
-    }
-  },
 })

+ 1 - 0
pages/mathematics/mathematics.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 8 - 32
pages/mathematics/mathematics.wxml

@@ -1,48 +1,24 @@
-<!--pages/art/art.wxml-->
+<!--pages/mathematics/mathematics.wxml-->
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
-          <!-- 科学艺术 -->
-          <view class="art">
-            <target/>
+          <!-- 数学 -->
+          <view class="mathematics">
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
 
-            <lessonList/>
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
 
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
-
-            <view>数学</view>
-            <chat 
-                productionData="{{productionData}}" 
-                title="作品分享"
-                query="分享作品"
-                type="2"/>
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
+                type="1"
+                columnType="2"/>
 
 
             <view class="questions-one">

+ 0 - 187
pages/mathematics/mathematics.wxss

@@ -49,193 +49,6 @@
 }
 
 
-/* 预览图片 */
-.material-con {
-    margin-left: 10rpx;
-    padding: 0 25rpx;
-}
-
-.art-img {
-    display: flex;
-    justify-content: space-between;
-    margin-left: 53rpx;
-    font-size: 28rpx;
-    color: #444;
-    margin-top: 30rpx;
-}
-
-/* 分享评论 */
-.works,
-.share {
-    padding: 16rpx 25rpx;
-}
-
-.works .title,
-.share .title {
-    position:relative;
-    width: 100%;
-    text-align: center;
-    font-size: 32rpx;
-    font-weight: 600;
-    border-bottom: 2rpx #878787 solid;
-    padding-bottom: 16rpx;
-    background: #fff;
-}
-
-.xing {
-    width: 20rpx;
-    height: 20rpx;
-    margin: 0 10rpx;
-}
-
-.uploading {
-    position: absolute;
-    right: 0;
-    top: 10rpx;
-    font-size: 24rpx;
-}
-
-.share-con,
-.questions {
-    position:relative;
-    margin-top: 28rpx;
-    padding-bottom: 58rpx;
-    border-bottom: 2rpx #878787 solid;
-}
-
-.share-con .head {
-    position:relative;
-    padding:20rpx 0;
-}
-
-.head-img {
-    width: 86rpx;
-    height: 86rpx;
-    float: left;  
-    margin-right: 18rpx; 
-}
-
-.head-img image {
-    width: 100%;
-    height: 100%;
-    border-radius: 50%;
-}
-
-
-.picture {
-    display: flex;
-    justify-content: center;    
-    margin: 24rpx 112rpx 17rpx 103rpx;
-
-}
-.picture image {
-     width: 236rpx;
-     height: 176rpx;
-     border-radius: 15rpx;
- }
-
-.picture image:nth-child(2) {
-    margin-left: 8rpx;
-}
-
-.share_up {
-    position: absolute;
-    right: 0;
-    top: 20rpx;
-    height: 19rpx;
-    width: 19rpx;
-}
-
-.icon {
-    display: flex;
-    align-items: center;
-    margin: 0 112rpx 17rpx 103rpx;
-}
-
-.icon view {
-    display: flex;
-    align-items: center;
-    margin-right: 60rpx;
-}
-
-.icon .zan {
-    width: 26rpx;
-    height: 23rpx;
-}
-
-.icon .weatch {
-    width: 30rpx;
-    height: 23rpx;
-}
-
-.icon .discuss {
-    width: 32rpx;
-    height: 29rpx;  
-}
-
-.icon view text {
-    font-size: 24rpx;
-    color: #878787;
-    margin-left: 14rpx;
-}
-
-
-.more {
-    margin-top: 18rpx;
-    font-size: 28rpx;
-    text-align: center;
-    color: #787878;
-}
-
-.no-con {
-    margin: 50rpx 0 ;
-}
-
-.state {
-    text-align: center;
-    font-size: 24rpx;
-    color: #C0C0C0;
-}
-
-.upload-works {
-    position: relative;
-    width: 212rpx;
-    height: 212rpx;
-    margin: 0 auto;
-}
-
-.work-box {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 212rpx;
-    height: 212rpx;
-}
-
-.uploading-works {
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    z-index: 1;
-    width: 67rpx;
-    height: 51rpx;
-    transform: translate(-50%, -50%);
-}
-
-.upload-works text {
-    position: absolute;
-    left: 50%;
-    top: 70%;
-    z-index: 1;
-    font-size: 24rpx;
-    color: #C0C0C0;
-    transform: translate(-50%);
-}
-
-
-
-
-
  
  /* 答疑讨论 */
  .questions {

+ 32 - 2
pages/science/science.js

@@ -9,6 +9,7 @@ Page({
     flag: false,
     productionData: {},
     questionsData: {},
+    courseData: {}
   },
 
   methods: {
@@ -25,6 +26,7 @@ Page({
   },
 
   onShow: function () {
+    const columnId = util.column('5').columnId;
     /* 区分答疑和分享 */
     let distinction = (type, success) => {
       login.getOpenidSessionKey(function(res) {
@@ -33,9 +35,9 @@ Page({
           uid: res.data.data.uid
         }, {
           "type": type,
-          "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+          "columnId": columnId,
           "pageNo": 1,
-          "pageSize": 6
+          "pageSize": 2
         }).success(success)
       }, function() {
         wx.showModal({
@@ -71,6 +73,33 @@ Page({
         })
       }
     });
+    /*科目信息*/
+    login.getOpenidSessionKey((res) => {
+      //console.log(res.data.data.uid);
+      APIClient.getEachSchedule({
+        uid: res.data.data.uid
+      }, {
+        "category": 5
+      }).success((res) => {
+        //console.log('科目信息' + JSON.stringify(res));
+        this.setData({
+          courseData: res.data.data
+        })
+      })
+    }, function() {
+      wx.showModal({
+        title: '提示',
+        content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+    });
   },
   /* 转发*/
   onShareAppMessage: function (ops) {
@@ -93,3 +122,4 @@ Page({
     }
   },
 })
+

+ 1 - 0
pages/science/science.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
+    "preview": "/compontents/preview/preview",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
   }

+ 12 - 29
pages/science/science.wxml

@@ -1,48 +1,31 @@
-<!--pages/art/art.wxml-->
+<!--pages/science/science.wxml-->
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true"  scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
-          <!-- 科学艺术 -->
-          <view class="art">
-            <target/>
-
-            <lessonList/>
-
-            <view class="material">
-                <view class="this-week">
-                    <image src="../image/study.png"></image>
-                    <view class="lesson-name">
-                        <text>学习资料</text>
-                        <text>本周和历史学习资料</text>
-                    </view>
-                </view>
-                <view class="material-con">
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                    <view class="art-img">
-                        <text>钻石戒指</text>
-                        <text>点击预览</text>
-                    </view>
-                </view>
-            </view>
+          <!-- 科学 -->
+          <view class="science">
+            <target wxObjectives="{{courseData.weekCourseConfig.wxObjectives}}"/>
+
+            <lessonList lessonData="{{courseData.lessonPage.list}}"/>
+
+            <preview materialData="{{courseData.lessonPage.list}}"/>
 
-            <view>科学</view>
             <chat 
                 productionData="{{productionData}}" 
                 title="作品分享"
                 query="分享作品"
-                type="2"/>
+                type="2"
+                columnType="5"/>
 
             <chat 
                 productionData="{{questionsData}}" 
                 title="答疑讨论"
                 query="我有疑问"
-                type="1"/>
+                type="1"
+                columnType="5"/>
 
 
             <view class="questions-one">

+ 3 - 3
pages/science/science.wxss

@@ -1,6 +1,6 @@
-/* pages/art/art.wxss */
+/* pages/science/science.wxss */
 
-.art {
+.science {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
@@ -55,7 +55,7 @@
     padding: 0 25rpx;
 }
 
-.art-img {
+.science-img {
     display: flex;
     justify-content: space-between;
     margin-left: 53rpx;

+ 62 - 1
utils/util.js

@@ -55,9 +55,70 @@ function getUrl() {
   return options
 }
 
+//判断科目唯一值columnId
+
+function column(columnNum) {
+  let column = {};
+  switch(columnNum) {
+    case '1':
+      column.columnId = '3564feb8-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '语文'
+    break;
+    case '2':
+      column.columnId = '2b52f52e-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '数学'
+    break;
+    case '3':
+      column.columnId = '3561f024-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '中文'
+    break;   
+    case '4':
+      column.columnId = '2b5a24ca-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '英语'
+    break;
+    case '5':
+      column.columnId = '23598e64-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '科学'
+    break;
+    case '6':
+      column.columnId = '41209f14-05ba-11e8-9771-080027fcfc4b'
+      column.columnName = '艺术'
+    break; 
+  }
+  return column;
+}
+
+//输入跳转URL链接
+function url(columnNum) {
+  let url = '';
+  switch(columnNum) {
+    case '1':
+      url = '../language/language?ind=2'
+    break;
+    case '2':
+      url = '../mathematics/mathematics?ind=3'
+    break;
+    case '3':
+      url = '../chinese/chinese?ind=4'
+    break;   
+    case '4':
+      url = '../english/english?ind=5'
+    break;
+    case '5':
+      url = '../science/science?ind=6'
+    break;
+    case '6':
+      url = '../art/art?ind=7'
+    break; 
+  }
+  return url;
+}
+
 module.exports = {
   formatTime: formatTime,
   gradeUpper,
   day,
-  getUrl
+  getUrl,
+  column,
+  url
 }