安装协议页面导入安装协议

This commit is contained in:
WindowBird 2025-09-11 14:52:11 +08:00
parent f44d76a7a2
commit 08374b4a41
3 changed files with 98 additions and 60 deletions

View File

@ -124,13 +124,11 @@
}
},
{
"path" : "pages/InstallationAgreement/InstallationAgreement",
"style" :
{
"navigationBarTitleText" : "安装协议"
}
"path": "pages/InstallationAgreement/InstallationAgreement",
"style": {
"navigationBarTitleText": "签署安装协议"
}
}
],
"subPackages": [
{

View File

@ -1,5 +1,6 @@
<template>
<view class="page">
<uv-button throttleTime="1000" type="primary " @click="openProtocol">点击查看协议</uv-button>
<uv-form ref="form" :model="userInfo" :rules="rules" labelPosition="left" labelWidth="auto">
<uv-form-item borderBottom label="电话:" prop="phone">
<uv-input v-model="userInfo.phone" border="none"></uv-input>
@ -118,6 +119,19 @@ export default {
}
},
methods: {
openProtocol() {
uni.downloadFile({
url: 'https://api.ccttiot.com/安装协议(准备好)-1757570264575.pdf',
success: function (res) {
var filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {},
})
},
})
},
handleUploadSuccess(result) {
console.log('图片上传成功:', result.url)
this.userInfo.businessLicenseUrl = result.url

View File

@ -1,64 +1,90 @@
<!--<template>-->
<!-- <view style="width: 750rpx; height: 750rpx">-->
<!-- <l-signature-->
<!-- ref="signatureRef"-->
<!-- :openSmooth="openSmooth"-->
<!-- :penColor="penColor"-->
<!-- :penSize="penSize"-->
<!-- disableScroll-->
<!-- ></l-signature>-->
<!-- </view>-->
<!-- <view>-->
<!-- <button @click="onClick('clear')">清空</button>-->
<!-- <button @click="onClick('undo')">撤消</button>-->
<!-- <button @click="onClick('save')">保存</button>-->
<!-- <button @click="onClick('openSmooth')">压感{{ openSmooth ? '' : '' }}</button>-->
<!-- </view>-->
<!--</template>-->
<!--<script>-->
<!--import { getCurrentInstance, onMounted, ref } from 'vue'-->
<!--export default {-->
<!-- data() {-->
<!-- return {-->
<!-- title: 'Hello',-->
<!-- penColor: 'red',-->
<!-- penSize: 5,-->
<!-- url: '',-->
<!-- openSmooth: true,-->
<!-- }-->
<!-- },-->
<!-- methods: {-->
<!-- onClick(type) {-->
<!-- if (type == 'openSmooth') {-->
<!-- this.openSmooth = !this.openSmooth-->
<!-- return-->
<!-- }-->
<!-- if (type == 'save') {-->
<!-- this.$refs.signatureRef.canvasToTempFilePath({-->
<!-- success: res => {-->
<!-- // -->
<!-- console.log(res.isEmpty)-->
<!-- // -->
<!-- // H5 base64-->
<!-- this.url = res.tempFilePath-->
<!-- console.log(res.tempFilePath)-->
<!-- // uni.saveImageToPhotosAlbum({-->
<!-- // filePath: res.tempFilePath,-->
<!-- // success: () => {-->
<!-- // uni.showToast({ title: '' })-->
<!-- // },-->
<!-- // })-->
<!-- uni.previewImage({-->
<!-- urls: [res.tempFilePath],-->
<!-- current: 0,-->
<!-- })-->
<!-- },-->
<!-- })-->
<!-- return-->
<!-- }-->
<!-- if (this.$refs.signatureRef) this.$refs.signatureRef[type]()-->
<!-- },-->
<!-- },-->
<!--}-->
<!--</script>-->
<!--<style lang="scss"></style>-->
<template>
<view style="width: 750rpx; height: 750rpx">
<l-signature
ref="signatureRef"
:openSmooth="openSmooth"
:penColor="penColor"
:penSize="penSize"
disableScroll
></l-signature>
</view>
<view>
<button @click="onClick('clear')">清空</button>
<button @click="onClick('undo')">撤消</button>
<button @click="onClick('save')">保存</button>
<button @click="onClick('openSmooth')">压感{{ openSmooth ? '' : '' }}</button>
</view>
<view @click="open()">123</view>
</template>
<script>
import { getCurrentInstance, onMounted, ref } from 'vue'
export default {
data() {
return {
title: 'Hello',
penColor: 'red',
penSize: 5,
url: '',
openSmooth: true,
}
return {}
},
methods: {
onClick(type) {
if (type == 'openSmooth') {
this.openSmooth = !this.openSmooth
return
}
if (type == 'save') {
this.$refs.signatureRef.canvasToTempFilePath({
success: res => {
//
console.log(res.isEmpty)
//
// H5 base64
this.url = res.tempFilePath
console.log(res.tempFilePath)
// uni.saveImageToPhotosAlbum({
// filePath: res.tempFilePath,
// success: () => {
// uni.showToast({ title: '' })
// },
// })
uni.previewImage({
urls: [res.tempFilePath],
current: 0,
})
},
})
return
}
if (this.$refs.signatureRef) this.$refs.signatureRef[type]()
open() {
uni.downloadFile({
url: 'https://api.ccttiot.com/安装协议(准备好)-1757570264575.pdf',
success: function (res) {
var filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {},
})
},
})
},
},
}