Browse Source

完善页面

master
Penny 2 years ago
parent
commit
aa86522498
  1. 3
      App.vue
  2. 45
      manifest.json
  3. BIN
      nativeplugins/JY-MLScanSDK/android/jy-mlscansdk-release.aar
  4. BIN
      nativeplugins/JY-MLScanSDK/android/mlkit-scanner-release.aar
  5. 28
      nativeplugins/JY-MLScanSDK/package.json
  6. BIN
      nativeplugins/test/android/scanCode-release.aar
  7. 23
      nativeplugins/test/package.json
  8. 17
      pages/scan/Barcode.vue
  9. 18
      pages/scan/Book.vue
  10. 25
      pages/scan/Calendar.vue
  11. 26
      pages/scan/Contacts.vue
  12. 21
      pages/scan/Email.vue
  13. 20
      pages/scan/Location.vue
  14. 17
      pages/scan/Product.vue
  15. 238
      pages/scan/Scan.nvue
  16. 20
      pages/scan/Sms.vue
  17. 19
      pages/scan/Tel.vue
  18. 19
      pages/scan/Text.vue
  19. 20
      pages/scan/Url.vue
  20. 26
      pages/scan/Wifi.vue

3
App.vue

@ -13,7 +13,10 @@
</script>
<style lang="scss">
/* #ifndef APP-PLUS*/
@import './tuniao-ui/index.scss';
@import './tuniao-ui/iconfont.css';
/* #endif */
/*每个页面公共css */
</style>

45
manifest.json

@ -17,7 +17,9 @@
"delay" : 0
},
/* */
"modules" : {},
"modules" : {
"SQLite" : {}
},
/* */
"distribute" : {
/* android */
@ -40,7 +42,7 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"minSdkVersion" : 21,
"targetSdkVersion" : 28
"targetSdkVersion" : 32
},
/* ios */
"ios" : {
@ -52,43 +54,10 @@
}
},
"nativePlugins" : {
"Mpaas-Scan" : {
"AppId" : "ALIPUB292A079010931",
"License" : "KXaY6vzdsbbpso9o+9XOdpbiWPfgWstqa2NFfXVxEJZ4sVFaH33wvGUvLELnwibqFU3LEeWQPm+nW5TOfHNIOVnrUVji+bZoDuRTvPGFnVupqKpZRiF3kNB76pXHy9LuqAkH0h/eI44ZapbQNj15/Jma4WR5bffSdNKuTUnbDiaQSpBp9A38TGeWJ222eQL+RjGvFm15MZntBou93IspOnN58cDAvk75A6hUydJupKqYDl7UgQurm5pRKvB0UMYQOFcymuUVJH6N8a8pyJkvgP98oy3MskMcdJtYAzbjbdQi8/4ZuhPwbjqhVqzM3Pq2ebA2QcH/zbGT4LuvnQKXLw==",
"WorkspaceId" : "default",
"__plugin_info__" : {
"name" : "支付宝原生扫码插件",
"description" : "支付宝原生扫码组件,包体积仅0.7MB,15分钟即可完成接入。同时,mPaaS提供「扫码分析」大盘",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=2636",
"android_package_name" : "uni.UNI44D25EC",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "2636",
"parameters" : {
"AppId" : {
"des" : "Android平台的AppId,请填写Android的config文件中的appId对应的值",
"key" : "mobilegw.appid",
"value" : ""
},
"License" : {
"des" : "Android平台的License,,请填写Android的config文件中的mpaasConfigLicense对应的值",
"key" : "mpaasConfigLicense",
"value" : ""
},
"WorkspaceId" : {
"des" : "Android平台的WorkspaceId,请填写Android的config文件中的workspaceId对应的值",
"key" : "workspaceId",
"value" : ""
}
}
}
},
"scanCode" : {
"JY-MLScanSDK" : {
"__plugin_info__" : {
"name" : "scanCode",
"description" : "测试插件流程",
"name" : "JY-MLScanSDK模块",
"description" : "JY-MLScanSDK",
"platforms" : "Android",
"url" : "",
"android_package_name" : "",

BIN
nativeplugins/JY-MLScanSDK/android/jy-mlscansdk-release.aar

Binary file not shown.

BIN
nativeplugins/JY-MLScanSDK/android/mlkit-scanner-release.aar

Binary file not shown.

28
nativeplugins/JY-MLScanSDK/package.json

@ -0,0 +1,28 @@
{
"name": "JY-MLScanSDK模块",
"id": "JY-MLScanSDK",
"version": "1.0.0",
"description": "JY-MLScanSDK",
"_dp_type": "nativeplugin",
"_dp_nativeplugin": {
"android": {
"plugins": [{
"type": "module",
"name": "JY-MLScanSDK",
"class": "com.jiyi.jy_mlscansdk.JYMLScanSDKModule"
}],
"integrateType": "aar",
"dependencies": [
"com.google.mlkit:barcode-scanning:16.2.0",
"androidx.camera:camera-core:1.0.1",
"androidx.camera:camera-camera2:1.0.1",
"androidx.camera:camera-lifecycle:1.0.1",
"androidx.camera:camera-view:1.0.0-alpha25"
],
"compileOptions": {
"sourceCompatibility": "1.8",
"targetCompatibility": "1.8"
}
}
}
}

BIN
nativeplugins/test/android/scanCode-release.aar

Binary file not shown.

23
nativeplugins/test/package.json

@ -1,23 +0,0 @@
{
"name": "scanCode",
"id": "scanCode",
"version": "0.0.1",
"description": "测试插件流程",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "scanCode",
"class": "cn.bnyer.scancode.scanCode"
}
],
"integrateType": "aar",
"parameters": {
},
"dependencies": []
}
}
}

17
pages/scan/Barcode.vue

@ -2,7 +2,9 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>{{ barcodeInfo.ssid }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +31,7 @@
data() {
return {
col: 3,
barcodeInfo:{},
fastToolList:[
{
"index": 0,
@ -48,11 +51,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.barcodeInfo = data;
console.log('barcodeInfo',that.barcodeInfo)
}
}
}
</script>

18
pages/scan/Book.vue

@ -2,7 +2,9 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>{{ bookInfo.display }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +31,7 @@
data() {
return {
col: 4,
bookInfo:{},
fastToolList:[
{
"index": 0,
@ -53,13 +56,16 @@
]
}
},
onLoad() {
this.loadPage();
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
loadPage(){
console.log('11111')
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.bookInfo = data;
console.log('bookInfo',that.bookInfo)
}
}
}

25
pages/scan/Calendar.vue

@ -2,7 +2,13 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Subject: {{ calendarInfo.summary }}</view>
<view>Start: {{ calendarInfo.start }}</view>
<view>End: {{ calendarInfo.end }}</view>
<view>Note: {{ calendarInfo.desc }}</view>
<view>Address: {{ calendarInfo.location }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +35,7 @@
data() {
return {
col: 4,
calendarInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +60,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.calendarInfo = data;
console.log('calendarInfo',that.calendarInfo)
}
}
}
</script>
@ -84,8 +97,8 @@
background-color: #141b29;
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
height: 120px;
text-align: start;
}
.listItem{

26
pages/scan/Contacts.vue

@ -2,7 +2,14 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Name: {{ contactsInfo.name.formattedName }}</view>
<view>Tel: {{ contactsInfo.phones[0].number }}</view>
<view>E-mail: {{ contactsInfo.emails[0].address }}</view>
<view>Address: {{ contactsInfo.addresses[0].addressLines[0] }}</view>
<view>Note: {{ contactsInfo.title }}</view>
<view>Org: {{ contactsInfo.organization }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +36,7 @@
data() {
return {
col: 4,
contactsInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +61,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.contactsInfo = data;
console.log('contactsInfo',that.contactsInfo)
}
}
}
</script>
@ -84,8 +98,8 @@
background-color: #141b29;
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
height: 180px;
text-align: start;
}
.listItem{

21
pages/scan/Email.vue

@ -2,7 +2,11 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>To: {{ emailInfo.address }}</view>
<view>Subject: {{ emailInfo.subject }}</view>
<view>Content: {{ emailInfo.body }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +33,7 @@
data() {
return {
col: 4,
emailInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +58,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.emailInfo = data;
console.log('emailInfo',that.emailInfo)
}
}
}
</script>
@ -85,7 +96,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{

20
pages/scan/Location.vue

@ -2,7 +2,10 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Lng: {{ locationInfo.lng }}</view>
<view>Lat: {{ locationInfo.lat }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +32,7 @@
data() {
return {
col: 4,
locationInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +57,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.locationInfo = data;
console.log('locationInfo',that.locationInfo)
}
}
}
</script>
@ -85,7 +95,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{

17
pages/scan/Product.vue

@ -2,7 +2,9 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>code: {{ productInfo.display }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +31,7 @@
data() {
return {
col: 3,
productInfo:{},
fastToolList:[
{
"index": 0,
@ -48,11 +51,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.productInfo = data;
console.log('productInfo',that.productInfo)
}
}
}
</script>

238
pages/scan/Scan.nvue

@ -1,5 +1,5 @@
<template>
<view class="content">
<div class="content">
<tn-button shape="round" backgroundColor="#01BEFF" fontColor="#080808" @click="jumpToPage('/pages/scan/Barcode')">跳转Barcode页面</tn-button>
<tn-button shape="round" @click="jumpToPage('/pages/scan/Book')">跳转Book页面</tn-button>
<tn-button shape="round" @click="jumpToPage('/pages/scan/Calendar')">跳转Calendar页面</tn-button>
@ -15,20 +15,20 @@
<tn-button shape="round" @click="jumpToPage('/pages/scan/Wifi')">跳转Wifi页面</tn-button>
<tn-button type="primary" @click="scanCode()">扫码</tn-button>
<tn-button type="primary" @click="testAdd">相加</tn-button>
<tn-button type="primary" @click="writeToDb()">添加数据</tn-button>
<tn-toast ref="toast"></tn-toast>
</view>
<button @click="scanCode()">扫码</button>
<!-- <button @click="writeToDb()">添加数据</button> -->
<!-- <tn-button type="primary" @click="writeToDb()">添加数据</tn-button> -->
<!-- <tn-toast ref="toast"></tn-toast> -->
</div>
</template>
<script>
import { openSqlite,executeSql,closedb,isTable,addSql} from "@/utils/database";
//import { openSqlite,executeSql,closedb,isTable,addSql} from "@/utils/database";
export default {
data() {
return {
title: 'Scan',
tableName:"scancode",
tableName:"scancode"
}
},
created() {
@ -36,132 +36,144 @@
},
methods: {
testAdd(){
const testModule = uni.requireNativePlugin('scanCode');
testModule.add({
a:1,
b:2
},res => {
uni.showToast({
title: '提示',
content: JSON.stringify(res)
})
})
},
//写入扫描记录
async writeToDb(){
try{
let b = await addSql(this.tableName,{title:"你好,世界!",content:"世界:你好呀!",desc:"嘻嘻"})
uni.showToast({
title:"添加成功",
icon:"none"
});
}catch(e){
console.error("insert data error!",e)
}
},
// async writeToDb(){
// try{
// let b = await addSql(this.tableName,{title:"你好,世界!",content:"世界:你好呀!",desc:"嘻嘻"})
// uni.showToast({
// title:"添加成功",
// icon:"none"
// });
// }catch(e){
// console.error("insert data error!",e)
// }
// },
// 创建表
async createTable(){
let sql = this.createTableSql_outbound()
try{
let exist = await isTable(this.tableName)
console.log("表是否存在",exist)
if(!exist){
let res = await executeSql(sql)
uni.showToast({
title:"insert table ok",
icon:"none"
})
console.log("新增表scancode",res)
}else{
uni.showToast({
title:"table exist",
icon:"none"
})
}
}catch(e){
uni.showToast({
title:"insert table error",
icon:"none"
})
console.error("新增表报错scancode",e)
}
},
// async createTable(){
// let sql = this.createTableSql_outbound()
// try{
// let exist = await isTable(this.tableName)
// console.log("表是否存在",exist)
// if(!exist){
// let res = await executeSql(sql)
// uni.showToast({
// title:"insert table ok",
// icon:"none"
// })
// console.log("新增表scancode",res)
// }else{
// uni.showToast({
// title:"table exist",
// icon:"none"
// })
// }
// }catch(e){
// uni.showToast({
// title:"insert table error",
// icon:"none"
// })
// console.error("新增表报错scancode",e)
// }
// },
// 打开数据库
async openSqlite(){
try{
let b = await openSqlite()
uni.showToast({
title:"open db success",
icon:"none"
})
}catch(e){
console.error("open db error",e)
}
},
// async openSqlite(){
// try{
// let b = await openSqlite()
// uni.showToast({
// title:"open db success",
// icon:"none"
// })
// }catch(e){
// console.error("open db error",e)
// }
// },
// 关闭数据库
closedb(){
try{
closedb()
}catch(e){
console.error("close db error",e)
}
// closedb(){
// try{
// closedb()
// }catch(e){
// console.error("close db error",e)
// }
},
// },
//根据扫码返回结果判断跳转到哪个指定页面
jumpToPage(url){
jumpToPage(url,data){
uni.navigateTo({
url: url
url: url + '?data='+ data
});
},
//阿里扫描
// scanCode() {
// var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
// mpaasScanModule.mpaasScan({
// // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
// // 'scanType': ['qrCode', 'barCode'],
// // 是否隐藏相册,默认false不隐藏
// 'hideAlbum': false,
// },
// (ret) => {
// console.log(JSON.stringify(ret))
// this.$refs.toast.show({
// title: '支付成功',
// content: JSON.stringify(ret),
// icon: 'success',
// duration: 2000
// });
// console.log('24123123')
// })
// },
//mlkit扫码
scanCode(){
let that = this;
var mlscan = uni.requireNativePlugin("JY-MLScanSDK");
//console.log(mlscan)
mlscan.startScan(res=> {
that.analyserCode(res);
// uni.showToast({
// icon:'none',
// title:JSON.stringify(res)
// })
this.$refs.toast.show({
title: 'scan success',
content: JSON.stringify(res),
icon: 'success',
duration: 2000
});
})
},
analyserCode(res){
let that = this;
let result = JSON.parse(JSON.stringify(res))
console.log('result',result)
let data = JSON.parse(result.data)
console.log('data',data)
let type = data[0].type
console.log('type',type)
let data2 = data[0].data
console.log('data2',data2)
// let data3 = JSON.stringify(data[0].data)
// console.log('data3',data3)
if(result.errorCode != "0"){
uni.showToast({
icon:'none',
title: 'scan error!'
})
}else{
if(type === 1){
that.jumpToPage('/pages/scan/Contacts',JSON.stringify(data2))
}else if(type === 2){
that.jumpToPage('/pages/scan/Email',JSON.stringify(data2))
}else if(type === 3){
that.jumpToPage('/pages/scan/Book',JSON.stringify(data2))
}else if(type === 4){
that.jumpToPage('/pages/scan/Tel',JSON.stringify(data2))
}else if(type === 5){
that.jumpToPage('/pages/scan/Product',JSON.stringify(data2))
}else if(type === 6){
that.jumpToPage('/pages/scan/Sms',JSON.stringify(data2))
}else if(type === 7){
that.jumpToPage('/pages/scan/Text',JSON.stringify(data2))
}else if(type === 8){
that.jumpToPage('/pages/scan/Url',JSON.stringify(data2))
}else if(type === 9){
that.jumpToPage('/pages/scan/Wifi',JSON.stringify(data2))
}else if(type === 10){
that.jumpToPage('/pages/scan/Location',JSON.stringify(data2))
}else if(type === 11){
that.jumpToPage('/pages/scan/Calendar',JSON.stringify(data2))
}
}
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
@ -169,22 +181,4 @@
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

20
pages/scan/Sms.vue

@ -2,7 +2,10 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Tel: {{ smsInfo.phoneNumber }}</view>
<view>Content: {{ smsInfo.message }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +32,7 @@
data() {
return {
col: 4,
smsInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +57,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.smsInfo = data;
console.log('smsInfo',that.smsInfo)
}
}
}
</script>
@ -85,7 +95,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{

19
pages/scan/Tel.vue

@ -2,7 +2,9 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Telephone number: {{ telInfo.number }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +31,7 @@
data() {
return {
col: 4,
telInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +56,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.telInfo = data;
console.log('telInfo',that.telInfo)
}
}
}
</script>
@ -85,7 +94,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{

19
pages/scan/Text.vue

@ -2,7 +2,9 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>{{ textInfo.display }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +31,7 @@
data() {
return {
col: 4,
textInfo:{},
fastToolList:[
{
"index": 0,
@ -53,11 +56,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.textInfo = data;
console.log('textInfo',that.textInfo)
}
}
}
</script>
@ -85,7 +94,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{

20
pages/scan/Url.vue

@ -2,7 +2,10 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Title: {{ urlInfo.title }}</view>
<view>Url: {{ urlInfo.url }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +32,7 @@
data() {
return {
col: 3,
urlInfo:{},
fastToolList:[
{
"index": 0,
@ -48,11 +52,17 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.urlInfo = data;
console.log('urlInfo',that.urlInfo)
}
}
}
</script>
@ -79,7 +89,7 @@
background-color: #141b29;
color: #fff;
//border: 2px solid yellow;
height: 80px;
height: 180px;
text-align: center;
}

26
pages/scan/Wifi.vue

@ -2,7 +2,10 @@
<view class="content">
<tn-avatar src="/static/logo.png" class="icon" size="xl"></tn-avatar>
<tn-list-view :card="true" unlined="all" class="listView">
<tn-list-cell class="listItem-1">我是扫码内容部分</tn-list-cell>
<tn-list-cell class="listItem-1">
<view>Network name: {{ wifiInfo.ssid }}</view>
<view>Password: {{ wifiInfo.password }}</view>
</tn-list-cell>
<tn-list-cell class="listItem">
<tn-grid align="center" :col="col">
<block v-for="(item, index) in fastToolList" :key="index">
@ -29,6 +32,7 @@
data() {
return {
col: 4,
wifiInfo:{},
fastToolList:[
{
"index": 0,
@ -53,17 +57,25 @@
]
}
},
onLoad() {
onLoad(option) {
let that = this;
that.initData(option);
},
methods: {
initData(option){
let that = this;
let data = JSON.parse(option.data);
that.wifiInfo = data;
console.log('wifiInfo',that.wifiInfo)
console.log('password',that.wifiInfo.password)
console.log('ssid',that.wifiInfo.ssid)
}
}
}
</script>
<style lang="scss">
.content {
.content {
display: flex;
flex-direction: column;
align-items: center;
@ -85,7 +97,7 @@
color: #fff;
//border: 2px solid yellow;
height: 80px;
text-align: center;
text-align: start;
}
.listItem{
@ -158,4 +170,4 @@
}
}
</style>
</style>
Loading…
Cancel
Save