微信小程序vant+canvas实现签名

微信小程序canvas实现签名

话不多说,先看效果
图1.签名样式
在这里插入图片描述
图2.页面展示效果
在这里插入图片描述

下面是具体代码

canvas.wxml


<view class="signBox border">
  <view class="flex-center">
    <view>商户签字</view>
    <van-image style="padding-left:30rpx" wx:if="{
  
  {sign}}" src="{
  
  {sign}}" width="100" height="50" fit="contain"/>
  </view>
  <van-button type="primary" size="small" color="#12b2a8" bind:click="toSign">{
  
  {form.sign == '' ? '点击签名' : '点击重签'}}
  </van-button>
  <!-- <button style="margin-top: 30rpx;" bindtap="submitSignature" disabled="{
  
  {!isSignatureFinish}}">提交保存</button> -->
</view>
<view class="bottom">
  <van-button block round type="primary" color="#12b2a8" bind:click="makeEOrder">
    完成</van-button>
</view>
<page-container show="{
  
  {showPage}}" overlay="{
  
  {false}}" round="{
  
  {false}}" close-on-slideDown="{
  
  {false}}" z-index="1000">
  <view class="flex" style="height: 100vh;">
    <view class="sign-btn-container">
      <view class="cu-btn" bindtap="hideSignPage">取消/返回</view>
      <view class="cu-btn {
  
  {isSignatureFinish?'bg-blue light':''}}" bindtap="clearCanvas">重新签名</view>
      <view class="cu-btn {
  
  {isSignatureFinish?'bg-blue light':''}}" bindtap="co
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值