lijuncheng
7 months ago
8 changed files with 108 additions and 4 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,35 @@ |
|||
{ |
|||
|
|||
"name": "TestModule", |
|||
|
|||
"id": "TestModule", |
|||
|
|||
"version": "1.0.0", |
|||
|
|||
"description": "打印", |
|||
|
|||
"_dp_type": "nativeplugin", |
|||
|
|||
"_dp_nativeplugin": { |
|||
|
|||
"android": { |
|||
|
|||
"integrateType": "aar", |
|||
|
|||
"plugins": [ |
|||
|
|||
{ |
|||
|
|||
"type": "module", |
|||
"name": "TestModule", |
|||
"class": "io.dcloud.uniplugin.TestModule" |
|||
|
|||
} |
|||
|
|||
] |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
<template> |
|||
<view> |
|||
<button @click="printImage"> 打印图片</button> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
// #ifdef APP |
|||
var testModule = uni.requireNativePlugin("TestModule") |
|||
// #endif |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
bufferData:'' |
|||
} |
|||
}, |
|||
components:{ |
|||
|
|||
}, |
|||
methods: { |
|||
// #ifdef APP |
|||
printImage(){ |
|||
var content ="<html><body><h1>Test Content测试打印,测试打印</h1><p>Testing, testing, testing...测试测试测试测试</p></body></html>" |
|||
testModule.doHTMLPrint(content) |
|||
} |
|||
// #endif |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
Loading…
Reference in new issue