“hujiajun” 6 месяцев назад
Родитель
Сommit
7096a1425d
100 измененных файлов с 3001 добавлено и 0 удалено
  1. 7 0
      cloudfunctions/quickstartFunctions/config.json
  2. 56 0
      cloudfunctions/quickstartFunctions/createCollection/index.js
  3. 27 0
      cloudfunctions/quickstartFunctions/fetchGoodsList/index.js
  4. 18 0
      cloudfunctions/quickstartFunctions/genMpQrcode/index.js
  5. 20 0
      cloudfunctions/quickstartFunctions/getMiniProgramCode/index.js
  6. 17 0
      cloudfunctions/quickstartFunctions/getOpenId/index.js
  7. 31 0
      cloudfunctions/quickstartFunctions/index.js
  8. 14 0
      cloudfunctions/quickstartFunctions/package.json
  9. 12 0
      cloudfunctions/quickstartFunctions/selectRecord/index.js
  10. 18 0
      cloudfunctions/quickstartFunctions/sumRecord/index.js
  11. 32 0
      cloudfunctions/quickstartFunctions/updateRecord/index.js
  12. 21 0
      miniprogram/app.js
  13. 34 0
      miniprogram/app.json
  14. 27 0
      miniprogram/app.wxss
  15. 48 0
      miniprogram/common/share-behavior.js
  16. 118 0
      miniprogram/components/1/xr-ar-2dmarker/index.js
  17. 5 0
      miniprogram/components/1/xr-ar-2dmarker/index.json
  18. 23 0
      miniprogram/components/1/xr-ar-2dmarker/index.wxml
  19. 1 0
      miniprogram/components/1/xr-ar-2dmarker/index.wxss
  20. 118 0
      miniprogram/components/2/xr-ar-2dmarker/index.js
  21. 5 0
      miniprogram/components/2/xr-ar-2dmarker/index.json
  22. 20 0
      miniprogram/components/2/xr-ar-2dmarker/index.wxml
  23. 1 0
      miniprogram/components/2/xr-ar-2dmarker/index.wxss
  24. 28 0
      miniprogram/components/cloudTipModal/index.js
  25. 4 0
      miniprogram/components/cloudTipModal/index.json
  26. 10 0
      miniprogram/components/cloudTipModal/index.wxml
  27. 60 0
      miniprogram/components/cloudTipModal/index.wxss
  28. 39 0
      miniprogram/components/cloudbaseModuleInstallModal/index.js
  29. 4 0
      miniprogram/components/cloudbaseModuleInstallModal/index.json
  30. 11 0
      miniprogram/components/cloudbaseModuleInstallModal/index.wxml
  31. 57 0
      miniprogram/components/cloudbaseModuleInstallModal/index.wxss
  32. 24 0
      miniprogram/components/cloudbaseModuleInstallPath/index.js
  33. 4 0
      miniprogram/components/cloudbaseModuleInstallPath/index.json
  34. 1 0
      miniprogram/components/cloudbaseModuleInstallPath/index.wxml
  35. 7 0
      miniprogram/components/cloudbaseModuleInstallPath/index.wxss
  36. 21 0
      miniprogram/components/mpCodeModal/index.js
  37. 4 0
      miniprogram/components/mpCodeModal/index.json
  38. 8 0
      miniprogram/components/mpCodeModal/index.wxml
  39. 95 0
      miniprogram/components/mpCodeModal/index.wxss
  40. 133 0
      miniprogram/components/xr-demo-viewer/index.js
  41. 4 0
      miniprogram/components/xr-demo-viewer/index.json
  42. 54 0
      miniprogram/components/xr-demo-viewer/index.wxml
  43. 129 0
      miniprogram/components/xr-demo-viewer/index.wxss
  44. 26 0
      miniprogram/components/xr-template-share/index.js
  45. 5 0
      miniprogram/components/xr-template-share/index.json
  46. 20 0
      miniprogram/components/xr-template-share/index.wxml
  47. 1 0
      miniprogram/components/xr-template-share/index.wxss
  48. 6 0
      miniprogram/envList.js
  49. 11 0
      miniprogram/images/arrow.svg
  50. BIN
      miniprogram/images/avatar.png
  51. BIN
      miniprogram/images/cloud_backend.png
  52. BIN
      miniprogram/images/cloud_backend_info.png
  53. BIN
      miniprogram/images/cloud_backend_login.png
  54. BIN
      miniprogram/images/cloud_dev.png
  55. BIN
      miniprogram/images/create_env.png
  56. BIN
      miniprogram/images/database.png
  57. BIN
      miniprogram/images/database_add.png
  58. BIN
      miniprogram/images/default-goods-image.png
  59. BIN
      miniprogram/images/deploy_step1.png
  60. BIN
      miniprogram/images/deploy_step2.png
  61. BIN
      miniprogram/images/env-select.png
  62. BIN
      miniprogram/images/function_deploy.png
  63. BIN
      miniprogram/images/icons/avatar.png
  64. BIN
      miniprogram/images/icons/business-active.png
  65. BIN
      miniprogram/images/icons/business.png
  66. BIN
      miniprogram/images/icons/close.png
  67. BIN
      miniprogram/images/icons/copy.png
  68. 3 0
      miniprogram/images/icons/customer-service.svg
  69. BIN
      miniprogram/images/icons/examples-active.png
  70. BIN
      miniprogram/images/icons/examples.png
  71. BIN
      miniprogram/images/icons/goods-active.png
  72. BIN
      miniprogram/images/icons/goods.png
  73. BIN
      miniprogram/images/icons/home-active.png
  74. BIN
      miniprogram/images/icons/home.png
  75. 5 0
      miniprogram/images/icons/question.svg
  76. 4 0
      miniprogram/images/icons/setting.svg
  77. 4 0
      miniprogram/images/icons/share.svg
  78. BIN
      miniprogram/images/icons/usercenter-active.png
  79. BIN
      miniprogram/images/icons/usercenter.png
  80. BIN
      miniprogram/images/list-database.png
  81. BIN
      miniprogram/images/list-init.png
  82. BIN
      miniprogram/images/list-scf.png
  83. BIN
      miniprogram/images/list-share.png
  84. BIN
      miniprogram/images/scf-enter.png
  85. BIN
      miniprogram/images/single_template.png
  86. BIN
      miniprogram/images/single_template_info.png
  87. BIN
      miniprogram/images/single_template_sample.png
  88. 89 0
      miniprogram/pages/behavior-scene/scene-ready.js
  89. 75 0
      miniprogram/pages/behavior-scene/util.js
  90. 171 0
      miniprogram/pages/business/index.js
  91. 6 0
      miniprogram/pages/business/index.json
  92. 29 0
      miniprogram/pages/business/index.wxml
  93. 142 0
      miniprogram/pages/business/index.wxss
  94. 614 0
      miniprogram/pages/cloudbaseModuleDetail/index.js
  95. 7 0
      miniprogram/pages/cloudbaseModuleDetail/index.json
  96. 213 0
      miniprogram/pages/cloudbaseModuleDetail/index.wxml
  97. 153 0
      miniprogram/pages/cloudbaseModuleDetail/index.wxss
  98. 21 0
      miniprogram/pages/cloudbaseModuleGuide/index.js
  99. 3 0
      miniprogram/pages/cloudbaseModuleGuide/index.json
  100. 23 0
      miniprogram/pages/cloudbaseModuleGuide/index.wxml

+ 7 - 0
cloudfunctions/quickstartFunctions/config.json

@@ -0,0 +1,7 @@
+{
+  "permissions": {
+    "openapi": [
+      "wxacode.get"
+    ]
+  }
+}

+ 56 - 0
cloudfunctions/quickstartFunctions/createCollection/index.js

@@ -0,0 +1,56 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+const db = cloud.database();
+
+// 创建集合云函数入口函数
+exports.main = async (event, context) => {
+  try {
+    // 创建集合
+    await db.createCollection('sales');
+    await db.collection('sales').add({
+      // data 字段表示需新增的 JSON 数据
+      data: {
+        region: '华东',
+        city: '上海',
+        sales: 11
+      }
+    });
+    await db.collection('sales').add({
+      // data 字段表示需新增的 JSON 数据
+      data: {
+        region: '华东',
+        city: '南京',
+        sales: 11
+      }
+    });
+    await db.collection('sales').add({
+      // data 字段表示需新增的 JSON 数据
+      data: {
+        region: '华南',
+        city: '广州',
+        sales: 22
+      }
+    });
+    await db.collection('sales').add({
+      // data 字段表示需新增的 JSON 数据
+      data: {
+        region: '华南',
+        city: '深圳',
+        sales: 22
+      }
+    });
+    return {
+      success: true
+    };
+  } catch (e) {
+    // 这里catch到的是该collection已经存在,从业务逻辑上来说是运行成功的,所以catch返回success给前端,避免工具在前端抛出异常
+    return {
+      success: true,
+      data: 'create collection success'
+    };
+  }
+};

+ 27 - 0
cloudfunctions/quickstartFunctions/fetchGoodsList/index.js

@@ -0,0 +1,27 @@
+const cloud = require('wx-server-sdk');
+cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV });
+exports.main = async (event, context) => {
+  return {
+    dataList: [
+      { _id: '1', title: '微信气泡徽章', price: 1800 },
+      { _id: '2', title: '微信地球鼠标垫', price: 5800 },
+      { _id: '3', title: '微信黄脸大贴纸', price: 500 }
+    ],
+  }
+};
+
+// const cloud = require('wx-server-sdk');
+// cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV });
+
+// const db = cloud.database();
+
+// exports.main = async (event, context) => {
+//   const result = await db.collection('goods')
+//     .skip(0)
+//     .limit(10)
+//     .get();
+//   return {
+//     dataList: result?.data,
+//   };
+// };
+        

+ 18 - 0
cloudfunctions/quickstartFunctions/genMpQrcode/index.js

@@ -0,0 +1,18 @@
+const cloud = require('wx-server-sdk');
+cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV });
+
+exports.main = async (event, context) => {
+  const pagePath = event.pagePath;
+  // 获取小程序二维码的buffer
+  const resp = await cloud.openapi.wxacode.get({
+    path: pagePath,
+  });
+  const { buffer } = resp;
+  // 将图片上传云存储空间
+  const upload = await cloud.uploadFile({
+    cloudPath: String(pagePath).replace(/\//g, '_') + '.png',
+    fileContent: buffer
+  });
+  return upload.fileID;
+};
+        

+ 20 - 0
cloudfunctions/quickstartFunctions/getMiniProgramCode/index.js

@@ -0,0 +1,20 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+// 获取小程序二维码云函数入口函数
+exports.main = async (event, context) => {
+  // 获取小程序二维码的buffer
+  const resp = await cloud.openapi.wxacode.get({
+    path: 'pages/index/index'
+  });
+  const { buffer } = resp;
+  // 将图片上传云存储空间
+  const upload = await cloud.uploadFile({
+    cloudPath: 'code.png',
+    fileContent: buffer
+  });
+  return upload.fileID;
+};

+ 17 - 0
cloudfunctions/quickstartFunctions/getOpenId/index.js

@@ -0,0 +1,17 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+// 获取openId云函数入口函数
+exports.main = async (event, context) => {
+  // 获取基础信息
+  const wxContext = cloud.getWXContext();
+
+  return {
+    openid: wxContext.OPENID,
+    appid: wxContext.APPID,
+    unionid: wxContext.UNIONID,
+  };
+};

+ 31 - 0
cloudfunctions/quickstartFunctions/index.js

@@ -0,0 +1,31 @@
+const getOpenId = require('./getOpenId/index');
+const getMiniProgramCode = require('./getMiniProgramCode/index');
+const createCollection = require('./createCollection/index');
+const selectRecord = require('./selectRecord/index');
+const updateRecord = require('./updateRecord/index');
+const sumRecord = require('./sumRecord/index');
+const fetchGoodsList = require('./fetchGoodsList/index');
+const genMpQrcode = require('./genMpQrcode/index');
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+  switch (event.type) {
+    case 'getOpenId':
+      return await getOpenId.main(event, context);
+    case 'getMiniProgramCode':
+      return await getMiniProgramCode.main(event, context);
+    case 'createCollection':
+      return await createCollection.main(event, context);
+    case 'selectRecord':
+      return await selectRecord.main(event, context);
+    case 'updateRecord':
+      return await updateRecord.main(event, context);
+    case 'sumRecord':
+      return await sumRecord.main(event, context);
+    case 'fetchGoodsList':
+      return await fetchGoodsList.main(event, context);
+    case 'genMpQrcode':
+      return await genMpQrcode.main(event, context);
+  }
+};
+        

+ 14 - 0
cloudfunctions/quickstartFunctions/package.json

@@ -0,0 +1,14 @@
+{
+  "name": "quickstartFunctions",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "wx-server-sdk": "~2.4.0"
+  }
+}

+ 12 - 0
cloudfunctions/quickstartFunctions/selectRecord/index.js

@@ -0,0 +1,12 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+
+// 查询数据库集合云函数入口函数
+exports.main = async (event, context) => {
+  // 返回数据库查询结果
+  return await db.collection('sales').get();
+};

+ 18 - 0
cloudfunctions/quickstartFunctions/sumRecord/index.js

@@ -0,0 +1,18 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+const $ = db.command.aggregate;
+
+// 聚合记录云函数入口函数
+exports.main = async (event, context) => {
+  // 返回数据库聚合结果
+  return db.collection('sales').aggregate()
+    .group({
+      _id: '$region',
+      sum: $.sum('$sales')
+    })
+    .end();
+};

+ 32 - 0
cloudfunctions/quickstartFunctions/updateRecord/index.js

@@ -0,0 +1,32 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+
+// 修改数据库信息云函数入口函数
+exports.main = async (event, context) => {
+  try {
+    // 遍历修改数据库信息
+    for (let i = 0; i < event.data.length; i++) {
+      await db.collection('sales').where({
+        _id: event.data[i]._id
+      })
+        .update({
+          data: {
+            sales: event.data[i].sales
+          },
+        });
+    }
+    return {
+      success: true,
+      data: event.data
+    };
+  } catch (e) {
+    return {
+      success: false,
+      errMsg: e
+    };
+  }
+};

+ 21 - 0
miniprogram/app.js

@@ -0,0 +1,21 @@
+// app.js
+App({
+  onLaunch: function () {
+    if (!wx.cloud) {
+      console.error("请使用 2.2.3 或以上的基础库以使用云能力");
+    } else {
+      wx.cloud.init({
+        // env 参数说明:
+        //   env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
+        //   此处请填入环境 ID, 环境 ID 可打开云控制台查看
+        //   如不填则使用默认环境(第一个创建的环境)
+        env: "",
+        traceUser: true,
+      });
+    }
+
+    this.globalData = {
+      url:"https://mp.ghz-tech.com/yx/"
+    };
+  },
+});

+ 34 - 0
miniprogram/app.json

@@ -0,0 +1,34 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/saomiao1/index",
+    "pages/saomiao2/index",
+    "pages/xr-ar-basic/index",
+    "pages/xr-template-share/index",
+    "pages/goods-list/index",
+    "pages/examples/index",
+    "pages/user-center/index",
+    "pages/exampleDetail/index",
+    "pages/deployService/index",
+    "pages/updateRecord/index",
+    "pages/updateRecordResult/index",
+    "pages/updateRecordSuccess/index",
+    "pages/sumRecord/index",
+    "pages/sumRecordResult/index",
+    "pages/web/index",
+    "pages/cloudbaseModuleDetail/index",
+    "pages/cloudbaseModuleInstallTips/index",
+    "pages/cloudbaseModuleGuide/index",
+    "pages/business/index"
+  ],
+  "window": {
+    "backgroundColor": "#F6F6F6",
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#F6F6F6",
+    "navigationBarTitleText": "五仙观奇谈",
+    "navigationBarTextStyle": "black"
+  },
+  "sitemapLocation": "sitemap.json",
+  "style": "v2",
+  "lazyCodeLoading": "requiredComponents"
+}

+ 27 - 0
miniprogram/app.wxss

@@ -0,0 +1,27 @@
+/**app.wxss**/
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  box-sizing: border-box;
+} 
+
+button {
+  background: initial;
+}
+
+button:focus{
+  outline: 0;
+}
+
+button::after{
+  border: none;
+}
+
+
+page {
+  background: #f6f6f6;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-start;
+}

+ 48 - 0
miniprogram/common/share-behavior.js

@@ -0,0 +1,48 @@
+export default Behavior({
+  created: function () {
+    this.checkInitShare();
+  },
+  methods: {
+    checkInitShare() {
+      wx.xrScene = undefined;
+
+      if (!this.scene) {
+        setTimeout(() => {
+          this.checkInitShare()
+        }, 100);
+        return;
+      }
+
+      if (this.scene.ar) {
+        if (this.scene.ar.ready) {
+          this.initARTrackerState(this.scene);    
+        } else { 
+          this.scene.event.add('ar-ready', () => this.initARTrackerState(this.scene));
+        }
+      }
+
+      if (!this.scene.share.supported) {
+        console.warn('Not support xr-frame share system now!');
+        return;
+      }
+
+      this.sharing = false;
+      wx.xrScene = this.scene;
+    },
+    initARTrackerState(scene) {
+      const xrFrameSystem = wx.getXrFrameSystem();
+      scene.dfs(() => {}, undefined, true, el => {
+        const comp = el.getComponent(xrFrameSystem.ARTracker);
+        if (comp) {
+          if (typeof comp.state === 'number') {
+            this.triggerEvent('arTrackerState', {state: comp.state, error: comp.errorMessage});
+            el.event.add('ar-tracker-state', tracker => {
+              this.triggerEvent('arTrackerState', {state: tracker.state, error: tracker.errorMessage});
+            });
+          }
+          return true;
+        }
+      });
+    }
+  }
+})

+ 118 - 0
miniprogram/components/1/xr-ar-2dmarker/index.js

@@ -0,0 +1,118 @@
+const app = getApp();
+var url = app.globalData.url;
+Component({
+  behaviors: [require('../../../common/share-behavior').default],
+  properties: {
+    markerImg: {
+      type: String
+    },recordState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) { 
+        if (newVal !== oldVal) {
+        if (newVal === 1) {
+          this.recordStart();
+        } else if (newVal === 2)  {
+          this.recordEnd();
+        }
+      }
+      }
+    },captureState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) {
+        console.log("observer===>"+newVal);
+        this.capture();
+      }
+    },
+  },
+  data: {
+    loaded: false,
+    arReady: false,
+    loadedSaoMiao:false,
+    ar_1img:url+"targets/ar_1.png",
+    baseurl:url,
+  },
+  
+  lifetimes: {
+    attached() {
+      console.log('data', this.data)
+    }
+  },
+  methods: {
+    handleReady({
+      detail
+    }) {
+      const xrScene = this.scene = detail.value;
+      console.log('xr-scene', xrScene);
+    },
+    handleAssetsProgress: function ({
+      detail
+    }) {
+      console.log('assets progress', detail.value);
+    },handleTrackerSwitch: function ({detail}) {
+      const active = detail.value;
+      if(active)
+      {       
+        this.triggerEvent('assetsstr',true);
+        
+        this.setData({loadedSaoMiao: true});
+       // this.scene.share.captureToFriends();
+      }
+    },handleARTrackerState({detail}) {
+    },
+    handleAnimationStop: function() {
+      console.log('animation Stop');
+    },
+    handleAssetsLoaded: function ({
+      detail
+    }) {
+      console.log('assets loaded', detail.value);
+      this.setData({
+        loaded: true
+      });
+
+    },
+    handleARReady: function ({
+      detail
+    }) {
+      console.log('arReady');
+      this.setData({
+        arReady: true
+      })
+    },
+    capture: function () {
+      this.scene.share.captureToFriends({
+        fileType: this.data.captureType,
+        quality: this.data.captureQuality
+      });
+    },
+    recordStart() {
+      console.log('recordStart') 
+      wx.updateShareMenu({
+        withShareTicket: true,
+        success () { }
+      })
+      this.scene.share.recordStart({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+    },
+    recordEnd() {
+      console.log('recordEnd')
+     
+      
+      //
+      const tempFilePath =  this.scene.share.recordFinishToAlbum({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+      wx.shareVideoMessage({
+        videoPath: tempFilePath,
+      });
+      wx.showToast({
+        title: '视频已经保存至相册',
+      });
+    }
+  }
+})

+ 5 - 0
miniprogram/components/1/xr-ar-2dmarker/index.json

@@ -0,0 +1,5 @@
+{
+  "component": true,
+  "usingComponents": {},
+  "renderer": "xr-frame"
+}

+ 23 - 0
miniprogram/components/1/xr-ar-2dmarker/index.wxml

@@ -0,0 +1,23 @@
+<xr-scene ar-system="modes:Marker" id="xr-scene" bind:ready="handleReady" bind:ar-ready="handleARReady">
+  <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
+    <xr-asset-load type="gltf" asset-id="gltf" src="{{baseurl}}StreamingAssets/ui/liumianyinzhang.glb" />
+    <xr-asset-load type="gltf" asset-id="arrow" src="{{baseurl}}model/direction_arrow.glb" />
+   
+  </xr-assets>
+  <xr-env env-data="xr-frame-team-workspace-day" />
+  <xr-node wx:if="{{arReady}}">
+    <xr-ar-tracker mode="Marker" src="{{ar_1img}}" bind:ar-tracker-switch="handleTrackerSwitch"
+      bind:ar-tracker-state="handleARTrackerState">
+      <xr-gltf model="gltf" anim-autoplay position="0 0.8 0" scale="2 2 2" rotation="-90 0 0" />
+      <xr-gltf model="arrow" anim-autoplay position="0.5 0.8 0.5" scale="0.3 0.3 0.3" rotation="0 0 45" />
+    </xr-ar-tracker>
+    <xr-camera
+      id="camera" node-id="camera" position="0.8 2.2 -5" clear-color="0.925 0.925 0.925 1"
+      background="ar" is-ar-camera
+    ></xr-camera>
+  </xr-node>
+  <xr-node node-id="lights">
+    <xr-light type="ambient" color="1 1 1" intensity="1" />
+    <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
+  </xr-node>
+</xr-scene>

+ 1 - 0
miniprogram/components/1/xr-ar-2dmarker/index.wxss

@@ -0,0 +1 @@
+/* xr/index.wxss */

+ 118 - 0
miniprogram/components/2/xr-ar-2dmarker/index.js

@@ -0,0 +1,118 @@
+const app = getApp();
+var url = app.globalData.url;
+Component({
+  behaviors: [require('../../../common/share-behavior').default],
+  properties: {
+    markerImg: {
+      type: String
+    },recordState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) { 
+        if (newVal !== oldVal) {
+        if (newVal === 1) {
+          this.recordStart();
+        } else if (newVal === 2)  {
+          this.recordEnd();
+        }
+      }
+      }
+    },captureState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) {
+        console.log("observer===>"+newVal);
+        this.capture();
+      }
+    },
+  },
+  data: {
+    loaded: false,
+    arReady: false,
+    loadedSaoMiao:false,
+    ar_2img:url+"targets/ar_2.png",
+    baseurl:url,
+  },
+  
+  lifetimes: {
+    attached() {
+      console.log('data', this.data)
+    }
+  },
+  methods: {
+    handleReady({
+      detail
+    }) {
+      const xrScene = this.scene = detail.value;
+      console.log('xr-scene', xrScene);
+    },
+    handleAssetsProgress: function ({
+      detail
+    }) {
+      console.log('assets progress', detail.value);
+    },handleTrackerSwitch: function ({detail}) {
+      const active = detail.value;
+      if(active)
+      {       
+        this.triggerEvent('assetsstr',true);
+        
+        this.setData({loadedSaoMiao: true});
+       // this.scene.share.captureToFriends();
+      }
+    },handleARTrackerState({detail}) {
+    },
+    handleAnimationStop: function() {
+      console.log('animation Stop');
+    },
+    handleAssetsLoaded: function ({
+      detail
+    }) {
+      console.log('assets loaded', detail.value);
+      this.setData({
+        loaded: true
+      });
+
+    },
+    handleARReady: function ({
+      detail
+    }) {
+      console.log('arReady');
+      this.setData({
+        arReady: true
+      })
+    },
+    capture: function () {
+      this.scene.share.captureToFriends({
+        fileType: this.data.captureType,
+        quality: this.data.captureQuality
+      });
+    },
+    recordStart() {
+      console.log('recordStart') 
+      wx.updateShareMenu({
+        withShareTicket: true,
+        success () { }
+      })
+      this.scene.share.recordStart({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+    },
+    recordEnd() {
+      console.log('recordEnd')
+     
+      
+      //
+      const tempFilePath =  this.scene.share.recordFinishToAlbum({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+      wx.shareVideoMessage({
+        videoPath: tempFilePath,
+      });
+      wx.showToast({
+        title: '视频已经保存至相册',
+      });
+    }
+  }
+})

+ 5 - 0
miniprogram/components/2/xr-ar-2dmarker/index.json

@@ -0,0 +1,5 @@
+{
+  "component": true,
+  "usingComponents": {},
+  "renderer": "xr-frame"
+}

+ 20 - 0
miniprogram/components/2/xr-ar-2dmarker/index.wxml

@@ -0,0 +1,20 @@
+<xr-scene ar-system="modes:Marker" id="xr-scene" bind:ready="handleReady" bind:ar-ready="handleARReady">
+  <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
+    <xr-asset-load type="gltf" asset-id="gltf" src="{{baseurl}}StreamingAssets/ui/xihanyuying.glb" />
+  </xr-assets>
+  <xr-env env-data="xr-frame-team-workspace-day" />
+  <xr-node wx:if="{{arReady}}">
+    <xr-ar-tracker mode="Marker" src="{{ar_2img}}" bind:ar-tracker-switch="handleTrackerSwitch"
+      bind:ar-tracker-state="handleARTrackerState">
+      <xr-gltf model="gltf" anim-autoplay position="0 0.8 0" scale="2 2 2" rotation="0 0 0" />
+    </xr-ar-tracker>
+    <xr-camera
+      id="camera" node-id="camera" position="0.8 2.2 -5" clear-color="0.925 0.925 0.925 1"
+      background="ar" is-ar-camera
+    ></xr-camera>
+  </xr-node>
+  <xr-node node-id="lights">
+    <xr-light type="ambient" color="1 1 1" intensity="1" />
+    <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
+  </xr-node>
+</xr-scene>

+ 1 - 0
miniprogram/components/2/xr-ar-2dmarker/index.wxss

@@ -0,0 +1 @@
+/* xr/index.wxss */

+ 28 - 0
miniprogram/components/cloudTipModal/index.js

@@ -0,0 +1,28 @@
+Component({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    showTip: false,
+  },
+  properties: {
+    showTipProps: Boolean,
+    title:String,
+    content:String
+  },
+  observers: {
+    showTipProps: function(showTipProps) {
+      this.setData({
+        showTip: showTipProps
+      });
+    }
+  },
+  methods: {
+    onClose(){
+      this.setData({
+        showTip: !this.data.showTip
+      });
+    },
+  }
+});

+ 4 - 0
miniprogram/components/cloudTipModal/index.json

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

+ 10 - 0
miniprogram/components/cloudTipModal/index.wxml

@@ -0,0 +1,10 @@
+<!--miniprogram/components/cloudTipModal/index.wxml-->
+<!--  wx:if="{{showUploadTip}}" -->
+<view class="install_tip" wx:if="{{showTip}}">
+  <view class="install_tip_back"></view>
+  <view class="install_tip_detail">
+    <image class="install_tip_close" bind:tap="onClose" src="../../images/icons/close.png"/>
+    <view class="install_tip_detail_title">{{title}}</view>
+    <view class="install_tip_detail_tip">{{content}}</view>
+  </view>
+</view>

+ 60 - 0
miniprogram/components/cloudTipModal/index.wxss

@@ -0,0 +1,60 @@
+.install_tip_back {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background-color: rgba(0,0,0,0.4);
+  z-index: 1;
+}
+.install_tip_close{
+  position:absolute;
+  right: 10rpx;
+  top: 10rpx;
+  width: 32px;
+  height: 32px;
+  /* background-color: red; */
+}
+.install_tip_detail {
+  position: fixed;
+  background-color: white;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  border-radius: 40rpx 40rpx 0 0;
+  padding: 50rpx 50rpx 100rpx 50rpx;
+  z-index: 9;
+}
+
+.install_tip_detail_title {
+  font-weight: 400;
+  font-size: 40rpx;
+  text-align: center;
+}
+
+.install_tip_detail_tip {
+  font-size: 25rpx;
+  color: rgba(0,0,0,0.4);
+  margin-top: 20rpx;
+  text-align: left;
+}
+.install_tip_detail_buttons {
+  padding-top: 50rpx;
+  display: flex;
+}
+.install_tip_detail_button {
+  color: #07C160;
+  font-weight: 500;
+  background-color: rgba(0,0,0,0.1);
+  width: 40%;
+  text-align: center;
+  /* height: 90rpx; */
+  /* line-height: 90rpx; */
+  border-radius: 10rpx;
+  margin: 0 auto;
+}
+
+.install_tip_detail_button_primary {
+  background-color: #07C160;
+  color: #fff;
+}

+ 39 - 0
miniprogram/components/cloudbaseModuleInstallModal/index.js

@@ -0,0 +1,39 @@
+Component({
+  data: {
+    modalVisible: false,
+    tipText: '云开发>云模板>模板中心',
+  },
+  properties: {
+    installModulePageTitleProps: String,
+    modalVisibleProps: Boolean,
+    tipTextProps: String,
+    installModuleNameProps: String,
+  },
+  observers: {
+    modalVisibleProps: function (modalVisibleProps) {
+      this.setData({
+        modalVisible: modalVisibleProps,
+      });
+    },
+    tipTextProps: function (tipTextProps) {
+      this.setData({
+        tipText: tipTextProps,
+      });
+    },
+  },
+  methods: {
+    hideModal() {
+      if (this.data.modalVisible) {
+        this.setData({
+          modalVisible: false,
+        });
+      }
+    },
+    onViewDetail() {
+      this.hideModal();
+      wx.navigateTo({
+        url: `/pages/cloudbaseModuleInstallTips/index?moduleName=${this.properties.installModuleNameProps}&title=${this.properties.installModulePageTitleProps}`,
+      });
+    },
+  },
+});

+ 4 - 0
miniprogram/components/cloudbaseModuleInstallModal/index.json

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

+ 11 - 0
miniprogram/components/cloudbaseModuleInstallModal/index.wxml

@@ -0,0 +1,11 @@
+<!-- miniprogram/components/cloudTipModal/index.wxml -->
+<view class="install_tip" wx:if="{{ modalVisible }}">
+	<view class="install_tip_back" bindtap="hideModal" />
+	<view class="install_tip_detail">
+		<view class="install_tip_detail_title">体验前需安装云模板</view>
+		<view class="install_tip_detail_tip">请按照以下路径安装对应云模板</view>
+		<view class="install_tip_detail_shell">{{ tipText }}</view>
+		<view bindtap="onViewDetail" class="install_tip_detail_button">查看详情{{ installModuleName }}</view>
+	</view>
+</view>
+

+ 57 - 0
miniprogram/components/cloudbaseModuleInstallModal/index.wxss

@@ -0,0 +1,57 @@
+.install_tip_back {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background-color: rgba(0,0,0,0.4);
+  z-index: 1;
+}
+
+.install_tip_detail {
+  position: fixed;
+  background-color: white;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  top: 60%;
+  border-radius: 40rpx 40rpx 0 0;
+  padding: 50rpx;
+  z-index: 9;
+}
+
+.install_tip_detail_title {
+  font-weight: 400;
+  font-size: 40rpx;
+  text-align: center;
+}
+
+.install_tip_detail_tip {
+  font-size: 25rpx;
+  color: rgba(0,0,0,0.4);
+  margin-top: 20rpx;
+  text-align: center;
+}
+
+.install_tip_detail_shell {
+  margin: 70rpx 0;
+  display: flex;
+  justify-content: center;
+}
+
+.install_tip_detail_copy {
+  color: #546488;
+  margin-left: 10rpx;
+}
+
+.install_tip_detail_button {
+  color: #07C160;
+  font-weight: 500;
+  background-color: rgba(0,0,0,0.1);
+  width: 60%;
+  text-align: center;
+  height: 90rpx;
+  line-height: 90rpx;
+  border-radius: 10rpx;
+  margin: 0 auto;
+}

+ 24 - 0
miniprogram/components/cloudbaseModuleInstallPath/index.js

@@ -0,0 +1,24 @@
+// components/cloudbaseModuleInstallPath/index.js
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    installModuleName: String,
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
miniprogram/components/cloudbaseModuleInstallPath/index.json

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

+ 1 - 0
miniprogram/components/cloudbaseModuleInstallPath/index.wxml

@@ -0,0 +1 @@
+<view class="tip">可以在“云开发>云模板>模板中心>{{installModuleName}}”找到该模板</view>

+ 7 - 0
miniprogram/components/cloudbaseModuleInstallPath/index.wxss

@@ -0,0 +1,7 @@
+.tip {
+  font-size: 23rpx;
+  color: rgba(0, 0, 0, 0.5);
+  width: 90%;
+  text-align: center;
+  margin: 30rpx auto 0 auto;
+}

+ 21 - 0
miniprogram/components/mpCodeModal/index.js

@@ -0,0 +1,21 @@
+Component({
+  data: {
+    modalVisible: false,
+  },
+  properties: {
+    visible: Boolean,
+    imageSrc: String,
+  },
+  observers: {
+    visible: function (visible) {
+      this.setData({
+        modalVisible: visible
+      });
+    },
+  },
+  methods: {
+    onClose() {
+      this.setData({ modalVisible: false });
+    }
+  }
+});

+ 4 - 0
miniprogram/components/mpCodeModal/index.json

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

+ 8 - 0
miniprogram/components/mpCodeModal/index.wxml

@@ -0,0 +1,8 @@
+<view class="modal_container" wx:if="{{ modalVisible }}">
+  <view class="icon_close" bind:tap="onClose">
+    <view>X</view>
+  </view>
+  <view class="image_container">
+    <image class="code_img" src="{{ imageSrc }}" />
+  </view>
+</view>

+ 95 - 0
miniprogram/components/mpCodeModal/index.wxss

@@ -0,0 +1,95 @@
+.modal_container {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background-color: rgba(0,0,0,0.4);
+  z-index: 1;
+  width: 100%;
+  height: 100%;
+}
+
+.icon_close {
+  position: fixed;
+  right: 40rpx;
+  top: 40rpx;
+  width: 70rpx;
+  height: 70rpx;
+  border-radius: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  /* background-color: #07c160; */
+  background-color: rgba(0,0,0,0.7);
+  color: white;
+  font-size: 32rpx;
+  font-weight: bold;
+}
+
+.code_img {
+  width: 400rpx;
+  height: 400rpx;
+  margin-top: 50%;
+  margin-left: 50%;
+  transform: translateX(-50%);
+  border-radius: 30rpx;
+}
+
+.install_tip_back {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background-color: rgba(0,0,0,0.4);
+  z-index: 1;
+}
+
+.install_tip_detail {
+  position: fixed;
+  background-color: white;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  top: 60%;
+  border-radius: 40rpx 40rpx 0 0;
+  padding: 50rpx;
+  z-index: 9;
+}
+
+.install_tip_detail_title {
+  font-weight: 400;
+  font-size: 40rpx;
+  text-align: center;
+}
+
+.install_tip_detail_tip {
+  font-size: 25rpx;
+  color: rgba(0,0,0,0.4);
+  margin-top: 20rpx;
+  text-align: center;
+}
+
+.install_tip_detail_shell {
+  margin: 70rpx 0;
+  display: flex;
+  justify-content: center;
+}
+
+.install_tip_detail_copy {
+  color: #546488;
+  margin-left: 10rpx;
+}
+
+.install_tip_detail_button {
+  color: #07C160;
+  font-weight: 500;
+  background-color: rgba(0,0,0,0.1);
+  width: 60%;
+  text-align: center;
+  height: 90rpx;
+  line-height: 90rpx;
+  border-radius: 10rpx;
+  margin: 0 auto;
+}

+ 133 - 0
miniprogram/components/xr-demo-viewer/index.js

@@ -0,0 +1,133 @@
+Component({
+  properties: {
+    title: {
+      type: String,
+      value: '',
+    },
+    intro: {
+      type: String,
+      value: '',
+    },
+    hint: {
+      type: String,
+      value: '',
+    },
+    code: {
+      type: String,
+      value: '',
+    },
+    json: {
+      type: String,
+      value: '',
+    },
+    js: {
+      type: String,
+      value: '',
+    },
+    showBackBtn: {
+      type: Boolean,
+      value: false,
+    },
+    recordState: 0,
+  },
+  data: {
+  },
+  lifetimes: {
+    attached() {
+      wx.xrTitle = this.data.title;
+    }
+  },
+  captureQuality: {
+    type: Number,
+    value: 0.8,
+  },
+  captureType: {
+    type: String,
+    value: 'jpg',
+  },
+  recordFPS: {
+    type: Number,
+    value: 30,
+  },
+  methods: {
+    recordStart() {
+      console.log('recordStart') 
+      wx.updateShareMenu({
+        withShareTicket: true,
+        success () { }
+      })
+      this.scene.share.recordStart({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+    },
+    recordEnd() {
+      console.log('recordEnd')
+      const tempFilePath =  this.scene.share.recordFinishToAlbum({
+        fps: 15,
+        videoBitsPerSecond: 10000,
+      });
+      wx.shareVideoMessage({
+        videoPath: tempFilePath,
+      });
+    },
+    onClickBack() {
+      wx.navigateBack()
+    },
+    /**
+     * 获取系统信息 设置相机的大小适应屏幕
+     */
+    setCameraSize() {
+      //获取设备信息
+      const res =  wx.getSystemSetting();
+      //获取屏幕的可使用宽高,设置给相机
+      this.setData({
+        cameraHeight: res.windowHeight,
+        cameraWidth: res.windowWidth
+      })
+      console.log(res)
+    },
+  
+  
+    /**
+     * 开始录像的方法
+     */
+    startShootVideo() {
+  
+      console.log("========= 调用开始录像 ===========")
+      this.ctx.startRecord({
+        success: (res) => {
+          wx.showLoading({
+            title: '正在录像',
+          })
+        },
+        fail() {
+          console.log("========= 调用开始录像失败 ===========")
+        }
+      })
+    },
+  
+    /**
+     * 结束录像
+     */
+    stopShootVideo() {
+  
+      console.log("========= 调用结束录像 ===========")
+      this.ctx.stopRecord({
+        success: (res) => {
+          wx.hideLoading();
+          this.setData({
+            videoSrc: res.tempVideoPath,
+          })
+        },
+        fail() {
+          wx.hideLoading();
+          console.log("========= 调用结束录像失败 ===========")
+        }
+      })
+    }
+  },
+  options: {
+    multipleSlots: true
+  }
+})

+ 4 - 0
miniprogram/components/xr-demo-viewer/index.json

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

+ 54 - 0
miniprogram/components/xr-demo-viewer/index.wxml

@@ -0,0 +1,54 @@
+
+<view class="demo-wrap">
+  <scroll-view class="demo-viewer" scroll-y="{{false}}" 
+        recordState="{{recordState}}">
+    <block bind:sceneReady="handleSceneReady">
+      <slot></slot>
+    </block>
+    
+    <view wx:if="{{hint.length > 0}}">
+      <view class="hint-wrap">
+        <text class="hint-words" >{{hint}}</text>
+      </view>
+    </view>
+    <view wx:if="{{code.length > 0}}">
+      <view class="intro">
+        <view class="intro-detail">
+          <view class="title">代码演示</view>
+          <view class="code-inner">
+            <rich-text nodes="{{code}}"></rich-text>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view wx:if="{{js.length > 0}}">
+      <view class="intro">
+        <view class="intro-detail">
+          <view class="title">脚本演示</view>
+          <view class="code-inner">
+            <rich-text nodes="{{js}}"></rich-text>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view wx:if="{{json.length > 0}}">
+      <view class="intro">
+        <view class="intro-detail">
+          <view class="title">动画数据结构</view>
+          <view class="code-inner">
+            <rich-text nodes="{{json}}"></rich-text>
+          </view>
+        </view>
+      </view>
+      
+    </view>
+    
+    <view class="holder"></view>
+    
+  </scroll-view>
+  <view class="back-btn-wrap" wx:if="{{showBackBtn}}" bind:tap="onClickBack">
+    <view class="back-line-t"></view>
+    <view class="back-line-b"></view>
+  </view>
+  
+</view>

+ 129 - 0
miniprogram/components/xr-demo-viewer/index.wxss

@@ -0,0 +1,129 @@
+.demo-wrap {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.demo-viewer {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.holder {
+  height: 60rpx;
+}
+
+.hint-wrap {
+  text-align: center;
+}
+
+.hint-words {
+  display: block;
+  font-size: 14px;
+  color: #000;
+  text-align: center;
+  font-weight: normal;
+  margin: 10px 20px;
+  padding: 10px;
+  border-radius: 5px;
+  border: 1px dashed #000;
+  background-color: #fff;
+}
+
+.intro {
+  display: block;
+  margin: 20rpx 0;
+  background: #fff;
+}
+
+.intro .title {
+  font-size: 36rpx;
+  padding-bottom: 20rpx;
+}
+
+.intro .description {
+  color: #8f8f8f;
+  font-size: 28rpx;
+}
+
+.intro-detail {
+  padding: 30rpx;
+}
+
+
+.code-inner {
+  margin: 0rpx;
+  padding: 30rpx;
+  font-size: 30rpx;
+  background-color: #f9f9fa;
+}
+
+.code-inner rich-text {
+  word-wrap: break-word;
+}
+
+.block-name {
+  display: inline-block;
+  color: #b457ff;
+}
+
+.attr-name {
+  display: inline-block;
+  color: #ff4d00;
+}
+
+.ml20 {
+  margin-left: 20rpx;
+}
+
+.intro-title {
+  font-size: 30rpx;
+  font-weight: bold;
+  display: flex;
+  justify-content: space-between;
+  align-items: baseline;
+  margin-bottom: 24rpx;
+}
+
+.share {
+  margin: 0 !important;
+  margin-left: 0 !important;
+  margin-right: 0 !important;
+  padding: 0;
+  width: 160rpx !important;
+  background: none;
+  font-size: 28rpx;
+  color: #ff4d00;
+}
+
+.back-btn-wrap {
+  position: absolute;
+  left: 30rpx;
+  top: 100rpx;
+  width: 90rpx;
+  height: 80rpx;
+}
+.back-line-t {
+  position: absolute;
+  left: 20rpx;
+  top: 15rpx;
+  width: 30rpx;
+  height: 6rpx;
+  background-color: #000;
+  transform: rotate(-45deg);
+  border-radius: 5rpx;
+}
+.back-line-b {
+  position: absolute;
+  left: 20rpx;
+  top: 32rpx;
+  width: 30rpx;
+  height: 6rpx;
+  background-color: #000;
+  transform: rotate(45deg);
+  border-radius: 5rpx;
+}

+ 26 - 0
miniprogram/components/xr-template-share/index.js

@@ -0,0 +1,26 @@
+Component({
+  behaviors: [require('../../common/share-behavior').default],
+  properties: {
+    a: Number,
+  },
+  data: {
+    loaded: false
+  },
+  lifetimes: {},
+  methods: {
+    handleReady({detail}) {
+      const xrScene = this.scene = detail.value;
+      console.log('xr-scene', xrScene);
+      this.scene.event.add('touchstart', this.handleShare.bind(this));
+    },
+    handleShare(event) {
+      const {clientX, clientY} = event.touches[0];
+      const {frameWidth: width, frameHeight: height} = this.scene;
+
+      if (clientY / height > 0.7 && clientX / width > 0.7) {
+        this.scene.share.captureToFriends();
+      }
+
+    }
+  }
+})

+ 5 - 0
miniprogram/components/xr-template-share/index.json

@@ -0,0 +1,5 @@
+{
+  "component": true,
+  "usingComponents": {},
+  "renderer": "xr-frame"
+}

+ 20 - 0
miniprogram/components/xr-template-share/index.wxml

@@ -0,0 +1,20 @@
+<xr-scene id="xr-scene" bind:ready="handleReady">
+  <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
+    <xr-asset-material asset-id="standard-mat" effect="standard" />
+  </xr-assets>
+  <xr-node>
+    <xr-mesh node-id="mesh-plane" position="0 -0.02 -4" rotation="0 0 0" scale="5 1 5" geometry="plane" material="standard-mat" uniforms="u_baseColorFactor:0.48 0.78 0.64 1" receive-shadow></xr-mesh>
+    <xr-mesh id="cube" node-id="mesh-cube" position="-1 0.5 -3.5" scale="1 1 1" rotation="0 45 0" geometry="cube" material="standard-mat" uniforms="u_baseColorFactor:0.298 0.764 0.85 1" cast-shadow></xr-mesh>
+    <xr-mesh node-id="mesh-cylinder" position="1 0.7 -3.5" scale="1 0.7 1" geometry="cylinder" material="standard-mat" uniforms="u_baseColorFactor:1 0.776 0.364 1" cast-shadow></xr-mesh>
+    <xr-mesh node-id="mesh-sphere" position="0 1.25 -5" scale="1.25 1.25 1.25" geometry="sphere" material="standard-mat" uniforms="u_baseColorFactor:0.937 0.176 0.368 1" cast-shadow></xr-mesh>
+    <xr-camera
+      id="camera" node-id="camera" position="0 1.6 0" clear-color="0.925 0.925 0.925 1"
+      target="mesh-sphere"
+      camera-orbit-control=""
+    ></xr-camera>
+  </xr-node>
+  <xr-node node-id="lights">
+    <xr-light type="ambient" color="1 1 1" intensity="1" />
+    <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="3" cast-shadow/>
+  </xr-node>
+</xr-scene>

+ 1 - 0
miniprogram/components/xr-template-share/index.wxss

@@ -0,0 +1 @@
+/* xr/index.wxss */

+ 6 - 0
miniprogram/envList.js

@@ -0,0 +1,6 @@
+const envList = [];
+const isMac = false;
+module.exports = {
+  envList,
+  isMac
+};

+ 11 - 0
miniprogram/images/arrow.svg

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="8px" height="14px" viewBox="0 0 8 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>☀ iOS/☀ 图标/线型/icons_outlined_arrow@3x</title>
+    <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.3">
+        <g id="4.列表/z.覆盖层/右边/箭头" transform="translate(-334.000000, -21.000000)" fill="#000000">
+            <g id="☀-iOS/☀-图标/线型/icons_outlined_arrow" transform="translate(332.000000, 16.000000)">
+                <path d="M2.45405845,6.58064919 L3.51471863,5.51998901 L9.29361566,11.298886 C9.68374096,11.6890113 9.6872014,12.318069 9.29361566,12.7116547 L3.51471863,18.4905518 L2.45405845,17.4298916 L7.87867966,12.0052704 L2.45405845,6.58064919 Z" id="Combined-Shape"></path>
+            </g>
+        </g>
+    </g>
+</svg>

BIN
miniprogram/images/avatar.png


BIN
miniprogram/images/cloud_backend.png


BIN
miniprogram/images/cloud_backend_info.png


BIN
miniprogram/images/cloud_backend_login.png


BIN
miniprogram/images/cloud_dev.png


BIN
miniprogram/images/create_env.png


BIN
miniprogram/images/database.png


BIN
miniprogram/images/database_add.png


BIN
miniprogram/images/default-goods-image.png


BIN
miniprogram/images/deploy_step1.png


BIN
miniprogram/images/deploy_step2.png


BIN
miniprogram/images/env-select.png


BIN
miniprogram/images/function_deploy.png


BIN
miniprogram/images/icons/avatar.png


BIN
miniprogram/images/icons/business-active.png


BIN
miniprogram/images/icons/business.png


BIN
miniprogram/images/icons/close.png


BIN
miniprogram/images/icons/copy.png


+ 3 - 0
miniprogram/images/icons/customer-service.svg

@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.95693 15.75H19.5V6H4.5V17.7974L6.95693 15.75ZM3.73808 20.3849C3.44499 20.6292 3 20.4208 3 20.0392V6C3 5.17157 3.67157 4.5 4.5 4.5H19.5C20.3284 4.5 21 5.17157 21 6V15.75C21 16.5784 20.3284 17.25 19.5 17.25H7.5L3.73808 20.3849Z" fill="black" fill-opacity="0.9"/>
+</svg>

BIN
miniprogram/images/icons/examples-active.png


BIN
miniprogram/images/icons/examples.png


BIN
miniprogram/images/icons/goods-active.png


BIN
miniprogram/images/icons/goods.png


BIN
miniprogram/images/icons/home-active.png


BIN
miniprogram/images/icons/home.png


+ 5 - 0
miniprogram/images/icons/question.svg

@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.0911 17.4C11.0911 16.9029 11.494 16.5 11.9911 16.5C12.4881 16.5 12.8911 16.9029 12.8911 17.4C12.8911 17.8971 12.4881 18.3 11.9911 18.3C11.494 18.3 11.0911 17.8971 11.0911 17.4Z" fill="black" fill-opacity="0.9"/>
+<path d="M11.9911 6.00915C9.98467 6.00915 8.35363 7.64019 8.35363 9.64665H9.85363C9.85363 8.46862 10.8131 7.50915 11.9911 7.50915C13.1692 7.50915 14.1286 8.46862 14.1286 9.64665C14.1286 10.4533 13.4619 11.2621 12.5917 11.6156L12.5878 11.6172C11.7935 11.945 11.2412 12.7262 11.2412 13.6387V15H12.7412V13.6387C12.7412 13.3474 12.9142 13.106 13.1585 13.0044C14.3995 12.4993 15.6286 11.248 15.6286 9.64665C15.6286 7.64019 13.9976 6.00915 11.9911 6.00915Z" fill="black" fill-opacity="0.9"/>
+<path d="M22.4912 12C22.4912 6.20101 17.7902 1.5 11.9912 1.5C6.19222 1.5 1.49121 6.20101 1.49121 12C1.49121 17.799 6.19222 22.5 11.9912 22.5C17.7902 22.5 22.4912 17.799 22.4912 12ZM20.9912 12C20.9912 16.9706 16.9618 21 11.9912 21C7.02065 21 2.99121 16.9706 2.99121 12C2.99121 7.02944 7.02065 3 11.9912 3C16.9618 3 20.9912 7.02944 20.9912 12Z" fill="black" fill-opacity="0.9"/>
+</svg>

+ 4 - 0
miniprogram/images/icons/setting.svg

@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M16.5002 12C16.5002 14.4853 14.4855 16.5 12.0002 16.5C9.51497 16.5 7.50025 14.4853 7.50025 12C7.50025 9.51472 9.51497 7.5 12.0002 7.5C14.4855 7.5 16.5002 9.51472 16.5002 12ZM15.0002 12C15.0002 10.3431 13.6571 9 12.0002 9C10.3434 9 9.00025 10.3431 9.00025 12C9.00025 13.6569 10.3434 15 12.0002 15C13.6571 15 15.0002 13.6569 15.0002 12Z" fill="black" fill-opacity="0.9"/>
+<path d="M12.0002 1.875L21.0935 6.9375V17.0625L12.0002 22.125L2.90698 17.0625V6.9375L12.0002 1.875ZM4.40698 7.8192V16.1808L12.0002 20.4082L19.5935 16.1808V7.8192L12.0002 3.59179L4.40698 7.8192Z" fill="black" fill-opacity="0.9"/>
+</svg>

+ 4 - 0
miniprogram/images/icons/share.svg

@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M3.43993 20.5601C3.72112 20.8413 4.10234 20.9995 4.5 21H19.5C19.8977 20.9995 20.2789 20.8413 20.5601 20.5601C20.8413 20.2789 20.9995 19.8977 21 19.5V12.75H19.5V19.5H4.5V4.5H11.25V3H4.5C4.10234 3.00054 3.72112 3.15874 3.43993 3.43993C3.15874 3.72112 3.00054 4.10234 3 4.5V19.5C3.00054 19.8977 3.15874 20.2789 3.43993 20.5601Z" fill="black" fill-opacity="0.9"/>
+<path d="M13.5 4.5V3H20.25C20.6642 3 21 3.33579 21 3.75V10.5H19.5V5.5605L13.0605 12L12 10.9395L18.4395 4.5H13.5Z" fill="black" fill-opacity="0.9"/>
+</svg>

BIN
miniprogram/images/icons/usercenter-active.png


BIN
miniprogram/images/icons/usercenter.png


BIN
miniprogram/images/list-database.png


BIN
miniprogram/images/list-init.png


BIN
miniprogram/images/list-scf.png


BIN
miniprogram/images/list-share.png


BIN
miniprogram/images/scf-enter.png


BIN
miniprogram/images/single_template.png


BIN
miniprogram/images/single_template_info.png


BIN
miniprogram/images/single_template_sample.png


+ 89 - 0
miniprogram/pages/behavior-scene/scene-ready.js

@@ -0,0 +1,89 @@
+module.exports = Behavior({
+  behaviors: [],
+  properties: {
+  },
+  data: {
+    left: 0,
+    top: 0,
+    width: 0,
+    height: 0,
+    renderWidth: 0,
+    renderHeight: 0,
+    windowHeight: 1000,
+    heightScale: 0.75,
+    dpiScale: 1,
+    showBackBtn: false,
+    activeValues: [1],
+    arTrackerShow: false,
+    arTrackerState: 'Init',
+    arTrackerError: ''
+  },
+  attached: function(){},
+  ready() {
+    const info = wx.getSystemInfoSync();
+    const width = info.windowWidth;
+    const windowHeight = info.windowHeight;
+    const height = windowHeight * this.data.heightScale;
+    const dpi = info.pixelRatio;
+    this.setData({
+      width,
+      height,
+      renderWidth: width * dpi * this.data.dpiScale,
+      renderHeight: height * dpi * this.data.dpiScale,
+      testw: 100011,
+      windowHeight
+    });
+  },
+  methods: {
+    onLoad(options) {
+      wx.reportEvent("xr_frame", {
+        "xr_page_path": options.path
+      });
+    },
+    onShareAppMessage() {
+      try {
+        if (wx.xrScene) {
+          const buffer = wx.xrScene.share.captureToArrayBuffer({quality: 0.5});
+          const fp = `${wx.env.USER_DATA_PATH}/xr-frame-share.jpg`;
+          wx.getFileSystemManager().writeFileSync(fp, buffer, 'binary');
+          return {
+            title: this.getTitle(),
+            imageUrl: fp
+          };
+        }
+      } catch (e) {
+        return {
+          title: this.getTitle()
+        };
+      }
+    },
+    onShareTimeline() {
+      try {
+        if (wx.xrScene) {
+          const buffer = wx.xrScene.share.captureToArrayBuffer({quality: 0.5});
+          const fp = `${wx.env.USER_DATA_PATH}/xr-frame-share.jpg`;
+          wx.getFileSystemManager().writeFileSync(fp, buffer, 'binary');
+          return {
+            title: this.getTitle(),
+            imageUrl: fp
+          };
+        }
+      } catch (e) {
+        return {
+          title: this.getTitle()
+        }
+      }
+    },
+    getTitle() {
+      return wx.xrTitle ? `XR - ${wx.xrTitle}` : 'XR-FRAME官方示例';
+    },
+    handleARTrackerState({detail}) {
+      const {state, error} = detail;
+      this.setData({
+        arTrackerShow: true,
+        arTrackerState: wx.getXrFrameSystem().EARTrackerState[state],
+        arTrackerError: error
+      });
+    }
+  }
+})

+ 75 - 0
miniprogram/pages/behavior-scene/util.js

@@ -0,0 +1,75 @@
+var handleDecodedXML = function(decodedXml) {
+  let rerurnXml = '';
+
+  const blockArr = decodedXml.split('&lt;');
+
+  for (let i = 0; i < blockArr.length; i++) {
+    let blockStr = blockArr[i];
+    let handleBlockStr = '';
+    let returnBlockStr = '';
+
+    const sliceBlockStr = blockStr.split(' ');
+
+    for(let j = 0; j < sliceBlockStr.length; j++) {
+      const subBlockStr = sliceBlockStr[j];
+      
+      const eIndex = subBlockStr.indexOf('=');
+      if (eIndex !== -1) {
+        handleBlockStr += ' <span class="attr-name">' + subBlockStr.slice(0, eIndex) +'</span>' + subBlockStr.slice(eIndex);
+      } else {
+        handleBlockStr += subBlockStr;
+      }
+    }
+    // console.log(sliceBlockStr);
+
+    const blockEndIndexB = handleBlockStr.indexOf(' ');
+    const blockEndIndexR = handleBlockStr.indexOf('&gt;');
+    // Handle XMLTag
+    if (blockEndIndexB === -1 && blockEndIndexR === -1) {
+      continue;
+    }
+    const endBlockFlag = handleBlockStr[0] === '/';
+
+    if (blockEndIndexR !== -1) {
+      handleBlockStr += '<br>'
+    }
+    if (blockEndIndexR < blockEndIndexB) {
+      returnBlockStr = '&lt;' + (endBlockFlag ? '/' : '') + '<span class="block-name">' + handleBlockStr.slice(endBlockFlag ? 1 : 0, blockEndIndexR) + '</span>' + handleBlockStr.slice(blockEndIndexR);
+    } else if (blockEndIndexB !== -1) {
+      returnBlockStr = '&lt;' + (endBlockFlag ? '/' : '') +'<span class="block-name">' + handleBlockStr.slice(endBlockFlag ? 1 : 0, blockEndIndexB) + '</span>' + handleBlockStr.slice(blockEndIndexB);
+    } else if (blockEndIndexR !== -1) {
+      returnBlockStr = '&lt;' + (endBlockFlag ? '/' : '') + '<span class="block-name">' + handleBlockStr.slice(endBlockFlag ? 1 : 0, blockEndIndexR) + '</span>' + handleBlockStr.slice(blockEndIndexR);
+    }
+    rerurnXml += returnBlockStr;
+  }
+  return rerurnXml;
+}
+
+var escapeMarkup = function(dangerousInput) {
+  const dangerousString = String(dangerousInput);
+  const matchHtmlRegExp = /["'&<>]/;
+  const match = matchHtmlRegExp.exec(dangerousString);
+  if (!match) {
+    return dangerousInput;
+  }
+
+  const encodedSymbolMap = {
+    '"': '&quot;',
+    '\'': '&#39;',
+    '&': '&amp;',
+    '<': '&lt;',
+    '>': '&gt;'
+  };
+  const dangerousCharacters = dangerousString.split('');
+  const safeCharacters = dangerousCharacters.map(function (character) {
+    return encodedSymbolMap[character] || character;
+  });
+  const safeString = safeCharacters.join('');
+  return safeString;
+}
+
+
+module.exports = {
+  handleDecodedXML,
+  escapeMarkup
+}

+ 171 - 0
miniprogram/pages/business/index.js

@@ -0,0 +1,171 @@
+// index.js
+// const app = getApp()
+const { envList } = require('../../envList.js');
+
+Page({
+  data: {
+    showUploadTip: false,
+    businessList: [
+      {
+        title: '小程序消息',
+        tip: '在小程序中通过几行代码即可发送订阅消息',
+        showItem: false,
+        item: [
+          {
+            type: 'wx_message_send_message',
+            title: '发送消息',
+          },
+          {
+            type: 'wx_message_create_activity_id',
+            title: '创建activity_id',
+          },
+        ],
+      },
+      {
+        title: '微信小程序码和链接',
+        tip: '在小程序中快速获取小程序码和short link',
+        showItem: false,
+        item: [
+          {
+            type: 'wx_qrcode_get_qrcode',
+            title: '获取小程序码',
+          },
+          {
+            type: 'wx_qrcode_get_unlimited_qrcode',
+            title: '获取不限制的小程序码',
+          },
+          {
+            type: 'wx_qrcode_generate_short_link',
+            title: '获取ShortLink',
+          },
+        ],
+      },
+      {
+        title: '小程序短信',
+        tip: '在小程序中向指定用户发送短信和创建发送短信的任务',
+        showItem: false,
+        item: [
+          {
+            type: 'wx_sms_new_send_cloudbase_sms',
+            title: '发送短信',
+          },
+          {
+            type: 'wx_sms_create_send_sms_task',
+            title: '创建发短信任务',
+          },
+        ],
+      },
+      {
+        title: '小程序安全能力',
+        tip: '在小程序中可以几行代码即可调用小程序的内容安全识别能力',
+        showItem: false,
+        item: [
+          {
+            type: 'wx_security_msg_sec_check',
+            title: '文本内容安全识别',
+          },
+          {
+            type: 'wx_security_media_check',
+            title: '音视频内容安全识别',
+          },
+        ],
+      },
+      {
+        title: '小程序用户信息',
+        tip: '在小程序中通过几行代码即可获取当前用户的信息',
+        showItem: false,
+        item: [
+          {
+            type: 'wx_user_get_open_id',
+            title: '获取用户openId',
+          },
+          {
+            type: 'wx_user_get_phone_number',
+            title: '手机号快速验证',
+          },
+        ],
+      },
+      {
+        title: '小程序微信支付',
+        tip: '在小程序中通过几行代码即可调用微信支付的能力',
+        showItem: false,
+        item: [
+          {
+            title: '使用指南',
+          }
+        ],
+      },
+      {
+        title: '轮播图管理',
+        tip: '结合商品订单管理流程,提供订单信息列表展示/查询/导出等相关能力。',
+        showItem: false,
+        item: [
+          {
+            title: '使用指南',
+          },
+        ],
+      },
+      {
+        title: '管理商品和订单',
+        tip: '通过云模板,快速实现小程序内的商品信息展示/查询/上架/删除/分类管理等。',
+        showItem: false,
+        item: [
+          {
+            title: '内容管理系统(CMS)',
+            level:'main'
+          },
+          {
+            title: '商品管理',
+            level:'main'
+          },
+          {
+            title: '订单管理',
+            level:'main'
+          },
+        ],
+      },
+      {
+        title: '管理云开发数据和文件',
+        tip: '通过云模板,快速实现小程序管理后台所需的CMS内容管理/数据库管理/文件管理等能力。',
+        showItem: false,
+        item: [
+          {
+            title: '云存储管理',
+            level:'main'
+          },
+          {
+            title: '云数据库管理',
+            level:'main'
+          },
+        ],
+      }
+    ],
+    envList,
+    selectedEnv: envList?.[0],
+    haveCreateCollection: false,
+  },
+
+  onClickBusinessInfo(e) {
+    const index = e.currentTarget.dataset.index;
+    const businessList = this.data.businessList;
+    const selectedItem = businessList[index];
+    selectedItem.showItem = !selectedItem.showItem;
+    this.setData({
+      businessList,
+    });
+  },
+
+  jumpBusinessPage(e) {
+    const { title, subtitle, type,level } = e.currentTarget.dataset;
+    if (type) {
+      wx.navigateTo({
+        url: `/pages/cloudbaseModuleDetail/index?envId=${this.data.selectedEnv}&type=${type}&title=${title}&subtitle=${subtitle}`,
+      });
+    } else {
+      console.log(level);
+      wx.navigateTo({
+        url: `/pages/cloudbaseModuleGuide/index?title=${title}&subtitle=${subtitle}&level=${level}`,
+      });
+    }
+  }
+});

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

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "业务示例",
+  "usingComponents": {
+    "cloud-tip-modal": "/components/cloudTipModal/index"
+  }
+}

+ 29 - 0
miniprogram/pages/business/index.wxml

@@ -0,0 +1,29 @@
+<!--index.wxml-->
+<view class="container">
+  <view class="title">业务示例</view>
+  <view class="top_tip">使用云开发快速实现业务功能</view>
+  <view class="power" wx:key="title" wx:for="{{businessList}}" wx:for-item="business">
+    <view class="power_info" data-index="{{index}}" data-type="{{ business.type }}" bindtap="onClickBusinessInfo">
+      <view class="power_info_text">
+        <view class="power_info_text_title">
+          {{business.title}}
+          <view class="power_info_text_tag" wx:if="{{business.tag}}">{{business.tag}}</view>
+        </view>
+        <view class="power_info_text_tip">{{business.tip}}</view>
+      </view>
+      <image wx:if="{{!business.showItem && business.item.length}}" class="power_info_more" src="../../images/arrow.svg"></image>
+      <image wx:if="{{business.showItem && business.item.length}}" class="power_info_less" src="../../images/arrow.svg"></image>
+      <image wx:if="{{!business.item.length}}" class="power_item_icon" src="../../images/arrow.svg"></image>
+    </view>
+    <view wx:if="{{business.showItem}}">
+      <view wx:key="title" wx:for="{{business.item}}">
+        <view class="line"></view>
+        <view class="power_item" bindtap="jumpBusinessPage" data-title="{{business.title}}" data-level="{{item.level}}" data-subtitle="{{item.title}}" data-type="{{ item.type }}">
+          <view class="power_item_title">{{item.title}}</view>
+          <image class="power_item_icon" src="../../images/arrow.svg"></image>
+        </view>
+      </view>
+    </view>
+  </view>
+  <cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
+</view>

+ 142 - 0
miniprogram/pages/business/index.wxss

@@ -0,0 +1,142 @@
+/**index.wxss**/
+
+page {
+  padding-top: 54rpx;
+  background-color: #f6f6f6;
+  padding-bottom: 60rpx;
+}
+
+.container {
+  font-family: PingFang SC;
+}
+
+.title {
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #000000;
+  font-size: 44rpx;
+  margin-bottom: 40rpx;
+}
+.function_title {
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #000000;
+  font-size: 36rpx;
+  text-align: left;
+  width: 93%;
+  margin-top: 50rpx;
+}
+
+.top_tip {
+  font-size: 28rpx;
+  font-family: PingFang SC;
+  font-weight: 400;
+  color: #888888;
+  margin-bottom: 28rpx;
+}
+
+.examples_container {
+  display: flex;
+  flex-direction: column;
+  gap: 16rpx;
+  width: 100%;
+  align-items: center;
+}
+
+.example_item {
+  border: 3rpx solid #e5e5e5;
+  border-radius: 10rpx;
+  padding: 24rpx;
+  width: 90%;
+  background-color: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.power {
+  margin-top: 30rpx;
+  border-radius: 5px;
+  background-color: white;
+  width: 93%;
+  padding-bottom: 1rpx;
+}
+
+.power_info {
+  display: flex;
+  padding: 30rpx 25rpx;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.power_info_more {
+  width: 30rpx;
+  height: 30rpx;
+  transform: rotate(90deg);
+}
+
+.power_info_less {
+  width: 30rpx;
+  height: 30rpx;
+  transform: rotate(270deg);
+}
+
+.power_info_text {
+  display: flex;
+  flex-direction: column;
+}
+
+.power_info_text_title {
+  margin-bottom: 10rpx;
+  font-weight: 400;
+  font-size: 32rpx;
+  display: flex;
+  align-items: center;
+  font-family: 'PingFang SC';
+  color: #000;
+}
+
+.power_info_text_tag {
+  margin-left: 20rpx;
+  background-color: #fbe0e0;
+  color: #e54545;
+  padding: 0 7px;
+  font-size: 14px;
+  vertical-align: middle;
+  border-radius: 3px;
+}
+
+.power_info_text_tip {
+  color: rgba(0, 0, 0, 0.6);
+  font-size: 28rpx;
+  padding-right: 30rpx;
+}
+
+.power_item {
+  padding: 30rpx 25rpx;
+  display: flex;
+  justify-content: space-between;
+}
+
+.power_item_title {
+  font-size: 28rpx;
+  color: rgba(0, 0, 0, 0.9);
+}
+
+.power_item_icon {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.line {
+  width: 95%;
+  margin: 0 auto;
+  height: 2rpx;
+  background-color: rgba(0, 0, 0, 0.1);
+}
+
+.environment {
+  color: rgba(0, 0, 0, 0.4);
+  font-size: 24rpx;
+  margin-top: 25%;
+}

+ 614 - 0
miniprogram/pages/cloudbaseModuleDetail/index.js

@@ -0,0 +1,614 @@
+// pages/exampleDetail/index.js
+// 云模板未安装错误码
+const CLOUD_MODULE_NOT_INSTALLED = 'InnerError.ResourceNotFound';
+
+Page({
+  data: {
+    type: '',
+    envId: '',
+    showUploadTip: false,
+    installModalVisible: false,
+    installModalTipText: '',
+    installModuleName: '',
+    installModulePageTitle: '',
+    userOpenId: 'ouSoxxxxxxxxxxxxxJp3zM',
+    currentOpenId:'',
+    templateId: 'XeULkxnxxxxxxxxxxxxxx9vRO0olhrQi34',
+    getErrorInfo:'',
+    securityContent:'hello world!',
+    securityMedia:'https://developers.weixin.qq.com/miniprogram/assets/images/head_global_z_@all.png',
+    mediaId:'MEDIA_ID',
+    sendCustomMessage:'Hello World',
+    urlLink:'https://wxaurl.cn/difT1VdVOLa',
+    smsTemplateId:'2053122',
+    phoneNumber:'+8611111111111',
+    appid:'appid',
+    csvLink:'extension://xxx.zip',
+    qrcode:'',
+    unlimitedQrcode:'',
+    qrcodeShortLink:''
+  },
+  handdleResult: function(data){
+    if(data.message.includes('env not exists') || data.message.includes('Environment not found') || data.message.includes('env check invalid be filterd')){
+      this.setData({
+        showUploadTip: true,
+      });
+    }
+    wx.hideLoading();
+  },
+  bindKeyInputCsvLink: function(e){
+    this.setData({
+      csvLink: e.detail.value
+    })
+  },
+  bindKeyInputUrlLink: function(e){
+    this.setData({
+      urlLink: e.detail.value
+    })
+  },
+  bindKeyInputSmsTemplateId: function(e){
+    this.setData({
+      smsTemplateId: e.detail.value
+    })
+  },
+  bindKeyInputPhoneNumber: function(e){
+    this.setData({
+      phoneNumber: e.detail.value
+    })
+  },
+  bindKeyInputAppid: function(e){
+    this.setData({
+      appid: e.detail.value
+    })
+  },
+  bindKeyInputSendCustomMessage: function(e){
+    this.setData({
+      sendCustomMessage: e.detail.value
+    })
+  },
+  bindKeyInputMediaId: function(e){
+    this.setData({
+      mediaId: e.detail.value
+    })
+  },
+  bindKeyInputSecurityMedia: function(e){
+    this.setData({
+      securityMedia: e.detail.value
+    })
+  },
+  bindKeyInputSecurityContent: function(e){
+    this.setData({
+      securityContent: e.detail.value
+    })
+  },
+  bindKeyInputTemplateId: function (e) {
+    this.setData({
+      templateId: e.detail.value
+    })
+  },
+  bindKeyInputOpenId: function (e) {
+    this.setData({
+      userOpenId: e.detail.value
+    })
+  },
+  clearError: function(){
+    this.setData({
+      userOpenId: '',
+      templateId: '',
+      getErrorInfo:'',
+      securityMedia:'',
+      securityContent:'',
+      mediaId:'',
+      sendCustomMessage:'',
+      urlLink:'',
+      smsTemplateId:'',
+      phoneNumber:'',
+      appid:'',
+      csvLink:'',
+      qrcode:'',
+      unlimitedQrcode:'',
+      qrcodeShortLink:''
+    })  
+  },
+  onLoad(options) {
+    wx.setNavigationBarTitle({
+      title: `${options?.title}-${options?.subtitle}`
+    })
+    this.setData({ type: options?.type, envId: options?.envId});
+  },
+
+  // 发送消息
+  sendMessage() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+      .callFunction({
+        name: 'cloudbase_module',
+        data: {
+          name: 'wx_message_send_message',
+          data: {
+            template_id: this.data.templateId, // 所需下发的订阅模板id
+            page: "pages/index/index", //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转
+            touser: this.data.userOpenId, //接收者(用户)的 openid
+            data:{ "thing1": { "value": 123 }, "thing4": { "value": 123 },"thing6": { "value": 123 },"thing7": { "value": 123 },"time6":{"value": "2022-11-32"} }, //模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }的object
+            miniprogram_state:"trial", //跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
+            lang:"zh_CN" //进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN
+          },
+        },
+      })
+      .then((resp) => {
+        if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+          this.setData({
+            installModalVisible: true,
+            installModalTipText: '云开发>云模板>模板中心>小程序消息',
+            installModuleName: 'wx_message_send_message',
+            installModulePageTitle:'小程序消息-发送消息'
+          });
+        }else if(resp?.result?.errcode !== -1){
+          wx.showToast({
+            title: "发送失败",
+            icon: 'error',
+            duration: 2000
+          });
+          this.setData({
+            getErrorInfo:resp?.result?.errmsg,
+          })
+        }else {
+          wx.showToast({
+            title: "发送成功",
+            icon: 'success',
+            duration: 2000
+          }); 
+        }
+        wx.hideLoading();
+      })
+      .catch((e) => {
+        this.handdleResult(e);
+      });
+  },
+
+  // 创建activity_id
+  createMessageActivityId() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+      .callFunction({
+        name: 'cloudbase_module',
+        data: {
+          name: 'wx_message_create_activity_id',
+          data: {
+            openid: this.data.userOpenId, //为私密消息创建activity_id时,指定分享者为openid用户。其余用户不能用此activity_id分享私密消息。openid与unionid填一个即可。私密消息暂不支持云函数生成activity id。
+          },
+        }
+      })
+      .then((resp) => {
+        if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+          this.setData({
+            installModalVisible: true,
+            installModalTipText: '云开发>云模板>模板中心>小程序消息',
+            installModuleName: 'wx_message_send_message',
+            installModulePageTitle:'小程序消息-创建activity_id'
+          });
+        }else if(resp?.result?.activityId){
+          wx.showToast({
+            title: "创建成功",
+            icon: 'success',
+            duration: 2000
+          }); 
+        }else {
+          wx.showToast({
+            title: "创建失败",
+            icon: 'error',
+            duration: 2000
+          });
+          this.setData({
+            getErrorInfo:resp?.result?.errmsg,
+          })
+        } 
+        wx.hideLoading();
+      })
+      .catch((e) => {
+        this.handdleResult(e);
+      });    
+  },
+
+  // 获取小程序码
+  getCodeSrc() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+      .callFunction({
+        name: 'cloudbase_module',
+        data: {
+          name: 'wx_qrcode_get_qrcode',
+          data: {
+            path: 'pages/index/index', // 扫码进入的小程序页面路径,最大长度 1024 个字符,不能为空,scancode_time为系统保留参数,不允许配置;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
+            width: 430, //二维码的宽度,单位 px。默认值为430,最小 280px,最大 1280px
+            auto_color: false, //默认值false;自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
+            line_color: { r: 0, g: 0, b: 0 }, //默认值{"r":0,"g":0,"b":0} ;auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
+            is_hyaline: false, //默认值false;是否需要透明底色,为 true 时,生成透明底色的小程序码
+            env_version: 'trial', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
+          },
+        },
+      })
+      .then((resp) => {
+        if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+          this.setData({
+            installModalVisible: true,
+            installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
+            installModuleName: 'wx_qrcode',
+            installModulePageTitle:'微信小程序码和链接-获取小程序码'
+          });
+        } else {
+          wx.showToast({
+            title: "获取成功",
+            icon: 'success',
+            duration: 2000
+          }); 
+          this.setData({
+            qrcode: resp.result.tempFileURL,
+          });
+        }
+        wx.hideLoading();
+      })
+      .catch((e) => {
+        this.handdleResult(e);
+      });
+  },
+
+  // 获取不限制的小程序码
+  getUnlimitedCodeSrc() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+      .callFunction({
+        name: 'cloudbase_module',
+        data: {
+          name: 'wx_qrcode_get_unlimited_qrcode',
+          data: {
+            scene: 'abc', //最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
+            page: 'pages/index/index', //默认是主页,页面 page,例如 pages/index/index,根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面。scancode_time为系统保留参数,不允许配置
+            check_path: true, //默认是true,检查page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但page 有数量上限(60000个)请勿滥用。
+            env_version: 'trial', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
+            width: 430, // 默认430,二维码的宽度,单位 px,最小 280px,最大 1280px
+            auto_color: false, //自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
+            line_color: {"r":0,"g":0,"b":0}, //默认是{"r":0,"g":0,"b":0} 。auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
+            is_hyaline: false, //默认是false,是否需要透明底色,为 true 时,生成透明底色的小程序
+          },
+        },
+      })
+      .then((resp) => {
+        if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+          this.setData({
+            installModalVisible: true,
+            installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
+            installModuleName: 'wx_qrcode',
+            installModulePageTitle:'微信小程序码和链接-获取不限制的小程序码'
+          });
+        }else if(resp.result?.errmsg){
+          wx.showToast({
+            title: "获取失败",
+            icon: 'error',
+            duration: 2000
+          }); 
+          this.setData({
+            getErrorInfo:resp?.result?.errmsg,
+          })
+        } else {
+          wx.showToast({
+            title: "获取成功",
+            icon: 'success',
+            duration: 2000
+          }); 
+          this.setData({
+            unlimitedQrcode: resp.result.tempFileURL,
+          });
+        }
+        wx.hideLoading();
+      })
+      .catch((e) => {
+        this.handdleResult(e);
+      });
+  },
+
+  // 获取ShortLink
+  getShortLink() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+      .callFunction({
+        name: 'cloudbase_module',
+        data: {
+          name: 'wx_qrcode_generate_short_link',
+          data: {
+            page_url: 'pages/index/index', // 通过 Short Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,可携带 query,最大1024个字符
+            page_title: '首页', //页面标题,不能包含违法信息,超过20字符会用... 截断代替
+            is_permanent: false, //默认值false。生成的 Short Link 类型,短期有效:false,永久有效:true
+          },
+        },
+      })
+      .then((resp) => {
+        if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+          this.setData({
+            installModalVisible: true,
+            installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
+            installModuleName: 'wx_qrcode',
+            installModulePageTitle:'微信小程序码和链接-获取ShortLink'
+          });
+        }else if(resp.result?.errmsg){
+          wx.showToast({
+            title: "获取失败",
+            icon: 'error',
+            duration: 2000
+          }); 
+          this.setData({
+            getErrorInfo:resp?.result?.errmsg,
+          })
+        } else {
+          wx.showToast({
+            title: "获取成功",
+            icon: 'success',
+            duration: 2000
+          }); 
+          this.setData({
+            qrcodeShortLink: resp.result.tempFileURL,
+          });
+        }
+        wx.hideLoading();
+      })
+      .catch((e) => {
+        this.handdleResult(e);
+      });
+  },
+
+  
+// 发送短信
+sendCloudbaseSms() {
+  wx.showLoading({
+    title: '',
+  });
+  wx.cloud
+    .callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_sms_new_send_cloudbase_sms',
+        data: {
+          env: this.data.envId, // 环境 ID
+          url_link: this.data.urlLink, // URL Link
+          template_id: this.data.smsTemplateId, //短信模版 ID 默认值:2053122(销类短信模版 ID)
+          template_param_list: ['xxx'], //短信模版变量数组
+          phone_number_list: [this.data.phoneNumber], //手机号列表,单次请求最多支持 1000 个境内手机号,手机号必须以+86开头
+          use_short_name: false, //是否使用小程序简称
+          resource_appid: this.data.appid, //资源方appid,第三方代开发时可填第三方appid或小程序appid,应为所填环境所属的账号APPID
+        },
+      },
+    })
+    .then((resp) => {
+      if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+        this.setData({
+          installModalVisible: true,
+          installModalTipText: '云开发>云模板>模板中心>小程序短信',
+          installModuleName: 'wx_sms_new_send_cloudbase_sms',
+          installModulePageTitle:'小程序短信-发送短信'
+        });
+      }else if(resp?.result?.errmsg){
+        wx.showToast({
+          title: "发送失败",
+          icon: 'error',
+          duration: 2000
+        });
+        this.setData({
+          getErrorInfo:resp?.result?.errmsg,
+        })
+      }else {
+        wx.showToast({
+          title: "发送成功",
+          icon: 'success',
+          duration: 2000
+        }); 
+      } 
+      wx.hideLoading();
+    })
+    .catch((e) => {
+      this.handdleResult(e);
+    });    
+  },
+
+  // 创建发短信任务
+  sendCloudbaseSmsTask() {
+    wx.showLoading({
+      title: '',
+    });
+  wx.cloud
+    .callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_sms_create_send_sms_task',
+        data:{
+          env: this.data.envId, // 环境 ID
+          file_url: this.data.csvLink, //短信 CSV 文件地址CodeUri
+          template_id: this.data.smsTemplateId, //短信模版 ID 默认值:2053122(销类短信模版 ID)
+          use_short_name: false //是否使用小程序简称
+        }
+      },
+    })
+    .then((resp) => {
+      if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+        this.setData({
+          installModalVisible: true,
+          installModalTipText: '云开发>云模板>模板中心>小程序短信',
+          installModuleName: 'wx_sms_new_send_cloudbase_sms',
+          installModulePageTitle:'小程序短信-创建发短信任务'
+        });
+      }else if(resp?.result?.errmsg){
+        wx.showToast({
+          title: "创建失败",
+          icon: 'error',
+          duration: 2000
+        });
+        this.setData({
+          getErrorInfo:resp?.result?.errmsg,
+        })
+      }else {
+        wx.showToast({
+          title: "创建成功",
+          icon: 'success',
+          duration: 2000
+        }); 
+      } 
+      wx.hideLoading();
+    })
+    .catch((e) => {
+      this.handdleResult(e);
+    });    
+  },
+
+  // 文本内容安全识别
+  securityMessageCheck() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+    .callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_security_msg_sec_check',
+        data: {
+          scene: 1, // 场景值 1, 代表资料
+          version: 2, // 接口版本号,2.0版本为固定值2
+          content: this.data.securityContent, // 要检测的内容
+        },
+      },
+    })
+    .then((resp) => {
+      if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+        this.setData({
+          installModalVisible: true,
+          installModalTipText: '云开发>云模板>模板中心>小程序安全能力',
+          installModuleName: 'wx_security_msg_sec_check',
+          installModulePageTitle:'小程序安全能力-文本内容安全识别'
+        });
+      }else if(resp?.result?.result?.label === 100){
+        wx.showToast({
+          title: "内容正常",
+          icon: 'success',
+          duration: 2000
+        }); 
+      }else{
+        wx.showToast({
+          title: "内容异常",
+          icon: 'error',
+          duration: 2000
+        }); 
+      }
+      wx.hideLoading();
+    })
+    .catch((e) => {
+      this.handdleResult(e);
+    });    
+  },
+
+  // 音视频内容安全识别
+  securityMediaCheck() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+    .callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_security_media_check',
+        data: {
+          scene: 1, // 场景值 1, 代表资料
+          version: 2, // 接口版本号,2.0版本为固定值2
+          media_url: this.data.securityMedia, // 要检测的内容
+          media_type: 2, //媒体资源类型,2 代表图片图片
+        },
+      },
+    })
+    .then((resp) => {
+      if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+        this.setData({
+          installModalVisible: true,
+          installModalTipText: '云开发>云模板>模板中心>小程序安全能力',
+          installModuleName: 'wx_security_msg_sec_check',
+          installModulePageTitle:'小程序安全能力-音视频内容安全识别'
+        });
+      }else if(resp?.result?.errmsg){
+        wx.showToast({
+          title: "内容异常",
+          icon: 'error',
+          duration: 2000
+        }); 
+        this.setData({
+          getErrorInfo:resp?.result?.errmsg,
+        })
+      }else{
+        wx.showToast({
+          title: "内容正常",
+          icon: 'success',
+          duration: 2000
+        });   
+      }
+      wx.hideLoading();
+    })
+    .catch((e) => {
+      this.handdleResult(e);
+    });    
+  },
+  
+  // 获取用户openId
+  getUserOpenId() {
+    wx.showLoading({
+      title: '',
+    });
+    wx.cloud
+    .callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_user_get_open_id',
+      },
+    })
+    .then((resp) => {
+      if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
+        this.setData({
+          installModalVisible: true,
+          installModalTipText: '云开发>云模板>模板中心>小程序用户信息',
+          installModuleName: 'wx_user_get_open_id',
+          installModulePageTitle:'小程序用户信息-获取用户openId'
+        });
+      }else {
+        this.setData({
+          currentOpenId: resp.result.openId,
+        });
+      }
+      wx.hideLoading();
+    })
+    .catch((e) => {
+      this.handdleResult(e);
+    });    
+  },
+
+  // 手机号快速验证
+  getPhoneNumber(e) {
+    console.log(e.detail.code); // 动态令牌
+    wx.cloud.callFunction({
+      name: 'cloudbase_module',
+      data: {
+        name: 'wx_user_get_phone_number',
+        data: {
+          code: e.detail.code,
+        },
+      },
+      success: (res) => {
+        const phoneInfo = res.result?.phoneInfo;
+        console.log('获取到的手机号信息: ', phoneInfo);
+      },
+    });
+  }
+});

+ 7 - 0
miniprogram/pages/cloudbaseModuleDetail/index.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "cloud-tip-modal": "/components/cloudTipModal/index",
+    "cloud-module-install-modal": "/components/cloudbaseModuleInstallModal/index",
+    "cloud-module-install-path": "/components/cloudbaseModuleInstallPath/index"
+  }
+}

+ 213 - 0
miniprogram/pages/cloudbaseModuleDetail/index.wxml

@@ -0,0 +1,213 @@
+<view class="container">
+  <view class="main">
+    <!-- 获取小程序码 -->
+    <block wx:if="{{ type === 'wx_qrcode_get_qrcode' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,直接获取ShortLink</view>
+      <view wx:if="{{qrcode}}" class="code_box">
+        <image class="code_img" src="{{qrcode}}" />
+      </view>
+      <view class="button" bindtap="getCodeSrc">获取小程序码</view>
+      <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
+    </block>
+
+    <!-- 获取不限制的小程序码 -->
+    <block wx:if="{{ type === 'wx_qrcode_get_unlimited_qrcode' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,直接获取不限制的小程序码</view>
+      <view class="page-section">
+        <view wx:if="{{qrcodeShortLink}}" class="code_box">
+        <image class="code_img" src="{{qrcodeShortLink}}" />
+      </view>      
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="getUnlimitedCodeSrc">获取不限制的小程序码</view>
+      <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
+    </block>
+
+    <!-- 获取shortLink -->
+    <block wx:if="{{ type === 'wx_qrcode_generate_short_link' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,直接获取ShortLink</view>
+      <view class="page-section">
+        <view wx:if="{{qrcode}}" class="code_box">
+          <image class="code_img" src="{{qrcode}}" />
+        </view> 
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="getShortLink">获取ShortLink</view>
+      <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
+    </block>
+
+    <!-- 发送消息 -->
+    <block wx:if="{{ type === 'wx_message_send_message' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,向订阅用户送微信订阅消息。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">订阅消息模板Id</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{templateId}}" bindinput="bindKeyInputTemplateId" placeholder="微信订阅消息模板Id"/>
+          </view>
+        </view>
+        <view class="weui-cells__title">消息接收者openId</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{userOpenId}}" bindinput="bindKeyInputOpenId" placeholder="消息接收者openId"/>
+          </view>
+        </view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="sendMessage" wx:if="{{!getErrorInfo}}">发送消息</view>
+      <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
+      <cloud-module-install-path installModuleName="小程序消息"></cloud-module-install-path>
+    </block>
+
+    <!-- 创建activity_id -->
+    <block wx:if="{{ type === 'wx_message_create_activity_id' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,创建被分享动态消息或私密消息的activity_id。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">用户openId</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{userOpenId}}" bindinput="bindKeyInputOpenId" placeholder="用户openId"/>
+          </view>
+        </view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="createMessageActivityId" wx:if="{{!getErrorInfo}}">创建activity_id</view>
+      <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
+      <cloud-module-install-path installModuleName="小程序消息"></cloud-module-install-path>
+    </block>
+
+    <!-- 发送短信 -->
+    <block wx:if="{{ type === 'wx_sms_new_send_cloudbase_sms' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,向用户发送携带 URL Link 的短信。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">URL Link</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{urlLink}}" bindinput="bindKeyInputUrlLink" placeholder="请输入URL Link"/>
+          </view>
+        </view>
+        <view class="weui-cells__title">短信模版ID</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{smsTemplateId}}" bindinput="bindKeyInputSmsTemplateId" placeholder="请输入短信模版ID"/>
+          </view>
+        </view>
+        <view class="weui-cells__title">手机号</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{phoneNumber}}" bindinput="bindKeyInputPhoneNumber" placeholder="请输入手机号"/>
+          </view>
+        </view>
+        <view class="weui-cells__title">APPID</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{appid}}" bindinput="bindKeyInputAppid" placeholder="请输入APPID"/>
+          </view>
+        </view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="sendCloudbaseSms" wx:if="{{!getErrorInfo}}">发送短信</view>
+      <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
+      <cloud-module-install-path installModuleName="小程序短信"></cloud-module-install-path>
+    </block>
+
+    <!-- 创建发送短信任务 -->
+    <block wx:if="{{ type === 'wx_sms_create_send_sms_task' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,创建发短信任务。发送的短信支持打开云开发静态网站 H5,进而在 H5 里可以打开小程序。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">短信CSV文件地址</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{csvLink}}" bindinput="bindKeyInputCsvLink" placeholder="请输入短信CSV文件地址"/>
+          </view>
+        </view>
+        <view class="weui-cells__title">短信模版ID</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{smsTemplateId}}" bindinput="bindKeyInputSmsTemplateId" placeholder="请输入短信模版ID"/>
+          </view>
+        </view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="sendCloudbaseSmsTask" wx:if="{{!getErrorInfo}}">创建发送短信任务</view>
+      <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
+      <cloud-module-install-path installModuleName="小程序短信"></cloud-module-install-path>
+    </block>
+
+    <!-- 文本内容安全识别 -->
+    <block wx:if="{{ type === 'wx_security_msg_sec_check' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,检查一段文本是否含有违法违规内容。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">文本内容</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{securityContent}}" bindinput="bindKeyInputSecurityContent" placeholder="请输入需要安全识别的文本内容"/>
+          </view>
+        </view>
+      </view>
+      <view class="button" bindtap="securityMessageCheck">文本内容安全识别</view>
+      <cloud-module-install-path installModuleName="小程序安全能力"></cloud-module-install-path>
+    </block>
+
+    <!-- 音视频内容安全识别 -->
+    <block wx:if="{{ type === 'wx_security_media_check' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,异步校验图片/音频是否含有违法违规内容。</view>
+      <view class="page-section">
+        <view class="weui-cells__title">文件url地址</view>
+        <view class="weui-cells weui-cells_after-title">
+          <view class="weui-cell weui-cell_input">
+            <input class="weui-input"  value="{{securityMedia}}" bindinput="bindKeyInputSecurityMedia" placeholder="请输入需要安全识别的音视频url地址"/>
+          </view>
+        </view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
+        <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
+          {{getErrorInfo}}
+        </view>
+      </view>
+      <view class="button" bindtap="securityMediaCheck"  wx:if="{{!getErrorInfo}}">音视频内容安全识别</view>
+      <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
+      <cloud-module-install-path installModuleName="小程序安全能力"></cloud-module-install-path>
+    </block>
+
+    <!-- 获取用户openId -->
+    <block wx:if="{{ type === 'wx_user_get_open_id'}}">
+      <view class="top_tip">可通过云开发云模板提供的能力,获取用户的openId。</view>
+      <view class="box_text" wx:if="{{!currentOpenId}}">openId将展示在这里</view>
+      <view wx:if="{{currentOpenId}}" class="code_box">
+        {{currentOpenId}}
+      </view>
+      <view class="button" bindtap="getUserOpenId">获取openId</view>
+      <cloud-module-install-path installModuleName="小程序用户信息"></cloud-module-install-path>
+    </block>
+
+    <!-- 手机号快速验证 -->
+    <block wx:if="{{ type === 'wx_user_get_phone_number' }}">
+      <view class="top_tip">可通过云开发云模板提供的能力,将code换取用户手机号。每个code只能使用一次,code的有效期为5min。</view>
+      <button class="button_phone" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button>
+      <cloud-module-install-path installModuleName="小程序用户信息"></cloud-module-install-path>
+    </block>
+  </view>
+</view>
+
+<cloud-tip-modal showUploadTipProps="{{showUploadTip}}" />
+<!-- 云模板未安装提示弹框 -->
+<cloud-module-install-modal installModulePageTitleProps="{{installModulePageTitle}}" modalVisibleProps="{{ installModalVisible }}" tipTextProps="{{ installModalTipText }}" installModuleNameProps="{{ installModuleName }}" />
+

+ 153 - 0
miniprogram/pages/cloudbaseModuleDetail/index.wxss

@@ -0,0 +1,153 @@
+.container {
+  width: 100%;
+  height: 100%;
+  align-items: center;
+}
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  box-sizing: border-box;
+}
+
+.main {
+  width: 90%;
+  display: flex;
+  flex-direction: column;
+  font-family: PingFang SC;
+}
+
+.tip {
+  font-size: 23rpx;
+  color: rgba(0, 0, 0, 0.5);
+  text-align: center;
+  margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+  font-size: 28rpx;
+  color: rgba(0, 0, 0, 0.6);
+  text-align: left;
+  margin: 30rpx auto 0;
+}
+
+.box_text {
+  background-color: white;
+  text-align: center;
+  padding: 300rpx 0;
+  margin-top: 30rpx;
+  color: rgba(0, 0, 0, 0.5);
+}
+
+.button {
+  width: 450rpx;
+  text-align: center;
+  margin: 60rpx auto 0 auto;
+  height: 80rpx;
+  color: white;
+  border-radius: 5px;
+  line-height: 80rpx;
+  background-color: #07c160;
+}
+
+.button_phone {
+  text-align: center;
+  margin: 250rpx auto 0 auto;
+  color: white;
+  border-radius: 5px;
+  background-color: #07c160;
+  font-weight: normal;
+}
+
+.button_clear {
+  width: 300rpx;
+  text-align: center;
+  margin: 250rpx auto 0 auto;
+  height: 80rpx;
+  color: #07c160;
+  border-radius: 5px;
+  line-height: 80rpx;
+  background-color: rgba(0, 0, 0, 0.03);
+}
+
+.line {
+  height: 1rpx;
+  width: 100%;
+  background-color: rgba(0, 0, 0, 0.1);
+}
+
+.code_box {
+  text-align: center;
+  background-color: white;
+  margin-top: 30rpx;
+  padding: 17rpx;
+}
+
+.code_box_title {
+  color: rgba(0, 0, 0, 0.5);
+  font-size: 26rpx;
+  margin-bottom: 20rpx;
+  text-align: left;
+}
+
+.code_box_record {
+  display: flex;
+}
+
+.code_box_record_title {
+  width: 33%;
+  font-size: 26rpx;
+  color: rgba(0, 0, 0, 0.5);
+  padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+  width: 33%;
+  font-size: 26rpx;
+  padding: 20rpx 0;
+}
+
+.title {
+  margin-top: 16px;
+  font-size: 36rpx;
+  font-weight: 500;
+  color: #000;
+}
+
+.info {
+  margin-top: 12px;
+  font-size: 28rpx;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.6);
+  line-height: 52rpx;
+}
+
+.img {
+  margin-top: 16px;
+  width: 100%;
+}
+
+.code_img {
+  width: 360rpx;
+  height: 360rpx;
+}
+
+.page-section {
+  width: 100%;
+  text-align: left;
+  margin: 20rpx auto 0;
+  font-size: 28rpx;
+}
+.weui-cells__title {
+  margin: 10rpx 0;
+  color: rgba(0, 0, 0, 0.6);
+}
+.weui-cells_after-title {
+  border: 1px solid #ddd;
+  padding: 10rpx;
+  color: rgba(0, 0, 0, 0.6);
+}
+
+.weui-cells_after-error {
+ color: red;
+}

+ 21 - 0
miniprogram/pages/cloudbaseModuleGuide/index.js

@@ -0,0 +1,21 @@
+// pages/cloudbaseModuleGuide/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    title:'',
+    level:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    wx.setNavigationBarTitle({
+      title: options?.level === 'main'?options?.subtitle:`${options?.title}-${options?.subtitle}`
+    })
+    this.setData({ title: options?.level === 'main'?options?.subtitle:options?.title});
+  }
+})

+ 3 - 0
miniprogram/pages/cloudbaseModuleGuide/index.json

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

+ 23 - 0
miniprogram/pages/cloudbaseModuleGuide/index.wxml

@@ -0,0 +1,23 @@
+<view class="container">
+  <view class="main">
+    <view class="title font_title_2">1、进入云开发</view>
+    <view class="image_container">
+      <image mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/42c5de06223b0ca92524cd18fcde41d1.jpg"></image>
+    </view>
+    <view class="title font_title_2">2、进入云模板</view>
+    <view class="image_container">
+      <image mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/ec2bab70c36185918647a49edcab4c3e.jpg"></image>
+    </view>
+    <view class="title font_title_2">3、在模板中心 -> 管理后台,找到 <text>{{title}}</text></view>
+    <view class="image_container">
+      <image wx:if="{{ title === '内容管理系统(CMS)' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/802195e2b3837764fdbf3fa82aadb710.jpg"></image>
+      <image wx:if="{{ title === '云存储管理' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/6ed7d64ce0f66eabb27c66fd7d6f4fdc.jpg"></image>
+      <image wx:if="{{ title === '云数据库管理' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/71ef3a9cd7cc6f1e707b10cbdd6ec2b6.jpg"></image>
+      <image wx:if="{{ title === '商品管理' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/816a3c09ab0b1a698e861eca99e7dc15.jpg"></image>
+      <image wx:if="{{ title === '订单管理' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/81dce3ed7309bb85cea27d954e2f440a.jpg"></image>
+      <image wx:if="{{ title === '轮播图管理' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/c4b90084020ed2f5c74fc4da359b4652.jpg"></image>
+      <image wx:if="{{ title === '小程序微信支付' }}" mode="widthFix" src="https://qcloudimg.tencent-cloud.cn/raw/fd16cb13ef003581a959c7b0cf29fb6b.jpg"></image>
+    </view> 
+    <view class="title font_title_2">4、进入模板详情页,点击 <text>安装模板</text>,等待安装完成即可使用。</view>
+  </view>
+</view>

Некоторые файлы не были показаны из-за большого количества измененных файлов