Browse Source

feat: 开发完成

dev
jiannibang 4 years ago
parent
commit
3eb218e821
  1. 10
      .mini-ide/compileMode.json
  2. 4
      .mini-ide/project-ide.json
  3. 7
      app.js
  4. 2
      app.json
  5. 5
      pages/index/index.axml
  6. 14
      pages/index/index.js

10
.mini-ide/compileMode.json

@ -0,0 +1,10 @@
{
"modes": [
{
"title": "测试二维码",
"page": "pages/index/index",
"chInfo": "ch_scan",
"query": "qrCode=https%3A%2F%2Fcdn.1000my.cn%2Fqrcode%2F423ca563-a82d-4ee6-a375-c5a80d138eb5%2F%3Fs%3D5_10_%E6%82%A8%E7%9A%84%E4%BD%8D%E7%BD%AE%26e%3DF5-04-05"
}
]
}

4
.mini-ide/project-ide.json

@ -1,3 +1,5 @@
{ {
"enableLegacyRemoteDebug": false
"enableLegacyRemoteDebug": false,
"ignoreWebViewDomainCheck": false,
"ignoreHttpDomainCheck": false
} }

7
app.js

@ -2,10 +2,13 @@ App({
onLaunch(options) { onLaunch(options) {
// 第一次打开 // 第一次打开
// options.query == {number:1} // options.query == {number:1}
console.info('App onLaunch');
console.info("App onLaunch", options);
if (options.query && options.query.qrCode) {
this.qrCode = options.query.qrCode.split("?")[1];
}
}, },
onShow(options) { onShow(options) {
// 从后台被 scheme 重新打开 // 从后台被 scheme 重新打开
// options.query == {number:1} // options.query == {number:1}
},
}
}); });

2
app.json

@ -3,6 +3,6 @@
"pages/index/index" "pages/index/index"
], ],
"window": { "window": {
"defaultTitle": "My App"
"defaultTitle": "千目GO"
} }
} }

5
pages/index/index.axml

@ -1,4 +1 @@
<view>
this is a blank page
</view>
<web-view src="https://cdn.1000my.cn/qianmugo/index.html{{query}}" />

14
pages/index/index.js

@ -1,7 +1,11 @@
Page({ Page({
data: {
query: ""
},
onLoad(query) { onLoad(query) {
// 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`); console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
const app = getApp();
this.setData({ query: `?t=${new Date().getTime()}#/?${app.qrCode}` });
}, },
onReady() { onReady() {
// 页面加载完成 // 页面加载完成
@ -27,9 +31,9 @@ Page({
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
return { return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
title: "My App",
desc: "My App description",
path: "pages/index/index"
}; };
},
}
}); });

Loading…
Cancel
Save