Merge branch 'master' of http://172.16.100.91:3000/xingyy/oa-base
This commit is contained in:
commit
67e81c1a80
@ -1,20 +1,20 @@
|
|||||||
const env = 'prod';
|
const env = 'prod';
|
||||||
const configs = {
|
const configs = {
|
||||||
LocalTest: {
|
LocalTest: {
|
||||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||||
h5Url:'http://192.168.88.30:8080/#/'
|
h5Url: 'http://192.168.88.61:2367/#/'
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||||
h5Url:'http://192.168.88.47:2367/#/'
|
h5Url: 'http://192.168.88.47:2367/#/'
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||||
h5Url:'http://114.218.158.24:8042/#/'
|
h5Url: 'http://114.218.158.24:8042/#/'
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
apiBaseUrl: 'https://oa-a.szjixun.cn/api',
|
apiBaseUrl: 'https://oa-a.szjixun.cn/api',
|
||||||
h5Url:'https://oa-a.szjixun.cn/#/'
|
h5Url: 'https://oa-a.szjixun.cn/#/'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const config = configs[env];
|
const config = configs[env];
|
||||||
|
BIN
files/pushicon/18.png
Normal file
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
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
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
BIN
files/pushicon/48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
files/pushicon/72.png
Normal file
BIN
files/pushicon/72.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -2,8 +2,8 @@
|
|||||||
"name" : "oa考勤系统",
|
"name" : "oa考勤系统",
|
||||||
"appid" : "__UNI__4796942",
|
"appid" : "__UNI__4796942",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "2.1.7",
|
"versionName" : "2.2.0",
|
||||||
"versionCode" : 217,
|
"versionCode" : 220,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -82,7 +82,20 @@
|
|||||||
"push" : {
|
"push" : {
|
||||||
"unipush" : {
|
"unipush" : {
|
||||||
"offline" : true,
|
"offline" : true,
|
||||||
"version" : "2"
|
"oppo" : {},
|
||||||
|
"vivo" : {},
|
||||||
|
"mi" : {},
|
||||||
|
"honor" : {},
|
||||||
|
"version" : "2",
|
||||||
|
"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" : {}
|
"maps" : {}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<web-view class="webview" @message="webLoad" style="flex: 1;" :src="config.h5Url"></web-view>
|
<web-view class="webview" @message="webLoad" style="flex: 1;" :src="config.h5Url"></web-view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { onExit, onShow } from "@dcloudio/uni-app";
|
import { onExit, onShow } from "@dcloudio/uni-app";
|
||||||
import config from "../../config"
|
import config from "../../config"
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@ -17,43 +17,15 @@ onShow(() => {
|
|||||||
// bottom: 0,
|
// bottom: 0,
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
// const currentPages = getCurrentPages()
|
// var pages = getCurrentPages();
|
||||||
// const currentWebview = currentPages[currentPages.length - 1].$getAppWebview()
|
// var page = pages[pages.length - 1];
|
||||||
// currentWebview.append(wv)
|
// var currentWebview = page.$getAppWebview();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
// 监听收到推送消息
|
|
||||||
|
|
||||||
import { Communication } from '../../utils/communication.js';
|
import { Communication } from '../../utils/communication.js';
|
||||||
const commun = new Communication()
|
const commun = new Communication()
|
||||||
const share = () => {
|
|
||||||
uni.getProvider({
|
|
||||||
service: "share",
|
|
||||||
success: (res) => {
|
|
||||||
console.log(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
uni.share({
|
|
||||||
provider: 'weixin',
|
|
||||||
scene: "WXSceneSession",
|
|
||||||
type: 5,// 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: '分享的标题',
|
|
||||||
miniProgram: {
|
|
||||||
id: "gh_97094c34debd",
|
|
||||||
path: "/pages/index/index",
|
|
||||||
type: 0,
|
|
||||||
webUrl: '/#/pages/list/detail',
|
|
||||||
},
|
|
||||||
success: function (res) {
|
|
||||||
console.log("success:" + JSON.stringify(res));
|
|
||||||
},
|
|
||||||
fail: function (err) {
|
|
||||||
console.log("fail:" + JSON.stringify(err));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const shareH5 = () => {
|
const shareH5 = () => {
|
||||||
uni.share({
|
uni.share({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
@ -70,58 +42,65 @@ const shareH5 = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// import {
|
import {
|
||||||
// registerRequestPermissionTipsListener,
|
registerRequestPermissionTipsListener,
|
||||||
// unregisterRequestPermissionTipsListener,
|
unregisterRequestPermissionTipsListener,
|
||||||
// setRequestPermissionTips
|
setRequestPermissionTips
|
||||||
// } from "@/uni_modules/uni-registerRequestPermissionTips"
|
} from "@/uni_modules/uni-registerRequestPermissionTips"
|
||||||
|
|
||||||
// const PermissionTips = {
|
const PermissionTips = {
|
||||||
// "android.permission.READ_PHONE_STATE": "<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>",
|
||||||
// "android.permission.CAMERA": "<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.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>",
|
||||||
// onExit(() => {
|
"android.permission.ACCESS_COARSE_LOCATION": "<h4 style=\"font-size:40px;\">正在访问位置权限</h4><font color=#cccccc>需要获取您的位置信息,以便您能够进行考勤打卡。</font>"
|
||||||
// unregisterRequestPermissionTipsListener()
|
}
|
||||||
// })
|
onExit(() => {
|
||||||
|
unregisterRequestPermissionTipsListener()
|
||||||
|
})
|
||||||
|
|
||||||
// const brand = uni.getSystemInfoSync().deviceBrand
|
const brand = uni.getSystemInfoSync().deviceBrand
|
||||||
// setRequestPermissionTips(PermissionTips)
|
setRequestPermissionTips(PermissionTips)
|
||||||
// registerRequestPermissionTipsListener({
|
registerRequestPermissionTipsListener({
|
||||||
// onRequest: (e) => {
|
onRequest: (e) => {
|
||||||
// console.log('onRequest', e)
|
console.log('onRequest', e)
|
||||||
// },
|
},
|
||||||
// onConfirm: (e) => {
|
onConfirm: (e) => {
|
||||||
// commun.sendToH5('permission-application', { action: 'open-permission', data: e });
|
// commun.sendToH5('permission-application', { action: 'open-permission', data: e });
|
||||||
// },
|
},
|
||||||
// onComplete: (e) => {
|
onComplete: (e) => {
|
||||||
// commun.sendToH5('permission-application', { action: 'close-permission', data: e });
|
commun.sendToH5('permission-application', { action: 'close-permission', data: e });
|
||||||
|
|
||||||
// // 华为手机在权限禁止之后,再次申请权限不会出现权限申请框。此时应该引导用户去系统设置开启此权限,不应该频繁申请。
|
// 华为手机在权限禁止之后,再次申请权限不会出现权限申请框。此时应该引导用户去系统设置开启此权限,不应该频繁申请。
|
||||||
// if (brand.toLowerCase() === "huawei") {
|
if (brand.toLowerCase() === "huawei") {
|
||||||
// const tips = {}
|
const tips = {}
|
||||||
// let hasDeniedPermission = false
|
let hasDeniedPermission = false
|
||||||
// for (let k in PermissionTips) {
|
for (let k in PermissionTips) {
|
||||||
// if (e[k] !== "denied") {
|
if (e[k] !== "denied") {
|
||||||
// tips[k] = PermissionTips[k]
|
tips[k] = PermissionTips[k]
|
||||||
// } else {
|
} else {
|
||||||
// hasDeniedPermission = true
|
hasDeniedPermission = true
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// setRequestPermissionTips(tips) // 更新弹框提醒,防止华为手机不出现权限申请框时权限提醒框闪烁的情况
|
setRequestPermissionTips(tips) // 更新弹框提醒,防止华为手机不出现权限申请框时权限提醒框闪烁的情况
|
||||||
// if (hasDeniedPermission)
|
if (hasDeniedPermission)
|
||||||
// uni.showModal({
|
uni.showModal({
|
||||||
// content: "权限已经被拒绝,请前往设置中开启"
|
content: "权限已经被拒绝,请前往设置中开启"
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
const webLoad = (e) => {
|
||||||
|
const message = e.detail.data?.[0] || '';
|
||||||
|
commun.handleMessage(message);
|
||||||
|
};
|
||||||
function initializeWebView() {
|
function initializeWebView() {
|
||||||
const currentWebview = getCurrentPages().pop().$getAppWebview()
|
const currentWebview = getCurrentPages().pop().$getAppWebview()
|
||||||
commun.setWebView(currentWebview.children()[0])
|
commun.setWebView(currentWebview.children()[0])
|
||||||
}
|
}
|
||||||
//load-complete 注册函数
|
//load-complete 注册函数
|
||||||
commun.registerHandler('load-complete', () => {
|
commun.registerHandler('load-complete', () => {
|
||||||
|
|
||||||
initializeWebView()
|
initializeWebView()
|
||||||
const { statusBarHeight } = uni.getSystemInfoSync()
|
const { statusBarHeight } = uni.getSystemInfoSync()
|
||||||
commun.webViewObj.setStyle({
|
commun.webViewObj.setStyle({
|
||||||
@ -130,6 +109,7 @@ commun.registerHandler('load-complete', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
commun.registerHandler('getLocation', (data) => {
|
commun.registerHandler('getLocation', (data) => {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
@ -142,10 +122,46 @@ commun.registerHandler('getLocation', (data) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const webLoad = (e) => {
|
commun.registerHandler('goCard', async (data) => {
|
||||||
const message = e.detail.data?.[0] || '';
|
await getCard(data.phone)
|
||||||
commun.handleMessage(message);
|
})
|
||||||
};
|
|
||||||
|
// 获取电子名片
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
Loading…
Reference in New Issue
Block a user