bottomCont.vue 5.4 KB
Newer Older
liujinsa committed
1 2
<template>
  <div class="bottomCont">
李嘉林 committed
3
    <template v-if="shopInfo.showPowerByAntFlag">
liujinsa committed
4 5 6 7 8 9 10 11 12 13
      <div class="bc1 flex">
        <i></i>
        <p @click="showVConsoles">底线在此,不能更低了</p>
        <i></i>
      </div>
      <div class="bc2">
        <img :src="shopInfo.logoUrl" alt />
      </div>
      <div class="bc3">
        <!-- 送颂 -->
liujinsa committed
14
        <p v-if="shopInfo.shopCode=='songsong'">送颂科技提供技术支持</p>
liujinsa committed
15
        <!-- 嗨有料 -->
liujinsa committed
16
        <p v-else-if="shopInfo.shopCode=='HYL' || shopInfo.shopCode=='Id9uwD' "></p>
liujinsa committed
17 18 19 20 21
        <!-- <p
          v-else-if="Array.isArray(this.$store.state.sceneModule.songCopyright)"
          @click="showCookie"
        >{{this.$store.state.sceneModule.songCopyright.some(item=>item==shopInfo.shopCode)?'送颂科技提供技术支持':'小工蚁(上股交N板企业300258)提供平台服务'}}</p> -->
      </div>
李嘉林 committed
22 23 24 25 26
    </template>
    <div class="height7"></div>
    <div class="hide-wrap" v-if="showHideWrap" @click="showActionSheet">
      <i class="ant-fenlei-line" style="font-size:22px"></i>
    </div>
liujinsa committed
27 28 29 30 31
  </div>
</template>

<script type="text/ecmascript-6">
import { DFSImg } from "@/utils/index";
李嘉林 committed
32 33
const app = getApp();
const { log } = app;
liujinsa committed
34 35 36 37
export default {
  data() {
    return {
      shopInfo: {
李嘉林 committed
38 39
        logoUrl: '',
        showPowerByAntFlag: true,
liujinsa committed
40
      },
程智春 committed
41 42
      showVConsole : 0,
      showHideWrap : false,
李嘉林 committed
43
      attemptNum: 0, //获取logo次数
liujinsa committed
44 45
    };
  },
李嘉林 committed
46 47 48 49 50 51 52
  computed:{
    globalDataShopInfo() {
      return this.mpApp.globalData.shopInfo;
    }
  },
  watch:{
    globalDataShopInfo:{
李嘉林 committed
53 54
      handler(newVal,oldVal){
        if(newVal){
李嘉林 committed
55
          console.log(newVal,'------------------globalDataShopInfo')
李嘉林 committed
56 57 58 59
          this.shopInfo = this.mpApp.globalData.shopInfo
          if(this.shopInfo && this.shopInfo.logoUrl) {
            this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400)
          }
李嘉林 committed
60 61 62
          if(this.shopInfo) {
            this.shopInfo.showPowerByAntFlag = !(this.shopInfo.hidePowerByAntFlag == 1)
          }
李嘉林 committed
63 64
          console.log(this.shopInfo,'this.shopInfo')
        }
李嘉林 committed
65 66 67 68
      },
      immediate: true,
    }
  },
liujinsa committed
69
  created(){
李嘉林 committed
70 71
    // this.shopInfo = this.mpApp.globalData.shopInfo
    // this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400)
liujinsa committed
72
    console.log(this.shopInfo,'mpapp123')
程智春 committed
73 74 75 76

    if(wx.getStorageSync('workBox')){
      this.showHideWrap = true
    }
李嘉林 committed
77
    this.mpApp.showActionSheet = this.showActionSheet;
liujinsa committed
78
  },
李嘉林 committed
79 80
  onLoad() {
    console.log('bottomCont-------onLoad');
李嘉林 committed
81
    this.setLogoUrl();
李嘉林 committed
82 83 84
    console.log(this.shopInfo.logoUrl,'bottomCont-onLoad-logoUrl')
    log.info(this.shopInfo.logoUrl,'bottomCont-onLoad-logoUrl')
  },
liujinsa committed
85 86 87
  onShow(){
  },
  methods:{
李嘉林 committed
88 89 90 91 92 93 94 95 96
    setLogoUrl(){
      if(!this.shopInfo.logoUrl && this.attemptNum<5) {
        this.attemptNum ++;
        setTimeout(() => {
          this.shopInfo.logoUrl = wx.getStorageSync("logoUrl");
          this.setLogoUrl();
        }, 500);
      }
    },
程智春 committed
97 98 99 100 101 102 103 104 105 106 107 108 109
    showVConsoles(){

      this.showVConsole++;
      if (this.showVConsole >= 10) {
        this.showVConsole=0;

        wx.setStorageSync('workBox','1')
        this.showHideWrap = true
        
      }
      
    },
    showActionSheet(){
李嘉林 committed
110
      this.showHideWrap = true
程智春 committed
111
      let vm = this
李嘉林 committed
112 113 114 115 116 117
      let accountInfo = wx.getAccountInfoSync(); 
      let version = accountInfo.miniProgram.version; // 1.0.0 小程序版本号
      let itemList = ['复制页面路径', '隐藏工具箱'];
      if(version){
        itemList.push(`当前版本号:${version}`)
      }
程智春 committed
118
      wx.showActionSheet({
李嘉林 committed
119
        itemList,
程智春 committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
        success (res) {
          console.log(res.tapIndex)

          if(res.tapIndex == 0){
            vm.copyUrl()
          }else if(res.tapIndex == 1){
            vm.hideUtils()
          }
        },
        fail (res) {
          console.log(res.errMsg)
        }
      })
    },
    copyUrl(){
      let pages = getCurrentPages()
      let currentPage = pages[pages.length - 1]
      
      let route = currentPage.route
      let options = currentPage.options
      console.log(route,options,'currentPage')
      let query = ''
      for(let attr in options){
        query = attr + '=' + options[attr] + '&'
      }
      let href = '/' + route

      if(query){
        href += '?' + query
      }
      console.log(query)
      wx.setClipboardData({
        data: href,
        success (res) {

        }
      })
    },
    hideUtils(){
      this.showHideWrap = false
      wx.removeStorageSync('workBox','1')
    }
liujinsa committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
  }
}
</script>

<style lang="scss" scoped>
  .bottomCont {
    width: 100%;
    position: absolute;
    padding: 10px 0;
    z-index:10;
    div {
      width: 70%;
      margin: 0 auto;
      text-align: center;
      color: #999;
      font-size: 13px;
    }
    .bc1 {
      justify-content: space-between;
      align-items: center;
      i {
        width: 15%;
        height: 1px;
        background: #c3c3c3;
      }
    }
    .bc2 {
      width: 64px;
      height: 64px;
      margin-top: 20px;
      margin-bottom: 10px;
      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }
    .height7{
      width:100%;
李嘉林 committed
201
      height: 130rpx;
liujinsa committed
202 203
    }
  }
程智春 committed
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
  .hide-wrap{
    width: 40px !important;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
    font-size: 20px;
  }
liujinsa committed
219
</style>