Commit 0d86e200 authored by haiyoucuv's avatar haiyoucuv

1

parents
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxBlameSettings">
<option name="version" value="2" />
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlRequiredAltAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/blank.iml" filepath="$PROJECT_DIR$/.idea/blank.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
{
"disableRemoteDebugSourcePanel": false,
"enableLegacyRemoteDebug": false,
"enableCloudBuild": false,
"ignoreWebViewDomainCheck": true,
"ignoreHttpDomainCheck": true,
"enableBackgroundBuild": false
}
\ No newline at end of file
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
/**! __CODEPLACEHOLDER_START__ */ /*[PositionForHostUserCodeBegin]*/ /**! __CODEPLACEHOLDER_END__ */
\ No newline at end of file
/**! __CODEPLACEHOLDER_START__ */ /*[PositionForClientEntryCodeBegin]*/ /**! __CODEPLACEHOLDER_END__ */
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
/**! __CODEPLACEHOLDER_START__ */ /*[PositionForHostEntryCodeBegin]*/ /**! __CODEPLACEHOLDER_END__ */
if(!self.__appxInited) {
self.__appxInited = 1;
require('./config$');
require('./importScripts$');
function getUserAgentInPlatformWeb() {
return typeof navigator !== 'undefined' ? navigator.swuserAgent || navigator.userAgent || '' : '';
}
if(getUserAgentInPlatformWeb() && (getUserAgentInPlatformWeb().indexOf('LyraVM') > 0 || getUserAgentInPlatformWeb().indexOf('AlipayIDE') > 0) ) {
var AFAppX = self.AFAppX.getAppContext ? self.AFAppX.getAppContext().AFAppX : self.AFAppX;
} else {
importScripts('https://appx/af-appx.worker.min.js');
var AFAppX = self.AFAppX;
}
self.getCurrentPages = AFAppX.getCurrentPages;
self.getApp = AFAppX.getApp;
self.Page = AFAppX.Page;
self.App = AFAppX.App;
self.my = AFAppX.bridge || AFAppX.abridge;
self.abridge = self.my;
self.Component = AFAppX.WorkerComponent || function(){};
self.$global = AFAppX.$global;
self.requirePlugin = AFAppX.requirePlugin;
if(AFAppX.registerApp) {
AFAppX.registerApp({
appJSON: appXAppJson,
});
}
function success() {
require('../../app');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
importScripts(`https://appx/af-appx.worker.min.js`);
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
if(!self.__appxInited) {
self.__appxInited = 1;
require('./config$');
require('./importScripts$');
var AFAppX = self.AFAppX;
self.getCurrentPages = AFAppX.getCurrentPages;
self.getApp = AFAppX.getApp;
self.Page = AFAppX.Page;
self.App = AFAppX.App;
self.my = AFAppX.bridge || AFAppX.abridge;
self.abridge = self.my;
self.Component = AFAppX.WorkerComponent || function(){};
self.$global = AFAppX.$global;
self.requirePlugin = AFAppX.requirePlugin;
if(AFAppX.registerApp) {
AFAppX.registerApp({
appJSON: appXAppJson,
});
}
function success() {
require('../../app');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
page {
flex: 1;
display: flex;
background: #f7f7f7;
}
App({
globalData: {},
onLaunch(options) {
// Page opens for the first time
console.info('App onLaunch');
const {query} = options;
if(query){
this.globalData.query = query;
}
},
onShow(options) {
// Reopened by scheme from the background
},
});
{
"pages": [
"pages/index/index"
],
"window": {
"defaultTitle": "My App",
"transparentTitle": "none"
}
}
<!-- <button size="default" type="primary" onTap="getAuthCode">Button</button> -->
<!-- duiba -->
<!-- <web-view id="web-view" src="https://credits-test.duibatest.com.cn/app/skin/Cave_Cruiser.html" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="https://credits-test.duibatest.com.cn/app/skin/Treasure_Mania.html" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="https://credits-test.duibatest.com.cn/app/skin/Purrfect_Jump.html" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="https://credits-test.duibatest.com.cn/app/skin/Starship_Showdown.html" onMessage="onMessage"/> -->
<!-- tngd -->
<!-- <web-view id="web-view" src="https://gamification-sbx.tngdigital.com.my/app/skin/Cave_Cruiser.html" onMessage="onMessage"/> -->
<web-view id="web-view" src="https://gamification-sbx.tngdigital.com.my/app/skin/Treasure_Mania.html" onMessage="onMessage"/>
<!-- <web-view id="web-view" src="https://gamification-sbx.tngdigital.com.my/app/skin/Purrfect_Jump.html" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="https://gamification-sbx.tngdigital.com.my/app/skin/Starship_Showdown.html" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="https://activity.m.duiba.com.cn/customShare/share?id=Did1NTc3MTE" onMessage="onMessage"/> -->
<!-- <web-view id="web-view" src="http://localhost:5173/" onMessage="onMessage"></web-view> -->
<!-- <web-view id="web-view" src="http://localhost:7456/" onMessage="onMessage"></web-view> -->
<!-- <button size="default" type="primary" onTap="testBack">Button</button> -->
\ No newline at end of file
Page({
onLoad(query) {
// Page load
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
this.webViewContext = my.createWebViewContext('web-view');
},
testBack(){
my.call("popWindow");
},
getAuthCode() {
return new Promise((resolve) => {
my.getAuthCode({
scopes: ["BASE_USER_INFO", "USER_NAME"],
success: (res) => {
resolve(res.authCode);
console.log(res);
},
fail: (res) => {
resolve(null);
console.error(res);
},
});
});
},
// onShareAppMessage() {
// // Back to custom sharing information
// return {
// title: 'My App',
// desc: 'My App description',
// path: 'pages/index/index',
// };
// },
async onMessage(e) {
const eventType = e.detail.type;
console.log(123123, e);
if (eventType == "getAuthCode") {
const authCode = await this.getAuthCode();
console.log(authCode);
this.webViewContext.postMessage({type: eventType, 'authCode': authCode});
} else if(eventType == "getMiniAppQuery"){
this.webViewContext.postMessage({type: eventType, query: getApp().globalData.query});
} else if(eventType == "popWindow"){
my.call("popWindow");
} else if(eventType == "goWallet") {
// sandbox:
const scheme = "tngdwallet://client/dl/webview?url=https%3A%2F%2Fsite-sandbox.tngdigital.com.my%2Fs%2Floyalty%2Findex.html%23%2Fcollections%3FbackAction%3Ddefault";
// sit:
// const scheme = "tngdwallet://client/dl/webview?url=https%3A%2F%2Fsite-sit.tngdigital.com.my%2Fs%2Floyalty%2Findex.html%23%2Fcollections%3FbackAction%3Ddefault";
// prod:
// const scheme = "tngdwallet://client/dl/webview?url=https%3A%2F%2Fcdn.tngdigital.com.my%2Fs%2Floyalty%2Findex.html%23%2Fcollections%3FbackAction%3Ddefault";
my.call(
'startDeepLink',
{scheme},
function(){
console.log('success')
},
function(){
console.log('fail')
}
);
} else if(eventType == "tngdMPEventTagging") {
const {pageView, clickName, additionalInfo} = e.detail;
my.call(
'tngdMPEventTagging',
{
pageView: pageView,
clickName: clickName,
additionalInfo: additionalInfo,
},
function(){
console.log('success')
},
function(){
console.log('fail')
}
);
}
},
});
{
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment