Skip to content

开发微信小程序时,提示不在以下 request 合法域名列表中怎么办

勾选不校验合法域名的选项

引入echart

参考教程:https://blog.csdn.net/mao871863224/article/details/108877244

首先,下载 GitHub 上的 ecomfe/echarts-for-weixin 项目。

目录结构如下:

项目根目录\components\ec-canvas\ec-xxx.js

其他

事件

wx.navigateBack()是返回 index 页面,不是新打开,不会触发onload事件,onShow会触发

页面注册

需要使用的页面都需要在app.json中进行注册

 "pages": [
    "pages/index/index",
    "pages/inventory/inventory",
    "pages/analysis/analysis",
    "pages/profile/profile",
    "pages/device/device",
    "pages/mqtt/mqtt"
  ],

原生弹窗

<view class="function-item" bindtap="showAbout">
        <image class="function-icon" src="/images/about.png"></image>
        <text class="function-name">关于我们</text>
        <text class="arrow">></text>
      </view>

  showAbout: function() {
    wx.showModal({
      title: '关于我们',
      content: '水果冷库控制系统 v1.0.0\n\n本系统旨在实现对冷库温度、湿度、库存等的智能监控与管理,保障水果储藏品质,提升仓储管理效率。',
      showCancel: false
    });
  },