You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.3 KiB
116 lines
3.3 KiB
<template>
|
|
<view 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>
|
|
<tn-button shape="round" @clicksss="jumpToPage('/pages/scan/Contacts')">跳转Contacts页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Email')">跳转Email页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Location')">跳转Location页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Paypal')">跳转Paypal页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Product')">跳转Product页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Sms')">跳转Sms页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Tel')">跳转Tel页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Text')">跳转Text页面</tn-button>
|
|
<tn-button shape="round" @click="jumpToPage('/pages/scan/Url')">跳转Url页面</tn-button>
|
|
<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-toast ref="toast"></tn-toast>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: 'Scan'
|
|
}
|
|
},
|
|
created() {
|
|
// this.scanCode();
|
|
},
|
|
methods: {
|
|
|
|
testAdd(){
|
|
const testModule = uni.requireNativePlugin('scanCode');
|
|
testModule.add({
|
|
a:1,
|
|
b:2
|
|
},res => {
|
|
uni.showToast({
|
|
title: '提示',
|
|
content: JSON.stringify(res)
|
|
})
|
|
})
|
|
},
|
|
//根据扫码返回结果判断跳转到哪个指定页面
|
|
jumpToPage(url){
|
|
uni.navigateTo({
|
|
url: url
|
|
});
|
|
},
|
|
|
|
//扫码
|
|
// scanCode(){
|
|
// // 允许从相机和相册扫码
|
|
// uni.scanCode({
|
|
// success: function (res) {
|
|
// console.log(JSON.stringify(res))
|
|
// console.log('条码类型:' + res.scanType);
|
|
// console.log('条码内容:' + res.result);
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
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')
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
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>
|
|
|