瀏覽代碼

更新 拍照缓存

wzh 3 年之前
父節點
當前提交
4af03b5fba
共有 3 個文件被更改,包括 7 次插入3 次删除
  1. 5 1
      miniprogram/pages/takeBill/takeBill.js
  2. 2 1
      miniprogram/pages/takeBill/takeBill.wxml
  3. 0 1
      project.private.config.json

+ 5 - 1
miniprogram/pages/takeBill/takeBill.js

@@ -14,7 +14,8 @@ Page({
     modalText: "位置",
     cw: '',
     ch: '',
-    disabled: false
+    disabled: false,
+    imgCache:''
   },
   takeBill() {
     if (this.data.disabled) return
@@ -83,6 +84,9 @@ Page({
         //   url: `/pages/takeBill/success/success?src=${src}&path=${path}`
         // })
         // return
+        this.setData({
+          imgCache:e.tempFilePath
+        })
         let res = await uploadFile(e.tempFilePath, {
           type: 0,
           userId: wx.getStorageSync('userId'),

+ 2 - 1
miniprogram/pages/takeBill/takeBill.wxml

@@ -9,4 +9,5 @@
   <view class="in"></view>
 </view>
 <view class="go-back fixed" bindtap="goBack">返 回</view>
-<canvas type="2d" id="myCanvas" style="position:fixed;left: -100vw;width:{{cw*0.9*0.25}}rpx;height: {{ch*0.85*0.25}}rpx;box-sizing: border-box"></canvas>
+<canvas type="2d" id="myCanvas" style="position:fixed;left: -100vw;width:{{cw*0.9*0.25}}rpx;height: {{ch*0.85*0.25}}rpx;box-sizing: border-box"></canvas>
+<image wx:if="{{imgCache}}" style="position: fixed;width: 100vw;height: 100vh;top: 0;left: 0;z-index: 100;" src="{{imgCache}}"></image>

+ 0 - 1
project.private.config.json

@@ -72,7 +72,6 @@
     "checkInvalidKey": true,
     "compileHotReLoad": false,
     "lazyloadPlaceholderEnable": false,
-    "useMultiFrameRuntime": false,
     "showES6CompileOption": false,
     "useStaticServer": true
   },