xiaxiaofeng vor 8 Jahren
Ursprung
Commit
c3ed780cec
40 geänderte Dateien mit 2997 neuen und 25 gelöschten Zeilen
  1. 2 1
      app.js
  2. 24 0
      app.json
  3. 7 1
      config.js
  4. 247 0
      pages/channel/image/add/add.js
  5. 1 0
      pages/channel/image/add/add.json
  6. 25 0
      pages/channel/image/add/add.wxml
  7. 197 0
      pages/channel/image/add/add.wxss
  8. 250 0
      pages/channel/index/index.js
  9. 1 0
      pages/channel/index/index.json
  10. 45 0
      pages/channel/index/index.wxml
  11. 189 0
      pages/channel/index/index.wxss
  12. 163 0
      pages/channel/user/application/application.js
  13. 3 0
      pages/channel/user/application/application.json
  14. 30 0
      pages/channel/user/application/application.wxml
  15. 204 0
      pages/channel/user/application/application.wxss
  16. 231 0
      pages/channel/user/followers/followers.js
  17. 3 0
      pages/channel/user/followers/followers.json
  18. 33 0
      pages/channel/user/followers/followers.wxml
  19. 204 0
      pages/channel/user/followers/followers.wxss
  20. 231 0
      pages/channel/user/following_users/following_users.js
  21. 3 0
      pages/channel/user/following_users/following_users.json
  22. 32 0
      pages/channel/user/following_users/following_users.wxml
  23. 204 0
      pages/channel/user/following_users/following_users.wxss
  24. 175 0
      pages/channel/video/add/add.js
  25. 1 0
      pages/channel/video/add/add.json
  26. 21 0
      pages/channel/video/add/add.wxml
  27. 80 0
      pages/channel/video/add/add.wxss
  28. 210 0
      pages/channel/view/view.js
  29. 1 0
      pages/channel/view/view.json
  30. 35 0
      pages/channel/view/view.wxml
  31. 108 0
      pages/channel/view/view.wxss
  32. BIN
      pages/images/default.png
  33. 2 2
      pages/person/image/add/add.wxml
  34. 5 5
      pages/person/image/send/send.js
  35. 3 3
      pages/person/image/view/view.js
  36. 15 2
      pages/person/index/index.js
  37. 2 1
      pages/person/video/add/add.js
  38. 2 2
      pages/person/video/add/add.wxml
  39. 6 6
      pages/person/video/send/send.js
  40. 2 2
      pages/person/video/view/view.js

+ 2 - 1
app.js

@@ -36,7 +36,8 @@ App({
     /**
      * 小程序初始化时执行,我们初始化客户端的登录地址,以支持所有的会话操作
      */
-    onLaunch() {
+    onLaunch(options) {
+        console.log(options);
         qcloud.setLoginUrl(config.service.loginUrl);
         // this.doLogin();
     },

+ 24 - 0
app.json

@@ -8,8 +8,32 @@
         "pages/person/video/view/view",
         "pages/person/video/send/send",
         "pages/person/end/end",
+        "pages/channel/index/index",
+        "pages/channel/image/add/add",
+        "pages/channel/video/add/add",
+        "pages/channel/view/view",
+        "pages/channel/user/application/application",
+        "pages/channel/user/followers/followers",
+        "pages/channel/user/following_users/following_users",
         "pages/test/video"
     ],
+    "tabBar": {
+        "color": "#7A7E83",
+        "selectedColor": "#fff",
+        "borderStyle": "black",
+        "backgroundColor": "#000",
+        "list": [{
+        "pagePath": "pages/person/index/index",
+        "iconPath": "pages/images/geren.png",
+        "selectedIconPath":"pages/images/geren.png",
+        "text": "制作"
+        }, {
+        "pagePath": "pages/channel/index/index",
+        "iconPath": "pages/images/qun.png",
+        "selectedIconPath":"pages/images/qun.png",
+        "text": "密频"
+        }]
+    },
     "window": {
         "navigationBarTextStyle": "white",
         "navigationBarTitleText": "密件",

+ 7 - 1
config.js

@@ -28,7 +28,13 @@ var config = {
         
         //新建消息
 
-        messageAddUrl:`https://${host}/api/messages`
+        messageAddUrl:`https://${host}/api/messages`,
+        
+
+        //新建频道消息
+
+        channelMessageAddUrl:`https://${host}/api/posts`
+
 
     }
 };

+ 247 - 0
pages/channel/image/add/add.js

@@ -0,0 +1,247 @@
+// 引入 QCloud 小程序增强 SDK
+var qcloud = require('../../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var app = getApp()
+Page({
+  data: {
+  "imageSrc":'',
+  "text":'',
+  "is_qun":0,
+  "busy1":false,
+  "textarea":false,
+  "expire":false,
+  "imageAble":false,
+  "upload_busy":false
+  },
+  onLoad: function () {
+    console.log('onLoad');
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    const ctx = wx.createCanvasContext('myCanvas')
+    this.chooseImage();
+  },
+  onShow: function () {
+    console.log('onShow');
+    // this.chooseImage();
+  },
+  chooseImage: function() {
+    var self = this;
+    if(self.data.upload_busy||self.data.textarea){
+      console.log(self.data.textarea)
+      return;
+    }
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album','camera'],
+      success: function(res) {
+        //  showMsg('提示信息','chooseImage successful,temp path is'+res.tempFilePaths[0]);
+        console.log(res);
+        console.log('chooseImage success, temp path is', res.tempFilePaths[0])
+        wx.getImageInfo({
+          src: res.tempFilePaths[0],
+          success: function (res) {
+            console.log(res)
+          }
+        })
+        var imageSrc = res.tempFilePaths[0];
+        // wx.saveFile({
+        //   tempFilePath: imageSrc,
+        //   success: function(res) {
+        //     console.log(res)
+        //   }
+        // })
+        // wx.getSavedFileList({
+        //   success: function(res) {
+        //     console.log(res.fileList)
+        //   }
+        // })
+        self.setData({
+            'upload_busy':true
+        })
+        //上传图片到服务器
+        wx.uploadFile({
+          url: config.service.uploadUrl,
+          filePath: imageSrc,
+          name: 'file',
+          success: function(res) {
+            console.log(res.statusCode);
+            if(res.statusCode==200){
+              var data=JSON.parse(res.data);
+              console.log(data);
+              if(data.success==true){
+                self.setData({
+                    'imageSrc':data.file.url,
+                    'imageAble':false
+                })
+                showSuccess('上传成功');
+              }else{
+                showMsg('提示信息','上传失败');
+              }
+            }else if(res.statusCode==413){
+              showMsg('提示信息','上传失败,文件过大');
+            }else{
+              showMsg('提示信息','上传失败');
+            }
+          },
+          fail: function({errMsg}) {
+            console.log('uploadImage fail, errMsg is', errMsg);
+            showMsg('提示信息','上传失败,'+errMsg);
+          },
+          complete:function(){
+            self.setData({
+                'upload_busy':false
+            })
+          }
+        })
+
+      },
+      fail: function({errMsg}) {
+        // showMsg('提示信息','chooseImage fail, err is'+errMsg)
+      }
+    })
+  },
+  expire_set:function(e){
+    console.log(e.target.dataset);
+  },
+  formSubmit: function(e) {
+    var self = this;
+    if(self.data.upload_busy||self.data.busy1){
+      return;
+    }
+    if(self.data.imageSrc==""&&self.data.text==""){
+      showMsg("提示信息","文字和图片至少不为空");
+      return;
+    }
+    var data={};
+    if(self.data.imageSrc!=""){
+      data.image_url=self.data.imageSrc;
+    }
+    if(self.data.text!=""){
+      data.text=self.data.text;
+    }
+    if(e.detail.formId!='the formId is a mock one'){
+      data.form_id=e.detail.formId;
+    }
+    if(self.data.text!=""&&self.data.imageSrc==""){
+      data.type==1
+    }else{
+      data.type=2
+    }
+    self.setData({
+        'busy1':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.channelMessageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 wx.switchTab({
+                  url: '/pages/channel/index/index'
+                })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy1':false
+                  })
+                console.log('request complete');
+            }
+      });
+  },
+  textarea_toggle:function(){
+    if(this.data.textarea==false){
+        this.setData({
+            'textarea':true
+        })
+    }else{
+      this.setData({
+          'textarea':false
+      })
+    }
+  },
+  bindTextAreaInput:function(e){
+    console.log(e.detail.value)
+    this.setData({
+        'text':e.detail.value
+    })
+  },
+  bindTextAreaConfirm:function(e){
+    console.log(e.detail.value)
+    this.setData({
+        'text':e.detail.value
+    })
+  },
+  imageLoad: function(e){
+    console.log(e);
+    this.setData({
+        'imageAble':true
+    })
+    var width=e.detail.width;
+    var height=e.detail.height;
+    try {
+      var res = wx.getSystemInfoSync()
+      if(res.system.indexOf('Android')!==-1){
+        if(width>height){
+          this.setData({
+            'imageSrc':this.data.imageSrc+'/rotate/90',
+          })
+        }
+      }
+    } catch (e) {
+      // Do something when catch error
+    }
+  }
+})

+ 1 - 0
pages/channel/image/add/add.json

@@ -0,0 +1 @@
+{}

+ 25 - 0
pages/channel/image/add/add.wxml

@@ -0,0 +1,25 @@
+
+<!--add.wxml-->
+<view class="page">
+<loading hidden="{{!upload_busy}}">上传中...</loading>
+  <view class="content">
+    <view class="upload_img" style="overflow-y:auto;" bindtap="chooseImage">
+    <view  style="display:inline-block;width:100%;vertical-align: middle;">
+      <image src="{{imageSrc}}" class="image" mode="widthFix" bindload="imageLoad" style="display:{{imageAble?'block' :'none'}}"></image>
+    </view>
+    </view>
+    <view class="bottom">
+       <view class="txt">
+        <button bindtap="textarea_toggle" type="primary" hover-class="none" style="background-color:transparent;border:1px solid #fff;padding-top:0;padding-bottom:0;">添加文字</button>
+      </view>
+      <view class="submit">
+      <form report-submit="{{true}}" bindsubmit="formSubmit">
+          <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy1 ? true : false}}" formType="submit">保存</button>
+      </form>
+      </view>
+    </view>
+    <view class="textareas" hidden="{{!textarea}}">
+      <textarea bindinput="bindTextAreaInput" bindconfirm="bindTextAreaConfirm"   placeholder="请输入文字" />
+    </view>
+  </view>
+</view>

+ 197 - 0
pages/channel/image/add/add.wxss

@@ -0,0 +1,197 @@
+.container {
+  display: flex;
+  flex-direction: column;
+  min-height: 100%;
+  justify-content: space-between;
+  font-size: 32rpx;
+  font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
+}
+.page-body {
+  width: 100%;
+  flex-grow: 1;
+  overflow-x: hidden;
+}
+.page-section{
+  width: 100%;
+  margin-bottom: 0rpx;
+}
+.image-plus {
+  width: 150rpx;
+  height: 150rpx;
+  border: 2rpx solid #D9D9D9;
+  position: relative;
+}
+.image-plus-nb{
+  border: 0;
+}
+.image-plus-text{
+  color: #888888;
+  font-size: 28rpx;
+}
+.image-plus-horizontal {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  background-color: #d9d9d9;
+  width: 4rpx;
+  height: 80rpx;
+  transform: translate(-50%, -50%);
+}
+.image-plus-vertical {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  background-color: #d9d9d9;
+  width: 80rpx;
+  height: 4rpx;
+  transform: translate(-50%, -50%);
+}
+.image {
+  width: 100%;
+  height: 360rpx;
+}
+.page-body-info {
+  display: flex;
+  box-sizing: border-box;
+  padding: 30rpx;
+  height: 420rpx;
+  /*border-top: 1rpx solid #D9D9D9;*/
+  /*border-bottom: 1rpx solid #D9D9D9;*/
+  align-items: center;
+  justify-content: center;
+  margin-bottom: 0rpx;
+}
+.page-section-title{
+  font-size: 28rpx;
+  color: #999999;
+  margin-bottom: 0rpx;
+  padding-left: 30rpx;
+  padding-right: 30rpx;
+  line-height:90rpx;
+}
+textarea {
+    width: 700rpx;
+    padding: 25rpx 0;
+}
+.textarea-wrp {
+    padding: 0 25rpx;
+    background-color: #fff;
+}
+.button-wrapper{
+    margin: 1.17647059em 15px 0.3em;
+}
+.content{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+}
+.upload_img{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  background-repeat: no-repeat;
+  background-size: 100% auto;
+  background-position: center;
+}
+.upload_img:before {
+  content: '';
+  display: inline-block;
+  height: 100%;
+  vertical-align: middle;
+}
+.top{
+  position: absolute;
+  width: 100%;
+  top:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+.bottom{
+  position: absolute;
+  width: 100%;
+  bottom:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+.txt{
+  /*width: 120px;*/
+  /*height: 35px;*/
+  float: left;
+  margin-left:30px; 
+  margin-top: 17.5px;
+}
+.txt button{
+ display:block;
+  color:#fff;
+  width:120px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+.submit{
+  width: 120px;
+  /*height: 35px;*/
+  float: right;
+  margin-right:30px; 
+  margin-top: 17.5px;
+}
+.submit button{
+  display:block;
+  color:#fff;
+  width:120px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+.textareas{
+  position: absolute;
+  width: 100%;
+  bottom:30%;
+  height: 200px;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+.textareas textarea{
+  margin-left: 5%;
+  width: 90%;
+  height:100%;
+  /*padding: 30px;*/
+  font-size:14px;
+  color: #fff;
+}
+.rotate{
+  transform:rotate(90deg);
+}
+.picker{
+  line-height:2.55555556;
+  color:#fff;
+  margin-left:auto;
+  margin-right:auto;
+  padding-left:14px;
+  padding-right:14px;
+  box-sizing:border-box;
+  width:90px;
+  background-color:#50B7E3;
+  border:0px solid #50B7E3;
+  font-size:14px;
+  border-radius:30px;
+  text-align:center;
+  background:transparent;
+  border:1px solid #fff;
+}
+.setting:before {
+  content: '';
+  display: inline-block;
+  height: 100%;
+  vertical-align: middle;
+}

+ 250 - 0
pages/channel/index/index.js

@@ -0,0 +1,250 @@
+// pages/channel/index/index.js
+// 引入 QCloud 小程序增强 SDK
+Date.prototype.format = function(format){ 
+	var o = { 
+	"M+" : this.getMonth()+1, //month 
+	"d+" : this.getDate(), //day 
+	"h+" : this.getHours(), //hour 
+	"m+" : this.getMinutes(), //minute 
+	"s+" : this.getSeconds(), //second 
+	"q+" : Math.floor((this.getMonth()+3)/3), //quarter 
+	"S" : this.getMilliseconds() //millisecond 
+	} 
+
+	if(/(y+)/.test(format)) { 
+	format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
+	} 
+
+	for(var k in o) { 
+	if(new RegExp("("+ k +")").test(format)) { 
+	format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length)); 
+	} 
+	} 
+	return format; 
+}
+
+var qcloud = require('../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+var busy=false;
+//获取应用实例
+var app = getApp()
+Page({
+  data:{
+    userInfo: {},
+    loading:false,
+    loading_more:false,
+    next_data:true,
+    busy:false,
+    posts:[]
+  },
+  post_list:function(){
+    var self = this;
+    if(self.data.busy){
+      return;
+    }
+    self.setData({
+        loading:true,
+        busy:true
+    });
+    var url;
+    if(self.data.next_page_url==null){
+      url=config.service.apiUrl+'timeline';
+    }else{
+      url=self.data.next_page_url
+    }
+    qcloud.request({
+        // 要请求的地址
+        url: url,
+        success(result) {
+            if(result.data.success==true){
+                for (var i=0;i<result.data.posts.data.length;i++){
+                  var datestr=Date.parse((result.data.posts.data[i]['created_at']).toString().replace(/-/g,   "/"));
+                  if(datestr){
+                    result.data.posts.data[i]['created_at']=new Date(datestr).format("hh:mm");
+                  }else{
+                    result.data.posts.data[i]['created_at']= '--:--'
+                  }
+                }
+                self.setData({
+                    posts:result.data.posts.data
+                })
+            }
+            if(result.data.posts.next_page_url!==null){
+                self.setData({
+                    next_data:true,
+                    next_page_url:result.data.posts.next_page_url
+                })
+            }else{
+                self.setData({
+                    next_data:false,
+                    next_page_url:null
+                })
+            }
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            console.log('request fail', error);
+        },
+
+        complete() {
+           busy=false;
+            self.setData({
+                loading:false,
+                busy:false
+            })
+            console.log('request complete');
+        }
+    });
+  },
+  load_more(){
+      var self = this;
+      var request_url=self.data.next_page_url;
+      if(!request_url){
+          return;
+      }
+      if(self.data.busy){
+        return;
+      }
+      self.setData({
+        loading:true,
+        busy:true
+      });
+      qcloud.request({
+          // 要请求的地址
+          url: request_url,
+          success(result) {
+              if(result.data.success==true){
+                  var item=self.data.posts;
+                  var obj=result.data.posts.data;
+                  for (var i=0;i<obj.length;i++){
+                    var datestr=Date.parse((obj[i]['created_at']).toString().replace(/-/g,   "/"));
+                    if(datestr){
+                      obj[i]['created_at']=new Date(datestr).format("hh:mm");
+                    }else{
+                      obj[i]['created_at']= '--:--'
+                    }
+                    item.push(obj[i]);
+                  }
+                  self.setData({
+                      posts:item
+                  });
+                  if(result.data.posts.next_page_url!==null){
+                      self.setData({
+                          next_data:true,
+                          next_page_url:result.data.posts.next_page_url
+                      })
+                  }else{
+                      self.setData({
+                          next_data:false,
+                          next_page_url:null
+                      })
+                  }
+              }
+              console.log('request success', result);
+          },
+
+          fail(error) {
+              console.log('request fail', error);
+          },
+
+          complete() {
+              self.setData({
+                  loading:false,
+                  busy:false
+              })
+              console.log('request complete');
+          }
+    });
+  },
+  onReachBottom: function() {
+    var self = this;
+    self.load_more();
+  },
+  onShareAppMessage: function () {
+    return {
+      title: '密频',
+      path: 'pages/channel/index/index',
+      success: function(res) {
+        showSuccess('分享成功');
+        console.log(res);
+        // 分享成功
+      },
+      fail: function(res) {
+        // 分享失败
+        console.log(res);
+      },
+      complete:function(res){
+        console.log(res);
+      }
+    }
+  },
+  onLoad:function(options){
+    // 页面初始化 options为页面跳转所带来的参数
+  },
+  onReady:function(){
+    // 页面渲染完成
+  },
+  onShow:function(){
+    // 页面显示
+    var self=this;
+    if(busy){
+      return;
+    }
+    self.setData({
+        posts:[],
+        loading:true,
+        busy:false
+    });
+    busy=true;
+    var self=this;
+    app.getUserInfo(function(userInfo){
+      self.post_list();
+    });
+  },
+  onHide:function(){
+    // 页面隐藏
+  },
+  onUnload:function(){
+    // 页面关闭
+  }
+})

+ 1 - 0
pages/channel/index/index.json

@@ -0,0 +1 @@
+{}

+ 45 - 0
pages/channel/index/index.wxml

@@ -0,0 +1,45 @@
+<!--pages/channel/index/index.wxml-->
+<view class="page">
+  <view class="page__bd">
+    <view class="section">
+        <view class="article">
+            <text>密频是你的私有频道,加入你的密频的朋友可以看到你在密频中发的内容,凡是看过你的密件的朋友你可以批准他是否加入你的密频。</text>
+        </view>
+    </view>
+    <view class="section" style="display:inline-block;width:100%;">
+        <view class="button-wrapper" style="margin-left:40px;float:left;width:38%;">
+            <navigator class="button" url="/pages/channel/image/add/add" >制作图片密件</navigator>
+        </view>
+         <view class="button-wrapper" style="margin-right:40px;float:right;width:38%;">
+            <navigator class="button" url="/pages/channel/video/add/add">制作视频密件</navigator>
+        </view>
+    </view>
+    <view class="section" style="display:inline-block;width:100%;margin:0 auto;">
+        <view  style="width:38%;margin:0 auto;">
+            <navigator class="button" url="/pages/channel/user/application/application" >关注管理</navigator>
+        </view>
+    </view>
+    <view class="section" style="display:inline-block;width:100%;margin-bottom:0;margin-top:20px;">
+        <view style="width:100%;font-size:14px;color:#fff;text-align:center;">最近密频的更新内容</view>
+        <view class="weui-loadmore" wx:if="{{loading}}">
+            <view class="weui-loading"></view>
+            <text class="weui-loadmore__tips">正在加载</text>
+        </view>
+        <view style="width:100%;display:inline-block;padding:50px 40px;box-sizing:border-box;padding-top:10px;padding-bottom:0px;">
+            <view class="item" wx:for="{{posts}}" wx:key="id">
+                <navigator url="/pages/channel/view/view?hash_key={{item.hash_key}}" open-type="navigate" >
+                    <image src="{{item.user.headimgurl}}" mode="widthFix"></image>
+                </navigator>
+                <view class="u_name" style="color:#fff;text-align:center;font-size:12px;margin-top:5px;">{{item.user.nickname}}</view>
+                <view class="date_time" style="color:#fff;text-align:center;font-size:12px;margin-top:5px;">{{item.created_at}}</view>
+            </view>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{!next_data&&!loading&&posts.length!==0}}">
+            <text class="weui-loadmore__tips">数据已经全部加载完了</text>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{!next_data&&!loading&&posts.length==0}}">
+            <text class="weui-loadmore__tips">暂无数据</text>
+        </view>
+    </view>
+  </view>
+</view>

+ 189 - 0
pages/channel/index/index.wxss

@@ -0,0 +1,189 @@
+/* pages/channel/index/index.wxss */
+.switch_section{
+    width: 100%;
+    display: inline-block;
+    background-color:#fff;
+    position:relative;
+}
+.switch_section::before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #D9D9D9;
+    color: #D9D9D9;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}
+.switch_section::after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #D9D9D9;
+    color: #D9D9D9;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}
+.switch_view{
+    padding-left:30rpx;
+    padding-right:30rpx;
+    height: 40px;
+    position: relative;
+}
+.switch_view::before {
+    content: " ";
+    position: absolute;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #D9D9D9;
+    color: #D9D9D9;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.switch_text{
+    float:left;
+    display: inline-block;
+    font-size:32rpx;
+    color:#000;
+    margin-right:16rpx;
+    height:40px;
+    line-height: 40px;
+}
+switch{
+    float:right;
+    margin-top: 4px;
+}
+.section__title {
+    margin-bottom:16rpx;
+    padding-left:30rpx;
+    padding-right:30rpx;
+    color:#999999;
+    font-size:14px;
+}
+.button-wrapper{
+    margin:0;
+    /*margin-bottom:1.8em;*/
+    /*width:150px;*/
+    float:left;
+}
+.button {
+position:relative;
+display:block;
+margin-left:auto;
+margin-right:auto;
+padding-left:14px;
+padding-right:14px;
+box-sizing:border-box;
+/*font-size:18px;*/
+text-align:center;
+text-decoration:none;
+line-height:2.55555556;
+border-radius:30px;
+-webkit-tap-highlight-color:transparent;
+overflow:hidden;
+color:#fff;
+/*width:200px;*/
+background-color: #50B7E3;
+border:0px solid #AAAAAA;
+font-size: 14px;
+padding-bottom:1px;
+padding-top:1px;
+}
+.section {
+margin-bottom:10rpx;
+
+}
+.article{
+    padding:50px 40px;
+}
+.article text{
+    line-height: 25px;
+    font-size:16px;
+    color: #fff;
+}
+.active{
+  position: fixed;
+  width: 100%;
+  height:100%;
+  top:0;
+  left:0;
+  background-color: rgba(0, 0, 0, 1);
+  overflow-y:auto; 
+}
+.item{
+    width:16%;
+    display: inline-block;
+    float:left;
+    margin-right:4%;
+    margin-bottom:10px;
+}
+.item:nth-child(5n){
+    margin-right:0;
+}
+.item image{
+    width:100%;
+}
+.weui-loadmore {
+    width: 65%;
+    margin: 1.5em auto;
+    line-height: 1.6em;
+    font-size: 14px;
+    text-align: center;
+}
+.weui-loading {
+    width: 20px;
+    height: 20px;
+    display: inline-block;
+    vertical-align: middle;
+    -webkit-animation: weuiLoading 1s steps(12, end) infinite;
+    animation: weuiLoading 1s steps(12, end) infinite;
+    background: transparent url(http://www.ibanling.com/h5/gate/images/loading.svg) no-repeat;
+    background-size: 100%;
+}
+.weui-loadmore__tips {
+    display: inline-block;
+    vertical-align: middle;
+}
+@-webkit-keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+
+@keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+.weui-loadmore_line {
+    border-top: 1px solid #E5E5E5;
+    margin-top: 2.4em;
+}
+.weui-loadmore_line .weui-loadmore__tips {
+    position: relative;
+    top: -0.9em;
+    padding: 0 .55em;
+    background-color: #000;
+    color: #999999;
+}

+ 163 - 0
pages/channel/user/application/application.js

@@ -0,0 +1,163 @@
+// pages/channel/user/application/application.js
+// 引入 QCloud 小程序增强 SDK
+var qcloud = require('../../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var busy=false;
+var app = getApp()
+Page({
+  data: {
+    userInfo: {},
+    loading:true,
+    users:[],
+    busy:false,
+    loading_show:false,
+    users:[]
+  },
+  user_list(){
+    var self = this;
+    if(self.data.busy){
+      return;
+    }
+    self.setData({
+        loading:true,
+        busy:true
+    })
+    qcloud.request({
+        // 要请求的地址
+        url: config.service.apiUrl+'friend_requests',
+
+        success(result) {
+            if(result.data.success==true){
+                self.setData({
+                    users:result.data.followers.data
+                })
+            }
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            console.log('request fail', error);
+        },
+
+        complete() {
+            self.setData({
+                loading:false,
+                busy:false
+            })
+            busy=false;
+            console.log('request complete');
+        }
+    });
+  },
+  onLoad: function () {
+    console.log('onLoad');
+  },
+  agree:function(e){
+    console.log(e);
+    var follower_id=e.target.dataset.followerId;
+    var self=this;
+    if(busy||!follower_id){
+        return;
+    }
+    if(wx.showLoading) {
+        wx.showLoading({
+            title: '操作中...',
+            mask:true
+        })
+    }else{
+        self.setData({
+            loading_show:true,
+        })
+    }
+    var data={};
+    data.follower_id=follower_id;
+    data.accept=1;
+    qcloud.request({
+        // 要请求的地址
+        url: config.service.apiUrl+'friend_requests',
+        method:"PUT",
+        data: data,
+        success(result) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            if(result.data.success==true){
+                showSuccess('操作成功');
+            }else{
+                showMsg("提示信息","操作失败");
+            }
+            self.user_list();
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            console.log('request fail', error);
+        },
+
+        complete() {
+            console.log('request complete');
+        }
+     });
+  },
+  onShow:function(){
+      if(busy){
+        return;
+      }
+      busy=true;
+      var self=this;
+      app.getUserInfo(function(userInfo){
+        self.user_list();
+      });
+  }
+})

+ 3 - 0
pages/channel/user/application/application.json

@@ -0,0 +1,3 @@
+{
+    "enablePullDownRefresh": true
+}

+ 30 - 0
pages/channel/user/application/application.wxml

@@ -0,0 +1,30 @@
+<!--pages/channel/user/application/application.wxml-->
+<loading hidden="{{!loading_show}}">操作中...</loading>
+<view class="page" style="background-color: #fff;">
+    <view class="weui-navbar">
+
+        <navigator  url="/pages/channel/user/application/application" open-type="redirect" class="weui-navbar__item weui-bar__item_on">申请</navigator>
+        <navigator url="/pages/channel/user/followers/followers" open-type="redirect" class="weui-navbar__item">关注我</navigator>
+        <navigator url="/pages/channel/user/following_users/following_users" open-type="redirect" class="weui-navbar__item">我关注</navigator>
+    </view>
+    <view class="weui-panel weui-panel_access">
+        <view class="weui-loadmore" wx:if="{{loading}}">
+            <view class="weui-loading"></view>
+            <text class="weui-loadmore__tips">正在加载</text>
+        </view>
+        <view class="weui-panel__bd" wx:if="{{users.length!==0&&!loading}}">
+            <view class="weui-media-box weui-media-box_appmsg" wx:for="{{users}}" wx:key="follower_id">
+                <view class="weui-media-box__hd">
+                    <image class="weui-media-box__thumb" src="{{item.follower.headimgurl ? item.follower.headimgurl : '/pages/images/default.png'}}"></image>
+                </view>
+                <view class="weui-media-box__bd">{{item.follower.nickname}}</view>
+                <view class="weui-media-box__bt">
+                    <button type="primary" hover-class="none" bindtap="agree" data-follower-id="{{item.follower_id}}">同意</button>
+                </view>
+            </view>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{users.length==0&&!loading}}">
+            <text class="weui-loadmore__tips">暂无数据</text>
+        </view>
+    </view>
+</view>

+ 204 - 0
pages/channel/user/application/application.wxss

@@ -0,0 +1,204 @@
+/* pages/channel/user/application/application.wxss */
+.weui-panel {
+    background-color: #FFFFFF;
+    margin-top: 10px;
+    position: relative;
+    overflow: hidden;
+}
+.weui-panel:first-child {
+    margin-top: 0;
+}
+/*.weui-panel:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}*/
+.weui-panel:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}
+.weui-panel__hd {
+    padding: 14px 15px 10px;
+    color: #999999;
+    font-size: 13px;
+    position: relative;
+}
+.weui-panel__hd:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box {
+    padding: 15px;
+    position: relative;
+    color: #000000;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-media-box_appmsg {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-align: center;
+    -webkit-align-items: center;
+    align-items: center;
+}
+.weui-media-box_appmsg .weui-media-box__hd {
+    margin-right: .8em;
+    width: 60px;
+    height: 60px;
+    line-height: 60px;
+    text-align: center;
+    float:left;
+}
+.weui-media-box_appmsg .weui-media-box__bd {
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    min-width: 0;
+}
+.weui-media-box_appmsg .weui-media-box__thumb {
+    width: 100%;
+    max-height: 100%;
+    vertical-align: top;
+}
+.weui-media-box:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box:first-child:before {
+    display: none;
+}
+.weui-loadmore {
+    width: 65%;
+    margin: 1.5em auto;
+    line-height: 1.6em;
+    font-size: 14px;
+    text-align: center;
+}
+.weui-loading {
+    width: 20px;
+    height: 20px;
+    display: inline-block;
+    vertical-align: middle;
+    -webkit-animation: weuiLoading 1s steps(12, end) infinite;
+    animation: weuiLoading 1s steps(12, end) infinite;
+    background: transparent url(http://www.ibanling.com/h5/gate/images/loading.svg) no-repeat;
+    background-size: 100%;
+}
+.weui-loadmore__tips {
+    display: inline-block;
+    vertical-align: middle;
+}
+@-webkit-keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+
+@keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+.weui-loadmore_line {
+    border-top: 1px solid #E5E5E5;
+    margin-top: 2.4em;
+}
+.weui-loadmore_line .weui-loadmore__tips {
+    position: relative;
+    top: -0.9em;
+    padding: 0 .55em;
+    background-color: #FFFFFF;
+    color: #999999;
+}
+.weui-media-box__bt{
+    width:80px;
+    position:absolute;
+    right:15px;
+}
+.weui-media-box__bt button{
+  display:block;
+  color:#fff;
+  width:80px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+
+.weui-navbar {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    /*position: absolute;*/
+    z-index: 500;
+    /*top: 0;*/
+    width: 100%;
+    background-color: #FAFAFA;
+}
+.weui-navbar__item {
+    position: relative;
+    display: block;
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    padding: 13px 0;
+    text-align: center;
+    font-size: 15px;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-navbar__item.weui-bar__item_on {
+    background-color: #50B7E3;
+    color: #fff;
+}

+ 231 - 0
pages/channel/user/followers/followers.js

@@ -0,0 +1,231 @@
+// pages/channel/user/followers/followers.js
+var qcloud = require('../../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var busy=false;
+var app = getApp()
+Page({
+  data: {
+    userInfo: {},
+    loading:true,
+    users:[],
+    busy:false,
+    loading_show:false,
+    users:[]
+  },
+  user_list(){
+    var self = this;
+    if(self.data.busy){
+      return;
+    }
+    self.setData({
+        loading:true,
+        busy:true
+    });
+    var url=config.service.apiUrl+'followers';
+    qcloud.request({
+        // 要请求的地址
+        url: url,
+        success(result) {
+            if(result.data.success==true){
+                self.setData({
+                    users:result.data.followers.data
+                })
+            }
+            if(result.data.followers.next_page_url!==null){
+                self.setData({
+                    next_data:true,
+                    next_page_url:result.data.followers.next_page_url
+                })
+            }else{
+                self.setData({
+                    next_data:false,
+                    next_page_url:null
+                })
+            }
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            console.log('request fail', error);
+        },
+
+        complete() {
+            self.setData({
+                loading:false,
+                busy:false
+            })
+            busy=false;
+            console.log('request complete');
+        }
+    });
+  },
+  load_more(){
+      var self = this;
+      var request_url=self.data.next_page_url;
+      if(!request_url){
+          return;
+      }
+      if(self.data.busy){
+        return;
+      }
+      self.setData({
+        loading:true,
+        busy:true
+      });
+        qcloud.request({
+            // 要请求的地址
+            url: request_url,
+            success(result) {
+                if(result.data.success==true){
+                    var item=self.data.users;
+                    var obj=result.data.followers.data;
+                    for (var i=0;i<obj.length;i++){
+                        item.push(obj[i]);
+                    }
+                    self.setData({
+                        users:item
+                    });
+                    if(result.data.followers.next_page_url!==null){
+                        self.setData({
+                            next_data:true,
+                            next_page_url:result.data.followers.next_page_url
+                        })
+                    }else{
+                        self.setData({
+                            next_data:false,
+                            next_page_url:null
+                        })
+                    }
+                }
+                console.log('request success', result);
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                self.setData({
+                    loading:false,
+                    busy:false
+                })
+                console.log('request complete');
+            }
+    });
+  },
+  onReachBottom: function() {
+    var self = this;
+    self.load_more();
+  },
+  del:function(e){
+    console.log(e);
+    var follower_id=e.target.dataset.followerId;
+    var self=this;
+    if(busy||!follower_id){
+        return;
+    }
+    if(wx.showLoading) {
+        wx.showLoading({
+            title: '操作中...',
+            mask:true
+        })
+    }else{
+        self.setData({
+            loading_show:true,
+        })
+    }
+    var data={};
+    data.follower_id=follower_id;
+    qcloud.request({
+        // 要请求的地址
+        url: config.service.apiUrl+'followers',
+        method:"DELETE",
+        data: data,
+        success(result) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            if(result.data.success==true){
+                showSuccess('操作成功');
+            }else{
+                showMsg("提示信息","操作失败");
+            }
+            self.user_list();
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            console.log('request fail', error);
+        },
+
+        complete() {
+            console.log('request complete');
+        }
+     });
+  },
+  onLoad: function () {
+    console.log('onLoad');
+  },
+  
+  onShow:function(){
+      if(busy){
+        return;
+      }
+      busy=true;
+      var self=this;
+      app.getUserInfo(function(userInfo){
+        self.user_list();
+      });
+  }
+})

+ 3 - 0
pages/channel/user/followers/followers.json

@@ -0,0 +1,3 @@
+{
+    "enablePullDownRefresh": true
+}

+ 33 - 0
pages/channel/user/followers/followers.wxml

@@ -0,0 +1,33 @@
+<!--pages/channel/user/followers/followers.wxml-->
+<loading hidden="{{!loading_show}}">操作中...</loading>
+<view class="page" style="background-color: #fff;">
+    <view class="weui-navbar">
+        <navigator  url="/pages/channel/user/application/application" open-type="redirect" class="weui-navbar__item">申请</navigator>
+        <navigator url="/pages/channel/user/followers/followers" open-type="redirect" class="weui-navbar__item weui-bar__item_on">关注我</navigator>
+        <navigator url="/pages/channel/user/following_users/following_users" open-type="redirect" class="weui-navbar__item">我关注</navigator>
+    </view>
+    <view class="weui-panel weui-panel_access">
+        <view class="weui-loadmore" wx:if="{{loading}}">
+            <view class="weui-loading"></view>
+            <text class="weui-loadmore__tips">正在加载</text>
+        </view>
+        <view class="weui-panel__bd" wx:if="{{users.length!==0&&!loading}}">
+            <view class="weui-media-box weui-media-box_appmsg" wx:for="{{users}}" wx:key="follower_id">
+                <view class="weui-media-box__hd">
+                    <image class="weui-media-box__thumb" src="{{item.follower.headimgurl ? item.follower.headimgurl : '/pages/images/default.png'}}"></image>
+                </view>
+                <view class="weui-media-box__bd">{{item.follower.nickname}}</view>
+                <view class="weui-media-box__bt">
+                    <button type="primary" hover-class="none" bindtap="del" data-follower-id="{{item.follower_id}}">删除</button>
+                </view>
+            </view>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{!next_data&&!loading&&users.length!==0}}">
+            <text class="weui-loadmore__tips">数据已经全部加载完了</text>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{users.length==0&&!loading}}">
+            <text class="weui-loadmore__tips">暂无数据</text>
+        </view>
+    </view>
+</view>
+

+ 204 - 0
pages/channel/user/followers/followers.wxss

@@ -0,0 +1,204 @@
+/* pages/channel/user/followers/followers.wxss */
+.weui-panel {
+    background-color: #FFFFFF;
+    margin-top: 10px;
+    position: relative;
+    overflow: hidden;
+}
+.weui-panel:first-child {
+    margin-top: 0;
+}
+/*.weui-panel:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}*/
+.weui-panel:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}
+.weui-panel__hd {
+    padding: 14px 15px 10px;
+    color: #999999;
+    font-size: 13px;
+    position: relative;
+}
+.weui-panel__hd:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box {
+    padding: 15px;
+    position: relative;
+    color: #000000;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-media-box_appmsg {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-align: center;
+    -webkit-align-items: center;
+    align-items: center;
+}
+.weui-media-box_appmsg .weui-media-box__hd {
+    margin-right: .8em;
+    width: 60px;
+    height: 60px;
+    line-height: 60px;
+    text-align: center;
+    float:left;
+}
+.weui-media-box_appmsg .weui-media-box__bd {
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    min-width: 0;
+}
+.weui-media-box_appmsg .weui-media-box__thumb {
+    width: 100%;
+    max-height: 100%;
+    vertical-align: top;
+}
+.weui-media-box:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box:first-child:before {
+    display: none;
+}
+.weui-loadmore {
+    width: 65%;
+    margin: 1.5em auto;
+    line-height: 1.6em;
+    font-size: 14px;
+    text-align: center;
+}
+.weui-loading {
+    width: 20px;
+    height: 20px;
+    display: inline-block;
+    vertical-align: middle;
+    -webkit-animation: weuiLoading 1s steps(12, end) infinite;
+    animation: weuiLoading 1s steps(12, end) infinite;
+    background: transparent url(http://www.ibanling.com/h5/gate/images/loading.svg) no-repeat;
+    background-size: 100%;
+}
+.weui-loadmore__tips {
+    display: inline-block;
+    vertical-align: middle;
+}
+@-webkit-keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+
+@keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+.weui-loadmore_line {
+    border-top: 1px solid #E5E5E5;
+    margin-top: 2.4em;
+}
+.weui-loadmore_line .weui-loadmore__tips {
+    position: relative;
+    top: -0.9em;
+    padding: 0 .55em;
+    background-color: #FFFFFF;
+    color: #999999;
+}
+.weui-media-box__bt{
+    width:80px;
+    position:absolute;
+    right:15px;
+}
+.weui-media-box__bt button{
+  display:block;
+  color:#fff;
+  width:80px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+
+.weui-navbar {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    /*position: absolute;*/
+    z-index: 500;
+    /*top: 0;*/
+    width: 100%;
+    background-color: #FAFAFA;
+}
+.weui-navbar__item {
+    position: relative;
+    display: block;
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    padding: 13px 0;
+    text-align: center;
+    font-size: 15px;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-navbar__item.weui-bar__item_on {
+    background-color: #50B7E3;
+    color: #fff;
+}

+ 231 - 0
pages/channel/user/following_users/following_users.js

@@ -0,0 +1,231 @@
+// pages/channel/user/following_users/following_users.js
+var qcloud = require('../../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var busy=false;
+var app = getApp()
+Page({
+  data: {
+    userInfo: {},
+    loading:true,
+    users:[],
+    busy:false,
+    loading_show:false,
+    users:[]
+  },
+  user_list(){
+    var self = this;
+    if(self.data.busy){
+      return;
+    }
+    self.setData({
+        loading:true,
+        busy:true
+    });
+    var url=config.service.apiUrl+'following_users';
+    qcloud.request({
+        // 要请求的地址
+        url: url,
+        success(result) {
+            if(result.data.success==true){
+                self.setData({
+                    users:result.data.following_users.data
+                })
+            }
+            if(result.data.following_users.next_page_url!==null){
+                self.setData({
+                    next_data:true,
+                    next_page_url:result.data.following_users.next_page_url
+                })
+            }else{
+                self.setData({
+                    next_data:false,
+                    next_page_url:null
+                })
+            }
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            console.log('request fail', error);
+        },
+
+        complete() {
+            self.setData({
+                loading:false,
+                busy:false
+            })
+            busy=false;
+            console.log('request complete');
+        }
+    });
+  },
+  load_more(){
+      var self = this;
+      var request_url=self.data.next_page_url;
+      if(!request_url){
+          return;
+      }
+      if(self.data.busy){
+        return;
+      }
+      self.setData({
+        loading:true,
+        busy:true
+      });
+        qcloud.request({
+            // 要请求的地址
+            url: request_url,
+            success(result) {
+                if(result.data.success==true){
+                    var item=self.data.users;
+                    var obj=result.data.following_users.data;
+                    for (var i=0;i<obj.length;i++){
+                        item.push(obj[i]);
+                    }
+                    self.setData({
+                        users:item
+                    });
+                    if(result.data.following_users.next_page_url!==null){
+                        self.setData({
+                            next_data:true,
+                            next_page_url:result.data.following_users.next_page_url
+                        })
+                    }else{
+                        self.setData({
+                            next_data:false,
+                            next_page_url:null
+                        })
+                    }
+                }
+                console.log('request success', result);
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                self.setData({
+                    loading:false,
+                    busy:false
+                })
+                console.log('request complete');
+            }
+    });
+  },
+  onReachBottom: function() {
+    var self = this;
+    self.load_more();
+  },
+  del:function(e){
+    console.log(e);
+    var follower_id=e.target.dataset.followerId;
+    var self=this;
+    if(busy||!follower_id){
+        return;
+    }
+    if(wx.showLoading) {
+        wx.showLoading({
+            title: '操作中...',
+            mask:true
+        })
+    }else{
+        self.setData({
+            loading_show:true,
+        })
+    }
+    var data={};
+    data.follower_id=follower_id;
+    qcloud.request({
+        // 要请求的地址
+        url: config.service.apiUrl+'following_users',
+        method:"DELETE",
+        data: data,
+        success(result) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            if(result.data.success==true){
+                showSuccess('操作成功');
+            }else{
+                showMsg("提示信息","操作失败");
+            }
+            self.user_list();
+            console.log('request success', result);
+        },
+
+        fail(error) {
+            if(wx.hideLoading) {
+                    wx.hideLoading();
+            }else{
+                self.setData({
+                    loading_show:false,
+                })
+            }
+            console.log('request fail', error);
+        },
+
+        complete() {
+            console.log('request complete');
+        }
+     });
+  },
+  onLoad: function () {
+    console.log('onLoad');
+  },
+  
+  onShow:function(){
+      if(busy){
+        return;
+      }
+      busy=true;
+      var self=this;
+      app.getUserInfo(function(userInfo){
+        self.user_list();
+      });
+  }
+})

+ 3 - 0
pages/channel/user/following_users/following_users.json

@@ -0,0 +1,3 @@
+{
+    "enablePullDownRefresh": true
+}

+ 32 - 0
pages/channel/user/following_users/following_users.wxml

@@ -0,0 +1,32 @@
+<!--pages/channel/user/following_users/following_users.wxml-->
+<loading hidden="{{!loading_show}}">操作中...</loading>
+<view class="page" style="background-color: #fff;">
+    <view class="weui-navbar">
+        <navigator  url="/pages/channel/user/application/application" open-type="redirect" class="weui-navbar__item">申请</navigator>
+        <navigator url="/pages/channel/user/followers/followers" open-type="redirect" class="weui-navbar__item">关注我</navigator>
+        <navigator url="/pages/channel/user/following_users/following_users" open-type="redirect" class="weui-navbar__item weui-bar__item_on">我关注</navigator>
+    </view>
+    <view class="weui-panel weui-panel_access">
+        <view class="weui-loadmore" wx:if="{{loading}}">
+            <view class="weui-loading"></view>
+            <text class="weui-loadmore__tips">正在加载</text>
+        </view>
+        <view class="weui-panel__bd" wx:if="{{users.length!==0&&!loading}}">
+            <view class="weui-media-box weui-media-box_appmsg" wx:for="{{users}}" wx:key="follower_id">
+                <view class="weui-media-box__hd">
+                    <image class="weui-media-box__thumb" src="{{item.following_user.headimgurl ? item.following_user.headimgurl : '/pages/images/default.png'}}"></image>
+                </view>
+                <view class="weui-media-box__bd">{{item.following_user.nickname}}</view>
+                <view class="weui-media-box__bt">
+                    <button type="primary" hover-class="none" bindtap="del" data-follower-id="{{item.follower_id}}">删除</button>
+                </view>
+            </view>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{!next_data&&!loading&&users.length!==0}}">
+            <text class="weui-loadmore__tips">数据已经全部加载完了</text>
+        </view>
+        <view class="weui-loadmore weui-loadmore_line" wx:if="{{users.length==0&&!loading}}">
+            <text class="weui-loadmore__tips">暂无数据</text>
+        </view>
+    </view>
+</view>

+ 204 - 0
pages/channel/user/following_users/following_users.wxss

@@ -0,0 +1,204 @@
+/* pages/channel/user/following_users/following_users.wxss */
+.weui-panel {
+    background-color: #FFFFFF;
+    margin-top: 10px;
+    position: relative;
+    overflow: hidden;
+}
+.weui-panel:first-child {
+    margin-top: 0;
+}
+/*.weui-panel:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}*/
+.weui-panel:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+}
+.weui-panel__hd {
+    padding: 14px 15px 10px;
+    color: #999999;
+    font-size: 13px;
+    position: relative;
+}
+.weui-panel__hd:after {
+    content: " ";
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1px;
+    border-bottom: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 100%;
+    transform-origin: 0 100%;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box {
+    padding: 15px;
+    position: relative;
+    color: #000000;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-media-box_appmsg {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-align: center;
+    -webkit-align-items: center;
+    align-items: center;
+}
+.weui-media-box_appmsg .weui-media-box__hd {
+    margin-right: .8em;
+    width: 60px;
+    height: 60px;
+    line-height: 60px;
+    text-align: center;
+    float:left;
+}
+.weui-media-box_appmsg .weui-media-box__bd {
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    min-width: 0;
+}
+.weui-media-box_appmsg .weui-media-box__thumb {
+    width: 100%;
+    max-height: 100%;
+    vertical-align: top;
+}
+.weui-media-box:before {
+    content: " ";
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    height: 1px;
+    border-top: 1px solid #E5E5E5;
+    color: #E5E5E5;
+    -webkit-transform-origin: 0 0;
+    transform-origin: 0 0;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    left: 15px;
+}
+.weui-media-box:first-child:before {
+    display: none;
+}
+.weui-loadmore {
+    width: 65%;
+    margin: 1.5em auto;
+    line-height: 1.6em;
+    font-size: 14px;
+    text-align: center;
+}
+.weui-loading {
+    width: 20px;
+    height: 20px;
+    display: inline-block;
+    vertical-align: middle;
+    -webkit-animation: weuiLoading 1s steps(12, end) infinite;
+    animation: weuiLoading 1s steps(12, end) infinite;
+    background: transparent url(http://www.ibanling.com/h5/gate/images/loading.svg) no-repeat;
+    background-size: 100%;
+}
+.weui-loadmore__tips {
+    display: inline-block;
+    vertical-align: middle;
+}
+@-webkit-keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+
+@keyframes weuiLoading {
+  0% {
+    transform: rotate3d(0, 0, 1, 0deg);
+  }
+
+  100% {
+    transform: rotate3d(0, 0, 1, 360deg);
+  }
+}
+.weui-loadmore_line {
+    border-top: 1px solid #E5E5E5;
+    margin-top: 2.4em;
+}
+.weui-loadmore_line .weui-loadmore__tips {
+    position: relative;
+    top: -0.9em;
+    padding: 0 .55em;
+    background-color: #FFFFFF;
+    color: #999999;
+}
+.weui-media-box__bt{
+    width:80px;
+    position:absolute;
+    right:15px;
+}
+.weui-media-box__bt button{
+  display:block;
+  color:#fff;
+  width:80px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+
+.weui-navbar {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    /*position: absolute;*/
+    z-index: 500;
+    /*top: 0;*/
+    width: 100%;
+    background-color: #FAFAFA;
+}
+.weui-navbar__item {
+    position: relative;
+    display: block;
+    -webkit-box-flex: 1;
+    -webkit-flex: 1;
+    flex: 1;
+    padding: 13px 0;
+    text-align: center;
+    font-size: 15px;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-navbar__item.weui-bar__item_on {
+    background-color: #50B7E3;
+    color: #fff;
+}

+ 175 - 0
pages/channel/video/add/add.js

@@ -0,0 +1,175 @@
+// 引入 QCloud 小程序增强 SDK
+var qcloud = require('../../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var app = getApp()
+Page({
+  data: {
+  "videoSrc":'',
+  "busy":false,
+  "busy1":false,
+  "textarea":false,
+  "upload_busy":false
+  },
+  onLoad: function () {
+    console.log('onLoad');
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    this.chooseVideo();
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+  chooseVideo: function() {
+    var self = this;
+    if(self.data.upload_busy){
+      return;
+    }
+    wx.chooseVideo({
+      sourceType: ['album','camera'],
+      maxDuration: 60,
+      success: function(res) {
+        console.log('chooseVideo success, temp path is', res.tempFilePath)
+        console.log(res);
+        if(res.size>20*1024*1000){
+          showMsg('提示信息','视频大小不能大于20M');
+          return;
+        }
+        var videoSrc = res.tempFilePath;
+        self.setData({
+            'upload_busy':true,
+            'videoSrc':""
+        })
+        //上传图片到服务器
+        wx.uploadFile({
+          url: config.service.uploadUrl,
+          filePath: videoSrc,
+          name: 'file',
+          success: function(res) {
+            if(res.statusCode==200){
+              var data=JSON.parse(res.data);
+              console.log(data);
+              if(data.success==true){
+                self.setData({
+                    'videoSrc':data.file.url,
+                    'videoContext':wx.createVideoContext('myVideo')
+                })
+                showSuccess('上传成功');
+              }else{
+                showMsg('提示信息','上传失败');
+              }
+            }else if(res.statusCode==413){
+              showMsg('提示信息','上传失败,文件过大');
+            }else{
+              showMsg('提示信息','上传失败');
+            }
+          },
+          fail: function({errMsg}) {
+            console.log('uploadVideo fail, errMsg is', errMsg);
+            showMsg('提示信息','上传失败,'+errMsg);
+          },
+          complete:function(){
+            self.setData({
+                'upload_busy':false
+            })
+          }
+        })
+      },
+      fail: function({errMsg}) {
+        console.log('chooseVideo fail, err is', errMsg)
+      }
+    })
+  },
+  formSubmit: function(e) {
+    // console.log(e);
+    
+    var self = this;
+    if(self.data.upload_busy||self.data.busy1){
+      return;
+    }
+    if(self.data.videoSrc==""){
+      showMsg("提示信息","请先上传视频");
+      return;
+    }
+    var data={};
+    if(self.data.videoSrc!=""){
+      data.image_url=self.data.videoSrc;
+    }
+    if(e.detail.formId!='the formId is a mock one'){
+      data.form_id=e.detail.formId;
+    }
+    data.type=3
+    self.setData({
+        'busy1':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.channelMessageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 self.data.videoContext.pause();
+                wx.switchTab({
+                  url: '/pages/channel/index/index'
+                })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy1':false
+                  })
+                console.log('request complete');
+            }
+      });
+  }
+})

+ 1 - 0
pages/channel/video/add/add.json

@@ -0,0 +1 @@
+{}

+ 21 - 0
pages/channel/video/add/add.wxml

@@ -0,0 +1,21 @@
+<!--add.wxml-->
+<view class="page">
+<loading hidden="{{!upload_busy}}">上传中...</loading>
+  <view class="content">
+    <view class="upload_video">
+    <view style="display:inline-block;width:100%;height:100%;">
+      <video id="myVideo" src="{{videoSrc}}" controls="{{true}}" style="width:100%;height:100%;" hidden="{{!videoSrc}}"></video>
+    </view>
+    </view>
+    <view class="bottom">
+    <view class="txt">
+        <button bindtap="chooseVideo" type="primary" hover-class="none" style="background-color:transparent;border:1px solid #fff;padding-top:0;padding-bottom:0;">选择视频</button>
+      </view>
+      <view class="submit">
+      <form report-submit="{{true}}" bindsubmit="formSubmit">
+          <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy1 ? true : false}}" formType="submit">保存</button>
+          </form>
+      </view>
+    </view>
+  </view>
+</view>

+ 80 - 0
pages/channel/video/add/add.wxss

@@ -0,0 +1,80 @@
+.content{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+}
+.upload_video{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  background-repeat: no-repeat;
+  background-size: 100% auto;
+  background-position: center;
+  overflow-y:hidden;
+  padding-bottom:70px;
+  display:inline-block;
+  box-sizing:border-box;
+}
+.bottom{
+  position: absolute;
+  width: 100%;
+  bottom:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+.txt{
+  width: 120px;
+  /*height: 35px;*/
+  float: left;
+  margin-left:30px; 
+  margin-top: 17.5px;
+}
+.txt button{
+  display:block;
+  color:#fff;
+  width:120px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+.submit{
+  width: 120px;
+  /*height: 35px;*/
+  float: right;
+  margin-right:30px; 
+  margin-top: 17.5px;
+}
+.submit button{
+  display:block;
+  color:#fff;
+  width:120px;
+  /*height: 37px;*/
+  background-color: #50B7E3;
+  border:0px solid #50B7E3;
+  font-size: 14px;
+  border-radius:30px;
+  padding-top:1px;
+  padding-bottom:1px;
+}
+.textareas{
+  position: absolute;
+  width: 100%;
+  bottom:30%;
+  height: 200px;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+.textareas textarea{
+  margin-left: 5%;
+  width: 90%;
+  height:100%;
+  /*padding: 30px;*/
+  font-size:14px;
+  color: #fff;
+}

+ 210 - 0
pages/channel/view/view.js

@@ -0,0 +1,210 @@
+// pages/channel/view/view.js
+// 引入 QCloud 小程序增强 SDK
+var qcloud = require('../../../vendor/qcloud-weapp-client-sdk/index');
+
+// 引入配置
+var config = require('../../../config');
+
+// 显示繁忙提示
+var showBusy = text => wx.showToast({
+    title: text,
+    icon: 'loading',
+    duration: 10000
+});
+
+// 显示成功提示
+var showSuccess = text => {
+    wx.hideToast();
+    wx.showToast({
+        title: text,
+        icon: 'success'
+    });
+};
+
+// 显示失败提示
+var showModel = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: JSON.stringify(content),
+        showCancel: false
+    });
+};
+
+var showMsg = (title, content) => {
+    wx.hideToast();
+
+    wx.showModal({
+        title,
+        content: content,
+        showCancel: false
+    });
+};
+//获取应用实例
+var app = getApp()
+Page({
+  data: {
+      hash_key:"",
+      loading:false,
+      start:false,
+      text:"",
+      is_mine:false,
+      imageSrc:"",
+      nicker_name:"",
+      animationData: {},
+      num:5,
+      video_hidden:true,
+  },
+  Interval:function(){
+       var self=this;
+        this.data.intervarID= setInterval(function(){
+                self.animation.scale(2, 2).step()
+                self.animation.scale(1, 1).step()
+                self.setData({
+                    animationData: self.animation.export()
+                })
+                self.setData({
+                    num:self.data.num-1,
+                });
+                if(self.data.num == 0){
+                    clearInterval(self.data.intervarID);
+                    setTimeout(function(){
+                        wx.switchTab({
+                            url: '/pages/channel/index/index'
+                        })
+                    }, 1000);
+                }
+            },1000);
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    this.setData({
+        hash_key:e.hash_key
+    })
+    this.setData({
+        num:5,
+    });
+    var animation = wx.createAnimation({
+      duration: 100,
+        timingFunction: 'ease',
+    })
+    this.animation = animation
+    var self=this
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.apiUrl+'posts/'+self.data.hash_key,
+            success(result) {
+              console.log(result);
+              if(result.statusCode==200){
+                if(result.data.success==true){
+                  if(result.data.is_mine==true){
+                      self.setData({
+                              is_mine:true
+                      });
+                  }else{
+                      self.setData({
+                              is_mine:false
+                      });
+                  }
+                  self.setData({
+                          start:true,
+                          type:result.data.post.type,
+                          text:result.data.post.text,
+                          imageSrc:result.data.post.image_url,
+                          nicker_name:result.data.post.user.nickname
+                  });
+                  if(result.data.post.type==1&&result.data.is_mine==false){
+                      self.Interval();
+                  }else if(result.data.post.type==2){
+                    self.setData({
+                      loading:true
+                    });
+                  }
+                }else{
+                    wx.hideToast();
+                    wx.showModal({
+                        title:'提示信息',
+                        content: result.data.message,
+                        showCancel: false,
+                        success: function(res) {
+                            if (res.confirm) {
+                                wx.switchTab({
+                                  url: '/pages/channel/index/index'
+                                })
+                            }
+                        }
+                    });
+                }
+              }else{
+                 wx.switchTab({
+                    url: '/pages/channel/index/index'
+                 })
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                console.log('request complete');
+            }
+      });
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+  imageLoad: function(e){
+    console.log(e);
+    var self=this;
+    self.setData({
+            loading:false
+    });
+    if(self.data.is_mine==false){
+        self.Interval();
+    }
+  },
+  play:function(e){
+    console.log(e);
+  },
+  videoPlay:function(){
+    this.setData({
+        video_hidden:false
+    });
+    this.videoContext = wx.createVideoContext('myVideo');
+    var self=this;
+    setTimeout(function(){
+        self.videoContext.play();
+    }, 500);
+  },
+  timeUpdate: function(e){
+    console.log(e);
+    var self=this;
+    var num=Math.floor(e.detail.duration)-Math.floor(e.detail.currentTime);
+    if(num!==self.data.num){
+        self.animation.scale(2, 2).step()
+        self.animation.scale(1, 1).step()
+        self.setData({
+            animationData: self.animation.export()
+        })
+        self.setData({
+            num:num,
+        });
+    }
+    
+  },
+  ended:function(e){
+      var self=this;
+      if(self.data.is_mine==false){
+        setTimeout(function(){
+                wx.switchTab({
+                  url: '/pages/channel/index/index'
+                })
+        }, 1000);
+      }
+  }
+})

+ 1 - 0
pages/channel/view/view.json

@@ -0,0 +1 @@
+{}

+ 35 - 0
pages/channel/view/view.wxml

@@ -0,0 +1,35 @@
+<!--pages/channel/view/view.wxml-->
+<view class="page" wx:if="{{type==1||type==2}}">
+    <loading hidden="{{!loading}}">加载中...</loading>
+    <view class="content" wx:if="{{start}}">
+      <view class="upload_img" style="overflow-y:auto;">
+        <view  style="display:inline-block;width:100%;vertical-align: middle;">
+          <image src="{{imageSrc}}" class="image" mode="widthFix" bindload="imageLoad"></image>
+        </view>
+      </view>
+      <view class="bottom" wx:if="{{text}}">
+        <view>{{text}}</view>
+      </view>
+      <view class="top" wx-if="{{!is_mine}}">
+        <view class="right">
+          <view class="num" animation="{{animationData}}">{{num}}</view>
+          <view class="txt">销毁</view>
+        </view>
+      </view>
+    </view>
+</view>
+<view class="page" wx:if="{{type==3}}">
+<view class="content">
+    <view class="upload_video" >
+    <view style="display:inline-block;width:100%;height:100%;">
+    <view style="width:100%;height:{{height}}px;background-color:#000;padding-top:50%;box-sizing:border-box;" hidden="{{!video_hidden}}">
+      <view style="width:100%;display:inline-block;text-align:center;margin-top:1em;">
+          <image bindtap="videoPlay" src="/pages/images/main_play@2x.png" mode="widthFix" style="width:30%"></image>
+    </view>
+    <view style="width:100%;display:inline-block;text-align:center;color:#978b7d;margin-top:1em;">点击播放</view>
+    </view>
+    <video id="myVideo" src="{{imageSrc}}" controls="{{true}}"  style="width:100%;height:100%;" bindplay="play" bindended="ended" hidden="{{video_hidden}}"></video>
+    </view>
+    </view>
+</view>
+</view>

+ 108 - 0
pages/channel/view/view.wxss

@@ -0,0 +1,108 @@
+/* pages/channel/view/view.wxss */
+.page___title{
+    text-align: center;
+    font-size: 30rpx;
+  line-height: 26px;
+}
+.fixed{
+  width:100%;
+  display: inline-block;
+  position: fixed;
+  left: 0;
+  bottom:100px;
+}
+.fixed .num{
+  float:right;
+  margin-right:45px;
+  font-size:30px;
+  line-height: 30px;
+  color: red;
+}
+.image {
+  width: 100%;
+  height: 360rpx;
+}
+.content{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+}
+.upload_img{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  background-repeat: no-repeat;
+  background-size: 100% auto;
+  background-position: center;
+}
+.upload_img:before {
+  content: '';
+  display: inline-block;
+  height: 100%;
+  vertical-align: middle;
+}
+.bottom{
+  position: absolute;
+  width: 100%;
+  bottom:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+  padding: 0 30px;
+  padding-top: 10px;
+  box-sizing:border-box;
+}
+.bottom view{
+  font-size:14px;
+  color: #fff;
+  line-height: 25px;
+}
+.top{
+  position:absolute;
+  width:100%;
+  top:0;
+  height:50px;
+  padding-top:10px;
+  padding-bottom:10px;
+
+}
+.top .right{
+  width:32px;
+  height:50px;
+  float:right;
+  margin-right:30px;
+
+}
+.top .right .num{
+  width:30px;
+  height:30px;
+  background-color:transparent;
+  border:1px solid #fff;
+  border-radius:100px;
+  color:#fff;
+  text-align:center;
+  line-height:30px;
+
+}
+.top .right .txt{
+  color:#fff;
+  font-size:12px;
+  text-align:center;
+  margin-top:5px;
+}
+.upload_video{
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  background-repeat: no-repeat;
+  background-size: 100% auto;
+  background-position: center;
+  overflow-y:hidden;
+  padding-top:0px;
+  display:inline-block;
+  box-sizing:border-box;
+}

BIN
pages/images/default.png


+ 2 - 2
pages/person/image/add/add.wxml

@@ -16,12 +16,12 @@
     <view class="bottom">
       <view class="txt">
         <form report-submit="{{true}}" bindsubmit="formSubmit1">
-          <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy ? true : false}}" formType="submit">发到群里</button>
+          <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy1 ? true : false}}" formType="submit">发到群里</button>
         </form>
       </view>
       <view class="submit">
       <form report-submit="{{true}}" bindsubmit="formSubmit2">
-          <button type="primary" hover-class="none" loading="{{busy2 ? true : false}}" disabled="{{busy ? true : false}}" formType="submit">发给个人</button>
+          <button type="primary" hover-class="none" loading="{{busy2 ? true : false}}" disabled="{{busy2 ? true : false}}" formType="submit">发给个人</button>
       </form>
       </view>
     </view>

+ 5 - 5
pages/person/image/send/send.js

@@ -68,7 +68,7 @@ Page({
                 if(self.data.num == 0){
                     clearInterval(self.data.intervarID);
                     setTimeout(function(){
-                        wx.redirectTo({
+                        wx.switchTab({
                             url: '/pages/person/index/index'
                         })
                     }, 1000);
@@ -132,14 +132,14 @@ Page({
                                 showCancel: false,
                                 success: function(res) {
                                     if (res.confirm) {
-                                        wx.redirectTo({
+                                        wx.switchTab({
                                             url: '/pages/person/index/index'
                                         })
                                     }
                                 }
                             });
                         }else{
-                            wx.redirectTo({
+                            wx.switchTab({
                                 url: '/pages/person/index/index'
                             })
                         }
@@ -152,7 +152,7 @@ Page({
                         showCancel: false,
                         success: function(res) {
                             if (res.confirm) {
-                                wx.redirectTo({
+                                wx.switchTab({
                                     url: '/pages/person/index/index'
                                 })
                             }
@@ -160,7 +160,7 @@ Page({
                     });
                 }
               }else{
-                 wx.redirectTo({
+                 wx.switchTab({
                     url: '/pages/person/index/index'
                  })
               }

+ 3 - 3
pages/person/image/view/view.js

@@ -110,8 +110,8 @@ Page({
                     });
                   }
               }else{
-                wx.redirectTo({
-                    url: '/pages/index/index'
+                wx.switchTab({
+                    url: '/pages/person/index/index'
                 })
               }
             },
@@ -129,7 +129,7 @@ Page({
     console.log('onShow');
   },
   edit:function(){
-    wx.redirectTo({
+    wx.switchTab({
         url: '/pages/person/index/index'
     })
   },

+ 15 - 2
pages/person/index/index.js

@@ -117,8 +117,21 @@ Page({
   onShareAppMessage: function () {
     return {
       title: '密件',
-      desc: '密件',
-      path: 'pages/person/index/index'
+      path: 'pages/person/index/index',
+      success: function(res) {
+        console.log('1234');
+        showSuccess('分享123成功');
+        console.log(res);
+        // 分享成功
+      },
+      fail: function(res) {
+        // 分享失败
+        console.log('1234');
+        console.log(res);
+      },
+      complete:function(res){
+        console.log(res);
+      }
     }
   }
 })

+ 2 - 1
pages/person/video/add/add.js

@@ -152,7 +152,7 @@ Page({
               console.log(result);
               if(result.data.success==true){
                  showSuccess("成功");
-                 self.videoContext.pause();
+                 self.data.videoContext.pause();
                  wx.navigateTo({
                     url: '/pages/person/video/view/view?hash_key='+result.data.id
                  })
@@ -206,6 +206,7 @@ Page({
               console.log(result);
               if(result.data.success==true){
                  showSuccess("成功");
+                 self.data.videoContext.pause();
                  wx.navigateTo({
                     url: '/pages/person/video/view/view?hash_key='+result.data.id
                  })

+ 2 - 2
pages/person/video/add/add.wxml

@@ -10,12 +10,12 @@
     <view class="bottom">
       <view class="txt">
         <form report-submit="{{true}}" bindsubmit="formSubmit1">
-        <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy ? true : false}}" formType="submit">发到群里</button>
+        <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy1 ? true : false}}" formType="submit">发到群里</button>
         </form>
       </view>
       <view class="submit">
       <form report-submit="{{true}}" bindsubmit="formSubmit2">
-          <button type="primary" hover-class="none" loading="{{busy2 ? true : false}}" disabled="{{busy ? true : false}}" formType="submit">发给个人</button>
+          <button type="primary" hover-class="none" loading="{{busy2 ? true : false}}" disabled="{{busy2 ? true : false}}" formType="submit">发给个人</button>
           </form>
       </view>
     </view>

+ 6 - 6
pages/person/video/send/send.js

@@ -39,7 +39,7 @@ Page({
       text:"",
       is_mine:false,
       videoSrc:"",
-      "video_hidden":true,
+      video_hidden:true,
       nicker_name:"",
       animationData: {},
       num:""
@@ -103,14 +103,14 @@ Page({
                                 showCancel: false,
                                 success: function(res) {
                                     if (res.confirm) {
-                                        wx.redirectTo({
+                                        wx.switchTab({
                                             url: '/pages/person/index/index'
                                         })
                                     }
                                 }
                             });
                         }else{
-                            wx.redirectTo({
+                            wx.switchTab({
                                 url: '/pages/person/index/index'
                             })
                         }
@@ -123,7 +123,7 @@ Page({
                         showCancel: false,
                         success: function(res) {
                             if (res.confirm) {
-                                wx.redirectTo({
+                                wx.switchTab({
                                     url: '/pages/person/index/index'
                                 })
                             }
@@ -131,7 +131,7 @@ Page({
                     });
                 }
               }else{
-                 wx.redirectTo({
+                 wx.switchTab({
                     url: '/pages/person/index/index'
                  })
               }
@@ -190,7 +190,7 @@ Page({
       var self=this;
       if(self.data.is_mine==false){
         setTimeout(function(){
-                wx.redirectTo({
+                wx.switchTab({
                     url: '/pages/person/index/index'
                 })
         }, 1000);

+ 2 - 2
pages/person/video/view/view.js

@@ -113,7 +113,7 @@ Page({
                     });
                   }
               }else{
-                wx.redirectTo({
+                wx.switchTab({
                     url: '/pages/person/index/index'
                 })
               }
@@ -132,7 +132,7 @@ Page({
     console.log('onShow');
   },
   edit:function(){
-    wx.redirectTo({
+    wx.switchTab({
         url: '/pages/person/index/index'
     })
   },