Commit a86cbbfd authored by xinzhedeai's avatar xinzhedeai

优化

parent 2c87ae12
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</p> </p>
<h5>九小场所安全检查清单</h5> <h5>九小场所安全检查清单</h5>
</div> </div>
<div class="checklist-container"> <div class="checklist-container" v-cloak>
<div class="item_title"> <div class="item_title">
{{ checkData?.[checkPageIndex]?.name }} {{ checkData?.[checkPageIndex]?.name }}
</div> </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script type="text/javascript" src="../sdk/includeHead.js"></script> <script type="text/javascript" src="../sdk/includeHead.js"></script>
</head> </head>
<div id="app"> <div id="app">
<div class="wrapper"> <div class="wrapper" v-cloak>
<!-- 表单内容 --> <!-- 表单内容 -->
<van-cell-group inset> <van-cell-group inset>
<van-cell-group> <van-cell-group>
...@@ -36,9 +36,10 @@ ...@@ -36,9 +36,10 @@
<van-picker show-toolbar :columns="typeOptions" @confirm="onConfirmType" <van-picker show-toolbar :columns="typeOptions" @confirm="onConfirmType"
@cancel="showTypePicker = false" /> @cancel="showTypePicker = false" />
</van-popup> </van-popup>
-->
<van-cell-group> <van-cell-group>
<van-field label="安全二维码"/> <van-field label="安全二维码" :disabled="true"/>
</van-cell-group> --> </van-cell-group>
</van-cell-group> </van-cell-group>
</div> </div>
......
...@@ -105,23 +105,7 @@ window.addEventListener('load', function () { ...@@ -105,23 +105,7 @@ window.addEventListener('load', function () {
this.formData.type = value this.formData.type = value
this.showTypePicker = false this.showTypePicker = false
}, },
saveCanvas() {
if (!this.canvasReady) return
const canvas = document.getElementById('mainCanvas')
const dataURL = canvas.toDataURL('image/png')
console.log(dataURL, '图片下载')
lightAppJssdk.media.savePhoto({
arg: dataURL,
success: function (data) {
alert(JSON.stringify(data))
},
fail: function (data) {
alert(data)
},
})
},
generateQRCode(QR_IMAGE_URL) { generateQRCode(QR_IMAGE_URL) {
this.canvasReady = false this.canvasReady = false
// 加载二维码图片 // 加载二维码图片
...@@ -185,3 +169,34 @@ window.addEventListener('load', function () { ...@@ -185,3 +169,34 @@ window.addEventListener('load', function () {
}, },
}) })
}) })
function saveCanvas() {
if (!VUE.canvasReady) return
vant.Toast.loading({
message: '图片保存中...',
forbidClick: true,
loadingType: 'spinner',
});
const canvas = document.getElementById('mainCanvas')
const dataURL = canvas.toDataURL('image/png')
console.log(dataURL, '图片下载')
lightAppJssdk.media.savePhoto({
arg: dataURL,
success: function (data) {
// vant.Toast.clear()
// alert(JSON.stringify(data))
vant.Dialog.alert({
message: '保存成功',
})
},
fail: function (data) {
// vant.Toast.clear()
// alert('保存失败')
vant.Dialog.alert({
message: '保存失败',
})
},
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment