counterInfo.vue 4.6 KB
Newer Older
1 2 3
<template>
  <div class="container">
    <div class="img">
xd's avatar
xd committed
4 5
      <van-swipe :autoplay="3000" >
        <van-swipe-item v-for="(item,index) in  carousel" :key="index">
xd's avatar
xd committed
6
          <img :src="item"  />
7 8 9 10 11
        </van-swipe-item>
      </van-swipe>
    </div>
    <div class="list">
      <div class="left">
xd's avatar
xd committed
12
        <img :src="storeInfo.logo" alt="" />
13 14
      </div>
      <div class="right">
xd's avatar
xd committed
15 16
        <h3>{{storeInfo.name}}</h3>
        <p>{{storeInfo.summaryTitle}}</p>
17 18 19
      </div>
    </div>
    <van-cell-group class="gn">
20
      <van-cell title="专柜信息设置" is-link value="详细信息" @click="handleEdit" v-if="flag == 1" />
xd's avatar
xd committed
21
      <van-cell title="访问专柜首页" is-link value="详细信息" @click="handleCounterHome" />
xd's avatar
xd committed
22 23
      <van-cell title="专柜收款码" is-link value="详细信息" @click="getChargeCode" />
      <van-cell title="推送门店信息" is-link value="详细信息" @click="handlePushInfo" />
24 25 26 27 28
    </van-cell-group>
  </div>
</template>

<script>
29
import { getStoreDetail, getDirector } from "@/api/sidebar/voucher";
xd's avatar
xd committed
30 31 32 33
import { quillEditor } from "vue-quill-editor"
import "quill/dist/quill.core.css"
import "quill/dist/quill.snow.css"
import "quill/dist/quill.bubble.css"
34 35
export default {
  data() {
xd's avatar
xd committed
36
    return {
xd's avatar
xd committed
37
      info: 1,
xd's avatar
xd committed
38
      oyStallCode: '',
39 40
      flag: 2,
      userId: '',
xd's avatar
xd committed
41 42
      storeInfo: {
        logo: './img/counter.png',
xd's avatar
xd committed
43 44
        name: '未配置',
        summaryTitle: '未配置',       
xd's avatar
xd committed
45 46
      },
      carousel:['./img/cswiper.png','./img/cswiper.png','./img/cswiper.png','./img/cswiper.png']
xd's avatar
xd committed
47 48
    }
  },
xd's avatar
xd committed
49
  mounted() { 
xd's avatar
xd committed
50
    this.userId = sessionStorage.getItem('userId')    
51 52
    this.oyStallCode = sessionStorage.getItem('oyStallCode')    
    console.log(sessionStorage.getItem('oyStallCode'),'专柜code1')
xd's avatar
xd committed
53
    this.getAgentAuth()
xd's avatar
xd committed
54
    this.getDetail()
xd's avatar
xd committed
55
    this.getDirector(this.userId)
xd's avatar
xd committed
56 57
  },
  methods: {
xd's avatar
xd committed
58 59 60
    getDetail() {
      let params = {
        oyStallCode: this.oyStallCode
xd's avatar
xd committed
61
      }      
xd's avatar
xd committed
62 63
      getStoreDetail(params).then(res => {
        if(res.data.stallInfo != null) {
xd's avatar
xd committed
64
          this.info = 2
xd's avatar
xd committed
65 66
          this.carousel = res.data.carousel
          this.storeInfo = res.data.stallInfo
xd's avatar
xd committed
67
          sessionStorage.setItem("barName",  res.data.stallInfo.name)
xd's avatar
xd committed
68 69
        }else {
          this.info = 1
xd's avatar
xd committed
70 71 72
        }
      })
    },
xd's avatar
xd committed
73 74 75 76
    handleEdit() {
      this.$router.push("counterEdit")
    },
    getChargeCode() {
xd's avatar
xd committed
77
      this.$router.push("chargeCode")   
xd's avatar
xd committed
78
    },
xd's avatar
xd committed
79
    handleCounterHome() {
xd's avatar
xd committed
80
      if(this.info == 1) {
xd's avatar
xd committed
81
        this.$router.push('noSet')
xd's avatar
xd committed
82 83 84
      }else {
        this.$router.push("counterHome")
      }     
xd's avatar
xd committed
85
    },
xd's avatar
xd committed
86 87 88 89 90 91 92 93 94
    getDirector(userId) {
      getDirector({userId}).then(res => {
        if(res.data == true) {
          this.flag = 1
        }else {
          this.flag = 2
        }       
      })
    },
xd's avatar
xd committed
95
    handlePushInfo() { 
xd's avatar
xd committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
      if(this.info == 1) {
        this.$router.push('pushStoreInfo')
      }else {
        let url = `http://oysales.oywanhao.com:8087/counterPageHome?oyStallCode=${this.oyStallCode}` 
        wx.invoke("shareToExternalContact", {
          title: '专柜首页', // 消息的标题
          desc: '专柜首页详情', // 消息的描述
          link: url, // 消息链接
          imgUrl: '' // 消息封面
          },function(res) {
            if (res.err_msg == "shareToExternalContact:ok") {
              this.$router.push({ path: "counterInfo" })      
            }else {
              console.log(res.err_msg,'错误信息')            
            }
          })
        }
      }     
xd's avatar
xd committed
114
    }
xd's avatar
xd committed
115
    
116 117 118 119 120
  }
</script>

<style  scoped>
.gn >>> .van-cell__title{
121 122
    font-size: 14px;
    font-weight: bold;
123 124 125 126
    color:rgba(45,71,106,1);
}
.gn {
    margin-top: 12px;
xd's avatar
xd committed
127
    width: 100%;
128 129
}
.container {
xd's avatar
xd committed
130 131 132 133 134 135 136
  background: #f8f8f8;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  min-height: 100%;
137 138 139 140
}
.img {
  width: 100%;
  height: 200px;
xd's avatar
xd committed
141
  background-color: #fff;
142 143 144
}
.img img {
  width: 100%;
xd's avatar
xd committed
145 146 147 148
  height: 200px;
}
.img >>> .van-swipe {
  height: 200px;
149 150 151 152 153 154 155 156 157 158
}
.list {
  height: 80px;
  width: 100%;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(238, 238, 238, 1);
  box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
  border-radius: 2px;
xd's avatar
xd committed
159
  z-index: 100;
160 161 162 163 164 165 166 167 168 169
}
.list3 {
  border-bottom: none;
  margin-bottom: 0;
}
.left,
.right {
  height: 80px;
}
.left {
xd's avatar
xd committed
170 171 172
    width: 30%;
    display: flex;
    justify-content: center;
173 174
}
.left img {
xd's avatar
xd committed
175
  width: 80px;
176 177
}
.right {
xd's avatar
xd committed
178 179
  width: 70%;
  padding: 16px 0 0 10px;
180
  background-color: #fff;
xd's avatar
xd committed
181

182 183 184 185 186 187 188 189 190 191 192 193
}
h3 {
  font-size: 14px;
  font-weight: bold;
  color: rgba(45, 71, 106, 1);
}
p {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(45, 71, 106, 0.8);
}
</style>