@@ -220,7 +220,6 @@
}
this.info.signUrl=img
-
if(!this.info.accountName){
uni.showToast({
@@ -91,8 +91,8 @@
</view>
<button :class="{
- submit:this.url,
- submitNo:!this.url
+ submit:true,
+
}" @click="submit()">提交确认单</button>
</template>
@@ -184,13 +184,29 @@
},
submit(){
- if(this.url){
- this.uploadpic()
- }else{
- uni.showToast({
- title: "请签字后,点击保存"
- })
- }
+ this.$refs.signatureRef.canvasToTempFilePath({
+ success: (res) => {
+ // 是否为空画板 无签名
+ console.log(res.isEmpty)
+ if(res.isEmpty){
+ this.url ="";
+ }else{
+ this.url = res.tempFilePath
+ }
+ if(this.url){
+ this.uploadpic()
+ uni.showToast({
+ title: "请签字后提交"
+ })
+ // 生成图片的临时路径
+ // app | H5 | 微信小程序 生成的是base64
onClick(type) {