counterInfo.vue 4.31 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">
xd's avatar
xd committed
20
      <van-cell title="专柜信息" is-link value="详细信息" @click="handleEdit" />
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>
xd's avatar
xd committed
29
import { getStoreDetail } 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 39 40 41
      oyStallCode: '',
      storeInfo: {
        logo: './img/counter.png',
        name: 'only专柜',
xd's avatar
xd committed
42
        summaryTitle: 'ONLY是丹麦著名的国际时装公司BESTSELLER拥有的众多著名品牌之一',       
xd's avatar
xd committed
43 44
      },
      carousel:['./img/cswiper.png','./img/cswiper.png','./img/cswiper.png','./img/cswiper.png']
xd's avatar
xd committed
45 46
    }
  },
xd's avatar
xd committed
47
  mounted() { 
xd's avatar
xd committed
48
    this.oyStallCode = sessionStorage.getItem('oyStallCode') 
xd's avatar
xd committed
49
    this.getAgentAuth()
xd's avatar
xd committed
50
    this.getDetail()
xd's avatar
xd committed
51 52
  },
  methods: {
xd's avatar
xd committed
53 54 55 56 57 58
    getDetail() {
      let params = {
        oyStallCode: this.oyStallCode
      }
      getStoreDetail(params).then(res => {
        if(res.data.stallInfo != null) {
xd's avatar
xd committed
59
          this.info = 2
xd's avatar
xd committed
60 61 62
          console.log(res,'res');
          this.carousel = res.data.carousel
          this.storeInfo = res.data.stallInfo
xd's avatar
xd committed
63 64
        }else {
          this.info = 1
xd's avatar
xd committed
65 66 67
        }
      })
    },
xd's avatar
xd committed
68 69 70 71
    handleEdit() {
      this.$router.push("counterEdit")
    },
    getChargeCode() {
xd's avatar
xd committed
72 73 74 75 76
      if(this.info == 1) {
        this.$router.push('pushStoreInfo')
      }else {
        this.$router.push("chargeCode")
      }     
xd's avatar
xd committed
77
    },
xd's avatar
xd committed
78
    handleCounterHome() {
xd's avatar
xd committed
79 80 81 82 83
      if(this.info == 1) {
        this.$router.push('pushStoreInfo')
      }else {
        this.$router.push("counterHome")
      }     
xd's avatar
xd committed
84 85
    },
    handlePushInfo() { 
xd's avatar
xd committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
      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
104
    }
105 106 107 108 109 110 111 112 113 114 115
  }
</script>

<style  scoped>
.gn >>> .van-cell__title{
    font-size:14px;
    font-weight:bold;
    color:rgba(45,71,106,1);
}
.gn {
    margin-top: 12px;
xd's avatar
xd committed
116
    width: 100%;
117 118
}
.container {
xd's avatar
xd committed
119 120 121 122 123 124 125
  background: #f8f8f8;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  min-height: 100%;
126 127 128 129
}
.img {
  width: 100%;
  height: 200px;
xd's avatar
xd committed
130
  background-color: #fff;
131 132 133
}
.img img {
  width: 100%;
xd's avatar
xd committed
134 135 136 137
  height: 200px;
}
.img >>> .van-swipe {
  height: 200px;
138 139 140 141 142 143 144 145 146 147
}
.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
148
  z-index: 100;
149 150 151 152 153 154 155 156 157 158
}
.list3 {
  border-bottom: none;
  margin-bottom: 0;
}
.left,
.right {
  height: 80px;
}
.left {
xd's avatar
xd committed
159 160 161
    width: 30%;
    display: flex;
    justify-content: center;
162 163
}
.left img {
xd's avatar
xd committed
164
  width: 80px;
165 166
}
.right {
xd's avatar
xd committed
167 168
  width: 70%;
  padding: 16px 0 0 10px;
169
  background-color: #fff;
xd's avatar
xd committed
170

171 172 173 174 175 176 177 178 179 180 181 182
}
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>