|
|
@@ -0,0 +1,117 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="img_box" style="margin-top:30upx;">
|
|
|
+ <image :src="gatherUrl" mode="heightFix" class="img_url"></image>
|
|
|
+ </view>
|
|
|
+ <view class="confirm-btn">
|
|
|
+ <button class="admin-button-com big blue" style="width:60vw;" @click="downloadImg(gatherUrl)">下载收款码</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view style="text-align: center;font-size:32upx;">
|
|
|
+ 收款码是否算收入:<switch style="transform:scale(0.7,0.7)" :checked="gatherRepeat == 0 ? true : false" @change="gatherRepeatChangeFn" />{{ gatherRepeat==0?'是':'否' }}
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { miniGatheringCode } from '@/api/shop'
|
|
|
+import { getInfo,modifyGatherRepeat } from '@/api/shop/ext'
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ gatherUrl:'',
|
|
|
+ gatherRepeat:0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.getImg()
|
|
|
+ getInfo().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.gatherRepeat = res.data.ext.gatherRepeat
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gatherRepeatChangeFn(e){
|
|
|
+ this.gatherRepeat = e.detail.value ? 0 : 1
|
|
|
+ modifyGatherRepeat({gatherRepeat:this.gatherRepeat}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ downloadImg(url){
|
|
|
+ // #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(url)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.downloadImg2(url)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.downloadImg2(url)
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ this.downloadImg2(url)
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ downloadImg2(url){
|
|
|
+ uni.downloadFile({
|
|
|
+ url: url,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.statusCode === 200) {
|
|
|
+ uni.saveImageToPhotosAlbum({
|
|
|
+ filePath: res.tempFilePath,
|
|
|
+ success: function (data) {
|
|
|
+ uni.showToast({title:'下载成功!'})
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getImg() {
|
|
|
+ miniGatheringCode().then(res => {
|
|
|
+ this.gatherUrl = res.data.imgUrl
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-content{
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.img_box{
|
|
|
+ height:900upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &>.img_url{
|
|
|
+ height:900upx;
|
|
|
+ width: auto;
|
|
|
+ margin: 20upx auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 按钮
|
|
|
+.confirm-btn {
|
|
|
+ width: calc(100% - 60upx);
|
|
|
+ margin: 30upx 30upx 20upx;
|
|
|
+ text-align:center;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 按钮
|
|
|
+.confirm-btn1 {
|
|
|
+ width: calc(100% - 60upx);
|
|
|
+ margin: 30upx 30upx 20upx;
|
|
|
+ text-align:center;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|