quanwei
2025-11-01 121b714d710cf3c865f4a1b5efe81abec11056d1
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
<template>
    <view :data-theme='theme()' :class="theme() || ''" v-if="!loadding">
        <view class="bg">
            <!--头部图片-->
            <view class="banner d-c-c d-c">
                <image :src="top_background" mode="widthFix"></image>
            </view>
            <!--门店信息-->
            <view class="pr m-0-20 shop">
                <view class="f28 tc p20 title">{{act_name}}福利群</view>
                <view class="bg-white p20 qrcode">
                    <view class="tc red" v-if="act_name !=='' && act_qrcode == '../../static/default.png'">该店铺福利群未创建</view>
                    <view><image :src="act_qrcode" mode="heightFix"></image></view>
                    <view class="tc" v-if="act_name == ''">请选择加入的店铺</view>
                </view>
                <view class="bg-white radius20 p20 mt20 pb30">
                    
                    <view class="flex-1 d-b-c border-b mt20 pb10" v-for="(item,index) in shopData" :key="index">
                        <view>
                            <view class="f30">{{item.name}}福利群</view>
                            <view class="gray f22">{{item.address}}</view>
                        </view>
                        <view class="radius20 border add-group" @click="change_shop(index)">{{item.add_group}}</view>
                    </view>
            
                </view>
            </view>
        </view>
 
    </view>
</template>
 
<script>
    import utils from '../../common/utils.js';
    export default {
        data() {
            return {
                /*是否加载完成*/
                loadding: true,
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500,
                /*顶部背景*/
                top_background: '',
                /*当前福利群*/
                act_name: '',
                /*当前福利群二维码*/
                act_qrcode: '../../static/default.png',
                /*店铺列表*/
                shopData: [],
                /*当前已点击*/
                cur_index:0,
                shop_supplier_id: 0,
                /*扫码或链接跳转*/
                source: 0,
            };
        },
        onLoad(e) {
            let self = this;
            self.getSceneData(e);
        },
        onShow(e) {
            uni.showLoading({
                title: '加载中'
            });
            /*获取数据*/
            this.getData();
        },
        methods: {
            getSceneData(query) {
                // 获取场景值
                let scene = utils.getSceneData(query);
                // 来自扫福利群码记录门店id
                let shop_supplier_id = scene.shop_supplier_id;
                //console.log(scene)
                if(shop_supplier_id > 0){
                    uni.setStorageSync('selectedId', shop_supplier_id);
                }
            },
            /*获取数据*/
            getData() {
                let self = this;
                //扫码进来
                if (uni.getStorageSync('selectedId') != '') {
                    self.shop_supplier_id = uni.getStorageSync('selectedId');
                }
                //点击链接进来
                let from_supplier_id = this.$mp.query.from_supplier_id;
                if(from_supplier_id > 0){
                    self.source = 1;//链接跳转
                    self.shop_supplier_id = from_supplier_id;
                }
                self._post('supplier.index/getLists', {
                    shop_supplier_id:self.shop_supplier_id,
                    source:self.source,
                }, (res) => {
                    self.loadding = false;
                    uni.hideLoading();
                    if(res.data.is_add == 1){
                        self.gotoPage('/pages/index/index');
                    }
                    self.shopData = res.data.list;
                    if(res.data.index > 0){
                        self.change_shop(res.data.index);
                    }
                    self.top_background = res.data.data.background;
                })
            },
            change_shop(index) {
                let self = this;
                let shopData = self.shopData;
                let cur_index=self.cur_index;
                self.shopData[cur_index].add_group = "加群";
                self.shopData[index].add_group = "已选择";
                self.act_name = shopData[index].name;
                if(shopData[index].qyQrcode){
                    self.act_qrcode = shopData[index].qyQrcode.file_path;
                }else{
                    self.act_qrcode = '../../static/default.png';
                }
                self.cur_index = index;    
            },
 
        }
    };
</script>
 
<style lang="scss">
    page {
        background-color: #f2f2f2; 
        
    }
    .bg{
        padding-bottom: 200rpx;
        @include background_color('background_color');
    }
    .index-agent .banner {
        position: absolute;
        width: 100%;
        z-index: 0;
        min-height: 167rpx;
        background-repeat: no-repeat;
        background-size: 100%;
        top: 0;    
    }
 
    .index-agent .banner image {
        width: 100%;
    }
    .radius20 {   
      border-radius: 40rpx;
    }
    .shop .qrcode image{
        height: 210rpx;
        margin: auto;
    }
    .shop .qrcode{
        border-radius: 0 0 20rpx 20rpx;
    }
    .shop .title{
        line-height: 30rpx;
        background: #CCCCE4;
        border-radius:20rpx 20rpx 0 0;
    }
    .add-group{
        padding: 10rpx 25rpx;
        @include background_color('background_color');
        color:#FFFFFF;
        
    }
 
    
</style>