fogwind пре 2 година
комит
1b37307f6a
7 измењених фајлова са 232 додато и 0 уклоњено
  1. 4 0
      .gitignore
  2. 53 0
      config.xml
  3. BIN
      icon/icon150x150.png
  4. BIN
      image/loading.gif
  5. BIN
      launch/launch1080x1920.png
  6. 171 0
      pages/main/main.stml
  7. 4 0
      res/manifest.xml

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+.apicloud
+.bin
+.yonstudio
+.svn

+ 53 - 0
config.xml

@@ -0,0 +1,53 @@
+<widget id="A1741688086024683527" version="0.0.1">
+
+	<name>Alipearl Hair</name>
+
+	<description>This APP is developed for the corresponding APP end of website (www.alipearlhair.com).</description>
+
+	<author email="server@alipearlhair.com" href="https://www.alipearlhair.com">alipearl</author>
+
+	<preference name="avm" value="true"/>
+
+	<preference name="android_abi" value="arm64-v8a"/>
+
+	<preference name="userAgent" value="APICloud"/>
+
+	<preference name="checkSslTrusted" value="false"/>
+
+	<preference name="appCertificateVerify" value="false"/>
+
+	<preference name="pageBounce" value="false"/>
+
+	<preference name="appBackground" value="rgba(0,0,0,0.0)"/>
+
+	<preference name="windowBackground" value="rgba(0,0,0,0.0)"/>
+
+	<preference name="frameBackgroundColor" value="rgba(0,0,0,0.0)"/>
+
+	<preference name="hScrollBarEnabled" value="false"/>
+
+	<preference name="vScrollBarEnabled" value="false"/>
+
+	<preference name="autoLaunch" value="true"/>
+
+	<preference name="fullScreen" value="false"/>
+
+	<preference name="autoUpdate" value="true"/>
+
+	<preference name="smartUpdate" value="false"/>
+
+	<preference name="debug" value="false"/>
+
+	<preference name="statusBarAppearance" value="false"/>
+
+	<content src="pages/main/main"/>
+
+	<access origin="*"/>
+
+	<permission name="readPhoneState"/>
+
+	<permission name="fileSystem"/>
+
+	<permission name="internet"/>
+
+</widget>

BIN
icon/icon150x150.png


BIN
image/loading.gif


BIN
launch/launch1080x1920.png


+ 171 - 0
pages/main/main.stml

@@ -0,0 +1,171 @@
+<template>
+	<safe-area class="page">
+		<view class="body">
+			<img id='loading' class="img" src="../../image/loading.gif" />
+		</view>
+	</safe-area>
+</template>
+<script>
+export default {
+	name: 'main',
+	apiready() {
+		var that = this;
+
+        api.openFrame({
+			name: 'main',
+			url: 'https://m.alipearlhair.com',
+			rect: {
+				x: 0,
+				y: 0,
+				w: 'auto',
+				h: 'auto'
+			},
+			useWKWebView: true,
+			historyGestureEnabled: true,
+			bounces: false,
+			progress:{
+                type:'page'
+            }
+		});
+		api.setStatusBarStyle({
+			style: 'light'
+		});
+
+		api.setFrameClient({
+		    frameName:'main'
+		},function(ret){
+		    that.onBrowserStateChange(ret);
+		});
+		this.removeLogic();
+        api.addEventListener({
+            name: 'keyback'
+        }, function(ret, err){
+            api.historyBack({
+                frameName:'main'
+            },function(ret,err){
+                if(!ret.status){
+                    api.closeWidget();
+                }
+            });
+        });
+		this.removeLogic();
+
+		// this.googlePushInit();
+	},
+	data() {
+		return {
+			msg: "Hello APICloud",
+			launchRemoved: false,
+			loadingRemoved: false,
+		};
+	},
+	methods: {
+
+		onBrowserStateChange(ret){
+			if(0 == ret.state){//开始加载
+				if(!this.launchRemoved){
+					this.launchRemoved = true;
+					this.removeLaunch();
+				}
+			}
+			if(2 == ret.state){
+				if(!this.loadingRemoved){
+					this.loadingRemoved = true;
+					document.getElementById('loading').style.display = 'none';
+				}
+			}
+		},
+		
+		removeLogic(){
+			var that = this;
+			setTimeout(function(){
+				if(!that.launchRemoved){
+					that.launchRemoved = true;
+					that.removeLaunch();
+				}
+			}, 3000);
+		},
+
+		removeLaunch(){
+			// 移除启动图
+			api.removeLaunchView({
+				animation:{
+					type:"fade",
+					subType:"from_right",
+					duration:300
+				}
+			});
+		},
+		/*
+		// google推送
+		googlePushInit() {
+			var googlePush = api.require('googlePush'); 
+			// 初始化 
+			googlePush.initFcm(function(ret, err) {
+				console.log('---initFcm satrt---');
+				console.log(JSON.stringify(ret));
+				console.log(JSON.stringify(err));
+				console.log('---initFcm end---');
+				// 获取token
+				googlePush.registerToken(function(ret, err){
+					console.log('---registerToken satrt---');
+					console.log(JSON.stringify(ret));
+					console.log(JSON.stringify(err));
+					console.log('---registerToken end---');
+				});
+				// 收到消息时会触发
+				googlePush.addOnMessageLisener(function(ret){
+					console.log('---addOnMessageLisener satrt---');
+					console.log(JSON.stringify(ret));
+					console.log('---addOnMessageLisener end---');
+				});
+			});
+			// 监听通知栏消息被点击
+			api.addEventListener({
+				name:'appintent'
+			},function(ret,err){
+				console.log('---appintent satrt---');
+				console.log(JSON.stringify(ret));
+				console.log(JSON.stringify(err));
+				console.log('---appintent end---');
+				var appParam = ret.appParam;
+				if(api.systemType == 'ios'){
+					var iosUrl = ret.iosUrl;
+				} else {
+					var sourceAppId = ret.sourceAppId;
+					console.log(JSON.stringify(appParam));
+					if(appParam.url) {
+						api.openWin({
+							name: 'WestKiss Sale',
+							url: appParam.url,
+							pageParam: {
+								name: 'test'
+							}
+						});
+					}
+				}
+			});
+		}
+		*/
+	}
+};
+</script>
+<style>
+.page {
+	width: 100%;
+	height: 100%;
+	background: #fff;
+	display:flex;
+	justify-content:center;
+	align-items: center;
+}
+.body{
+	position: relative;
+}
+.img{
+    display:block;
+	width: 40px;
+	height: 40px;
+}
+
+</style>

+ 4 - 0
res/manifest.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<manifest>
+    <application name="targetSdkVersion" value="31"/>
+</manifest>