Limengbo 7 лет назад
Сommit
d311ba8585
72 измененных файлов с 2634 добавлено и 0 удалено
  1. 81 0
      app.js
  2. 13 0
      app.json
  3. 8 0
      app.wxss
  4. 70 0
      compontents/chat/chat.js
  5. 6 0
      compontents/chat/chat.json
  6. 53 0
      compontents/chat/chat.wxml
  7. 198 0
      compontents/chat/chat.wxss
  8. 29 0
      compontents/curriculum/curriculum.js
  9. 4 0
      compontents/curriculum/curriculum.json
  10. 13 0
      compontents/curriculum/curriculum.wxml
  11. 37 0
      compontents/curriculum/curriculum.wxss
  12. 130 0
      compontents/discuss/discuss.js
  13. 4 0
      compontents/discuss/discuss.json
  14. 12 0
      compontents/discuss/discuss.wxml
  15. 36 0
      compontents/discuss/discuss.wxss
  16. 51 0
      compontents/lesson_list/lessonList.js
  17. 4 0
      compontents/lesson_list/lessonList.json
  18. 24 0
      compontents/lesson_list/lessonList.wxml
  19. 105 0
      compontents/lesson_list/lessonList.wxss
  20. 23 0
      compontents/share/share.js
  21. 4 0
      compontents/share/share.json
  22. 14 0
      compontents/share/share.wxml
  23. 52 0
      compontents/share/share.wxss
  24. 53 0
      compontents/target/target.js
  25. 4 0
      compontents/target/target.json
  26. 10 0
      compontents/target/target.wxml
  27. 48 0
      compontents/target/target.wxss
  28. 57 0
      pages/art/art.js
  29. 9 0
      pages/art/art.json
  30. 133 0
      pages/art/art.wxml
  31. 289 0
      pages/art/art.wxss
  32. BIN
      pages/image/courseware.png
  33. BIN
      pages/image/discuss.png
  34. BIN
      pages/image/download.png
  35. BIN
      pages/image/loading.gif
  36. BIN
      pages/image/medal.png
  37. BIN
      pages/image/medal_icon.png
  38. BIN
      pages/image/q_discuss.png
  39. BIN
      pages/image/questions.png
  40. BIN
      pages/image/share_bg.png
  41. BIN
      pages/image/share_down.png
  42. BIN
      pages/image/share_up.png
  43. BIN
      pages/image/strategy.png
  44. BIN
      pages/image/study.png
  45. BIN
      pages/image/transmit.png
  46. BIN
      pages/image/uploading_works.png
  47. BIN
      pages/image/weatch.png
  48. BIN
      pages/image/work_box.png
  49. BIN
      pages/image/works.png
  50. BIN
      pages/image/xing.png
  51. BIN
      pages/image/zan.png
  52. 82 0
      pages/index/index.js
  53. 8 0
      pages/index/index.json
  54. 95 0
      pages/index/index.wxml
  55. 230 0
      pages/index/index.wxss
  56. 199 0
      pages/input_content/input_content.js
  57. 3 0
      pages/input_content/input_content.json
  58. 14 0
      pages/input_content/input_content.wxml
  59. 33 0
      pages/input_content/input_content.wxss
  60. 15 0
      pages/logs/logs.js
  61. 4 0
      pages/logs/logs.json
  62. 6 0
      pages/logs/logs.wxml
  63. 8 0
      pages/logs/logs.wxss
  64. 30 0
      pages/recommend/recommend.js
  65. 6 0
      pages/recommend/recommend.json
  66. 49 0
      pages/recommend/recommend.wxml
  67. 103 0
      pages/recommend/recommend.wxss
  68. 28 0
      project.config.json
  69. 37 0
      utils/APIClient.js
  70. 51 0
      utils/WXHttpRequest.js
  71. 11 0
      utils/const.js
  72. 48 0
      utils/util.js

+ 81 - 0
app.js

@@ -0,0 +1,81 @@
+//app.js
+App({
+  onLaunch: function () {
+    //调用API从本地缓存中获取数据  
+    var logs = wx.getStorageSync('logs') || []  
+    logs.unshift(Date.now())  
+    wx.setStorageSync('logs', logs)
+    // 登录
+    // wx.login({
+    //   success: res => {
+    //     // 发送 res.code 到后台换取 openId, sessionKey, unionId
+    //   }
+    // })
+    // // 获取用户信息
+    // wx.getSetting({
+    //   success: res => {
+    //     if (res.authSetting['scope.userInfo']zx) {
+    //       // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
+    //       wx.getUserInfo({
+    //         success: res => {
+    //           // 可以将 res 发送给后台解码出 unionId
+    //           this.globalData.userInfo = res.userInfo
+
+    //           // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+    //           // 所以此处加入 callback 以防止这种情况
+    //           if (this.userInfoReadyCallback) {
+    //             this.userInfoReadyCallback(res)
+    //           }
+    //         }
+    //       })
+    //     }
+    //   }
+    // })
+  },
+  getUserInfo: function (cb) {
+    var that = this;
+    if (this.globalData.userInfo) {
+      typeof cb == "function" && cb(this.globalData.userInfo)
+    } else {
+      //调用登录接口  
+      wx.login({
+        success: function (res) {
+          if (res.code) {
+            wx.request({  
+            //获取openid接口  
+            url: 'https://weixin.ai160.com',
+            header: { 'content-type': 'application/json'	},  
+            data:{   
+              js_code: res.code,  
+              grant_type: 'authorization_code'  
+            },  
+            method:'GET',  
+            success:function(res){  
+              console.log(res)  
+            }  
+          })  
+            //发起网络请求
+            // wx.request({
+            //   url: 'https://test.com/onLogin',
+            //   data: {
+            //     code: res.code
+            //   }
+            // })
+          } else {
+            console.log('登录失败!' + res.errMsg)
+          }
+          wx.getUserInfo({
+            success: function (res) {
+              console.log(res);
+              that.globalData.userInfo = res.userInfo;
+              typeof cb == "function" && cb(that.globalData.userInfo)
+            }
+          })
+        }
+      });
+    }
+  },
+  globalData: {
+    userInfo: null
+  }
+})  

+ 13 - 0
app.json

@@ -0,0 +1,13 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/logs/logs",
+    "pages/input_content/input_content"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "小学王者班",
+    "navigationBarTextStyle": "black"
+  }
+}

+ 8 - 0
app.wxss

@@ -0,0 +1,8 @@
+/**app.wxss**/
+page {
+  height: 100%;
+}
+
+.container {
+  box-sizing: border-box;
+} 

+ 70 - 0
compontents/chat/chat.js

@@ -0,0 +1,70 @@
+// compontents/chat/chat.js
+const APIClient = require('../../utils/APIClient.js');
+
+Component({
+  relations: {
+    '../discuss/custom-li': {
+      type: 'child', // 关联的目标节点应为子节点
+      linked: function(target) {
+        // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后
+      },
+      linkChanged: function(target) {
+        // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后
+      },
+      unlinked: function(target) {
+        // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
+      }
+    }
+  },
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    productionData: {
+      type: Object,
+      value: {}
+    },
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    text: '',
+    chatDatas: [],
+    animationData: {}
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    uploadImage (e) {
+      wx.navigateTo({
+        url: '../input_content/input_content'
+      })
+    },
+    listenerButtonPreviewImage: function(e) {
+      let imgUrl = [];
+      imgUrl.push(e.target.dataset.img);
+      wx.previewImage({
+          current: '', // 当前显示图片的http链接
+          urls: imgUrl, // 需要预览的图片http链接列表
+          //这根本就不走
+          success: function(res) {
+              //console.log(res);
+          },
+          //也根本不走
+          fail: function() {
+              //console.log('fail')
+          }
+      })
+    }
+  },
+  ready () {
+    console.log(this.getRelationNodes('discuss/discuss/custom-li'))
+    // this.discuss = this.selectComponent("#discuss");
+    // console.log(this.discuss);
+  }
+})

+ 6 - 0
compontents/chat/chat.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "discuss": "../discuss/discuss"
+  }
+}

+ 53 - 0
compontents/chat/chat.wxml

@@ -0,0 +1,53 @@
+<!--compontents/chat/chat.wxml-->
+<view class="works">
+    <view class="title">
+        <image src="../../pages/image/xing.png" class="xing"></image>
+        <text class="">作品分享</text>
+        <image src="../../pages/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>
+                <image class="share_up" src="../../pages/image/share_up.png" data-flag="{{flag}}" bindtap="shareImage"></image>
+            </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="../../pages/image/zan.png" class="zan"></image>
+                    <text>{{item.postsAttributeInfo ? item.postsAttributeInfo.favors : '0'}}</text>
+                </view>
+                <view>
+                    <image src="../../pages/image/weatch.png" class="weatch"></image>
+                    <text>{{item.postsAttributeInfo ? item.postsAttributeInfo.views : '0'}}</text>
+                </view>
+                <view>
+                    <image src="../../pages/image/discuss.png" class="discuss"></image>
+                    <text>{{item.replyCount}}</text>
+                </view>
+            </view>
+            <discuss discussData="{{item.replyList}}" uid="{{item.userId}}" id="discuss"/>
+        </view>
+        <view class="more">查看更多</view>
+    </view>
+    <view class="no-con" style="display: none;">
+        <view class="state">你还没有上传作品</view>
+        <view class="upload-works">
+            <image src="../../pages/image/work_box.png" class="work-box"></image>
+            <image src="../../pages/image/uploading_works.png" class="uploading-works"></image>
+            <text>上传作品</text>
+        </view>
+    </view>
+</view>
+

+ 198 - 0
compontents/chat/chat.wxss

@@ -0,0 +1,198 @@
+/* compontents/chat/chat.wxss */
+.works,
+.share {
+    width: 100%;
+    margin: 20rpx 0;
+    border-radius: 25rpx;
+    padding: 20rpx 0;
+    box-sizing: border-box;
+    background: #fff;
+    position: relative;
+}
+
+/* 分享评论 */
+.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%;
+}
+
+.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;
+}
+
+.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%);
+}

+ 29 - 0
compontents/curriculum/curriculum.js

@@ -0,0 +1,29 @@
+// compontents/curriculum/curriculum.js
+Component({
+  options: {
+    multipleSlots: true // 在组件定义时的选项中启用多slot支持
+  },
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    studyLog: {
+      type: Array,
+      value: []
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
compontents/curriculum/curriculum.json

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

+ 13 - 0
compontents/curriculum/curriculum.wxml

@@ -0,0 +1,13 @@
+<!--compontents/curriculum/curriculum.wxml-->
+<view class="record">
+  <view class="record_title">
+    <text>学习记录</text>
+  </view>
+  <view class="record_con" wx:for="{{studyLog}}" wx:key="{{item.lessonId}}">
+    <view class="record_list">
+      <text>{{item.lessonTitle}}</text>
+      <text>{{item.gmtCreated}}</text>
+    </view>
+  </view>
+  
+</view>

+ 37 - 0
compontents/curriculum/curriculum.wxss

@@ -0,0 +1,37 @@
+/* compontents/curriculum/curriculum.wxss */
+.record {
+    width:100%;
+    margin:20rpx 0;
+    border-radius:25rpx;
+    padding: 28rpx 28rpx 81rpx 28rpx;
+    box-sizing:border-box;
+    background:#fff;
+}
+
+.record_title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+}
+
+.record_title text:nth-child(1) {
+    font-size: 36rpx;
+    font-weight: 600;
+}
+
+.record_title text:nth-child(2) {
+    font-size: 28rpx;
+    color: #878787;
+}
+
+.record_list {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 30rpx;
+}
+
+.record_list text {
+    color: #444;
+    font-size: 28rpx;
+}

+ 130 - 0
compontents/discuss/discuss.js

@@ -0,0 +1,130 @@
+// compontents/discuss/discuss.js
+const APIClient = require('../../utils/APIClient.js');
+
+Component({
+  relations: {
+    './custom-ul': {
+      type: 'parent', // 关联的目标节点应为父节点
+      linked: function(target) {
+        // 每次被插入到custom-ul时执行,target是custom-ul节点实例对象,触发在attached生命周期之后
+      },
+      linkChanged: function(target) {
+        // 每次被移动后执行,target是custom-ul节点实例对象,触发在moved生命周期之后
+      },
+      unlinked: function(target) {
+        // 每次被移除时执行,target是custom-ul节点实例对象,触发在detached生命周期之后
+      }
+    }
+  },
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    discussData: {
+      type: Array,
+      value: []
+    },
+    uid: {
+      type: String,
+      value: ''
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    text: '',
+    discussDatas: [],
+    animationData: {},
+    messageLength: ''
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onTap (e) {
+      let flage = e.target.dataset.flag;
+      if(flage){
+        this.util(flage, '0rpx');
+        this.setData({'flag': false})
+      } else {
+        this.util(flage, '800rpx');
+        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()  
+      })  
+    },
+    /* 获取输入内容 */
+    bindKeyInput (e) {
+      this.setData({
+        text: e.detail.value
+      })
+    },
+    /* 发送评论 */
+    sendText () {
+      //console.log(this.data.text.trim())
+      let text = this.data.text.trim();
+      let postsId = this.properties.postsId;
+      let _this = this;
+      let header = {
+        uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+      }
+      if(text == ''){
+        wx.showModal({
+          title: '提示',
+          content: '请输入评论内容',
+          success: function(res) {
+            if (res.confirm) {
+              console.log('用户点击确定')
+            } else if (res.cancel) {
+              console.log('用户点击取消')
+            }
+          }
+        })
+        return false;
+      }
+      this.data.text = "";
+      let data = {
+        "userId": header.uid,
+        "postsId": postsId,
+        "content": text
+      };
+      APIClient.getDiscussSchedule(header, data).success(function (res) {
+        console.log(res.data)
+        if(res.data.success) {
+          _this.properties.discussData.push(res.data.data);
+          _this.setData({
+            discussDatas: _this.properties.discussData,
+            messageLength: _this.properties.discussData.length
+          });
+        };
+      });
+      this.setData({
+        text: ''
+      })
+    }
+  },
+  ready () {
+    this.setData({
+      discussDatas: this.properties.discussData
+    })
+  }
+})

+ 4 - 0
compontents/discuss/discuss.json

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

+ 12 - 0
compontents/discuss/discuss.wxml

@@ -0,0 +1,12 @@
+<!--compontents/discuss/discuss.wxml-->
+<view class="comment " animation="{{animationData}}">
+    <view  wx:for="{{discussDatas}}" wx:key="{{item.id}}">
+        <text style="color: {{uid == item.userId ? '#000' : '#f7085e'}}">{{item.featureMap.wechatName}}:</text>
+        <text>{{item.content}}</text>
+    </view>  
+    <view class="text">
+        <input placeholder="输入评论内容" value="{{text}}" bindinput="bindKeyInput" type="text" />
+        <text bindtap="sendText">发送</text>
+    </view>
+</view>
+<text class="unfold" data-flag="{{flag}}" bindtap="onTap">展开</text>

+ 36 - 0
compontents/discuss/discuss.wxss

@@ -0,0 +1,36 @@
+/* compontents/discuss/discuss.wxss */
+/* 评论内容展开 */
+ .comment {
+     position: relative;
+     height: 0rpx;
+     overflow: hidden;
+ }
+
+ .comment view {
+     margin-top: 20rpx; 
+     font-size: 28rpx;
+ }
+
+ .text {
+     position: absolute;
+     bottom: 0;
+     width: 100%;
+ }
+
+ .text input {
+     width: 85%;
+     float: left;
+ }
+
+.text text {
+    color: #93AAFA;
+}
+
+
+ .unfold {
+    position: absolute;
+    right: 28rpx;
+    bottom: 24rpx;
+    font-size: 28rpx;
+    color: #93AAFA;
+}

+ 51 - 0
compontents/lesson_list/lessonList.js

@@ -0,0 +1,51 @@
+// compontents/lesson_list/lessonList.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    arr: ['钻石', '四季', '踏雪寻梅', '鹅鹅鹅', 'aaa'],
+    flag: false,
+    animationData: {},
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onTap (e) {
+      let flage = e.target.dataset.flag;
+      if(flage){
+        this.util(flage, '270rpx');
+        this.setData({'flag': false})
+      } else {
+        this.util(flage, '400rpx');
+        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/lesson_list/lessonList.json

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

+ 24 - 0
compontents/lesson_list/lessonList.wxml

@@ -0,0 +1,24 @@
+<!--compontents/lesson_list/lessonList.wxml-->
+
+<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="{{arr}}" 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>
+            <view class="art-con">
+                <text>{{item}}</text>
+                <text>28分钟前</text>
+            </view>
+        </view>
+    </view>
+    <text class="unfold" data-flag="{{flag}}" bindtap="onTap">展开</text>
+</view>

+ 105 - 0
compontents/lesson_list/lessonList.wxss

@@ -0,0 +1,105 @@
+/* compontents/lesson_list/lessonList.wxss */
+
+.lesson-list {
+  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;
+}
+
+/* 时间轴 */
+.timer-shaft {
+    height: 276rpx;
+    overflow: hidden;
+    margin: 0 0 68rpx 10rpx;
+    padding: 0 25rpx;
+}
+
+.art-lesson {
+     position: relative;
+     margin-top: 30rpx;
+ }
+
+.art-con {
+    display: flex;
+    justify-content: space-between;
+    margin-left: 53rpx;
+    font-size: 28rpx;
+    color: #444;
+}
+
+.graph {
+    position: absolute;
+    left: 0;
+    top: 10rpx;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+}
+
+.yuan {
+    height: 18rpx;
+    width: 18rpx;
+    border-radius: 50%;
+}
+
+.long-line {
+    height: 56rpx;
+    width: 4rpx;
+}
+
+.nocheckyuan {
+    border: 2rpx solid #878787;
+}
+
+.check {
+    background: #48bdfb;
+}
+
+.nocheck {
+    background: #878787;
+}
+
+.none {
+    display: none;
+}
+
+.unfold {
+    position: absolute;
+    right: 28rpx;
+    bottom: 24rpx;
+    font-size: 28rpx;
+    color: #93AAFA;
+}

+ 23 - 0
compontents/share/share.js

@@ -0,0 +1,23 @@
+// compontents/share/share.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
compontents/share/share.json

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

+ 14 - 0
compontents/share/share.wxml

@@ -0,0 +1,14 @@
+<!--compontents/share/share.wxml-->
+<view class="share">
+    <view class="title">分享</view>
+    <view class="share-img">
+        <view class="download">
+            <image src="../../pages/image/download.png"></image>
+            <text>生成海报分享</text>
+        </view>
+        <view class="transmit">
+            <image src="../../pages/image/transmit.png"></image>
+            <text>转发给好友</text>
+        </view>        
+    </view>
+</view>

+ 52 - 0
compontents/share/share.wxss

@@ -0,0 +1,52 @@
+/* compontents/share/share.wxss */
+.share {
+    position: absolute;
+    left: 0;
+    bottom: -342rpx;
+    width:100%;
+    border-radius:25rpx;
+    padding:32rpx 24rpx;
+    box-sizing:border-box;
+    background:#fff;
+}
+
+.share .title {
+    font-size: 32rpx;
+    font-weight: bolder;
+    color: #3F3F3F;
+    text-align: center;
+    padding-bottom: 20rpx;
+    border-bottom: 2rpx solid #C8C8C8;
+    
+}
+
+.share-img {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    margin-top: 44rpx;
+}
+
+.share-img view {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+}
+
+.share-img text {
+    font-size: 32rpx;
+    color: #3F3F3F;
+    margin-top: 43rpx;
+}
+
+
+.download image {
+    width: 82rpx;
+    height: 86rpx;
+}
+
+.transmit image {
+    width: 102rpx;
+    height: 82rpx;    
+}

+ 53 - 0
compontents/target/target.js

@@ -0,0 +1,53 @@
+// compontents/target/target.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    wxObjectives: {
+      type: String,
+      value: ""
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    animationData: {} 
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onTap (e) {
+      let flage = e.target.dataset.flag;
+      if(flage){
+        this.util(flage, '156rpx');
+        this.setData({'flag': false})
+      } else {
+        this.util(flage, '200rpx');
+        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/target/target.json

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

+ 10 - 0
compontents/target/target.wxml

@@ -0,0 +1,10 @@
+<!--compontents/target/target.wxml-->
+<view class="target">
+    <view class="title">
+        <text>本周学习目标</text>
+    </view>
+    <view class="{{ flag ? 'target-txt-show' : 'target-txt'}}" animation="{{animationData}}">
+        <text class="week">第五周:{{wxObjectives}}</text>
+    </view>
+    <text class="unfold" data-flag="{{flag}}" bindtap="onTap">展开</text>
+</view>

+ 48 - 0
compontents/target/target.wxss

@@ -0,0 +1,48 @@
+/* compontents/target/target.wxss */
+.target {
+  width: 100%;
+  margin: 20rpx 0;
+  border-radius: 25rpx;
+  padding: 28rpx 24rpx 61rpx 24rpx;
+  box-sizing: border-box;
+  background: #fff;
+  position: relative;
+}
+
+.title {
+    font-size: 36rpx;
+    font-weight: 600;
+}
+
+.target-txt {
+    height: 156rpx;
+    display: -webkit-box;
+    font-size: 28rpx;
+    margin-top: 28rpx;
+    line-height: 40rpx;
+    word-break: break-all;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 4;
+    overflow: hidden;
+    text-overflow:ellipsis;
+}
+
+.target-txt-show {
+    height: 200rpx;
+    font-size: 28rpx;
+    margin-top: 28rpx;
+    line-height: 40rpx;
+    word-break: break-all;
+}
+
+.week {
+    margin-left: 92rpx;
+}
+
+.unfold {
+    position: absolute;
+    right: 28rpx;
+    bottom: 10rpx;
+    font-size: 28rpx;
+    color: #93AAFA;
+}

+ 57 - 0
pages/art/art.js

@@ -0,0 +1,57 @@
+// pages/art/art.js
+const APIClient = require('../../utils/APIClient.js');
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    productionData: {},
+    questionsData: {}
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    shareImage: function(e) {
+      console.log(e.target.dataset.flag)
+    }
+  },
+  ready () {
+     /* 区分答疑和分享 */
+    let distinction = (type, success) => {
+      APIClient.getProductionSchedule({
+        uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+      }, {
+        "userId": "e7e0d43a-36b1-4e71-a3a3-61469c90d0a2",
+        "type": type,
+        "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+        "pageNo": 1,
+        "pageSize": 2
+      }).success(success)
+    };
+    /* 分享 */
+    distinction(2, res => {
+      console.log(res.data.data)
+      this.setData({
+        productionData: res.data.data,
+      })
+    });
+    /* 答疑 */
+    distinction(1, res => {
+      console.log(res.data)
+      this.setData({
+        questionsData: res.data.data,
+      })
+    })
+  },
+})

+ 9 - 0
pages/art/art.json

@@ -0,0 +1,9 @@
+{
+  "component": true,
+  "usingComponents": {
+    "target": "/compontents/target/target",
+    "chat": "/compontents/chat/chat",
+    "lessonList": "/compontents/lesson_list/lessonList",
+    "share": "/compontents/share/share"
+  }
+}

+ 133 - 0
pages/art/art.wxml

@@ -0,0 +1,133 @@
+<!--pages/art/art.wxml-->
+
+<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="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>
+                <image class="share_up" src="../image/share_up.png" data-flag="{{flag}}" bindtap="shareImage"></image>
+            </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}}" />
+
+<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>
+
+<share/>
+
+<view class="questions-one">
+    <image src="../image/q_discuss.png" ></image>
+</view>
+
+ <view class="upload-one">
+   <image src="../image/works.png" ></image>
+</view> 

+ 289 - 0
pages/art/art.wxss

@@ -0,0 +1,289 @@
+/* pages/art/art.wxss */
+
+.material,
+.works,
+.share {
+  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 {
+    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;
+  left: 0;
+  top: 72rpx;
+}
+
+/* 定位图片 */
+.questions-one {
+    position: fixed;
+    right: 20rpx;
+    bottom: 30rpx;
+    width: 100rpx;
+    height: 100rpx;
+    border-radius: 50%;
+}
+
+.questions-one image {
+    width: 100%;
+    height: 100%;
+}
+
+.upload-one {
+    position: fixed;
+    right: 20rpx;
+    bottom: 150rpx;
+    width: 100rpx;
+    height: 100rpx;
+    border-radius: 50%;   
+}
+
+.upload-one image {
+    width: 100%;
+    height: 100%;
+}

BIN
pages/image/courseware.png


BIN
pages/image/discuss.png


BIN
pages/image/download.png


BIN
pages/image/loading.gif


BIN
pages/image/medal.png


BIN
pages/image/medal_icon.png


BIN
pages/image/q_discuss.png


BIN
pages/image/questions.png


BIN
pages/image/share_bg.png


BIN
pages/image/share_down.png


BIN
pages/image/share_up.png


BIN
pages/image/strategy.png


BIN
pages/image/study.png


BIN
pages/image/transmit.png


BIN
pages/image/uploading_works.png


BIN
pages/image/weatch.png


BIN
pages/image/work_box.png


BIN
pages/image/works.png


BIN
pages/image/xing.png


BIN
pages/image/zan.png


+ 82 - 0
pages/index/index.js

@@ -0,0 +1,82 @@
+//index.js
+//获取应用实例
+const app = getApp()
+const util = require('../../utils/util.js');
+const APIClient = require('../../utils/APIClient.js');
+
+Page({
+  data: {
+    motto: ['我的','本周推荐','语文','数学','中文','英语','科学','艺术'],
+    navBtnSelectIdx: 0,
+    left: 0,
+    //questionsPreviewing: false,
+    //questionsShare: false,
+    data: {},
+    grade: "",
+    time: "",
+    recommendData: {}
+  },
+  navItemTap: function (e) {
+    //更改navBtnSelectIdx加class
+    let index = e.target.dataset.index;
+    if (index != this.navBtnSelectIdx) {
+      this.setData({ navBtnSelectIdx: index});
+    }
+
+    //点击第几个请求数据
+    let header = {
+      uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+    }
+    if(index == 1){
+      APIClient.getRecommendSchedule(header).success(res => {
+        console.log(res.data)
+        this.setData({
+          recommendData: res.data.data,
+        })
+      })
+    }
+
+    //移动nav
+    if (index <= 2) {
+      this.setData({ left: 0 });
+    }
+    if(index > 2){
+      this.setData({left: 200 });
+    }
+  },
+  lower: function (e) {
+    //console.log(e);
+    //console.log(e.detail.scrollTop)
+    // if (320 <= e.detail.scrollTop && e.detail.scrollTop <= 1000){
+    //   this.setData({ questionsPreviewing: true, questionsShare: false});
+    // }else {
+    //   this.setData({ questionsPreviewing: false });
+    // }
+    // if (1090 <= e.detail.scrollTop) {
+    //   this.setData({ questionsPreviewing: false, questionsShare: true});
+    // } else {
+    //   this.setData({ questionsShare: false });
+    // }
+  },
+
+  onLoad: function () {
+    //调用应用实例的方法获取全局数据  
+    // app.getUserInfo( userInfo => {
+    //   console.log(userInfo)
+    //   //更新数据  
+    //   this.setData({
+    //     userInfo: userInfo
+    //   })
+    // })
+    let header = {
+      uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+    }
+    APIClient.getMySchedule(header).success(res => {
+          this.setData({
+          data: res.data.data,
+          grade: util.gradeUpper(res.data.data.users.grade),
+          time: util.day(res.data.data.timeSpend)
+        })
+    })
+  },
+})

+ 8 - 0
pages/index/index.json

@@ -0,0 +1,8 @@
+
+{
+    "usingComponents": {
+     "curriculum": "/compontents/curriculum/curriculum",
+     "recommend": "../recommend/recommend",
+     "art": "../art/art"
+    }
+  }

+ 95 - 0
pages/index/index.wxml

@@ -0,0 +1,95 @@
+<!--index.wxml-->
+<view class="container">
+  <!-- 标题 -->
+  <view class="menu">
+    <scroll-view scroll-x="true" class="top-nav" scroll-with-animation="true" scroll-left="{{left}}" >
+        <block wx:for="{{motto}}" wx:for-item="item" wx:key="index" wx:for-index="itemIdx">
+          <view bindtap="navItemTap" class="top-btn {{navBtnSelectIdx == itemIdx ? 'top-hoverd-btn' : ''}}" data-index="{{itemIdx}}">
+            {{item}}              
+            <view class="striping {{navBtnSelectIdx == itemIdx ? 'top-hoverd-striping' : ''}}"></view>
+          </view>
+        </block>
+    </scroll-view>
+  </view>
+  <!-- 内容 -->
+  <view class="content">
+      <scroll-view scroll-y="true" bindscroll="lower"  scroll-with-animation="true" enable-back-to-top="true">
+          <!-- 我的 -->
+          <view class="my {{navBtnSelectIdx == 0 ? '' : 'none'}}">
+            <!-- 个人信息 -->
+            <view class='message'>
+              <view class='user'>
+                <view class='head'>
+                  <image class="userinfo-avatar" src="{{data.users.headImgUrl}}" background-size="cover"></image>
+                  <view class='left'>
+                    <view class="name">
+                      {{data.users.wechatName}}
+                      <text class='LV'>LV.{{data.level}}</text>
+                    </view>
+                    <view class="student">
+                      学号:
+                      <text>{{data.users.eid}}</text>
+                    </view>
+                  </view>
+                </view>
+                <view class='grade'>{{grade}}</view>
+              </view>
+              <view class='personal'>
+                <view class="particulars">
+                    <text>登录天数</text>
+                    <text>{{data.users.loginDay}}</text>
+                </view>
+                <view class="particulars">
+                  <text>总时长</text>
+                  <text>{{time}}</text>
+                </view>
+                <view class="particulars">
+                  <text>当前排名</text>
+                  <text>{{data.scoreRank}}</text>
+                </view>
+                <view class="particulars">
+                  <text>超过用户</text>
+                  <text>{{data.proportion}}%</text>
+                </view>
+              </view>  
+            </view>
+            <!-- 勋章 -->
+            <view class="medal">
+              <view class="title">
+                <text>我的勋章</text>
+                <text class="{{data.metalsList.length > 0 ? 'none' : ''}}">本周还没获得</text>
+              </view>
+              <view class="img">
+                <view wx:for="{{data.metalsList}}" wx:key="{{item.id}}" >    
+                  <image src="{{item.img}}"></image>
+                  <text>{{item.name}}</text>
+                </view>
+              </view>
+            </view>
+            <!-- 课模板 -->
+            <view>
+              <curriculum studyLog="{{ data.studyLog }}"/>
+            </view>
+            <!-- <view class='questions'>
+              <scroll-view>
+              <text class="{{questionsPreviewing ? 'adsorb' : ''}}">答疑</text>
+              <view>
+              </view>
+              </scroll-view>
+            </view>
+            <view class='share'>
+             <text class="{{questionsShare ? 'adsorb' : ''}}">分享</text>
+             <view></view>
+            </view> -->
+          </view>
+          <!-- 本周推荐 -->
+          <view class="recommend {{navBtnSelectIdx == 1 ? '' : 'none'}}">
+            <recommend recommendData="{{recommendData}}"/>
+          </view>
+          <!-- 科学艺术 -->
+          <view class="art {{navBtnSelectIdx == 7 ? '' : 'none'}}">
+            <art />
+          </view>
+      </scroll-view>
+  </view>
+</view>

+ 230 - 0
pages/index/index.wxss

@@ -0,0 +1,230 @@
+/**index.wxss**/
+.container {
+  width: 100%;
+  height: 100%;
+  background: #FAF8FB;
+  padding-top:72rpx;
+}
+/*菜单*/
+.menu{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  z-index: 99;
+  background: #FAF8FB;
+}
+
+.top-nav{
+    white-space: nowrap;
+}
+
+.top-btn{
+    position: relative;
+    display: inline-block;
+    padding: 12rpx 20rpx;
+    font-size: 36rpx;
+    color: #878787;
+}
+
+.top-hoverd-btn {
+  color: #000;
+}
+
+.striping {
+    position: absolute;
+    left: 50%;
+    bottom: 0;
+    transform: translateX(-50%);
+    width: 26rpx;
+    border-bottom: #000 solid 6rpx;
+    display: none;
+}
+
+.top-hoverd-striping {
+  display: block;
+}
+
+/* 隐藏内容 */
+.none {
+  display: none;
+} 
+
+/*个人一些信息*/
+.content {
+  height:100%;
+}
+
+.content scroll-view{
+  height: 100%;
+}
+
+::-webkit-scrollbar{
+  width: 0;
+  height: 0;
+  color: transparent;
+}
+
+.my, 
+.recommend,
+.art {
+  position: relative;
+  width: 100%;
+  padding: 0 15rpx;
+  box-sizing: border-box;
+  overflow: hidden;
+}
+
+.message,.medal {
+  width: 100%;
+  margin: 20rpx 0;
+  border-radius: 25rpx;
+  padding: 32rpx 24rpx;
+  box-sizing: border-box;
+  background: #fff;
+}
+
+.user {
+  display: flex;
+  justify-content: space-between;
+  border-bottom: 2rpx solid #CDCED3;
+  padding-bottom: 20rpx;
+}
+
+.head {
+  display: flex;
+  align-items: center;
+}
+
+.left {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  margin-left: 34rpx;
+}
+
+.userinfo-avatar {
+  width: 86rpx;
+  height: 86rpx;
+  border-radius: 50%;
+}
+
+.name {
+  height:44rpx;
+  font-size: 36rpx;
+  font-weight: 600;
+}
+
+.LV {
+  font-size: 24rpx;
+}
+
+.student {
+  height:34rpx;
+  font-size: 28rpx;
+  color: #8C8C8C;
+  margin-top: 10rpx;
+}
+
+.grade {
+  width: 128rpx;
+  height: 46rpx;
+  font-size: 28rpx;
+  font-weight: bolder;
+  color: #878787;
+  border: 2rpx solid #CECDD2;
+  border-radius: 30rpx;
+  text-align: center;
+  line-height: 48rpx; 
+}
+
+.personal {
+  display: flex;
+  margin-top: 34rpx;
+}
+
+.personal .particulars {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  text-align: center;
+}
+/*勋章*/
+.medal {
+  padding: 28rpx;
+}
+
+.medal .title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+} 
+
+.medal .title text:nth-child(1){
+  font-size: 36rpx;
+  font-weight: 600;
+}
+
+.medal .title text:nth-child(2){
+  font-size: 28rpx;
+  color: #878787;
+}
+
+.img {
+  display: flex;
+  margin-top: 38rpx;
+}
+
+.img view {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.img image {
+  width: 100rpx;
+  height: 100rpx;
+}
+
+.img text {
+  font-size: 24rpx;
+  color: #878787;
+  margin-top: 10rpx;
+}
+
+.personal .particulars text:nth-child(1) {
+  font-size: 24rpx;
+  color: #8D8C91;
+}
+
+.personal .particulars text:nth-child(2) {
+  font-size: 28rpx;
+  color: #000;
+  font-weight: 600;
+}
+
+.questions, .share {
+  width: 100%;
+  margin-top: 40rpx;
+}
+
+.questions text, .share text {
+  width: 100%;
+  display: inline-block;
+  border: 1px solid #ccc;
+  background: #fff;
+}
+
+.questions view, .share view {
+  height: 1400rpx;
+  margin-top: 20rpx;
+  background: red;
+}
+
+.adsorb {
+  position: fixed;
+  left: 0;
+  top: 84rpx;
+}

+ 199 - 0
pages/input_content/input_content.js

@@ -0,0 +1,199 @@
+// pages/Input_content/input_content.js
+
+const app = getApp();
+const url = require('../../utils/const.js');
+const APIClient = require('../../utils/APIClient.js');
+
+const HOST = url.apiUrl;
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    tempFilePath: [],
+    imgId: [],
+    textValue: ''
+  },
+
+  /**
+   * 获取输入框内容
+   */
+  bindKeyInput: function(e) {
+    this.setData({
+      textValue: e.detail.value
+    })
+  },
+
+  /**
+   * 图片上传
+   */
+  uploading: function () {
+    var that = this;  
+    wx.chooseImage({  
+      count: 2,  //最多可以选择的图片总数  
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有  
+      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有  
+      success: function (res) {  
+        // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片  
+        var tempFilePaths = res.tempFilePaths; 
+        //启动上传等待中...  
+        wx.showToast({  
+          title: '正在上传...',  
+          icon: 'loading',  
+          mask: true,  
+          duration: 1000 
+        })  
+
+        that.setData({
+          tempFilePath: tempFilePaths
+        })
+
+        var uploadImgCount = 0;  
+        for (var i = 0, h = tempFilePaths.length; i < h; i++) {  
+          //上传文件
+          wx.uploadFile({  
+            url: HOST + '/cms/file/upload',  
+            filePath: tempFilePaths[i],  
+            name: 'uploadfile_ant',  
+            header: {  
+              "Content-Type": "multipart/form-data"  
+            },  
+            success: function (res) {  
+              uploadImgCount++;  
+              let data = JSON.parse(res.data);
+              let imgId = [];
+              imgId.push(data.data.id)
+              that.setData({
+                imgId: imgId,
+              })
+              console.log(data);
+              //如果是最后一张,则隐藏等待中  
+              if (uploadImgCount == tempFilePaths.length) {  
+                wx.hideToast();  
+              }  
+            },  
+            fail: function (res) {  
+              wx.hideToast();  
+              wx.showModal({  
+                title: '错误提示',  
+                content: '上传图片失败',  
+                showCancel: false,  
+                success: function (res) { }  
+              })  
+            }  
+          });  
+        }  
+      }  
+    }); 
+  },
+  //点击发送
+  send: function() {
+    let header = {
+      uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+    }
+    if(this.data.imgId.length == 0){
+      wx.showModal({
+        title: '提示',
+        content: '请上传分享的作品',
+        success: function(res) {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+      return false;
+    }
+    let data = {
+      "title": this.data.textValue,
+      "userId": "e7e0d43a-36b1-4e71-a3a3-61469c90d0a2",
+      "type": "1",
+      "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
+      "columnType": "6",
+      "columnNames": "艺术",
+      "imagesStrList": this.data.imgId
+    };
+    APIClient.getSendSchedule(header, data).success(res => {
+      console.log(res);
+    })
+    
+  },
+  /**
+   * 图片预览
+   */
+  listenerButtonPreviewImage: function(e) {
+    let index = e.target.dataset.index;
+    let that = this; 
+    wx.previewImage({
+        current: that.data.tempFilePath[index],
+        urls: that.data.tempFilePath,
+        //这根本就不走
+        success: function(res) {
+            //console.log(res);
+        },
+        //也根本不走
+        fail: function() {
+            //console.log('fail')
+        }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  }
+})

+ 3 - 0
pages/input_content/input_content.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "作品分享"
+  }

+ 14 - 0
pages/input_content/input_content.wxml

@@ -0,0 +1,14 @@
+<!--pages/Input_content/input_content.wxml-->
+<view class="input-content">
+    <view class="head">
+        <text>取消</text>
+        <text bindtap="send">发送</text>
+    </view>
+    <view class="write">
+        <input placeholder="写点什么..." bindinput="bindKeyInput" type="text" />
+        <text bindtap="uploading">上传图片</text>
+        <block wx:for="{{tempFilePath}}" wx:key="{{index}}">
+            <image src="{{item }}" bindtap="listenerButtonPreviewImage" data-index="{{index}}" style="width: 100%;"/>
+        </block>
+    </view>
+</view>

+ 33 - 0
pages/input_content/input_content.wxss

@@ -0,0 +1,33 @@
+/* pages/Input_content/input_content.wxss */
+.input-content {
+    height: 100%;
+    background: #F4F4F4;
+}
+
+.head {
+    height: 82rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    background: #fff;
+    padding: 42rpx;
+    box-sizing: border-box;
+    border-top: 2rpx #F4F4F4 solid;
+}
+
+.head text {
+    font-size: 24rpx;
+}
+
+.head text:nth-child(2) {
+    color: #1B87EA;
+}
+
+.write {
+    padding: 42rpx;
+    box-sizing: border-box;
+}
+
+.write input {
+    font-size: 32rpx;
+}

+ 15 - 0
pages/logs/logs.js

@@ -0,0 +1,15 @@
+//logs.js
+const util = require('../../utils/util.js')
+
+Page({
+  data: {
+    logs: []
+  },
+  onLoad: function () {
+    this.setData({
+      logs: (wx.getStorageSync('logs') || []).map(log => {
+        return util.formatTime(new Date(log))
+      })
+    })
+  }
+})

+ 4 - 0
pages/logs/logs.json

@@ -0,0 +1,4 @@
+{
+  "backgroundTextStyle": "light",
+  "navigationBarTitleText": "查看启动日志"
+}

+ 6 - 0
pages/logs/logs.wxml

@@ -0,0 +1,6 @@
+<!--logs.wxml-->
+<view class="container log-list">
+  <block wx:for="{{logs}}" wx:for-item="log" >
+    <text class="log-item">{{index + 1}}. {{log}}</text>
+  </block>
+</view>

+ 8 - 0
pages/logs/logs.wxss

@@ -0,0 +1,8 @@
+.log-list {
+  display: flex;
+  flex-direction: column;
+  padding: 40rpx;
+}
+.log-item {
+  margin: 10rpx;
+}

+ 30 - 0
pages/recommend/recommend.js

@@ -0,0 +1,30 @@
+// pages/recommend/recommend.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    recommendData: {
+      type: Object,
+      value: {}
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    imgUrls: [
+      'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
+      'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
+      'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
+    ]
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    
+  }
+})

+ 6 - 0
pages/recommend/recommend.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "target": "/compontents/target/target"
+  }
+}

+ 49 - 0
pages/recommend/recommend.wxml

@@ -0,0 +1,49 @@
+<!--pages/recommend/recommend.wxml-->
+
+<target wxObjectives="{{recommendData.weekPageThemeConfig.wxObjectives}}"/>
+
+<view class="recommend-exchange">
+    <view class="auto-img">
+        <swiper indicator-dots="{{indicatorDots}}"
+        autoplay="true"  duration="1000" circular="true" indicator-dots="true">
+        <block wx:for="{{recommendData.weekStory.autoImageVOList}}" wx:key="{{index}}">
+            <swiper-item>
+            <image src="{{item.img}}"/>
+            </swiper-item>
+        </block>
+        </swiper>
+    </view>
+    <view class="exchange-medal">
+        <view class="this-week">
+            <image src="{{recommendData.weekMetals.img}}"></image>
+            <view class="medal-name">
+                <text>本周勋章“{{recommendData.weekMetals.name}}”</text>
+                <text class="{{recommendData.userDiamond >= 7 ? 'none' : ''}}">还差{{7 - recommendData.userDiamond}}个宝石即可兑换</text>
+            </view>
+        </view>
+    </view>
+    <view class="get-gem">
+        <text>本宝石获取方法</text>
+        <text>学习完每门课程,并与XXXPK成功获取</text>
+    </view>
+    <view class="get-medal">
+        <text>勋章获取方法</text>
+        <text>1,{{recommendData.weekPageThemeConfig.metalsStrategy}}</text>
+        <text>2,学习完每门课程,获取宝石</text>
+        <text>3,学习完每门课程,获取宝石</text>
+    </view>
+</view>
+
+<view class="recommend-strategy">
+    <view class="this-week">
+        <image src="../image/strategy.png"></image>
+        <view class="medal-name">
+            <text>春季攻略</text>
+            <text>春季剧情即将开始</text>
+        </view>
+    </view>
+    <view class="strategy-con">
+        <view>春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽春季攻略,怎样打败怪兽</view>
+        <text class="unfold">展开</text>
+    </view>
+</view>

+ 103 - 0
pages/recommend/recommend.wxss

@@ -0,0 +1,103 @@
+/* pages/recommend/recommend.wxss */
+
+.unfold {
+    position: absolute;
+    right: 28rpx;
+    bottom: 10rpx;
+    font-size: 28rpx;
+    color: #93AAFA;
+}
+
+.recommend-exchange, 
+.recommend-strategy {
+  width: 100%;
+  margin: 15rpx 0;
+  padding-bottom: 32rpx;
+  border-radius: 25rpx;
+  box-sizing: border-box;
+  background: #fff;
+  overflow: hidden;
+}
+
+.auto-img {
+    width: 100%;
+    height: 404rpx;
+}
+
+swiper {
+    height: 404rpx;   
+}
+
+.auto-img image {
+    width: 100%;
+    height: 100%;
+}
+
+.this-week {
+    display: flex;
+    margin-top: 25rpx;
+    padding: 0 25rpx;
+    box-sizing: border-box;
+}
+
+.this-week image {
+  width: 86rpx;
+  height: 86rpx;
+}
+
+.medal-name {
+    display: flex;
+    flex-direction: column;
+    margin: 8rpx  16rpx;
+}
+
+.medal-name text:nth-child(1) {
+    height: 38rpx;
+    font-size: 32rpx;
+    font-weight: 600;
+}
+
+.medal-name text:nth-child(2) {
+    height: 30rpx;
+    margin-top: 10rpx;
+    font-size: 24rpx;
+    color: #C3C3C3;
+}
+
+.get-gem {
+    margin-top: 30rpx;
+    padding: 0 30rpx;       
+}
+
+.get-medal {
+    padding: 0 30rpx;       
+}
+
+.get-gem text, .get-medal text {
+    display: block;
+    margin-top: 18rpx;
+    font-size: 28rpx;
+}
+
+.recommend-strategy {
+    position: relative;    
+    padding-bottom: 80rpx;
+}
+
+.strategy-con {
+    margin-top: 26rpx;
+}
+
+.strategy-con view {
+    display: block;
+    font-size:28rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow:ellipsis;
+    padding: 0 30rpx;
+}
+
+.none {
+    display: none;
+}
+

+ 28 - 0
project.config.json

@@ -0,0 +1,28 @@
+{
+	"description": "项目配置文件。",
+	"setting": {
+		"urlCheck": true,
+		"es6": true,
+		"postcss": true,
+		"minified": true,
+		"newFeature": true
+	},
+	"compileType": "miniprogram",
+	"libVersion": "1.6.6",
+	"appid": "wx7b5ea6422847ea64",
+	"projectname": "%E5%B0%8F%E5%AD%A6%E7%8E%8B%E8%80%85%E7%8F%AD",
+	"condition": {
+		"search": {
+			"current": -1,
+			"list": []
+		},
+		"conversation": {
+			"current": -1,
+			"list": []
+		},
+		"miniprogram": {
+			"current": -1,
+			"list": []
+		}
+	}
+}

+ 37 - 0
utils/APIClient.js

@@ -0,0 +1,37 @@
+const request = require('./WXHttpRequest.js');
+const url = require('./const.js');
+
+const HOST = url.apiUrl;
+
+function genAPIUrl(action) {
+	return HOST + action;
+}
+
+
+module.exports = {
+    // 获取我的data
+	getMySchedule(header) {
+		let url = genAPIUrl('wx/ucenter');
+		return request.getInstance().url(url).header(header).send();
+	},
+	//获取推荐课程
+	getRecommendSchedule(header) {
+		let url = genAPIUrl('wx/course/recommend');
+		return request.getInstance().url(url).header(header).send();
+	},
+	//发送上传图片
+	getSendSchedule(header, data) {
+		let url = genAPIUrl('wx/posts');
+		return request.getInstance().url(url).header(header).data(data).method('POST').send();
+	},
+	//获取分享作品list
+	getProductionSchedule(header, data) {
+		let url = genAPIUrl('wx/posts/findPostsReplyList');
+		return request.getInstance().url(url).header(header).data(data).method('GET').send();
+	},
+	//保存评论
+	getDiscussSchedule(header, data) {
+		let url = genAPIUrl('wx/reply');
+		return request.getInstance().url(url).header(header).data(data).method('POST').send();
+	},
+}

+ 51 - 0
utils/WXHttpRequest.js

@@ -0,0 +1,51 @@
+module.exports = {
+	getInstance: function() {
+		return {
+			_sucCallback: null,
+			_failCallback: null,
+			_method: 'GET',
+			_data: {},
+			_header: { 'content-type': 'application/json'	},
+			_url: '',
+			send: function() {
+				wx.request({
+					url: this._url,
+					data: this._data,
+					method: this._method,
+					header: this._header,
+					success: function(res) {
+						this._sucCallback(res);
+					}.bind(this),
+					fail: function(res) {
+						this._failCallback(res);
+					}.bind(this)
+				});
+				return this;
+			},
+			success: function(callback) {
+				this._sucCallback = callback;
+				return this;
+			},
+			fail: function(callback) {
+				this._failCallback = callback;
+				return this;
+			},
+			url: function(url) {
+				this._url = url;
+				return this;
+			},
+			data: function(data) {
+				this._data = data;
+				return this;
+			},
+			header: function(header) {
+				this._header = header;
+				return this;
+			},
+			method: function(method) {
+				this._method = method;
+				return this;
+			}
+		};
+	}
+};

+ 11 - 0
utils/const.js

@@ -0,0 +1,11 @@
+// 常量列表
+module.exports = {
+	openid: '',
+	// imgUrl: 'https://efunimgs.ai160.com/',
+
+	// apiUrl: 'https://weixin.ai160.com/',
+	// host: 'wss://weixin.ai160.com/wx/websocket'
+	// ----测试环境-----
+  apiUrl: 'https://weixin.efunbox.cn/',
+
+}

+ 48 - 0
utils/util.js

@@ -0,0 +1,48 @@
+const formatTime = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+  n = n.toString()
+  return n[1] ? n : '0' + n
+}
+
+//年级显示方法
+let gradeArr = ["学前班", "一年级", "二年级", "三年级"]
+const gradeUpper = grade => {
+  return gradeArr[grade];
+} 
+
+//时间转换秒转天或小时或分
+const day = msd => {
+  let time = Math.floor(msd) + "秒";  
+  if( Math.floor(msd )> 60){  
+      let min = Math.floor(msd / 60);  
+      time = min + "分";   
+      if( min > 60 ){  
+          min = Math.floor(msd / 60) % 60;  
+          let hour = Math.floor( msd / 3600 );  
+          time = hour + "小时" + min + "分";  
+          if( hour > 24 ){  
+              hour = Math.floor( msd / 3600 ) % 24;  
+              let day = Math.floor(msd / 3600 / 24 );  
+              time = day + "天" + hour + "小时";  
+          }  
+      }    
+  }  
+    
+  return time;          
+}
+
+module.exports = {
+  formatTime: formatTime,
+  gradeUpper,
+  day
+}