Browse Source

完善功能

master
Penny 2 years ago
parent
commit
bd06e91920
  1. 3
      androidPrivacy.json
  2. 296
      js_sdk/wa-permission/permission.js
  3. 73
      manifest.json
  4. 35
      pages.json
  5. 197
      pages/history/History.vue
  6. 119
      pages/policy/Policy.vue
  7. 75
      pages/rights/RightsOpen.vue
  8. 100
      pages/rights/RightsSetting.vue
  9. 65
      pages/scan/Barcode.vue
  10. 124
      pages/scan/Calendar.vue
  11. 67
      pages/scan/Contacts.vue
  12. 64
      pages/scan/Email.vue
  13. 77
      pages/scan/Location.vue
  14. 73
      pages/scan/Product.vue
  15. 92
      pages/scan/Scan.nvue
  16. 72
      pages/scan/Sms.vue
  17. 60
      pages/scan/Tel.vue
  18. 83
      pages/scan/Text.vue
  19. 62
      pages/scan/Url.vue
  20. 62
      pages/scan/Wifi.vue
  21. 418
      pages/setting/Setting.vue
  22. BIN
      static/album.png
  23. BIN
      static/flashLightOff.png
  24. BIN
      static/flashLightOn.png
  25. 186
      uni_modules/vv-schedule/index.js
  26. 13
      uni_modules/vv-schedule/readme.md

3
androidPrivacy.json

@ -0,0 +1,3 @@
{
"prompt" : "none"
}

296
js_sdk/wa-permission/permission.js

@ -0,0 +1,296 @@
/**
* 本模块封装了AndroidiOS的应用权限判断打开应用权限设置界面以及位置系统服务是否开启
*/
var isIos
// #ifdef APP-PLUS
isIos = (plus.os.name == "iOS")
// #endif
// 判断推送权限是否开启
function judgeIosPermissionPush() {
var result = false;
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
var enabledTypes = 0;
if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types");
console.log("enabledTypes1:" + enabledTypes);
if (enabledTypes == 0) {
console.log("推送权限没有开启");
} else {
result = true;
console.log("已经开启推送功能!")
}
plus.ios.deleteObject(settings);
} else {
enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) {
console.log("推送权限没有开启!");
} else {
result = true;
console.log("已经开启推送功能!")
}
console.log("enabledTypes2:" + enabledTypes);
}
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
return result;
}
// 判断定位权限是否开启
function judgeIosPermissionLocation() {
var result = false;
var cllocationManger = plus.ios.import("CLLocationManager");
var status = cllocationManger.authorizationStatus();
result = (status != 2)
console.log("定位权限开启:" + result);
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
/* var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus();
console.log("enable:" + enable);
console.log("status:" + status);
if (enable && status != 2) {
result = true;
console.log("手机定位服务已开启且已授予定位权限");
} else {
console.log("手机系统的定位没有打开或未给予定位权限");
} */
plus.ios.deleteObject(cllocationManger);
return result;
}
// 判断麦克风权限是否开启
function judgeIosPermissionRecord() {
var result = false;
var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance();
var permissionStatus = avaudio.recordPermission();
console.log("permissionStatus:" + permissionStatus);
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
console.log("麦克风权限没有开启");
} else {
result = true;
console.log("麦克风权限已经开启");
}
plus.ios.deleteObject(avaudiosession);
return result;
}
// 判断相机权限是否开启
function judgeIosPermissionCamera() {
var result = false;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
console.log("authStatus:" + authStatus);
if (authStatus == 3) {
result = true;
console.log("相机权限已经开启");
} else {
console.log("相机权限没有开启");
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
}
// 判断相册权限是否开启
function judgeIosPermissionPhotoLibrary() {
var result = false;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus();
console.log("authStatus:" + authStatus);
if (authStatus == 3) {
result = true;
console.log("相册权限已经开启");
} else {
console.log("相册权限没有开启");
}
plus.ios.deleteObject(PHPhotoLibrary);
return result;
}
// 判断通讯录权限是否开启
function judgeIosPermissionContact() {
var result = false;
var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (cnAuthStatus == 3) {
result = true;
console.log("通讯录权限已经开启");
} else {
console.log("通讯录权限没有开启");
}
plus.ios.deleteObject(CNContactStore);
return result;
}
// 判断日历权限是否开启
function judgeIosPermissionCalendar() {
var result = false;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) {
result = true;
console.log("日历权限已经开启");
} else {
console.log("日历权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
// 判断备忘录权限是否开启
function judgeIosPermissionMemo() {
var result = false;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) {
result = true;
console.log("备忘录权限已经开启");
} else {
console.log("备忘录权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
// Android权限查询
function requestAndroidPermission(permissionID) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
// if (result != 1) {
// gotoAppPermissionSetting()
// }
},
function(error) {
console.log('申请权限错误:' + error.code + " = " + error.message);
resolve({
code: error.code,
message: error.message
});
}
);
});
}
//权限设置专用检查(解决onShow循环问题)
function queryRightsSettingPermission(permissionID){
plus.android.requestPermissions([permissionID], function(e){
if(e.granted.length>0){ //权限被允许
//调用依赖获取定位权限的代码
console.log('granted!!! '+e.granted.toString());
return 1;
}
if(e.deniedAlways.length>0){ //权限被永久拒绝
// 弹出提示框解释为何需要定位权限,引导用户打开设置页面开启
console.log('Always Denied!!! '+e.deniedAlways.toString());
return -1;
}
if(e.deniedPresent.length>0){ //权限被临时拒绝
// 弹出提示框解释为何需要定位权限,可再次调用plus.android.requestPermissions申请权限
console.log('Present Denied!!! '+e.deniedPresent.toString());
return 0;
}
}, function(e){
console.log('Request Permissions error:'+JSON.stringify(e));
});
}
// 使用一个方法,根据参数判断权限
function judgeIosPermission(permissionID) {
if (permissionID == "location") {
return judgeIosPermissionLocation()
} else if (permissionID == "camera") {
return judgeIosPermissionCamera()
} else if (permissionID == "photoLibrary") {
return judgeIosPermissionPhotoLibrary()
} else if (permissionID == "record") {
return judgeIosPermissionRecord()
} else if (permissionID == "push") {
return judgeIosPermissionPush()
} else if (permissionID == "contact") {
return judgeIosPermissionContact()
} else if (permissionID == "calendar") {
return judgeIosPermissionCalendar()
} else if (permissionID == "memo") {
return judgeIosPermissionMemo()
}
return false;
}
// 跳转到**应用**的权限页面
function gotoAppPermissionSetting() {
if (isIos) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
// console.log(plus.device.vendor);
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
// 检查系统的设备服务是否开启
// var checkSystemEnableLocation = async function () {
function checkSystemEnableLocation() {
if (isIos) {
var result = false;
var cllocationManger = plus.ios.import("CLLocationManager");
var result = cllocationManger.locationServicesEnabled();
console.log("系统定位开启:" + result);
plus.ios.deleteObject(cllocationManger);
return result;
} else {
var context = plus.android.importClass("android.content.Context");
var locationManager = plus.android.importClass("android.location.LocationManager");
var main = plus.android.runtimeMainActivity();
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
console.log("系统定位开启:" + result);
return result
}
}
module.exports = {
judgeIosPermission: judgeIosPermission,
requestAndroidPermission: requestAndroidPermission,
checkSystemEnableLocation: checkSystemEnableLocation,
gotoAppPermissionSetting: gotoAppPermissionSetting,
queryRightsSettingPermission: queryRightsSettingPermission
}

73
manifest.json

@ -1,7 +1,7 @@
{
"name" : "scanCode",
"name" : "QR Scanner",
"appid" : "__UNI__44D25EC",
"description" : "",
"description" : "扫码工具",
"versionName" : "1.0.0",
"versionCode" : 101,
"transformPx" : false,
@ -12,7 +12,7 @@
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"waiting" : false,
"autoclose" : true,
"delay" : 0
},
@ -21,11 +21,7 @@
"SQLite" : {},
"Barcode" : {},
"Camera" : {},
"Share" : {},
"Contacts" : {},
"Geolocation" : {},
"Maps" : {},
"Messaging" : {}
"Share" : {}
},
/* */
"distribute" : {
@ -34,36 +30,30 @@
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.READ_SMS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
"<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_APN_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"
],
"minSdkVersion" : 21,
"targetSdkVersion" : 32
"targetSdkVersion" : 32,
"abiFilters" : [ "armeabi-v7a" ]
},
/* ios */
"ios" : {
"dSYMs" : false
"dSYMs" : false,
"idfa" : false
},
/* SDK */
"sdkConfigs" : {
@ -76,6 +66,48 @@
}
},
"maps" : {}
},
"icons" : {
"android" : {
"xhdpi" : "unpackage/res/icons/96x96.png",
"hdpi" : "unpackage/res/icons/72x72.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "",
"ipad" : {
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
},
"splashscreen" : {
"androidStyle" : "default",
"android" : {
"hdpi" : "F:/次元节点doc/扫码项目文件/icon/splash-480x762.png",
"xhdpi" : "F:/次元节点doc/扫码项目文件/icon/splash-720x1242.png",
"xxhdpi" : "F:/次元节点doc/扫码项目文件/icon/splash-1080x1882.png"
},
"useOriginalMsgbox" : false,
"iosStyle" : "common"
}
},
"nativePlugins" : {
@ -117,5 +149,6 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"locale" : "en"
}

35
pages.json

@ -24,6 +24,27 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/policy/Policy",
"style": {
"navigationBarTitleText": "Policy",
"enablePullDownRefresh": false
}
},
{
"path": "pages/rights/RightsSetting",
"style": {
"navigationBarTitleText": "RightsSetting",
"enablePullDownRefresh": false
}
},
{
"path": "pages/rights/RightsOpen",
"style": {
"navigationBarTitleText": "RightsOpen",
"enablePullDownRefresh": false
}
},
// {
// "path": "pages/create/Create",
// "style": {
@ -166,6 +187,20 @@
"iconPath": "static/setting-default.png",
"selectedIconPath": "static/setting-select.png",
"text": "Setting"
},
{
"pagePath": "pages/rights/RightsOpen",
"iconPath": "static/setting-default.png",
"selectedIconPath": "static/setting-select.png",
"text": "RightsOpen",
"visible": false
},
{
"pagePath": "pages/rights/RightsSetting",
"iconPath": "static/setting-default.png",
"selectedIconPath": "static/setting-select.png",
"text": "RightsSetting",
"visible": false
}
]
}

197
pages/history/History.vue

@ -29,7 +29,7 @@
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
<view class="list-left">
<view class="list-left-icon tn-icon-circle-fill tn-color-gray"></view>
<view class="tn-color-gray"></view>
<view class="list-left-text" @click="getHistory(item.category,item.content)">
<view class="list-left-text-one">{{ item.category }}</view>
<view class="list-left-text-two">{{ item.content }}</view>
@ -48,7 +48,8 @@
</template>
<script>
import { openSqlite,closedb,getPageList,updateSql} from "@/utils/database";
// import { openSqlite,closedb,getPageList,updateSql} from "@/utils/database";
import { openSqlite,closedb,getPageList} from "@/utils/database";
export default {
data() {
return {
@ -62,44 +63,44 @@
pages:0,
total:0,
cardMode: true,
favoritesList:[
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test1.com",
"sort":"0",
"label":"URL"
},
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test2.com",
"sort":"1",
"label":"URL"
},
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test3.com",
"sort":"2",
"label":"URL"
},
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test4.com",
"sort":"3",
"label":"URL"
},
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test5.com",
"sort":"4",
"label":"URL"
},
{
"icon":"grid-item-icon tn-icon-empty-network",
"text":"https://test6.com",
"sort":"5",
"label":"URL"
},
],
// favoritesList:[
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test1.com",
// "sort":"0",
// "label":"URL"
// },
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test2.com",
// "sort":"1",
// "label":"URL"
// },
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test3.com",
// "sort":"2",
// "label":"URL"
// },
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test4.com",
// "sort":"3",
// "label":"URL"
// },
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test5.com",
// "sort":"4",
// "label":"URL"
// },
// {
// "icon":"grid-item-icon tn-icon-empty-network",
// "text":"https://test6.com",
// "sort":"5",
// "label":"URL"
// },
// ],
historyList: []
}
},
@ -114,8 +115,24 @@
let that = this;
that.closedb();
},
onBackPress(options){
let that = this;
if (options.from === 'navigateBack') {
return false;
}
that.back();
return true;
},
methods: {
//
back() {
uni.switchTab({
url: '/pages/scan/Scan'
});
},
//
getHistory(category,data){
//console.log('category',category)
@ -201,25 +218,25 @@
},
//
async changeData(){
let that = this;
// fid id
try{
let res = await getPageList(that.tableName,{current:1,size:1},{},"fid desc")
console.log("最后一页数据",res.data.data)
await updateSql(that.tableName,{title:"updated data"},{fid:res.data.data.records[0].fid})
uni.showToast({
title:"update ok",
icon:"none"
});
}catch(e){
uni.showToast({
title:"update error",
icon:"none"
});
console.error("修改报错",e)
}
},
// async changeData(){
// let that = this;
// // fid id
// try{
// let res = await getPageList(that.tableName,{current:1,size:1},{},"fid desc")
// console.log("",res.data.data)
// await updateSql(that.tableName,{title:"updated data"},{fid:res.data.data.records[0].fid})
// uni.showToast({
// title:"update ok",
// icon:"none"
// });
// }catch(e){
// uni.showToast({
// title:"update error",
// icon:"none"
// });
// console.error("",e)
// }
// },
}
}
</script>
@ -229,18 +246,18 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
justify-content: start;
background-color: #1F222B;
// height:1400rpx;
height: 100vh;
overflow: scroll;
.headLine{
color: royalblue;
font-size: 36rpx;
color: #fff;
font-size: 48rpx;
//padding-top:30px;
//margin-right:200px;
margin-top:60rpx;
margin-top:30rpx;
//border: 2px solid purple;
}
@ -249,12 +266,12 @@
width: 660rpx;
//height:300px;
height: auto;
//margin-top: 10px;
margin-top: 60rpx;
//background-color: #141b29;
.listItem{
//border: 2px solid yellow;
height: 100rpx;
height: 200rpx;
//margin-top: 30px;
background-color: #141b29;
color: #fff;
@ -275,13 +292,13 @@
.list-left-text{
width: 420rpx;
.list-left-text-one{
font-size: 30rpx;
font-size: 36rpx;
//border: 2px solid blue;
}
.list-left-text-two{
color: grey;
font-size:26rpx;
font-size: 36rpx;
//border: 2px solid lightsalmon;
}
}
@ -289,50 +306,50 @@
.list-left-feedback-text{
width: 480rpx;
.list-left-feedback-text-one{
font-size: 30rpx;
font-size: 36rpx;
//border: 2px solid blue;
}
.list-left-feedback-text-two{
color: grey;
font-size: 26rpx;
font-size: 30rpx;
//border: 2px solid lightsalmon;
}
}
.list-left-icon{
//border: 2px solid blueviolet;
margin-right: 20rpx;
font-size: 50rpx;
}
// .list-left-icon{
// //border: 2px solid blueviolet;
// margin-right: 20rpx;
// font-size: 100rpx;
// }
.list-left-select-text{
width: 320rpx;
.list-left-select-text-one{
font-size: 30rpx;
font-size: 36rpx;
//border: 2px solid blue;
}
}
}
.list-right{
//border: 2px solid pink;
color: royalblue;
font-size: 40rpx;
// .list-right{
// //border: 2px solid pink;
// color: royalblue;
// font-size: 36rpx;
.list-right-icon{
//border: 2px solid gainsboro;
font-size: 50rpx;
margin-left: 30rpx;
}
// .list-right-icon{
// //border: 2px solid gainsboro;
// font-size: 36rpx;
// margin-left: 30rpx;
// }
.list-right-text{
//border: 2px solid green;
//margin-right: 30px;
//padding-right: 30px;
}
}
// .list-right-text{
// //border: 2px solid green;
// //margin-right: 30px;
// //padding-right: 30px;
// }
// }
}
}
}

119
pages/policy/Policy.vue

@ -0,0 +1,119 @@
<template>
<view class="content">
<!-- <view class="radioStyle">
<tn-radio-group v-model="radioValue" width="100%" wrap :size="radioGroupSize">
<tn-radio :iconSize="iconSize" :labelSize="labelSize" v-for="(item, index) in radioList" :key="index" :name="item.name" :disabled="item.disabled">
<view class="radioFont">{{ item.name }}</view>
</tn-radio>
</tn-radio-group>
</view>
<view class="radioBtn">
<tn-button @click="submitFeedback()" backgroundColor="#0186ff" width="600rpx" height="100rpx"
:fontSize="btnFontSize">Submit</tn-button>
</view>
<tn-toast ref="toast"></tn-toast> -->
<text style="color: #fff; font-size: 48rpx;"> this is policy</text>
</view>
</template>
<script>
export default {
data() {
return {
radioGroupSize: 45,
labelSize: 45,
iconSize: 40,
btnFontSize: 36,
radioValue: '',
radioList:[
{
'name': 'Scan faild',
'disabled': false
},
{
'name': 'Too many ads',
'disabled': false
},
{
'name': 'Need more infomation',
'disabled': false
},
{
'name': 'Bugs',
'disabled': false
},
{
'name': 'Other',
'disabled': false
}
]
}
},
onLoad() {
//starTipStatus
//this.setStarTipStatus(false);
},
onHide() {
},
methods: {
//
// setStarTipStatus(value){
// uni.setStorageSync('starTipStatus', value);
// },
//
// submitFeedback(){
// let that = this;
// if(that.radioValue == '' || that.radioValue == null){
// that.$refs.toast.show({
// title: 'Fail',
// content: 'please select one!',
// icon: 'fail',
// duration: 3000
// })
// }else{
// that.$refs.toast.show({
// title: 'Success',
// content: 'Thanks for feedback!',
// icon: 'success',
// duration: 3000
// })
// //
// setTimeout(() =>{
// uni.navigateBack();
// }, 3000);
// }
// }
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #1F222B;
height:100vh;
}
.radioStyle{
//border: 1px solid red;
margin-top: 50rpx;
margin-left: 50rpx;
padding-top: 100rpx;
}
.radioFont{
color: #fff;
//margin-top: 50rpx;
}
.radioBtn{
//border: 1px solid yellow;
margin-top: 600rpx;
}
</style>

75
pages/rights/RightsOpen.vue

@ -0,0 +1,75 @@
<template>
<view class="content">
<view class="textBoard">
<text style="color: #fff; font-size: 48rpx;">Need permissions?</text>
</view>
<view class="textBoard">
<text style="color: #fff; font-size: 36rpx;">Camera permission is requeired to</text>
</view>
<view class="textBoard">
<text style="color: #0186FF; font-size: 36rpx;">QR Code Scanner & barcode Reader.</text>
</view>
<view class="textBoard">
<tn-button @click="openPermission()" :backgroundColor="btnBackgroundColor" :fontColor="btnFontColor" width="300rpx" height="100rpx"
:fontSize="btnFontSize">Allow</tn-button>
</view>
</view>
</template>
<script>
import permision from "@/js_sdk/wa-permission/permission.js"
export default {
data() {
return {
btnFontSize: 36,
btnBackgroundColor: '#0186ff',
btnFontColor: '#fff'
}
},
onLoad() {
},
onHide() {
},
methods: {
//
async openPermission(){
let that = this;
console.log('打开授权')
var result = await permision.requestAndroidPermission('android.permission.CAMERA')
if (result == 1) {
//,
that.jumpToRights('/pages/scan/Scan');
}else if(result == -1) {
//
that.jumpToRights('/pages/rights/RightsSetting');
}
},
//
jumpToRights(url){
uni.switchTab({
url: url
})
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #1F222B;
height:100vh;
}
.textBoard{
margin-top: 1vh;
}
</style>

100
pages/rights/RightsSetting.vue

@ -0,0 +1,100 @@
<template>
<view class="content">
<view class="textBoard">
<text style="color: #fff; font-size: 48rpx;">Need permissions?</text>
</view>
<view class="textBoard">
<text style="color: #fff; font-size: 36rpx;">Camera permission is requeired to</text>
</view>
<view class="textBoard">
<text style="color: #0186FF; font-size: 36rpx;">QR Code Scanner & barcode Reader.</text>
</view>
<view class="textBoard">
<text style="color: #fff; font-size: 36rpx;">1.Open settings</text>
</view>
<view class="textBoard">
<text style="color: #fff; font-size: 36rpx;">2.Tap permissions</text>
</view>
<view class="textBoard">
<text style="color: #fff; font-size: 36rpx;">3.Turn on Camera</text>
</view>
<view class="textBoard">
<tn-button @click="setPermission()" :backgroundColor="btnBackgroundColor" :fontColor="btnFontColor" width="300rpx" height="100rpx"
:fontSize="btnFontSize">Open settings</tn-button>
</view>
</view>
</template>
<script>
import permision from "@/js_sdk/wa-permission/permission.js"
export default {
data() {
return {
btnFontSize: 36,
btnBackgroundColor: '#0186ff',
btnFontColor: '#fff',
hasRequestedPermission: false
}
},
async onShow(){
let that = this;
if (!that.hasRequestedPermission) {
console.log('进入了判断setting权限',that.hasRequestedPermission)
await that.requestAndroidPermission('android.permission.CAMERA');
}
// else{
// console.log('settingtrue',that.hasRequestedPermission)
// that.jumpToRights('/pages/scan/Scan');
// }
},
onHide() {
this.hasRequestedPermission = false;
console.log('onHide')
},
onUnload(){
console.log('onUnload')
},
methods: {
//
setPermission(){
permision.gotoAppPermissionSetting();
},
//
async requestAndroidPermission(permisionID) {
let that = this;
var result = await permision.requestAndroidPermission(permisionID)
console.log('setting判断权限结果',result)
that.hasRequestedPermission = true;
if (result == 1) {
//,
that.jumpToRights('/pages/scan/Scan');
}
},
//
jumpToRights(url){
uni.switchTab({
url: url
})
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #1F222B;
height:100vh;
}
.textBoard{
margin-top: 1vh;
}
</style>

65
pages/scan/Barcode.vue

@ -1,33 +1,30 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-qr-barcode" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-qr-barcode" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>{{ barcodeInfo.message }}</view>
<view style="font-size: 36rpx;">{{ barcodeInfo.message }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="openWeb()">
<view class="tn-icon-search"></view>
<view class="cutline"></view>
<view class="toolText">Web Search</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view> -->
<!-- <tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -40,10 +37,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -98,6 +95,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -142,9 +140,6 @@
summary: this.barcodeInfo.message,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -160,8 +155,8 @@
let that = this;
console.log('that.barcodeInfo.message',that.barcodeInfo.message)
uni.navigateTo({
url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.barcodeInfo.message
//url: '/pages/webview/webview?url=http://www.google.com?wd=' + that.textInfo.message
//url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.barcodeInfo.message
url: '/pages/webview/webview?url=https://www.google.com.hk/search?q=' + that.barcodeInfo.message
});
},
@ -288,11 +283,11 @@
width: 660rpx;
height:1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
@ -304,12 +299,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -324,7 +319,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -334,7 +329,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -348,27 +343,35 @@
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

124
pages/scan/Calendar.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-calendar" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-calendar" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Subject: {{ calendarInfo.Theme }}</view>
@ -12,26 +12,23 @@
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="addEvent()">
<tn-grid-item class="toolItem" @click="addActivity()">
<view class="tn-icon-calendar"></view>
<view class="cutline"></view>
<view class="toolText">Add to events</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -44,10 +41,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -56,7 +53,13 @@
</template>
<script>
// var calanderURL = "content://com.android.calendar/calendars";
// var calanderEventURL = "content://com.android.calendar/events";
// var calanderRemiderURL = "content://com.android.calendar/reminders";
// var calId; //id
import { openSqlite,executeSql,closedb,isTable,addSql} from "@/utils/database";
import permision from "@/js_sdk/wa-permission/permission.js"
import {addSchedule} from '@/uni_modules/vv-schedule'
export default {
data() {
return {
@ -102,6 +105,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -141,7 +145,20 @@
},
//
addEvent(){
async addActivity(){
let that = this;
await addSchedule({
title: that.calendarInfo.Theme,
description: that.calendarInfo.AbstractInfo,
dtstart: new Date(that.calendarInfo.startTime).getTime(),
dtend: new Date(that.calendarInfo.closeTime).getTime(),
})
that.$refs.toast.show({
title: 'Success',
content: 'Add calander success!',
icon: 'success',
duration: 1500
})
},
@ -151,9 +168,6 @@
summary: this.calendarInfo,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -277,7 +291,43 @@
const data = JSON.parse(params);
that.calendarInfo = data;
that.textImgUrl = 'file://'+that.calendarInfo.imgUrl;
}
},
// * *
getCalendarJurisdiction() {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(['android.permission.READ_CALENDAR',
'android.permission.WRITE_CALENDAR'
],
function(e) {
if (e.deniedAlways.length > 0) { //
//
console.log('Always Denied!!! ' + e.deniedAlways.toString());
reject({
data: -1,
message: "权限被永久拒绝了"
})
}
if (e.deniedPresent.length > 0) { //
reject({
data: 0,
message: "权限被临时拒绝了"
})
// plus.android.requestPermissions
console.log('Present Denied!!! ' + e.deniedPresent.toString());
}
if (e.granted.length > 0) { //
//
resolve({
data: 1,
message: "ok"
})
}
})
})
},
}
}
</script>
@ -297,14 +347,15 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
overflow: auto;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid green;
height: 260rpx;
height: auto;
text-align: start;
}
@ -314,12 +365,12 @@
//margin-top: 30px;
//padding-top: 30px;
width: 660rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -335,7 +386,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -345,7 +396,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -358,25 +409,34 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 120rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

67
pages/scan/Contacts.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-my" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-my" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Name: {{ contactsInfo.peopleName }}</view>
@ -15,29 +15,25 @@
<block>
<tn-grid-item class="toolItem" @click="addContact()">
<view class="tn-icon-my-circle-fill"></view>
<view class="cutline"></view>
<view class="toolText">Add to contacts</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="sendEmail()">
<view class="tn-icon-email"></view>
<view class="cutline"></view>
<view class="toolText">Send email</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="call()">
<view class="tn-icon-tel"></view>
<view class="cutline"></view>
<view class="toolText">Call</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -50,10 +46,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -104,10 +100,12 @@
let that = this;
//
let starTipStatus = that.getStarTipStatus();
console.log('starTipStatus',starTipStatus)
console.log('starTipStatus',JSON.stringify(starTipStatus));
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
//starTipStatus
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -117,12 +115,12 @@
//
getStarTipStatus(){
return uni.getStorageSync('starTipStatus');
return uni.getStorageSync('starTipStatus');
},
//
setStarTipStatus(value){
uni.setStorageSync('starTipStatus', value);
uni.setStorageSync('starTipStatus', value);
},
//
@ -316,7 +314,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #000000;
background-color: #1F222B;
height:100vh;
.listView{
@ -325,11 +323,11 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 360rpx;
@ -341,12 +339,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -361,7 +359,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -371,7 +369,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -384,25 +382,34 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 120rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 50rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

64
pages/scan/Email.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-email" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-email" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>To: {{ emailInfo.addressInfo }}</view>
@ -12,29 +12,25 @@
<block>
<tn-grid-item class="toolItem" @click="sendEmail()">
<view class="tn-icon-email"></view>
<view class="cutline"></view>
<view class="toolText">Send email</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="addContact()">
<view class="tn-icon-my-circle-fill"></view>
<view class="cutline"></view>
<view class="toolText">Add to contacts</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -47,10 +43,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -105,6 +101,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -182,9 +179,6 @@
summary: this.emailInfo.addressInfo,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -328,14 +322,15 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
overflow: auto;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
height: auto;
text-align: start;
}
@ -344,12 +339,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -365,7 +360,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -375,7 +370,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -389,25 +384,34 @@
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

77
pages/scan/Location.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-location" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-location" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Lng: {{ locationInfo.Longitude }}</view>
@ -9,31 +9,27 @@
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="showMap()">
<!-- <tn-grid-item class="toolItem" @click="showMap()">
<view class="tn-icon-map"></view>
<view class="cutline"></view>
<view class="toolText">Show map</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="getDirection()">
<view class="tn-icon-share"></view>
<view class="cutline"></view>
<view class="toolText">Navigation</view>
</tn-grid-item>
</tn-grid-item> -->
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -46,10 +42,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -104,6 +100,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -143,25 +140,22 @@
},
//
showMap(){
// showMap(){
},
// },
//
getDirection(){
// getDirection(){
},
// },
//
share(){
uni.shareWithSystem({
summary: '',
href: 'https://uniapp.dcloud.io',
summary: this.locationInfo,
//href: 'https://uniapp.dcloud.io',
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -296,11 +290,11 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
@ -312,12 +306,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -334,7 +328,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -344,7 +338,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -357,25 +351,34 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

73
pages/scan/Product.vue

@ -1,38 +1,34 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-all" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-all" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>code: {{ productInfo.message }}</view>
<view style="font-size: 36rpx;">{{ productInfo.message }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block class="block1">
<tn-grid-item class="toolItem" @click="openShoping()">
<view class="tn-icon-shop"></view>
<view class="cutline"></view>
<view class="toolText">View in store</view>
<view class="tn-icon-shopbag"></view>
<view class="toolText">Shopping</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="openWeb()">
<view class="tn-icon-search"></view>
<view class="cutline"></view>
<view class="toolText">Web Search</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -45,10 +41,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -103,6 +99,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -147,7 +144,7 @@
console.log('that.textInfo.message',that.productInfo.message)
uni.navigateTo({
url: '/pages/webview/webview?url=https://www.amazon.com/s?k=' + that.productInfo.message
//url: '/pages/webview/webview?url=http://www.google.com?wd=' + that.textInfo.message
//url: '/pages/webview/webview?url=https://www.google.com.hk/search?q=' + that.textInfo.message
});
},
@ -157,9 +154,6 @@
summary: this.productInfo.message ,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -175,8 +169,8 @@
let that = this;
console.log('that.textInfo.message',that.productInfo.message)
uni.navigateTo({
url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.productInfo.message
//url: '/pages/webview/webview?url=http://www.google.com?wd=' + that.textInfo.message
//url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.productInfo.message
url: '/pages/webview/webview?url=https://www.google.com.hk/search?q=' + that.productInfo.message
});
},
@ -304,11 +298,11 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
@ -321,14 +315,14 @@
width: 660rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
}
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -343,7 +337,7 @@
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -353,7 +347,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -367,28 +361,37 @@
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

92
pages/scan/Scan.nvue

@ -12,9 +12,13 @@
<!-- </view> -->
<!-- 扫码框下方图片按钮 -->
<view class="scan_frame_bottom_btn">
<image class="btn" src="../../static/flashLightOn.png" @click="lightOff()" v-if="flashLightFlag === true"></image>
<image class="btn" src="../../static/flashLightOff.png" @click="lightOn()" v-if="flashLightFlag === false"></image>
<image class="btn" src="../../static/album.png" @click="photoAlbum()"></image>
<view class="imgBack">
<image class="btnLight" src="../../static/flashLightOn.png" @click="lightOff()" v-if="flashLightFlag === true"></image>
<image class="btnLight" src="../../static/flashLightOff.png" @click="lightOn()" v-if="flashLightFlag === false"></image>
</view>
<view class="imgBack">
<image class="btnAlbum" src="../../static/album.png" @click="photoAlbum()"></image>
</view>
</view>
</view>
</view>
@ -33,6 +37,7 @@
<script>
import { openSqlite,executeSql,closedb} from "@/utils/database";
import permision from "@/js_sdk/wa-permission/permission.js"
const hwscan = uni.requireNativePlugin('LY-HWScan')
export default {
data() {
@ -54,29 +59,63 @@
sleep: 1,//连续扫描间隔
code: "",
path:'',//扫描图片
flashLightFlag: true
flashLightFlag: true,
hasPermission: false
}
},
async onShow(){
async onShow(){
let that = this;
//打开db
await that.openSqlite();
if(this.$refs.scanComponent){
this.$refs.scanComponent.remoteResume();
if(that.$refs.scanComponent){
setTimeout(function(){
that.$refs.scanComponent.remoteResume();
},300);
}
if (!that.hasPermission) {
console.log('进入了判断scan权限',that.hasPermission)
//判断是否有权限
await that.requestAndroidPermission('android.permission.CAMERA')
}
//TODO 有权限就是扫码页面,没权限跳转到权限提示
// else{
// console.log('scan权限状态已变更为true,进入扫码页',that.hasPermission)
// //that.jumpToRights('/pages/scan/Scan');
// }
},
onHide() {
let that = this;
that.closedb();
if(this.$refs.scanComponent){
this.$refs.scanComponent.remotePause();
if(that.$refs.scanComponent){
that.$refs.scanComponent.remotePause();
}
//that.hasPermission = false;
},
onUnload() {
// this.$refs.scanComponent.releaseAssets()
},
methods: {
//判断是否有相机权限
async requestAndroidPermission(permisionID) {
let that = this;
var result = await permision.requestAndroidPermission(permisionID)
console.log('scan判断权限结果',result)
that.hasPermission = true;
if (result == 0) {
//无权限,跳转到引导打开权限
that.jumpToRights('/pages/rights/RightsOpen');
}else if(result == -1) {
//禁止权限,跳转到权限设置页面
that.jumpToRights('/pages/rights/RightsSetting');
}else{
//有权限,跳转到扫码界面
that.jumpToRights('/pages/scan/Scan');
}
},
// 识别完成回调 ------ res.detail.data是组装好的数据
scanResult(res) {
console.log(res.detail.data)
@ -220,6 +259,13 @@
});
},
//跳转到授权设置页面(type: 0->非tabbar页面;1->tabbar页面)
jumpToRights(url,type){
uni.switchTab({
url: url
})
},
//mlkit扫码
// scanCode(){
// let that = this;
@ -290,8 +336,9 @@
}
.scan_frame {
width: 450px;
height: 450px;
width: 500vh;
height: 500vh;
margin-right: 10vh;
}
.scan_frame_bottom_btn{
position: absolute;
@ -303,13 +350,28 @@
padding-left: 30px;
padding-right: 30px;
justify-content: space-between;
}
.btnLight{
width: 40vh;
height: 40vh;
margin-left: 6vh;
margin-top: 6vh;
}
.btn{
width: 100rpx;
height: 100rpx;
margin-top: 200rpx;
.btnAlbum{
width: 30vh;
height: 30vh;
margin-left: 10vh;
margin-top: 10vh;
}
.imgBack{
width: 50vh;
height: 50vh;
background-color: #000000;
border-radius: 100%;
margin-top: 100vh;
}

72
pages/scan/Sms.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-message" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-message" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Tel: {{ smsInfo.destPhoneNumber }}</view>
@ -11,24 +11,21 @@
<block>
<tn-grid-item class="toolItem" @click="sendMessage()">
<view class="tn-icon-email"></view>
<view class="cutline"></view>
<view class="toolText">Send SMS</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -41,10 +38,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -88,6 +85,20 @@
let that = this;
that.closedb();
},
onBackPress(e){
let that = this;
//
let starTipStatus = that.getStarTipStatus();
console.log('starTipStatus',starTipStatus)
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
}
},
methods: {
//
@ -135,9 +146,6 @@
summary: this.smsInfo,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -272,14 +280,15 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
overflow: auto;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
height: auto;
text-align: start;
}
@ -288,12 +297,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -310,7 +319,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -320,7 +329,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -333,25 +342,30 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
}
</style>

60
pages/scan/Tel.vue

@ -1,26 +1,23 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-tel" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-tel" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Telephone number: {{ telInfo.TelPhoneNumber }}</view>
<view style="font-size: 36rpx;">{{ telInfo.TelPhoneNumber }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="addConnect()">
<view class="tn-icon-my-circle-fill"></view>
<view class="cutline"></view>
<view class="toolText">Add to contacts</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="call()">
<view class="tn-icon-tel"></view>
<view class="cutline"></view>
<view class="toolText">Call</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
@ -31,8 +28,8 @@
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -45,10 +42,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -103,6 +100,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -180,9 +178,6 @@
summary: this.telInfo.TelPhoneNumber,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -316,15 +311,15 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
text-align: start;
text-align: center;
}
.listItem{
@ -332,12 +327,12 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -353,7 +348,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -363,7 +358,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -376,25 +371,30 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
}
</style>

83
pages/scan/Text.vue

@ -1,33 +1,33 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-level" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-level" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>{{ textInfo.message }}</view>
<tn-read-more ref="readMore" :showHeight="400" openText="More" closeText="Close" :closeBtn="true" :shadowStyle="shdowStyle">
<rich-text style="color:#fff" :nodes="textInfo.message" ></rich-text>
</tn-read-more>
<!-- <view>{{ textInfo.message }}</view> -->
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="openWeb()">
<view class="tn-icon-search"></view>
<view class="cutline"></view>
<view class="toolText">Web Search</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -40,10 +40,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -60,6 +60,12 @@
textInfo:{},
tableName: 'scan_code',
textImgUrl: '',
shdowStyle: {
paddingTop: "300rpx",
marginTop: "-300rpx"
},
// openFont: 'More',
// closeFont: 'Close',
starRateValue: 5, //
showStarTip: false, //
@ -82,6 +88,10 @@
//
await that.getHistoryData(option.data);
}
that.$nextTick(() => {
that.$refs.readMore.init()
})
},
onHide() {
let that = this;
@ -98,6 +108,8 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
//starTipStatus
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -143,9 +155,6 @@
summary: this.textInfo.message,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -161,8 +170,8 @@
let that = this;
//console.log('that.textInfo.message',that.textInfo.message)
uni.navigateTo({
url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.textInfo.message
//url: '/pages/webview/webview?url=http://www.google.com?wd=' + that.textInfo.message
//url: '/pages/webview/webview?url=https://www.baidu.com/s?wd=' + that.textInfo.message
url: '/pages/webview/webview?url=https://www.google.com.hk/search?q=' + that.textInfo.message
});
},
@ -290,14 +299,15 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
overflow: auto;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
height: auto;
text-align: start;
}
@ -306,13 +316,13 @@
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -328,7 +338,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -338,7 +348,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -351,26 +361,35 @@
}
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
}
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 300rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

62
pages/scan/Url.vue

@ -1,33 +1,30 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-link" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-link" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Url: {{ urlInfo.LinkValue }}</view>
<view>{{ urlInfo.LinkValue }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block>
<tn-grid-item class="toolItem" @click="openUrl()">
<view class="tn-icon-plane"></view>
<view class="cutline"></view>
<view class="tn-icon-share-square"></view>
<view class="toolText">Open</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyValue()">
<view class="tn-icon-copy-fill"></view>
<view class="cutline"></view>
<view class="toolText">Copy</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view> -->
<!-- <tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -40,10 +37,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -69,6 +66,7 @@
},
async onLoad(option) {
let that = this;
console.log('option',option)
//db
await that.openSqlite();
//
@ -98,6 +96,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -150,9 +149,6 @@
summary: this.urlInfo.LinkValue ,
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -286,11 +282,11 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 360rpx;
@ -300,14 +296,12 @@
.listItem{
//border: 2px solid yellow;
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -322,7 +316,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -332,7 +326,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -346,23 +340,23 @@
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 80rpx;
}
.cutline{
border: 1px solid #8f8f94;
@ -372,5 +366,9 @@
color: #fff;
font-size: 48rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

62
pages/scan/Wifi.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<tn-avatar class="icon tn-icon-wifi" size="xl"></tn-avatar>
<!-- <tn-avatar class="icon tn-icon-wifi" size="xl"></tn-avatar> -->
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">
<view>Network name: {{ wifiInfo.ssidNumber }}</view>
@ -11,24 +11,21 @@
<block>
<tn-grid-item class="toolItem" @click="connectWifi()">
<view class="tn-icon-wifi"></view>
<view class="cutline"></view>
<view class="toolText">Connect to Wifi</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="share()">
<view class="tn-icon-share-triangle"></view>
<view class="cutline"></view>
<view class="toolText">Share</view>
</tn-grid-item>
<tn-grid-item class="toolItem" @click="copyPassword()">
<view class="tn-icon-coupon"></view>
<view class="cutline"></view>
<view class="toolText">Copy password</view>
</tn-grid-item>
</block>
</tn-grid>
</tn-list-cell>
<view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell>
<!-- <view class="cutline"></view>
<tn-list-cell class="listItem-ad">我是谷歌ad部分</tn-list-cell> -->
<tn-list-cell class="listItemBottom">
<image :src="textImgUrl" class="buttomImg"/>
</tn-list-cell>
@ -41,10 +38,10 @@
<view class="starTipText">Do you like this app?</view>
</view>
<view slot="center" class="tn-icon tn-icon-about-fill">
<tn-rate v-model="starRateValue" :size="80" :allowHalf="true" activeColor="#0186FF"></tn-rate>
<tn-rate v-model="starRateValue" :size="80" :allowHalf="false" activeColor="#0186FF"></tn-rate>
</view>
<view slot="right" class="tn-icon tn-icon-about-fill">
<tn-button :fontSize="36" margin="30rpx" height="46rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
<tn-button :fontSize="50" margin="80rpx" height="100rpx" backgroundColor="#0186FF" fontColor="tn-color-white" @click="starTipSubmit()">submit</tn-button>
</view>
</view>
</tn-modal>
@ -99,6 +96,7 @@
if(starTipStatus === null || starTipStatus === ""){
//
that.showStarTip = true;
that.setStarTipStatus(false);
return true;
}else{
return false;
@ -165,9 +163,6 @@
summary: JSON.stringify(this.wifiInfo),
success(){
//
uni.showToast({
title: 'share success!'
});
},
fail(){
//
@ -304,11 +299,11 @@
width: 660rpx;
height: 1300rpx;
margin-top: 100rpx;
background-color: #141b29;
background-color: #1F222B;
.listItem-1{
margin-top: 120rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
//border: 2px solid yellow;
height: 160rpx;
@ -318,14 +313,12 @@
.listItem{
//border: 2px solid yellow;
height: 160rpx;
//margin-top: 30px;
//padding-top: 30px;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
.toolItem{
//border: 2px solid red;
background-color: #141b29;
background-color: #1F222B;
font-size: 60rpx;
color: #8f8f94;
height: 120rpx;
@ -340,7 +333,7 @@
}
.listItem-ad{
background-color: #141b29;
background-color: #1F222B;
text-align: center;
color: #fff;
//border: 2px solid red;
@ -350,7 +343,7 @@
.listItemBottom{
height: 400rpx;
margin-top: 20rpx;
background-color: #141b29;
background-color: #1F222B;
color: #fff;
display: flex;
flex-direction: column;
@ -364,27 +357,36 @@
}
}
.icon{
z-index: 1;
position: absolute;
margin-top: -620rpx;
background-color: #3e444d;
font-size: 120rpx;
color: #fff;
text-align: center;
}
// .icon{
// z-index: 1;
// position: absolute;
// margin-top: -620rpx;
// background-color: #3e444d;
// font-size: 120rpx;
// color: #fff;
// text-align: center;
// }
.bottomText{
color: #fff;
text-align: center;
font-size: 24rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
//margin-top: 40rpx;
margin-bottom: 240rpx;
}
.cutline{
border: 1px solid #8f8f94;
}
.starTipText{
color: #fff;
font-size: 50rpx;
}
.startTipContent{
margin-bottom: 30rpx;
}
}
</style>

418
pages/setting/Setting.vue

@ -3,11 +3,11 @@
<!-- 顶部通用设置模块 -->
<view>
<view class="headLine">General Settings</view>
<tn-list-view :card="cardMode" class="settingList" unlined="all">
<tn-list-cell class="listItem">
<view class="headLine">Settings</view>
<!-- <tn-list-view :card="cardMode" class="settingList" unlined="all"> -->
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-circle-fill tn-color-gray"></view>
<view class="list-left-text">
@ -15,84 +15,105 @@
<view class="list-left-text-two">Beep when the scan is successfull.</view>
</view>
</view>
<!-- 右边操作按钮部分 -->
右边操作按钮部分
<view class="list-right">
<tn-switch v-model="beepChecked" :inactiveValue="0" :activeValue="1"
:inactiveColor="inactiveColor" :activeColor="activeColor"></tn-switch>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-discover tn-color-gray"></view>
<view class="list-left-text">
<view class="list-left-text-one">Auto-copied to clipboard</view>
</view>
</view>
<!-- 右边操作按钮部分 -->
右边操作按钮部分
<view class="list-right">
<tn-switch v-model="ClipboardCheked" :inactiveValue="0" :activeValue="1"
:inactiveColor="inactiveColor" :activeColor="activeColor"></tn-switch>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-search tn-color-gray"></view>
<view class="list-left-select-text">
<view class="list-left-select-text-one">Search Engine</view>
</view>
</view>
<!-- 右边操作按钮部分 -->
右边操作按钮部分
<view class="list-right">
<text class="list-right-text">{{ webEngineLabel }}</text><text class="tn-icon-down-triangle list-right-icon" @click="openWebSelectView"></text>
<tn-select title="Select Browser" :confirmText="confirmText" :cancelText="cancelText"
v-model="webEngine" mode="single" :list="webEngineList" @confirm="selectWebEngine" :searchShow="searchEngineFlag" :searchPlaceholder="placeholderText"></tn-select>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-moon-fill tn-color-gray"></view>
<view class="list-left-text">
<view class="list-left-text-one">Dark Mode</view>
</view>
</view>
<!-- 右边操作按钮部分 -->
右边操作按钮部分
<view class="list-right">
<tn-switch v-model="DarkModeChecked" :inactiveValue="0" :activeValue="1"
:inactiveColor="inactiveColor" :activeColor="activeColor"></tn-switch>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<view class="list-icon-text">
<view class="tn-margin-top-sm">
<tn-list-cell class="listView" :radius="true">
<view class="list-box">
<!-- 左边图标文本显示部分 -->
<view class="list-left">
<view class="list-left-icon tn-icon-english tn-color-gray"></view>
<view class="list-left-select-text">
<view class="list-left-select-text-one">Language options</view>
</view>
<view>
<view class="list-text">Language</view>
</view>
<!-- 右边操作按钮部分 -->
<view class="list-right">
<text class="list-right-text">{{ languageLabel }}</text><text class="tn-icon-down-triangle list-right-icon" @click="openLanguageSelectView"></text>
<!-- <view class="list-select">
<text class="list-select-text">{{ languageLabel }}</text><text class="tn-icon-down-triangle list-select-icon" @click="openLanguageSelectView"></text>
<tn-select title="Select Language" :confirmText="confirmText" :cancelText="cancelText"
v-model="language" mode="single" :list="languageList" @confirm="selectLanauage" :searchShow="searchLanguageFlag" :searchPlaceholder="placeholderText"></tn-select>
</view> -->
</view>
</tn-list-cell>
</view>
<view class="tn-margin-top-sm">
<tn-list-cell class="listView" :radius="true">
<view>
<!-- 左边图标文本显示部分 -->
<view @click="gotoFeedback()">
<view class="list-text">Feedback</view>
</view>
</view>
</tn-list-cell>
</tn-list-view>
</view>
<view class="tn-margin-top-sm">
<tn-list-cell class="listView" :radius="true">
<view>
<!-- 左边图标文本显示部分 -->
<view @click="gotoPolicy()">
<view class="list-text">Provacy policy</view>
</view>
</view>
</tn-list-cell>
</view>
<!-- </tn-list-view> -->
</view>
@ -101,11 +122,11 @@
<view>
<view class="headLine">Help</view>
<tn-list-view :card="cardMode" class="settingList">
<!-- <view class="headLine">Help</view>
<tn-list-view :card="cardMode" class="settingList">
<tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-help tn-color-gray"></view>
<view class="list-left-text">
@ -113,11 +134,11 @@
</view>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-edit-form tn-color-gray"></view>
<view class="list-left-feedback-text">
@ -126,11 +147,11 @@
</view>
</view>
</view>
</tn-list-cell>
</tn-list-cell> -->
<tn-list-cell class="listItem">
<!-- <tn-list-cell class="listItem">
<view class="list-icon-text">
<!-- 左边图标文本显示部分 -->
左边图标文本显示部分
<view class="list-left">
<view class="list-left-icon tn-icon-safe-fill tn-color-gray"></view>
<view class="list-left-text">
@ -138,8 +159,8 @@
</view>
</view>
</view>
</tn-list-cell>
</tn-list-view>
</tn-list-cell>
</tn-list-view>-->
</view>
</view>
</template>
@ -212,21 +233,52 @@
},
onLoad() {
},
onBackPress(options){
let that = this;
if (options.from === 'navigateBack') {
return false;
}
that.back();
return true;
},
methods: {
//
back() {
uni.switchTab({
url: '/pages/scan/Scan'
});
},
//
selectWebEngine(e){
console.log('选择了浏览器',e[0].label);
this.webEngineLabel = e[0].label;
this.webEngineValue = e[0].value;
//
gotoFeedback(){
uni.navigateTo({
url: '/pages/feedback/Feedback'
});
},
//
openWebSelectView(){
this.webEngine = true;
//
gotoPolicy(){
uni.navigateTo({
url: '/pages/policy/Policy'
});
},
//
// selectWebEngine(e){
// console.log('',e[0].label);
// this.webEngineLabel = e[0].label;
// this.webEngineValue = e[0].value;
// },
//
// openWebSelectView(){
// this.webEngine = true;
// },
//
openLanguageSelectView(){
this.language = true;
@ -243,157 +295,167 @@
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #1F222B;
height:100vh;
// .content {
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: start;
// background-color: #1F222B;
// height:100vh;
.headLine{
color: royalblue;
font-size: 36rpx;
//padding-top:30px;
//margin-right:200px;
margin-top: 60rpx;
//border: 2px solid purple;
}
// .headLine{
// color: #fff;
// font-size: 48rpx;
// //padding-top:30px;
// //margin-right:200px;
// margin-top: 60rpx;
// //border: 2px solid purple;
// }
.settingList{
//border: 2px solid red;
width: 660rpx;
//height:300px;
height: auto;
//margin-top: 10px;
//background-color: #141b29;
// .settingList{
// //border: 2px solid red;
// width: 660rpx;
// //height:300px;
// height: auto;
// margin-top: 60rpx;
// //background-color: #141b29;
.listItem{
//border: 2px solid yellow;
height: 100rpx;
//margin-top: 30px;
background-color: #141b29;
color: #fff;
text-align: start;
// .listItem{
// border: 2px solid yellow;
// height: 130rpx;
// margin-top: 30rpx;
// background-color: #161A23;
// color: #fff;
// text-align: start;
.list-icon-text {
display: flex;
align-items: center;
justify-content: space-between;
// .list-icon-text {
// display: flex;
// align-items: center;
// justify-content: space-between;
.list-left{
//border: 2px solid green;
display: flex;
align-items: center;
justify-content: flex-start;
// .list-left{
// //border: 2px solid green;
// display: flex;
// align-items: center;
// justify-content: flex-start;
.list-left-text{
width: 420rpx;
.list-left-text-one{
font-size: 30rpx;
//border: 2px solid blue;
}
// .list-left-text{
// width: 420rpx;
// .list-left-text-one{
// font-size: 40rpx;
// //border: 2px solid blue;
// }
.list-left-text-two{
color: grey;
font-size: 26rpx;
//border: 2px solid lightsalmon;
}
}
// .list-left-text-two{
// color: grey;
// font-size: 40rpx;
// //border: 2px solid lightsalmon;
// }
// }
.list-left-feedback-text{
width: 480rpx;
.list-left-feedback-text-one{
font-size: 30rpx;
//border: 2px solid blue;
}
// .list-left-feedback-text{
// width: 480rpx;
// .list-left-feedback-text-one{
// font-size: 40rpx;
// //border: 2px solid blue;
// }
.list-left-feedback-text-two{
color: grey;
font-size: 26rpx;
//border: 2px solid lightsalmon;
}
}
// .list-left-feedback-text-two{
// color: grey;
// font-size: 30rpx;
// //border: 2px solid lightsalmon;
// }
// }
.list-left-icon{
//border: 2px solid blueviolet;
margin-right: 20rpx;
font-size: 50rpx;
}
// .list-left-icon{
// //border: 2px solid blueviolet;
// margin-right: 20rpx;
// font-size: 100rpx;
// }
.list-left-select-text{
width: 320rpx;
.list-left-select-text-one{
font-size: 30rpx;
//border: 2px solid blue;
}
}
}
// .list-left-select-text{
// width: 320rpx;
// .list-left-select-text-one{
// font-size: 40rpx;
// //border: 2px solid blue;
// }
// }
// }
.list-right{
//border: 2px solid pink;
color: royalblue;
font-size: 40rpx;
// .list-right{
// //border: 2px solid pink;
// color: royalblue;
// font-size: 48rpx;
.list-right-icon{
//border: 2px solid gainsboro;
font-size: 50rpx;
margin-left: 30rpx;
}
// .list-right-icon{
// //border: 2px solid gainsboro;
// font-size: 50rpx;
// margin-left: 30rpx;
// }
.list-right-text{
//border: 2px solid green;
//margin-right: 30px;
//padding-right: 30px;
}
}
}
}
// .list-right-text{
// //border: 2px solid green;
// //margin-right: 30px;
// //padding-right: 30px;
// }
// }
// }
// }
// }
// }
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
background-color: #000000;
height:100vh;
.listView{
height: auto;
width: 660rpx;
margin-top: 60rpx;
background-color: #161A23;
text-align: start;
//border: 1px solid red;
}
}
// .message {
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: space-around;
// &__left {
// width: 10%;
// }
// &__middle {
// width: 80%;
// padding-left: 20rpx;
// padding-right: 40rpx;
// }
// &__right {
// width: 10%;
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
// }
// &__name {
// font-size: 32rpx;
// margin-bottom: 8rpx;
// }
// &__content {
// //margin-top: 20px;
// font-size: 26rpx;
// color: #838383;
// }
// &__tips {
// &__icon {
// font-size: 36rpx;
// color: #AAAAAA;
// }
// }
// }
.headLine{
color: #fff;
font-size: 48rpx;
margin-top: 60rpx;
}
.list-text{
color: #fff;
font-size: 36rpx;
background-color: #161A23;
//border: 1px solid greenyellow;
}
.list-select{
//border: 2px solid pink;
color: royalblue;
font-size: 36rpx;
.list-select-icon{
//border: 2px solid gainsboro;
font-size: 50rpx;
margin-left: 30rpx;
}
}
.list-box{
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

BIN
static/album.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/flashLightOff.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 968 B

BIN
static/flashLightOn.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 863 B

186
uni_modules/vv-schedule/index.js

@ -0,0 +1,186 @@
export async function addSchedule(data) {
//#ifdef APP-PLUS
const {platform} = uni.getSystemInfoSync()
if (platform == 'android') {
return androidSchedule(data)
} else if (platform == 'ios') {
return iosSchedule(data)
}
//#endif
}
async function androidSchedule (data) {
const calendarURL = 'content://com.android.calendar/calendars'
const calendarEventURL = 'content://com.android.calendar/events'
const calendarRemiderURL = 'content://com.android.calendar/reminders'
const CalendarContract = plus.android.import('android.provider.CalendarContract')
const account = await createAccountData()
const main = plus.android.runtimeMainActivity()
const timeZone = plus.android.invoke('java.util.TimeZone', 'getDefault')
const timeZoneId = plus.android.invoke(timeZone, 'getID')
await checkPermission()
let accountId = getAccount()
if (!accountId) {
accountId = addAccount()
}
if (!accountId) return
const calendarId = insertCalendar({
calendar_id: accountId,
title: data.title,
description: data.description,
dtstart: data.dtstart,
dtend: data.dtend,
})
if (!calendarId) return
insertReminder({event_id: calendarId})
// insertAlarm(data.dtstart)
async function checkPermission() {
return new Promise((resolve) => {
plus.android.requestPermissions(['android.permission.READ_CALENDAR', 'android.permission.WRITE_CALENDAR'], ({deniedAlways, deniedPresent, granted}) => {
if (deniedAlways.length > 0) { //权限被永久拒绝
// 弹出提示框解释为何需要权限,引导用户打开设置页面开启
uni.showModal({
title: '提示',
content: '请打开日历权限',
success: ({confirm}) => {
if (!confirm) return
const intent = plus.android.newObject("android.content.Intent")
const Settings = plus.android.newObject("android.provider.Settings")
const action = plus.android.getAttribute(Settings, 'ACTION_APPLICATION_DETAILS_SETTINGS')
plus.android.invoke(intent, 'setAction', action)
const uri = plus.android.invoke('android.net.Uri', 'fromParts', 'package', main.getPackageName(), null)
plus.android.invoke(intent, 'setData', uri)
main.startActivity(intent)
}
})
} else if (deniedPresent.length > 0) { //权限被临时拒绝
uni.showToast({title: '您拒绝了日历写入权限', icon: 'none'})
} else if (granted.length > 0) { //权限被允许
resolve()
}
}, err => {
uni.showToast({title: `申请权限错误:${err.code} ${err.message}`, icon: 'none'})
})
})
}
function createAccountData() {
return new Promise((resolve) => {
plus.runtime.getProperty(plus.runtime.appid, ({appid, name}) => {
resolve({
name,
account_name: appid,
account_type: CalendarContract.ACCOUNT_TYPE_LOCAL,
display_name: name,
})
})
})
}
function getAccount() {
const uri = plus.android.invoke('android.net.Uri', 'parse', calendarURL)
const userCursor = plus.android.invoke(main.getContentResolver(), "query", uri, null, null, null, null)
while (plus.android.invoke(userCursor, 'moveToNext')) {
const _account_name = plus.android.invoke(userCursor, 'getString', plus.android.invoke(userCursor, 'getColumnIndex', 'account_name'))
const _account_type = plus.android.invoke(userCursor, 'getString', plus.android.invoke(userCursor, 'getColumnIndex', 'account_type'))
const _id = plus.android.invoke(userCursor, 'getString', plus.android.invoke(userCursor, 'getColumnIndex', '_id'))
if (_account_name == account.account_name && _account_type == account.account_type) {
return _id
}
}
}
function addAccount() {
const value = plus.android.newObject('android.content.ContentValues')
plus.android.invoke(value, 'put', 'name', account.name)
plus.android.invoke(value, 'put', 'account_name', account.account_name)
plus.android.invoke(value, 'put', 'account_type', account.account_type)
plus.android.invoke(value, 'put', 'calendar_displayName', account.display_name)
plus.android.invoke(value, 'put', 'visible', 1)
plus.android.invoke(value, 'put', 'sync_events', 1)
plus.android.invoke(value, 'put', 'calendar_timezone', timeZoneId)
plus.android.invoke(value, 'put', 'ownerAccount', account.account_name)
// plus.android.invoke(value, 'put', 'canOrganizerRespond', 0)
// plus.android.invoke(value, 'put', 'calendar_color', -9206951)
// plus.android.invoke(value, 'put', 'calendar_access_level', 700)
const calendarUri = plus.android.invoke('android.net.Uri', 'parse', calendarURL)
const buildUpon = plus.android.invoke(calendarUri, "buildUpon")
plus.android.invoke(buildUpon, "appendQueryParameter", CalendarContract.CALLER_IS_SYNCADAPTER, "true")
plus.android.invoke(buildUpon, "appendQueryParameter", "account_name", account.account_name)
plus.android.invoke(buildUpon, "appendQueryParameter", "account_type", account.account_type)
const build = plus.android.invoke(buildUpon, "build")
const newAccoutList = plus.android.invoke(main.getContentResolver(), "insert", build, value)
const newAccout_id = plus.android.invoke(plus.android.invoke(newAccoutList, "getPathSegments"), "get", 1)
return newAccout_id
}
function insertCalendar({calendar_id, title, description, dtstart, dtend}) {
const value = plus.android.newObject('android.content.ContentValues')
const systemInfo = uni.getSystemInfoSync()
plus.android.invoke(value, 'put', 'calendar_id', (systemInfo.brand || '').toLowerCase() == 'xiaomi' ? 1 : calendar_id)
plus.android.invoke(value, 'put', 'title', title)
plus.android.invoke(value, 'put', 'description', description)
plus.android.invoke(value, 'put', 'dtstart', dtstart)
plus.android.invoke(value, 'put', 'dtend', dtend)
plus.android.invoke(value, 'put', 'eventTimezone', timeZoneId)
// plus.android.invoke(value, 'put', 'allDay', 1)
// plus.android.invoke(value, 'put', 'rrule', 'FREQ=MONTHLY;BYMONTHDAY=24')
//rrule参考 https://www.cnblogs.com/ice5/p/14023771.html
plus.android.invoke(value, 'put', 'hasAlarm', 1) //是否闹钟提醒 默认提醒 因为大部分手机未实现此功能 故未实现
const calendarEventUri = plus.android.invoke('android.net.Uri', 'parse', calendarEventURL)
const newEvent = plus.android.invoke(main.getContentResolver(), 'insert', calendarEventUri, value)
const id = plus.android.invoke(newEvent, 'getLastPathSegment')
return id
}
function insertReminder({event_id}) {
const value = plus.android.newObject('android.content.ContentValues')
plus.android.invoke(value, 'put', 'event_id', event_id)
plus.android.invoke(value, 'put', 'minutes', 5)
plus.android.invoke(value, 'put', 'method', 1)
const calendarRemiderUri = plus.android.invoke('android.net.Uri', 'parse', calendarRemiderURL)
const res = plus.android.invoke(main.getContentResolver(), 'insert', calendarRemiderUri, value)
return res
}
function insertAlarm(dtstart) {
const AlarmManager = plus.android.importClass("android.app.AlarmManager")
const Context = plus.android.importClass("android.content.Context")
const alarm = main.getSystemService(Context.ALARM_SERVICE)
const intent = plus.android.newObject("android.content.Intent")
const PendingIntent = plus.android.importClass("android.app.PendingIntent")
const pendingIntent = PendingIntent.getActivity(main, 0, intent, 0)
alarm.set(AlarmManager.RTC_WAKEUP, dtstart, pendingIntent)
}
}
function iosSchedule(data) {
return new Promise((resolve) => {
const eventStore = plus.ios.newObject('EKEventStore')
// const hasMethod = plus.ios.invoke(eventStore, 'respondsToSelector:', plus.ios.newObject('@selector', 'requestAccessToEntityType:completion:'))
plus.ios.invoke(eventStore, 'requestAccessToEntityType:completion:', 0, () => {
const calendar = plus.ios.invoke(eventStore, 'defaultCalendarForNewEvents')
if (!calendar) {
// uni.showModal({
// title: '提示',
// content: '请打开日历权限',
// success: ({confirm}) => {
// if (!confirm) return
// plus.runtime.openURL('app-settings://')
// }
// })
return
}
const event = plus.ios.invoke('EKEvent', 'eventWithEventStore:', eventStore)
// const date = plus.ios.newObject('NSDate')
event.plusSetAttribute('title', data.title)
// event.plusSetAttribute('location', 'location')
event.plusSetAttribute('notes', data.description)
const startDate = plus.ios.invoke('NSDate', 'dateWithTimeIntervalSince1970:', data.dtstart /1000)
event.plusSetAttribute('startDate', startDate)
const endDate = plus.ios.invoke('NSDate', 'dateWithTimeIntervalSince1970:', data.dtend /1000)
event.plusSetAttribute('endDate', endDate)
const alarm = plus.ios.invoke('EKAlarm', 'alarmWithRelativeOffset:', -5)
plus.ios.invoke(event, 'addAlarm:', alarm)
plus.ios.invoke(event, 'setCalendar:', calendar)
const res = plus.ios.invoke(eventStore, 'saveEvent:span:error:', event, 0, null)
if (res) {
return resolve(res)
}
})
})
}

13
uni_modules/vv-schedule/readme.md

@ -0,0 +1,13 @@
# vv-schedule
### 用法:
```
import {addSchedule} from '@/uni_modules/vv-schedule'
await addSchedule({
title: 'vvv',
description: 'eee',
dtstart: new Date('2021/8/28 5:00').getTime(),
dtend: new Date('2021/8/28 6:00').getTime(),
})
uni.showToast({title: '日程添加成功'})
```
Loading…
Cancel
Save