Compare commits
1 Commits
master
...
wyfMaster-
Author | SHA1 | Date | |
---|---|---|---|
22c254fffd |
@ -2,8 +2,8 @@
|
|||||||
"name" : "oa考勤系统",
|
"name" : "oa考勤系统",
|
||||||
"appid" : "__UNI__4796942",
|
"appid" : "__UNI__4796942",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "2.3.2",
|
"versionName" : "2.3.4",
|
||||||
"versionCode" : 232,
|
"versionCode" : 234,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -27,7 +27,9 @@
|
|||||||
"LivePusher" : {},
|
"LivePusher" : {},
|
||||||
"Push" : {},
|
"Push" : {},
|
||||||
"Barcode" : {},
|
"Barcode" : {},
|
||||||
"Share" : {}
|
"Share" : {},
|
||||||
|
"Record" : {},
|
||||||
|
"SQLite" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@ -48,7 +50,10 @@
|
|||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>"
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_MEDIA_VIDEO\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
|
||||||
"autoSdkPermissions" : false,
|
"autoSdkPermissions" : false,
|
||||||
@ -146,6 +151,22 @@
|
|||||||
"storyboard" : "files/CustomStoryboard.zip"
|
"storyboard" : "files/CustomStoryboard.zip"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"nativePlugins" : {
|
||||||
|
"VideoPicker" : {
|
||||||
|
"__plugin_info__" : {
|
||||||
|
"name" : "视频多选原生SDK",
|
||||||
|
"description" : "封装到js端使用",
|
||||||
|
"platforms" : "Android",
|
||||||
|
"url" : "",
|
||||||
|
"android_package_name" : "",
|
||||||
|
"ios_bundle_id" : "",
|
||||||
|
"isCloud" : false,
|
||||||
|
"bought" : -1,
|
||||||
|
"pid" : "",
|
||||||
|
"parameters" : {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
@ -172,3 +193,5 @@
|
|||||||
},
|
},
|
||||||
"vueVersion" : "3"
|
"vueVersion" : "3"
|
||||||
}
|
}
|
||||||
|
/* ios打包配置 *//* SDK配置 */
|
||||||
|
|
||||||
|
BIN
nativeplugins/VideoPicker/android/VideoPicker.aar
Normal file
BIN
nativeplugins/VideoPicker/android/VideoPicker.aar
Normal file
Binary file not shown.
35
nativeplugins/VideoPicker/package.json
Normal file
35
nativeplugins/VideoPicker/package.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "视频多选原生SDK",
|
||||||
|
"id": "VideoPicker",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "封装到js端使用",
|
||||||
|
"_dp_type": "nativeplugin",
|
||||||
|
"_dp_nativeplugin": {
|
||||||
|
"android": {
|
||||||
|
"plugins": [{
|
||||||
|
"type": "module",
|
||||||
|
"name": "VideoPicker",
|
||||||
|
"class": "io.dcloud.uniplugin.VideoPicker"
|
||||||
|
}],
|
||||||
|
"integrateType": "aar",
|
||||||
|
"dependencies": [
|
||||||
|
"com.alibaba:fastjson:1.2.83",
|
||||||
|
"com.facebook.fresco:fresco:1.13.0",
|
||||||
|
"androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
||||||
|
"androidx.core:core:1.1.0",
|
||||||
|
"androidx.fragment:fragment:1.1.0",
|
||||||
|
"androidx.recyclerview:recyclerview:1.0.0",
|
||||||
|
"androidx.legacy:legacy-support-v4:1.0.0",
|
||||||
|
"androidx.appcompat:appcompat:1.0.0"
|
||||||
|
],
|
||||||
|
"compileOptions": {
|
||||||
|
"sourceCompatibility": "1.8",
|
||||||
|
"targetCompatibility": "1.8"
|
||||||
|
},
|
||||||
|
"abis": [
|
||||||
|
"armeabi-v7a","arm64-v8a","x86"
|
||||||
|
],
|
||||||
|
"minSdkVersion": "21"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@
|
|||||||
import { ref, onMounted } 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"
|
||||||
|
import { operateSQLite } from '../../utils/sqlite.js'
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// const { statusBarHeight } = uni.getSystemInfoSync()
|
// const { statusBarHeight } = uni.getSystemInfoSync()
|
||||||
// const wv1 = plus.webview.getWebviewById("custom-webview");
|
// const wv1 = plus.webview.getWebviewById("custom-webview");
|
||||||
@ -22,7 +23,7 @@ onShow(() => {
|
|||||||
// var currentWebview = page.$getAppWebview();
|
// var currentWebview = page.$getAppWebview();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
import { Communication } from '../../utils/communication.js';
|
import { Communication } from '../../utils/communication.js';
|
||||||
const commun = new Communication()
|
const commun = new Communication()
|
||||||
@ -132,6 +133,35 @@ commun.registerHandler('createPushMessage', async (data) => {
|
|||||||
uni.createPushMessage(JSON.parse(decodeURIComponent(data)))
|
uni.createPushMessage(JSON.parse(decodeURIComponent(data)))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
commun.registerHandler('operateSQLite', async (data) => {
|
||||||
|
operateSQLite(data)
|
||||||
|
})
|
||||||
|
|
||||||
|
commun.registerHandler('VideoPicker', async () => {
|
||||||
|
console.error("=======BASE==VideoPicker")
|
||||||
|
uni.requireNativePlugin('VideoPicker').pickVideos(
|
||||||
|
{ maxCount: 9 },
|
||||||
|
(res) => {
|
||||||
|
console.log('选中的视频:', res.paths)
|
||||||
|
let allWebview = plus.webview.all()
|
||||||
|
allWebview.forEach((webview) => {
|
||||||
|
if (webview.id === 'chat') {
|
||||||
|
//找到聊天的webview
|
||||||
|
console.log('找到聊天的webview', webview)
|
||||||
|
webview.evalJS(
|
||||||
|
`getBaseMulVideo('${encodeURIComponent(
|
||||||
|
JSON.stringify(res.paths),
|
||||||
|
)}')`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
console.error('选择失败:', err)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
// 获取电子名片
|
// 获取电子名片
|
||||||
async function getCard(phone) {
|
async function getCard(phone) {
|
||||||
uni.request({
|
uni.request({
|
||||||
|
79
utils/sqlite.js
Normal file
79
utils/sqlite.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import { Communication } from './communication.js'
|
||||||
|
const commun = new Communication()
|
||||||
|
|
||||||
|
// 操作数据库
|
||||||
|
export const operateSQLite = (data) => {
|
||||||
|
const options = JSON.parse(decodeURIComponent(data))
|
||||||
|
console.error('operateSQLite', options)
|
||||||
|
if (options.eventType === 'openDatabase') {
|
||||||
|
// 打开数据库
|
||||||
|
let params = Object.assign({}, options.eventParams, {
|
||||||
|
success: function (e) {
|
||||||
|
console.log('打开数据库成功!' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
fail: function (e) {
|
||||||
|
console.log('打开数据库失败: ' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
plus.sqlite.openDatabase(params)
|
||||||
|
} else if (options.eventType === 'executeSql') {
|
||||||
|
// 执行增删改等操作的sql语句
|
||||||
|
let params = Object.assign({}, options.eventParams, {
|
||||||
|
success: function (e) {
|
||||||
|
console.log('执行增删改等操作sql语句成功!' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
fail: function (e) {
|
||||||
|
console.log('执行增删改等操作sql语句失败: ' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
plus.sqlite.executeSql(params)
|
||||||
|
} else if (options.eventType === 'selectSql') {
|
||||||
|
// 执行查询的sql语句
|
||||||
|
let params = Object.assign({}, options.eventParams, {
|
||||||
|
success: function (e) {
|
||||||
|
console.log('执行查询sql语句成功!' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
fail: function (e) {
|
||||||
|
console.log('执行查询sql语句失败: ' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
plus.sqlite.selectSql(params)
|
||||||
|
} else if (options.eventType === 'closeDatabase') {
|
||||||
|
// 关闭数据库
|
||||||
|
let params = Object.assign({}, options.eventParams, {
|
||||||
|
success: function (e) {
|
||||||
|
console.log('关闭数据库成功!' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
fail: function (e) {
|
||||||
|
console.log('关闭数据库失败: ' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
plus.sqlite.selectSql(params)
|
||||||
|
} else if (options.eventType === 'isOpenDatabase') {
|
||||||
|
// 判断数据库是否打开
|
||||||
|
const isOpen = plus.sqlite.isOpenDatabase(options.eventParams)
|
||||||
|
console.log('判断数据库是否打开:' + isOpen)
|
||||||
|
let allWebview = plus.webview.all()
|
||||||
|
allWebview.forEach((webview) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
//找到OA的webview
|
||||||
|
webview.evalJS(
|
||||||
|
`getBaseMessage('${encodeURIComponent(
|
||||||
|
JSON.stringify({ action: 'isOpenDatabase', data: isOpen }),
|
||||||
|
)}')`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (options.eventType === 'transaction') {
|
||||||
|
// 执行事务
|
||||||
|
let params = Object.assign({}, options.eventParams, {
|
||||||
|
success: function (e) {
|
||||||
|
console.log('执行事务成功!' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
fail: function (e) {
|
||||||
|
console.log('执行事务失败: ' + JSON.stringify(e))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
plus.sqlite.transaction(params)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user