center.vue 26.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891
<template>
  <div class="marketing live-room">
    <div class="memberCardWrap" v-if="!(merchantModel == 2 && accountLevel == 1)">
      <div class="cardBoxWrap">
        <img src="@/assets/memberCard.png" alt="" />
        <div class="memberCardName">{{ ruleForm.cardName }}</div>
      </div>
      <div class="cardDetail" v-if="!isShowEditWrap">
        <div class="flex-1">
          <p class="text-16 weight-6">
            {{ ruleForm.cardName }}
            <!-- <el-tooltip content="会员已包含基础权益:生活权益、商城折扣" effect="light" placement="top">
              <img class="icon-circle-question" src="@/assets/icon-circle-question.png" alt="" @click="isshow = true" />
            </el-tooltip> -->
          </p>
          <template v-if="showGh">
            <div class="member-card"><img src="@/assets/silver.png" alt="" /></div>
          </template>
          <GLButton @click="openEditWrap" fn="编辑" mode="div"><img src="@/assets/editBlue.png" class="editIcon" @click="openEditWrap" alt="" /></GLButton>
        </div>
        <template v-if="showGh">
          <div class="flex-1 mt-10 line-20">
            <p class="text-14 weight-5">
              {{ ruleForm.goldCardClassName ? ruleForm.goldCardClassName : '--' }}
            </p>
            <div class="member-card"><img src="@/assets/gold.png" alt="" /></div>
          </div>
        </template>

        <div class="row">
          <span>售价:</span>
          <span class="price text-e8" v-if="ruleForm.price">¥{{ ruleForm.price }}</span>
        </div>
        <div class="row">
          <span>市场价:</span>
          <span class="price" v-if="ruleForm.marketPrice">¥{{ ruleForm.marketPrice }}</span>
        </div>
        <div class="membership">
          <span>会员卡试用:</span>
          <span class="membershipDays" v-if="ruleForm.tryAble == 1">{{ ruleForm.tryNum }}天试用</span>
          <span class="membershipDays" v-else>已关闭</span>
          <span class="lookQR" @click="extensionQR" v-if="ruleForm.tryAble == 1">生成小程序码推广码></span>
        </div>
        <el-button class="seeEquity" size="small" type="primary" @click="openDialog">查看权益</el-button>
      </div>
      <div class="cardDetail editForm gl-form-page" v-else>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
          <template v-if="!showGh">
            <el-form-item label="会员卡名:" prop="cardName" size="small">
              <el-input v-model.trim="ruleForm.cardName" size="small" class="cardNameInput" show-word-limit placeholder="请输入会员卡名" maxlength="15"></el-input>
            </el-form-item>
          </template>
          <template v-else>
            <el-form-item label="银卡" prop="cardName" size="small">
              <el-input v-model.trim="ruleForm.cardName" size="small" class="cardNameInput" show-word-limit placeholder="请输入银卡名称" maxlength="15"></el-input>
            </el-form-item>
            <el-form-item label="金卡" prop="goldCardClassName" size="small">
              <el-input v-model.trim="ruleForm.goldCardClassName" size="small" class="cardNameInput" show-word-limit placeholder="请输入金卡名称" maxlength="15"></el-input>
            </el-form-item>
          </template>

          <div class="pricesMerge">
            <el-form-item label="售价/元:" size="small" prop="price" style="width: 300px">
              <el-input v-model="ruleForm.price" size="small" style="width: 136px;" placeholder="请输入售价" @keyup.native="ruleForm.price = oninput(ruleForm.price)">
                <!-- <span slot="suffix" class="suffix-label">元</span> -->
              </el-input>
            </el-form-item>
            <el-form-item label="市场价/元:" prop="marketPrice" size="small" style="width: 300px">
              <el-input v-model="ruleForm.marketPrice" size="small" style="width: 136px;" placeholder="请输入市场价" @keyup.native="ruleForm.marketPrice = oninput(ruleForm.marketPrice)">
                <!-- <span slot="suffix" class="suffix-label">元</span> -->
              </el-input>
            </el-form-item>
          </div>
          <el-form-item :class="!ruleForm.tryNum ? 'is-error' : ''" class="memberTrial" label="会员卡试用" size="small">
            <div class="trialMerge">
              <el-switch class="switchTag" active-value="1" inactive-value="0" v-model="ruleForm.tryAble" active-color="#5850FF" inactive-color="#E8E8EA" active-text="开" inactive-text="关"></el-switch>
              <div class="trialDays" v-if="ruleForm.tryAble == 1">
                <span>试用时长</span>
                <el-input-number v-model="ruleForm.tryNum" :controls="false" :min="1" :max="365"></el-input-number>
                <span>天试用</span>
              </div>
              <div class="el-form-item__error trialDays_error" v-if="ruleForm.tryAble == 1 && !ruleForm.tryNum">请输入试用时长</div>
            </div>
            <!-- <div v-if="ruleForm.tryAble" class="promoteQR">生成小程序码推广</div> -->
          </el-form-item>
        </el-form>

        <div style="display: flex">
          <el-button size="small" class="cancelBtn" @click="cancelEdit">取消</el-button>
          <el-button size="small" class="saveBtn" type="primary" @click="submitRuleForm('ruleForm')">保存</el-button>
          <el-button size="small" class="lookUpBtn" type="primary" @click="openDialog">查看权益</el-button>
        </div>
      </div>
    </div>
    <div class="pageTitle">会员用户</div>
    <div class="live-room container">
      <GLCombiForm class="p-t-20" ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
      <div class="flex-between m-b-10 m-t-10">
        <div class="text-16 color-3 weight-5">会员列表</div>
        <div class="export" @click="handleExport">全部导出</div>
      </div>

      <GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
        <div slot="cardInfo" slot-scope="scope">
          <GLTable class="centerTable" ref="cardListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="cardParams" :tableData="scope.scope.list"></GLTable>
        </div>
        <span slot="accountName" slot-scope="scope">
          <div>{{ scope.scope.accountName }}</div>
          <div>{{ scope.scope.mobile }}</div>
        </span>
      </GLTable>
    </div>
    <GLDialog :mode="mode" title="权益详情" :hasFooter="hasFooter" :type="'error'" :visible.sync="isDialogVisible">
      <div class="modal-body">
        <div class="equity-name">汽车权益</div>
        <div class="equity-panel">
          <div class="equity-item" v-for="(item, index) in merchantData.carServiceList" :key="index">
            <div class="equity-item-icon"><img :src="item.equityIcon" /></div>
            <div class="equity-item-name">{{ item.equityName }}</div>
            <div class="equity-item-desc">{{ item.equityDesc }}</div>
          </div>
        </div>
        <div v-for="(item, index) in merchantData.goodsServiceList" :key="index">
          <div class="equity-name">{{ item.goodsCategory }}</div>
          <div class="equity-panel">
            <div class="equity-item" v-for="(v, xindex) in item.equityGoodsGroupDescDtos" :key="xindex">
              <div class="equity-item-icon"><img :src="v.equityIcon" /></div>
              <div class="equity-item-name">{{ v.equityName }}</div>
              <div class="equity-item-desc">{{ v.equityDesc }}</div>
            </div>
          </div>
        </div>
      </div>
    </GLDialog>
    <!-- 推广弹窗 -->
    <GLDialog :mode="mode" title="试用推广" @onOk="handleQRConfirm" @onCancel="handleQRClose" :visible.sync="isQRVisible">
      <el-form class="proForm" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="68px">
        <div class="form">
          <div class="main-qrcode">
            <img :src="promotionForm.QRcode" ref="Qrcode" id="qrCode" />
            <div class="tryDays">{{ ruleForm.tryNum }}天试用</div>
          </div>
          <el-form-item label="领取链接" style="margin-top: 20px">
            <div class="lineCtn">
              <el-input disabled="true" :value="`${promotionForm.QRurl}`" maxlength="14" placeholder="请输入链接" clearable></el-input>
              <el-button size="small" type="primary" @click="closeText(`${promotionForm.QRurl}`)">复制链接</el-button>
            </div>
          </el-form-item>
        </div>
      </el-form>
    </GLDialog>
  </div>
</template>

<script>
const cloneText = message => {
  let input = document.createElement('input')
  input.value = message
  document.body.appendChild(input)
  input.select()
  input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
  document.body.removeChild(input)
}
import { getCenterListApi, getMoreMerchant, getCardContent, updateCardContent, memberExportApi, getQrUrl, getCardtypeList } from '@/api/modules/center'
import { statusList, memberTypeList, exportFn } from '@/common/constant'
export default {
  filters: {
    filterTable(list, data) {
      return data
    }
  },
  data() {
    return {
      mode: 'mid',
      hasFooter: false,
      showGh: false,
      promotionForm: {
        QRurl: '',
        QRcode: ''
      }, //推广
      isQRVisible: false,
      size: 'small',
      getListApi: getCenterListApi,
      searchForm: {
        userInfo: '',
        status: '',
        merchantName: '',
        memberType: '',
        activeType: '',
        daterange: ''
      },
      searchFormTable: {},
      // 搜索
      searchFormData: [
        {
          label: '会员用户',
          name: 'userInfo',
          type: 'input',
          placeholder: '请输入会员用户或手机号',
          maxlength: 100
        },
        {
          label: '门店',
          name: 'merchantName',
          type: 'input',
          maxlength: 100
        },
        {
          label: '状态',
          name: 'status',
          type: 'select',
          optionList: [],
          optionId: 'dictValue',
          optionLabel: 'dictLabel',
          optionsName: 'memberCenterStatuList'
        },
        {
          label: '会员类型',
          name: 'memberType',
          type: 'select',
          optionList: [],
          optionId: 'dictValue',
          optionLabel: 'dictLabel',
          optionsName: 'memberTypeLists'
        },
        {
          label: '开通日期',
          name: 'daterange',
          type: 'datePicker',
          isClear: true,
          pickerOptions: 'beforeRangePickerOptions'
        },
        {
          label: '开通方式',
          name: 'activeType',
          type: 'select',
          optionList: [],
          optionId: 'dictValue',
          optionLabel: 'dictLabel',
          optionsName: 'openModeList'
        }
      ],
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
      // 表格参数
      tableParams: {
        listName: 'list',
        tableOption: false,
        tableColumns: [
          {
            label: '',
            prop: '',
            columnattrs: {
              type: 'expand'
            },
            addHtml: 'cardInfo'
          },
          {
            label: '会员用户',
            prop: 'accountName',
            width: '180',
            addHtml: 'accountName'
          },
          {
            label: '会员类型',
            prop: 'memberType',
            formatter: cellValue => {
              return cellValue.memberType ? this.baseData.memberTypeList.find(item => item.confId == cellValue.memberType).confName : '-'
            }
          },
          {
            label: '状态',
            prop: 'status',
            formatter: cellValue => {
              return cellValue.memberStatus ? this.baseData.statusList.find(item => item.confId == cellValue.memberStatus).confName : '-'
            }
          }
        ]
      },
      cardParams: {
        listName: 'list',
        tableOption: false,
        tableColumns: [
          {
            label: '开通门店',
            prop: 'merchantName',
            width: 300
          },
          {
            label: '开通方式',
            prop: 'activeTypeDesc',
            width: 200
          },
          {
            label: '开通日期',
            prop: 'activeTime',
            width: 300
          }
        ]
      },
      baseData: {
        statusList: statusList,
        memberTypeList: memberTypeList,
        memberCenterStatuList: [
          {
            dictValue: 1,
            dictLabel: '生效中'
          },
          {
            dictValue: 2,
            dictLabel: '已失效'
          }
        ],
        memberTypeLists: [
          {
            dictValue: 1,
            dictLabel: '正式会员'
          },
          {
            dictValue: 2,
            dictLabel: '试用会员'
          }
        ],
        openModeList: [
          {
            dictValue: 6,
            dictLabel: '付费开通'
          },
          {
            dictValue: 12,
            dictLabel: '无忧服务'
          },
          {
            dictValue: 0,
            dictLabel: '试用领取'
          }
        ]
      },

      isShowEditWrap: false,

      ruleForm: {
        equityId: '',
        cardName: '',
        goldCardClassName: '',
        price: '',
        marketPrice: '',
        linkUrl: '',
        tryNum: '', //试用时长
        tryAble: '' //会员卡试用开关
      },
      copyRuleForm: {},
      rules: {
        cardName: [{ required: true, min: 1, max: 15, message: '请输入会员卡名称', trigger: 'blur' }],
        goldCardClassName: [{ required: true, min: 1, max: 15, message: '请输入金卡名称', trigger: 'blur' }],
        price: [{ required: true, message: '请输入售价', trigger: 'blur' }],
        marketPrice: [{ required: true, message: '请输入市场价', trigger: 'blur' }]
      },
      //权益 - 弹窗
      isDialogVisible: false,
      merchantData: {},
      merchantId: 0, //记得改 glsxadmin:44184606
      merchantModel: 1, //集团:1,门店:2
      accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
    }
  },
  created() {
    if (window.__POWERED_BY_QIANKUN__) {
      //运行在qiankun容器中
      this.merchantId = this.$globalState.session.merchantId
      this.merchantModel = this.$globalState.session.merchantModel
      this.accountLevel = this.$globalState.session.accountLevel
    }
    this.showGh = window.location.host.indexOf('cgacar') != -1
    this.getCardContentFun()
    this.getCardtypeList()
  },
  mounted() {
    this.getOptionsList('searchFormData')
  },
  methods: {
    getOptionsList(formName, hasAll = true, refreshSigle) {
      if (refreshSigle) {
        var item = this[formName].find(k => k.name == refreshSigle)
        var index = this[formName].findIndex(k => k.name == refreshSigle)
        this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
        if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
          const temp = {}
          temp[this[formName][index].optionId] = ''
          temp[this[formName][index].optionLabel] = '全部'
          this[formName][index].optionList.unshift(temp)
        }
      } else {
        this[formName].forEach((item, index) => {
          if (item.type === 'select' && this.baseData[item.optionsName].length) {
            this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
            if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
              const temp = {}
              temp[this[formName][index].optionId] = ''
              temp[this[formName][index].optionLabel] = '全部'
              this[formName][index].optionList.unshift(temp)
            }
          }
        })
      }
    },

    //门店会员开通方式
    getCardtypeList() {
      getCardtypeList({}).then(res => {
        if (res.code == 0) {
          this.openModeList = res.data
        }
      })
    },
    // 复制链接按钮
    closeText(val) {
      cloneText(val)
      this.$message.success('复制成功')
    },
    // 查看小程序推广码
    extensionQR() {
      const params = {
        id: this.ruleForm.equityId
      }
      getQrUrl(params).then(res => {
        this.isQRVisible = !this.isQRVisible
        this.promotionForm.QRurl = res.data.url
        this.promotionForm.QRcode = res.data.qrCode
      })
    },
    oninput(value) {
      let str = value
      let len1 = str.substr(0, 1)
      let len2 = str.substr(1, 1) //如果第一位是0,第二位不是点,就用数字把点替换掉
      if (str.length > 1 && len1 == 0 && len2 != '.') {
        str = str.substr(1, 1)
      } //第一位不能是.
      if (len1 == '.') {
        str = ''
      }
      if (len1 == '+') {
        str = ''
      }
      if (len1 == '-') {
        str = ''
      } //限制只能输入一个小数点
      if (value !== '' && value == 0) {
        // return (str = 1)
        return (str = 0.01)
      }
      if (Number(value) >= 99999) {
        return (str = 99999)
      }
      if (str.indexOf('.') != -1) {
        let str_ = str.substr(str.indexOf('.') + 1)
        if (str_.indexOf('.') != -1) {
          str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
        }
      }
      //正则替换
      // (/[^\-\d.]/g, ''))"
      str = str.replace(/[^\d.^]+/g, '') // 保留数字和小数点
      str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位
      return str
    },
    getCardContentFun() {
      if (this.merchantModel == 2 && this.accountLevel == 1) return
      getCardContent({ merchantId: this.merchantId }).then(res => {
        if (!res) {
          return
        }
        this.ruleForm.equityId = res.equityClassId
        this.ruleForm.cardName = res.equityName
        this.ruleForm.goldCardClassName = res.equityGoldName
        this.ruleForm.price = res.goodPrice
        this.ruleForm.marketPrice = res.marketPrice
        this.ruleForm.linkUrl = res.freeUrl
        this.ruleForm.tryNum = res.freeDay //新增试用时长
        this.ruleForm.tryAble = res.tryAble //会员卡试用开关
      })
    },
    openEditWrap() {
      if (!this.ruleForm.equityId) return
      this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm))
      this.isShowEditWrap = true
    },
    //点击取消编辑按钮
    cancelEdit() {
      this.ruleForm = this.copyRuleForm
      this.isShowEditWrap = false
    },
    submitRuleForm(formName) {
      if (this.ruleForm.tryAble == true && this.ruleForm.tryNum == undefined) {
        return
      }
      this.$refs[formName].validate(valid => {
        if (!valid) {
          return
        }
        this.isShowEditWrap = false
        let params = {}
        params.id = this.ruleForm.equityId
        params.cardClassName = this.ruleForm.cardName
        if (this.showGh) params.goldCardClassName = this.ruleForm.goldCardClassName
        params.price = this.ruleForm.price
        params.marketPrice = this.ruleForm.marketPrice
        params.tryNum = this.ruleForm.tryNum
        params.tryAble = this.ruleForm.tryAble //会员卡试用开关
        updateCardContent(params).then(res => {
          if (!res) {
            return
          }
          this.$message.success('修改成功')
          this.getCardContentFun()
        })
      })
    },
    getParams() {
      var params = JSON.parse(JSON.stringify(this.searchForm))
      if (params.daterange) {
        params.startTime = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
        params.endTime = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
      }
      delete params.daterange
      return params
    },
    beforeSearchFn() {
      return new Promise((resolve, reject) => {
        this.searchFormTable = this.getParams()
        resolve()
      })
    },
    handleExport(row) {
      var params = this.getParams()
      memberExportApi(params).then(res => {
        exportFn(res)
      })
    },
    handleReset() {
      this.searchForm = {
        userInfo: '',
        status: '',
        merchantName: '',
        memberType: '',
        activeType: '',
        daterange: ''
      }
      this.handleSearch()
    },
    handleSearch() {
      this.$refs.memberCenterRef.refreshTable()
    },
    setTableFinishFun() {
      //接收到的数据为空
      this.$refs.memberCenterRef.data.length ? (this.$refs.memberCenterRef.tableHeightValues = '') : this.$refs.memberCenterRef.setTableHeightFun()
    },
    handleQRClose() {
      this.isQRVisible = !this.isQRVisible
    },
    handleQRConfirm() {
      this.isQRVisible = !this.isQRVisible
    },
    handleClose() {
      this.isDialogVisible = !this.isDialogVisible
    },
    openDialog() {
      this.isDialogVisible = !this.isDialogVisible
      getMoreMerchant({})
        .then(res => {
          this.merchantData = res
        })
        .catch(err => {
          console.error('错误信息:', err)
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.centerTable {
  padding-left: 10px;
}
/deep/ .el-input-number--small {
  width: 53px;
  margin: 0 3px;
}
.lineCtn {
  display: flex;
  flex-direction: row;
}
.main-qrcode {
  text-align: center;
  margin-bottom: 10px;
}
.main-qrcode img {
  width: 160px;
  height: 160px;
}
.main-qrcode .tryDays {
  margin-top: 12px;
}
// .form {
//   padding: 32px 20px 32px 48px;
// }
.form {
  padding: 20px 0;
}
.addCardsDialog .el-dialog__header {
  padding: 20px 20px 20px;
  border-bottom: 1px solid #d8d8d8;
  font-size: 20px;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
}
.addCardsDialog .el-dialog__footer {
  padding: 16px 20px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  border-top: 1px solid #e6e6e6;
}
.addCardsDialog .el-radio {
  color: #606266;
  font-weight: 500;
  cursor: pointer;
  margin-right: 20px;
}
.memberCardWrap {
  display: flex;
  background-color: #fff;
  height: 190px;
  box-sizing: border-box;
  padding: 10px 8px;
  box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
  .cardBoxWrap {
    position: relative;
    img {
      width: 321px;
      height: 174px;
    }
    .masonry {
      position: absolute;
      top: 40px;
      left: 32px;
    }
    .memberCardName {
      position: absolute;
      font-size: 17px;
      font-weight: 600;
      color: #ffd690;
      line-height: 24px;
      background: radial-gradient(125deg, #fde8bf 0%, #dda15f 100%);
      top: 116px;
      margin: 0 28px;
    }
  }
  .cardDetail {
    height: 129px;
    width: calc(100% - 350px);
    padding-top: 8px;
    margin-left: 10px;
    position: relative;
    .icon-circle-question {
      width: 16px;
      height: 16px;
    }
    .member-card {
      width: 30px;
      height: 16px;
      margin-left: 4px;
      img {
        width: 100%;
      }
    }
    .seeEquity {
      position: absolute;
      right: 0;
      bottom: 14px;
    }
    .cancelBtn {
      position: absolute;
      right: 173px;
      bottom: 0;
      // padding: 8px 30px;
    }
    .saveBtn {
      position: absolute;
      right: 100px;
      bottom: 0;
      // padding: 8px 30px;
    }
    .lookUpBtn {
      position: absolute;
      right: 0;
      bottom: 0;
    }
    .editIcon {
      margin-left: 6px;
      vertical-align: middle;
      cursor: pointer;
      width: 12.8px;
    }
    .flex-1 {
      display: flex;
      p {
        display: inline-block;
        color: #333333;
        margin: 0;
      }
    }
    .row {
      margin-top: 15px;
      font-weight: 400;
      font-size: 14px;
      span:first-child {
        color: #666666;
      }
      .price {
        color: #333333;
      }
      .address {
        display: inline-block;
        vertical-align: bottom;
        max-width: calc(100% - 220px);
        color: #989898;
      }
    }
  }
  .editForm {
    padding-top: 0px;
    .cardNameInput {
      width: 423px;
    }
  }
}

.pageTitle {
  position: relative;
  padding: 15px 20px;
  margin-bottom: -20px;
  font-size: 16px;
  font-weight: 500;
  color: #333333;
  line-height: 28px;
  border-bottom: 1px solid #d8d8d8;
  background-color: #fff;
  margin-top: 20px;
}
.export {
  height: 32px;
  border-radius: 4px;
  border: 1px solid #5850ff;
  font-size: 14px;
  font-weight: 400;
  color: #5850ff;
  line-height: 14px;
  padding: 9px 20px;
  box-sizing: border-box;
  cursor: pointer;
}

.el-form-item {
  margin-bottom: 15px;
}
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
  border-color: #5850ff;
  width: 215px;
}
.el-range-editor--small.el-input__inner {
  width: 215px;
}
/deep/.el-dialog__body {
  .modal-body {
    max-height: 400px;
  }
  .equity-panel {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .equity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    margin-bottom: 15px;
  }
  .equity-name {
    font-size: 15px;
    font-weight: 700;
    margin: 12px 0px;
    color: #000;
    height: 24px;
    line-height: 24px;
  }
  .equity-item-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
  }
  .equity-item-icon img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
  }
  .equity-item-name {
    font-size: 14px;
    width: 80px;
    text-align: center;
    color: #282829;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 10px;
  }
  .equity-item-desc {
    font-size: 12px;
    width: 80px;
    text-align: center;
    color: #fc5b32;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
}

.pricesMerge {
  display: flex;
  width: 1500px;
}
// 会员卡试用样式
.memberTrial {
  .trialMerge {
    display: flex;
    align-items: center;
    height: 33px;
    .trialDays_error {
      margin-left: 129px;
    }
    .switchTag .el-switch__label {
      position: absolute;
      display: none;
      color: #fff;
    }
    .trialDays {
      display: flex;
      font-size: 12px;
    }
    /*打开时文字位置设置*/
    .demo .el-switch__label--right {
      z-index: 1;
      right: -3px;
    }
    /*关闭时文字位置设置*/
    .demo .el-switch__label--left {
      z-index: 1;
      left: 19px;
    }
    /*显示文字*/
    .demo .el-switch__label.is-active {
      display: block;
    }
    .demo.el-switch .el-switch__core,
    .el-switch .el-switch__label {
      width: 50px !important;
    }
  }
  .promoteQR {
    color: #5850ff;
    margin-bottom: 26px;
  }
}
.membership {
  margin-top: 15px;
  font-family: PingFangSC-Regular;
  font-size: 14px;
  color: #666666;
  font-weight: 400;
  .membershipDays {
    margin-left: 5px;
    color: #333333;
  }
  .lookQR {
    margin-left: 12px;
    color: #5850ff;
    cursor: pointer;
  }
}
</style>