├── components ├── card │ ├── card.json │ ├── card.wxml │ ├── card.js │ └── card.wxss ├── loading │ ├── loading.json │ ├── loading.js │ ├── loading.wxml │ └── loading.wxss ├── audio-player │ ├── audio-player.json │ ├── audio-player.wxml │ ├── audio-player.wxss │ ├── Player.js │ └── audio-player.js ├── video-player │ ├── video-player.json │ ├── video-player.wxml │ ├── video-player.js │ └── video-player.wxss └── private-modal │ ├── private-modal.json │ ├── private-modal.wxml │ ├── private-modal.wxss │ └── private-modal.js ├── static └── images │ ├── beef.png │ ├── chef.png │ ├── text.png │ ├── close.png │ ├── video.png │ ├── pause-audio.png │ ├── default-audio.png │ ├── loading-icon.png │ └── loading-content.png ├── sitemap.json ├── app.wxss ├── project.private.config.json ├── .gitignore ├── app.js ├── pages └── index │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ ├── index.js │ └── Food.js ├── app.json ├── utils ├── stats.js └── util.js ├── .eslintrc.js ├── package.json ├── README.md ├── project.config.json ├── miniprogram_npm └── umtrack-wx │ └── index.js └── animate.wxss /components/card/card.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/loading/loading.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/audio-player/audio-player.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/video-player/video-player.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/private-modal/private-modal.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /static/images/beef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/beef.png -------------------------------------------------------------------------------- /static/images/chef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/chef.png -------------------------------------------------------------------------------- /static/images/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/text.png -------------------------------------------------------------------------------- /static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/close.png -------------------------------------------------------------------------------- /static/images/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/video.png -------------------------------------------------------------------------------- /static/images/pause-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/pause-audio.png -------------------------------------------------------------------------------- /static/images/default-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/default-audio.png -------------------------------------------------------------------------------- /static/images/loading-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/loading-icon.png -------------------------------------------------------------------------------- /static/images/loading-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kivisense/wechat-kivicube-slam-plugin-api-sample/HEAD/static/images/loading-content.png -------------------------------------------------------------------------------- /sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /components/audio-player/audio-player.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | @import "./animate.wxss"; 3 | 4 | .-kivi-dim { 5 | backdrop-filter: blur(5px); 6 | } 7 | 8 | .layer { 9 | position: absolute; 10 | left: 0; 11 | top: 0; 12 | width: 100%; 13 | height: 100%; 14 | overflow: hidden; 15 | } -------------------------------------------------------------------------------- /project.private.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", 3 | "projectname": "wechat-kivicube-slam-plugin-api-sample", 4 | "setting": { 5 | "compileHotReLoad": true 6 | } 7 | } -------------------------------------------------------------------------------- /components/loading/loading.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | data: { 3 | showLoading: false, 4 | }, 5 | methods: { 6 | show() { 7 | this.setData({ 8 | showLoading: true, 9 | }); 10 | }, 11 | hidden() { 12 | this.setData({ 13 | showLoading: false, 14 | }); 15 | }, 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | # /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | import uma from "umtrack-wx"; 2 | 3 | // app.js 4 | App({ 5 | umengConfig: { 6 | appKey: "61d50c5ae014255fcbd8c71b", 7 | useOpenid: false, 8 | autoGetOpenid: false, 9 | debug: false, 10 | uploadUserInfo: false, 11 | enableVerify: true // 测试验证数据使用 12 | }, 13 | onLaunch() {}, 14 | globalData: { 15 | uma, 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /components/loading/loading.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 加载中,请稍后... 8 | 9 | -------------------------------------------------------------------------------- /components/audio-player/audio-player.wxss: -------------------------------------------------------------------------------- 1 | /* components/audio-player/audio-player.wxss */ 2 | @import "../../app.wxss"; 3 | 4 | .player-btn-layout { 5 | position: relative; 6 | width: 10.67vw; 7 | height: 10.67vw; 8 | border-radius: 50%; 9 | background-color: rgba(255, 255, 255, 0.4); 10 | } 11 | 12 | .icon-img { 13 | position: absolute; 14 | left: 50%; 15 | top: 50%; 16 | width: 6.4vw; 17 | height: 6.4vw; 18 | transform: translateX(-50%) translateY(-50%); 19 | } -------------------------------------------------------------------------------- /components/card/card.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{detail.title}} 7 | ¥{{ detail.price }}元/份 8 | 9 | 10 | 11 | 12 | 立即下单 13 | -------------------------------------------------------------------------------- /pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "disableScroll": true, 3 | "navigationStyle": "custom", 4 | "usingComponents": { 5 | "kivicube-slam": "plugin://kivicube-slam/kivicube-slam", 6 | "Loading": "../../components/loading/loading", 7 | "food-card": "../../components/card/card", 8 | "audio-player": "../../components/audio-player/audio-player", 9 | "private-modal": "../../components/private-modal/private-modal", 10 | "video-player": "../../components/video-player/video-player" 11 | } 12 | } -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index" 4 | ], 5 | "window": { 6 | "backgroundTextStyle": "light", 7 | "navigationBarBackgroundColor": "#fff", 8 | "navigationBarTitleText": "Weixin", 9 | "navigationBarTextStyle": "black" 10 | }, 11 | "__usePrivacyCheck__": true, 12 | "style": "v2", 13 | "sitemapLocation": "sitemap.json", 14 | "plugins": { 15 | "kivicube-slam": { 16 | "version": "1.3.11", 17 | "provider": "wx12ad8a61f049ea02" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /utils/stats.js: -------------------------------------------------------------------------------- 1 | const { benchmarkLevel } = wx.getSystemInfoSync(); 2 | /** 3 | * 友盟埋点 4 | * @param {String} eventId 事件id 5 | * @param {Object} [params={}] 属性 6 | */ 7 | export function stats(eventId, params = {}) { 8 | try { 9 | const allParams = Object.assign({ benchmarkLevel: `${benchmarkLevel}` }, params); 10 | wx.uma.trackEvent(`${eventId}2`, allParams); 11 | } catch (e) {} 12 | } 13 | 14 | /** 15 | * 计算经过的时间等级,以每0.5s为一个分界线 16 | * @param {Number} startTime 开始时间戳 17 | * @returns {Number} 时间等级 18 | */ 19 | export function getTimeLevel(startTime) { 20 | try { 21 | return Math.ceil((Date.now() - startTime) / 500) + ''; 22 | } catch (e) { 23 | return "1"; 24 | } 25 | } -------------------------------------------------------------------------------- /components/card/card.js: -------------------------------------------------------------------------------- 1 | // components/card/card.js 2 | import { stats } from "../../utils/stats"; 3 | 4 | Component({ 5 | properties: { 6 | detail: { 7 | default: {}, 8 | type: Object, 9 | }, 10 | }, 11 | methods: { 12 | buyNow() { 13 | wx.showModal({ 14 | title: "立即下单", 15 | content: "这是演示示意,实际可以跳转下单页面", 16 | showCancel: true, 17 | cancelText: "取消", 18 | confirmText: "确定", 19 | success: (result) => { 20 | if (result.confirm) { 21 | } 22 | }, 23 | fail: () => {}, 24 | complete: () => {}, 25 | }); 26 | 27 | stats("ar_click_orderNow"); 28 | }, 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /components/video-player/video-player.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 制作方法 4 | 5 | 6 | 9 | 10 |