<template>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="商铺列表" name="first">
      <div style="display: inline-block;">
        <div style="position: relative;display: inline-block;margin: 10px 0px;">
          <span>商铺名称：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="shopSelect"
            placeholder="请输入商铺名称"
            v-model="shopName1"
          >
          </el-input
          >&nbsp;&nbsp;
        </div>
        <div style="position: relative;display: inline-block;margin: 10px 0px;">
          <span>省/市/区：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="shopSelect"
            placeholder="请输入省/市/区"
            v-model="region"
          >
          </el-input
          >&nbsp;&nbsp;
        </div>
        <div style="position: relative;display: inline-block;margin: 10px 0px;">
          <span>是否是活动商铺：</span>
          <el-select
            v-model="isActivity"
            placeholder="请选择是否是活动商铺"
            style="width:150px;"
            @change="shopSelect()"
          >
            <el-option
              v-for="item in statusmain"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option> </el-select
          >&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <div style="position: relative;display: inline-block;margin: 10px 0px;">
          <span>是否为会员立减商家：</span>
          <el-select
            v-model="vipPromotion"
            placeholder="请选择"
            style="width:150px;"
            @change="shopSelect()"
          >
            <el-option label="是" :value="1"></el-option>
            <el-option label="否" :value="0"></el-option>
          </el-select>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="shopSelect"
          >查询
        </el-button>
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="cleans2"
          >重置
        </el-button>
      </div>
      <div style="float: right;margin-right:2%;">
        <el-button
          :disabled="!isAuth('shopsList:add')"
          icon="document"
          size="mini"
          style="margin: 10px 0;"
          type="primary"
          @click="addNotice"
          >添加商铺</el-button
        >
      </div>
      <el-table
        v-loading="tableDataLoading"
        :data="typeDatas.list"
        row-key="id"
      >
        <el-table-column label="编号" prop="shopId" width="80" fixed="left">
        </el-table-column>
        <el-table-column label="名称" prop="shopName" fixed="left">
        </el-table-column>
        <el-table-column label="店铺手机号" prop="phone" width="120">
        </el-table-column>

        <el-table-column label="商铺类型" prop="shopTypeName">
        </el-table-column>
        <el-table-column prop="shopCover" label="封面图" width="150">
          <template slot-scope="scope">
            <div style="display: inline-block; margin: 3px;">
              <el-popover placement="top-start" title="" trigger="hover">
                <img
                  style="width: 50px; height: 50px"
                  :src="scope.row.shopCover"
                  alt=""
                  slot="reference"
                />
                <img
                  style="width: 300px; height: auto"
                  :src="scope.row.shopCover"
                  alt=""
                />
              </el-popover>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="shopBanner" label="轮播图" width="150">
          <template slot-scope="scope">
            <div
              v-for="(item, index) in scope.row.shopBanner"
              :key="index"
              style="display: inline-block; margin: 3px;"
            >
              <el-popover placement="top-start" title="" trigger="hover">
                <img
                  style="width: 50px; height: 50px"
                  :src="item"
                  alt=""
                  slot="reference"
                />
                <img style="width: 300px; height: auto" :src="item" alt="" />
              </el-popover>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="商铺佣金比例" prop="shopTypeName" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.shopRate ? scope.row.shopRate : 0 }}</span>
            <el-button
              size="mini"
              type="danger"
              style="color: #4f9dec;background: #fff;border: none;"
              :disabled="!isAuth('userList:updateMoney')"
              @click="rechargenone(scope.row, 3)"
              >修改佣金比例
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="营业状态" prop="putawayFlag">
          <template slot-scope="scope">
            <span>{{ scope.row.putawayFlag == 0 ? "上班啦" : "打烊啦" }}</span>
          </template>
        </el-table-column>

        <el-table-column label="商铺保证金" prop="cashDeposit" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.cashDeposit ? scope.row.cashDeposit : 0 }}</span>
            <el-button
              size="mini"
              type="danger"
              style="color: #4f9dec;background: #fff;border: none;"
              :disabled="!isAuth('userList:updateMoney')"
              @click="rechargenone(scope.row, 2)"
              >修改保证金
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="配送费" prop="errandMoney" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.errandMoney ? scope.row.errandMoney : 0 }}</span>
            <el-button
              size="mini"
              type="danger"
              style="color: #4f9dec;background: #fff;border: none;"
              :disabled="!isAuth('userList:updateMoney')"
              @click="rechargenone(scope.row, 1)"
              >修改配送费
            </el-button>
          </template>
        </el-table-column>
        <el-table-column
          label="配送距离"
          prop="distributionDistance"
          width="150"
        >
          <template slot-scope="scope">
            <span>{{
              scope.row.distributionDistance
                ? scope.row.distributionDistance
                : 0
            }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column label="是否减免配送费" prop="exemptErrandFlag">
					<template slot-scope="scope">
						<span>{{scope.row.exemptErrandFlag==0?'开启':'关闭'}}</span>
					</template>
				</el-table-column> -->
        <el-table-column label="减免配送费最低订单金额" prop="exemptMinMoney">
        </el-table-column>
        <el-table-column label="最低起送金额" prop="minimumDelivery">
        </el-table-column>
        <el-table-column label="是否开启满减" prop="enableFullReductionFlag">
          <template slot-scope="scope">
            <span>{{
              scope.row.enableFullReductionFlag == 0 ? "开启" : "关闭"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column label="是否开启平台配送" prop="autoSendOrder">
          <template slot-scope="scope">
            <span>{{ scope.row.autoSendOrder == 0 ? "开启" : "关闭" }}</span>
          </template>
        </el-table-column>
        <el-table-column label="是否开启自动接单" prop="autoAcceptOrder">
          <template slot-scope="scope">
            <span>{{ scope.row.autoAcceptOrder == 0 ? "开启" : "关闭" }}</span>
          </template>
        </el-table-column>
        <el-table-column label="商铺标签" prop="shopLable"> </el-table-column>
        <el-table-column label="开店时间" prop="businessHours">
        </el-table-column>
        <el-table-column label="闭店时间" prop="lockHours"> </el-table-column>
        <el-table-column label="商铺评分" prop="shopScore"> </el-table-column>
        <el-table-column label="商铺销量" prop="shopSales"> </el-table-column>
        <el-table-column label="打印机类型" prop="facility">
          <template slot-scope="scope">
            <span v-if="scope.row.facility == 1">飞鹅</span>
          </template>
        </el-table-column>
        <el-table-column label="设备sn编码" prop="snCode"> </el-table-column>
        <el-table-column label="设备key秘钥" prop="value"> </el-table-column>
        <el-table-column label="省" prop="province"> </el-table-column>
        <el-table-column label="市" prop="city"> </el-table-column>
        <el-table-column label="区" prop="district"> </el-table-column>
        <el-table-column label="详细地址" prop="detailedAddress" width="200">
        </el-table-column>
        <el-table-column label="经度" prop="shopLng"> </el-table-column>
        <el-table-column label="纬度" prop="shopLat"> </el-table-column>
        <el-table-column label="审核时间" prop="auditTime" width="160">
        </el-table-column>
        <el-table-column label="创建时间" prop="createTime" width="160">
        </el-table-column>
        <el-table-column label="商家公告" prop="shopNotice" width="150">
        </el-table-column>

        <el-table-column label="关联用户" prop="userId" width="150">
          <template slot-scope="scope">
            <span @click="goUserInfo(scope.row.userId)">{{
              scope.row.userId ? "查看" : "暂无"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="sort" label="排序" width="200">
          <template slot-scope="scope">
            <el-input-number
              size="mini"
              v-model="scope.row.sort"
              @change="paixuBtn(scope.row)"
            ></el-input-number>
          </template>
        </el-table-column>
        <el-table-column label="是否订阅消息配置" width="120">
          <template slot-scope="scope">
            <el-switch
              v-model="scope.row.messageConfiguration"
              @change="changeTj(scope.row)"
              :active-value="0"
              :inactive-value="1"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="是否供货商" width="120">
          <template slot-scope="scope">
            <el-switch
              v-model="scope.row.isSupplier"
              @change="changeTj(scope.row)"
              :active-value="0"
              :inactive-value="1"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="店铺二维码" width="100">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              @click="erweima(scope.row)"
              style="margin: 5px;"
              >查看
            </el-button>
          </template>
        </el-table-column>
        <el-table-column prop="isAllowShop" label="是否推荐" width="80">
          <template slot-scope="scope">
            <el-switch
              v-model="scope.row.isRecommend"
              @change="changeTj(scope.row)"
              :active-value="openValue"
              :inactive-value="closeValue"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column
          label="是否为会员立减商家"
          align="center"
          width="150"
          fixed="right"
        >
          <template slot-scope="scope">
            <!-- <div v-if="scope.row.vipPromotion == 1">是</div>
            <div v-else>否</div> -->
            <el-switch
              v-model="scope.row.vipPromotion"
              @change="changeLJ(scope.row)"
              :active-value="String(openValue)"
              :inactive-value="String(closeValue)"
              active-color="#13ce66"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column
          label="是否参加活动"
          align="center"
          width="120"
          fixed="right"
        >
          <template slot-scope="scope">
            <div v-if="scope.row.activityId">是</div>
            <div v-else>否</div>
            <!-- <el-button size="mini" style="color: #4f9dec;background: #fff;border: none;margin: 3px;"
							type="primary" v-if="scope.row.activityId" @click="looksHd(scope.row)">活动详情
						</el-button> -->
            <el-button
              size="mini"
              style="margin: 3px;"
              type="warning"
              @click="canjiaHd(scope.row)"
              :disabled="!isAuth('shopsList:huodongliebiao')"
              >活动列表
            </el-button>
          </template>
        </el-table-column>
        <el-table-column
          label="是否隐藏商家"
          align="center"
          width="120"
          fixed="right"
        >
          <template slot-scope="scope">
            <el-switch
              v-model="scope.row.isConceal"
              @change="isConcealChange(scope.row)"
              :active-value="1"
              :inactive-value="0"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="230" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              @click="shopsListAdmin(scope.row)"
              style="margin: 5px;"
            >
              商品列表
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="updateMima(scope.row)"
              style="margin: 5px;"
              >修改密码
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="shopsListOrder(scope.row)"
              style="margin: 5px;"
            >
              订单列表
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="updates(scope.$index, scope.row)"
              style="margin: 5px;"
              >修改信息
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="shopsListSr(scope.row)"
              style="margin: 5px;"
              >收入统计
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="shopsListQb(scope.row)"
              style="margin: 5px;"
              >商铺钱包
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="shopsListBzj(scope.row)"
              style="margin: 5px;"
            >
              保证金明细
            </el-button>
            <el-button
              size="mini"
              type="primary"
              @click="shopsListPJ(scope.row)"
              style="margin: 5px;"
              >评价明细
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="shopsListYhq(scope.row)"
              style="margin: 5px;"
              >优惠券管理
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:fengjin')"
              size="mini"
              type="danger"
              @click="fengjin(scope.row)"
              style="margin: 5px;"
              >{{ scope.row.bannedFlag == 1 ? "解封" : "封禁" }}
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:delete')"
              size="mini"
              type="danger"
              @click="deletes(scope.row)"
              style="margin: 5px;"
              >删除
            </el-button>

            <el-button
              size="mini"
              type="danger"
              style="margin: 5px;"
              @click="printSet(scope.row)"
              :disabled="!isAuth('shopsList:dayinpeizhi')"
            >
              打印配置
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[10, 20, 30, 50, 100]"
          :page-size="limit"
          :current-page="page"
          layout="total,sizes, prev, pager, next,jumper"
          :total="typeDatas.totalCount"
        >
        </el-pagination>
      </div>
    </el-tab-pane>
    <el-tab-pane label="商家类型" name="third">
      <div style="float: right;margin-right:2%;">
        <el-button
          style="margin: 10px 0;"
          :disabled="!isAuth('bannerList:add')"
          size="mini"
          type="primary"
          icon="document"
          @click="addNotice1(1)"
          >添加类型</el-button
        >
      </div>
      <el-table
        v-loading="tableDataLoading"
        :data="typeDatas1.list"
        row-key="id"
      >
        <el-table-column label="编号" prop="id" width="80"> </el-table-column>
        <el-table-column label="名称" prop="shopTypeName"> </el-table-column>
        <el-table-column label="操作" width="200">
          <template slot-scope="scope">
            <el-button
              :disabled="!isAuth('shopsList:update')"
              size="mini"
              type="primary"
              @click="addNotice1(scope.row)"
              style="margin: 5px;"
              >修改
            </el-button>
            <el-button
              :disabled="!isAuth('shopsList:delete')"
              size="mini"
              type="danger"
              @click="deletes1(scope.row)"
              style="margin: 5px;"
              >删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align: center;margin-top: 10px;float:right">
        <el-pagination
          @size-change="handleSizeChange1"
          @current-change="handleCurrentChange1"
          :page-sizes="[10, 20, 30, 50, 100]"
          :page-size="limit"
          :current-page="page"
          layout="total,sizes, prev, pager, next"
          :total="typeDatas1.totalCount"
        >
        </el-pagination>
      </div>
    </el-tab-pane>
    <!-- 添加商户 -->
    <el-dialog :visible.sync="dialogFormVisible" center :title="titles">
      <div style="margin-bottom: 10px;" v-if="titles == '添加'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >商铺用户：</span
        >
        <el-input
          v-model="shopUserName"
          placeholder="请选择用户"
          style="width:50%;"
          @focus="selectUserId"
        >
        </el-input>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '添加'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >店铺手机号：</span
        >
        <el-input
          v-model="shopPhone"
          placeholder="请输入店铺手机号"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >店铺名称：</span
        >
        <el-input
          v-model="shopName"
          placeholder="请输入店铺名称"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >店铺类型：</span
        >
        <el-select
          v-model="shopType"
          multiple
          clearable
          style="width:50%;"
          @change="shopTypeSelect"
        >
          <el-option
            v-for="item in typeDatas2"
            :key="item.id"
            :label="item.shopTypeName"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <!-- <div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">排序：</span>
				<el-input style="width:50%;" v-model="sort" type="number" min="0" placeholder="请输入排序"></el-input>
			</div> -->
      <div style="display: flex;align-items: center;margin: 2% 0;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >封面图：</span
        >
        <div
          style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;"
        >
          <el-upload
            class="avatar-uploader"
            v-model="shopCover"
            :action="Tupiantou"
            :show-file-list="false"
            :on-success="handleAvatarSuccess1"
            :before-upload="beforeAvatarUpload"
            :headers="{ token: token }"
          >
            <img
              v-if="shopCover"
              :src="shopCover"
              class="avatar"
              style="width: 148px;height: 148px;"
            />
            <i
              v-else
              class="el-icon-plus avatar-uploader-icon"
              style="font-size: 28px;color: #8c939d"
            ></i>
          </el-upload>
        </div>
      </div>
      <div style="margin-bottom: 10px;display:flex;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >轮播图：</span
        >
        <div class="imgs" v-for="(item, index) in img" :key="index">
          <img width="100%" class="images" height="100%" :src="item" alt="" />
          <span class="dels">
            <i class="el-icon-delete" @click="dels(index)"></i>
          </span>
        </div>
        <div class="imgs" style="width: 50%;">
          <el-upload
            :action="Tupiantou"
            list-type="picture-card"
            :show-file-list="false"
            :on-success="handleRemove"
            :on-progress="onprogress1"
            :headers="{ token: token }"
            :before-upload="beforeAvatarUpload"
          >
            <el-progress
              v-if="percentage1 > 0 && percentage1 < 100"
              type="circle"
              :percentage="percentage1"
            >
            </el-progress>
            <i v-else class="el-icon-plus"></i>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </div>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >商铺商户号：</span
        >
        <el-input
          v-model="mchId"
          placeholder="请输入商铺商户号"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >开店时间：</span
        >
        <!-- <el-input v-model="openTime" placeholder="请输入排序号" type="data" min="0" style="width:50%;"></el-input> -->
        <el-time-select
          v-model="openTime"
          :picker-options="{
            start: '00:00',
            step: '00:15',
            end: '24:00'
          }"
          placeholder="选择开店时间"
          style="width:50%;"
        >
        </el-time-select>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >闭店时间：</span
        >
        <!-- <el-input v-model="closeTime" placeholder="请输入排序号" type="data" min="0" style="width:50%;"></el-input> -->
        <el-time-select
          v-model="closeTime"
          :picker-options="{
            start: '00:00',
            step: '00:15',
            end: '24:00'
          }"
          placeholder="选择闭店时间"
          style="width:50%;"
        >
        </el-time-select>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >商铺标签：</span
        >
        <span class="bqList" v-for="(item, index) in labels" :key="index"
          >{{ item }}
          <span class="delss">
            <i class="el-icon-delete" @click="dels1(index)"></i>
          </span>
        </span>
        <el-input
          v-model="bq"
          style="width:200px;"
          placeholder="请输入标签"
          onkeyup="this.value=this.value.replace(/[, ]/g,'')"
          @keydown.enter.native="btnTj"
        ></el-input>
        <!-- <button class="tj" @click="btnTj">添加标签</button> -->
        <el-button
          type="primary"
          class="tj"
          size="mini"
          icon="el-icon-edit"
          circle
          @click="btnTj"
        >
        </el-button>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >店铺公告：</span
        >
        <el-input
          v-model="shopNotice"
          placeholder="请输入店铺公告"
          type="textarea"
          :rows="2"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >城市：</span
        >
        <el-cascader
          style="width:50%"
          size="large"
          :options="options"
          ref="cascaderAddr"
          v-model="storeAddress"
          :placeholder="storeAddre"
          @change="handleChange55"
          :value="storeAddre"
        >
        </el-cascader>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >店铺地址：</span
        >
        <el-input
          v-model="detailedAddress"
          @keydown.enter.native="phoneSelect"
          placeholder="请输入店铺地址"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >配送费：</span
        >
        <el-input
          v-model="errandMoney"
          placeholder="请输入配送费"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >配送距离：</span
        >
        <el-input
          v-model="distributionDistance"
          placeholder="请输入配送距离"
          type="text"
          style="width:50%;"
        >
        </el-input>
      </div>
      <!-- <div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">是否减免配送费：</span>
				<el-radio-group v-model="exemptErrandFlag" @change="onFlag">
					<el-radio :label="0">开启</el-radio>
					<el-radio :label="1">关闭</el-radio>
				</el-radio-group>
			</div> -->
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >减免配送费最低订单金额：</span
        >
        <el-input
          v-model="exemptMinMoney"
          placeholder="请输入减免配送费最低订单金额"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >最低起送金额：</span
        >
        <el-input
          v-model="minimumDelivery"
          placeholder="请输入最低起送金额"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >是否开启满减：</span
        >
        <el-radio-group v-model="enableFullReductionFlag">
          <el-radio :label="0">开启</el-radio>
          <el-radio :label="1">关闭</el-radio>
        </el-radio-group>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >是否开启平台配送：</span
        >
        <el-radio-group v-model="autoSendOrder">
          <el-radio :label="0">开启</el-radio>
          <el-radio :label="1">关闭</el-radio>
        </el-radio-group>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >是否开启自动接单：</span
        >
        <el-radio-group v-model="autoAcceptOrder">
          <el-radio :label="0">开启</el-radio>
          <el-radio :label="1">关闭</el-radio>
        </el-radio-group>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >是否开启预约单功能：</span
        >
        <el-radio-group v-model="reservationOpenFlag">
          <el-radio :label="1">开启</el-radio>
          <el-radio :label="0">关闭</el-radio>
        </el-radio-group>
      </div>

      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >打印机类型：</span
        >
        <el-radio-group v-model="facility">
          <el-radio :label="1">飞鹅</el-radio>
        </el-radio-group>
        <div style="font-size: 8px;color: red;margin-left: 200px;">
          * 一个设备只能关联一个商铺
        </div>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >设备sn编码：</span
        >
        <el-input
          v-model="snCode"
          placeholder="请输入设备sn编码"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >设备key秘钥：</span
        >
        <el-input
          v-model="value"
          placeholder="请输入设备key秘钥"
          type="text"
          style="width:50%;"
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;" v-if="titles == '修改'">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >营业状态：</span
        >
        <el-radio-group v-model="putawayFlag">
          <el-radio :label="0">上班啦</el-radio>
          <el-radio :label="1">打烊啦</el-radio>
        </el-radio-group>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >纬度：</span
        >
        <el-input
          v-model="latitude"
          style="width:50%;"
          placeholder="请输入纬度"
          disabled
        ></el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >经度：</span
        >
        <el-input
          v-model="longitude"
          style="width:50%;"
          placeholder="请输入经度"
          disabled
        ></el-input>
      </div>
      <div>
        <div
          id="container1"
          style="width:80%;height:500px;margin-left: 10%;"
        ></div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="releasNoticeTo()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 店铺二维码 -->
    <el-dialog :visible.sync="dialogFormVisible2" center title="店铺二维码">
      <div>
        <img :src="erweimaImg" style="width: 50%;margin-left: 25%;" />
        <div style="text-align: center;margin-top: 20px;">
          <el-button type="primary" @click="chakan()">打开窗口查看</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- 添加、修改类型 -->
    <el-dialog :visible.sync="dialogFormVisible3" center :title="titles1">
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >类型名称：</span
        >
        <el-input
          v-model="shopTypeName"
          placeholder="请输入类型名称"
          style="width:50%;"
        ></el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible3 = false">取 消</el-button>
        <el-button type="primary" @click="releasNoticeTo1()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 修改保证金 金额 -->
    <el-dialog title="修改金额" :visible.sync="dialogFormVisible4" center>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >修改类型：</span
        >
        <el-radio-group v-model="type">
          <el-radio :label="1">添加</el-radio>
          <el-radio :label="2">减少</el-radio>
        </el-radio-group>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >金额：</span
        >
        <el-input
          style="width:50%;"
          v-model="money"
          type="number"
          :min="0"
          :max="100"
          :controls="false"
          placeholder="请输入金额"
        ></el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible4 = false">取 消</el-button>
        <el-button type="primary" @click="StairNoticeTo1()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 修改佣金比例 -->
    <el-dialog title="修改佣金比例" :visible.sync="dialogFormVisible7" center>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >佣金比例：</span
        >
        <el-input
          style="width:50%;"
          v-model="money"
          type="number"
          :min="0"
          :max="100"
          :controls="false"
          placeholder="请输入佣金比例"
        ></el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible7 = false">取 消</el-button>
        <el-button type="primary" @click="StairNoticeToYj()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 修改配送费 金额 -->
    <el-dialog title="修改配送费" :visible.sync="dialogFormVisible6" center>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >配送费：</span
        >
        <el-input
          style="width:50%;"
          v-model="money"
          type="number"
          :min="0"
          :max="100"
          :controls="false"
          placeholder="请输入配送费"
        ></el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible6 = false">取 消</el-button>
        <el-button type="primary" @click="StairNoticeTo2()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 修改密码 -->
    <el-dialog title="修改密码" :visible.sync="dialogFormVisible5" center>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >新密码：</span
        >
        <el-input
          style="width:50%;"
          v-model="newPassword"
          type="password"
          :controls="false"
          placeholder="请输入新密码"
        >
        </el-input>
      </div>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;"
          >确认密码：</span
        >
        <el-input
          style="width:50%;"
          v-model="querenPassword"
          type="password"
          :controls="false"
          placeholder="请输入确认密码"
        >
        </el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible5 = false">取 消</el-button>
        <el-button type="primary" @click="updatePassword()">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 用户列表 -->
    <el-dialog title="用户列表" :visible.sync="dialogFormVisible11" center>
      <el-input
        style="width: 150px;"
        @keydown.enter.native="select11"
        clearable
        placeholder="请输入手机号"
        v-model="phone"
      >
      </el-input
      >&nbsp;&nbsp;&nbsp;&nbsp;
      <el-input
        style="width: 150px;"
        @keydown.enter.native="select11"
        clearable
        placeholder="请输入昵称"
        v-model="nickName"
      >
      </el-input>
      <div style="display: inline-block;">
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="select11"
          >查询
        </el-button>
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="cleans11"
          >重置
        </el-button>
      </div>
      <!-- <el-button style="margin-left:15px;"  size="mini" type="primary"
        icon="document" @click="closes2()">确定</el-button> -->
      <el-table
        v-loading="tableDataLoading11"
        :data="userData.list"
        :row-key="
          row => {
            return row.userId;
          }
        "
      >
        <!-- <el-table-column :reserve-selection="true" type="selection" fixed>
        </el-table-column> -->
        <el-table-column prop="userId" label="编号"> </el-table-column>
        <el-table-column fixed prop="nickName" label="昵称">
          <template slot-scope="scope">
            <span style="color: #f56c6c;">{{
              scope.row.nickName ? scope.row.nickName : "未设置"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column label="图像">
          <template slot-scope="scope">
            <img
              v-if="scope.row.avatar == null"
              src="~@/assets/img/avatar.png"
              alt=""
              width="40"
              height="40"
            />
            <img v-else :src="scope.row.avatar" alt="" width="40" height="40" />
          </template>
        </el-table-column>
        <el-table-column prop="phone" label="手机号" width="120">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              @click="closes11(scope.row)"
              >{{ scope.row.phone ? scope.row.phone : "未绑定" }}</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="platform" label="来源"> </el-table-column>
        <el-table-column prop="createTime" label="创建时间"> </el-table-column>
        <el-table-column prop="createTime" label="操作">
          <template slot-scope="scope">
            <el-button
              style="margin-left:15px;"
              size="mini"
              type="primary"
              icon="document"
              @click="closes2(scope.row)"
            >
              确定</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChange11"
          @current-change="handleCurrentChange11"
          :page-sizes="[10, 20, 30, 50]"
          :page-size="size11"
          :current-page="page11"
          layout="total,sizes, prev, pager, next,jumper"
          :total="userData.totalCount"
        >
        </el-pagination>
      </div>
    </el-dialog>

    <!-- 活动列表 -->
    <el-dialog
      title="活动列表"
      :visible.sync="dialogFormVisibleHd"
      center
      width="70%"
      @close="handleCancleHd"
    >
      <div style="margin:2% 0;display: inline-block;">
        <el-input
          style="width: 180px;"
          @keydown.enter.native="selectHd"
          clearable
          placeholder="请输入活动名称"
          v-model="integralName"
        ></el-input>
      </div>
      <div style="display: inline-block;">
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="selectHd"
          >查询
        </el-button>
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="cleansHs"
          >重置
        </el-button>
      </div>
      <el-table v-loading="tableDataLoadingHd" :data="huodongData">
        <el-table-column prop="id" label="编号" width="80"> </el-table-column>
        <el-table-column prop="title" label="活动名称" width="150">
        </el-table-column>
        <el-table-column prop="image" label="活动图片" width="200">
          <template slot-scope="scope">
            <div v-if="scope.row.image">
              <div
                v-for="(item, index) in scope.row.image.split(',')"
                :key="index"
                style="display: inline-block; margin: 3px;"
              >
                <el-popover placement="top-start" title="" trigger="hover">
                  <img
                    style="width: 50px; height: 50px"
                    :src="item"
                    alt=""
                    slot="reference"
                  />
                  <img style="width: 300px; height: auto" :src="item" alt="" />
                </el-popover>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="type" label="活动类型">
          <template slot-scope="scope">
            <span v-if="scope.row.type == 1">普通活动</span>
            <span v-else-if="scope.row.type == 2">时段优惠</span>
            <span v-else-if="scope.row.type == 3">满额优惠</span>
            <span v-else-if="scope.row.type == 4">全场优惠</span>
          </template>
        </el-table-column>
        <el-table-column prop="content" label="活动内容">
          <template slot-scope="scope">
            <el-popover placement="top-start" title="" trigger="hover">
              <div
                style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;"
                slot="reference"
              >
                {{ scope.row.content }}
              </div>
              <div style="width: 300px; height: auto;word-break: break-all;">
                {{ scope.row.content }}
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="updateTime" label="创建时间" width="160">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="100">
          <template slot-scope="scope">
            <el-button
              size="mini"
              v-if="scope.row.quantity == 0"
              type="primary"
              @click="querenBtnHd(scope.row)"
              style="margin: 3px;"
              >参加活动
            </el-button>
            <template v-else>
              <el-button size="mini" type="warn" disabled style="margin: 3px;"
                >已参加
              </el-button>
              <el-button
                size="mini"
                type="primary"
                style="margin: 3px;"
                v-if="scope.row.type == 3"
                @click="selectshangpin(scope.row)"
                >选择商品
              </el-button>
              <el-button
                size="mini"
                type="primary"
                style="margin: 3px;"
                @click="quitHuo(scope.row)"
                >退出活动
              </el-button>
            </template>
          </template>
        </el-table-column>
      </el-table>
      <!-- <div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeH" @current-change="handleCurrentChangeH"
					:page-sizes="[10, 15, 20, 25]" :page-size="limitH" :current-page="pageH"
					layout="total,sizes, prev, pager, next" :total="huodongData.length">
				</el-pagination>
			</div> -->
    </el-dialog>

    <!-- 活动详情 -->
    <el-dialog title="活动详情" :visible.sync="dialogFormVisibleXq" center>
      <div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动名称：</span
          >
          <span>{{ xiangqingData.activityTitle }}</span>
        </div>
        <div style="margin-bottom: 10px;" v-if="xiangqingData.activityImage">
          <div style="width: 200px;display: inline-block;text-align: right;">
            活动图片：
          </div>
          <div
            class="imgs"
            v-for="(item, index) in xiangqingData.activityImage.split(',')"
            :key="index"
          >
            <img width="100%" class="images" height="100%" :src="item" alt="" />
          </div>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动详情：</span
          >
          <div
            class="divs"
            v-html="xiangqingData.activityContent"
            style="margin-left: 200px;width: 50%;"
          ></div>
        </div>
      </div>
    </el-dialog>
    <!-- 参与活动弹框 -->
    <el-dialog title="参与活动" :visible.sync="dialogFormcanyuhuo" center>
      <div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动名称：</span
          >
          <span>{{ huoList.title }}</span>
        </div>
        <div style="margin-bottom: 10px;" v-if="huoList.image">
          <div style="width: 200px;display: inline-block;text-align: right;">
            活动图片：
          </div>
          <div
            class="imgs"
            v-for="(item, index) in huoList.image.split(',')"
            :key="index"
          >
            <img width="100%" class="images" height="100%" :src="item" alt="" />
          </div>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动详情：</span
          >
          <div
            class="divs"
            v-html="huoList.content"
            style="margin-left: 200px;width: 50%;"
          ></div>
        </div>
        <!-- <div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">参与活动的商品：</span>
					<span class="divs" style="width: 50%;color: rgba(62, 142, 247, 1);" @click="selectshangpin">请选择/修改</span>
				</div> -->
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动类型：</span
          >
          <span v-if="huoList.type == '1'">普通活动</span>
          <span v-if="huoList.type == '2'">时段优惠</span>
          <span v-if="huoList.type == '3'">满额优惠</span>
          <span v-if="huoList.type == '4'">全场优惠</span>
        </div>
        <div
          style="margin-bottom: 10px;"
          v-if="
            huoList.type == '2' || huoList.type == '3' || huoList.type == '4'
          "
        >
          <span style="width: 200px;display: inline-block;text-align: right;"
            >适用情况：</span
          >
          <el-radio v-model="suitType" :label="'1'">皆适用</el-radio><br />
          <div style="margin-left: 205px;width: 200px;">
            <el-radio v-model="suitType" :label="'2'"
              >仅针对第一次下单</el-radio
            >
          </div>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;"
            >活动时间：</span
          >
          <span>{{ huoList.startTime }}至{{ huoList.endTime }}</span>
        </div>
        <div
          style="margin-bottom: 10px;"
          v-if="
            huoList.type == '2' || huoList.type == '3' || huoList.type == '4'
          "
        >
          <span style="width: 200px;display: inline-block;text-align: right;"
            >使用限制：</span
          >
          <el-radio v-model="limitType" :label="'1'">无限制</el-radio><br />
          <div style="margin-left: 205px;">
            <el-radio v-model="limitType" :label="'2'">每天使用</el-radio>
            <el-input
              v-model="limitNum"
              type="number"
              style="width:13%;display: inline-table;"
            ></el-input>
            <span>次</span>
          </div>
        </div>
        <div style="margin-bottom: 10px;">
          <div class="canquxiao" @click="joinHuo">确定</div>
          <div class="canqueding" @click="quxiaoHuo">取消</div>
        </div>
      </div>
    </el-dialog>

    <!-- 选择活动商品弹框 -->
    <el-dialog
      title="优惠商品"
      :visible.sync="dialogFormVisibleshangp"
      center
      width="70%"
      @close="handleCancleshangp"
    >
      <div style="margin:2% 0;display: inline-block;">
        <span>商品名称：</span>
        <el-input
          style="width: 180px;"
          @keydown.enter.native="select2"
          clearable
          placeholder="请输入商品名称"
          v-model="integralName2"
        ></el-input>
      </div>
      <div style="display: inline-block;">
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="select2"
          >查询
        </el-button>
      </div>
      <div style="display: inline-block;">
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="yiselect()"
          >已选择商品
        </el-button>
      </div>
      <el-table
        v-loading="tableDataLoadingShop"
        :data="shopData.list"
        ref="dataTable"
        :key="randomKey"
        @select="selectdan"
        @select-all="selectAll"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="编号" prop="goodsId" width="80" fixed="left">
        </el-table-column>
        <el-table-column label="标题" prop="goodsName" fixed="left">
        </el-table-column>
        <el-table-column prop="goodsCover" label="商品图" width="150">
          <template slot-scope="scope">
            <div style="display: inline-block; margin: 3px;">
              <el-popover placement="top-start" title="" trigger="hover">
                <img
                  style="width: 50px; height: 50px"
                  :src="scope.row.goodsCover"
                  alt=""
                  slot="reference"
                />
                <img
                  style="width: 300px; height: auto"
                  :src="scope.row.goodsCover"
                  alt=""
                />
              </el-popover>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="商品描述" prop="goodsDescribe" width="120">
        </el-table-column>
        <el-table-column label="创建时间" prop="createTime"> </el-table-column>
      </el-table>
      <el-button
        style="margin-left:15px;margin-top: 10px;"
        size="mini"
        type="primary"
        icon="document"
        @click="tianjiahuo"
        >确定
      </el-button>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChangeShop"
          @current-change="handleCurrentChangeShop"
          :page-sizes="[10, 15, 20, 25]"
          :page-size="limit1"
          :current-page="page1"
          layout="total,sizes, prev, pager, next"
          :total="shopData.totalCount"
        >
        </el-pagination>
      </div>
    </el-dialog>

    <!-- 已选择商品 -->
    <el-dialog
      title="已选择商品"
      :visible.sync="dialogFormVisibleshangpYi"
      center
      width="70%"
    >
      <el-table v-loading="tableDataLoadingShopYi" :data="shopDataYi">
        <el-table-column label="编号" prop="goodsId" width="80" fixed="left">
        </el-table-column>
        <el-table-column label="标题" prop="goodsName" fixed="left">
        </el-table-column>
        <el-table-column prop="goodsCover" label="商品图" width="150">
          <template slot-scope="scope">
            <div style="display: inline-block; margin: 3px;">
              <el-popover placement="top-start" title="" trigger="hover">
                <img
                  style="width: 50px; height: 50px"
                  :src="scope.row.goodsCover"
                  alt=""
                  slot="reference"
                />
                <img
                  style="width: 300px; height: auto"
                  :src="scope.row.goodsCover"
                  alt=""
                />
              </el-popover>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="商品描述" prop="goodsDescribe" width="120">
        </el-table-column>
        <el-table-column label="创建时间" prop="createTime"> </el-table-column>
      </el-table>
      <!-- <div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeShop2" @current-change="handleCurrentChangeShop2"
					:page-sizes="[10, 15, 20, 25]" :page-size="limit2" :current-page="page2"
					layout="total,sizes, prev, pager, next" :total="shopTotal">
				</el-pagination>
			</div> -->
    </el-dialog>
  </el-tabs>
</template>

<script>
import Vue from "vue";
import { jsonp } from "vue-jsonp";
import {
  provinceAndCityData,
  regionData,
  provinceAndCityDataPlus,
  regionDataPlus,
  CodeToText,
  TextToCode
} from "element-china-area-data";
var geocoder,
  map,
  markersArray = [];
export default {
  data() {
    return {
      token: "",
      routeFlag: true,
      phone: "",
      nickName: "",
      limit: 10,
      page: 1,
      limit1: 10,
      page1: 1,
      limit2: 10,
      page2: 1,
      size11: 10,
      page11: 1,
      shopName1: "",
      isActivity: "",
      vipPromotion:"",
      region: "",
      shopId: "",
      userIdList: "",
      shopName: "",
      shopNotice: "",
      userData: [], //用户集合
      openTime: "",
      closeTime: "",
      detailedAddress: "",
      shopLng: "",
      shopLat: "",
      percentage1: 0, //进度条
      img: [], //任务轮播图
      // img: '',
      classn: "",
      value: "",
      parentId: 0,
      parentIdnum: "",

      tableDataLoading: false,
      dialogFormVisible1: false,
      dialogFormVisible2: false,
      dialogFormVisible3: false,
      tableDataLoading11: false,
      dialogFormVisible: false,
      dialogFormVisible11: false, //用户列表
      typeDatas: {},
      typeDatas1: {},
      titles: "添加",
      // 地图相关
      longitude: "", //维度
      latitude: "", //经度
      loadingMap: true,
      BMap: "",
      map: "",
      geoc: "",
      keyword: "",
      showMap: false,
      pointLngLat: "",
      center: {
        lng: 109.45744048529967,
        lat: 36.49771311230842
      },
      storeAddress: [],
      storeAddre: "请选择城市",
      form: {
        province: "",
        city: "", //市
        district: "" //区
      },
      dialogImageUrl: [],
      dialogVisible: false,
      erweimaImg: "",
      activeName: "first",
      shopTypeName: "",
      shopTypId: "",
      titles1: "",
      labels: [], //标签集合
      bq: "", //输入的标签名
      province: "",
      city: "", //市
      district: "", //区
      options: regionData,
      shopCover: "",
      shopTypenum: [],
      typeDatas2: [],
      shopType: "",

      type: "",
      money: "",
      classIndex: "",
      dialogFormVisible4: false,
      dialogFormVisible5: false,
      dialogFormVisible6: false,
      dialogFormVisible7: false,
      tablemoney: 0,
      dataForm: {
        id: 0,
        userName: "",
        password: "",
        comfirmPassword: "",
        salt: "",
        email: "",
        mobile: "",
        roleIdList: [],
        shopIdList: [],
        status: 1
      },
      newPassword: "",
      querenPassword: "",
      bannedFlag: "",
      exemptErrandFlag: 1, //是否见面配送费0开启 1关闭
      errandMoney: 0,
      exemptMinMoney: 0,
      minimumDelivery: 0,
      enableFullReductionFlag: 1,
      autoSendOrder: 1,
      autoAcceptOrder: 1,
      reservationOpenFlag: 0,
      sort: 1,
      putawayFlag: 1,
      distributionDistance: 3000,
      facility: 1,
      shopUserId: "",
      shopUserName: "",
      mchId: "", // 商铺商户号
      shopPhone: "", //商户关联手机号
      snCode: "",

      dialogFormVisibleHd: false,
      dialogFormVisibleXq: false,
      dialogFormcanyuhuo: false,
      dialogFormVisibleshangp: false, //优惠商品选择弹框
      dialogFormVisibleshangpYi: false, //已选择商品弹框
      selectedItems: [], //存储选中的数组
      randomKey: Math.random(),
      suoshoplength: 0, //所有商品数量
      shopTotal: 0,
      shopDataYi: [], //已选择商品
      shopData: {},
      tableDataLoadingShop: false,
      tableDataLoadingShopYi: false,
      tableDataLoadingHd: false,
      huodongData: [],
      limitH: 10,
      pageH: 1,
      integralName: "",
      integralName2: "",
      xiangqingData: {},
      statusmain: [
        {
          value: "",
          label: "全部"
        },
        {
          value: 0,
          label: "否"
        },
        {
          value: 1,
          label: "是"
        }
      ],
      openValue: 1,
      closeValue: 0,
      activityId: "",
      // 参与活动参数
      huoList: {},
      suitType: "1", //适用情况
      limitType: "1", //使用限制
      limitNum: "",
      actShopid: [] //选择商品的id
    };
  },
  methods: {
    // tabs切换
    handleClick(tab, event) {
      this.page = 1;
      this.limit = 10;
      if (tab._props.label == "商铺列表") {
        this.dataSelect();
      }
      if (tab._props.label == "商家类型") {
        this.dataSelect1();
      }
    },

    //用户模块的分页处理
    handleSizeChange11(val) {
      this.size11 = val;
      this.dataSelect11();
    },
    //用户模块的分页处理
    handleCurrentChange11(val) {
      this.page11 = val;
      this.dataSelect11();
    },

    handleSizeChange(val) {
      this.limit = val;
      this.dataSelect();
    },
    handleCurrentChange(val) {
      this.page = val;
      this.dataSelect();
    },
    //活动列表
    handleSizeChangeH(val) {
      this.limitH = val;
      this.shopSelect2();
    },
    handleCurrentChangeH(val) {
      this.pageH = val;
      this.shopSelect2();
    },
    handleSizeChange1(val) {
      this.limit = val;
      this.dataSelect1();
    },
    handleCurrentChange1(val) {
      this.page = val;
      this.dataSelect1();
    },
    // 图标上传
    handleAvatarSuccess(file) {
      this.img = file.data;
    },
    // 添加店铺
    addNotice() {
      this.titles = "添加";
      this.shopId = "";
      this.mchId = "";
      this.shopName = "";
      this.shopNotice = "";
      this.shopType = "";
      this.openTime = "";
      this.closeTime = "";
      this.shopCover = "";
      this.dialogImageUrl = [];
      this.img = [];
      this.detailedAddress = "";
      this.shopLng = "";
      this.shopLat = "";
      this.longitude = ""; //维度
      this.latitude = ""; //经度
      this.bannedFlag = "";
      this.errandMoney = 0;
      this.exemptErrandFlag = 1;
      this.facility = 1;
      this.snCode = "";
      this.value = "";
      this.distributionDistance = 3000;
      this.exemptMinMoney = 0;
      this.minimumDelivery = 0;
      this.enableFullReductionFlag = 1;
      this.autoSendOrder = 1;
      this.autoAcceptOrder = 1;
      this.reservationOpenFlag = 0;
      this.sort = 1;
      this.putawayFlag = 1;
      this.labels = [];
      this.shopPhone = "";
      this.shopUserId = "";
      this.shopUserName = "";
      this.storeAddress = [];
      this.storeAddre = "请选择城市";
      this.dialogFormVisible = true;
      this.getMyLocation();
    },

    // 获取用户数据列表
    dataSelect11() {
      let phone = -1;
      if (this.phone) {
        phone = this.phone;
      }
      this.tableDataLoading11 = true;
      this.$http({
        url: this.$http.adornUrl("user/selectUserList"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page11,
          limit: this.size11,
          shopAdminFlag: "",
          phone: this.phone,
          userName: this.nickName,
          type: ""
        })
      }).then(({ data }) => {
        this.tableDataLoading11 = false;
        let returnData = data.data;
        this.userData = returnData;
      });
    },
    // 查询
    select11() {
      this.page11 = 1;
      this.dataSelect11();
    },
    //查看用户
    selectUserId() {
      this.dialogFormVisible11 = true;
      this.page11 = 1;
      this.phone = "";
      this.nickName = "";
      this.dataSelect11();
    },

    closes11(item) {
      this.shopUserId = item.userId;
      this.shopUserName = item.userName;
      this.dialogFormVisible11 = false;
    },
    // 重置
    cleans11() {
      this.page11 = 1;
      this.phone = "";
      this.nickName = "";
      this.dataSelect11();
    },
    // 添加店铺
    releasNoticeTo() {
      if (this.shopUserId == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入选择关联用户",
          type: "warning"
        });
        return;
      }
      if (this.shopPhone == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入商户关联手机号",
          type: "warning"
        });
        return;
      }
      if (this.shopName == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入店铺名称",
          type: "warning"
        });
        return;
      }
      if (this.shopType == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请选择店铺类型",
          type: "warning"
        });
        return;
      }

      if (this.openTime == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请选择开店时间",
          type: "warning"
        });
        return;
      }
      if (this.closeTime == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请选择闭店时间",
          type: "warning"
        });
        return;
      }
      if (this.detailedAddress == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入店铺地址",
          type: "warning"
        });
        return;
      }
      if (this.img.length == 0) {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "轮播图不能为空",
          type: "warning"
        });
        return;
      }

      if (this.errandMoney == "") {
        this.errandMoney = 0;
      }
      if (this.minimumDelivery == "") {
        this.minimumDelivery = 0;
      }
      if (this.exemptMinMoney == "") {
        this.exemptMinMoney = 0;
      }

      if (this.longitude == "" || this.latitude == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请在地图上定位获取经纬度",
          type: "warning"
        });
        return;
      }
      var datas = {};
      datas.shopName = this.shopName;
      datas.mchId = this.mchId;
      datas.businessHours = this.openTime;
      datas.shopBanner = this.img.toString();
      datas.lockHours = this.closeTime;
      datas.detailedAddress = this.detailedAddress;
      datas.errandMoney = this.errandMoney;
      datas.exemptErrandFlag = this.exemptErrandFlag;
      datas.shopNotice = this.shopNotice;
      datas.facility = this.facility;
      datas.snCode = this.snCode;
      datas.value = this.value;
      datas.distributionDistance = this.distributionDistance;
      datas.exemptMinMoney = this.exemptMinMoney;
      datas.minimumDelivery = this.minimumDelivery;
      datas.enableFullReductionFlag = this.enableFullReductionFlag;
      datas.autoSendOrder = this.autoSendOrder;
      datas.autoAcceptOrder = this.autoAcceptOrder;
      datas.reservationOpenFlag = this.reservationOpenFlag;
      datas.sort = this.sort;
      datas.putawayFlag = this.putawayFlag;
      datas.shopLng = this.longitude;
      datas.shopLat = this.latitude;
      datas.shopCover = this.shopCover;
      datas.city = this.city;
      datas.province = this.province;
      datas.district = this.district;
      datas.userId = this.shopUserId;
      datas.phone = this.shopPhone;

      // datas.isSupplier=1; // 是否为供货商
      // datas.shopTypeId = this.shopType;
      datas.shopTypeId = this.shopType.join(","); // 店铺类型改为多选
      datas.shopLable = this.labels.toString();
      datas.bannedFlag = this.bannedFlag;
      // datas.reservation0penFlag='1'

      if (this.titles == "添加") {
        var url = "admin/goods/insertGoodsShop";
      }
      if (this.titles == "修改") {
        var url = "admin/goods/updateGoodsShop";
        datas.shopId = this.shopId;
      }
      console.log(datas, "jjkkk");
      this.$http({
        url: this.$http.adornUrl(url),
        method: "post",
        data: this.$http.adornData(datas)
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormVisible = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    // 修改弹框
    updates(index, rows) {
      console.log(rows, "dfsf");

      this.titles = "修改";
      this.shopId = rows.shopId;
      this.shopName = rows.shopName;
      this.mchId = rows.mchId;
      if (rows.shopNotice) {
        this.shopNotice = rows.shopNotice;
      } else {
        this.shopNotice = "";
      }

      if (rows.shopBanner) {
        this.dialogImageUrl = rows.shopBanner;
        this.img = rows.shopBanner;
      }
      if (rows.shopLable) {
        this.labels = rows.shopLable.split(",");
      }
      this.openTime = rows.businessHours;
      this.closeTime = rows.lockHours;
      this.detailedAddress = rows.detailedAddress;
      this.shopLng = rows.shopLng;
      this.shopLat = rows.shopLat;
      this.longitude = rows.shopLng; //维度
      this.latitude = rows.shopLat; //经度
      this.shopCover = rows.shopCover;
      this.city = rows.city;
      this.province = rows.province;
      this.district = rows.district;
      // this.shopType = rows.shopTypeId;
      if (rows.shopTypeId) {
        this.shopType = rows.shopTypeId.split(",").map(i => {
          return Number(i);
        }); // 店铺类型改为多选
      }

      this.bannedFlag = rows.bannedFlag;
      if (rows.errandMoney) {
        this.errandMoney = rows.errandMoney;
      } else {
        this.errandMoney = 0;
      }
      if (rows.exemptMinMoney) {
        this.exemptMinMoney = rows.exemptMinMoney;
      } else {
        this.exemptMinMoney = 0;
      }

      this.minimumDelivery = rows.minimumDelivery;
      this.shopPhone = rows.phone;
      this.shopUserId = rows.userId;

      if (rows.facility) {
        this.facility = rows.facility;
      }
      console.log(rows, "mmm");
      this.snCode = rows.snCode;
      this.value = rows.value;
      if (rows.exemptErrandFlag) {
        this.exemptErrandFlag = rows.exemptErrandFlag;
      }

      if (rows.enableFullReductionFlag != null) {
        this.enableFullReductionFlag = rows.enableFullReductionFlag;
        console.log(
          "rows.enableFullReductionFlag",
          rows.enableFullReductionFlag
        );
      } else {
        this.enableFullReductionFlag = 1;
      }
      if (rows.autoSendOrder != null) {
        this.autoSendOrder = rows.autoSendOrder;
        console.log("rows.autoSendOrder", rows.autoSendOrder);
      } else {
        this.autoSendOrder = 1;
      }
      if (rows.autoAcceptOrder != null) {
        this.autoAcceptOrder = rows.autoAcceptOrder;
        console.log("rows.autoAcceptOrder", rows.autoAcceptOrder);
      } else {
        this.autoAcceptOrder = 1;
      }
      if (rows.reservationOpenFlag != null) {
        this.reservationOpenFlag = rows.reservationOpenFlag;
        console.log("rows.reservationOpenFlag", rows.reservationOpenFlag);
      } else {
        this.reservationOpenFlag = 1;
      }
      if (rows.sort != null) {
        this.sort = rows.sort;
      } else {
        this.sort = 1;
      }

      // if(rows.exemptErrandFlag==1){
      // 	this.exemptMinMoney = 0
      // }
      this.putawayFlag = rows.putawayFlag;
      this.distributionDistance = rows.distributionDistance;
      this.storeAddress = [];
      this.storeAddre = this.province + "/" + this.city + "/" + this.district;
      // console.log(this.province + '/' + this.city + '/' + this.district)
      this.getMyLocation();
      this.dialogFormVisible = true;
    },
    // 查看二维码
    erweima(row) {
      console.log("row.shopId", row.shopId);
      this.dialogFormVisible2 = true;
      this.erweimaImg = this.$http.adornUrl(
        "invite/shopQr?shopId=" + row.shopId
      );
    },
    chakan() {
      window.open(this.erweimaImg, "_blank");
    },
    // 删除分类
    deletes(row) {
      // if (row.children == null || row.children.length == 0) {
      this.$confirm(`确定删除此条信息?删除后将无法恢复`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("admin/goods/deleteGoodsShop"),
            method: "get",
            params: this.$http.adornParams({
              id: row.shopId
            })
          }).then(({ data }) => {
            this.$message({
              message: "删除成功",
              type: "success",
              duration: 1500,
              onClose: () => {
                this.dataSelect();
              }
            });
          });
        })
        .catch(() => {});
      // } else {
      //   this.$message({
      //     message: '请先删除',
      //     type: 'error',
      //     duration: 1500,
      //   })
      //   return
      // }
    },
    // 打印配置
    printSet(row) {
      // console.log(row,'打印');
      this.$router.push({
        path: "/shopPrintSet",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 封禁
    fengjin(row) {
      if (row.bannedFlag == 1) {
        var bannedFlag = 0;
        var texts = "确定要解封此商铺吗?";
      } else {
        var bannedFlag = 1;
        var texts = "确定要封禁此商铺吗?";
      }

      this.$confirm(texts, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("admin/goods/updateGoodsShop"),
            method: "post",
            data: this.$http.adornData({
              shopId: row.shopId,
              bannedFlag: bannedFlag
            })
          }).then(({ data }) => {
            this.$message({
              message: "操作成功",
              type: "success",
              duration: 1500,
              onClose: () => {
                this.dataSelect();
              }
            });
          });
        })
        .catch(() => {});
    },

    //查看用户详情
    goUserInfo(userId) {
      if (userId) {
        this.$router.push({
          path: "/userDetail",
          query: {
            userId
          }
        });
      }
    },

    // 商品列表
    shopsListAdmin(row) {
      this.$router.push({
        path: "/shopsListAdmin",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 订单列表
    shopsListOrder(row) {
      this.$router.push({
        path: "/shopsOrder",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 收入统计
    shopsListSr(row) {
      this.$router.push({
        path: "/shopDatas",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 保证金明细
    shopsListBzj(row) {
      this.$router.push({
        path: "/bondList",
        query: {
          shopId: row.shopId
        }
      });
    },

    // 评价明细
    shopsListPJ(row) {
      this.$router.push({
        path: "/pingjiaList",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 商铺钱包
    shopsListQb(row) {
      this.$router.push({
        path: "/shopWallet",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 优惠券管理
    shopsListYhq(row) {
      this.$router.push({
        path: "/couponShop",
        query: {
          shopId: row.shopId
        }
      });
    },
    // 获取商户数据
    dataSelect() {
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("admin/goods/selectAllShop"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit,
          shopName: this.shopName1,
          region: this.region,
          isActivity: this.isActivity,
          vipPromotion:this.vipPromotion
        })
      }).then(({ data }) => {
        let canshu = {
          page: this.page,
          limit: this.limit,
          shopName1: this.shopName1,
          region: this.region,
          isActivity: this.isActivity
        };
        sessionStorage.setItem("shopsList", JSON.stringify(canshu));

        this.tableDataLoading = false;
        for (var i in data.data.list) {
          if (data.data.list[i].shopBanner) {
            data.data.list[i].shopBanner = data.data.list[i].shopBanner.split(
              ","
            );
          }
          data.data.list[i].isConceal == 1 ? 1 : 0;
        }
        let returnData = data.data;
        this.typeDatas = returnData;
        console.log(this.typeDatas, "ll");
      });
    },
    //定位获得当前位置信息
    getMyLocation() {
      var geolocation = new qq.maps.Geolocation(
        "ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75",
        "来点小收入"
      );
      geolocation.getIpLocation(this.showPosition, this.showErr);
      // geolocation.getLocation(this.showPosition, this.showErr);//或者用getLocation精确度比较高
    },
    showPosition(position) {
      console.log(position);
      // this.latitude = position.lat;
      // this.longitude = position.lng;
      // this.city = position.city;
      this.setMap();
    },
    showErr(e) {
      console.log("定位失败", e);
      this.getMyLocation(); //定位失败再请求定位，测试使用
    },
    //位置信息在地图上展示
    setMap() {
      //步骤：定义map变量 调用 qq.maps.Map() 构造函数   获取地图显示容器
      //设置地图中心点
      var myLatlng = new qq.maps.LatLng(this.latitude, this.longitude);
      //定义工厂模式函数
      var myOptions = {
        zoom: 13, //设置地图缩放级别
        center: myLatlng, //设置中心点样式
        mapTypeId: qq.maps.MapTypeId.ROADMAP //设置地图样式详情参见MapType
      };
      // //获取dom元素添加地图信息
      var map = new qq.maps.Map(
        document.getElementById("container1"),
        myOptions
      );
      //给地图添加点击事件

      //给定位的位置添加图片标注
      var marker = new qq.maps.Marker({
        position: myLatlng,
        map: map
      });
      // `````````````
      var that = this;
      if (that.longitude == "") {
        var center = new qq.maps.LatLng(34.34281541842994, 108.93970884382725);
      } else {
        var center = new qq.maps.LatLng(that.latitude, that.longitude);
      }

      var map = new qq.maps.Map(document.getElementById("container1"), {
        center: center,
        zoom: 13
      });
      var marker = new qq.maps.Marker({
        position: center,
        map: map
      });
      var latlngBounds = new qq.maps.LatLngBounds();
      qq.maps.event.addListener(map, "click", function(event) {
        console.log(event, qq.maps);
        that.longitude = event.latLng.getLng(); // 经度
        that.latitude = event.latLng.getLat(); // 纬度
        jsonp(
          "https://apis.map.qq.com/ws/geocoder/v1/?location=" +
            event.latLng.getLat() +
            "," +
            event.latLng.getLng() +
            "&key=ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75&get_poi=1&output=jsonp",
          {
            myCustomUrlParam: "veryNice"
          }
        )
          .then(response => {
            console.log(
              "response",
              response,
              response.result.formatted_addresses.recommend
            );
            that.detailedAddress =
              response.result.formatted_addresses.recommend;
          })
          .catch(error => {
            // handle error
          })
          .then(() => {
            // always executed
          });
        if (markersArray) {
          for (let i in markersArray) {
            markersArray[i].setMap(null);
          }
        }
        var marker = new qq.maps.Marker({
          map: map,
          position: event.latLng
        });
        markersArray.push(marker);
      });
      geocoder = new qq.maps.Geocoder({
        complete: function(result) {
          console.log(result);
          that.longitude = result.detail.location.lng;
          that.latitude = result.detail.location.lat;
          map.setCenter(result.detail.location);
          var marker = new qq.maps.Marker({
            map: map,
            position: result.detail.location
          });
          markersArray.push(marker);
        }
      });
    },
    // 地图定位
    select() {
      console.log(this.detailedAddress);
      // this.address = this.province+ this.city+this.district+this.address
      var addr =
        this.province + this.city + this.district + this.detailedAddress;
      let that = this;
      jsonp(
        "https://apis.map.qq.com/ws/geocoder/v1/?address==" +
          addr +
          "&key=ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75&get_poi=1&output=jsonp",
        {
          myCustomUrlParam: "veryNice"
        }
      )
        .then(response => {
          // handle success
          console.log("response", response);
          that.longitude = response.result.location.lng; // 经度
          that.latitude = response.result.location.lat; // 纬度
          // that.address = response.result.title
          that.setMap();
        })
        .catch(error => {
          // handle error
        })
        .then(() => {
          // always executed
        });
    },
    phoneSelect() {
      this.select();
    },
    onprogress1(event, file, fileList) {
      console.log("详情图上传进度", parseInt(event.percent));
      this.percentage1 = parseInt(event.percent);
    },
    beforeAvatarUpload(file) {
      return this.$processImage(this, file, false);
    },
    // 封面图
    handleAvatarSuccess1(file, fileList) {
      this.shopCover = file.data;
    },
    // 轮播图片上传
    handleRemove(file) {
      console.log(file, this.img);
      this.img.push(file.data);
    },
    handleDownload(file) {
      console.log(file, this.img);
    },
    // 删除轮播图
    dels(index) {
      this.img.splice(index, 1);
      console.log(this.img);
    },
    shopSelect() {
      this.page = 1;
      this.dataSelect();
    },
    cleans2(state) {
      this.page = 1;
      this.shopName1 = "";
      this.region = "";
      this.isActivity = "";
      this.vipPromotion="";
      this.dataSelect();
    },
    // 获取分类数据
    dataSelect1() {
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("admin/shoptype/selectShopTypeList"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit
        })
      }).then(({ data }) => {
        this.tableDataLoading = false;
        let returnData = data.data;
        this.typeDatas1 = returnData;
      });
    },
    // 获取分类数据不带分页
    dataSelect2() {
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("admin/shoptype/selectShopTypeList"),
        method: "get",
        params: this.$http.adornParams({})
      }).then(({ data }) => {
        this.tableDataLoading = false;
        let returnData = data.data;
        this.typeDatas2 = returnData;
        console.log(this.typeDatas2, "店铺数据");
      });
    },
    // 添加类型
    addNotice1(row) {
      if (row != 1) {
        this.titles1 = "修改类型";
        this.shopTypId = row.id;
        this.shopTypeName = row.shopTypeName;
      } else {
        this.titles1 = "添加类型";
        this.shopTypId = "";
        this.shopTypeName = "";
      }
      this.dialogFormVisible3 = true;
    },
    // 确认添加
    releasNoticeTo1() {
      if (this.shopTypeName == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入类型名称",
          type: "warning"
        });
        return;
      }
      if (this.titles1 == "添加类型") {
        var url = "admin/shoptype/insertShopType";
      }
      if (this.titles1 == "修改类型") {
        var url = "admin/shoptype/upateShopType";
      }
      this.$http({
        url: this.$http.adornUrl(url),
        method: "post",
        data: this.$http.adornData({
          id: this.shopTypId,
          shopTypeName: this.shopTypeName
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormVisible3 = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect1();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    // 删除类型
    deletes1(row) {
      this.$confirm(`确定删除此条信息?删除后将无法恢复`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("admin/shoptype/deleteShopType"),
            method: "post",
            params: this.$http.adornParams({
              shopTypeId: row.id
            })
          }).then(({ data }) => {
            if (data.code == 0) {
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.dataSelect1();
                }
              });
            } else {
              this.$message({
                message: data.msg,
                type: "warning",
                duration: 1500,
                onClose: () => {}
              });
            }
          });
        })
        .catch(() => {});
    },
    // 添加标签
    btnTj() {
      if (this.bq == "" || this.bq == " ") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入标签名",
          type: "warning"
        });
        return;
      } else {
        console.log("this.bq", this.bq);
        this.labels.push(this.bq);
        this.bq = "";
      }
    },
    // 删除标签
    dels1(index) {
      this.labels.splice(index, 1);
      console.log(this.labels);
    },
    // 获取省市区
    handleChange55(value) {
      value = this.$refs["cascaderAddr"].currentLabels;
      this.province = value[0];
      this.city = value[1];
      this.district = value[2];
      if (this.city == "市辖区") {
        this.city = this.province;
      }
      console.log(this.$refs["cascaderAddr"].currentLabels);
    },
    shopTypeSelect(val) {
      console.log(val);
    },
    // 修改保证金
    rechargenone(row, index) {
      this.shopId = row.shopId;
      if (index == 2) {
        this.type = "";
        this.money = 0;
        this.tablemoney = row.cashDeposit;
        this.dialogFormVisible4 = true;
      }
      if (index == 1) {
        this.bannedFlag = row.bannedFlag;
        this.money = row.errandMoney;
        this.dialogFormVisible6 = true;
      }
      if (index == 3) {
        this.bannedFlag = row.bannedFlag;
        this.money = row.shopRate;
        this.dialogFormVisible7 = true;
      }
    },
    StairNoticeTo2() {
      if (this.money == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入金额",
          type: "warning"
        });
        return;
      }
      this.money = Number(this.money);
      this.$http({
        url: this.$http.adornUrl("admin/goods/updateGoodsShop"),
        method: "post",
        data: this.$http.adornData({
          shopId: this.shopId,
          errandMoney: this.money,
          bannedFlag: this.bannedFlag
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.$message({
            message: "添加金额成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.money = "";
              this.dataSelect();
            }
          });
          this.dialogFormVisible6 = false;
        } else {
          this.$message.error(data.msg);
        }
      });
    },
    StairNoticeTo1() {
      let userId = this.$route.query.userId;
      if (this.type == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请选择修改类型",
          type: "warning"
        });
        return;
      }

      if (this.money == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入金额",
          type: "warning"
        });
        return;
      }
      if (this.type == 2) {
        if (this.money > this.tablemoney) {
          this.$notify({
            title: "提示",
            duration: 1800,
            message: "最高金额为" + this.tablemoney,
            type: "warning"
          });
          return;
        }
      }
      this.$http({
        // url: this.$http.adornUrl(
        //   `admin/shop/updateShopCashDeposit?shopId=` +
        //     this.shopId +
        //     "&money=" +
        //     this.money +
        //     "&type=" +
        //     this.type
        // ),
        url: this.$http.adornUrl(
          `admin/shop/updateShopCashDeposit`
        ),
        method: "get",
        data: this.$http.adornData({}),
        params: this.$http.adornParams({
          shopId: this.shopId,
          money: this.money,
          type: this.type
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.$message({
            message: "添加金额成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.money = "";
              this.dataSelect();
            }
          });
          this.dialogFormVisible4 = false;
        } else {
          this.$message.error(data.msg);
        }
      });
    },
    // 修改佣金比例
    StairNoticeToYj() {
      if (this.money == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入佣金比例",
          type: "warning"
        });
        return;
      }

      this.$http({
        url: this.$http.adornUrl("admin/goodsShop/updateGoodsShopRate"),
        method: "get",
        params: this.$http.adornParams({
          shopId: this.shopId,
          shopRate: this.money
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.$message({
            message: "修改成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.money = "";
              this.dataSelect();
            }
          });
          this.dialogFormVisible7 = false;
        } else {
          this.$message.error(data.msg);
        }
      });
    },
    updateMima(row) {
      console.log("修改密码", row);
      this.init(row.adminUserId);
      this.dialogFormVisible5 = true;
      this.newPassword = "";
      this.querenPassword = "";
    },
    init(id) {
      this.$http({
        url: this.$http.adornUrl(`sys/user/info/${id}`),
        method: "get",
        params: this.$http.adornParams()
      }).then(({ data }) => {
        console.log(data);
        if (data && data.code === 0) {
          this.dataForm.userName = data.user.username;
          this.dataForm.salt = data.user.salt;
          this.dataForm.email = data.user.email;
          this.dataForm.mobile = data.user.mobile;
          this.dataForm.roleIdList = data.user.roleIdList;
          this.dataForm.shopIdList = data.user.shopIdList;
          this.dataForm.status = data.user.status;
          this.dataForm.id = data.user.userId;
        }
      });
    },
    // 确认修改
    updatePassword() {
      console.log({
        userId: this.dataForm.id,
        // 'username': this.dataForm.userName,
        password: this.dataForm.password,
        salt: this.dataForm.salt
      });

      if (this.newPassword == "" || this.querenPassword == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "新密码或确认密码不能为空！",
          type: "warning"
        });
        return;
      }
      if (this.newPassword != this.querenPassword) {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "两次密码输入不一致！",
          type: "warning"
        });
        return;
      }
      this.dataForm.password = this.newPassword;
      this.$http({
        url: this.$http.adornUrl(`/sys/user/updateAdmin`),
        method: "post",
        data: this.$http.adornData({
          userId: this.dataForm.id,
          // 'username': this.dataForm.userName,
          password: this.dataForm.password,
          salt: this.dataForm.salt
          // 'email': this.dataForm.email,
          // 'mobile': this.dataForm.mobile,
          // 'status': this.dataForm.status,
          // 'roleIdList': this.dataForm.roleIdList,
          //  'shopIdList': this.dataForm.shopIdList
        })
      }).then(({ data }) => {
        console.log(data);

        if (data && data.code === 0) {
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dialogFormVisible5 = false;
            }
          });
        } else {
          this.$message.error(data.msg);
        }
      });
    },
    closes2(row) {
      this.shopUserId = row.userId;
      if (row.nickName) {
        this.shopUserName = row.nickName;
      } else {
        this.shopUserName = row.phone;
      }

      this.dialogFormVisible11 = false;
    },
    // 活动弹框
    canjiaHd(row) {
      this.shopId = row.shopId;
      this.activityId = row.activityId;
      this.dialogFormVisibleHd = true;
      this.shopSelect2();
    },
    // 活动列表中该商家已参与的活动
    shopSelect2() {
      this.$http({
        url: this.$http.adornUrl(
          `admin/activity-shop/shop-activity-list/${this.shopId}`
        ),
        method: "get",
        params: this.$http.adornParams({
          // 'shopId': this.shopId,
        })
      }).then(({ data }) => {
        let returnData = data.data;
        this.huodongSelect(returnData);
      });
    },
    // 获取活动列表
    huodongSelect(returnData) {
      this.tableDataLoadingHd = true;
      this.$http({
        url: this.$http.adornUrl("admin/activity/page"),
        method: "get",
        params: this.$http.adornParams({
          page: this.pageH,
          limit: this.limitH,
          title: this.integralName,
          isEnable: ""
        })
      }).then(({ data }) => {
        let length = data.data.totalCount;
        this.$http({
          url: this.$http.adornUrl("admin/activity/page"),
          method: "get",
          params: this.$http.adornParams({
            page: this.pageH,
            limit: length,
            title: this.integralName,
            isEnable: ""
          })
        }).then(({ data }) => {
          this.tableDataLoadingHd = false;
          let returnData2 = data.data;
          const newList = returnData2.list.map(item => {
            return { ...item, quantity: 0 };
            return { ...item, activityShopId: 0 };
          });
          var arr = [];
          for (var j in returnData) {
            newList.forEach(item => {
              if (item.id === returnData[j].activityId) {
                // 'status'为属性名，'非活动'为修改后的内容
                item.quantity = 1;
                item.activityShopId = returnData[j].activityShopId;
              }
            });
          }
          arr = newList;
          this.huodongData = arr;
        });
      });
    },
    selectHd() {
      this.pageH = 1;
      this.shopSelect2();
    },
    cleansHs() {
      this.pageH = 1;
      this.integralName = "";
      this.shopSelect2();
    },
    select2() {
      this.page1 = 1;
      this.getGoods11();
    },
    // 已选择商品
    yiselect(row) {
      console.log(this.shopId);
      this.dialogFormVisibleshangpYi = true;
      this.selectShang();
    },
    handleSizeChangeShop(val) {
      this.limit1 = val;
      this.getGoods11();
    },
    handleCurrentChangeShop(val) {
      this.page1 = val;
      this.getGoods11();
    },
    handleSizeChangeShop2(val) {
      this.limit2 = val;
      this.selectShang();
    },
    handleCurrentChangeShop2(val) {
      this.page2 = val;
      this.selectShang();
    },
    //添加商品
    tianjiahuo() {
      if (this.selectedItems.length <= 0) {
        this.$message("请勾选需要添加的商品");
        return;
      }
      var shangIds = [];
      this.selectedItems.forEach(item => {
        shangIds.push(item.goodsId);
      });
      this.$http({
        url: this.$http.adornUrl("/admin/activity-goods"),
        method: "post",
        data: this.$http.adornData({
          activityShopId: this.actShopid,
          goodsIds: shangIds
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dialogFormVisibleshangp = false;
              this.selectedItems = [];
              this.integralName = "";
              this.integralName2 = "";
              this.shopSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    //选中table已有数据
    selectedPreExisting(rows) {
      if (rows.length > 0) {
        //这里使用this.$nextTick是防止表格未渲染完成就执行，导致无法添加选中效果
        this.$nextTick(() => {
          rows.forEach(row => {
            //判断row是存在当前tableData
            let selectedItem = this.shopData.list.find(
              item => item.goodsId == row.goodsId
            );
            this.$refs.dataTable.toggleRowSelection(selectedItem);
          });
        });
      } else {
        this.$refs.dataTable.clearSelection();
      }
    },
    //表格单选
    selectdan(selection, row) {
      //因为翻页之后，点选时selection会出现undefined,所以这里需要进行判断
      //这里可以通过判断选择selection中有没有row，就可以判断出是增加还是删减
      if (
        selection &&
        selection.find(item => item && item.goodsId == row.goodsId)
      ) {
        this.addRows([row]);
      } else {
        this.deleteRows([row]);
      }
    },
    //表格全选
    selectAll(selection) {
      //判断是选中还是取消tableData
      if (selection.length > 0) {
        this.addRows(this.shopData.list);
      } else {
        this.deleteRows(this.shopData.list);
      }
    },
    //添加选中
    addRows(rows) {
      rows.forEach(row => {
        //过滤，当selectedItems有此条数据时，则直接返回，不执行添加
        if (this.selectedItems.find(item => item.goodsId == row.goodsId)) {
          return;
        }
        this.selectedItems.push(row);
      });
    },
    //取消选中
    deleteRows(rows) {
      //当selectedItems为空数组时，不执行删除
      if (this.selectedItems.length == 0) {
        return;
      }
      rows.forEach(row => {
        this.selectedItems = this.selectedItems.filter(
          item => item.goodsId !== row.goodsId
        );
      });
    },
    //优惠商品弹框关闭
    handleCancleshangp() {
      this.integralName2 = "";
    },
    //活动列表弹框关闭
    handleCancleHd() {
      this.integralName = "";
    },
    //选择商品
    selectshangpin(row) {
      console.log(row);
      this.dialogFormVisibleshangp = true;
      this.actShopid = row.activityShopId;
      this.getGoods11();
    },
    // 店铺已选择商品
    selectShang() {
      this.$http({
        url: this.$http.adornUrl(`admin/activity-goods/${this.actShopid}`),
        method: "get",
        params: this.$http.adornParams({})
      }).then(({ data }) => {
        if (data.msg == "success") {
          let returnData = data.data;
          //商品列表
          this.getGoods(returnData);
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    //所有商品
    getGoods(returnData) {
      this.$http({
        url: this.$http.adornUrl("admin/goodsShop/selectGoodsByShopId"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page2,
          limit: this.limit2,
          goodsName: "",
          shopId: this.shopId
        })
      }).then(({ data }) => {
        if (data.msg == "success") {
          this.suoshoplength = data.data.totalCount;
          this.$http({
            url: this.$http.adornUrl("admin/goodsShop/selectGoodsByShopId"),
            method: "get",
            params: this.$http.adornParams({
              page: this.page2,
              limit: this.suoshoplength,
              goodsName: "",
              shopId: this.shopId
            })
          }).then(({ data }) => {
            if (data.msg == "success") {
              let returnData2 = data.data;
              const newList = returnData2.list;
              var arr = [];
              for (var j in returnData) {
                newList.forEach(item => {
                  if (item.goodsId === returnData[j]) {
                    arr.push(item);
                  }
                });
              }
              this.shopDataYi = arr;
              this.shopTotal = this.shopDataYi.length;
            } else {
              this.$message({
                message: data.msg,
                type: "warning",
                duration: 1500,
                onClose: () => {}
              });
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    //所有商品11
    getGoods11() {
      this.$http({
        url: this.$http.adornUrl("admin/goodsShop/selectGoodsByShopId"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page1,
          limit: this.limit1,
          goodsName: this.integralName2,
          shopId: this.shopId
        })
      }).then(({ data }) => {
        if (data.msg == "success") {
          this.shopData = data.data;
          //randomKey是table数据改动时，刷新table的
          this.randomKey = Math.random();
          this.selectedPreExisting(this.selectedItems);
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    //选中table已有数据
    selectedPreExisting(rows) {
      if (rows.length > 0) {
        //这里使用this.$nextTick是防止表格未渲染完成就执行，导致无法添加选中效果
        this.$nextTick(() => {
          rows.forEach(row => {
            //判断row是存在当前tableData
            let selectedItem = this.shopData.list.find(
              item => item.goodsId == row.goodsId
            );
            this.$refs.dataTable.toggleRowSelection(selectedItem);
          });
        });
      } else {
        this.$refs.dataTable.clearSelection();
      }
    },
    // 确认参加活动
    querenBtnHd(row) {
      this.activityId = row.id;
      this.getActivity(row.id);
    },
    //退出活动
    quitHuo(row) {
      this.$confirm(`确定退出该活动?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("admin/activity-shop/quit"),
            method: "put",
            params: this.$http.adornParams({
              shopId: this.shopId,
              activityId: row.id
            })
          }).then(({ data }) => {
            if (data.code == 0) {
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.shopSelect2();
                }
              });
            } else {
              this.$message({
                message: data.msg,
                type: "warning",
                duration: 1500,
                onClose: () => {}
              });
            }
          });
        })
        .catch(() => {});
    },
    //取消参与活动
    quxiaoHuo() {
      this.dialogFormcanyuhuo = false;
    },
    //参与活动
    joinHuo() {
      var shopid = [this.shopId];
      if (this.limitType == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "有限制时不能为空",
          type: "warning"
        });
        return;
      }
      this.$http({
        url: this.$http.adornUrl("admin/activity-shop/join"),
        method: "post",
        data: this.$http.adornData({
          activityId: this.activityId,
          limitType: this.limitType,
          limitValue: this.limitNum,
          shopIds: shopid,
          suitType: this.suitType
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormcanyuhuo = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.shopSelect2();
              // this.dataSelect()
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    //获取活动信息
    getActivity(id) {
      this.$http({
        url: this.$http.adornUrl(`admin/activity/${id}`),
        method: "get",
        params: this.$http.adornParams({
          // 'shopId': this.shopId,
        })
      }).then(({ data }) => {
        if (data.msg == "success") {
          let returnData = data.data;
          this.huoList = returnData;
          this.dialogFormcanyuhuo = true;
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {}
          });
        }
      });
    },
    // 查看活动
    looksHd(row) {
      this.$http({
        url: this.$http.adornUrl("admin/activityManage/getActivityInfo?=2"),
        method: "get",
        params: this.$http.adornParams({
          activityId: row.activityId
        })
      }).then(({ data }) => {
        let returnData = data.data;
        this.xiangqingData = returnData;
      });
      this.dialogFormVisibleXq = true;
    },
    // 是否推荐活动商家
    changeTj(row) {
      console.log(row);
      this.$http({
        url: this.$http.adornUrl("admin/goods/updateGoodsShop"),
        method: "post",
        data: this.$http.adornData({
          isRecommend: row.isRecommend,
          shopId: row.shopId,
          isSupplier: row.isSupplier,
          messageConfiguration: row.messageConfiguration
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormVisible1 = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        }
      });
    },
    // 是否为会员立减商家
    changeLJ(row) {
      console.log(row);
      this.$http({
        url: this.$http.adornUrl(`/admin/goodsShop/vip-promotion/${row.shopId}/${row.vipPromotion}`),
        method: "put",
        data: this.$http.adornData({})
      }).then(({ data }) => {
        console.log(data,"是否为会员立减商家");

        if (data.code == 0) {
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        }
      });
    },

    // 是否隐藏商家
    isConcealChange(row) {
      console.log(row);
      this.$http({
        url: this.$http.adornUrl("admin/goods/updateGoodsShop"),
        method: "post",
        data: this.$http.adornData({
          isConceal: row.isConceal,
          isRecommend: row.isRecommend,
          shopId: row.shopId,
          isSupplier: row.isSupplier,
          messageConfiguration: row.messageConfiguration
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormVisible1 = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        }
      });
    },

    // 减免开关
    onFlag() {
      if (this.exemptErrandFlag == 1) {
        this.exemptMinMoney = 0;
        this.minimumDelivery = 0;
      }
    },
    // 修改排序
    paixuBtn(row) {
      this.$http({
        url: this.$http.adornUrl("admin/goodsShop/updateGoodsShopSort"),
        method: "get",
        // data: this.$http.adornData({
        params: this.$http.adornParams({
          sort: row.sort,
          shopId: row.shopId
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        } else {
          this.$message({
            message: data.msg,
            type: "warning",
            duration: 1500,
            onClose: () => {
              this.dataSelect();
            }
          });
        }
      });
    }
  },
  mounted() {
    this.token = Vue.cookie.get("token");
    let flag = sessionStorage.getItem("shopsListFlag");
    console.log(flag, "shopsListFlag");

    if (flag == "true") {
      let parmas = JSON.parse(sessionStorage.getItem("shopsList"));
      this.page = parmas.page;
      this.limit = parmas.limit;
      this.shopName1 = parmas.shopName1;
      this.region = parmas.region;
      this.isActivity = parmas.isActivity;
    } else {
      this.page = 1;
      this.limit = 10;
      this.shopName1 = "";
      this.region = "";
      this.isActivity = "";
      sessionStorage.removeItem("shopsList");
    }
    this.dataSelect();
    this.dataSelect2();
  },
  beforeRouteEnter(to, from, next) {
    if (
      from.name == "shopsListAdmin" ||
      from.name == "shopsOrder" ||
      from.name == "shopDatas" ||
      from.name == "bondList" ||
      from.name == "couponShop" ||
      from.name == "shopWallet" ||
      from.name == "pingjiaList" ||
      from.name == "shopPrintSet"
    ) {
      sessionStorage.setItem("shopsListFlag", true);
      console.log("是通过修改页面跳转过来的");
    } else {
      sessionStorage.setItem("shopsListFlag", false);
      console.log("直接进入页面");
    }
    next(vm => {});
  }
};
</script>

<style>
.imgs {
  position: relative;
  border-radius: 6px;
  width: 148px;
  height: 148px;
  margin-right: 10px;
  display: inline-block;
}

.dels {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

.dels .el-icon-delete {
  line-height: 148px;
  padding-left: 58px;
  font-size: 25px;
  color: #fff;
}

.imgs:hover .dels {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
  opacity: 0.5;
}

.bqList {
  padding: 4px 14px;
  margin: 4px;
  border: 1px solid #efefef;
  font-size: 12px;
  color: #999;
  border-radius: 4px;
  margin-right: 15px;
}

.delss {
  display: none;
  position: relative;
}

.delss .el-icon-delete {
  position: absolute;
  top: 0;
}

.bqList:hover .delss {
  display: initial;
  opacity: 0.5;
}

.tj {
  padding: 6px !important;
  margin: 4px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.divs img {
  width: 100%;
}

/* //参与活动 */
.canquxiao {
  margin-top: 20px;
  margin-left: 287px;
  width: 76px;
  height: 35px;
  opacity: 1;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 1);
  font-size: 16px;
  font-weight: 400;
  line-height: 35px;
  color: rgba(0, 0, 0, 1);
  text-align: center;
}

.canqueding {
  margin-top: -35px;
  margin-left: 407px;
  width: 76px;
  height: 35px;
  opacity: 1;
  border-radius: 5px;
  background: rgba(62, 142, 247, 1);
  font-size: 16px;
  font-weight: 400;
  line-height: 35px;
  color: rgba(255, 255, 255, 1);
  text-align: center;
}
</style>
