shuishen
2022-04-12 ca0258c8e07a7a36616d7036d7baa1b7ab6b4bba
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<template>
    <!-- 信息窗口导航mobilePopupOurAfter -->
 
    <div class="mobilePopupOurAfter" :class="{ ismBigPopupAfter: mBigPopupAfter }">
        <!-- v-if="mBigPopupAfter" -->
        <div class="m_p_a_heard">
            <div>
                <i class="el-icon-menu icon"></i>
            </div>社区列表
            <div @click="closeBigPopupAfter">
                <i class="el-icon-close icon"></i>
            </div>
        </div>
        <div class="m_p_a_center">
            <div class="m_p_a_center_group">
                <div
                    :class="[
            'm_p_a_center_once',
            item.name ? '' : 'm_p_a_center_once_notblue',
          ]"
                    v-for="(item, index) in choiceDataUp"
                    @click="item.name ? openBigPopup(item) : ''"
                    :key="index"
                >
                    <div class="m_p_a_c_o_up">
                        <i :class="[item.icon]"></i>
                    </div>
                    <div class="m_p_a_c_o_down">{{ item.seeName || item.name }}</div>
                </div>
            </div>
            <div class="m_p_a_center_group">
                <div
                    :class="[
            'm_p_a_center_once',
            item.name ? '' : 'm_p_a_center_once_notblue',
          ]"
                    v-for="(item, index) in choiceDataDown"
                    @click="item.name ? openBigPopup(item) : ''"
                    :key="index"
                >
                    <div class="m_p_a_c_o_up">
                        <i :class="[item.icon]"></i>
                    </div>
                    <div class="m_p_a_c_o_down">{{ item.seeName || item.name }}</div>
                </div>
            </div>
            <div
                class="m_p_a_heard m_p_a_hdheard"
                style="justify-content: center"
                v-show="avtivityData.length > 0 && useHD"
            >活动列表</div>
            <div
                class="m_p_a_center_group"
                v-for="(act, index) in avtivityData"
                :key="index"
                v-show="avtivityData.length > 0 && useHD"
            >
                <div
                    :class="[
            'm_p_a_center_once',
            item.name ? '' : 'm_p_a_center_once_notblue',
          ]"
                    v-for="(item, index) in act"
                    @click="item.name ? openHDPopup(item) : ''"
                    :key="index"
                >
                    <div class="m_p_a_c_o_up">
                        <i :class="[item.icon]"></i>
                    </div>
                    <div class="m_p_a_c_o_down">{{ item.seeName || item.name }}</div>
                </div>
            </div>
        </div>
    </div>
</template>
 
<script>
import { mapGetters } from 'vuex'
import { getList } from '@/api/mobile/orgnav/index' // 机构单位
import { getChildNavList } from '@/api/mobile/public/arc' // 社区建筑
import {
    // getListlivingFacilitiesr,
    // getListsupermarket,
    // getListmedical,
    // getListmail,
    // getListbathroom,
    // getListduplicate,
    // getListnetwork,
    // getListaed,
    // getListsignal,
    // getListtransference,
    getListLifeOnce // 所有的
} from '@/api/mobile/livingFacilities/index' // 生活设施
// import { getListdoor } from "@/api/mobile/outIn/index"; //出入口
// import { getListparking } from "@/api/mobile/stop/index"; //停车场
import { getActivity } from '@/api/mobile/hd/hd' // 活动
export default {
    name: 'mobilePopupOurAfter',
    computed: {
        ...mapGetters(['mBigPopupAfter'])
    },
    data () {
        return {
            choiceValue: '',
            choiceDataUp: [
                {
                    // seeName: "社区内机构导览",
                    name: '机构单位',
                    icon: 'el-icon-s-cooperation',
                    opendata: 'openData1'
                },
                {
                    name: '社区建筑',
                    opendata: 'openData2',
                    icon: 'el-icon-s-management'
                },
                {
                    // seeName: "生活服务设施",
                    name: '生活设施',
                    opendata: 'openData3',
                    icon: 'el-icon-s-flag'
                }
            ],
            choiceDataDown: [
                {
                    name: '出入口',
                    opendata: 'openData5',
                    icon: 'el-icon-s-promotion'
                },
                {
                    name: '停车场',
                    opendata: 'openData6',
                    icon: 'el-icon-s-flag'
                },
                {
                    // name: "文化风景",
                    name: '活动',
                    opendata: 'openData4',
                    icon: 'el-icon-s-opportunity'
                }
            ],
            avtivityData: [
                // [
                //   {
                //     name: "活动",
                //     opendata: "openData4",
                //     icon: "el-icon-s-opportunity",
                //   },
                //   {},
                //   {},
                // ],
            ],
            // 全部调用数据
            openData1: [
                // { name: '党群机构', type: 1, method: getList },
                // { name: '职能部处', type: 2, method: getList },
                { name: '直属及附属单位', type: 3, method: getList },
                // { name: '教学与科研机构', type: 4, method: getList },
                { name: '其他机构', type: 5, method: getList }
            ],
            openData2: [
                { name: '行政办公', type: 1, method: getChildNavList },
                // { name: '教学科研', type: 2, method: getChildNavList },
                { name: '社区场馆', type: 3, method: getChildNavList },
                // { name: '宿舍公寓', type: 4, method: getChildNavList },
                // { name: '文化风景', type: 5, method: getChildNavList },
                // { name: '家属住宅', type: 6, method: getChildNavList },
                { name: '主要楼宇', type: 7, method: getChildNavList }
            ],
            openData3: [
                // { name: '食堂餐厅', type: 1, method: getListLifeOnce },
                // { name: '购物超市', type: 2, method: getListLifeOnce },
                { name: '社区医疗', type: 3, method: getListLifeOnce },
                // { name: '邮寄快递', type: 4, method: getListLifeOnce },
                // { name: '社区浴室', type: 5, method: getListLifeOnce },
                // { name: "圈存机", type: 6, method: getListLifeOnce },
                // { name: '打字复印', type: 7, method: getListLifeOnce },
                // { name: '银行网点', type: 8, method: getListLifeOnce },
                // { name: 'AED', type: 9, method: getListLifeOnce },
                // { name: '通信营业厅', type: 10, method: getListLifeOnce },
                { name: '停车场', type: 11, method: getListLifeOnce },
                { name: '出入口', type: 12, method: getListLifeOnce }
            ],
            openData4: [
                { name: '文化风景', type: 5, method: getChildNavList },
                { name: '活动', type: 1, method: getActivity }
            ],
            openData6: [{ name: '停车场', type: 11, method: getListLifeOnce }],
            openData5: [{ name: '出入口', type: 12, method: getListLifeOnce }],
            useHD: true
        }
    },
    mounted () {
        this.getActivitys()
        if (this.useHD) {
            this.choiceDataDown.pop()
            this.choiceDataDown.push({ name: '' })
        }
    },
    methods: {
        // 活动点击事件
        openHDPopup (val) {
            console.log(val)
            // 开启底部弹窗  关闭本弹窗
            const d = {
                state: true,
                value: val
            }
            this.$store.commit('set_showActivity', d)
            this.closeBigPopupAfter()
        },
        // 获取活动数据
        getActivitys () {
            const that = this
            getActivity().then((res) => {
                const data = res.data.data.records
                const datas = [...data]
                const num = datas.length
                // 划分出每组3个的二维数组
                const many = parseInt(num / 3) // 整数组
                const over = parseInt(num % 3) // 余数组
                // 赋值整数组
                const integers = []
                let i = 0
                for (let index = 0; index < many; index++) {
                    const integersins = []
                    for (let indexs = 0; indexs < 3; indexs++) {
                        integersins.push({
                            name: datas[i].hdname,
                            opendata: datas[i],
                            icon: 'el-icon-s-opportunity'
                        })
                        i++
                    }
                    integers.push(integersins)
                }
                // 赋值余数组
                const integersOvers = []
                for (let overI = 0; overI < over; overI++) {
                    integersOvers.push({
                        name: datas[i].hdname,
                        opendata: datas[i],
                        icon: 'el-icon-s-opportunity'
                    })
                    i++
                }
                const lastOver = 3 - over
                for (let overM = 0; overM < lastOver; overM++) {
                    integersOvers.push({ data: 'not' })
                }
                integers.push(integersOvers)
                that.avtivityData = integers
            })
        },
        openBigPopup (val) {
            if (val.name == '活动' && !this.useHD) {
                this.openHDPopup(this.avtivityData[0][0])
                // 隐藏右侧栏
                this.$store.commit('SET_SeeAndNotSee', false)
                return
            }
            const d = {
                main: this[val.opendata],
                qurey: val.name
            }
            this.$store.commit('MSET_POPUPOUROPENDATA', d)
            this.$store.commit('MSET_BIGPOPUP', val)
        },
        closeBigPopupAfter () {
            this.$store.commit('MSET_BIGPOPUPAFTER', false)
        }
    }
}
</script>
 
<style lang="scss" scoped>
.flexCenter {
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobilePopupOurAfter {
    font-size: 18px;
    position: fixed;
    top: 37.5%;
    // left: 13.5%;
    left: -1000px;
    width: 75%;
    height: auto;
    min-height: 155px;
    background-color: #fff;
    box-shadow: 0px 0px 5px #29baf1;
    transition: all 0.5s;
    // background-image: linear-gradient(
    //     // 135deg,
    //     #28bbf06c 30px,
    //     #28bbf06c 30px,
    //     // #28bbf06c 50%,
    //     // transparent 50%
    //     #28bbf06c 100%,
    //     transparent 100%
    //   ),
    //   linear-gradient(
    //     // -45deg,
    //     transparent 30px,
    //     #28bbf06c 30px,
    //     // #28bbf06c 50.1%,
    //     // transparent 50%
    //     #28bbf06c 100%,
    //     transparent 100%
    //   );
    z-index: 300;
    .m_p_a_heard {
        width: 100%;
        height: 35px;
        box-sizing: border-box;
        padding: 5px 15px;
        color: #fff;
        @extend .flexCenter;
        justify-content: space-between;
        background-color: #29baf1;
        div {
            width: 35px;
            height: 35px;
            @extend .flexCenter;
        }
        .icon {
            font-size: 24px;
            color: #fff;
        }
    }
    .m_p_a_hdheard {
        margin: 5px 0;
    }
    .m_p_a_center {
        width: 100%;
        // height: calc(100% - 35px);
        height: auto;
        @extend .flexCenter;
        flex-direction: column;
        padding: 10px 0;
        .m_p_a_center_group {
            width: 100%;
            height: auto;
            @extend .flexCenter;
            .m_p_a_center_once {
                width: 30%;
                height: 50px;
                // background-image: linear-gradient(#29baf1, #28bbf06c);
                // background-color: #a40000;
                background-color: #29baf1;
                color: #fff;
                // border: 2px solid rgba(105, 215, 255, 0.658);
                border: 2px solid rgb(255, 255, 255);
                @extend .flexCenter;
                flex-direction: column;
                // &:hover {
                // background-image: linear-gradient(#09b7fc, #28bbf0a4);
                // }
            }
            .m_p_a_center_once_notblue {
                background-color: #fff !important;
            }
        }
    }
}
.ismBigPopupAfter {
    left: 13.5%;
}
.m_p_a_c_o_down {
    font-size: 14px;
}
</style>