1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
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
<template>
<div class="container">
<div class="img">
<van-swipe :autoplay="3000" >
<van-swipe-item v-for="(item,index) in carousel" :key="index">
<img :src="item" />
</van-swipe-item>
</van-swipe>
</div>
<div class="list">
<div class="left">
<img :src="storeInfo.logo" alt="" />
</div>
<div class="right">
<h3>{{storeInfo.name}}</h3>
<p>{{storeInfo.summaryTitle}}</p>
</div>
</div>
<van-cell-group class="gn">
<van-cell title="专柜信息设置" is-link value="详细信息" @click="handleEdit" v-if="flag == 1" />
<van-cell title="访问专柜首页" is-link value="详细信息" @click="handleCounterHome" />
<van-cell title="专柜收款码" is-link value="详细信息" @click="getChargeCode" />
<van-cell title="推送门店信息" is-link value="详细信息" @click="handlePushInfo" />
</van-cell-group>
</div>
</template>
<script>
import { getStoreDetail, getDirector } from "@/api/sidebar/voucher";
import { quillEditor } from "vue-quill-editor"
import "quill/dist/quill.core.css"
import "quill/dist/quill.snow.css"
import "quill/dist/quill.bubble.css"
export default {
data() {
return {
info: 1,
oyStallCode: '',
flag: 2,
userId: '',
storeInfo: {
logo: './img/counter.png',
name: '未配置',
summaryTitle: '未配置',
},
carousel:['./img/cswiper.png','./img/cswiper.png','./img/cswiper.png','./img/cswiper.png']
}
},
mounted() {
this.userId = sessionStorage.getItem('userId')
this.oyStallCode = sessionStorage.getItem('oyStallCode')
console.log(sessionStorage.getItem('oyStallCode'),'专柜code1')
this.getAgentAuth()
this.getDetail()
this.getDirector(this.userId)
},
methods: {
getDetail() {
let params = {
oyStallCode: this.oyStallCode
}
getStoreDetail(params).then(res => {
if(res.data.stallInfo != null) {
this.info = 2
this.carousel = res.data.carousel
this.storeInfo = res.data.stallInfo
sessionStorage.setItem("barName", res.data.stallInfo.name)
}else {
this.info = 1
}
})
},
handleEdit() {
this.$router.push("counterEdit")
},
getChargeCode() {
this.$router.push("chargeCode")
},
handleCounterHome() {
if(this.info == 1) {
this.$router.push('noSet')
}else {
this.$router.push("counterHome")
}
},
getDirector(userId) {
getDirector({userId}).then(res => {
if(res.data == true) {
this.flag = 1
}else {
this.flag = 2
}
})
},
handlePushInfo() {
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,'错误信息')
}
})
}
}
}
}
</script>
<style scoped>
.gn >>> .van-cell__title{
font-size: 14px;
font-weight: bold;
color:rgba(45,71,106,1);
}
.gn {
margin-top: 12px;
width: 100%;
}
.container {
background: #f8f8f8;
height: auto;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
min-height: 100%;
}
.img {
width: 100%;
height: 200px;
background-color: #fff;
}
.img img {
width: 100%;
height: 200px;
}
.img >>> .van-swipe {
height: 200px;
}
.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;
z-index: 100;
}
.list3 {
border-bottom: none;
margin-bottom: 0;
}
.left,
.right {
height: 80px;
}
.left {
width: 30%;
display: flex;
justify-content: center;
}
.left img {
width: 80px;
}
.right {
width: 70%;
padding: 16px 0 0 10px;
background-color: #fff;
}
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>