<NME> watermark.js
<BEF> import weCropper from '../../src/weCropper.core.js'

const data = {
  id: 'cropper',
  width: 750,
  height: 750,
  minScale: 1,
  maxScale: 2.5,
  zoom: 8,
  src: ''
}

Page({
  data,
  touchStart (e) {
    this.wecropper.touchStart(e)
  },
  touchStart (e) {
    this.cropper.touchStart(e)
  },
  touchMove (e) {
    this.cropper.touchMove(e)
  },
  touchEnd (e) {
    this.cropper.touchEnd(e)
  },
  getCropperImage () {
    this.cropper.getCropperImage(function (path, err) {
      if (err) {
        wx.showModal({
          title: '温馨提示',
          content: err.message
        })
    })
  },
  uploadTap () {
    let self = this

    wx.chooseImage({
      count: 1, // 默认9
      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
      success: (res) => {
        let src = res.tempFilePaths[0]
        //  获取裁剪图片资源后，给data添加src属性及其值

        Object.assign(data, { src })

        new weCropper(data)
          .on('ready', (ctx) => {
						console.log(`weCropper is ready`)
						console.log(`current canvas context: ${ctx}`)
						wx.showToast({
							title: '上传中',
							icon: 'loading',
							duration: 20000
						})
          })
          .on('load', (ctx) => {
						console.log(`picture loaded`)
						console.log(`current canvas context: ${ctx}`)
						wx.hideToast()
          })
					.on('beforeDraw', (ctx) => {
						console.log(`before canvas draw,i can do something`)
						console.log(`current canvas context: ${ctx}`)
						//  那就尝试在图片上加个水印吧
						ctx.setFontSize(14)
						ctx.setFillStyle('#ffffff')
						ctx.fillText('@we-cropper', 265, 350)
					})
      }
    })
  },
  onLoad (option) {
    // do something
    if (option.src) {
      Object.assign(data, { src })
      new weCropper(data)
    }
  }
})

<MSG> add lazy-load method "pushOrign"

<DFF> @@ -1,17 +1,17 @@
 import weCropper from '../../src/weCropper.core.js'
 
-const data = {
-  id: 'cropper',
-  width: 750,
-  height: 750,
-  minScale: 1,
-  maxScale: 2.5,
-  zoom: 8,
-  src: ''
-}
+const __watermark_image__= 'http://image.smartisanos.cn/resource/a9ea11be5ffa8225110782fe3ac46a74.png'
+const __watermark_font__ = '@we-cropper'
 
 Page({
-  data,
+  data: {
+		id: 'cropper',
+		width: 750,
+		height: 750,
+		minScale: 1,
+		maxScale: 2.5,
+		zoom: 8
+	},
   touchStart (e) {
     this.wecropper.touchStart(e)
   },
@@ -34,49 +34,56 @@ Page({
     })
   },
   uploadTap () {
-    let self = this
+  	const self = this
 
     wx.chooseImage({
       count: 1, // 默认9
       sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
       sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
-      success: (res) => {
-        let src = res.tempFilePaths[0]
+      success (res) {
+        const src = res.tempFilePaths[0]
         //  获取裁剪图片资源后，给data添加src属性及其值
 
-        Object.assign(data, { src })
+        self.wecropper.pushOrign(src)
+      }
+    })
+  },
+  onLoad (option) {
+		const { data } = this
+
+		wx.getImageInfo({
+			src: __watermark_image__,
+			success (res) {
+				const { path } = res
 
-        new weCropper(data)
-          .on('ready', (ctx) => {
-						console.log(`weCropper is ready`)
+				new weCropper(data)
+					.on('ready', function (ctx) {
+						console.log(`wecropper is ready for work!`)
+					})
+					.on('beforeImageLoad', (ctx) => {
+						console.log(`before picture loaded, i can do something`)
 						console.log(`current canvas context: ${ctx}`)
 						wx.showToast({
 							title: '上传中',
 							icon: 'loading',
 							duration: 20000
 						})
-          })
-          .on('load', (ctx) => {
+					})
+					.on('imageLoad', (ctx) => {
 						console.log(`picture loaded`)
 						console.log(`current canvas context: ${ctx}`)
 						wx.hideToast()
-          })
+					})
 					.on('beforeDraw', (ctx) => {
 						console.log(`before canvas draw,i can do something`)
 						console.log(`current canvas context: ${ctx}`)
 						//  那就尝试在图片上加个水印吧
+						ctx.drawImage(path, 50, 50, 50, 30)
 						ctx.setFontSize(14)
 						ctx.setFillStyle('#ffffff')
-						ctx.fillText('@we-cropper', 265, 350)
+						ctx.fillText(__watermark_font__, 265, 350)
 					})
-      }
-    })
-  },
-  onLoad (option) {
-    // do something
-    if (option.src) {
-      Object.assign(data, { src })
-      new weCropper(data)
-    }
+			}
+		})
   }
 })

add lazy-load method "pushOrign"