Bladeren bron

重构微信小程序

Limengbo 7 jaren geleden
bovenliggende
commit
66ade75719

+ 76 - 0
app.js

@@ -5,5 +5,81 @@ App({
     var logs = wx.getStorageSync('logs') || []  
     logs.unshift(Date.now())  
     wx.setStorageSync('logs', logs)
+<<<<<<< HEAD
   },
+=======
+    // 登录
+    // 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
+  }
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 })  

+ 4 - 0
app.json

@@ -2,6 +2,7 @@
   "pages": [
     "pages/index/index",
     "pages/logs/logs",
+<<<<<<< HEAD
     "pages/recommend/recommend",
     "pages/language/language",
     "pages/mathematics/mathematics",
@@ -11,6 +12,9 @@
     "pages/art/art",
     "pages/input_content/input_content",
     "pages/transmit/transmit"
+=======
+    "pages/input_content/input_content"
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 5 - 0
app.wxss

@@ -4,6 +4,7 @@ page {
 }
 
 .container {
+<<<<<<< HEAD
   width: 100%;
   height: 100%;
   background: #FAF8FB;
@@ -24,3 +25,7 @@ page {
   height: 0;
   color: transparent;
 }
+=======
+  box-sizing: border-box;
+} 
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599

+ 41 - 0
compontents/chat/chat.js

@@ -1,4 +1,5 @@
 // compontents/chat/chat.js
+<<<<<<< HEAD
 
 Component({
   relations: {
@@ -15,6 +16,22 @@ Component({
       unlinked: function(target) {
         // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
         console.log(target)
+=======
+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生命周期之后
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       }
     }
   },
@@ -26,6 +43,7 @@ Component({
       type: Object,
       value: {}
     },
+<<<<<<< HEAD
     title: {
       type: String,
       value: ''      
@@ -38,15 +56,24 @@ Component({
       type: String,
       value: '' 
     },
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 
   /**
    * 组件的初始数据
    */
   data: {
+<<<<<<< HEAD
     text: '',
     chatDatas: [],
     animationData: {},
+=======
+    flag: false,
+    text: '',
+    chatDatas: [],
+    animationData: {}
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 
   /**
@@ -54,9 +81,14 @@ Component({
    */
   methods: {
     uploadImage (e) {
+<<<<<<< HEAD
       const type = this.properties.type;
       wx.navigateTo({
         url: '../input_content/input_content?type=' + type
+=======
+      wx.navigateTo({
+        url: '../input_content/input_content'
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       })
     },
     listenerButtonPreviewImage: function(e) {
@@ -74,6 +106,7 @@ Component({
               //console.log('fail')
           }
       })
+<<<<<<< HEAD
     },
     shareImage: function(e){
       console.log(e);
@@ -90,5 +123,13 @@ Component({
   ready: function(){
     this._getAllLi()
     this.share = this.selectComponent("#share");
+=======
+    }
+  },
+  ready () {
+    console.log(this.getRelationNodes('discuss/discuss/custom-li'))
+    // this.discuss = this.selectComponent("#discuss");
+    // console.log(this.discuss);
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   }
 })

+ 4 - 0
compontents/chat/chat.json

@@ -1,7 +1,11 @@
 {
   "component": true,
   "usingComponents": {
+<<<<<<< HEAD
     "discuss": "../discuss/discuss",
     "share": "../share/share"
+=======
+    "discuss": "../discuss/discuss"
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   }
 }

+ 29 - 0
compontents/chat/chat.wxml

@@ -2,11 +2,19 @@
 <view class="works">
     <view class="title">
         <image src="../../pages/image/xing.png" class="xing"></image>
+<<<<<<< HEAD
         <text class="">{{title}}</text>
         <image src="../../pages/image/xing.png" class="xing"></image>
         <text class="uploading" bindtap="uploadImage" wx:if="{{productionData.list}}">{{query}}</text>
     </view>
     <view wx:if="{{productionData.list}}">
+=======
+        <text class="">作品分享</text>
+        <image src="../../pages/image/xing.png" class="xing"></image>
+        <text class="uploading" bindtap="uploadImage">分享作品</text>
+    </view>
+    <view >
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
         <view class="share-con" wx:for="{{productionData.list}}" wx:key="{{index}}">
             <view class="head">
                 <view class="head-img">
@@ -16,12 +24,18 @@
                     <text>{{item.featureMap.wechatName}}</text>
                     <text style="height: 100%">{{item.title}}</text>
                 </view>
+<<<<<<< HEAD
                 <view class="share-up-box" wx:if="{{type == 2}}" bindtap="shareImage" data-postsId="{{item.id}}">
                     <image class="share_up" src="../../pages/image/share_up.png"></image>
                 </view>
                 <image wx:if="{{type == 1}}" class="message" src="../../pages/image/message.png"></image>
             </view>
             <view class="picture" wx:if="{{type == 2}}">
+=======
+                <image class="share_up" src="../../pages/image/share_up.png" data-flag="{{flag}}" bindtap="shareImage"></image>
+            </view>
+            <view class="picture">
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
                 <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>
@@ -40,6 +54,7 @@
                     <text>{{item.replyCount}}</text>
                 </view>
             </view>
+<<<<<<< HEAD
             <discuss discussData="{{item.replyList}}" uid="{{item.userId}}" postsId="{{item.id}}" id="discuss" type="{{type}}"/>
         </view>
         <view class="more">查看更多</view>
@@ -47,11 +62,21 @@
     <view class="no-con" wx:if="{{!productionData.list && type == 2}}">
         <view class="state">你还没有上传作品</view>
         <view class="upload-works" bindtap="uploadImage">
+=======
+            <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">
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
             <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>
+<<<<<<< HEAD
     <view class="no-con" wx:if="{{!productionData.list && type == 1}}">
         <view class="state">你还没有提问过问题</view>
         <view class="upload-works" bindtap="uploadImage">
@@ -64,3 +89,7 @@
 
 <share wx:if="{{type == 2}}" id="share"/>
 
+=======
+</view>
+
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599

+ 10 - 0
compontents/chat/chat.wxss

@@ -102,6 +102,7 @@
     margin-left: 8rpx;
 }
 
+<<<<<<< HEAD
 .share-up-box {
     position: absolute;
     right: -30rpx;
@@ -114,10 +115,17 @@
     position: absolute;
     right: 30rpx;
     top: 50rpx;
+=======
+.share_up {
+    position: absolute;
+    right: 0;
+    top: 20rpx;
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
     height: 19rpx;
     width: 19rpx;
 }
 
+<<<<<<< HEAD
 .message {
     position: absolute;
     right: 0;
@@ -126,6 +134,8 @@
     height: 56rpx;    
 }
 
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 .icon {
     display: flex;
     align-items: center;

+ 41 - 0
compontents/discuss/discuss.js

@@ -1,5 +1,6 @@
 // compontents/discuss/discuss.js
 const APIClient = require('../../utils/APIClient.js');
+<<<<<<< HEAD
 const login = require('../../utils/loginSchedule.js');
 
 Component({
@@ -17,6 +18,21 @@ Component({
       unlinked: function(target) {
         // 每次被移除时执行,target是custom-ul节点实例对象,触发在detached生命周期之后
         console.log(target)
+=======
+
+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生命周期之后
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       }
     }
   },
@@ -31,6 +47,7 @@ Component({
     uid: {
       type: String,
       value: ''
+<<<<<<< HEAD
     },
     type: {
       type: String,
@@ -39,6 +56,8 @@ Component({
     postsId: {
       type: String,
       value: ''
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
     }
   },
 
@@ -96,6 +115,12 @@ Component({
       let text = this.data.text.trim();
       let postsId = this.properties.postsId;
       let _this = this;
+<<<<<<< HEAD
+=======
+      let header = {
+        uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+      }
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       if(text == ''){
         wx.showModal({
           title: '提示',
@@ -112,6 +137,7 @@ Component({
       }
       this.data.text = "";
       let data = {
+<<<<<<< HEAD
         "postsId": postsId,
         "content": text
       };
@@ -142,6 +168,21 @@ Component({
             }
           }
         })
+=======
+        "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
+          });
+        };
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       });
       this.setData({
         text: ''

+ 4 - 0
compontents/discuss/discuss.wxml

@@ -4,7 +4,11 @@
         <text style="color: {{uid == item.userId ? '#000' : '#f7085e'}}">{{item.featureMap.wechatName}}:</text>
         <text>{{item.content}}</text>
     </view>  
+<<<<<<< HEAD
     <view class="text" wx:if="{{type == 2}}">
+=======
+    <view class="text">
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
         <input placeholder="输入评论内容" value="{{text}}" bindinput="bindKeyInput" type="text" />
         <text bindtap="sendText">发送</text>
     </view>

+ 9 - 0
compontents/share/share.js

@@ -11,14 +11,19 @@ Component({
    * 组件的初始数据
    */
   data: {
+<<<<<<< HEAD
     flag: true,
     postId: '',
+=======
+
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
+<<<<<<< HEAD
     //隐藏分享框
     hidePopup: function () {
       this.setData({
@@ -34,4 +39,8 @@ Component({
     },
   }
 
+=======
+
+  }
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 })

+ 14 - 0
compontents/share/share.wxml

@@ -1,4 +1,5 @@
 <!--compontents/share/share.wxml-->
+<<<<<<< HEAD
 <view class="container" bindtap="hidePopup" hidden="{{flag}}">
     <view class="share">
         <view class="title">分享</view>
@@ -12,5 +13,18 @@
                 <text>转发给好友</text>
             </button>      
         </view>
+=======
+<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>        
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
     </view>
 </view>

+ 14 - 0
compontents/share/share.wxss

@@ -1,4 +1,5 @@
 /* compontents/share/share.wxss */
+<<<<<<< HEAD
 .container {
     position:fixed;
     left: 0;
@@ -25,11 +26,21 @@
     left: 15rpx;
     bottom: 0;
     width: calc(100% - 30rpx);
+=======
+.share {
+    position: absolute;
+    left: 0;
+    bottom: -342rpx;
+    width:100%;
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
     border-radius:25rpx;
     padding:32rpx 24rpx;
     box-sizing:border-box;
     background:#fff;
+<<<<<<< HEAD
     z-index: 100;
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 }
 
 .share .title {
@@ -68,6 +79,7 @@
     height: 86rpx;
 }
 
+<<<<<<< HEAD
 .transmit {
     display: flex;
     flex-direction: column;
@@ -83,6 +95,8 @@
     border: none;
 }
 
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 .transmit image {
     width: 102rpx;
     height: 82rpx;    

+ 55 - 0
pages/art/art.js

@@ -1,4 +1,5 @@
 // pages/art/art.js
+<<<<<<< HEAD
 const app = getApp()
 const util = require('../../utils/util.js');
 const APIClient = require('../../utils/APIClient.js');
@@ -11,11 +12,36 @@ Page({
     questionsData: {},
   },
 
+=======
+const APIClient = require('../../utils/APIClient.js');
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: false,
+    productionData: {},
+    questionsData: {}
+  },
+
+  /**
+   * 组件的方法列表
+   */
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   methods: {
     shareImage: function(e) {
       console.log(e.target.dataset.flag)
     }
   },
+<<<<<<< HEAD
 
   onLoad: function (options) {
     //分享按钮
@@ -91,5 +117,34 @@ Page({
         console.log("转发失败:" + JSON.stringify(res));
       }
     }
+=======
+  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,
+      })
+    })
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 })

+ 7 - 0
pages/art/art.json

@@ -1,9 +1,16 @@
 {
   "component": true,
   "usingComponents": {
+<<<<<<< HEAD
     "tarbar": "/compontents/tarbar/tarbar",  
     "target": "/compontents/target/target",
     "chat": "/compontents/chat/chat",
     "lessonList": "/compontents/lesson_list/lessonList"
+=======
+    "target": "/compontents/target/target",
+    "chat": "/compontents/chat/chat",
+    "lessonList": "/compontents/lesson_list/lessonList",
+    "share": "/compontents/share/share"
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   }
 }

+ 135 - 0
pages/art/art.wxml

@@ -1,4 +1,5 @@
 <!--pages/art/art.wxml-->
+<<<<<<< HEAD
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar"/>
@@ -154,3 +155,137 @@
   </view>
 </view>
 
+=======
+
+<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> 
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599

+ 3 - 0
pages/art/art.wxss

@@ -1,11 +1,14 @@
 /* pages/art/art.wxss */
 
+<<<<<<< HEAD
 .art {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
 }
 
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 .material,
 .works,
 .share {

+ 58 - 0
pages/index/index.js

@@ -3,7 +3,10 @@
 const app = getApp()
 const util = require('../../utils/util.js');
 const APIClient = require('../../utils/APIClient.js');
+<<<<<<< HEAD
 const login = require('../../utils/loginSchedule.js');
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 
 Page({
   data: {
@@ -15,10 +18,43 @@ Page({
     data: {},
     grade: "",
     time: "",
+<<<<<<< HEAD
     oneData: {},
     share: false,
   },
   
+=======
+    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 });
+    }
+  },
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   lower: function (e) {
     //console.log(e);
     //console.log(e.detail.scrollTop)
@@ -34,6 +70,7 @@ Page({
     // }
   },
 
+<<<<<<< HEAD
   onLoad: function (options) {
     //获取分享过来的值跳转页面
     const ind  = options.ind;
@@ -60,10 +97,27 @@ Page({
       }).success(res => {
         console.log(res)
         this.setData({
+=======
+  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({
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
           data: res.data.data,
           grade: util.gradeUpper(res.data.data.users.grade),
           time: util.day(res.data.data.timeSpend)
         })
+<<<<<<< HEAD
       })
     }, function() {
       wx.showModal({
@@ -81,4 +135,8 @@ Page({
     });  
   },
 
+=======
+    })
+  },
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 })

+ 3 - 0
pages/index/index.json

@@ -1,7 +1,10 @@
 
 {
     "usingComponents": {
+<<<<<<< HEAD
      "tarbar": "/compontents/tarbar/tarbar",
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
      "curriculum": "/compontents/curriculum/curriculum",
      "recommend": "../recommend/recommend",
      "art": "../art/art"

+ 26 - 0
pages/index/index.wxml

@@ -1,10 +1,26 @@
 <!--index.wxml-->
 <view class="container">
   <!-- 标题 -->
+<<<<<<< HEAD
   <tarbar id="tarbar"/>
   <!-- 内容 -->
   <view class="content">
       <scroll-view scroll-y="true" bindscroll="lower" scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
+=======
+  <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">
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
           <!-- 我的 -->
           <view class="my {{navBtnSelectIdx == 0 ? '' : 'none'}}">
             <!-- 个人信息 -->
@@ -74,6 +90,7 @@
             </view> -->
           </view>
           <!-- 本周推荐 -->
+<<<<<<< HEAD
           <!-- <view class="recommend {{navBtnSelectIdx == 1 ? '' : 'none'}}">
             <recommend recommendData="{{recommendData}}"/>
           </view> -->
@@ -87,6 +104,15 @@
             productionData="{{productionData}}"
             questionsData="{{questionsData}}"/>
           </view> -->
+=======
+          <view class="recommend {{navBtnSelectIdx == 1 ? '' : 'none'}}">
+            <recommend recommendData="{{recommendData}}"/>
+          </view>
+          <!-- 科学艺术 -->
+          <view class="art {{navBtnSelectIdx == 7 ? '' : 'none'}}">
+            <art />
+          </view>
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       </scroll-view>
   </view>
 </view>

+ 74 - 0
pages/index/index.wxss

@@ -1,14 +1,88 @@
 /**index.wxss**/
+<<<<<<< HEAD
+=======
+.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;
+}
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 
 /* 隐藏内容 */
 .none {
   display: none;
 } 
 
+<<<<<<< HEAD
 .my {
   width: 100%;
   padding: 0 15rpx;
   box-sizing: border-box;
+=======
+/*个人一些信息*/
+.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;
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 }
 
 .message,.medal {

+ 36 - 0
pages/input_content/input_content.js

@@ -3,7 +3,10 @@
 const app = getApp();
 const url = require('../../utils/const.js');
 const APIClient = require('../../utils/APIClient.js');
+<<<<<<< HEAD
 const login = require('../../utils/loginSchedule.js');
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 
 const HOST = url.apiUrl;
 
@@ -15,8 +18,12 @@ Page({
   data: {
     tempFilePath: [],
     imgId: [],
+<<<<<<< HEAD
     textValue: '',
     type: ''
+=======
+    textValue: ''
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 
   /**
@@ -92,7 +99,14 @@ Page({
   },
   //点击发送
   send: function() {
+<<<<<<< HEAD
     if(this.data.imgId.length == 0 && this.data.type == 2){
+=======
+    let header = {
+      uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
+    }
+    if(this.data.imgId.length == 0){
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
       wx.showModal({
         title: '提示',
         content: '请上传分享的作品',
@@ -105,6 +119,7 @@ Page({
         }
       })
       return false;
+<<<<<<< HEAD
     } 
     let data = {
       "title": this.data.textValue,
@@ -147,6 +162,23 @@ Page({
   cancel: function() {
     wx.navigateBack({ changed: true });
   },
+=======
+    }
+    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);
+    })
+    
+  },
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   /**
    * 图片预览
    */
@@ -171,9 +203,13 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+<<<<<<< HEAD
     this.setData({
       type: options.type
     })
+=======
+  
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
   },
 
   /**

+ 11 - 0
pages/input_content/input_content.wxml

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

+ 32 - 0
pages/recommend/recommend.js

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 //获取应用实例
 const app = getApp()
 const util = require('../../utils/util.js');
@@ -39,4 +40,35 @@ Page({
     });
   },
   
+=======
+// 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: {
+    
+  }
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 })

+ 3 - 0
pages/recommend/recommend.json

@@ -1,7 +1,10 @@
 {
   "component": true,
   "usingComponents": {
+<<<<<<< HEAD
     "tarbar": "/compontents/tarbar/tarbar",    
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
     "target": "/compontents/target/target"
   }
 }

+ 50 - 0
pages/recommend/recommend.wxml

@@ -1,4 +1,5 @@
 <!--pages/recommend/recommend.wxml-->
+<<<<<<< HEAD
 <view class="container">
   <!-- 标题 -->
   <tarbar id="tarbar" />
@@ -57,4 +58,53 @@
         </view> 
       </scroll-view>
   </view>
+=======
+
+<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>
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 </view>

+ 3 - 0
pages/recommend/recommend.wxss

@@ -1,5 +1,6 @@
 /* pages/recommend/recommend.wxss */
 
+<<<<<<< HEAD
 
 .recommend {
   width: 100%;
@@ -7,6 +8,8 @@
   box-sizing: border-box;
 }
 
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 .unfold {
     position: absolute;
     right: 28rpx;

+ 8 - 0
project.config.json

@@ -10,7 +10,11 @@
 	"compileType": "miniprogram",
 	"libVersion": "1.6.6",
 	"appid": "wx7b5ea6422847ea64",
+<<<<<<< HEAD
 	"projectname": "%E5%B0%8F%E5%AD%A6%E7%8E%8B%E8%80%85%E7%8F%AD(2)",
+=======
+	"projectname": "%E5%B0%8F%E5%AD%A6%E7%8E%8B%E8%80%85%E7%8F%AD",
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 	"condition": {
 		"search": {
 			"current": -1,
@@ -22,6 +26,7 @@
 		},
 		"miniprogram": {
 			"current": -1,
+<<<<<<< HEAD
 			"list": [
 				{
 					"id": -1,
@@ -31,6 +36,9 @@
 					"scene": "1001"
 				}
 			]
+=======
+			"list": []
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 		}
 	}
 }

+ 11 - 0
utils/APIClient.js

@@ -7,6 +7,10 @@ function genAPIUrl(action) {
 	return HOST + action;
 }
 
+<<<<<<< HEAD
+=======
+
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 module.exports = {
     // 获取我的data
 	getMySchedule(header) {
@@ -25,7 +29,11 @@ module.exports = {
 	},
 	//获取分享作品list
 	getProductionSchedule(header, data) {
+<<<<<<< HEAD
 		let url = genAPIUrl('wx/posts/reply');
+=======
+		let url = genAPIUrl('wx/posts/findPostsReplyList');
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 		return request.getInstance().url(url).header(header).data(data).method('GET').send();
 	},
 	//保存评论
@@ -33,6 +41,7 @@ module.exports = {
 		let url = genAPIUrl('wx/reply');
 		return request.getInstance().url(url).header(header).data(data).method('POST').send();
 	},
+<<<<<<< HEAD
 	//分享查询单条
 	getOneSchedule(header, data) {
 		let url = genAPIUrl('wx/posts/one');
@@ -43,4 +52,6 @@ module.exports = {
 		let url = genAPIUrl('wx/course');
 		return request.getInstance().url(url).header(header).data(data).method('GET').send();
 	}
+=======
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 }

+ 7 - 0
utils/util.js

@@ -41,6 +41,7 @@ const day = msd => {
   return time;          
 }
 
+<<<<<<< HEAD
 //获取当前页面传的的值
 
 function getUrl() {
@@ -60,4 +61,10 @@ module.exports = {
   gradeUpper,
   day,
   getUrl
+=======
+module.exports = {
+  formatTime: formatTime,
+  gradeUpper,
+  day
+>>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
 }