shish 1 سال پیش
والد
کامیت
a4bb173265
3فایلهای تغییر یافته به همراه115 افزوده شده و 1 حذف شده
  1. 108 0
      hdApp/src/admin/recharge/rechargeCode.vue
  2. 5 0
      hdApp/src/api/recharge/index.js
  3. 2 1
      hdApp/src/pages.json

+ 108 - 0
hdApp/src/admin/recharge/rechargeCode.vue

@@ -0,0 +1,108 @@
+<template>
+    <view class="app-content">
+      <view class="img_box">
+        <image :src="imgUrl" mode="heightFix" class="img_url"></image>
+      </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>
+      </view>
+    </view>
+  </template>
+  <script>
+  import { getRechargeCode } from '@/api/recharge'
+  import { getWeixinId } from "@/api/invite";
+  import { mapGetters } from "vuex";
+  export default {
+    data() {
+      return {
+        imgUrl: '',
+        getappIdList: {}
+      }
+    },
+    computed: {
+      ...mapGetters({ loginInfo: "getLoginInfo" })
+    },
+    methods: {
+      init() {
+        this.getImg()
+        getWeixinId().then(res => {
+          this.getappIdList = res.data
+        });
+      },
+      downloadImg(){
+        let that = this
+        // #ifdef APP-PLUS
+        let platformType = uni.getSystemInfoSync().platform
+        if(platformType == 'android'){
+          let store = plus.navigator.checkPermission('android.permission.READ_EXTERNAL_STORAGE')
+          if(store != 'authorized'){
+            this.$util.confirmModal({content:'将申请您的存储权限,用于保存小程序码'},() => {
+              this.downloadImg2()
+            })
+          }else{
+            this.downloadImg2()
+          }
+        }else{
+          this.downloadImg2()
+        }
+        // #endif
+        // #ifdef MP-WEIXIN
+        this.downloadImg2()
+        // #endif
+      },
+      downloadImg2(){
+        uni.downloadFile({
+          url: this.imgUrl,
+          success: (res) => {
+            if (res.statusCode === 200) {
+              console.log(res)
+              uni.saveImageToPhotosAlbum({
+                filePath: res.tempFilePath,
+                success: function (data) {
+                  console.log(data)
+                  uni.showToast({title:'下载成功!'})
+                }
+              });
+            }
+          }
+        });
+      },
+      getImg() {
+        getRechargeCode().then(res => {
+          this.imgUrl = res.data.imgUrl
+        })
+      }
+    }
+  }
+  </script>
+  <style lang="scss" scoped>
+  .app-content{
+    overflow: hidden;
+  }
+  .img_box{
+    height: 450upx;
+    box-sizing: border-box;
+    &>.img_url{
+      height: 450upx;
+      width: auto;
+      margin: 100upx auto;
+    }
+  }
+  // 按钮
+  .confirm-btn {
+    width: calc(100% - 60upx);
+    margin: 30upx 30upx 20upx;
+    .admin-button-com {
+      width: 100%;
+    }
+  }
+  // 按钮
+  .confirm-btn1 {
+    width: calc(100% - 60upx);
+    margin: 30upx 30upx 20upx;
+    .admin-button-com {
+      width: 100%;
+    }
+  }
+  </style>

+ 5 - 0
hdApp/src/api/recharge/index.js

@@ -1,5 +1,10 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+//获取客户充值的二维码 ssh 20250307
+export const getRechargeCode = data => {
+	return https.get('/recharge/get-recharge-code', data)
+}
+
 //手动给客户充值
 export const toManRecharge = data => {
 	return https.post("/recharge/man-recharge", data);

+ 2 - 1
hdApp/src/pages.json

@@ -330,7 +330,8 @@
 			"pages": [
 				{ "path": "renew", "style": { "navigationBarTitleText": "免费续期"}},
 				{ "path": "rechargeSuccess", "style": { "navigationBarTitleText": "免费续期"}},
-				{ "path": "discount", "style": { "navigationBarTitleText": "充值优惠"}}
+				{ "path": "discount", "style": { "navigationBarTitleText": "充值优惠"}},
+				{ "path": "rechargeCode", "style": { "navigationBarTitleText": "充值码"}}
 			]
 		},
 		{