liyongli 2 anni fa
parent
commit
05e8934f9d
31 ha cambiato i file con 80 aggiunte e 863 eliminazioni
  1. 0 41
      cloudfunctions/server/controller/appConfig/index.js
  2. 0 2
      cloudfunctions/server/controller/index.js
  3. 4 4
      cloudfunctions/server/controller/media/index.js
  4. 0 4
      cloudfunctions/server/index.js
  5. 6 3
      miniprogram/app.js
  6. 0 2
      miniprogram/app.json
  7. 4 0
      miniprogram/config/idnex.js
  8. 0 103
      miniprogram/pages/detail/detail.js
  9. 0 3
      miniprogram/pages/detail/detail.json
  10. 0 9
      miniprogram/pages/detail/detail.wxml
  11. 0 8
      miniprogram/pages/detail/detail.wxss
  12. 0 6
      miniprogram/pages/detail/template/defaultDetail/index.wxml
  13. 0 4
      miniprogram/pages/detail/template/defaultDetail/index.wxss
  14. 0 5
      miniprogram/pages/detail/template/pdfDetail/index.wxml
  15. 0 5
      miniprogram/pages/detail/template/pdfDetail/index.wxss
  16. 0 4
      miniprogram/pages/detail/template/sysDetail/index.wxml
  17. 0 1
      miniprogram/pages/detail/template/sysDetail/index.wxss
  18. 3 5
      miniprogram/pages/home/index.js
  19. 0 72
      miniprogram/pages/marvellous/components/videoAn/index.js
  20. 0 4
      miniprogram/pages/marvellous/components/videoAn/index.json
  21. 0 27
      miniprogram/pages/marvellous/components/videoAn/index.wxml
  22. 0 107
      miniprogram/pages/marvellous/components/videoAn/index.wxss
  23. 0 301
      miniprogram/pages/marvellous/index.js
  24. 0 6
      miniprogram/pages/marvellous/index.json
  25. 0 33
      miniprogram/pages/marvellous/index.wxml
  26. 0 89
      miniprogram/pages/marvellous/index.wxss
  27. 14 5
      miniprogram/pages/videoDetail/index.js
  28. 3 4
      miniprogram/pages/videoDetail/index.wxml
  29. 26 2
      miniprogram/utils/httpFunc.js
  30. 1 1
      project.config.json
  31. 19 3
      project.private.config.json

+ 0 - 41
cloudfunctions/server/controller/appConfig/index.js

@@ -1,41 +0,0 @@
-const { formmat } = require("../../utils/http");
-function Home() {
-  const homeList = [
-    {
-      text: "何以中国",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/0.png",
-      type: 'toDetail'
-    },
-    {
-      text: "日程安排",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/1.png",
-      type: 'toDetail'
-    },
-    {
-      text: "图片集锦",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/3.png",
-      type: 'image'
-    },
-    {
-      text: "精彩视频",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/4.png",
-      type: 'video'
-    },
-    {
-      text: "媒体风采",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/5.png",
-      type: 'toDetail'
-    },
-    {
-      text: "蓝直播",
-      url: "https://cxzx.smcic.net/topic/Applets/shengshizhongguo/2.png",
-      type: 'video'
-    },
-  ];
-  return formmat(homeList, 0, "ok");
-}
-
-
-module.exports = {
-  Home
-}

+ 0 - 2
cloudfunctions/server/controller/index.js

@@ -1,7 +1,5 @@
-const appConfig = require("./appConfig/index");
 const media = require("./media/index");
 
 module.exports = {
-  ...appConfig,
   ...media
 }

+ 4 - 4
cloudfunctions/server/controller/media/index.js

@@ -1,6 +1,6 @@
 const { formmat } = require("../../utils/http");
 function MediaController(data) {
-  console.log('参数------------>',data)
+  console.log('参数------------>', data)
   let list = [
     {
       location: "西安",
@@ -23,7 +23,7 @@ function MediaController(data) {
       ]
     },
   ];
-  list = [
+  if (data.typeMedia === 'video') list = [
     {
       location: "西安",
       date: "2022-11-22",
@@ -49,7 +49,7 @@ function MediaController(data) {
 }
 
 function MediaControllerOnce(data) {
-  console.log('参数------------>',data)
+  console.log('参数------------>', data)
   let once = {
     location: "西安",
     date: "2022-11-22",
@@ -70,7 +70,7 @@ function MediaControllerOnce(data) {
       },
     ]
   };
-  once =  {
+  if (data.typeMedia === 'video') once = {
     location: "西安",
     date: "2022-11-22",
     icon: "",

+ 0 - 4
cloudfunctions/server/index.js

@@ -11,10 +11,6 @@ cloud.init({
 exports.main = async (event, context) => {
   console.log(event)
   switch (event.type) {
-    case "getHomeList": {
-      delete event.type;
-      return Home();
-    }
     case "getMediaController": {
       delete event.type;
       return MediaController(event);

+ 6 - 3
miniprogram/app.js

@@ -1,4 +1,5 @@
 //app.js
+const config = require("./config/idnex");
 App({
   onLaunch: function () {
     if (!wx.cloud) {
@@ -14,14 +15,16 @@ App({
       })
     }
 
-    this.globalData = {}
+    this.globalData = {
+      ...config
+    }
   }
 })
 
 
 /**
- * 何以中国 --》 图文稿件
- * 日程安排 --》 全部日程,扫码进入当天日程
+ * 何以中国 --》 图文稿件 3
+ * 日程安排 --》 全部日程,扫码进入当天日程 3
  * 图片集锦 --》 日期与地点分类 1
  * 精彩视频 --》 地点列表 -》 视频详情(上部视频,视频需要考虑横竖屏 下部相关视频列表 ) 2
  * 蓝直播   --》 参考精彩视频 2

+ 0 - 2
miniprogram/app.json

@@ -1,8 +1,6 @@
 {
   "pages": [
     "pages/home/index",
-    "pages/detail/detail",
-    "pages/marvellous/index",
     "pages/mediaController/index",
     "pages/videoDetail/index"
   ],

+ 4 - 0
miniprogram/config/idnex.js

@@ -0,0 +1,4 @@
+module.exports = {
+  client: wx.getSystemInfoSync(),
+  baseurl: "https://cxzx.smcic.net/topic"
+}

+ 0 - 103
miniprogram/pages/detail/detail.js

@@ -1,103 +0,0 @@
-// miniprogram/pages/detail/detail.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    detail: {}
-  },
-  nameText: "",
-  idText: "",
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: async function (options) {
-    console.log(options)
-    this.nameText = decodeURIComponent(options.title || "详情");
-    this.idText = options.id || "";
-    wx.setNavigationBarTitle({
-      title:  this.nameText
-    })
-    // const db = wx.cloud.database();
-    // const _ = db.command;
-    // let list = await db.collection('data_news').where({
-    //   _id: _.eq(options.id)
-    // }).get();
-    
-    // let D = list.data[0] || {};
-    // D.content = D.content.replace(/style=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/width=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/height=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/<img/g, "<img style='width: 100%'").replace(/<p/gi, '<p style="text-indent: 2em;min-height: 1em"')
-    // if (D.creat_time) D.creat_time = this.format(D.creat_time);
-    // _this.setData({
-    //   detail: D,
-    // })
-    wx.showShareMenu({
-      withShareTicket: true,
-    });
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-    return {
-      title: this.nameText,  // 分享名称
-      path: 'pages/detail/detail?title=' + this.nameText + '&id=' + this.data.id,  // 点击分享后的链接要来到的页面的路径已经对应需要的参数
-    }
-  },
-
-  format: function (res) {
-    if (!res) return "";
-    let num = (res || 0) - 0;
-    let T = new Date(num);
-    let year = T.getFullYear();
-    let month = T.getMonth() + 1;
-    let day = T.getDate();
-    let hour = T.getHours();
-    let min = T.getMinutes() + 1;
-    let sec = T.getSeconds();
-
-    return year + "-" + (month > 9 ? month : "0" + month) + "-" + day + " " + (hour > 9 ? hour : '0' + hour) + ":" + (min > 9 ? min : '0' + min) + ":" + (sec > 9 ? sec : '0' + sec);
-  },
-})

+ 0 - 3
miniprogram/pages/detail/detail.json

@@ -1,3 +0,0 @@
-{
-  "usingComponents": {}
-}

+ 0 - 9
miniprogram/pages/detail/detail.wxml

@@ -1,9 +0,0 @@
-<!--miniprogram/pages/detail/detail.wxml-->
-<import src="./template/sysDetail/index.wxml"></import>
-<import src="./template/pdfDetail/index.wxml"></import>
-<import src="./template/defaultDetail/index.wxml"></import>
-<view class="detail">
-  <template wx:if="{{detail.type === 0}}" is="sysDetail" data="{{...detail}}"></template>
-  <template wx:if="{{detail.type === 2}}" is="pdfDetail" data="{{...detail}}"></template>
-  <template wx:if="{{detail.type === 1}}" is="defaultDetail" data="{{...detail}}"></template>
-</view>

+ 0 - 8
miniprogram/pages/detail/detail.wxss

@@ -1,8 +0,0 @@
-/* miniprogram/pages/detail/detail.wxss */
-@import "./template/sysDetail/index.wxss";
-@import "./template/pdfDetail/index.wxss";
-@import "./template/defaultDetail/index.wxss";
-
-.detail{
-  width: 750rpx;
-}

+ 0 - 6
miniprogram/pages/detail/template/defaultDetail/index.wxml

@@ -1,6 +0,0 @@
-<!--miniprogram/pages/detail/template/pdfDetail/index.wxml-->
-<template name="defaultDetail">
-  <video custom-cache="{{false}}" class="video" wx:if="{{headUrl}}" src="{{headUrl}}"></video>
-  <view style="width:730rpx;margin: 10rpx auto;display:block" wx:if="{{creat_time}}"> 发表日期:{{creat_time}}</view>
-  <rich-text wx:if="{{content}}" style="width:730rpx;margin: 10rpx auto;display:block" nodes="{{content}}"></rich-text>
-</template>

+ 0 - 4
miniprogram/pages/detail/template/defaultDetail/index.wxss

@@ -1,4 +0,0 @@
-/* miniprogram/pages/detail/template/pdfDetail/index.wxss */
-.video{
-  width: 750rpx;
-}

+ 0 - 5
miniprogram/pages/detail/template/pdfDetail/index.wxml

@@ -1,5 +0,0 @@
-<!--miniprogram/pages/detail/template/pdfDetail/index.wxml-->
-<template name="pdfDetail">
-  <image class="headImg" mode="aspectFit" src="{{headUrl}}"></image>
-  <image class="bodyImg" mode="aspectFit" wx:for="{{content}}" src="{{item}}" wx:key="index"></image>
-</template>

+ 0 - 5
miniprogram/pages/detail/template/pdfDetail/index.wxss

@@ -1,5 +0,0 @@
-/* miniprogram/pages/detail/template/pdfDetail/index.wxss */
-.bodyImg{
-  width: 750rpx;
-  height: 1060rpx;
-}

+ 0 - 4
miniprogram/pages/detail/template/sysDetail/index.wxml

@@ -1,4 +0,0 @@
-<template name="sysDetail">
-  <image class="headImg" mode="aspectFit" wx:if="{{headUrl}}" src="{{headUrl}}"></image>
-  <rich-text wx:if="{{content}}" style="width:730rpx;margin: 10rpx auto;display:block" nodes="{{content}}"></rich-text>
-</template>

+ 0 - 1
miniprogram/pages/detail/template/sysDetail/index.wxss

@@ -1 +0,0 @@
-/* miniprogram/pages/detail/template/sysDetail/index.wxss */

+ 3 - 5
miniprogram/pages/home/index.js

@@ -1,4 +1,4 @@
-import { httpCloud } from "../../utils/httpFunc";
+import { httpOrther } from "../../utils/httpFunc";
 // miniprogram/pages/home/index.js
 Page({
 
@@ -10,7 +10,6 @@ Page({
   },
 
   clickFunc(data) {
-    console.log(data.currentTarget);
     const index = data.currentTarget.dataset.index;
     const item = this.data.iconList[index];
     let url = ""
@@ -35,9 +34,8 @@ Page({
     wx.setNavigationBarTitle({
       title: "盛世中华 何以中国"
     })
-    httpCloud({
-      name: "server",
-      type: "getHomeList",
+    httpOrther({
+      url: '/Applets/shengshizhongguo/json/shengshi.json',
       call(res) {
         _this.setData({
           iconList: res || []

+ 0 - 72
miniprogram/pages/marvellous/components/videoAn/index.js

@@ -1,72 +0,0 @@
-// pages/marvellous/components/videoAn/video.js
-Component({
-  /**
-   * 组件的属性列表
-   */
-  properties: {
-  },
-  transverse: undefined,
-  portrait: undefined,
-  /**
-   * 组件的初始数据
-   */
-  data: {
-    tra: {},
-    por: {},
-    step: 0,
-    show: true,
-    heng: true,
-    shu: true
-  },
-
-  ready() {
-    // this.transverse = wx.createAnimation({
-    //   duration: 1500,
-    //   timingFunction: 'linear',
-    // })
-    // this.portrait = wx.createAnimation({
-    //   duration: 1500,
-    //   timingFunction: 'linear',
-    // })
-    // this.transverse.width("750rpx").step();
-    // this.portrait.height("100vh").step();
-  },
-  /**
-   * 组件的方法列表
-   */
-  methods: {
-    start() {
-      let _this = this;
-      this.setData({
-        // tra: this.transverse.export(),
-        step: 1
-      },()=>{
-        let time = setInterval(() => {
-          clearInterval(time);
-          _this.nextAnstion();
-        }, 1450);
-
-      })
-    },
-    nextAnstion() {
-      let _this = this;
-      this.setData({
-        heng: false,
-        // por: this.portrait.export(),
-        step: 2
-      },()=>{
-        let time = setInterval(() => {
-          clearInterval(time);
-          _this.end();
-        }, 1450);
-      })
-    },
-    end(){
-      this.setData({
-        shu: false,
-        step: 3
-      })
-      this.triggerEvent("close")
-    }
-  }
-})

+ 0 - 4
miniprogram/pages/marvellous/components/videoAn/index.json

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

+ 0 - 27
miniprogram/pages/marvellous/components/videoAn/index.wxml

@@ -1,27 +0,0 @@
-<!--miniprogram/pages/marvellous/template/videoAn/index.wxml-->
-
-<view class="door" bindtap="start" wx:if="show">
-  <view class="transverse" wx:if="{{heng}}">
-    <image class="left"
-      src="https://cxzx.smcic.net/topic/Applets/shengshizhongguo/door_left.jpg"></image>
-    <view class="center {{ step === 1 ? 'width100' : '' }}" ></view>
-    <!-- <view class="center" animation="{{tra}}" bindtransitionend="nextAnstion"></view> -->
-    <image class="right"
-      src="https://cxzx.smcic.net/topic/Applets/shengshizhongguo/door_right.jpg"></image>
-  </view>
-
-
-
-  <view class="portrait" wx:if="{{shu}}">
-    <view class="port">
-      <image class="up" src="https://cxzx.smcic.net/topic/Applets/shengshizhongguo/wood.jpg">
-      </image>
-      <view class="center  {{ step === 2 ? 'height100' : '' }}"></view>
-      <!-- <view class="center" animation="{{por}}" bindtransitionend="end"></view> -->
-      <image class="down" src="https://cxzx.smcic.net/topic/Applets/shengshizhongguo/wood.jpg">
-      </image>
-    </view>
-  </view>
-
-  <view class="tip">点击开始</view>
-</view>

+ 0 - 107
miniprogram/pages/marvellous/components/videoAn/index.wxss

@@ -1,107 +0,0 @@
-/* miniprogram/pages/marvellous/template/videoAn/index.wxss */
-.door {
-  top: 0;
-  left: 0;
-  position: fixed;
-  width: 750rpx;
-  height: 100vh;
-  z-index: 1;
-}
-.door .transverse{
-  white-space: nowrap;
-  overflow: hidden;
-  width: 1500rpx;
-  left: -375rpx;
-  position: absolute;
-  height: 100vh;
-  z-index: 3;
-  text-align: center;
-}
-
-.door .transverse .right,
-.door .transverse .left{
-  width: 375rpx;
-  height: 100vh;
-}
-
-.door .transverse .center{
-  width: 0;
-}
-.door .transverse .right,
-.door .transverse .left,
-.door .transverse .center{
-  display: inline-block;
-}
-
-.door .portrait{
-  height: 200vh;
-  margin-top: -50vh;
-}
-.door .portrait .port{
-  position: absolute;
-  overflow: hidden;
-  top: 50%;
-  transform: translateY(-50%);
-  width: 750rpx;
-  font-size: 0;
-}
-.door .port .up,
-.door .port .down{
-  height: 50vh;
-  width: 750rpx;
-}
-.door .portrait .center{
-  height: 0;
-}
-
-.door .tip {
-  position: absolute;
-  text-align: center;
-  font-size: 18px;
-  bottom: 20rpx;
-  color: #eee;
-  width: 750rpx;
-  z-index: 4;
-  animation: mymove 2s infinite;
-}
-
-@keyframes mymove {
-  0% {
-    opacity: 1;
-  }
-  50% {
-    opacity: 0;
-  }
-
-  100% {
-    opacity: 1;
-  }
-}
-
-.door .width100{
-  animation: width100 1.5s;
-
-}
-.door .height100{
-  animation: height100 1.5s;
-
-}
-
-@keyframes width100 {
-  0% {
-    width: 0;
-  }
-
-  100% {
-    width: 750rpx;
-  }
-}
-@keyframes height100 {
-  0% {
-    height: 0;
-  }
-
-  100% {
-    height: 100vh;
-  }
-}

+ 0 - 301
miniprogram/pages/marvellous/index.js

@@ -1,301 +0,0 @@
-// miniprogram/pages/marvellous/index.js
-Page({
-  imgList: [],
-  downCount: 0,
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    pageList: [],
-    select: { count: 0 },
-    pageType: "",
-    showSelect: false,
-    showVideo: "",
-    showAnVideo: true
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    wx.setNavigationBarTitle({
-      title: options.title || "精彩瞬间"
-    })
-    this.init(options);
-  },
-  async init(options) {
-    const db = wx.cloud.database();
-    const _ = db.command;
-    if (!options) options = { type: this.data.pageType }
-    this.imgList = [];
-    let pageList = {};
-    wx.showLoading();
-    let allList = await db.collection('data_asset').where({
-      type: _.eq(options.type || "img")
-    }).count();
-    const totalpage = Math.ceil(allList.total / 20)
-    let list = [];
-    for (let i = 0; i < totalpage; i++) {
-      let end = allList.total > (i + 1) * 20 ? (i + 1) * 20 : allList.total;
-      let li = await db.collection('data_asset').where({
-        type: _.eq(options.type || "img")
-      }).skip(i * 20)
-        .limit(end)
-        .get() || { data: [] };
-      list = list.concat(...li.data)
-    }
-
-    wx.hideLoading();
-    if (!list.length) return wx.showToast({
-      title: '暂无数据',
-      icon: "none"
-    })
-    list.sort((a, b) => {
-      return b.create_time - a.create_time
-    })
-    for (let i = 0; i < list.length; i++) {
-      const v = list[i];
-      v.index = i;
-      // pageList[v.create_time] ? pageList[v.create_time].list.push(v) : pageList[v.create_time] = { list: [v], time: this.format(v.create_time) };
-      pageList[0] ? pageList[0].list.push(v) : pageList[0] = { list: [v], time: 0 };
-      this.imgList.push(v.url);
-    }
-
-    this.setData({
-      pageList: pageList,
-      pageType: options.type || "img",
-      showAnVideo: options.type === "video"
-    })
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  },
-  showImg(e) {
-    if (this.data.showSelect) return this.btnSelect(e);
-    if (this.data.pageType === "video") return this.showVideo(e);
-    if (this.data.pageType === "img") return this.showImage(e);
-  },
-  showVideo: function (e) {
-    this.setData({
-      showVideo: this.imgList[e.currentTarget.dataset.index]
-    })
-  },
-  showImage: function (e) {
-    wx.previewImage({
-      urls: this.imgList,
-      current: this.imgList[e.currentTarget.dataset.index],
-    })
-  },
-  longtap: function (e) {
-    this.setData({
-      showSelect: true
-    })
-  },
-  longClose: function (e) {
-    let pageList = this.data.pageList;
-    let select = this.data.select;
-    let keys = Object.keys(select);
-    for (let i = 0; i < keys.length; i++) {
-      let v = keys[i];
-      if (v === 'count') continue;
-      let li = v.split("-");
-      pageList[li[0]].list[li[1]].select = false;
-    }
-    this.setData({
-      showSelect: false,
-      pageList,
-      select: {
-        count: 0
-      }
-    })
-  },
-  btnSelect: function (e) {
-    if (this.data.select.count > 9) return;
-    let d = e.currentTarget.dataset;
-    let pageList = this.data.pageList;
-    let select = this.data.select;
-    pageList[d.key].list[d.o].select = !pageList[d.key].list[d.o].select;
-    if (pageList[d.key].list[d.o].select) {
-      select[d.key + "-" + d.o] = d.url;
-      select.count++;
-    } else {
-      select[d.key + "-" + d.o] = undefined;
-      select.count--;
-    }
-    this.setData({
-      pageList: pageList,
-      select
-    })
-  },
-  format: function (res) {
-    if (!res) return ""
-    let T = new Date(res || 0);
-    let year = T.getFullYear();
-    let month = T.getMonth() + 1;
-    let day = T.getDate();
-    let hour = T.getHours();
-    let min = T.getMinutes() + 1;
-    let sec = T.getSeconds();
-
-    return year + "-" + (month > 9 ? month : "0" + month) + "-" + day + " " + (hour > 9 ? hour : '0' + hour) + ":" + (min > 9 ? min : '0' + min) + ":" + (sec > 9 ? sec : '0' + sec);
-  },
-  saveAsset: function () {
-    if (this.data.select.count === 0) return;
-    let _this = this;
-    // 权限判断
-    wx.getSetting({
-      success: function (res) {
-        if (!res['scope.writePhotosAlbum']) {
-          wx.authorize({
-            scope: 'scope.writePhotosAlbum',
-            success: function (res) {
-              wx.showLoading();
-              let keys = Object.keys(_this.data.select);
-              _this.downCount = keys.length - 1;
-              for (let i = 0; i < keys.length; i++) {
-                const v = keys[i];
-                if (v === 'count') continue;
-                _this.downFile(v);
-              }
-            },
-            fail: function (err) {
-              wx.showToast({
-                title: '未获取权限',
-                icon: "none"
-              })
-            }
-          })
-          return
-        }
-        wx.showLoading();
-        let keys = Object.keys(this.data.select);
-        _this.downCount = keys.length - 1;
-        for (let i = 0; i < keys.length; i++) {
-          const v = keys[i];
-          if (v === 'count') continue;
-          _this.downFile(v);
-        }
-      },
-      fail: function (err) {
-        wx.showToast({
-          title: '未获取权限',
-          icon: "none"
-        })
-      }
-    })
-  },
-  downFile: function (v) {
-    let _this = this;
-    wx.cloud.downloadFile({
-      fileID: _this.data.select[v],
-      success: function (res) {
-        if (_this.data.pageType === "img") {
-          _this.saveImage(res.tempFilePath)
-        } else {
-          _this.savevideo(res.tempFilePath)
-        }
-      },
-      fail: function (err) {
-        wx.showToast({
-          title: "下载失败:" + _this.data.select[v],
-          icon: "none"
-        })
-        _this.downCount--;
-        if (_this.downCount <= 0) {
-          wx.hideLoading();
-        }
-      }
-    })
-  },
-  saveImage: function (tempFilePath) {
-    let _this = this;
-    wx.saveImageToPhotosAlbum({
-      filePath: tempFilePath,
-      success: function (res) {
-        _this.downEnd();
-      },
-      fail: function (err) {
-        wx.showToast({
-          title: '下载失败',
-          icon: "none"
-        })
-        _this.downEnd();
-      }
-    })
-  },
-  savevideo: function (tempFilePath) {
-    wx.saveVideoToPhotosAlbum({
-      filePath: tempFilePath,
-      success: function (res) {
-        _this.downEnd();
-      },
-      fail: function (err) {
-        wx.showToast({
-          title: '下载失败',
-          icon: "none"
-        })
-        _this.downEnd();
-      }
-    })
-  },
-  downEnd: function () {
-    this.downCount--;
-    if (this.downCount <= 0) {
-      wx.hideLoading();
-    }
-  },
-  closeVideo: function () {
-    this.setData({
-      showVideo: ""
-    })
-  },
-  closeAnvido: function () {
-    this.setData({
-      showAnVideo: false
-    })
-  }
-})

+ 0 - 6
miniprogram/pages/marvellous/index.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "startAn": "./components/videoAn/index",
-    "mp-icon": "weui-miniprogram/icon/icon"
-  }
-}

+ 0 - 33
miniprogram/pages/marvellous/index.wxml

@@ -1,33 +0,0 @@
-<!--miniprogram/pages/marvellous/index.wxml-->
-<view class="marvellous">
-  <startAn wx:if="{{pageType === 'video' && showAnVideo}}" bindclose="closeAnvido"></startAn>
-  <view class="htead"></view>
-  <view wx:if="{{!showAnVideo}}">
-    <view class="bg" wx:for="{{pageList}}" wx:key="_id">
-      <!-- <text>{{item.time}}</text> -->
-      <view class="icon_container">
-        <view class="icon_item_cell" wx:for="{{item.list}}" wx:key="_id" wx:for-item="v" wx:for-index="o"
-          data-index="{{v.index}}" data-key="{{index}}" data-o="{{o}}" data-url="{{v.url}}" bindtap="showImg"
-          bindlongtap="longtap">
-          <cover-view wx:if="{{showSelect}}" class="btnClose {{ v.select ? 'act': '' }}" size="{{20}}">√</cover-view>
-          <image style="background-color: #000" mode="aspectFit" wx:if="{{pageType === 'img'}}" class="img"
-            src="{{v.url}}" lazy-load="{{true}}">
-          </image>
-          <video custom-cache="{{false}}" show-progress="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}"
-            show-center-play-btn="{{false}}" bindlongtap="longtap" wx:if="{{v && v.url && pageType === 'video'}}" class="video {{}}"
-            src="{{v.url}}"></video>
-        </view>
-      </view>
-    </view>
-  </view>
-  <view class="bottomBtn" wx:if="{{showSelect}}">
-    <view class="btn" bindtap="longClose">取消</view>
-    <view class="btn" style="border-left: 1rpx solid #fff;" bindtap="saveAsset">确认({{select.count}})</view>
-  </view>
-
-  <!-- 视频 -->
-  <view class="videoM " style="display: {{showVideo == '' ? 'none': 'block'}}">
-    <mp-icon class="close" icon="close2" color="#fff" size="{{25}}" bindtap="closeVideo"></mp-icon>
-    <video custom-cache="{{false}}" show-play-btn="{{true}}" wx:if="{{showVideo}}" class="v" src="{{showVideo}}"></video>
-  </view>
-</view>

+ 0 - 89
miniprogram/pages/marvellous/index.wxss

@@ -1,89 +0,0 @@
-/* miniprogram/pages/marvellous/index.wxss */
-
-.marvellous {
-  padding: 10rpx;
-  height: 100%;
-}
-
-.icon_container {
-  width: 750rpx;
-  margin-left: -10rpx;
-  font-size: 12px;
-  color: #666;
-}
-
-.icon_container .icon_item_cell {
-  position: relative;
-  box-sizing: border-box;
-  display: inline-block;
-  width: 250rpx;
-  padding: 5rpx;
-}
-.icon_container .btnClose{
-  border: 2rpx solid #fff;
-  background-color: rgba(0,0,0, .2);
-  border-radius: 50%;
-  position: absolute;
-  font-size: 25rpx;
-  height: 30rpx;
-  width: 30rpx;
-  right: 10rpx;
-  top: 10rpx;
-  z-index: 1;
-  color: #fff;
-  text-align: center;
-  line-height: 30rpx;
-}
-.icon_container .act{
-  border-color: #07c160;
-  color: #07c160;
-}
-
-.img {
-  width: 245rpx;
-  height: 164rpx;
-}
-.video{
-  width: 245rpx;
-  height: 164rpx;
-}
-
-.bottomBtn{
-  background-color: #eee;
-  position: absolute;
-  width: 750rpx;
-  left: 0;
-  padding: 20rpx 0;
-  color: #333;
-  bottom: 0;
-}
-.bottomBtn .btn{
-  width: 370rpx;
-  text-align: center;
-  display: inline-block;
-}
-.bottomBtn .btn:last-child{
-  border-left: 1rpx solid #eee;
-}
-
-.videoM{
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  position: fixed;
-  background-color: rgba(0, 0, 0, .2);
-}
-.videoM .close{
-  position:absolute;
-  top: 10rpx;
-  right: 10rpx;
-}
-
-.videoM .v{
-  top: 50%;
-  width: 750rpx;
-  height: 422rpx;
-  position: absolute;
-  transform: translateY(-50%);
-}

+ 14 - 5
miniprogram/pages/videoDetail/index.js

@@ -1,5 +1,6 @@
 // pages/videoDetail/index.js
 import { httpCloud } from "../../utils/httpFunc";
+const app = getApp()
 Page({
 
   /**
@@ -7,21 +8,30 @@ Page({
    */
   data: {
     media: {},
-    indexItem: {}
+    indexItem: {},
+    videoWidth: 0,
+    videoHeight: 0,
   },
 
-  toNext(e){
+  toNext(e) {
     wx.redirectTo({
       url: "/pages/videoDetail/index?id=" + this.data.media.id + '&index=' + e.currentTarget.dataset.index
     })
   },
 
+  loadedmetadata(e) {
+    const { width, height } = e.detail || {};
+    this.setData({
+      videoWidth: app.globalData.client.windowWidth,
+      videoHeight: app.globalData.client.windowWidth/width * height
+    })
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
     const _this = this;
-    console.log(options)
     httpCloud({
       name: "server",
       type: "getMediaControllerOnce",
@@ -30,12 +40,11 @@ Page({
         id: options.id
       },
       call(res) {
-        const ori = res || {child: []};
+        const ori = res || { child: [] };
         _this.setData({
           media: ori,
           indexItem: ori.child[options.index]
         })
-        console.log(res)
         wx.setNavigationBarTitle({
           title: ori.child[options.index].title
         })

+ 3 - 4
miniprogram/pages/videoDetail/index.wxml

@@ -1,9 +1,8 @@
 <!--pages/videoDetail/index.wxml-->
-<video class="video" src="{{indexItem.url}}" controls 	poster="{{indexItem.url + '?x-oss-process=video/snapshot,t_100,f_jpg,m_fast'}}" />
+<video bindloadedmetadata="loadedmetadata" style="{{'width: '+ videoWidth +'px;height: '+ videoHeight +'px'}}" class="video" src="{{indexItem.url}}" controls poster="{{indexItem.url + '?x-oss-process=video/snapshot,t_100,f_jpg,m_fast'}}" />
 <mp-cell title="{{indexItem.title}}"></mp-cell>
 
 <view class="list" wx:for="{{media.child || []}}" wx:key="index" bindtap="toNext" data-index="{{index}}">
-  <image class="imgage" src="{{item.url + '?x-oss-process=video/snapshot,t_100,f_jpg,m_fast'}}"  mode="aspectFit"/>
+  <image class="imgage" src="{{item.url + '?x-oss-process=video/snapshot,t_100,f_jpg,m_fast'}}" mode="aspectFit" />
   <view class="title">{{item.title}}</view>
-</view>
-
+</view>

+ 26 - 2
miniprogram/utils/httpFunc.js

@@ -1,3 +1,5 @@
+import { baseurl } from "../config/idnex";
+
 function httpError(err) {
   console.error(err);
   wx.hideLoading();
@@ -19,12 +21,34 @@ export function httpCloud(params) {
     },
     success: function (res) {
       wx.hideLoading();
-      if(!/ok/g.test(res.errMsg)) return httpError(res);
-      if(res.result.code != 0) return wx.showToast({
+      if (!/ok/g.test(res.errMsg)) return httpError(res);
+      if (res.result.code != 0) return wx.showToast({
         title: '请稍后再试!',
       })
       par.call && par.call(res.result.data);
     },
     fail: httpError
   })
+}
+
+export function httpOrther(params) {
+  !params.noLoading && wx.showLoading();
+  const par = params || {};
+  wx.request({
+    url: baseurl + par.url,
+    data: {
+      ...(par.data || {}),
+    },
+    success(res) {
+      if (res.statusCode !== 200 || res.data.code != 0 )return wx.showToast({
+        title: '请稍后再试!',
+      })
+      if (!/ok/g.test(res.errMsg)) return httpError(res);
+      
+      par.call && par.call(res.data.data);
+    },
+    complete() {
+      wx.hideLoading();
+    }
+  })
 }

+ 1 - 1
project.config.json

@@ -2,7 +2,7 @@
   "miniprogramRoot": "miniprogram/",
   "cloudfunctionRoot": "cloudfunctions/",
   "setting": {
-    "urlCheck": false,
+    "urlCheck": true,
     "es6": true,
     "enhance": true,
     "postcss": true,

+ 19 - 3
project.private.config.json

@@ -1,5 +1,21 @@
 {
-  "setting": {},
-  "condition": {},
-  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+  "setting": {
+    "compileHotReLoad": false,
+    "urlCheck": true
+  },
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "",
+          "pathName": "pages/videoDetail/index",
+          "query": "id=0&index=1",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "libVersion": "2.14.1"
 }