<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>
        <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="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="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 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 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 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 size="mini" type="primary" @click="shopsListSr(scope.row)" style="margin: 5px;">收入统计
            </el-button>
            <el-button :disabled="!isAuth('shopsList:delete')" size="mini" type="danger" @click="fengjin(scope.row)"
              style="margin: 5px;">{{scope.row.bannedFlag==1?'解封':'封禁'}}
            </el-button>
            <el-button 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 size="mini" type="primary" @click="shopsListQb(scope.row)" style="margin: 5px;">商铺钱包
            </el-button>
            <el-button :disabled="!isAuth('shopsList:delete')" size="mini" type="danger" @click="deletes(scope.row)"
              style="margin: 5px;">删除
            </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" 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="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="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
            :on-success="handleAvatarSuccess1">
            <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="$http.adornUrlUp('alioss/upload')" list-type="picture-card"
            :show-file-list="false" :on-success="handleRemove" :on-progress="onprogress1">
            <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;">
        <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-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">
          <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;">
        <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;">
        <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;">
        <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;">
        <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="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.id}">
        <!-- <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="userName" label="昵称">
          <template slot-scope="scope">
            <span style="color: #f56c6c;">{{ scope.row.userName ? scope.row.userName : '未设置' }}</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-tabs>
</template>

<script>
  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 {
        phone: '',
        nickName: '',
        limit: 10,
        page: 1,
        size11: 10,
        page11: 1,
        shopName1: '',
        shopId: '',
        userIdList: '',
        shopName: '',
        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,
        tablemoney: 0,
        dataForm: {
          id: 0,
          userName: '',
          password: '',
          comfirmPassword: '',
          salt: '',
          email: '',
          mobile: '',
          roleIdList: [],
          shopIdList: [],
          status: 1,
        },
        newPassword: '',
        querenPassword: '',
        bannedFlag: '',
        exemptErrandFlag: 1, //是否见面配送费0开启 1关闭
        errandMoney: '',
        exemptMinMoney: '',
        minimumDelivery: '',
        autoSendOrder: 1,
        autoAcceptOrder:1,
        putawayFlag: 1,
        distributionDistance: '',
        facility: 1,
        shopUserId: '',
        shopUserName: '',
        shopPhone: '', //商户关联手机号
        snCode: '',
      }
    },
    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()
      },
      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.shopName = ''
        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 = ''
        this.exemptErrandFlag = 1
        this.facility = 1
        this.snCode = ''
        this.value = ''
        this.distributionDistance = ''
        this.exemptMinMoney = ''
        this.minimumDelivery = ''
        this.autoSendOrder = 1
        this.autoAcceptOrder = 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() {
        console.error('ffff')
        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.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.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.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.facility = this.facility
        datas.snCode = this.snCode
        datas.value = this.value
        datas.distributionDistance = this.distributionDistance
        datas.exemptMinMoney = this.exemptMinMoney
        datas.minimumDelivery = this.minimumDelivery
        datas.autoSendOrder = this.autoSendOrder
        datas.autoAcceptOrder = this.autoAcceptOrder
        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.userId = this.shopUserId;
        datas.phone = this.shopPhone;

        datas.shopTypeId = this.shopType
        datas.shopLable = this.labels.toString()
        datas.bannedFlag = this.bannedFlag

        if (this.titles == '添加') {
          var url = 'admin/goods/insertGoodsShop'

        }
        if (this.titles == '修改') {
          var url = 'admin/goods/updateGoodsShop'
          datas.shopId = this.shopId
        }
        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) {
        this.titles = '修改'
        this.shopId = rows.shopId
        this.shopName = rows.shopName
        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;
        this.bannedFlag = rows.bannedFlag;
        this.errandMoney = rows.errandMoney
        this.exemptMinMoney = rows.exemptMinMoney
        this.minimumDelivery = rows.minimumDelivery
        this.shopPhone = rows.phone
        this.shopUserId = rows.userId

        if (rows.facility) {
          this.facility = rows.facility
        }
        this.snCode = rows.snCode
        this.value = rows.value
        if (rows.exemptErrandFlag) {
          this.exemptErrandFlag = rows.exemptErrandFlag
        }

        if (rows.autoSendOrder) {
          this.autoSendOrder = rows.autoSendOrder
        }
        if (rows.autoAcceptOrder) {
          this.autoAcceptOrder = rows.autoAcceptOrder
        }
        
        this.putawayFlag = rows.putawayFlag
        this.distributionDistance = rows.distributionDistance
        this.storeAddre = 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
        // }
      },
      // 封禁
      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
          }
        })
      },
      // 获取分类数据
      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
          })
        }).then(({
          data
        }) => {
          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(',')
            }

          }
          let returnData = data.data
          this.typeDatas = returnData
        })
      },
      //定位获得当前位置信息
      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.address
        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)
      },
      // 封面图
      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.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
        })
      },
      // 添加类型
      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() {

      },
      // 修改保证金
      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
        }

      },
      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),
          method: 'get',
          data: this.$http.adornData({})
        }).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)
          }

        })
      },
      updateMima(row) {
        console.log('修改密码')
        this.init(row.adminUserId)
        this.dialogFormVisible5 = true
      },
      init(id) {
        this.$http({
          url: this.$http.adornUrl(`/sys/user/info/${id}`),
          method: 'get',
          params: this.$http.adornParams()
        }).then(({
          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() {
        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
        }) => {
          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
        this.shopUserName = row.userName
        this.dialogFormVisible11 = false
      }
    },


    mounted() {
      this.dataSelect()
      this.dataSelect2()
    }
  }
</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;
  }
</style>
