<template>
	<view class="container column hb flex-1 hidden">
		<view class="headbox">
			<view style="padding: 10px 10px 0 10px;" class="mb20">
				<view>
					<u-subsection class="subsection" :list="list" :current="current" bgColor="#e7f1fe"	activeColor="#1677ff" :fontSize="15" :bold="false" @change="sectionChange"></u-subsection>
				</view>
				<!-- <view style="width: 70%;">
						<u-subsection class="subsection" :list="list" :current="current" bgColor="#e7f1fe" activeColor="#1677ff"
							:fontSize="15" :bold="false" @change="sectionChange" ></u-subsection>
					</view> -->
				<view style="margin-top: 10px;" class="justify-between align-center" v-if="!viewload">
					<u-search placeholder="搜索微信名称、手机、标签" v-model="keyword" :showAction="false" height="30px"	@search='searchKeyword'></u-search>
					<view v-if="current!==0" class="fs24 ml20" @click="blackSel()">{{!isShowSelectAll?'批量管理':'取消批量'}}</view>
				</view>
				<view class="x-bc" v-if="current==0">
					<u-tabs :list="list2" :current='currentType' :lineWidth="40" lineColor="#1677ff" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle" @click="clickTypeTab"></u-tabs>
					<view class="participate-order x-f">
						<image :src="imgPath+'/app/images/order_icon2.png'" mode="aspectFill"	v-if="searchTypeIndex == 0 || searchTypeIndex == 2"></image>
						<image :src="imgPath+'/app/images/order_icon.png'" mode="aspectFill" v-else></image>
						<picker @change="bindPickerChange" :value="searchTypeIndex" :range="typeArray">
							{{typeoption[searchTypeIndex]}}
						</picker>
					</view>
				</view>
				<view class="tagbox x-bc" v-if="current==0">
					<view class="tagbox-left x-f">
						<!-- <view class="x-f" @click="openPop('search')">{{array[queryParam.typeIndex].name}}<u-icon name="arrow-down-fill" color="#2979ff" size="11" style="margin: 0 3px;"></u-icon></view> -->
						<view v-if="showCompanytag.length<=0" style="color: #888;" class="ml30">请点击筛选，选择标签</view>
						<view class="tagbox-list x-f">
							<view class="tagbox-item x-f" v-for="(item,index) in showCompanytag" :key='item.tagId'	:class="item.checked?'checked-bg':''">
								{{item.tagName}}
							</view>
						</view>
					</view>
					<view class="tagbox-right x-f" @click="openPop('tag')">筛选<u-icon name="arrow-down" color="#1677ff"	size="12"></u-icon></view>
				</view>
			</view>
			<view v-if="current==0&&!viewload">
				<dropdownPanel :filterData='filterData' @onClick="getactNav" :itemname='itemname' @onChange="onChange"	@confirm="confirm" @reset="reset" :ispopshow='ispopshow' :top="tops">
					<view v-if="filterData[searchbarNav].type == 'userStatus'">
						<view class="boxnav x-bc">
							<view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
								<view class="boxnav-item-info one-t"
									:class="userStatusIndex == index ? 'boxnav-active':''"	@click="handleParamItem('userStatus',index,item.id)">{{item.label}}</view>
							</view>
						</view>
					</view>
					<view v-if="filterData[searchbarNav].type == 'registerTime'">
						<view class="boxnav x-bc ">
							<view class="boxnav-item" style="width: 25%;" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
								<view class="boxnav-item-info one-t" :class="registerTimeIndex == index ? 'boxnav-active':''" @click="handleParamItem('registerTime',index)">{{item.label}}</view>
							</view>
							<view class="boxnav-item x-ac" style="width: 100%;" v-show="registerTimeIndex == 4">
								<view class="calendar-day x-c" @click="$refs.calendar.open()">
									<u-icon name="calendar" color="#999" size="20"></u-icon>{{queryParam.startTime || '选择日期'}}
								</view>
								<view class="calendar-day x-c" @click="$refs.calendar.open()">
									<u-icon name="calendar" color="#999" size="20"></u-icon>{{queryParam.endTime || '选择日期'}}
								</view>
							</view>
						</view>
					</view>
					<view v-if="filterData[searchbarNav].type == 'watchStatus'">
						<view class="boxnav x-bc">
							<view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
								<view class="boxnav-item-info one-t" :class="watchStatusIndex == index ? 'boxnav-active':''" @click="handleParamItem('watchStatus',index)">{{item.label}}</view>
							</view>
						</view>
					</view>
					<view v-if="filterData[searchbarNav].type == 'courseStatus'">
						<view class="boxnav x-bc">
							<view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
								<view class="boxnav-item-info one-t" :class="courseStatusIndex == index ? 'boxnav-active':''" @click="handleParamItem('courseStatus',index)">{{item.label}}</view>
							</view>
						</view>
					</view>
					<view v-if="filterData[searchbarNav].type == 'project'">
						<view class="boxnav x-bc">
							<view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
								<view class="boxnav-item-info one-t" :class="projectStatusIndex == index ? 'boxnav-active':''"	@click="handleParamItem('project',index,item.id)">{{item.label}}</view>
							</view>
						</view>
					</view>
				</dropdownPanel>
			</view>
		</view>
		<view class="">
			<uni-calendar ref="calendar" :clear-date="true" :date="date" :insert="false" :lunar="false"
				:startDate="$u.timeFormat(new Date().getTime() - (3600 * 24 * 365 * 1000), 'yyyy-mm-dd')" :range='true'
				@confirm="confirmCalendar" :endDate="$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd')" />
		</view>
		<view class="">
			<!-- 搜索选择弹窗/标签筛选 -->
			<u-popup :show="showPop" :round="12" @close="closePop" class="model" :zIndex="10076" style="flex: 0;">
				<view class="popbox">
					<view class="popbox-head">
						<u-icon class="close-circle" name="close-circle" color="#ccc" size="24"
							@click="closePop"></u-icon>
						{{popTitle}}
					</view>
					<view class="popbox-body">
						<view class="radiobox" v-show="popTitle == '搜索选择'">
							<label class="radiobox-item x-bc mbline" v-for="(item, index) in array" :key="item.value"
								@click="bindTypeChange(index)">
								<view>{{item.name}}</view>
								<radio :value="item.value" :checked="index === typeIndex"
									style="transform:scale(0.75)" />
							</label>
						</view>
						<!-- <input placeholder="请输入标签  多个标签用 , 隔开" /> -->
						<view class="mb20" v-if="current==0">
							<u-search placeholder="请输入标签  多个标签用 , 隔开" v-model="tagkeywords" :showAction="false" 	height="30px" @search='getcompanyTag'></u-search>
						</view>
						<scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnableds"	:refresher-triggered="triggereds" refresher-background="rgba(0,0,0,0)"	@refresherrefresh="pullDownRefreshs" @refresherrestore="triggereds = false"
							:upper-threshold="100" :lower-threshold="100" @refresherabort="triggereds = false"
							@scrolltolower="reachBottoms">
							<view class="tagbox-list x-f">
								<view class="tagbox-item x-f tag-active" v-if="companytag.length<=0">暂无标签</view>
								<view class="mlr10 mb10" v-for="(item,index) in companytag" :key='item.tagId'>
									<u-tag :text="item.tagName" :plain="!item.checked" :name="index" @click="chooseTag(index)"></u-tag>
								</view>
							</view>
							<view class="center fs24 mt20">
								<text class="mr20" @click="getTagpage('last')">上一页</text>
								<text class="base-color-red">{{pagetag.pageNum}}/{{pagetag.pages}}</text>
								<text class="ml20" @click="getTagpage('next')">下一页</text>
							</view>
						</scroll-view>
					</view>
					<view class="popbox-footer x-bc">
						<button class="popbox-footer-btn" @click="resetPop" v-show="popTitle == '标签筛选'">重置</button>
						<button class="popbox-footer-btn" @click="closePop" v-show="popTitle == '搜索选择'">取消</button>
						<button class="popbox-footer-btn con-btn" @click="confirmPop">确定</button>
					</view>
				</view>
			</u-popup>
		</view>
		<view class="userbox column hb hidden flex-1">
			<!-- <mescroll-body  bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> -->
			<view class="userlist column hb hidden flex-1">
				<vipUserItem :viplist='userList' :isShowSelectAll="isShowSelectAll" @changeItem="changeItem" @getuserId='singleChange' @getlableId='singleChangeLable' @change='changesinglevip'	@getuserIds='singleDelete' @pullDownRefresh="getfsuserListdata('refresh')"
					@changelistname="getfsuserListdata('more')" @reachBottom="getfsuserListdata()"	@changePageOptions="e=>pageOptions=e" :pageOptions="pageOptions" :status="status"
					@changeStatus="e=>status=e" class="pb2 hb" />
				<view class="justify-between base-bg-f foot-select pb40" v-if="isShowSelectAll">
					<view class="align-center justify-between" v-if="isShowSelectAll">
						<u-checkbox-group @change="selectAll">
							<u-checkbox :checked="isSelectAll" shape="circle" activeColor="#FF6C47" :name="true" label="全选" labelColor="#333" /><text class="fs24 base-color-9 ml12">已选 {{selectedCount}}
								个</text>
						</u-checkbox-group>
					</view>
					<view class="justify-center ">
						<button class="base-bg-red radius100 colorf h62 fs28 lh62 mlr10" @click="changeProhibit" v-if="current==0">禁用</button>
						<button class="base-bg-red radius100 colorf h62 fs28 lh62 mlr10" @click="changeblack"	v-else>取消禁用</button>
						<button class="base-bg-blue radius100 colorf h62 fs28 lh62" @click="changetagall" v-if="current==0">改标签</button>
						<!-- <button class="base-bg-f radius100 base-color-red h62 ml10 fs28 lh60"
							style="border: #ef4c50 solid 2rpx;" 
							@click="changevipuser"  v-if="current==0">更换归属</button> -->
					</view>
				</view>
			</view>
			<!-- </mescroll-body> -->
		</view>
		<!-- <u-picker :show="showTagSelect" :columns="companytag" keyName="tag" @cancel='showTagSelect=false'
			@confirm='singleChangeLable' ></u-picker> -->
		<view>
			<u-popup :show="projectbox" :round="12" @close="projectbox = false" :zIndex="10074" style="flex: 0;">
				<view class="pb120">
					<view class="center bold fs32 mt30">选择项目</view>
					<view class="p20 justify-start mb60" style="flex-wrap: wrap">
						<view class="plr16 ptb8 u-border mlr10 radius8 " :class="projectId==item.dictValue?'probgsel':'probg'"
						 v-for="(item,index) in projectList" :key="index" @click="selproject(item)">
							{{item.dictLabel}}
						</view>
					</view>
					<view class="quedingpro" @click="submitPro">确定</view>
				</view>
			</u-popup>
			<u-popup :show="showTagSelect" @close='closetagselect' :closeOnClickOverlay='true' mode="bottom"
				style="z-index: 999;">
				<view class=" w100 bgf pb120">
					<view class="plr28 ptb16 justify-between" style="flex-direction: row-reverse">
						<u-icon class="" name="close-circle" color="#ccc" size="24" @click="closetagselect"></u-icon>
					</view>
					<view class="mb20">
						<u-search placeholder="请输入标签  多个标签用 , 隔开" v-model="tagchangekeywords" :showAction="false"
							height="30px" @search='getcompanyTags'></u-search>
					</view>
					<scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnableds"
						:refresher-triggered="triggeredsA" refresher-background="rgba(0,0,0,0)"
						@refresherrefresh="pullDownRefreshsA" @refresherrestore="triggeredsA = false"
						:upper-threshold="100" :lower-threshold="100" @refresherabort="triggeredsA = false">
						<view class="justify-start p32 wrap">
							<view class="mlr10 mt10 " v-for="(item,index) in changetag" :key='item.tagId'>
								<u-tag :text="item.tag" :plain="!item.checked" :name="index"
									@click="choosechangeTag"></u-tag>
							</view>
						</view>
						<view class="center fs24 mt20">
							<text class="mr20" @click="getTagpageS('last')">上一页</text>
							<text class="base-color-red">{{pagetagA.pageNum}}/{{pagetagA.pages}}</text>
							<text class="ml20" @click="getTagpageS('next')">下一页</text>
						</view>
					</scroll-view>
					<view class="justify-between p32 " :class="isShowSelectAll?'pb120':''">
						<view class="changetagbtn base-bg-f8" @click="showTagSelect=!showTagSelect">取消</view>
						<view class="changetagbtn colorf base-bg-blue" @click="suretagchangeAll">确定</view>
					</view>
				</view>
			</u-popup>
		</view>

		<view class="invite-member" :style="{right:vipInviteshow?'-72rpx':'20rpx'}">
			<image :src="imgPath+'/app/images/invite-member-icon.png'" mode="aspectFill" @click="vipInvite"
				style="position: relative;" class="intimg"> </image>
			<image :src="imgPath+'/app/image/tc_close_icon.png'" class="falseimg" @click="showinimg"></image>
		</view>
		<view class="">

			<!-- 邀请弹窗 -->
			<u-popup :show="invitePop" :round="12" @close="invitePop = false" :zIndex="10074" style="flex: 0;">
				<view class="popbox">
					<view class="popbox-head">
						<u-icon class="close-circle" name="close-circle" color="#ccc" size="24"
							@click="invitePop = false"></u-icon>
						分享方式
					</view>
					<view class="popbox-body">
						<view class="choosetitle x-bc">
							<view>选择标签</view>
							<view v-if="sharetaglist" style="color:#1677ff" @click="addtag(0)">{{zhanshitag}}</view>
							<view class="x-f" style="color:#1677ff;" v-else @click="addtag(0)">
								<u-icon name="plus" color="#1677ff" size="14" style="margin-right: 5px;"></u-icon>添加标签
							</view>
						</view>
						<view class="invitetip">选择标签，当会员注册成功后，即可自动打标签</view>
						<!-- <view class="tagbox-list x-f" style="margin-top: 10px;margin-left: 0px;">
						<view class="tagbox-item x-f" @click="chooseTag">未打标签</view>
						<view class="tagbox-item x-f tag-active">未打标签</view>
					</view> -->
						<!--#ifdef MP-WEIXIN-->
						<view class="justify-center" style="margin-top: 10px;">
							<!--#endif-->
							<!--#ifdef H5-->
							<view class="justify-center" style="margin-top: 10px;">
								<!--#endif-->
								<!-- <view class="x-bc " style="margin-top: 30px;"> -->
								<!--#ifdef MP-WEIXIN-->
								<view class="sharePop-item y-f " style="text-align: center;">
									<!--#endif-->
									<!--#ifdef H5-->
									<view class="sharePop-item y-f card-share" @click="shareimg"
										style="text-align: center;">
										<!--#endif-->
										<image :src="imgPath+'/app/images/card_icon.png'" mode="aspectFill"
											style="width: 80rpx; height: 80rpx;margin-top: 20rpx;">
										</image>
										<view class='u-border radius100 plr20 ptb10' @click="copyPageLink"
										>复制页面地址</view>
										<!-- <view style="font-weight: bold;margin-bottom: 4px;">生成卡片</view>
										<view style="font-size: 12px;color: #888;">指导分享轻松转发</view> -->
										<!-- #ifdef MP-WEIXIN -->
										<!-- <button open-type="share" class="share">分享卡片</button> -->
										<!-- #endif -->
									</view>
									<!--#ifdef H5-->
									<view class="sharePop-item y-f " @click="buildimg" style="text-align: center;">
										<image :src="imgPath+'/app/images/poster_icon.png'" mode="aspectFill"></image>
										<view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
										<view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
									</view>
									<view class="sharePop-item y-f " @click="copyLink" style="text-align: center;">
										<image :src="imgPath+'/app/images/link_icon.png'" mode="aspectFill"></image>
										<view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
										<view style="font-size: 12px;color: #888; ">生成链接一键复制</view>
									</view>
									<!--#endif-->
								</view>
							</view>
						</view>
			</u-popup>
			<!-- 设置链接有效时长弹窗 -->
			<u-modal :show="setTimeShow" content='content' class="model" @confirm="confirmTime">
				<view class="setTimebox">
					<view class="timetip">不传默认以系统参数为准</view>
					<view class="x-f">
						<text style="margin-right: 20px;">链接有效时长(分钟)</text>
						<u-input fontSize="14px" placeholder="链接有效时长" border="none" v-model="time"
							maxlength="5"></u-input>
					</view>
				</view>
			</u-modal>
			<!-- 长按保存海报 -->
			<u-popup :show="setImg" @close="closeimg" :round="12">
				<view class="w100 h500 center">
					<image :src="codeLink.url" mode="aspectFill"></image>
				</view>
				<view class="justify-around mb40">
					<view class="column justify-center align-center" @click="downimg">
						<image :src="imgPath+'/app/image/downicon.png'" class="w80 h80"></image>
						<view class="mt10">长按图片保存</view>
					</view>
				</view>
			</u-popup>
			<!-- 卡片分享引导 -->
			<u-overlay :show="showzhidao" @click="showzhidao = false" style="z-index: 9999;">
				<view class="point-box">
					<view class="imgshe">
						<image :src="imgPath+'/app/image/point.png'" class="w300 h300"></image>
					</view>
					<view class="column colorf fs32 xu-box fs40
				align-center justify-center">
						<view class="justify-center">点击右上角
							<image :src="imgPath+'/app/image/wxmore.png'" class="w50 h50 mlr10"></image>
						</view>
						<view class="mt20">选择 “转发给朋友”</view>
						<view style="color: #cbcbcb;" class="fs28 mt40">点击任意位置关闭弹窗</view>
					</view>
				</view>
			</u-overlay>
			<!-- 更改归属 -->
			<u-picker :show="showcol" :columns="columns" @cancel='showcol=!showcol' @confirm='receiveA'
				keyName="nickName"></u-picker>
			<u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="20"
		:loading-text="loadingtext"></u-loading-page>
		</view>
	</view>
</template>

<script>
	import {
		getfsuserList,
		getcompanyTaglist,
		Addblacklist,
		changeLable,
		getvipNum,
		changevipUser,
		getgroupList,
		becomeVipuser,
		becomeVipuserImg,
		getusersales,
		removebalcklist,
		getallTags,
		copyuniLink,
		getlinkCode,
		getprojectlist
	} from "@/api/manageCompany.js";
	import vipUserItem from "../components/vipUserItem.vue"
	import dropdownPanel from "../components/dropdownPanel.vue"
	// import wx from 'weixin-js-sdk'
	export default {
		components: {
			vipUserItem,
			dropdownPanel,
		},
		data() {
			return {
				viewload: true,
				loadingtext: "数据加载中...",
				showcol: false,
				setImg: false,
				columns: [],
				showTagSelect: false,
				list: [{
						name: '会员(0)',

					}, {
						name: '小黑屋(0)'
					},
					{
						name: '黑名单(0)'
					}
				],
				userList: [],
				current: 0,
				keyword: "",
				companytag: [],
				showCompanytag: [],
				selectedList: [], //已经选中标签列表
				list2: [{
					name: '全部',
				}, {
					name: '今日新增',
				}, {
					name: '今日完播'
				}, {
					name: '未看过课'
				}],
				currentType: 0,
				activeStyle: {
					color: '#1677ff',
					fontSize: '14px',
					fontWeight: 'bold'
				},
				inactiveStyle: {
					fontSize: '14px'
				},
				searchTypeIndex: 0,
				typeArrays: ['连续缺课天数多到少', '连续缺课天数少到多', '按注册时间晚到早', '会员姓名0-9-A-Z'],
				typeArray: ['按注册时间晚到早', '会员姓名0-9-A-Z'],
				typeoption: ['注册时间', '会员姓名'],
				array: [{
						value: '0',
						name: '关联搜索',
					},
					{
						value: '1',
						name: '精准搜索'
					}
				],
				typeIndex: 0,
				popTitle: '搜索选择',
				showPop: false,
				filterData: [{
						name: '销售',
						value: 0,
						type: 'userStatus',
						option: [{
							label: '全部',
							id: ''
						}, ]
					},
					{
						name: '注册',
						value: 1,
						type: 'registerTime',
						option: [{
							label: '全部',
						}, {
							label: '今天',
						}, {
							label: '昨天',
						}, {
							label: '近7天',
						}, {
							label: '自定义',
						}]
					}, {
						name: '看课',
						value: 2,
						type: 'watchStatus',
						option: [{
							label: '全部',
						}, {
							label: '未看过课',
						}, {
							label: '正常看课',
						}, {
							label: '停止看课',
						}]
					},
					{
						name: '缺课',
						value: 3,
						type: 'courseStatus',
						option: [{
							label: '全部',
						}, {
							label: '已缺课',
						}, {
							label: '未缺课',
						}]
					},
					{
						name: '项目',
						value: 4,
						type: 'project',
						option: [{
							label: '全部',
							id: ''
						}]
					},
					{
						name: '批量',
						value: 5,
						type: 'piliang',
						special: true,
						stopPrevent: true
					}
				],
				searchbarNav: 0,
				userStatusIndex: 0,
				registerTimeIndex: 0,
				watchStatusIndex: 0,
				courseStatusIndex: 0,
				projectStatusIndex: 0,
				selprojectId: '',
				showCalendar: false,
				date: '',
				mode: 'range',
				queryParam: {
					typeIndex: 0,
					startTime: '',
					endTime: ''
				},
				mescroll: null,
				downOption: {
					use: true,
					auto: false
				},
				upOption: {
					onScroll: false,
					use: true, // 是否启用上拉加载; 默认true
					auto: true,
					page: {
						pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
						size: 10 // 每页数据的数量,默认10
					},
					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
					textNoMore: "已经到底了",
					empty: {
						icon: 'https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png',
						tip: '暂无数据'
					}
				},
				dataList: [],
				invitePop: false,
				setTimeShow: false,
				time: "",
				user: {},
				idx: [],
				todayday: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
				startTime: '',
				endTime: '',
				isShowSelectAll: false, //是否显示全选
				isSelectAll: false, //是否全选
				ispopshow: false,
				selectidAll: [],
				changetag: [],
				selectidtag: '',
				itemname: '',
				userid: '',
				groupid: [],
				pageOptions: {
					pageNum: 1,
					pageSize: 8,
				},
				status: 'loadmore',
				sharetag: 1,
				sharetaglist: [],
				codeLink: [],
				zhanshitag: '',
				copyLinks: '',
				showzhidao: false,
				imgs: this.$store.state.imgpath + '/app/image/logoshare.png',
				currentIsBlack: 1,
				tagpageNum: 1,
				tagpageSize: 16,
				triggereds: false,
				statusA: 'loadmore',
				isEnableds: true,
				pagetag: [],
				tagkeywords: '',
				salesid: '',
				tagchangekeywords: '',
				tagpageNums: 1,
				tagpageSizes: 16,
				triggeredsA: false,
				statusAs: 'loadmore',
				isEnabledsA: true,
				pagetagA: [],
				tops: '464rpx',
				showInvite: false,
				vipInviteshow: false,
				projectbox:false,
				projectList:{},
				projectId:''
			}
		},
		// onLoad() {
		// 	// #ifdef MP-WEIXIN
		// 	uni.showShareMenu({
		// 		withShareTicket: true,
		// 		menus: ['shareAppMessage']
		// 	});
		// 	// #endif
		// },
		mounted() {
			this.getsalelist()
			this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {},
				this.getvipListnum()
			this.userList = []
			this.getfsuserListdata()
			this.getprojectlistsA()
		},
		onShow() {
			// #ifdef H5
			this.getjssdklist()
			// #endif

		},
		// 这个是分享聊天
		// onShareAppMessage() {
		// 	return {
		// 		title:this.$store.state.logoname+'小程序的'+this.user.userName + '邀请您成为会员！',
		// 		path: '/pages/user/users/becomeVIP?companyId=' +
		// 			this.user.companyId + '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist,
		// 		imageUrl: this.imgs,
		// 	}
		// },
		computed: {
			selectedCount() {
				return this.userList.filter(item => item.checked).length;
			},
			imgPath() {
				return this.$store.state.imgpath
			}
		},
		methods: {
			getlinkCodes(){
				getlinkCode().then(res=>{
					if(res.code){
						this.projectCode=res.code
						console.log(this.projectCode)
						setTimeout(()=>{
							this.setlnk()
						},100)
					}
				})
			},
			setlnk(){
				let params={
					companyId: this.user.companyId,
					companyUserId: this.user.userId,
					tagids: this.sharetaglist,
					projectCode: this.projectCode,
					projectId: this.projectId,
				}
				const pages = '/pages_course/becomeVIP?becomeVip='+JSON.stringify(params)
				console.log(pages)
				const data={
					appid:wx.getAccountInfoSync().miniProgram.appId,
					linkStr:pages
				}
				copyuniLink(data).then(res=>{
					if(res.code==200){
						uni.hideLoading();
						setTimeout(() => {
							uni.setClipboardData({
								data:res.data,
								success: () => {
									uni.showToast({
										title: '链接已复制',
										icon: 'none',
										duration: 2000
									});
								},
								fail: () => {
									uni.showToast({
										title: '复制失败',
										icon: 'none'
									});
								}
							});
						}, 200)
					}else{
						uni.hideLoading();
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});
					}
				})
			},
			copyPageLink(){
				uni.showLoading({
					title: "处理中..."
				});
				this.getlinkCodes()
			},
			submitPro() {
				if (this.projectId == '') {
					uni.showToast({
						title: '请选择项目',
						icon: 'none',
						duration: 1000
					});
					return
				}
				this.projectbox = false
				this.invitePop = true
				const pages = '/pages_course/becomeVIP?companyId=' +this.user.companyId
				+"&projectId=" +this.projectId+ '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist
				this.$emit('childEvent', pages);
			},
			selproject(item) {
				this.projectId = item.dictValue
			},
			getprojectlistsA() {
				const oldlist = this.filterData[4].option
				const data = {
					key: 'sys_course_project'
				}
				getprojectlist(data).then(res => {
					if (res.code == 200) {
						const list = res.data
						this.filterData[4].option = oldlist.concat(list.map(item => {
							return {
								id: item.dictValue,
								label: item.dictLabel
							};
						}));
						console.log('1212121212', this.filterData[4].option)
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
						});
					}
				})
			},
			getprojectlists() {
				const data = {
					key: 'sys_course_project'
				}
				getprojectlist(data).then(res => {
					// this.projectList=res.data
					this.projectList = res.data.map(item => {
						return {
							...item,
							checked: false,
						}
					})
					console.log(this.projectList)
				})
			},
			sharecard() {
				console.log(11)
			},
			changetagall() {
				this.showTagSelect = !this.showTagSelect
				this.tagchangekeywords = ''
				this.selectidtag = ''
				this.showInvite = false
				this.sharetag = 1
				this.getalltagtaglist()
			},
			getTagpageS(type) {
				if (type == 'last') {
					if (this.tagpageNums >= 2) {
						this.tagpageNums--
						this.getalltagtaglist()
					} else {
						uni.showToast({
							title: '已经是第一页',
							icon: 'none',
							duration: 1000
						});
					}
				} else {
					if (this.tagpageNums < this.pagetagA.pages) {
						this.tagpageNums++
						this.getalltagtaglist()
					} else {
						uni.showToast({
							title: '已经是最后一页',
							icon: 'none',
							duration: 1000
						});
					}
				}
			},
			getcompanyTags(value) {
				this.tagchangekeywords = value
				this.getalltagtaglist()
			},
			singleDelete(data) {
				this.pageOptions.pageNum = 1
				this.$emit('update:parentValue', '新值');
				this.userList = []
				this.selectidAll[0] = data
				this.changeblack()
			},
			changeblack() {
				// console.log(this.selectidAll[0])
				//取消禁用
				if (this.selectidAll.length < 1) {
					uni.showToast({
						icon: 'none',
						title: '所选列表为空'
					})
					return
				}
				removebalcklist(this.selectidAll).then(res => {
					if (res.code == 200) {
						this.pageOptions.pageNum = 1
						// console.log(this.pageOptions.pageNum)
						this.getfsuserListdata('refresh')
						// 创建一个在**秒后执行的定时器
						const timer = setTimeout(function() {
							uni.showToast({
								icon: 'none',
								title: '取消禁用成功'
							})
						}, 200);
						this.getvipListnum()
						this.isShowSelectAll = false
						this.isSelectAll = false
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			blackSel() {
				this.isShowSelectAll = !this.isShowSelectAll
				// if (data.value == 4) {
				// 	this.itemname = data.name
				// 	this.isShowSelectAll = !this.isShowSelectAll
				// } else {
				// 	this.isShowSelectAll = false
				// }
			},
			getsalelist() {
				const oldlist = this.filterData[0].option
				getusersales().then(res => {
					if (res.code == 200) {
						const list = res.data
						this.filterData[0].option = oldlist.concat(list.map(item => {
							return {
								id: item.userId,
								label: item.nickName
							};
						}));
						// this.filterData[0].option=list.map(item => {
						// 	return {
						// 		id: item.userId,
						// 		label: item.nickName
						// 	};
						// })
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
						});
					}
				})

			},
			getTagpage(type) {
				if (type == 'last') {
					if (this.tagpageNum >= 2) {
						this.tagpageNum--
						this.getcompanyTag()
					} else {
						uni.showToast({
							title: '已经是第一页',
							icon: 'none',
							duration: 1000
						});
					}
				} else {
					if (this.tagpageNum < this.pagetag.pages) {
						this.tagpageNum++
						this.getcompanyTag()
					} else {
						uni.showToast({
							title: '已经是最后一页',
							icon: 'none',
							duration: 1000
						});
					}
				}
			},
			//标签展示下拉
			pullDownRefreshs() {
				// 下拉
				this.triggereds = true; //下拉了状态为true
				setTimeout(() => {
					this.triggereds = false;
					uni.stopPullDownRefresh()
					this.tagpageNum = 1;
					this.getcompanyTag('refresh') //触底  不穿执行else
					// 请求接口里面需要判断是不是最后一页   是最后一页 status赋值为‘loadmore’没有更多了
					// 请求接口
				}, 1000)
			},
			getjssdklist() {
				const param = {
					url: window.location.href
				}
				getSDK(param).then(res => {
					wx.config({
						appId: res.data.appId, // 必填，公众号的唯一标识
						timestamp: res.data.timestamp, // 必填，生成签名的时间戳
						nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
						signature: res.data.signature, // 必填，签名
						jsApiList: ["updateAppMessageShareData"] // 必填，需要使用的JS接口列表
					});
				})
			},
			shareimg() {
				//分享好友
				this.getlink()
				let self = this
				// 配置--你到时候把配置全局 --就是这些东西  调接口拿
				wx.ready(function() { //需在用户可能点击分享按钮前就先调用
					wx.updateAppMessageShareData({
						title: self.user.userName + "邀请您成为会员", // 分享标题
						desc: self.user.deptName, // 分享描述
						link: self.copyLinks,
						imgUrl: self.codeLink.url || self.imgs, // 分享图标
						success: function(res) {
							self.showzhidao = true
							self.setImg = false
							self.showShare = false
							// 设置成功
							uni.showToast({
								title: '卡片已生成',
								icon: 'none',
								duration: 1000
							});
						},
						fail: function(err) {
							console.log(err);
							uni.showToast({
								title: '卡片生成失败，请重试',
								icon: 'none',
								duration: 2000
							})
						}
					})
				});
			},
			downimg() {},
			closeimg() {
				this.setImg = false
				this.invitePop = false
			},
			buildimg() {
				this.setImg = !this.setImg
				this.getshareimg()
			},
			addtag(add) {
				this.sharetag = add
				this.showTagSelect = !this.showTagSelect
				this.invitePop = !this.invitePop
				this.showInvite = true
				this.getalltagtaglist()
			},
			changevipuser() {
				this.showcol = !this.showcol
				this.getgrouplist()
			},
			getgrouplist() {
				//获取群管列表
				getgroupList().then(res => {
					if (res.code == 200) {
						this.columns = [res.data]
						// console.log(this.columns)
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			changeall() {
				//更换全部会员
				console.log(1)
				const param = {
					companyId: this.user.companyId,
					companyUserId: this.userid,
					userId: this.groupid
				}
				changevipUser(param).then(res => {
					if (res.code == 200) {
						uni.showToast({
							icon: 'none',
							title: '更换会员归属成功'
						})
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			receiveA(e) {
				console.log(e)
				this.userid = e.value[0].userId
				if (this.isShowSelectAll == true) {
					this.groupid = this.selectidAll
					this.changeall()
					this.showcol = !this.showcol
					setTimeout(() => {
						this.getfsuserListdata()
					}, 200)
				} else {
					this.changeall()
					this.showcol = !this.showcol
					this.getfsuserListdata()
				}
				this.isSelectAll = false
			},
			getvipListnum() {
				getvipNum().then(res => {
					if (res.code == 200) {
						this.list[0].name = "会员" + '(' + res.data.number + ')'
						this.list[1].name = "小黑屋" + '(' + res.data.smallBlackNum + ')'
						this.list[2].name = "黑名单" + '(' + res.data.blackNum + ')'
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			getactNav(data) {
				if (data.value == 5) {
					this.itemname = data.name
					this.isShowSelectAll = !this.isShowSelectAll
				} else {
					this.isShowSelectAll = false
				}
			},
			closetagselect() {
				this.showTagSelect = !this.showTagSelect
			},
			suretagchangeAll() {
				if (this.sharetag == 0) {
					this.sharetaglist = this.changetag.filter(item => item.checked).map(v => v.tagId).join(',')
					this.showTagSelect = !this.showTagSelect
					this.zhanshitag = this.changetag.filter(item => item.checked).map(v => v.tag).join(',')
					// console.log(this.sharetaglist)
					const pages = '/pages_course/becomeVIP?companyId=' +this.user.companyId
					+"&projectId=" +this.projectId+ '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist
					this.$emit('childEvent', pages);
					console.log(pages)
				} else {
					//多选改标签确认按钮
					this.showTagSelect = !this.showTagSelect
					if (this.selectidAll.length == 0) {
						uni.showToast({
							icon: 'none',
							title: '未选中用户'
						})
						return
					}
					this.selectidtag = this.changetag.filter(item => item.checked).map(v => v.tagId)
					this.changeLabelmore()
				}
				if (this.showInvite) {
					this.invitePop = true
				}
			},
			singleChangeLable(data) {
				this.showTagSelect = !this.showTagSelect
				this.selectidAll[0] = data
				this.tagchangekeywords = ''
				this.selectidtag = []
				this.sharetag = 1
				this.showInvite = false
				this.getalltagtaglist()
			},
			getalltagtaglist(type) {
				//获取公司标签列表
				const data = {
					pageNum: this.tagpageNums,
					pageSize: this.tagpageSizes,
					keyword: this.tagchangekeywords
				}
				getallTags(data).then(res => {
					if (res.code == 200) {
						const dataList = res.data.list.map(item => {
							return {
								...item,
								checked: false,
							}
						})
						if (type == 'refresh') {
							this.changetag = dataList
						} else {
							this.changetag = dataList
						}
						if (res.data.isLastPage) {
							this.statusAs = 'nomore'
						} else {
							this.statusAs = 'loadmore'
						}
						this.pagetagA = res.data
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			changesinglevip(data) {
				this.showcol = !this.showcol
				// console.log(data)
				this.groupid[0] = data
				this.getgrouplist()
			},
			changeLabelmore() {
				//改标签选择按钮
				const params = {
					tagIds: this.selectidtag,
					userCompanyUserIds: this.selectidAll
				}
				changeLable(params).then(res => {
					if (res.code == 200) {
						this.userList = []
						this.getfsuserListdata('refresh')
						const timer = setTimeout(function() {
							uni.showToast({
								icon: 'none',
								title: '标签更改成功'
							})
						}, 500);
						this.isSelectAll = false
						this.selectedCount = 0
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			changeOwnership() {
				//更换归属（经销商功能）
			},
			getcompanyTag(type) {
				this.companytag = []
				this.tagkeywords = this.tagkeywords.replace(/，/g, ',')
				const data = {
					pageNum: this.tagpageNum,
					pageSize: this.tagpageSize,
					keyword: this.tagkeywords
				}
				getcompanyTaglist(data).then(res => {
					if (res.code == 200) {
						// this.showCompanytag = res.data.list
						const dataList = res.data.list.map(item => {
							return {
								...item,
								checked: false,
							}
						})
						if (type == 'refresh') {
							this.companytag = dataList
						} else {
							this.companytag = [...this.companytag, ...dataList]
						}
						if (res.data.isLastPage) {
							this.statusA = 'nomore'
						} else {
							this.statusA = 'loadmore'
						}
						this.pagetag = res.data
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			getfsuserListdata(type) {
				// this.userList=[]
				const param = {
					userId: this.user.userId,
					tabValue: this.currentType,
					registerStartTime: this.startTime, //注册开始
					registerEndTime: this.endTime, //注册结束
					watchCourseType: this.watchStatusIndex,
					missCourseStatus: this.courseStatusIndex,
					projectId: this.selprojectId,
					keyword: this.keyword,
					tagIds: this.idx,
					status: this.currentIsBlack,
					companyUserId: this.salesid,
					continueMissCourseSort: this.searchTypeIndex,
					...this.pageOptions
				}

				getfsuserList(param).then(res => {
					if (res.code == 200) {
						this.viewload = false
						let dataList = res.data.list.map(item => {
							return {
								...item,
								checked: false,
							}
						})
						if (type == 'refresh') {
							this.userList = dataList
						} else if (type == 'more') {
							this.userList = dataList
						} else {
							this.userList = [...this.userList, ...dataList]
						}
						if (res.data.isLastPage) {
							this.status = 'nomore'
						} else {
							this.status = 'loadmore'
						}
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			onChange(index) {
				if (index == 5) return
				this.searchbarNav = index
			},
			searchKeyword(value) {
				this.keyword = value
				this.userList = []
				this.pageOptions.pageNum = 1
				this.getfsuserListdata()
			},
			singleChange(data) {
				this.userList = []
				this.selectidAll[0] = data
				this.changeProhibit()
			},
			changeProhibit() {
				//批量禁用选择按钮
				if (this.selectidAll.length < 1) {
					uni.showToast({
						icon: 'none',
						title: '所选列表为空'
					})
					return
				}
				Addblacklist(this.selectidAll).then(res => {
					if (res.code == 200) {
						this.pageOptions.pageNum = 1
						this.getfsuserListdata('refresh')
						// 创建一个在**秒后执行的定时器
						const timer = setTimeout(function() {
							uni.showToast({
								icon: 'none',
								title: '禁用成功'
							})
						}, 200);
						this.getvipListnum()
						// this.isShowSelectAll = false
						this.isSelectAll = false
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			// 全选
			selectAll() {
				// 先设置全选
				this.isSelectAll = !this.isSelectAll
				// 然后设置列表  checked没得this不会报错吗  这是返回新数组 
				console.log(this.isSelectAll)
				this.userList = this.userList.map(item => {
					// 每一项的 checked为 全选的状态
					return {
						...item,
						checked: this.isSelectAll
					}
				})
				this.selectidAll = this.userList.filter(item => item.checked).map(item => item.userCompanyUserId)
				console.log(this.isSelectAll)
			},
			// 单选 /反选 
			changeItem(i) {

				let arr = {
					...this.userList[i],
					checked: !this.userList[i].checked
				}
				this.$set(this.userList, i, arr)
				this.selectidAll = this.userList.filter(item => item.checked).map(item => item.userCompanyUserId)
				console.log(this.selectidAll)
				this.isSelectAll = this.userList.every(item => item.checked)
				if (this.isSelectAll) {
					this.userList = this.userList.map(item => {
						return {
							...item,
							checked: this.isSelectAll
						}
					})
				}
				this.selectidAll = this.userList.filter(item => item.checked).map(item => item.userCompanyUserId)

			},
			reset() {
				//重置时间选择等筛选
				const type = this.filterData[this.searchbarNav].type
				console.log(this.registerTimeIndex)
				if (type == 'registerTime') {
					this.registerTimeIndex = ''
					this.endTime = ''
					this.startTime = ''
					this.getfsuserListdata('refresh')
					// console.log(this.getfsuserListdata())
				} else if (type == 'watchStatus') {
					this.watchStatusIndex = 0
					this.getfsuserListdata('refresh')
				} else if (type == 'userStatus') {
					this.userStatusIndex = 0
					this.salesid = ''
					this.getfsuserListdata('refresh')
				} else if (type == 'courseStatus') {
					this.courseStatusIndex = 0
					this.getfsuserListdata('refresh')
				} else if (type == 'project') {
					this.selprojectId = ''
					this.projectStatusIndex = 0
					this.getfsuserListdata("refresh")
				} else {

				}
			},
			confirm(e) {
				this.pageOptions.pageNum = 1
				this.userList = []
				const type = this.filterData[this.searchbarNav].type
				const value = this.registerTimeIndex
				if (type == 'registerTime') {
					if (value == 0) {
						this.startTime = ''
						this.endTime = ''
						this.getfsuserListdata('refresh')
					} else if (value == 1) {
						this.startTime = this.todayday + ' 00:00:00'
						this.endTime = this.todayday + ' 23:59:59'
						this.getfsuserListdata('refresh')
					} else if (value == 2) {
						let yesterday = new Date();
						yesterday.setDate(yesterday.getDate() - 1);
						this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd') + ' 00:00:00'
						this.endTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd') + ' 23:59:59'
						this.getfsuserListdata('refresh')
					} else if (value == 3) {
						let yesterday = new Date();
						yesterday.setDate(yesterday.getDate() - 6);
						this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd') + ' 00:00:00'
						this.endTime = this.todayday + ' 23:59:59'
						this.getfsuserListdata('refresh')
					} else {
						this.getfsuserListdata('refresh')
					}
				} else if (type == 'watchStatus') {
					// this.watchStatusIndex=value

					this.getfsuserListdata()
					// console.log(this.filterData)
				} else if (type == 'userStatus') {
					if (this.userStatusIndex == 0) {
						this.salesid = ''
						this.getfsuserListdata('refresh')
					} else {
						this.getfsuserListdata('refresh')
					}
					// console.log(this.userStatusIndex)
				} else if (type == 'courseStatus') {
					this.getfsuserListdata('refresh')
					console.log(this.courseStatusIndex)
				} else if (type == 'project') {
					if (this.projectStatusIndex == 0) {
						this.selprojectId = ''
						this.getfsuserListdata('refresh')
					} else {
						this.getfsuserListdata('refresh')
					}
					console.log(this.projectStatusIndex)
				}
				// this.mescroll.resetUpScroll()
			},

			handleParamItem(type, index, id) {
				if (type == 'registerTime') {
					this.registerTimeIndex = index
				} else if (type == 'watchStatus') {
					this.watchStatusIndex = index
					// console.log('watchStatus',index)
				} else if (type == 'userStatus') {
					this.userStatusIndex = index
					this.salesid = id
					console.log(this.salesid)
				} else if (type == 'courseStatus') {
					this.courseStatusIndex = index
				} else if (type == 'project') {
					this.selprojectId = id
					this.projectStatusIndex = index
				} else {
					this.ispopshow = false
				}
			},
			sectionChange(index) {
				this.current = index;
				this.currentType = 0
				this.startTime = '' //注册开始
				this.endTime = '' //注册结束
				this.watchStatusIndex = 0
				this.salesid = ''
				this.courseStatusIndex = 0
				this.selprojectId = ''
				this.keyword = ''
				this.idx = []
				this.pageOptions.pageNum = 1
				this.isShowSelectAll = false
				this.userList = []
				if (index == 0) {
					// 0小黑屋 1正常 2拉黑
					this.currentIsBlack = 1
					this.getfsuserListdata("refresh")
				} else if (index == 1) {
					this.currentIsBlack = 0
					this.getfsuserListdata("refresh")
				} else {
					this.currentIsBlack = 2
					this.getfsuserListdata("refresh")
				}
				this.isSelectAll=false
				this.getvipListnum()
			},
			clickTypeTab(e) {
				this.currentType = e.index
				this.userList = []
				// 在这里更新
				this.pageOptions.pageNum = 1
				this.getfsuserListdata()
			},
			bindPickerChange(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.userList = []
				this.searchTypeIndex = e.detail.value
				this.getfsuserListdata()
			},
			openPop(type) {
				this.popTitle = type == 'search' ? '搜索选择' : type == 'tag' ? '标签筛选' : ''
				this.typeIndex = this.queryParam.typeIndex
				this.showPop = true
				if (type == 'tag') {
					this.getcompanyTag()
				}
			},
			closePop() {
				this.showPop = false
			},
			resetPop(i) {
				this.idx = []
				this.tagkeywords = ''
				this.tagpageNum = 1
				this.showCompanytag = []
				this.companytag.forEach(tag => {
					tag.checked = false; // 将所有标签的show属性重置为true
				});
				this.showPop = false
				this.$nextTick(() => {
					this.getcompanyTag()
					this.getfsuserListdata()
				})
			},
			closeCalendar() {
				this.showCalendar = false
			},
			confirmCalendar(e) {
				// this.startTime = e[0]
				// this.endTime =  e[e.length-1]
				this.showCalendar = false
				this.queryParam.startTime = e.range.after
				this.queryParam.endTime = e.range.before
				this.endTime = e.range.before + ' 23:59:59'
				this.startTime = e.range.after + ' 00:00:00'
				console.log(e)
				// this.getCount()
			},
			bindTypeChange(i) {
				this.typeIndex = i
			},
			confirmPop() {
				this.queryParam.typeIndex = this.typeIndex
				this.showPop = false
				this.showCompanytag = this.companytag.filter(item => item.checked)
				this.idx = this.showCompanytag.map(v => v.tagId)
				//filtter(过滤)  筛选所有checked==true的  然后map返回每一项的id
				if (this.idx.length == 0) {
					this.showCompanytag = this.companytag
				}
				this.$nextTick(() => {
					this.getfsuserListdata("refresh")
				})
			},
			chooseTag(i) {
				this.companytag[i].checked = !this.companytag[i].checked
			},
			choosechangeTag(i) {
				this.changetag[i].checked = !this.changetag[i].checked
			},
			vipInvite() {
				if (!this.vipInviteshow) {
					// this.invitePop = true
					// this.getlink('preload')
					// this.getjssdklist()
					this.getprojectlists()
					// this.invitePop = true
					this.projectId=''
					this.projectbox=true
					this.sharetaglist = null
					
				} else {
					this.vipInviteshow = false
				}

			},
			showinimg() {
				this.vipInviteshow = true
			},
			copyLink() {
				this.setTimeShow = true
			},
			confirmTime() {
				this.setTimeShow = false
				this.showShare = false
				console.log(this.showInvite)
				this.getshareLink()
			},
			getshareimg() {
				//生成海报
				this.getlink()
				this.codeLink = ''
				uni.showLoading({
					title: '正在生成中...'
				})
				const url = window.location.href.split('#')[0]
				const param = {
					companyId: this.user.companyId,
					companyUserId: this.user.userId,
					realLink: url + '#/pages/user/users/becomeVIP' + '?companyId=' +
						this.user.companyId + '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist,
					tagIds: this.sharetaglist,
				}
				becomeVipuserImg(param).then(res => {
					if (res.code == 200) {
						this.codeLink = res.posterImage
						console.log(res)
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			getlink(type) {
				//生成链接
				const param = {
					companyId: this.user.companyId,
					companyUserId: this.user.userId,
					tagids: this.sharetaglist,
					limitTime: this.time
				}
				const url = window.location.href.split('#')[0]
				// console.log(url)
				this.copyLinks = url + '#/pages/user/users/becomeVIP' + '?companyId=' +
					this.user.companyId + '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist
			},
			getshareLink() {
				//生成链接
				this.copyLinks = []
				const param = {
					code: '',
					companyId: this.user.companyId,
					companyUserId: this.user.userId,
					tagids: this.sharetaglist,
					limitTime: this.time
				}
				const url = window.location.href.split('#')[0]
				console.log(url)
				this.copyLinks = url + '#/pages/user/users/becomeVIP' + '?companyId=' +
					this.user.companyId + '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist
				console.log(this.copyLinks)
				setTimeout(() => {
					uni.setClipboardData({
						data: String(this.copyLinks),
						success: () => {
							uni.showToast({
								title: '复制成功',
								icon: 'none',
								duration: 2000
							});
							setTimeout(() => {
								this.invitePop = false
							}, 200)
						},
					})
				}, 100)
			},
			mescrollInit(mescroll) {
				this.mescroll = mescroll;
			},
			/*下拉刷新的回调 */
			downCallback(mescroll) {
				mescroll.resetUpScroll()
			},
			upCallback(page) {
				//联网加载数据
				var that = this;
				var data = {
					courseId: this.courseId,
					status: '',
					pageNum: page.num,
					pageSize: page.size
				};
				uni.showLoading({
					title: "加载中..."
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.probg{
		color: #666;
	}
	.probgsel{
		background-color: #1677ff;
		color: #fff;
		border: none;
	}
	.quedingpro{
		background-color: #1677ff;
		color: #fff;
		border-radius: 80rpx;
		height: 80rpx;
		line-height: 80rpx;
		width: 60%;
		margin: 0 auto;
		margin-top: 40rpx;
		text-align: center;
	}
	.card-share {
		position: relative;
	}

	.share {
		display: inline-block;
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 50%;
		opacity: 0;
	}

	.imgshe {
		display: flex;
		flex-direction: row-reverse
	}

	.point-box {
		height: 100%;
		width: 100%;

		.xu-box {
			border: #f5f5f5 4rpx dashed;
			padding: 20rpx 20rpx;
		}
	}

	.codeimg {
		position: absolute;
		z-index: 9999;
		left: 40rpx;
		top: 40rpx;
	}

	#codeurl {
		position: relative;
	}

	.checked-bg {
		border: 1px solid #1677ff !important;
		color: #1677ff !important;
		background-color: #e7f1fe !important;
	}

	.changetagbtn {
		width: 45%;
		height: 80rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 80rpx;
	}

	::v-deep {
		.foot-select {
			width: 100%;
			padding: 20rpx 20rpx;
			padding-bottom: 60rpx;
			z-index: 10000 !important;
			position: fixed;
			bottom: 0;
			margin-left: -24rpx !important;
		}
	}

	::v-deep {
		.model .u-fade-enter-active {
			z-index: 10075 !important;

		}
	}

	::v-deep {
		.uni-calendar__mask {
			z-index: 11000 !important;
		}

		.uni-calendar__content {
			z-index: 12000 !important;
		}
	}

	.container {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 14px;
		color: #222222;
		height: 100%;
		overflow: hidden;
	}

	.boxnav {
		flex-wrap: wrap;
		padding: 0 0 0 10px;

		&-item {
			width: 50%;
			overflow: hidden;
		}

		&-item-info {
			border: 1px solid #f5f5f5;
			text-align: center;
			color: #222;
			background-color: #f5f5f5;
			border-radius: 3px;
			padding: 5px;
			margin: 0 10px 10px 0;
		}

		&-active {
			border: 1px solid #1677ff !important;
			color: #1677ff !important;
			background-color: #e7f1fe !important;
		}
	}

	.calendar-day {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 12px;
		color: #999;
		flex: 1;
		min-height: 30px;
		background-color: #f5f5f5;
		border-radius: 4px;
		margin: 0 10px 10px 0;
	}

	.setTimebox {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 14px;
		width: fit-content;
		height: fit-content;
	}

	.timetip {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 14px;
		color: #2979ff;
		text-align: center;
		margin-bottom: 5px;
	}

	.popbox {
		background-color: #fff;
		border-radius: 12px;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 14px;
		color: #333;
		padding-bottom: 120rpx;

		&-head {
			padding: 15px;
			font-weight: bold;
			font-size: 15px;
			text-align: center;
			position: relative;
		}

		.close-circle {
			position: absolute;
			right: 10px;
			top: 50%;
			transform: translateY(-50%);
		}

		&-body {
			padding: 10px 10px;
		}

		.radiobox {
			&-item {
				padding: 10px 0;
				border-bottom: 1px solid #f5f5f5;

				&:last-child {
					border-bottom: none;
				}
			}
		}

		&-footer {
			padding: 15px 0;
		}

		&-footer-btn {
			flex: 1;
			height: 44px;
			line-height: 44px;
			margin: 0 10px;
			border-radius: 50px;
			border: none;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 14px;
			color: #333;

			&::after {
				border: none;
			}
		}

		.con-btn {
			background-color: #1677ff;
			color: #fff;
		}

		.choosetitle {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 15px;
			color: #333;
		}

		.invitetip {
			margin-top: 10px;
			background-color: #ebf5fb;
			color: #1677ff;
			padding: 5px 10px;
			border-radius: 5px;
		}

		.sharePop-item {
			padding: 0 10px;
			box-sizing: border-box;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 14px;
			display: inline-flex !important;

			image {
				height: 48px;
				width: 48px;
				margin-bottom: 10px;
			}
		}
	}

	.headbox {
		background-color: #fff;

		.subsection {
			height: 45px;
			padding: 4px;
		}

		.participate-order {
			font-size: 12px;

			image {
				width: 15px;
				height: 15px;
			}
		}
	}

	.tag-active {
		background-color: #ffeceb !important;
		color: #f93e3e !important;
		border: 1px solid #f93e3e !important;
	}

	.tagbox {
		padding-top: 10rpx;
		font-size: 12px;
		color: #1677ff;

		&-list {
			margin: 0 0 -6px 6px;
			flex-wrap: wrap;
		}

		&-item {
			height: 26px;
			padding: 0 8px;
			margin: 0 6px 6px 0;
			border-radius: 4px;
			background-color: #f5f5f5;
			color: #999;
			border: 1px solid #f5f5f5;
			box-sizing: border-box;
			font-size: 12px;
		}
	}

	.invite-member {
		height: 55px;
		width: 50px;
		position: fixed;
		bottom: 110px;
		right: 10px;
		cursor: pointer;

		.intimg {
			width: 50px;
			height: 55px;
		}
	}

	.invite-members {
		right: -68rpx;
	}

	.falseimg {
		position: absolute;
		width: 30rpx;
		height: 30rpx;
		top: 0rpx;
		right: -8rpx;
	}

	.userlist {
		padding: 24rpx;
	}
</style>