<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>
|