Jelajahi Sumber

添加充值海报

shizhongqi 10 bulan lalu
induk
melakukan
4f455ab758
1 mengubah file dengan 27 tambahan dan 9 penghapusan
  1. 27 9
      hdApp/src/admin/recharge/rechargeCode.vue

+ 27 - 9
hdApp/src/admin/recharge/rechargeCode.vue

@@ -5,7 +5,13 @@
       </view>
       <view style="margin:50upx 0 0 30upx;font-size:30upx;">保存图片到手机,可分享或打印张贴</view>
       <view class="confirm-btn">
-        <button class="admin-button-com big blue" @click="downloadImg">保存图片</button>
+        <button class="admin-button-com big blue" @click="downloadImg(imgUrl)">保存图片</button>
+      </view>
+      <view class="poster_box">
+        <image :src="posterUrl" mode="widthFix" class="img_url"></image>
+      </view>
+      <view class="confirm-btn">
+        <button class="admin-button-com big blue" @click="downloadImg(posterUrl)">保存海报</button>
       </view>
     </view>
   </template>
@@ -17,6 +23,7 @@
     data() {
       return {
         imgUrl: '',
+        posterUrl: '',
         getappIdList: {}
       }
     },
@@ -30,7 +37,7 @@
           this.getappIdList = res.data
         });
       },
-      downloadImg(){
+      downloadImg(url){
         let that = this
         // #ifdef APP-PLUS
         let platformType = uni.getSystemInfoSync().platform
@@ -38,22 +45,22 @@
           let store = plus.navigator.checkPermission('android.permission.READ_EXTERNAL_STORAGE')
           if(store != 'authorized'){
             this.$util.confirmModal({content:'将申请您的存储权限,用于保存小程序码'},() => {
-              this.downloadImg2()
+              this.downloadImg2(url)
             })
           }else{
-            this.downloadImg2()
+            this.downloadImg2(url)
           }
         }else{
-          this.downloadImg2()
+          this.downloadImg2(url)
         }
         // #endif
         // #ifdef MP-WEIXIN
-        this.downloadImg2()
+        this.downloadImg2(url)
         // #endif
       },
-      downloadImg2(){
+      downloadImg2(url){
         uni.downloadFile({
-          url: this.imgUrl,
+          url: url,
           success: (res) => {
             if (res.statusCode === 200) {
               console.log(res)
@@ -70,7 +77,8 @@
       },
       getImg() {
         getRechargeCode().then(res => {
-          this.imgUrl = res.data.imgUrl
+          this.imgUrl = res.data.imgUrl,
+          this.posterUrl = res.data.posterUrl
         })
       }
     }
@@ -89,6 +97,16 @@
       margin: 100upx auto;
     }
   }
+  .poster_box{
+    width: 95%;
+    margin: 0 auto;
+    box-sizing: border-box;
+    &>.img_url{
+      width: 100%;
+      height: auto;
+      margin: 0 auto;
+    }
+  }
   // 按钮
   .confirm-btn {
     width: calc(100% - 60upx);