Compare commits

..

33 Commits

Author SHA1 Message Date
6227aaf931 修改版本号 2025-03-31 16:43:54 +08:00
ddfedd2058 更换云空间后,修改推送配置 2025-03-29 17:19:12 +08:00
934fe8de1f 修改ios版本号与打包配置 2025-03-24 15:18:44 +08:00
61459264ef 修改版本号与打包配置 2025-03-24 09:44:44 +08:00
59982f4f46 新增手动创建通知栏消息 2025-03-17 14:23:11 +08:00
scout
687371b1e6 fixbug 2024-12-31 09:17:33 +08:00
scout
f7b500f715 更换隐私协议 2024-12-30 16:17:42 +08:00
scout
a9d3014b28 feat(push): 添加魅族推送配置项 2024-12-24 10:40:17 +08:00
ed3ebf0b85 Merge branch 'master' of http://172.16.100.91:3000/xingyy/oa-base 2024-12-17 14:06:44 +08:00
a2b3ef0cf8 fix 2024-12-17 14:06:42 +08:00
scout
d6fb4b5688 add ver 2024-12-12 15:55:06 +08:00
scout
7bc12f11a0 add条件判断 2024-12-12 15:25:32 +08:00
67e81c1a80 Merge branch 'master' of http://172.16.100.91:3000/xingyy/oa-base 2024-12-12 10:21:09 +08:00
c0b331bfb5 启动页 更新 2024-12-12 10:21:07 +08:00
scout
acace8dc21 changemain 2024-12-12 09:31:54 +08:00
scout
446498b893 推送,分享 2024-12-11 15:31:56 +08:00
022aaa9109 Merge branch 'master' of http://172.16.100.91:3000/xingyy/oa-base 2024-12-04 16:36:57 +08:00
92d8327930 fix 2024-12-04 16:36:50 +08:00
scout
c2168272de addfile 2024-12-04 16:35:02 +08:00
scout
6d913b9288 addshare 2024-12-04 16:33:24 +08:00
scout
951aabfe55 addnetconfirm 2024-10-28 15:31:46 +08:00
a7bc5506de 1.切换环境配置至生产环境
2. 调整webview样式以适配状态栏高度
2024-10-18 10:41:57 +08:00
scout
e6833725e7 Merge branch 'master' of http://172.16.100.91:3000/xingyy/oa-base 2024-10-18 10:29:20 +08:00
scout
1bd2bffedf changewebviewway 2024-10-18 10:29:02 +08:00
86dbbcd6a7 commit message:```
移除Android应用的包名、证书别名和密钥密码信息

从文件'files/android/readme.md'中移除了Android应用的包名、证书别名和密钥密码信息。这些敏感信息不应公开,以确保应用的安全性。
```
2024-10-18 10:26:43 +08:00
6e8d2d38e3 fix 2024-10-18 10:25:36 +08:00
b9a7864433 1123 2024-10-12 14:21:12 +08:00
5e0d4bea19 1123 2024-10-10 16:05:08 +08:00
524bfb97fa 1123 2024-09-25 16:12:45 +08:00
8be6d5316d 1123 2024-09-25 16:11:12 +08:00
b44bd80ecd 1123 2024-09-25 15:42:01 +08:00
695f33d77b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	manifest.json
2024-09-20 13:51:27 +08:00
c955087e49 1123 2024-09-20 13:51:08 +08:00
42 changed files with 606 additions and 931 deletions

View File

@ -13,7 +13,7 @@
"h5" : {
"launchtype" : "local"
},
"provider" : "alipay",
"provider" : "aliyun",
"type" : "uniCloud"
},
{

117
App.vue
View File

@ -1,87 +1,78 @@
<script>
import silenceUpdate from '@/uni_modules/rt-uni-update/js_sdk/silence-update.js' //
import config from './config';
export default {
data() {
return {
//
lastNetworkStatus: null
}
},
methods: {
// APP
isFirstOpen() {
let isFirstOpen = uni.getStorageSync('isFirstOpen')
if (!isFirstOpen) {
uni.setStorageSync('isFirstOpen', true)
return true
}
return false
},
networkStatusChange(res) {
console.log(res)
if (res.isConnected) {
//
if (this.isFirstOpen()) {
uni.redirectTo({
url: "/pages/index/index",
url: '/pages/index/index'
})
}
//
if (this.lastNetworkStatus === false) {
uni.showModal({
title: "提示",
content: "当前设备网络发生更改,是否刷新页面?",
showCancel: true,
success: function (res) {
if (res.confirm || res.cancel) {
uni.redirectTo({
url: '/pages/index/index'
})
}
},
});
}
} else {
uni.redirectTo({
url: "/pages/networko/index",
});
url: '/pages/networko/index'
})
}
},
//
getLocalVersion() {
return new Promise((resolve, reject) => {
plus.runtime.getProperty(plus.runtime.appid, function (widgetInfo) {
resolve(widgetInfo);
});
});
},
//
getServerVersion(widgetInfo) {
return new Promise((resolve, reject) => {
uni.request({
url: config.apiBaseUrl + "/version-info",
method:'POST',
data:{
edition_type:widgetInfo.appid,
version_type:uni.getSystemInfoSync().platform,
edition_number:Number(widgetInfo.versionCode)
},
success: (res) => {
console.log("res4", res.data.data);
resolve(res.data.data);
},
});
});
},
this.lastNetworkStatus = res.isConnected
//
checkUpdate() {
//
this.getLocalVersion().then((widgetInfo) => {
console.log("本地信息", widgetInfo);
console.log("config", config);
this.getServerVersion(widgetInfo).then((serverVersionData) => {
if (Number(widgetInfo.versionCode) !== serverVersionData.edition_number) {
uni.navigateTo({
url:
"/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update?obj=" +
JSON.stringify(serverVersionData),
});
}
});
});
},
onLaunch: function () {
console.log('onLaunch')
},
onLaunch: function () {},
onShow: function () {
console.log("App 1onShow");
this.checkUpdate();
// silenceUpdate('555')
// uni.navigateTo({
// url: "./uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update",
// });
uni.onNetworkStatusChange(this.networkStatusChange);
uni.getNetworkType({
success: (res) => {
if (res.networkType === "none") {
if (res.networkType === 'none') {
uni.redirectTo({
url: "/pages/networko/index",
});
url: '/pages/networko/index'
})
}
},
});
uni.onNetworkStatusChange(this.networkStatusChange);
}
})
},
onHide: function () {
uni.offNetworkStatusChange(this.networkStatusChange);
},
};
uni.offNetworkStatusChange(this.networkStatusChange)
}
}
</script>
<style>

View File

@ -1,13 +1,13 @@
{
"version" : "1",
"prompt" : "template",
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“平台服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://oa.szjixun.cn/#/pages/login/serveInfo\">《用户服务协议》</a>和<a href=\"https://oa.szjixun.cn/#/pages/login/privateInfo\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"title" : "温馨提示",
"message" : "   感谢您对oa考勤系统的信赖!在使用前请务必阅读并同意<a href=\"https://oa-a.szjixun.cn/#/pages/setting/severInfo\">《用户服务协议》</a>和<a href=\"https://oa-a.szjixun.cn/#/pages/setting/privateInfo\">《隐私政策》</a>,我们将按照协议和政策内容为您提供服务。<br/>oa考勤系统系统的基本功能为打卡、审批等考勤管理及协同办公服务。基于您的授权及服务之必要基本功能的必要个人信息包括移动电话号码、账号信息等。您同意<a href=\"https://oa-a.szjixun.cn/#/pages/setting/privateInfo\">《隐私政策》</a>仅代表同意oa考勤系统在您使用基本功能时处理相关必要信息。附加功能如需处理个人信息将单独征求您的同意。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "不同意",
"second" : {
"title" : "确认提示",
"message" : "  进入应用前,你需先同意<a href=\"https://oa.szjixun.cn/#/pages/login/serveInfo\">《用户服务协议》</a>和<a href=\"https://oa.szjixun.cn/#/pages/login/privateInfo\">《隐私政策》</a>,否则将退出应用。",
"title" : "  您需要同意本隐私政策才能继续使用oa考勤系统",
"message" : "  若您不同意本<a href=\"https://oa-a.szjixun.cn/#/pages/setting/privateInfo\">《隐私政策》</a>,很遗憾我们将无法为您提供服务",
"buttonAccept" : "同意并继续",
"buttonRefuse" : "退出应用"
},

View File

@ -1,16 +1,16 @@
const env = 'test';
const env = 'prod';
const configs = {
LocalTest: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
h5Url:'http://192.168.88.51:8080/#/'
h5Url: 'http://192.168.88.61:2367/#/'
},
dev: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
h5Url:'https://192.168.88.27:8080/#/'
h5Url: 'http://192.168.88.47:2367/#/'
},
test: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
h5Url:'https://192.168.88.29:8080/#/'
h5Url: 'http://114.218.158.24:8042/#/'
},
prod: {
apiBaseUrl: 'https://oa-a.szjixun.cn/api',

Binary file not shown.

View File

@ -33,12 +33,12 @@
<rect key="frame" x="150.66666666666666" y="391.66666666666669" width="112.66666666666666" height="112.66666666666669"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="hello uniapp" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QBH-Ne-rcx">
<!-- <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="hello uniapp" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QBH-Ne-rcx">
<rect key="frame" x="168" y="835" width="78.333333333333314" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</label> -->
</subviews>
<viewLayoutGuide key="safeArea" id="IW3-oA-Ytg"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 KiB

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -1,3 +1,3 @@
Android 包名 uni.UNI4796942
Android 包名 uni.UNI70C49A3
证书别名oaapp
密钥密码12345678

BIN
files/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
files/pushicon/18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
files/pushicon/24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
files/pushicon/36.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
files/pushicon/48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
files/pushicon/72.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1 +1,5 @@
Android 包名 uni.UNI70C49A3
证书别名oaapp
密钥密码12345678
Bundle ID:com.fonchain.attendance
IOS:私钥证书密码 dis dev 都是 12345678

View File

@ -3,7 +3,6 @@ import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({

View File

@ -2,11 +2,14 @@
"name" : "oa考勤系统",
"appid" : "__UNI__4796942",
"description" : "",
"versionName" : "2.1.4",
"versionCode" : 214,
"versionName" : "2.3.2",
"versionCode" : 232,
"transformPx" : false,
/* 5+App */
"app-plus" : {
"compatible" : {
"ignoreVersion" : true //trueHBuilderX1.9.0
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
@ -21,7 +24,10 @@
"Camera" : {},
"Geolocation" : {},
"Maps" : {},
"LivePusher" : {}
"LivePusher" : {},
"Push" : {},
"Barcode" : {},
"Share" : {}
},
/* */
"distribute" : {
@ -32,13 +38,11 @@
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
@ -48,7 +52,8 @@
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
"autoSdkPermissions" : false,
"targetSdkVersion" : 34
"targetSdkVersion" : 34,
"minSdkVersion" : 21
},
/* ios */
"ios" : {
@ -65,33 +70,37 @@
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
},
"baidu" : {
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "5zzMAq3ofL5H5KfxRcf0zDMLTimvGIb0",
"appkey_android" : "ahdcPcBfatf61zRAgNl9SpBGUEURsnXN"
}
},
"ad" : {},
"share" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
"appid" : "wx3a0f78634d074b23",
"UniversalLinks" : "https://warehouse.szjixun.cn/oa_backend/static/aretree/"
}
},
"push" : {
"unipush" : {
"offline" : true,
"oppo" : {},
"vivo" : {},
"mi" : {},
"honor" : {},
"version" : "2",
"offline" : true
"icons" : {
"small" : {
"ldpi" : "unpackage/pushicon/18.png",
"mdpi" : "unpackage/pushicon/24.png",
"hdpi" : "unpackage/pushicon/36.png",
"xhdpi" : "unpackage/pushicon/48.png",
"xxhdpi" : "unpackage/pushicon/72.png"
}
},
"maps" : {
"baidu" : {
"appkey_ios" : "5zzMAq3ofL5H5KfxRcf0zDMLTimvGIb0",
"appkey_android" : "ahdcPcBfatf61zRAgNl9SpBGUEURsnXN"
}
"meizu" : {}
}
},
"maps" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
@ -126,13 +135,13 @@
},
"splashscreen" : {
"useOriginalMsgbox" : true,
"androidStyle" : "common",
"androidStyle" : "default",
"android" : {
"hdpi" : "static/image/sy.png",
"xhdpi" : "static/image/sy.png",
"xxhdpi" : "static/image/sy.png"
"hdpi" : "static/image/drawable-hdpi/sy.9.png",
"xhdpi" : "static/image/drawable-xhdpi/sy.9.png",
"xxhdpi" : "static/image/drawable-xxhdpi/sy.9.png"
},
"iosStyle" : "common",
"iosStyle" : "storyboard",
"ios" : {
"storyboard" : "files/CustomStoryboard.zip"
}

View File

@ -1 +0,0 @@
{}

View File

@ -1,6 +1,5 @@
{
"pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
@ -10,27 +9,14 @@
},
{
"path" : "pages/networko/index",
"style": {
"style" :
{
"navigationBarTitleText": "uni-app",
"navigationStyle": "custom"
}
},
}
{
"path": "uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update",
"style": {
"app-plus": {
"animationDuration": 200,
"animationType": "fade-in",
"background": "transparent",
"backgroundColorTop": "transparent",
"popGesture": "none",
"scrollIndicator": false,
"titleNView": false
},
"disableScroll": true
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@ -2,63 +2,107 @@
<web-view class="webview" @message="webLoad" style="flex: 1;" :src="config.h5Url"></web-view>
</template>
<script setup>
import { ref } from 'vue'
import config from "../../config";
import {onExit } from "@dcloudio/uni-app";
import { ref, onMounted } from 'vue'
import { onExit, onShow } from "@dcloudio/uni-app";
import config from "../../config"
onShow(() => {
// const { statusBarHeight } = uni.getSystemInfoSync()
// const wv1 = plus.webview.getWebviewById("custom-webview");
// let wv = null;
// if (wv1) {
// wv = wv1;
// } else {
// wv = plus.webview.create(config.h5Url, "custom-webview", {
// top: statusBarHeight,
// bottom: 0,
// });
// }
// var pages = getCurrentPages();
// var page = pages[pages.length - 1];
// var currentWebview = page.$getAppWebview();
})
import { Communication } from '../../utils/communication.js';
const commun = new Communication()
const shareH5 = () => {
uni.share({
provider: 'weixin',
scene: "WXSceneSession",
type: 0,// 5
imageUrl: 'https://th.bing.com/th?id=ORMS.41c34644e7e67f95a14620e77064b5d9&pid=Wdp&w=268&h=140&qlt=90&c=1&rs=1&dpr=1&p=0', //
title: '分享的标题',
href: 'https://www.baidu.com/',
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
//#ifdef APP-ANDROID
import {
registerRequestPermissionTipsListener,
unregisterRequestPermissionTipsListener,
setRequestPermissionTips
} from "@/uni_modules/uni-registerRequestPermissionTips"
// import {
// registerRequestPermissionTipsListener,
// unregisterRequestPermissionTipsListener,
// setRequestPermissionTips
// } from "@/uni_modules/uni-registerRequestPermissionTips"
const PermissionTips = {
"android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>",
"android.permission.CAMERA": "<h4 style=\"font-size:40px;\">正在访问相机权限</h4><font color=#cccccc>需要扫描二维码或拍照,是否允许打开相机?</font>",
"android.permission.WRITE_EXTERNAL_STORAGE": "<h4 style=\"font-size:40px;\">正在读取相册权限</h4><font color=#cccccc>我们需要获取访问您设备相册的权限,以便您能够选择并上传图片或视频到我们的应用中。</font>",
"android.permission.ACCESS_FINE_LOCATION": "<h4 style=\"font-size:40px;\">正在访问位置权限</h4><font color=#cccccc>需要获取您的位置信息,以便您能够进行考勤打卡。</font>",
"android.permission.ACCESS_COARSE_LOCATION": "<h4 style=\"font-size:40px;\">正在访问位置权限</h4><font color=#cccccc>需要获取您的位置信息,以便您能够进行考勤打卡。</font>"
}
onExit(() => {
unregisterRequestPermissionTipsListener()
})
// const PermissionTips = {
// "android.permission.CAMERA": "<h4 style=\"font-size:40px;\"></h4><font color=#cccccc></font>",
// "android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\"></h4><font color=#cccccc></font>"
// }
// onExit(()=>{
// unregisterRequestPermissionTipsListener()
// })
// const brand = uni.getSystemInfoSync().deviceBrand
// setRequestPermissionTips(PermissionTips)
// registerRequestPermissionTipsListener({
// onRequest: (e) => {
// console.log('onRequest',e)
// },
// onConfirm: (e) => {
const brand = uni.getSystemInfoSync().deviceBrand
setRequestPermissionTips(PermissionTips)
registerRequestPermissionTipsListener({
onRequest: (e) => {
console.log('onRequest', e)
},
onConfirm: (e) => {
// commun.sendToH5('permission-application', { action: 'open-permission', data: e });
// },
// onComplete: (e) => {
// commun.sendToH5('permission-application',{action:'close-permission',data:e});
},
onComplete: (e) => {
commun.sendToH5('permission-application', { action: 'close-permission', data: e });
// //
// if (brand.toLowerCase() === "huawei") {
// const tips = {}
// let hasDeniedPermission = false
// for (let k in PermissionTips) {
// if (e[k] !== "denied") {
// tips[k] = PermissionTips[k]
// } else {
// hasDeniedPermission = true
// }
// }
// setRequestPermissionTips(tips) //
// if (hasDeniedPermission)
// uni.showModal({
// content: ""
// })
// }
// }
// })
//
if (brand.toLowerCase() === "huawei") {
const tips = {}
let hasDeniedPermission = false
for (let k in PermissionTips) {
if (e[k] !== "denied") {
tips[k] = PermissionTips[k]
} else {
hasDeniedPermission = true
}
}
setRequestPermissionTips(tips) //
if (hasDeniedPermission)
uni.showModal({
content: "权限已经被拒绝,请前往设置中开启"
})
}
}
})
//#endif
const webLoad = (e) => {
const message = e.detail.data?.[0] || '';
commun.handleMessage(message);
};
function initializeWebView() {
const currentWebview = getCurrentPages().pop().$getAppWebview()
commun.setWebView(currentWebview.children()[0])
}
//load-complete
commun.registerHandler('load-complete', () => {
initializeWebView()
const { statusBarHeight } = uni.getSystemInfoSync()
commun.webViewObj.setStyle({
@ -67,6 +111,7 @@ commun.registerHandler('load-complete',()=>{
})
})
commun.registerHandler('getLocation', (data) => {
uni.getLocation({
type: 'gcj02',
@ -79,12 +124,50 @@ commun.registerHandler('getLocation',(data)=>{
},
})
})
const webLoad = (e) => {
const message = e.detail.data?.[0] || '';
commun.handleMessage(message);
};
commun.registerHandler('goCard', async (data) => {
await getCard(data.phone)
})
commun.registerHandler('createPushMessage', async (data) => {
uni.createPushMessage(JSON.parse(decodeURIComponent(data)))
})
//
async function getCard(phone) {
uni.request({
url: 'https://blockchain.szjixun.cn/api/e_card/info-phone',
method: 'POST',
data: {
phone: phone
},
success: (res) => {
const resData = res.data.data
uni.share({
provider: 'weixin',
scene: "WXSceneSession",
type: 5,// 5
imageUrl: 'https://e-cdn.fontree.cn/fonchain-main/prod/image/139/avatar/ababc42c-7654-47f8-b22b-29dc589c71f0.png', //
title: `${resData.name}的电子名片`,
miniProgram: {
id: "gh_97094c34debd",
path: `/pages/mine/index?uid=${resData.uid}&userType=${resData.userType}`,
type: 0,
webUrl: `/pages/mine/index?uid=${resData.uid}&userType=${resData.userType}`,
},
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
},
fail: (err) => {
console.log('getCard', err)
}
})
}
</script>
<style>
</style>
<style></style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 KiB

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -0,0 +1,14 @@
[
{
"IndexName": "index_device_id",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "device_id",
"Direction": "1"
}
],
"MgoIsUnique": true
}
}
]

View File

@ -0,0 +1,142 @@
{
"bsonType": "object",
"required": [],
"permission": {
"read": false,
"create": false,
"update": false,
"delete": false
},
"properties": {
"_id": {
"description": "ID系统自动生成"
},
"appid": {
"bsonType": "string",
"description": "DCloud appid"
},
"device_id": {
"bsonType": "string",
"description": "设备唯一标识"
},
"vendor": {
"bsonType": "string",
"description": "设备厂商"
},
"push_clientid": {
"bsonType": "string",
"description": "推送设备客户端标识"
},
"imei": {
"bsonType": "string",
"description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)"
},
"oaid": {
"bsonType": "string",
"description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)"
},
"idfa": {
"bsonType": "string",
"description": "iOS平台配置应用使用广告标识(IDFA)"
},
"imsi": {
"bsonType": "string",
"description": "国际移动用户识别码(International Mobile Subscriber Identification Number)"
},
"model": {
"bsonType": "string",
"description": "设备型号"
},
"platform": {
"bsonType": "string",
"description": "平台类型"
},
"uni_platform": {
"bsonType": "string",
"description": "uni-app 运行平台,与条件编译平台相同。"
},
"os_name": {
"bsonType": "string",
"description": "ios|android|windows|mac|linux "
},
"os_version": {
"bsonType": "string",
"description": "操作系统版本号 "
},
"os_language": {
"bsonType": "string",
"description": "操作系统语言 "
},
"os_theme": {
"bsonType": "string",
"description": "操作系统主题 light|dark"
},
"pixel_ratio": {
"bsonType": "string",
"description": "设备像素比 "
},
"network_model": {
"bsonType": "string",
"description": "设备网络型号wifi/3G/4G/"
},
"window_width": {
"bsonType": "string",
"description": "设备窗口宽度 "
},
"window_height": {
"bsonType": "string",
"description": "设备窗口高度"
},
"screen_width": {
"bsonType": "string",
"description": "设备屏幕宽度"
},
"screen_height": {
"bsonType": "string",
"description": "设备屏幕高度"
},
"rom_name": {
"bsonType": "string",
"description": "rom 名称"
},
"rom_version": {
"bsonType": "string",
"description": "rom 版本"
},
"location_latitude": {
"bsonType": "double",
"description": "纬度"
},
"location_longitude": {
"bsonType": "double",
"description": "经度"
},
"location_country": {
"bsonType": "string",
"description": "国家"
},
"location_province": {
"bsonType": "string",
"description": "省份"
},
"location_city": {
"bsonType": "string",
"description": "城市"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
},
"last_update_date": {
"bsonType": "timestamp",
"description": "最后一次修改时间",
"forceDefaultValue": {
"$env": "now"
}
}
},
"version": "0.0.1"
}

View File

@ -0,0 +1,26 @@
{
"bsonType": "object",
"required": [
"value",
"expired"
],
"permission": {
"read": false,
"create": false,
"update": false,
"delete": false
},
"properties": {
"_id": {
"description": "ID系统自动生成"
},
"value": {
"description": "值"
},
"expired": {
"description": "过期时间",
"bsonType": "timestamp"
}
},
"version": "0.0.1"
}

View File

@ -0,0 +1,38 @@
[
{
"IndexName": "device_id",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "device_id",
"Direction": "1"
}
],
"MgoIsUnique": false
}
},
{
"IndexName": "oaid",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "oaid",
"Direction": "1"
}
],
"MgoIsUnique": false
}
},
{
"IndexName": "imei",
"MgoKeySchema": {
"MgoIndexKeys": [
{
"Name": "imei",
"Direction": "1"
}
],
"MgoIsUnique": false
}
}
]

View File

@ -0,0 +1,87 @@
{
"bsonType": "object",
"required": [
"user_id"
],
"properties": {
"_id": {
"description": "ID系统自动生成"
},
"user_id": {
"bsonType": "string",
"description": "用户id参考uni-id-users表"
},
"ua": {
"bsonType": "string",
"description": "userAgent"
},
"uuid": {
"bsonType": "string",
"description": "设备唯一标识(需要加密存储)"
},
"os_name": {
"bsonType": "string",
"description": "ios|android|windows|mac|linux "
},
"os_version": {
"bsonType": "string",
"description": "操作系统版本号 "
},
"os_language": {
"bsonType": "string",
"description": "操作系统语言 "
},
"os_theme": {
"bsonType": "string",
"description": "操作系统主题 light|dark"
},
"vendor": {
"bsonType": "string",
"description": "设备厂商"
},
"push_clientid": {
"bsonType": "string",
"description": "推送设备客户端标识"
},
"device_id": {
"bsonType": "string",
"description": "设备id"
},
"imei": {
"bsonType": "string",
"description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)"
},
"oaid": {
"bsonType": "string",
"description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)"
},
"idfa": {
"bsonType": "string",
"description": "iOS平台配置应用使用广告标识(IDFA)"
},
"model": {
"bsonType": "string",
"description": "设备型号"
},
"platform": {
"bsonType": "string",
"description": "平台类型"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
},
"last_active_date": {
"bsonType": "timestamp",
"description": "最后登录时间"
},
"last_active_ip": {
"bsonType": "string",
"description": "最后登录IP"
}
},
"version": "0.0.1"
}

View File

@ -1,97 +0,0 @@
## 1.5.22023-09-08
优化文档
## 1.5.12023-05-26
优化文档
## 1.5.02023-05-23
优化文档
## 1.4.92023-05-23
文档新增后台版本管理示例图
## 1.4.82023-05-23
优化当前版本显示
## 1.4.72023-05-23
新增当前运行版本名称和新版本名称显示
## 1.4.62023-05-22
新增显示安装包大小
## 1.4.52023-04-27
优化页面不透明
## 1.4.42023-04-25
新增pages_init.json自动注册页面
## 1.4.32023-04-25
修改app下载链接
## 1.4.22023-04-25
优化
## 1.4.12023-04-15
优化bug
## 1.4.02023-04-14
删除无用代码
## 1.3.92023-04-14
优化
## 1.3.82023-04-03
优化文档
## 1.3.72023-03-23
优化文档
## 1.3.62023-03-23
优化文档
## 1.3.52023-03-08
新增常见问题
## 1.3.42023-03-07
解决应用切换到后台再次打开更新弹窗叠加多个的问题
## 1.3.32023-03-02
优化提示文档
## 1.3.22023-02-02
优化部分wgt包无法安装的提示
## 1.3.12023-01-12
修改示例下载文件地址
## 1.3.02022-11-17
兼容低版本安卓手机,用户拒绝安装后,去掉自动重启,优化体验
## 1.2.92022-11-14
优化插件
## 1.2.82022-11-14
优化整包更新用户体验
## 1.2.72022-11-14
修复apk整包更新时点击拒绝安装更新进度还在的bug
## 1.2.62022-10-17
优化问题汇总
## 1.2.52022-10-17
常见问题优化
## 1.2.42022-09-21
文档新增常见问题汇总,方便更快的解决问题
## 1.2.32022-09-21
文档新增常见问题汇总,方便更快的解决问题
## 1.2.22022-09-21
文档新增常见问题汇总,方便更快的解决问题
## 1.2.12022-09-21
文档新增常见问题汇总,方便更快的解决问题
## 1.2.02022-08-03
优化插件wgt升级重启整包升级不重启
## 1.1.92022-08-01
新增弹出一个合并页面路由的pages.json修改界面。插件使用者点击确认按钮即可完成插件页面向项目pages.json的注册。HBuilderX 3.5.0+支持
## 1.1.82022-07-25
1、静默更新后提示用户重启应用以解决样式错乱的问题
2、跳转应用市场下载后解决更新提示弹窗一直叠加的问题
## 1.1.72022-07-22
优化示例代码
## 1.1.62022-07-22
优化文档
## 1.1.52022-07-19
优化文档
## 1.1.42022-07-19
优化文档
## 1.1.32022-07-19
优化文档
## 1.1.22022-07-18
优化wgt更新文档
## 1.1.12022-07-17
新增wgt包静默更新
## 1.1.02022-05-17
优化readme文档
## 1.0.92022-05-14
优化
## 1.0.82022-05-05
修复图片不显示的bug
## 1.0.72022-01-19
1.0.7 优化readme文档
## 1.0.62022-01-19
正式支持uni_modules
## 1.0.52022-01-19
测试支持uni_models

View File

@ -1,303 +0,0 @@
<template>
<view class="update-mask flex-center">
<view class="content botton-radius">
<view class="content-top">
<view class="content-top-text">
<text class="">发现新版本 v{{data.edition_name}}</text>
<text class="version">当前版本{{version}}</text>
</view>
<image class="content-top" style="top: 0;" width="100%" height="100%" src="/uni_modules/rt-uni-update/static/bg_top.png"></image>
</view>
<view class="content-header"></view>
<view class="content-body">
<view class="title"><text>更新内容</text></view>
<view class="body">
<scroll-view class="box-des-scroll" scroll-y="true"><rich-text :nodes="data.describe"></rich-text></scroll-view>
</view>
<view class="footer flex-center">
<view class="progress-box flex-column" v-if="!updateBtn">
<progress class="progress" border-radius="35" :percent="percent" activeColor="#3DA7FF" show-info stroke-width="10" />
<!-- <u-line-progress :striped="true" :percent="percent" :striped-active="true"></u-line-progress> -->
<view><text class="fs24">正在下载请稍后 ({{downloadedSize}}/{{packageFileSize}}M)</text></view>
</view>
<button class="content-button" style="border: none;color: #fff;" plain @click="confirm" v-if="updateBtn">立即升级</button>
</view>
</view>
<image v-if="cancleBtn" class="close-img" src="/uni_modules/rt-uni-update/static/app_update_close.png" @click.stop="cancel"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
version:'1.0.0',//(manifest)
percent: 0, //
updateBtn: true, //
cancleBtn: false, //
downloadedSize:0,//
packageFileSize:0,//
data: {
describe: '1. 修复已知问题<br>2. 优化用户体验',
edition_url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6bef1fe3-e3e3-4909-9f0c-6ed9bd11c93b/aae2360a-6628-4c93-b873-ce1600b9a852.apk', //
edition_force: 1, // 0 1
package_type: 0 ,//0 1wgt
edition_name:'1.0.1' //
}
};
},
onHide() { //
// console.log('');
this.data.edition_force = 0;
uni.navigateBack({
delta: 1
})
},
onLoad({obj}) {
this.data = JSON.parse(obj);
if (this.data.edition_force == 0) {
this.cancleBtn = true;
}
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
this.version = inf.version;
})
},
onBackPress() {
//
if (this.data.edition_force == 1) {
return true;
}
},
methods: {
cancel() {
//
uni.navigateBack({
delta: 1
});
},
confirm() {
if (this.data.package_type == 0) {
//apk .apk
if (this.data.edition_url.includes('.apk')) {
this.updateBtn = false;
this.cancleBtn = false;
this.download();
} else {
// h5
this.data.edition_force = 0; //
plus.runtime.openURL(this.data.edition_url);
uni.navigateBack({
delta: 1
});
}
} else {
this.updateBtn = false;
this.cancleBtn = false;
//wgt .wgt
this.download();
}
},
download() {
let package_type = this.data.package_type;
let that = this;
const downloadTask = uni.downloadFile({
url: this.data.edition_url,
success: res => {
if (res.statusCode === 200) {
plus.runtime.install(
res.tempFilePath,
{
force: true //truefalse
},
function() {
// console.log('success', success);
if (package_type == 1) {
plus.runtime.restart();
}
},
function(e) {
//wgt
that.data.edition_force = 0;
uni.showToast({
title:e.message,
icon:'none',
duration:2500
})
setTimeout(()=>{
uni.navigateBack()
},2000)
}
);
if (package_type == 0) {
// app
this.data.edition_force = 0;
uni.navigateBack();
}
}
}
});
//
downloadTask.onProgressUpdate(res => {
this.percent = res.progress;
this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
});
}
}
};
</script>
<style>
page {
background: transparent;
}
.flex-center {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
}
.update-mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.65);
}
.botton-radius {
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
}
.content {
position: relative;
top: 0;
width: 600rpx;
background-color: #fff;
box-sizing: border-box;
padding: 0 50rpx;
font-family: Source Han Sans CN;
}
.text {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
line-height: 200px;
text-align: center;
color: #ffffff;
}
.content-top {
position: absolute;
top: -195rpx;
left: 0;
width: 600rpx;
height: 270rpx;
}
.content-top-text {
font-size: 40rpx;
font-weight: bold;
color: #f8f8fa;
position: absolute;
top: 120rpx;
left: 50rpx;
z-index: 1;
display: flex;
flex-direction: column;
}
.content-header {
height: 70rpx;
}
.title {
font-size: 33rpx;
font-weight: bold;
color: #3da7ff;
line-height: 38px;
}
.footer {
height: 150rpx;
display: flex;
align-items: center;
justify-content: space-around;
}
.box-des-scroll {
box-sizing: border-box;
padding: 0 40rpx;
text-align: left;
}
.box-des {
font-size: 26rpx;
color: #000000;
line-height: 50rpx;
}
.progress-box {
width: 100%;
}
.progress {
width: 83%;
height: 40rpx;
border-radius: 35px;
}
.close-img {
width: 70rpx;
height: 70rpx;
z-index: 1000;
position: absolute;
bottom: -120rpx;
left: calc(50% - 70rpx / 2);
}
.content-button {
text-align: center;
flex: 1;
font-size: 30rpx;
font-weight: 400;
color: #ffffff;
border-radius: 40rpx;
margin: 0 18rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(to right, #1785ff, #3da7ff);
}
.flex-column {
display: flex;
flex-direction: column;
align-items: center;
}
.fs24{
font-size: 24rpx;
}
.version{
font-size: 24rpx;
margin-top: 10rpx;
color: #eeeeee;
text-decoration: underline;
}
</style>

View File

@ -1,31 +0,0 @@
export default function silenceUpdate(url) {
uni.downloadFile({
url,
success: res => {
if (res.statusCode === 200) {
plus.runtime.install(
res.tempFilePath, {
force: true //true表示强制安装不进行版本号的校验false则需要版本号校验
},
function() {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,请重启应用',
showCancel: false,
success: function(res) {
if (res.confirm) {
// console.log('用户点击确定');
plus.runtime.restart()
}
}
});
// console.log('install success...');
},
function(e) {
console.error('install fail...');
}
);
}
}
});
}

View File

@ -1,80 +0,0 @@
{
"id": "rt-uni-update",
"displayName": "app升级整包更新和热更新支持vue3 支持打开安卓、苹果市场wgt静默更新",
"version": "1.5.2",
"description": "app升级、整包更新和热更新组件 支持vue3 支持打开安卓、苹果应用市场支持wgt静默更新无感知支持覆盖原生tabar原生导航栏",
"keywords": [
"整包更新",
"热更新",
"vue3",
"静默更新",
"app更新升级"
],
"repository": "",
"engines": {
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -1,192 +0,0 @@
## 整包更新和热更新组件 支持vue3 支持打开安卓、苹果应用市场支持wgt静默更新
- ui图是采用uniapp官方更新组件的ui如不满足需要可自行替换
- 一键式检查更新同时支持整包升级与wgt资源包更新 支持打开安卓自带的应用市场和苹果appstore
- 好看、实用、可自定义的客户端提示框
- 支持强制更新,无法退出
- 支持静默更新,下次启动后更新的内容自动生效
- 支持覆盖原生tabar原生导航栏
## 安装指引
1. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`选择要导入的项目点击确定建议使用uni_modules版本 非uni_modules版本不在维护有需要自行修改
2. 在`pages.json`中添加页面路径。注意一定不要设置为pages.json中第一项在1.1.9版本新增弹出一个合并页面路由的pages.json修改界面。点击确认按钮即可完成插件页面向项目pages.json的注册。HBuilderX 3.5.0+支持,无需手动添加)
```
"pages": [
// ……其他页面配置
{
"path": "uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update",
"style": {
"disableScroll": true,
"app-plus": {
"backgroundColorTop": "transparent",
"background": "transparent",
"titleNView": false,
"scrollIndicator": false,
"popGesture": "none",
"animationType": "fade-in",
"animationDuration": 200
}
}
}
]
```
3. 查看显示效果 (注意:这里只是查看显示效果,具体代码需要按照下面的项目使用说明编写)
```
// App.vue的onShow中查看效果 如果无法跳转 请在`pages.json`中添加页面路径,参照第二步
uni.navigateTo({
url: '/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update'
});
```
## 前言一般来说后台都需要有一个app的版本管理系统可参考下图
![app的版本管理系统](https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/d7898110-7905-11ec-a3c8-0f6ace22f6cc_3.png?image_process=quality,q_70/format,webp&v=1684809490)
![app的版本管理系统](https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/d7898110-7905-11ec-a3c8-0f6ace22f6cc_4.png?image_process=quality,q_70/format,webp&v=1684809494)
## 项目使用说明 最重要!!!
- 注意!!!后端返回数据要求 字段如下 (如果后端字段不一样,请在跳转更新页时手动赋值,示例见下面代码)
```
data:{
// 版本更新内容 支持<br>自动换行
describe: '1. 修复已知问题<br>
2. 优化用户体验',
edition_url: '', //apk、wgt包下载地址或者应用市场地址 安卓应用市场 market://details?id=xxxx 苹果store itms-apps://itunes.apple.com/cn/app/xxxxxx
edition_force: 0, //是否强制更新 0代表否 1代表是
package_type: 1, //0是整包升级apk或者appstore或者安卓应用市场 1是wgt升级
edition_issue:1, //是否发行 0否 1是 为了控制上架应用市场审核时不能弹出热更新框
edition_number:100, //版本号 最重要的manifest里的版本号 检查更新主要以服务器返回的edition_number版本号是否大于当前app的版本号来实现是否更新
edition_name:'1.0.0',// 版本名称 manifest里的版本名称
edition_silence:0, // 是否静默更新 0代表否 1代表是
}
// 如果后端返回的字段和上面不一致,请在前端手动赋值(示例)
data.edition_url = res.data.editionUrl
data.edition_force = res.data.editionForce
data.package_type = res.data.packageType
data.xxx = res.data.xxx
```
## 后端注意!!!
edition_number传这个参数是为了解决部分用户app长期不使用第一次打开服务器查到的版本是最新的是wgt包但是之前app有过整包更新如果直接更新最新wgt的话会出现以前的整包添加的原生模块或者安卓权限无法使用所以后端查询版本必须返回大于当前edition_number版本的最新的整包apk地址或者是应用市场地址如果没有大于edition_number的整包就返回最新的wgt包地址就行。
- 前端示例代码 或者根据实际业务修改 如果需要自动检测新版本建议写在App.vue的onShow中
```
import silenceUpdate from '@/uni_modules/rt-uni-update/js_sdk/silence-update.js' //引入静默更新
//#ifdef APP-PLUS
// 获取本地应用资源版本号
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
//获取服务器的版本号
uni.request({
url: 'http://127.0.0.1:8088/edition_manage/get_edition', //示例接口
data: {
edition_type: plus.runtime.appid,
version_type: uni.getSystemInfoSync().platform, //android或者ios
edition_number: inf.versionCode // 打包时manifest设置的版本号
},
success: (res) => {
//res.data.xxx根据后台返回的数据决定我这里后端返回的是data所以是res.data.data
//判断后台返回版本号是否大于当前应用版本号 && 是否发行 (上架应用市场时一定不能弹出更新提示)
if (Number(res.data.data.edition_number) > Number(inf.versionCode) && res
.data.data.edition_issue == 1) {
//如果是wgt升级并且是静默更新 (注意!!! 如果是手动检查新版本,就不用判断静默更新,请直接跳转更新页,不然点击检查新版本后会没反应)
if (res.data.data.package_type == 1 && res.data.data.edition_silence == 1) {
//调用静默更新方法 传入下载地址
silenceUpdate(res.data.data.edition_url)
} else {
//跳转更新页面 注意如果pages.json第一页的代码里有一打开就跳转其他页面的操作下面这行代码最好写在setTimeout里面设置延时3到5秒再执行
uni.navigateTo({
url: '/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update?obj=' +
JSON.stringify(res.data.data)
});
}
} else {
// 如果是手动检查新版本 需开启以下注释
/* uni.showModal({
title: '提示',
content: '已是最新版本',
showCancel: false
}) */
}
}
})
});
//#endif
```
# 常见问题汇总!!!
# 热更新制作wgt包的方法1、修改manifest.json版本名称和版本号必须大于当前版本。2、点击菜单的发行——原生App-制作应用wgt包
# app上传地址个人建议开通unicloud的阿里云按量付费方便、便宜apk或者wgt包直接上传到云存储就行。
## 1、调试请打包自定义基座测试否则uni.getSystemInfoSync().platform获取到的可能不是android或者ios会导致无法跳转更新页
## 2、进度条不显示但可以正常安装原因99%的情况是因为下载链接为内网链接,内网链接无法监听下载进度,请更换为外网链接
## 3、进度条显示下载apk完成后安卓不会自动弹出安装页面原因可能是离线打包未添加安卓安装权限请添加以下权限或者使用云打包
```
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
```
```
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
```
## 4、在app.vue中无法跳转到更新页原因第一、在pages.json中忘记注册页面第二、如果已经注册过页面一般在app.vue或者首页中会有默认跳转所以影响到了跳转更新页解决办法修改跳转逻辑或者在跳转更新页时加setTimeout延时几秒在跳转
## 5、app内下载apk时会跳转外部下载原因安卓apk下载链接必须为.apk结尾如果不是.apk结尾就会跳转外部下载比如应用市场链接
## 6、热更新时wgt包可以下载但是无法安装控制台提示wgt/wgtu文件格式错误。解决方法下载地址必须为http://xxxxxx.wgt的格式就是链接必须以.wgt结尾。2、如果地址是http://xxxxxx.wgt格式请在浏览器打开这个下载地址如果无法自动下载一般可能都是后端下载权限的问题导致的
## 7、整包更新/热更新成功后还是一直弹更新弹窗原因是打wgt包时未修改manifest.json的版本号请修改版本号后上传服务器后重试。
## 8、苹果支持appstore链接和wgt更新不支持整包ipa更新。
## 9、wgt更新进度条100%苹果无法安装原因1、wgt包名不要设置为中文2、增加原生模块必须上传appstore不能热更新
## 10、不能热更新的有1、如果原项目没有nvue页面新增nvue后也必须整包更新2、增加推送、第三方登录、地图、视频播放、支付等模块或者其他安卓权限。3、修改启动图或者app图标
## 11、更新弹窗后面的页面一半儿白屏[官方的bug](https://ask.dcloud.net.cn/question/164141)
## 12、跳转更新页后无法获取参数可能是使用了uni-simple-router等第三方路由插件解决办法通过eventChannel.$emit等方式传参在插件里接收赋值
有鼓励,更有动力,如果您认为这个插件帮到了您的开发工作,麻烦给个五星好评鼓励一下,有能力的也可以小小赞赏一下,感谢支持。
<img src="https://mp-bed742be-5cd0-413d-b7a5-c1bdcda83cd2.cdn.bspapp.com/rookie-ui/34afc1f2862e7579c3cbdd33d23d0de.jpg" width="220" >
<img style="margin-left: 100px;" src="https://mp-bed742be-5cd0-413d-b7a5-c1bdcda83cd2.cdn.bspapp.com/rookie-ui/e14de964c6d89008035f651be6fa2c8.jpg" width="220" >
## 如有问题请加qq 965969604

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB