liyongli 3 years ago
parent
commit
be1408117d

+ 1 - 3
miniprogram/app.json

@@ -4,9 +4,7 @@
     "pages/index/index",
     "pages/interList/interList",
     "pages/detail/detail",
-    "pages/ruins/index",
-    "pages/marvellous/index",
-    "pages/provincialArea/index"
+    "pages/marvellous/index"
   ],
   "window": {
     "backgroundColor": "#F6F6F6",

+ 0 - 254
miniprogram/ec-canvas/ec-canvas.js

@@ -1,254 +0,0 @@
-import WxCanvas from './wx-canvas';
-import * as echarts from './echarts';
-
-let ctx;
-
-function compareVersion(v1, v2) {
-  v1 = v1.split('.')
-  v2 = v2.split('.')
-  const len = Math.max(v1.length, v2.length)
-
-  while (v1.length < len) {
-    v1.push('0')
-  }
-  while (v2.length < len) {
-    v2.push('0')
-  }
-
-  for (let i = 0; i < len; i++) {
-    const num1 = parseInt(v1[i])
-    const num2 = parseInt(v2[i])
-
-    if (num1 > num2) {
-      return 1
-    } else if (num1 < num2) {
-      return -1
-    }
-  }
-  return 0
-}
-
-Component({
-  properties: {
-    canvasId: {
-      type: String,
-      value: 'ec-canvas'
-    },
-
-    ec: {
-      type: Object
-    },
-
-    forceUseOldCanvas: {
-      type: Boolean,
-      value: false
-    }
-  },
-
-  data: {
-    isUseNewCanvas: false
-  },
-
-  ready: function () {
-    // Disable prograssive because drawImage doesn't support DOM as parameter
-    // See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
-    echarts.registerPreprocessor(option => {
-      if (option && option.series) {
-        if (option.series.length > 0) {
-          option.series.forEach(series => {
-            series.progressive = 0;
-          });
-        }
-        else if (typeof option.series === 'object') {
-          option.series.progressive = 0;
-        }
-      }
-    });
-
-    if (!this.data.ec) {
-      console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
-        + 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
-      return;
-    }
-
-    if (!this.data.ec.lazyLoad) {
-      this.init();
-    }
-  },
-
-  methods: {
-    init: function (callback) {
-      const version = wx.getSystemInfoSync().SDKVersion
-
-      const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
-      const forceUseOldCanvas = this.data.forceUseOldCanvas;
-      const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
-      this.setData({ isUseNewCanvas });
-
-      if (forceUseOldCanvas && canUseNewCanvas) {
-        console.warn('开发者强制使用旧canvas,建议关闭');
-      }
-
-      if (isUseNewCanvas) {
-        // console.log('微信基础库版本大于2.9.0,开始使用<canvas type="2d"/>');
-        // 2.9.0 可以使用 <canvas type="2d"></canvas>
-        this.initByNewWay(callback);
-      } else {
-        const isValid = compareVersion(version, '1.9.91') >= 0
-        if (!isValid) {
-          console.error('微信基础库版本过低,需大于等于 1.9.91。'
-            + '参见:https://github.com/ecomfe/echarts-for-weixin'
-            + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
-          return;
-        } else {
-          console.warn('建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能');
-          this.initByOldWay(callback);
-        }
-      }
-    },
-
-    initByOldWay(callback) {
-      // 1.9.91 <= version < 2.9.0:原来的方式初始化
-      ctx = wx.createCanvasContext(this.data.canvasId, this);
-      const canvas = new WxCanvas(ctx, this.data.canvasId, false);
-
-      echarts.setCanvasCreator(() => {
-        return canvas;
-      });
-      // const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr
-      const canvasDpr = 1
-      var query = wx.createSelectorQuery().in(this);
-      query.select('.ec-canvas').boundingClientRect(res => {
-        if (typeof callback === 'function') {
-          this.chart = callback(canvas, res.width, res.height, canvasDpr);
-        }
-        else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
-          this.data.ec.onInit(canvas, res.width, res.height, canvasDpr).then(res=>{
-            this.chart = res
-          })
-        }
-        else {
-          this.triggerEvent('init', {
-            canvas: canvas,
-            width: res.width,
-            height: res.height,
-            canvasDpr: canvasDpr // 增加了dpr,可方便外面echarts.init
-          });
-        }
-      }).exec();
-    },
-
-    initByNewWay(callback) {
-      // version >= 2.9.0:使用新的方式初始化
-      const query = wx.createSelectorQuery().in(this)
-      query
-        .select('.ec-canvas')
-        .fields({ node: true, size: true })
-        .exec(res => {
-          const canvasNode = res[0].node
-          this.canvasNode = canvasNode
-
-          const canvasDpr = wx.getSystemInfoSync().pixelRatio
-          const canvasWidth = res[0].width
-          const canvasHeight = res[0].height
-
-          const ctx = canvasNode.getContext('2d')
-
-          const canvas = new WxCanvas(ctx, this.data.canvasId, true, canvasNode)
-          echarts.setCanvasCreator(() => {
-            return canvas
-          })
-
-          if (typeof callback === 'function') {
-            this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr)
-          } else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
-            this.data.ec.onInit(canvas, canvasWidth, canvasHeight, canvasDpr).then(res=>{
-              this.chart = res
-            })
-          } else {
-            this.triggerEvent('init', {
-              canvas: canvas,
-              width: canvasWidth,
-              height: canvasHeight,
-              dpr: canvasDpr
-            })
-          }
-        })
-    },
-    canvasToTempFilePath(opt) {
-      if (this.data.isUseNewCanvas) {
-        // 新版
-        const query = wx.createSelectorQuery().in(this)
-        query
-          .select('.ec-canvas')
-          .fields({ node: true, size: true })
-          .exec(res => {
-            const canvasNode = res[0].node
-            opt.canvas = canvasNode
-            wx.canvasToTempFilePath(opt)
-          })
-      } else {
-        // 旧的
-        if (!opt.canvasId) {
-          opt.canvasId = this.data.canvasId;
-        }
-        ctx.draw(true, () => {
-          wx.canvasToTempFilePath(opt, this);
-        });
-      }
-    },
-
-    touchStart(e) {
-      if (this.chart && e.touches.length > 0) {
-        var touch = e.touches[0];
-        var handler = this.chart.getZr().handler;
-        handler.dispatch('mousedown', {
-          zrX: touch.x,
-          zrY: touch.y
-        });
-        handler.dispatch('mousemove', {
-          zrX: touch.x,
-          zrY: touch.y
-        });
-        handler.processGesture(wrapTouch(e), 'start');
-      }
-    },
-
-    touchMove(e) {
-      if (this.chart && e.touches.length > 0) {
-        var touch = e.touches[0];
-        var handler = this.chart.getZr().handler;
-        handler.dispatch('mousemove', {
-          zrX: touch.x,
-          zrY: touch.y
-        });
-        handler.processGesture(wrapTouch(e), 'change');
-      }
-    },
-
-    touchEnd(e) {
-      if (this.chart) {
-        const touch = e.changedTouches ? e.changedTouches[0] : {};
-        var handler = this.chart.getZr().handler;
-        handler.dispatch('mouseup', {
-          zrX: touch.x,
-          zrY: touch.y
-        });
-        handler.dispatch('click', {
-          zrX: touch.x,
-          zrY: touch.y
-        });
-        handler.processGesture(wrapTouch(e), 'end');
-      }
-    }
-  }
-});
-
-function wrapTouch(event) {
-  for (let i = 0; i < event.touches.length; ++i) {
-    const touch = event.touches[i];
-    touch.offsetX = touch.x;
-    touch.offsetY = touch.y;
-  }
-  return event;
-}

+ 0 - 4
miniprogram/ec-canvas/ec-canvas.json

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

+ 0 - 4
miniprogram/ec-canvas/ec-canvas.wxml

@@ -1,4 +0,0 @@
-<!-- 新的:接口对其了H5 -->
-<canvas wx:if="{{isUseNewCanvas}}" type="2d" class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
-<!-- 旧的 -->
-<canvas wx:else class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>

+ 0 - 4
miniprogram/ec-canvas/ec-canvas.wxss

@@ -1,4 +0,0 @@
-.ec-canvas {
-  width: 100%;
-  height: 100%;
-}

File diff suppressed because it is too large
+ 0 - 0
miniprogram/ec-canvas/echarts.js


+ 0 - 121
miniprogram/ec-canvas/wx-canvas.js

@@ -1,121 +0,0 @@
-export default class WxCanvas {
-  constructor(ctx, canvasId, isNew, canvasNode) {
-    this.ctx = ctx;
-    this.canvasId = canvasId;
-    this.chart = null;
-    this.isNew = isNew
-    if (isNew) {
-      this.canvasNode = canvasNode;
-    }
-    else {
-      this._initStyle(ctx);
-    }
-
-    // this._initCanvas(zrender, ctx);
-
-    this._initEvent();
-  }
-
-  getContext(contextType) {
-    if (contextType === '2d') {
-      return this.ctx;
-    }
-  }
-
-  // canvasToTempFilePath(opt) {
-  //   if (!opt.canvasId) {
-  //     opt.canvasId = this.canvasId;
-  //   }
-  //   return wx.canvasToTempFilePath(opt, this);
-  // }
-
-  setChart(chart) {
-    this.chart = chart;
-  }
-
-  attachEvent() {
-    // noop
-  }
-
-  detachEvent() {
-    // noop
-  }
-
-  _initCanvas(zrender, ctx) {
-    zrender.util.getContext = function () {
-      return ctx;
-    };
-
-    zrender.util.$override('measureText', function (text, font) {
-      ctx.font = font || '12px sans-serif';
-      return ctx.measureText(text);
-    });
-  }
-
-  _initStyle(ctx) {
-    var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
-      'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
-      'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
-
-    styles.forEach(style => {
-      Object.defineProperty(ctx, style, {
-        set: value => {
-          if (style !== 'fillStyle' && style !== 'strokeStyle'
-            || value !== 'none' && value !== null
-          ) {
-            ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
-          }
-        }
-      });
-    });
-
-    ctx.createRadialGradient = () => {
-      return ctx.createCircularGradient(arguments);
-    };
-  }
-
-  _initEvent() {
-    this.event = {};
-    const eventNames = [{
-      wxName: 'touchStart',
-      ecName: 'mousedown'
-    }, {
-      wxName: 'touchMove',
-      ecName: 'mousemove'
-    }, {
-      wxName: 'touchEnd',
-      ecName: 'mouseup'
-    }, {
-      wxName: 'touchEnd',
-      ecName: 'click'
-    }];
-
-    eventNames.forEach(name => {
-      this.event[name.wxName] = e => {
-        const touch = e.touches[0];
-        this.chart.getZr().handler.dispatch(name.ecName, {
-          zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
-          zrY: name.wxName === 'tap' ? touch.clientY : touch.y
-        });
-      };
-    });
-  }
-
-  set width(w) {
-    if (this.canvasNode) this.canvasNode.width = w
-  }
-  set height(h) {
-    if (this.canvasNode) this.canvasNode.height = h
-  }
-
-  get width() {
-    if (this.canvasNode)
-      return this.canvasNode.width
-    return 0
-  }
-  get height() {
-    if (this.canvasNode)
-      return this.canvasNode.height
-    return 0
-  }
-}

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

@@ -94,11 +94,6 @@ Page({
       url: '/pages/detail/detail?title=' + title + "&id=" + id,
     })
   },
-  toRuins: function (e) {
-    wx.navigateTo({
-      url: '/pages/ruins/index',
-    })
-  },
   toMarvellous: function (e) {
     wx.navigateTo({
       url: '/pages/marvellous/index?title=' + e.currentTarget.dataset.title + "&type=" + e.currentTarget.dataset.type,

+ 2 - 2
miniprogram/pages/home/index.wxml

@@ -2,7 +2,7 @@
 <view class="home">
   <image class="headImg" src="cloud://cloud1-6gbxfp9x33ff3b7c.636c-cloud1-6gbxfp9x33ff3b7c-1306051304/head.jpeg"></image>
   <view class="title">
-    畅行中国•庆祝建党100周年“寻红色记忆”主题——“红色文物会说话、红色遗址会发声”融媒传播发布仪式
+    畅行中国•庆祝建党100周年“寻红色记忆”主题——“红色文物会说话、红色遗址会发声”融媒传播发布仪式
   </view>
   <view class="subTitle">
     2021年5月15日至16日
@@ -42,7 +42,7 @@
       </view>
     </view>
     <view class="icon_item_cell">
-      <view class="icon_content" bindtap="toRuins">
+      <view class="icon_content" data-title="延安印迹" data-id="28ee4e3e60bee3dc20a8a74e3e2d8b10" bindtap="toDetail">
         <image class="img" src="../../images/5.png"></image>
         <view class="icon_title">
           延安印迹

+ 4 - 3
miniprogram/pages/marvellous/index.js

@@ -39,14 +39,15 @@ Page({
     let li = list.data || [];
     for (let i = 0; i < li.length; i++) {
       const v = li[i];
-      console.log(v)
       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[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"
+      pageType: options.type || "img",
+      showAnVideo: options.type === "video"
     })
   },
 

+ 15 - 15
miniprogram/pages/marvellous/index.wxml

@@ -2,21 +2,21 @@
 <view class="marvellous">
   <startAn wx:if="{{pageType === 'video' && showAnVideo}}" bindclose="closeAnvido"></startAn>
   <view class="htead"></view>
-  <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 wx:if="{{pageType === 'img'}}" class="img" src="{{v.url}}"></image>
-        <image wx:if="{{pageType === 'video'}}" class="img" src="{{v.cover}}"></image>
-        <!-- <video show-progress="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}"
-          show-center-play-btn="{{false}}" bindlongtap="longtap" wx:if="{{pageType === 'video'}}" class="video {{}}"
-          src="{{v.url}}"></video> -->
+  <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 wx:if="{{pageType === 'img'}}" class="img" src="{{v.url}}"></image>
+          <video show-progress="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}"
+            show-center-play-btn="{{false}}" bindlongtap="longtap" wx:if="{{pageType === 'video'}}" class="video {{}}"
+            src="{{v.url}}"></video>
+        </view>
       </view>
     </view>
-
   </view>
   <view class="bottomBtn" wx:if="{{showSelect}}">
     <view class="btn" bindtap="longClose">取消</view>
@@ -24,8 +24,8 @@
   </view>
 
   <!-- 视频 -->
-  <view class="videoM " style="display: {{showVideo == '' ? 'none': 'block'}}" >
-    <mp-icon class="close" icon="close2" color="#fff" size="{{25}}"  bindtap="closeVideo"></mp-icon>
+  <view class="videoM " style="display: {{showVideo == '' ? 'none': 'block'}}">
+    <mp-icon class="close" icon="close2" color="#fff" size="{{25}}" bindtap="closeVideo"></mp-icon>
     <video show-play-btn="{{true}}" class="v" src="{{showVideo}}"></video>
   </view>
 </view>

+ 0 - 105
miniprogram/pages/provincialArea/index.js

@@ -1,105 +0,0 @@
-// miniprogram/pages/provincialArea/index.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  playIndex: 0,
-  data: {
-    tabs: [],
-    playStatus: true,
-    activeTab: 0,
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: async function (options) {
-
-    wx.setNavigationBarTitle({
-      title: "红色文物会发声-" + options.title
-    })
-    const db = wx.cloud.database();
-    const _ = db.command;
-    let list = await db.collection('data_news').where({
-      type: _.eq(3),
-      provincial: _.eq(options.title)
-    }).get();
-    wx.playBackgroundAudio({
-      dataUrl: list.data[this.playIndex].music
-    })
-    this.setData({
-      playStatus: true,
-      tabs: list.data || []
-    })
-  },
-  isPlay(){
-    let playStatus = !this.data.playStatus;
-    console.log(playStatus)
-    if(playStatus){
-      wx.playBackgroundAudio({
-        dataUrl: this.data.tabs[this.playIndex].music
-      })
-    }else{
-      wx.pauseBackgroundAudio()
-    }
-    this.setData({
-      playStatus
-    })
-  },
-  pageChange(e){
-    this.playIndex = e.detail.current || 0;
-    wx.playBackgroundAudio({
-      dataUrl: this.data.tabs[this.playIndex].music
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-    wx.stopBackgroundAudio()
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
-})

+ 0 - 5
miniprogram/pages/provincialArea/index.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "mp-icon": "weui-miniprogram/icon/icon"
-  }
-}

+ 0 - 22
miniprogram/pages/provincialArea/index.wxml

@@ -1,22 +0,0 @@
-<!--miniprogram/pages/provincialArea/index.wxml-->
-<view style="playbtn">
-  <view class="playAudio {{playStatus ? 'playAudioAnimation' : ''}}" bindtap="isPlay">
-    <mp-icon wx:if="{{playStatus}}" icon="music" color="#000" size="{{15}}"></mp-icon>
-    <mp-icon wx:if="{{!playStatus}}" icon="music-off" color="#000" size="{{15}}"></mp-icon>
-  </view>
-</view>
-<swiper class="areaPage" vertical="{{true}}" bindchange="pageChange">
-  <swiper-item wx:for="{{tabs}}" wx:key="_id">
-    <scroll-view class="areaItem" scroll-y="{{true}}">
-      <swiper wx:if="{{item.images.length}}">
-        <swiper-item wx:for="{{item.images}}" wx:key="_id">
-          <image style="width: 730rpx;height: 100%" src="../../images/5.png"></image>
-        </swiper-item>
-      </swiper>
-      <view class="title">{{item.title}}</view>
-      <view class="content">
-        <rich-text nodes="{{item.content}}"></rich-text>
-      </view>
-    </scroll-view>
-  </swiper-item>
-</swiper>

+ 0 - 55
miniprogram/pages/provincialArea/index.wxss

@@ -1,55 +0,0 @@
-/* miniprogram/pages/provincialArea/index.wxss */
-.areaPage {
-  width: 100%;
-  height: 100%;
-  box-sizing: border-box;
-}
-
-.areaItem {
-  height: 100vh;
-  padding: 10rpx;
-  box-sizing: border-box;
-}
-
-.content {
-  padding: 20rpx 20rpx 60rpx 20rpx;
-}
-
-.title {
-  text-align: center;
-  margin: 20rpx 0;
-}
-
-.palybtn {
-  position: relative;
-  height: 30px;
-}
-
-.playAudio {
-  z-index: 1;
-  right: 20rpx;
-  width: 30px;
-  height: 30px;
-  border-radius: 50%;
-  text-align: center;
-  position: absolute;
-  box-sizing: border-box;
-  border: 1rpx solid #000;
-}
-
-.playAudioAnimation {
-  animation-name: playAudio;
-  animation-duration: 2s;
-  animation-timing-function: linear;
-  animation-iteration-count: infinite;
-}
-
-@keyframes playAudio {
-  0% {
-    transform: rotate(0deg);
-  }
-
-  100% {
-    transform: rotate(360deg);
-  }
-}

+ 0 - 137
miniprogram/pages/ruins/index.js

@@ -1,137 +0,0 @@
-// miniprogram/pages/ruins/index.js
-import * as echarts from '../../ec-canvas/echarts';
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  chart: undefined,
-  data: {
-    show: false,
-    ec: {
-      onInit: undefined,
-      lazyload: true
-    },
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    const db = wx.cloud.database()
-    const $ = db.command.aggregate;
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-    this.setData({
-      ec: {
-        onInit: this.initChart.bind(this)
-      }
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-    this.chart && this.chart.dispose && this.chart.dispose();
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  },
-
-  initChart: async function (canvas, width, height, dpr) {
-    this.chart && this.chart.dispose && this.chart.dispose();
-    this.chart = echarts.init(canvas, null, {
-      width: width,
-      height: height,
-      devicePixelRatio: dpr // 像素
-    });
-
-    const db = wx.cloud.database();
-    const _ = db.command;
-    let list = await db.collection('map_json').where({
-      region: _.eq("china")
-    }).get();
-    console.log(JSON.stringify(list.data[0].geoJson))
-    echarts.registerMap('CN', list.data[0].geoJson);
-    var option = {
-      tooltip: {
-        show: false
-      },
-      geo: {
-        map: "CN",
-        roam: true,//改成true也完全没效果
-        zoom: 1.25,
-        scaleLimit: {
-          //滚轮缩放的极限控制
-          min: 1.25,
-          max: 6,
-        },
-        top: "middle",
-        label: {
-          normal: {
-            show: true,
-            fontSize: "10",
-            color: "rgb(249,80,77)",
-          },
-        },
-        itemStyle: {
-          normal: {
-            areaColor: "rgba(0,0,0,0)",
-            borderColor: "rgb(249,80,77)",
-          },
-          emphasis: {
-            areaColor: "rgba(249,80,77,.3)",
-            shadowOffsetX: 0,
-            shadowOffsetY: 0,
-            borderWidth: 0,
-          },
-        },
-      },
-      series: []
-    };
-    this.chart.setOption(option);
-    this.chart.on("click", (params) => {
-      wx.navigateTo({
-        url: '/pages/provincialArea/index?title=' + params.region.name,
-      })
-    })
-    return this.chart;
-  }
-})

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

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "ec-canvas": "../../ec-canvas/ec-canvas"
-  },
-  "navigationBarTitleText": "红色遗址会发声"
-}

+ 0 - 4
miniprogram/pages/ruins/index.wxml

@@ -1,4 +0,0 @@
-<!--miniprogram/pages/ruins/index.wxml-->
-<view class="ruins">
-  <ec-canvas canvasId="test" ec="{{ ec }}" ></ec-canvas>
-</view>

+ 0 - 5
miniprogram/pages/ruins/index.wxss

@@ -1,5 +0,0 @@
-/* miniprogram/pages/ruins/index.wxss */
-.ruins,.ec-canvas{
-  width: 750rpx;
-  height: 100vh;
-}

Some files were not shown because too many files changed in this diff