init
This commit is contained in:
42
xhs-mini-demos/component-case/webview/webview.js
Normal file
42
xhs-mini-demos/component-case/webview/webview.js
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
const env = global.env;
|
||||
|
||||
const getEnv = (env) => {
|
||||
if (env === 'sit'){
|
||||
return '.sit';
|
||||
}
|
||||
|
||||
if (env === 'beta'){
|
||||
return '.beta';
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
};
|
||||
|
||||
// const url = `https://www${getEnv(env)}.xiaohongshu.com/miniapp/mid-page?fullscreen=true&disableDragBack=yes&disableBackForwardNavigationGestures=true&source=12345`
|
||||
const url = `https://e${getEnv(env)}.xiaohongshu.com/home`;
|
||||
|
||||
Page({
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: 'webview',
|
||||
path: 'page/component/pages/webview/webview',
|
||||
};
|
||||
},
|
||||
data: {
|
||||
url: url,
|
||||
},
|
||||
onLoad() {
|
||||
console.log('lemon1');
|
||||
},
|
||||
handleLoad() {
|
||||
console.log('load');
|
||||
},
|
||||
handleError(e) {
|
||||
console.log('error error', e);
|
||||
},
|
||||
handleMessage(e) {
|
||||
console.log('lemon', JSON.stringify(e));
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user