MrShi
23 小时以前 825418425a91c4cf95e56c3fbaf06ea9fb5a37d8
mini-program/pagesA/pages/shop_points/shop_points.vue
@@ -1,6 +1,5 @@
<template>
   <view class="points">
      <view class="info-rule" @click="jumpService">积分规则</view>
      <view class="head" :style="{ backgroundImage: 'url(' + backImage + ')', height: 'calc(' + (navHeight + statusbarHeight + 'px + 376rpx)') }">
         <view :style="{ width: '100%', height: navHeight + statusbarHeight + 'px' }"></view>
@@ -58,7 +57,7 @@
            shop:{},
            active:0,
            backHeadImage:'',
            backImage: require('@/static/images/jifen_bg@2x.png')
            backImage: ''
         };
      },
      onReachBottom(){
@@ -72,6 +71,12 @@
              this.backHeadImage = ''
          }
      },
      onLoad() {
         if (uni.getStorageSync('backgroundImage')) {
            this.backImage = uni.getStorageSync('backgroundImage').shopIntegralBg
         }
          // this.getBase64Img('/static/images/jifen_bg@2x.png')
      },
      onShow() {
          this.shop  ={}
          this.checkShopLogin()
@@ -81,6 +86,22 @@
          this.getFirstPageData()
      },
      methods:{
         getBase64Img(path){
            var that =this
            uni.getFileSystemManager().readFile({
              filePath: path, // 替换为你的图片路径
              encoding: 'base64',
              success: (res) => {
                const base64Data = 'data:image/png;base64,' + res.data; // 拼接前缀,用于页面显示
                console.log('图片Base64编码:', base64Data);
                // 可以将 base64Data 绑定到 data 中,用于页面展示
                that.backImage = base64Data;
              },
              fail: (err) => {
                console.error('读取图片失败:', err);
              }
            });
         },
         getFirstPageData(){
            this.currentPage = 0
            this.hasNext=true