浏览代码

no message

xiaxiaofeng 8 年之前
父节点
当前提交
10f4997ade
共有 56 个文件被更改,包括 2394 次插入593 次删除
  1. 2 2
      app.js
  2. 12 7
      app.json
  3. 3 3
      app.wxss
  4. 0 162
      pages/add/add.js
  5. 0 38
      pages/add/add.wxml
  6. 0 82
      pages/add/add.wxss
  7. 3 1
      pages/common/footer.wxml
  8. 二进制
      pages/images/geren.png
  9. 二进制
      pages/images/main_play@2x.png
  10. 二进制
      pages/images/qun.png
  11. 二进制
      pages/images/share_arrow.png
  12. 二进制
      pages/images/xinfeng.png
  13. 0 20
      pages/index/index.wxml
  14. 4 4
      pages/index/index.js
  15. 0 0
      pages/person/end/end.json
  16. 28 0
      pages/person/end/end.wxml
  17. 11 6
      pages/index/index.wxss
  18. 303 0
      pages/person/image/add/add.js
  19. 0 0
      pages/person/image/add/add.json
  20. 32 0
      pages/person/image/add/add.wxml
  21. 197 0
      pages/person/image/add/add.wxss
  22. 191 0
      pages/person/image/send/send.js
  23. 0 0
      pages/person/image/send/send.json
  24. 21 0
      pages/person/image/send/send.wxml
  25. 92 0
      pages/person/image/send/send.wxss
  26. 153 0
      pages/person/image/view/view.js
  27. 3 0
      pages/person/image/view/view.json
  28. 17 0
      pages/person/image/view/view.wxml
  29. 56 0
      pages/person/image/view/view.wxss
  30. 124 0
      pages/person/index/index.js
  31. 3 0
      pages/person/index/index.json
  32. 33 0
      pages/person/index/index.wxml
  33. 125 0
      pages/person/index/index.wxss
  34. 230 0
      pages/person/video/add/add.js
  35. 0 0
      pages/person/video/add/add.json
  36. 23 0
      pages/person/video/add/add.wxml
  37. 80 0
      pages/person/video/add/add.wxss
  38. 199 0
      pages/person/video/send/send.js
  39. 1 0
      pages/person/video/send/send.json
  40. 15 0
      pages/person/video/send/send.wxml
  41. 67 0
      pages/person/video/send/send.wxss
  42. 171 0
      pages/person/video/view/view.js
  43. 1 0
      pages/person/video/view/view.json
  44. 21 0
      pages/person/video/view/view.wxml
  45. 50 0
      pages/person/video/view/view.wxss
  46. 0 102
      pages/send/send.js
  47. 0 16
      pages/send/send.wxml
  48. 0 23
      pages/send/send.wxss
  49. 46 0
      pages/test/video.js
  50. 1 0
      pages/test/video.json
  51. 9 0
      pages/test/video.wxml
  52. 67 0
      pages/test/video.wxss
  53. 0 93
      pages/view/view.js
  54. 0 16
      pages/view/view.wxml
  55. 0 17
      pages/view/view.wxss
  56. 0 1
      vendor/qcloud-weapp-client-sdk/lib/request.js

+ 2 - 2
app.js

@@ -28,7 +28,7 @@ var showModel = (title, content) => {
 
     wx.showModal({
         title,
-        content: JSON.stringify(content),
+        content: content,
         showCancel: false
     });
 };
@@ -84,7 +84,7 @@ App({
                 },
 
                 fail(error) {
-                    showModel('登录失败', error);
+                    showModel('错误提示', '需要微信授权才能体验,稍后请重试');
                     console.log('登录失败', error);
                 }
             });

+ 12 - 7
app.json

@@ -1,14 +1,19 @@
 {
     "pages": [
-        "pages/index/index",
-        "pages/add/add",
-        "pages/view/view",
-        "pages/send/send"
+        "pages/person/index/index",
+        "pages/person/image/add/add",
+        "pages/person/image/view/view",
+        "pages/person/image/send/send",
+        "pages/person/video/add/add",
+        "pages/person/video/view/view",
+        "pages/person/video/send/send",
+        "pages/person/end/end",
+        "pages/test/video"
     ],
     "window": {
-        "navigationBarTextStyle": "black",
+        "navigationBarTextStyle": "white",
         "navigationBarTitleText": "密件",
-        "navigationBarBackgroundColor": "#FBF9FE",
-        "backgroundColor": "#FBF9FE"
+        "navigationBarBackgroundColor": "#000",
+        "backgroundColor": "#000"
     }
 }

+ 3 - 3
app.wxss

@@ -9,7 +9,7 @@
   box-sizing: border-box;
 } 
 page {
-  background-color: #fbf9fe;
+  background-color: #000;
   height: 100%;
 }
 .container {
@@ -197,13 +197,13 @@ checkbox, radio{
 .page {
     min-height: 100%;
     flex: 1;
-    background-color: #FBF9FE;
+    background-color: #000;
     font-size: 32rpx;
     font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
     overflow: hidden;
 }
 .page__hd{
-    padding:200rpx 50rpx 200rpx 50rpx;
+    padding:100rpx 50rpx 100rpx 50rpx;
     text-align: center;
 }
 .page__title{

+ 0 - 162
pages/add/add.js

@@ -1,162 +0,0 @@
-// 引入 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":'',
-  "busy":false,
-  "upload_busy":false
-  },
-  onLoad: function () {
-    console.log('onLoad');
-  },
-  onShow: function () {
-    console.log('onShow');
-  },
-  chooseImage: function() {
-    var self = this;
-    if(self.data.upload_busy){
-      return;
-    }
-    wx.chooseImage({
-      count: 1,
-      sizeType: ['compressed'],
-      sourceType: ['album'],
-      success: function(res) {
-        console.log('chooseImage success, temp path is', res.tempFilePaths[0])
-        var imageSrc = res.tempFilePaths[0];
-        self.setData({
-            'upload_busy':true
-        })
-        //上传图片到服务器
-        wx.uploadFile({
-          url: config.service.uploadUrl,
-          filePath: imageSrc,
-          name: 'file',
-          success: function(res) {
-            console.log('uploadImage success, res is:', res);
-            var data=JSON.parse(res.data);
-            console.log(data);
-            if(data.success==true){
-              self.setData({
-                  'imageSrc':data.file.url
-              })
-              showSuccess('上传成功');
-            }else{
-              showMsg('提示信息','上传失败');
-            }
-          },
-          fail: function({errMsg}) {
-            console.log('uploadImage fail, errMsg is', errMsg)
-          },
-          complete:function(){
-            self.setData({
-                'upload_busy':false
-            })
-          }
-        })
-
-      },
-      fail: function({errMsg}) {
-        console.log('chooseImage fail, err is', errMsg)
-      }
-    })
-  },
-  formSubmit: function(e) {
-    var self = this;
-    if(self.data.upload_busy||self.data.busy){
-      return;
-    }
-    if(e.detail.value.text==""&&self.data.imageSrc==""){
-      showMsg("提示信息","内容和图片至少有一个不能为空");
-      return;
-    }
-    var data={};
-    if(e.detail.value.text!=""){
-      data.text=e.detail.value.text;
-    }
-    if(self.data.imageSrc!=""){
-      data.image_url=self.data.imageSrc;
-    }
-    console.log('form发生了submit事件,携带数据为:', e.detail.value);
-    self.setData({
-        'busy':true
-    })
-    qcloud.request({
-            // 要请求的地址
-            url: config.service.messageAddUrl,
-            method:"POST",
-            data: data,
-            success(result) {
-              console.log(result);
-              if(result.data.success==true){
-                 showSuccess("成功");
-                 wx.navigateTo({
-                    url: '/pages/view/view?hash_key='+result.data.id
-                 })
-              }else{
-                showMsg("提示信息","新建消息失败");
-              }
-            },
-
-            fail(error) {
-                console.log('request fail', error);
-                showMsg("提示信息","新建消息失败");
-            },
-
-            complete() {
-                self.setData({
-                      'busy':false
-                  })
-                console.log('request complete');
-            }
-      });
-  },
-  onShareAppMessage: function () {
-    return {
-      title: '密件',
-      desc: '密件',
-      path: 'pages/index/index'
-    }
-  }
-})

+ 0 - 38
pages/add/add.wxml

@@ -1,38 +0,0 @@
-
-<!--add.wxml-->
-<import src="../common/footer.wxml" />
-<form bindsubmit="formSubmit">
-  <view class="page">
-    <template is="head" />
-    <view class="page-body">
-      <view class="page-section">
-        <view class="page-body-info">
-          <block wx:if="{{imageSrc}}">
-            <view bindtap="chooseImage" style="display:inline-block;width:100%;">
-              <image src="{{imageSrc}}" class="image" mode="aspectFit"></image>
-            </view>
-          </block>
-          <block wx:else>
-            <view class="image-plus image-plus-nb" bindtap="chooseImage">
-              <view class="image-plus-horizontal"></view>
-              <view class="image-plus-vertical"></view>
-            </view>
-            <view class="image-plus-text">选择图片</view>
-          </block>
-        </view>
-      </view>
-      <view class="page-section">
-        <view class="page-section-title">内容</view>
-        <view class="textarea-wrp">
-          <textarea name="text" auto-height placeholder="请输入内容" />
-        </view>
-      </view>
-      <view class="page-section">
-        <view class="button-wrapper">
-          <button type="primary" loading="{{busy ? true : false}}" disabled="{{busy ? true : false}}" formType="submit">提交</button>
-        </view>
-      </view>
-    </view>
-    <template is="foot" />
-  </view>
-</form>

+ 0 - 82
pages/add/add.wxss

@@ -1,82 +0,0 @@
-.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;
-}

+ 3 - 1
pages/common/footer.wxml

@@ -2,6 +2,8 @@
   <view class="page__hd">
     <view class="bottom_title">北京斑羚在线网络科技有限公司 </view>
     <view class="bottom_title" data-mobile="010-85795663" bindtap="call"> 010-85795663</view>
-    
+     <!--<view class="bottom_title">
+      <contact-button type="default-light" size="20" session-from="weapp"></contact-button>
+     </view>-->
   </view>
 </template>

二进制
pages/images/geren.png


二进制
pages/images/main_play@2x.png


二进制
pages/images/qun.png


二进制
pages/images/share_arrow.png


二进制
pages/images/xinfeng.png


+ 0 - 20
pages/index/index.wxml

@@ -1,20 +0,0 @@
-
-<!--index.wxml-->
-<import src="../common/header.wxml" />
-<import src="../common/footer.wxml" />
-<view class="page">
-  <template is="head" />
-  <view class="page__bd">
-    <view class="section">
-        <view class="button-wrapper">
-            <navigator class="button" url="/pages/add/add">写密件</navigator>
-        </view>
-    </view>
-    <view class="section">
-        <view class="article">
-            <text>密件是一个在微信中使用的小程序,你可以把需要保密发送图片文字的内容通过密件发送。对方只有5秒钟观看的时间,观看之后就会被销毁,不能再转发给他人。</text>
-        </view>
-    </view>
-  </view>
-  <template is="foot" />
-</view>

+ 4 - 4
pages/index/index.js

@@ -1,9 +1,9 @@
-//index.js
+//end.js
 // 引入 QCloud 小程序增强 SDK
-var qcloud = require('../../vendor/qcloud-weapp-client-sdk/index');
+var qcloud = require('../../../vendor/qcloud-weapp-client-sdk/index');
 
 // 引入配置
-var config = require('../../config');
+var config = require('../../../config');
 
 // 显示繁忙提示
 var showBusy = text => wx.showToast({
@@ -49,7 +49,7 @@ Page({
     return {
       title: '密件',
       desc: '密件',
-      path: 'pages/index/index'
+      path: 'pages/person/index/index'
     }
   }
 })

pages/index/index.json → pages/person/end/end.json


+ 28 - 0
pages/person/end/end.wxml

@@ -0,0 +1,28 @@
+
+<!--index.wxml-->
+<import src="../../common/header.wxml" />
+<import src="../../common/footer.wxml" />
+<view class="page">
+  <template is="head" />
+  <view class="page__bd">
+    <view class="section">
+        <view class="article" style="padding-top:0px;text-align:center;">
+            <text>你来晚了,本密件已经被销毁</text>
+        </view>
+    </view>
+    <view class="section" style="display:inline-block;width:100%;margin-bottom:0;">
+        <view class="button-wrapper" style="margin-left:40px;float:left;width:38%;">
+            <navigator class="button" url="/pages/person/image/add/add" >制作图片密件</navigator>
+        </view>
+         <view class="button-wrapper" style="margin-right:40px;float:right;width:38%;">
+            <navigator class="button" url="/pages/person/video/add/add">制作视频密件</navigator>
+        </view>
+    </view>
+    <view class="section">
+        <view class="article">
+            <text>密件是一个在微信中使用的小程序,你可以吧需要保密发送的内容通过密件发给你的朋友们。观看之后就会被销毁。不能在转发给他人。</text>
+        </view>
+    </view>
+  </view>
+  <template is="foot" />
+</view>

+ 11 - 6
pages/index/index.wxss

@@ -74,7 +74,10 @@ switch{
     font-size:14px;
 }
 .button-wrapper{
-    margin: 1.17647059em 15px 0.3em;
+    margin:0;
+    /*margin-bottom:1.8em;*/
+    /*width:150px;*/
+    float:left;
 }
 .button {
 position:relative;
@@ -84,16 +87,17 @@ margin-right:auto;
 padding-left:14px;
 padding-right:14px;
 box-sizing:border-box;
-font-size:18px;
+/*font-size:18px;*/
 text-align:center;
 text-decoration:none;
 line-height:2.55555556;
-border-radius:5px;
+border-radius:30px;
 -webkit-tap-highlight-color:transparent;
 overflow:hidden;
-color:#000000;
-width:200px;
-border:1px solid #AAAAAA;
+color:#fff;
+/*width:200px;*/
+background-color: #50B7E3;
+border:0px solid #AAAAAA;
 }
 .section {
 margin-bottom:10rpx;
@@ -105,4 +109,5 @@ margin-bottom:10rpx;
 .article text{
     line-height: 25px;
     font-size:16px;
+    color: #fff;
 }

+ 303 - 0
pages/person/image/add/add.js

@@ -0,0 +1,303 @@
+// 引入 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,
+  "busy2":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);
+  },
+  formSubmit1: function(e) {
+    // console.log(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;
+    }
+    data.type=2
+    data.is_qun=1
+    self.setData({
+        'busy1':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.messageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 wx.navigateTo({
+                    url: '/pages/person/image/view/view?hash_key='+result.data.id
+                 })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy1':false
+                  })
+                console.log('request complete');
+            }
+      });
+  },
+  formSubmit2: function(e) {
+    // console.log(e);
+    
+    var self = this;
+    if(self.data.upload_busy||self.data.busy2){
+      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;
+    }
+    data.type=2
+    data.is_qun=0
+    self.setData({
+        'busy2':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.messageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 wx.navigateTo({
+                    url: '/pages/person/image/view/view?hash_key='+result.data.id
+                 })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy2':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
+    }
+  }
+})

pages/add/add.json → pages/person/image/add/add.json


+ 32 - 0
pages/person/image/add/add.wxml

@@ -0,0 +1,32 @@
+
+<!--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="top">
+      <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>
+    <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>
+        </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>
+      </form>
+      </view>
+    </view>
+    <view class="textareas" hidden="{{!textarea}}">
+      <textarea bindinput="bindTextAreaInput" bindconfirm="bindTextAreaConfirm"   placeholder="请输入文字" />
+    </view>
+  </view>
+</view>

+ 197 - 0
pages/person/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;
+}

+ 191 - 0
pages/person/image/send/send.js

@@ -0,0 +1,191 @@
+// 引入 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
+  },
+  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.redirectTo({
+                            url: '/pages/person/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+'messages/'+self.data.hash_key,
+            success(result) {
+              console.log(result);
+              if(result.statusCode==200){
+                if(result.data.success==true){
+                    if(result.data.message_data.dead==0){
+                        if(result.data.is_mine==true){
+                            self.setData({
+                                    is_mine:true
+                            });
+                        }else{
+                            self.setData({
+                                    is_mine:false
+                            });
+                        }
+                        self.setData({
+                                start:true,
+                                text:result.data.message_data.text,
+                                imageSrc:result.data.message_data.image_url,
+                                nicker_name:result.data.message_data.user.nickname
+                        });
+                        if(result.data.message_data.type==2){
+                            self.setData({
+                                    loading:true
+                            });
+                        }
+                        if(result.data.message_data.image_url==""&&result.data.is_mine==false){
+                            self.Interval();
+                        }
+                    }else{
+                        if(result.data.message_data.is_qun==1){
+                            wx.hideToast();
+                            wx.showModal({
+                                title:'提示信息',
+                                content: '你来晚了,本密件已经被销毁',
+                                showCancel: false,
+                                success: function(res) {
+                                    if (res.confirm) {
+                                        wx.redirectTo({
+                                            url: '/pages/person/index/index'
+                                        })
+                                    }
+                                }
+                            });
+                        }else{
+                            wx.redirectTo({
+                                url: '/pages/person/index/index'
+                            })
+                        }
+                    }
+                }else{
+                    wx.hideToast();
+                    wx.showModal({
+                        title:'提示信息',
+                        content: result.data.message,
+                        showCancel: false,
+                        success: function(res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/person/index/index'
+                                })
+                            }
+                        }
+                    });
+                }
+              }else{
+                 wx.redirectTo({
+                    url: '/pages/person/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();
+    }
+  }
+})

pages/send/send.json → pages/person/image/send/send.json


+ 21 - 0
pages/person/image/send/send.wxml

@@ -0,0 +1,21 @@
+<form bindsubmit="formSubmit">
+<view class="page">
+    <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>
+</form>

+ 92 - 0
pages/person/image/send/send.wxss

@@ -0,0 +1,92 @@
+.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;
+}
+.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;
+}

+ 153 - 0
pages/person/image/view/view.js

@@ -0,0 +1,153 @@
+// 引入 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
+    });
+};
+
+function   formatDate(now)   {     
+    var   year=now.getFullYear();     
+    var   month=now.getMonth()+1;  
+    if(month<10){
+        month='0'+month.toString();
+    }   
+    var   date=now.getDate();
+    if(date<10){
+        date='0'+date.toString();
+    }    
+    var   hour=now.getHours(); 
+    if(hour<10){
+        hour='0'+hour.toString();
+    }        
+    var   minute=now.getMinutes();
+    if(minute<10){
+        minute='0'+minute.toString();
+    }      
+    var   second=now.getSeconds();     
+    return   month+"-"+date+" "+hour+":"+minute;     
+}
+
+
+//获取应用实例
+var app = getApp()
+Page({
+  data: {
+    "hash_key":"",
+    "imageSrc":"",
+    "height":"",
+    "share_txt":"",
+    "share":false,
+    "is_qun":false,
+    "expire_time":"",
+    "text":""
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    this.setData({
+        hash_key:e.hash_key
+    })
+    var self=this
+    try {
+        var res = wx.getSystemInfoSync();
+        self.setData({
+            height:(res.windowWidth)*0.8
+        });
+    } catch (e) {
+    // Do something when catch error
+    }
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.apiUrl+'messages/'+self.data.hash_key,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                  self.setData({
+                    text:result.data.message_data.text,
+                    imageSrc:result.data.message_data.image_url
+                  });
+                  if(result.data.message_data.is_qun==0){
+                    self.setData({
+                        is_qun:false,
+                        expire_time:"",
+                        share_txt:'密件已经准备好了,你可以将本页发给你的朋友了,对方观看一次后立即销毁',
+                    });
+                  }else{
+                    var expire=result.data.message_data.expire_time;
+                    var d=new Date(expire*1000);
+                    self.setData({
+                        is_qun:true,
+                        expire_time:formatDate(d),
+                        share_txt:'密件已经准备好了,你可以将本页发到群中了。6小时后本密件自动销毁',
+                    });
+                  }
+              }else{
+                wx.redirectTo({
+                    url: '/pages/index/index'
+                })
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                console.log('request complete');
+            }
+      });
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+  edit:function(){
+    wx.redirectTo({
+        url: '/pages/person/index/index'
+    })
+  },
+  share:function(){
+    this.setData({
+        share:true
+    })
+    var self=this
+    setTimeout(function(){
+        self.setData({
+            share:false
+        })
+    }, 500);
+  },
+  onShareAppMessage: function () {
+    return {
+      title: '密件-只有我们知道',
+      path: 'pages/person/image/send/send?hash_key='+this.data.hash_key
+    }
+  }
+})

+ 3 - 0
pages/person/image/view/view.json

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

+ 17 - 0
pages/person/image/view/view.wxml

@@ -0,0 +1,17 @@
+<view class="page" style="background-color:#fff;">
+  <view class="page__hd page_head"  style="padding:0; height:{{height}}px;">
+    <view style="width:100%;display:inline-block;text-align:center;color:#4d3a34;font-size:1.5em;margin-top:8%;"  wx:if="{{expire_time}}">快看!本密件将于{{expire_time}}销毁</view>
+  </view>
+  <view class="page__bd" style="padding:50px;padding-left:0px;padding-right:0px;padding-bottom:0px">
+    <view class="page___title" style="margin-bottom:20px;padding:0 30px;text-align:left;color:#000">{{share_txt}}</view>
+  </view>
+  <view class="page__bd" style="padding:10px 50px 20px 50px;text-align:center;color:#fff;">
+    <button class="mini-btn" type="primary" bindtap="share" size="mini" hover-class="none" style="width:120px;clear:both;float:none;display:block;font-size:14px;padding-top:1px;padding-bottom:1px;" >发送</button>
+    <button class="mini-btn" type="primary" size="mini" hover-class="none" bindtap="edit" style="margin-top:20px;background-color:#ccc;width:120px;clear:both;float:none;display:block;font-size:14px;padding-top:1pxpadding-bottom:1px;">再写一封</button>
+  </view>
+  <view class="share" hidden="{{!share}}">
+    <view style="position: absolute;display:inline-block;top:5%;right:20%;color:#fff;" wx:if="{{is_qun}}">点击右上角,发到群中吧</view>
+    <view style="position: absolute;display:inline-block;top:5%;right:20%;color:#fff;" wx:if="{{!is_qun}}">点击右上角,发给你的朋友吧</view>
+  </view>
+
+</view>

文件差异内容过多而无法显示
+ 56 - 0
pages/person/image/view/view.wxss


+ 124 - 0
pages/person/index/index.js

@@ -0,0 +1,124 @@
+//index.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 app = getApp()
+Page({
+  data: {
+    "item":[],
+    "hidden":true,
+    "active":false
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+    this.setData({
+        track_id:e.track_id
+    })
+    wx.setStorageSync('track_id', e.track_id);
+    var self=this;
+    qcloud.request({
+        // 要请求的地址
+        url: 'https://81391412.qbanling.com/api/announcements',
+        success(result) {
+          console.log(result);
+          if(result.data.success==true){
+            self.setData({
+                item:result.data.data,
+                active:true
+            });
+          }else{
+            self.setData({
+                active:false
+            });
+          }
+        },
+
+        fail(error) {
+            console.log('request fail', error);
+        },
+
+        complete() {
+            console.log('request complete');
+        }
+      });
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+      if(self.data.track_id){
+        var data={};
+        data.track_id=self.data.track_id;
+        data.openid=userInfo.openId;
+        qcloud.request({
+          // 要请求的地址
+          url: 'https://81391412.qbanling.com/api/track_logs',
+          method:"POST",
+          data: data,
+          success(result) {
+            console.log(result);
+          },
+          fail(error) {
+              console.log('request fail', error);
+          },
+
+          complete() {
+              console.log('request complete');
+          }
+        });
+      }
+    });
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+  show:function(){
+    var self=this;
+    wx.previewImage({
+      current: self.data.item[0], // 当前显示图片的http链接
+      urls: [self.data.item[0]] // 需要预览的图片http链接列表
+    })
+    // this.setData({
+    //     hidden:false
+    // });
+  },
+  hidden:function(){
+  this.setData({
+        hidden:true
+    });
+  },
+  onShareAppMessage: function () {
+    return {
+      title: '密件',
+      desc: '密件',
+      path: 'pages/person/index/index'
+    }
+  }
+})

+ 3 - 0
pages/person/index/index.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "首页"
+}

+ 33 - 0
pages/person/index/index.wxml

@@ -0,0 +1,33 @@
+
+<!--index.wxml-->
+<import src="../../common/header.wxml" />
+<import src="../../common/footer.wxml" />
+<view class="page">
+  <template is="head" />
+  <view class="page__bd">
+    <view class="section" style="display:inline-block;width:100%;margin-bottom:20px;" wx:if="{{active}}">
+    <view class="button-wrapper" style="margin-left:40px;float:none;width:38%;margin:0 auto;">
+            <view class="button" bindtap="show" style="background-color:#000;color:#50B7E3;">有奖活动</view>
+        </view>
+    </view>
+    <view class="section" style="display:inline-block;width:100%;margin-bottom:0;">
+        <view class="button-wrapper" style="margin-left:40px;float:left;width:38%;">
+            <navigator class="button" url="/pages/person/image/add/add" >制作图片密件</navigator>
+        </view>
+         <view class="button-wrapper" style="margin-right:40px;float:right;width:38%;">
+            <navigator class="button" url="/pages/person/video/add/add">制作视频密件</navigator>
+        </view>
+    </view>
+    <view class="section">
+        <view class="article">
+            <text>密件是一个在微信中使用的小程序,你可以把需要保密发送的内容通过密件发给你的朋友们。观看之后就会被销毁。不能再转发给他人。</text>
+        </view>
+    </view>
+  </view>
+  <template is="foot" />
+  <view class="active" hidden="{{hidden}}">
+    <view  style="display:inline-block;width:100%;vertical-align: middle;">
+        <image src="{{item[0]}}" style="width:100%;" mode="widthFix" bindtap="hidden" ></image>
+    </view>
+  </view>
+</view>

+ 125 - 0
pages/person/index/index.wxss

@@ -0,0 +1,125 @@
+/**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; 
+}

+ 230 - 0
pages/person/video/add/add.js

@@ -0,0 +1,230 @@
+// 引入 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,
+  "busy2":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)
+      }
+    })
+  },
+  formSubmit1: 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
+    data.is_qun=1
+    self.setData({
+        'busy1':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.messageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 self.videoContext.pause();
+                 wx.navigateTo({
+                    url: '/pages/person/video/view/view?hash_key='+result.data.id
+                 })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy1':false
+                  })
+                console.log('request complete');
+            }
+      });
+  },
+  formSubmit2: function(e) {
+    // console.log(e);
+    
+    var self = this;
+    if(self.data.upload_busy||self.data.busy2){
+      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
+    data.is_qun=0
+    self.setData({
+        'busy2':true
+    })
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.messageAddUrl,
+            method:"POST",
+            data: data,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                 showSuccess("成功");
+                 wx.navigateTo({
+                    url: '/pages/person/video/view/view?hash_key='+result.data.id
+                 })
+              }else{
+                showMsg("提示信息","新建消息失败,"+result.data.message);
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+                showMsg("提示信息","新建消息失败");
+            },
+
+            complete() {
+                self.setData({
+                      'busy2':false
+                  })
+                console.log('request complete');
+            }
+      });
+  }
+})

pages/view/view.json → pages/person/video/add/add.json


+ 23 - 0
pages/person/video/add/add.wxml

@@ -0,0 +1,23 @@
+<!--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">
+        <form report-submit="{{true}}" bindsubmit="formSubmit1">
+        <button type="primary" hover-class="none" loading="{{busy1 ? true : false}}" disabled="{{busy ? 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>
+          </form>
+      </view>
+    </view>
+  </view>
+</view>

+ 80 - 0
pages/person/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;
+}

+ 199 - 0
pages/person/video/send/send.js

@@ -0,0 +1,199 @@
+// 引入 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 app = getApp()
+Page({
+  data: {
+      hash_key:"",
+      start:false,
+      text:"",
+      is_mine:false,
+      videoSrc:"",
+      "video_hidden":true,
+      nicker_name:"",
+      animationData: {},
+      num:""
+  },
+  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.redirectTo({
+                            url: '/pages/index/index'
+                        })
+                    }, 1000);
+                }
+            },1000);
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+    this.setData({
+        hash_key:e.hash_key
+    })
+    app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    var self=this;
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.apiUrl+'messages/'+self.data.hash_key,
+            success(result) {
+              console.log(result);
+              if(result.statusCode==200){
+                if(result.data.success==true){
+                    if(result.data.message_data.dead==0){
+                        if(result.data.is_mine==true){
+                            self.setData({
+                                    is_mine:true
+                            });
+                        }else{
+                            self.setData({
+                                    is_mine:false
+                            });
+                        }
+                        self.setData({
+                                start:true,
+                                videoSrc:result.data.message_data.image_url                             });
+                    }else{
+                        if(result.data.message_data.is_qun==1){
+                            wx.hideToast();
+                            wx.showModal({
+                                title:'提示信息',
+                                content: '你来晚了,本密件已经被销毁',
+                                showCancel: false,
+                                success: function(res) {
+                                    if (res.confirm) {
+                                        wx.redirectTo({
+                                            url: '/pages/person/index/index'
+                                        })
+                                    }
+                                }
+                            });
+                        }else{
+                            wx.redirectTo({
+                                url: '/pages/person/index/index'
+                            })
+                        }
+                    }
+                }else{
+                    wx.hideToast();
+                    wx.showModal({
+                        title:'提示信息',
+                        content: result.data.message,
+                        showCancel: false,
+                        success: function(res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/person/index/index'
+                                })
+                            }
+                        }
+                    });
+                }
+              }else{
+                 wx.redirectTo({
+                    url: '/pages/person/index/index'
+                 })
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                console.log('request complete');
+            }
+      });
+  },
+  onShow: function () {
+    console.log('onShow');
+    var animation = wx.createAnimation({
+      duration: 100,
+        timingFunction: 'ease',
+    })
+    this.animation = animation
+    var self=this;
+    
+    
+  },
+  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.redirectTo({
+                    url: '/pages/person/index/index'
+                })
+        }, 1000);
+      }
+  }
+})

+ 1 - 0
pages/person/video/send/send.json

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

+ 15 - 0
pages/person/video/send/send.wxml

@@ -0,0 +1,15 @@
+<view class="page">
+<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="{{videoSrc}}" controls="{{true}}"  style="width:100%;height:100%;" bindtimeupdate="timeUpdate" bindplay="play" bindended="ended" hidden="{{video_hidden}}"></video>
+    </view>
+    </view>
+</view>
+</view>

+ 67 - 0
pages/person/video/send/send.wxss

@@ -0,0 +1,67 @@
+.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-top:0px;
+  display:inline-block;
+  box-sizing:border-box;
+}
+.bottom{
+  position: absolute;
+  width: 100%;
+  bottom:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+  padding: 0 30px;
+  padding-top: 10px;
+}
+.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;
+}

+ 171 - 0
pages/person/video/view/view.js

@@ -0,0 +1,171 @@
+// 引入 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
+    });
+};
+
+function   formatDate(now)   {     
+    var   year=now.getFullYear();     
+    var   month=now.getMonth()+1;  
+    if(month<10){
+        month='0'+month.toString();
+    }   
+    var   date=now.getDate();
+    if(date<10){
+        date='0'+date.toString();
+    }    
+    var   hour=now.getHours(); 
+    if(hour<10){
+        hour='0'+hour.toString();
+    }        
+    var   minute=now.getMinutes();
+    if(minute<10){
+        minute='0'+minute.toString();
+    }      
+    var   second=now.getSeconds();     
+    return   month+"-"+date+" "+hour+":"+minute;     
+}
+//获取应用实例
+var app = getApp()
+Page({
+  data: {
+    "hash_key":"",
+    "videoSrc":"",
+    "height":"",
+    "is_qun":false,
+    "share":false,
+    "video_hidden":true,
+    "share_txt":"",
+    "expire_time":"",
+    "text":""
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+     app.getUserInfo(function(userInfo){
+      console.log(userInfo);
+    });
+    this.setData({
+        hash_key:e.hash_key
+    })
+    var self=this
+    try {
+        var res = wx.getSystemInfoSync();
+        self.setData({
+            height:(res.windowWidth)*0.8
+        });
+    } catch (e) {
+    // Do something when catch error
+    }
+    qcloud.request({
+            // 要请求的地址
+            url: config.service.apiUrl+'messages/'+self.data.hash_key,
+            success(result) {
+              console.log(result);
+              if(result.data.success==true){
+                  if(result.data.message_data.type!==3){
+                      wx.redirectTo({
+                            url: '/pages/perosn/image/view/view?hash_key='+self.data.hash_key
+                      })
+                  }
+                  self.setData({
+                    videoSrc:result.data.message_data.image_url
+                  });
+                  if(result.data.message_data.is_qun==0){
+                    self.setData({
+                        is_qun:false,
+                        expire_time:"",
+                        share_txt:'密件已经准备好了,你可以将本页发给你的朋友了,对方观看一次后立即销毁',
+                    });
+                  }else{
+                    var expire=result.data.message_data.expire_time;
+                    var d=new Date(expire*1000);
+                    self.setData({
+                        is_qun:true,
+                        expire_time:formatDate(d),
+                        share_txt:'密件已经准备好了,你可以将本页发到群中了。6小时后本密件自动销毁',
+                    });
+                  }
+              }else{
+                wx.redirectTo({
+                    url: '/pages/person/index/index'
+                })
+              }
+            },
+
+            fail(error) {
+                console.log('request fail', error);
+            },
+
+            complete() {
+                console.log('request complete');
+            }
+      });
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+  edit:function(){
+    wx.redirectTo({
+        url: '/pages/person/index/index'
+    })
+  },
+  share:function(){
+    this.setData({
+        share:true
+    })
+    var self=this
+    setTimeout(function(){
+        self.setData({
+            share:false
+        })
+    }, 500);
+  },
+  play:function(){
+    this.setData({
+        video_hidden:false
+    });
+    this.videoContext = wx.createVideoContext('myVideo');
+    var self=this;
+    setTimeout(function(){
+        self.videoContext.play();
+    }, 500);
+  },
+  ended:function(e){
+    this.setData({
+        video_hidden:true
+    });
+  },
+  onShareAppMessage: function () {
+    return {
+      title: '密件-只有我们知道',
+      path: 'pages/person/video/send/send?hash_key='+this.data.hash_key
+    }
+  }
+})

+ 1 - 0
pages/person/video/view/view.json

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

+ 21 - 0
pages/person/video/view/view.wxml

@@ -0,0 +1,21 @@
+<view class="page">
+      <view style="width:100%;height:{{height}}px;background-color:#c0b6aa;padding-top:15%;box-sizing:border-box;" hidden="{{!video_hidden}}">
+        <view style="width:100%;display:inline-block;text-align:center;color:#4d3a34;font-size:1.5em;"  wx:if="{{expire_time}}">快看!本密件将于{{expire_time}}销毁</view>
+        <view style="width:100%;display:inline-block;text-align:center;margin-top:1em;">
+          <image bindtap="play" 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="{{videoSrc}}" controls="{{true}}" style="width:100%;height:{{height}}px;"  hidden="{{video_hidden}}" bindended="ended" ></video>
+     <view class="page__bd" style="padding:50px;padding-left:0px;padding-right:0px;padding-bottom:0px">
+      <view class="page___title" style="margin-bottom:20px;padding:0 30px;text-align:left;">{{share_txt}}</view>
+     </view>
+    <view class="page__bd" style="padding:10px 50px 20px 50px;text-align:center;color:#fff;">
+       <button class="mini-btn" bindtap="share" type="primary" size="mini" hover-class="none" style="width:120px;clear:both;float:none;display:block;font-size:14px;padding-top:1px;padding-bottom:1px;">发送</button>
+    <button class="mini-btn" type="primary" size="mini" hover-class="none" bindtap="edit" style="margin-top:20px;background-color:#ccc;width:120px;clear:both;float:none;display:block;font-size:14px;padding-top:1px;padding-bottom:1px;">再写一封</button>
+    </view>
+ <view class="share" hidden="{{!share}}">
+    <view style="position: absolute;display:inline-block;top:5%;right:20%;color:#fff;" wx:if="{{is_qun}}">点击右上角,发到群中吧</view>
+    <view style="position: absolute;display:inline-block;top:5%;right:20%;color:#fff;" wx:if="{{!is_qun}}">点击右上角,发给你的朋友吧</view>
+  </view>
+</view>

文件差异内容过多而无法显示
+ 50 - 0
pages/person/video/view/view.wxss


+ 0 - 102
pages/send/send.js

@@ -1,102 +0,0 @@
-// 引入 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 app = getApp()
-Page({
-  data: {
-      hash_key:"",
-      text:"",
-      imageSrc:"",
-      nicker_name:"",
-      num:5
-  },
-  Interval:function(){
-       var self=this;
-        this.data.intervarID= setInterval(function(){
-                self.setData({
-                    num:self.data.num-1,
-                });
-                if(self.data.num == 0){
-                    clearInterval(self.data.intervarID);
-                    setTimeout(function(){
-                        wx.redirectTo({
-                            url: '/pages/index/index'
-                        })
-                    }, 1000);
-                }
-            },1000);
-  },
-  onLoad: function (e) {
-    console.log('onLoad');
-    this.setData({
-        hash_key:e.hash_key
-    })
-  },
-  onShow: function () {
-    console.log('onShow');
-    var self=this
-    qcloud.request({
-            // 要请求的地址
-            url: config.service.apiUrl+'messages/'+self.data.hash_key,
-            success(result) {
-              console.log(result);
-              if(result.data.success==true){
-                  if(result.data.message_data.dead==0){
-                      self.setData({
-                            text:result.data.message_data.text,
-                            imageSrc:result.data.message_data.image_url,
-                            nicker_name:result.data.message_data.user.nickname
-                      });
-                      self.Interval();
-                  }else{
-                      wx.redirectTo({
-                            url: '/pages/index/index'
-                      })
-                  }
-              }else{
-                wx.redirectTo({
-                    url: '/pages/index/index'
-                })
-              }
-            },
-
-            fail(error) {
-                console.log('request fail', error);
-            },
-
-            complete() {
-                console.log('request complete');
-            }
-      });
-  }
-})

+ 0 - 16
pages/send/send.wxml

@@ -1,16 +0,0 @@
-<import src="../common/header.wxml" />
-<import src="../common/footer.wxml" />
-<form bindsubmit="formSubmit">
-<view class="page">
-  <template is="head" />
-    <view class="page__bd"  style="padding:50px;padding-left:15px;padding-right:15px;">
-      <view class="page___title" style="margin-bottom:20px;">{{nicker_name}}发来的密件5秒后自动销毁</view>
-      <image src="{{imageSrc}}" class="image" mode="widthFix" wx:if="{{imageSrc}}"></image>
-      <view style="width:100%;margin-top:20px;display:inline-block;line-height:25px;text-align:center" wx:if="{{text}}">{{text}}</view>
-    </view>
-    <view class="fixed">
-      <view class="num">{{num}}</view>
-    </view>
-  <template is="foot" />
-</view>
-</form>

+ 0 - 23
pages/send/send.wxss

@@ -1,23 +0,0 @@
-.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;
-}

+ 46 - 0
pages/test/video.js

@@ -0,0 +1,46 @@
+// 引入 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 app = getApp()
+Page({
+  data: {
+      
+  },
+  onLoad: function (e) {
+    console.log('onLoad');
+    
+  },
+  onShow: function () {
+    console.log('onShow');
+  },
+})

+ 1 - 0
pages/test/video.json

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

+ 9 - 0
pages/test/video.wxml

@@ -0,0 +1,9 @@
+<view class="page">
+<view class="content">
+    <view class="upload_video" >
+    <view style="display:inline-block;width:100%;height:100%;">
+    <video src="http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8" controls="{{true}}" autoplay="{{true}}" style="width:100%;height:100%;"  ></video>
+    </view>
+    </view>
+</view>
+</view>

+ 67 - 0
pages/test/video.wxss

@@ -0,0 +1,67 @@
+.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-top:0px;
+  display:inline-block;
+  box-sizing:border-box;
+}
+.bottom{
+  position: absolute;
+  width: 100%;
+  bottom:0;
+  height: 70px;
+  background-color: rgba(0, 0, 0, 0.5);
+  padding: 0 30px;
+  padding-top: 10px;
+}
+.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;
+}

+ 0 - 93
pages/view/view.js

@@ -1,93 +0,0 @@
-// 引入 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 app = getApp()
-Page({
-  data: {
-    "hash_key":"",
-    "imageSrc":"",
-    "text":""
-  },
-  onLoad: function (e) {
-    console.log('onLoad');
-    this.setData({
-        hash_key:e.hash_key
-    })
-  },
-  onShow: function () {
-    console.log('onShow');
-    var self=this
-    qcloud.request({
-            // 要请求的地址
-            url: config.service.apiUrl+'messages/'+self.data.hash_key,
-            success(result) {
-              console.log(result);
-              if(result.data.success==true){
-                  self.setData({
-                    text:result.data.message_data.text,
-                    imageSrc:result.data.message_data.image_url
-                  });
-              }else{
-                wx.redirectTo({
-                    url: '/pages/index/index'
-                })
-              }
-            },
-
-            fail(error) {
-                console.log('request fail', error);
-            },
-
-            complete() {
-                console.log('request complete');
-            }
-      });
-  },
-  edit:function(){
-    wx.redirectTo({
-        url: '/pages/add/add'
-    })
-  },
-  send:function(){
-    wx.redirectTo({
-      url: '/pages/send/send'
-    })
-  },
-  onShareAppMessage: function () {
-    return {
-      title: '密件',
-      desc: '密件',
-      path: 'pages/send/send?hash_key='+this.data.hash_key
-    }
-  }
-})

+ 0 - 16
pages/view/view.wxml

@@ -1,16 +0,0 @@
-<import src="../common/header.wxml" />
-<import src="../common/footer.wxml" />
-<form bindsubmit="formSubmit">
-<view class="page">
-  <template is="head" />
-    <view class="page__bd" style="padding:50px;padding-left:15px;padding-right:15px;">
-      <view class="page___title" style="margin-bottom:20px;">密件已经准备好了,你可以将本页发给你的朋友了</view>
-      <image src="{{imageSrc}}" class="image" mode="widthFix" wx:if="{{imageSrc}}"></image>
-      <view style="width:100%;margin-top:20px;display:inline-block;line-height:25px;text-align:center" wx:if="{{text}}">{{text}}</view>
-    </view>
-    <view class="page__bd" style="padding:10px 50px 0px 50px;text-align:center;">
-      <button class="mini-btn" type="primary" size="mini" bindtap="edit">修改</button>
-    </view>
-  <template is="foot" />
-</view>
-</form>

+ 0 - 17
pages/view/view.wxss

@@ -1,17 +0,0 @@
-.page___title{
-    text-align: center;
-    font-size: 30rpx;
-  line-height: 26px;
-}
-
-
-button[size="mini"] {
-    width:100px;
-    height:34px;
-line-height:34px;
-
-}
-.image {
-  width: 100%;
-  height: 360rpx;
-}

+ 0 - 1
vendor/qcloud-weapp-client-sdk/lib/request.js

@@ -88,7 +88,6 @@ function request(options) {
                     Session.clear();
                     var error, message;
                     if (data.error === constants.ERR_INVALID_SESSION||data.error === constants.ERR_CHECK_LOGIN_FAILED) {
-                        console.log('123');
                         // 如果是登录态无效,并且还没重试过,会尝试登录后刷新凭据重新请求
                         if (!hasRetried) {
                             hasRetried = true;