serviceAddUpdateLook.vue 27.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
<template>
  <div class="live-room">
    <div class="topMsg">
      <p class="pageTitle">基本信息</p>
    </div>
    <div class="live-room container">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
        <el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px">
          <el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
        </el-form-item>
        <el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px">
          <el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input>
        </el-form-item>
        <el-form-item size="small" label="有效期" prop="effectiveType">
          <div class="radioGroupWrap">
            <el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent">
              <el-radio :label="3" class="itemBlock">永久有效</el-radio>
              <!-- effectiveType:1, effectiveDays:5 -->
              <el-radio :label="1">
                领取后
                <el-input
                  v-model="ruleForm.effectiveDays"
                  maxlength="4"
                  @input="
                    val => {
                      ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
                    }
                  "
                  :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1"
                  placeholder="请输入"
                  size="small"
                  style="width: 100px"
                ></el-input>
                天内有效
              </el-radio>
              <!-- effectiveStartTime  effectiveEndTime +具体时间 -->
              <el-radio :label="2">
                <el-date-picker :size="small" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 2" style="width: 230px" v-model="ruleForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
              </el-radio>
            </el-radio-group>
          </div>
        </el-form-item>
        <el-form-item size="small" label="使用限制" prop="customUseLimit">
          <div class="radioGroupWrap">
            <el-radio-group v-model="ruleForm.customUseLimit" :disabled="disabledContent">
              <el-radio :label="0" class="itemBlock">不限制使用次数</el-radio>
              <!-- useType:1  useAmount:6 -->
              <el-radio :label="1">
                有效期内可使用
                <el-button @click="sub1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">-</el-button>
                <div class="numWrap">{{ ruleForm.limitTime1 }}</div>
                <el-button @click="add1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">+</el-button>
                次
              </el-radio>
              <el-radio :label="2">
                有效期内每
                <el-input
                  v-model="ruleForm.limitDays"
                  maxlength="4"
                  @input="
                    val => {
                      ruleForm.limitDays = val.replace(/[^\d]/g, '')
                    }
                  "
                  :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
                  placeholder="请输入"
                  size="small"
                  style="width: 100px"
                ></el-input>
                天内可使用
                <el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
                <span class="numWrap">{{ ruleForm.limitTime2 }}</span>
                <el-button @click.stop="add2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">+</el-button>
                次
              </el-radio>
            </el-radio-group>
          </div>
        </el-form-item>
        <el-form-item size="small" label="会员价" prop="vipPrice" style="width: 315px">
          <el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.vipPrice" placeholder="请输入" @keyup.native="ruleForm.vipPrice = oninput(ruleForm.vipPrice)">
            <!-- <template slot="append">元</template> -->
            <span slot="suffix" class="suffix-label">元</span>
          </el-input>
        </el-form-item>
        <el-form-item size="small" label="门店价" prop="shopPrice" style="width: 315px">
          <el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.shopPrice" placeholder="请输入" @keyup.native="ruleForm.shopPrice = oninput(ruleForm.shopPrice)">
            <!-- <template slot="append">元</template> -->
            <span slot="suffix" class="suffix-label">元</span>
          </el-input>
        </el-form-item>
        <el-form-item size="small" label="库存" prop="stock" style="width: 315px">
          <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item size="small" label="使用说明" prop="useDescription" style="width: 670px">
          <el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input>
        </el-form-item>
        <el-form-item size="small" style="margin-left: -100px" v-show="isEdit">
          <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
        </el-form-item>
        <!-- <el-form-item size="small">
          <el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
          <el-button type="primary" @click="resetForm('ruleForm')" size="small">重置</el-button>
        </el-form-item> -->
      </el-form>

      <!-- <div class="serviceCard">
        <div class="cardtop">
          <img src="@/assets/serviceMemberCard.png" alt="" />
          <span class="serviceName ellipsis-1" :title="ruleForm.couponName">{{ ruleForm.couponName || '-' }}</span>
          <span class="effectiveRange">{{ limitText }}</span>
          <span class="timeRange">{{ effectiveRangeText }}</span>
          <div class="grayLine"></div>
          <div class="desc">使用说明:</div>
          <span class="detailDesc">{{ ruleForm.useDescription }}</span>
        </div>
      </div> -->
      <div class="right_show">
        <div class="card-top"></div>
        <div class="slider">
          <div class="card_one">
            <div :class="ruleForm.status == 3 ? 'darkColor' : ''" class="cname">{{ ruleForm.couponName }}</div>
            <img src="../../images/unService.png" class="couponImg" v-if="ruleForm.status == 3" />
            <img src="../../images/service.png" class="couponImg" v-else />

            <!-- <div class="ctype">
              <div class="ctypeName"></div>
            </div> -->
            <div class="validityPeriod">
              <!-- <span class="ctime_name">有效期:</span> -->
              <span>{{ effectiveRangeText }}</span>
            </div>
            <div style="height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px;"></div>

            <div :class="ruleForm.status == 3 ? 'darkColor' : ''" class="ctime">
              <!-- <span class="ctime_name">使用限制:</span> -->
              <span class="ctime_content">{{ limitText }}</span>
            </div>
            <div class="ccode">
              <img src="../../assets/coupon/code2.png" />
            </div>
            <div style="height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"></div>
            <div class="process">
              <img src="../../images/unArrow.png" v-if="ruleForm.status == 3" />
              <img src="../../images/arrow.png" v-else />
              <span class="process_text">导航到店</span>
              <img class="rightArrow" src="../../images/rightArrow.png" />
              <img src="../../images/unCar.png" v-if="ruleForm.status == 3" />
              <img src="../../images/car.png" v-else />
              <span class="process_text">开始服务</span>
              <img class="rightArrow" src="../../images/rightArrow.png" />
              <img src="../../images/unTicket.png" v-if="ruleForm.status == 3" />
              <img src="../../images/ticket.png" v-else />
              <span class="process_text">出示核销码</span>
            </div>
          </div>
          <div class="card_two">
            <div class="cremarks">有效日期:</div>
            <div class="validityPeriod" style="margin: 0 8px 8px 8px;">
              <span>{{ effectiveRangeText }}</span>
            </div>
            <div class="cremarks">使用说明:</div>
            <div class="cremarks_content" style="white-space:pre-wrap">{{ ruleForm.useDescription }}</div>
          </div>
        </div>
      </div>
    </div>
    <GLFooter>
      <el-button @click="goBack" size="medium">取消</el-button>
      <el-button type="primary" @click="submitForm('ruleForm')" size="medium" :loading="sloading" v-if="showSubmit">确定</el-button>
    </GLFooter>
    <GLDialog mode="small" :hasFooter="hasFooter" type="warning" content="当前有内容信息未保存,是否继续返回?" @onOk="handleConfirm" @onCancel="handleClose" :visible.sync="isDialogVisible"></GLDialog>
  </div>
</template>

<script>
import { limitPrice } from '@/common/constant'
import { createService, detailService, updateService } from '@/api/modules/service'
export default {
  data() {
    var checkZero = (rule, value, callback) => {
      setTimeout(() => {
        if (value == 0) {
          callback(new Error('请输入有效数字值'))
        } else {
          callback()
        }
      })
    }
    var checkStock = (rule, value, callback) => {
      if (value <= 0) {
        return callback(new Error('库存不能为空或负数'))
      }
      setTimeout(() => {
        if (!Number.isInteger(value)) {
          callback(new Error('请输入数字值'))
        } else {
          if (value < 0) {
            callback(new Error('必须大于或等于0'))
          } else {
            callback()
          }
        }
      }, 1000)
    }
    return {
      isEdit: false,
      showSubmit: true,
      disabledDescription: false,
      disabledCost: false,
      sloading: false,
      isDialogVisible: false,
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7 // 如果没有后面的-8.64e7就是不可以选择今天的
        }
      },
      ruleForm: {
        anticipatedCost: '',
        couponName: '',
        // region: '',
        // date1: '',
        // date2: '',
        // delivery: false,
        // type: [],
        // resource: '',
        effectiveType: 3, //有效期(默认永久有效)
        effectiveDays: '',
        customUseLimit: 0, //使用限制(默认不限制使用次数)
        limitTime1: 1,
        limitDays: '30',
        limitTime2: 5,
        vipPrice: '',
        shopPrice: '',
        stock: '',
        useDescription: '',
        daterange: []
      },
      copyRuleForm: {},
      rules: {
        anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
        couponName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
        // region: [{ required: true, message: '请选择活动区域', trigger: 'change' }],
        // date1: [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }],
        // date2: [{ type: 'date', required: true, message: '请选择时间', trigger: 'change' }],
        // type: [{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }],
        effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
        customUseLimit: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
        vipPrice: [
          { required: true, message: '请输入会员价', trigger: 'blur' },
          { validator: checkZero, trigger: 'blur' }
        ],
        shopPrice: [
          { required: true, message: '请输入门店价', trigger: 'blur' },
          { validator: checkZero, trigger: 'blur' }
        ],
        stock: [
          { required: true, message: '请输入库存', trigger: 'blur' },
          { validator: checkStock, trigger: 'blur' }
        ]

        // useDescription: [{ required: true, message: '请填写活动形式', trigger: 'blur' }]
      },
      merchantId: '',
      merchantName: '',
      title: this.$route.query.title || ''
    }
  },
  computed: {
    disabledContent() {
      if (this.title == '查看' || this.title == '编辑') {
        return true
      }
      return false
    },
    limitText() {
      if (this.ruleForm.customUseLimit == 0) {
        return `不限次数`
      } else if (this.ruleForm.customUseLimit == 1) {
        return `有效期内可使用${this.ruleForm.limitTime1}次`
      } else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType != 3) {
        return `有效期内每${this.ruleForm.limitDays}天内可使用${this.ruleForm.limitTime2}次`
      } else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType == 3) {
        return '不限次数'
      }
      return '不限次数'
    },
    effectiveRangeText() {
      if (this.ruleForm.effectiveType == 1) {
        return `领取后${this.ruleForm.effectiveDays}天内有效`
      } else if (this.ruleForm.effectiveType == 2) {
        return `${this.ruleForm.daterange[0]}-${this.ruleForm.daterange[1]}`
      }
      return '永久有效'
    }
    // 有效期内可使用3次
  },
  created() {
    this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
    if (window.__POWERED_BY_QIANKUN__) {
      //运行在qiankun容器中
      this.merchantId = this.$globalState.session.merchantId
      this.merchantName = this.$globalState.session.merchantName
    }
    if (this.title == '编辑' || this.title == '查看') {
      this.isEdit = true
      var breadcrumbTitle = this.title
      // document.getElementsByClassName('el-breadcrumb__item')[3].innerText = `${breadcrumbTitle}服务`
      // document.getElementById('tab-/membercenter/memberCenter/serviceAddUpdateLook').innerHTML = 'AAAAAAAA'
      this.getPageDetail()
    }
  },
  mounted() {
    this.footerLeft = document.querySelector('.base-container-right').offsetLeft
    this.footerWidth = document.documentElement.clientWidth - this.footerLeft
    if (this.title == '查看' || this.title == '编辑') {
      this.disabledCost = true
      this.disabledDescription = true
      this.showSubmit = false
    }
  },
  watch: {
    'ruleForm.anticipatedCost'(newValue, oldValue) {
      this.ruleForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
    }
  },
  methods: {
    editMessage() {
      console.log('111')
      this.disabledCost = false
      this.disabledDescription = false
      this.showSubmit = true
    },
    getPageDetail() {
      let params = {}
      params.couponId = this.$route.query.couponId
      detailService(params).then(res => {
        this.ruleForm = res
        this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
        this.ruleForm.customUseLimit = res.useType

        if (res.effectiveType == 1) {
          this.ruleForm.effectiveDays = res.effectiveDays
        }
        if (res.effectiveType == 2) {
          this.ruleForm.daterange = [res.effectiveStartTime, res.effectiveEndTime]
        }
        // this.ruleForm.limitTime1 = ''
        // this.ruleForm.limitTime2 = ''
        // this.limitDays = ''
        if (res.useType == 1) {
          this.ruleForm.limitTime1 = res.useAmount
        }
        if (res.useType == 2) {
          this.ruleForm.limitTime2 = res.useAmount
          this.ruleForm.limitDays = res.useLimitDays
        }
        this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
      })
    },
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          if (this.isEdit == true) {
            this.updateService()
          } else {
            this.createService()
          }
        } else {
          return false
        }
      })
    },
    //创建服务
    createService() {
      let params = {
        effectiveDays: '',
        useAmount: '',
        useLimitDays: ''
      }
      params.anticipatedCost = this.ruleForm.anticipatedCost * 100
      params.directionalFlag = '1'
      params.couponName = this.ruleForm.couponName
      //有效期
      params.effectiveType = this.ruleForm.effectiveType
      //使用限制
      params.useType = this.ruleForm.customUseLimit
      //有效期 effectiveType: 3 1 2
      if (this.ruleForm.effectiveType == 1 && !parseInt(this.ruleForm.effectiveDays)) {
        this.$message.error('请输入有效期')
        return false
      }
      params.effectiveDays = this.ruleForm.effectiveDays
      if (this.ruleForm.effectiveType == 2) {
        if (!this.ruleForm.daterange) {
          this.$message.error('请输入有效期')
          return false
        } else {
          params.effectiveStartTime = this.ruleForm.daterange[0] + ' 00:00:00'
          params.effectiveEndTime = this.ruleForm.daterange[1] + ' 23:59:59'
        }
      }
      //使用限制
      if (this.ruleForm.customUseLimit == 1) {
        if (!parseInt(this.ruleForm.limitTime1)) {
          this.$message.error('请输入有效期使用次数')
          return false
        } else {
          params.useAmount = this.ruleForm.limitTime1
        }
      }
      if (this.ruleForm.customUseLimit == 2) {
        if (!parseInt(this.ruleForm.limitTime2) || !parseInt(this.ruleForm.limitDays)) {
          this.$message.error('请输入有效期使用次数')
          return false
        } else {
          params.useLimitDays = this.ruleForm.limitDays
          params.useAmount = this.ruleForm.limitTime2
        }
      }

      params.vipPrice = this.ruleForm.vipPrice
      params.shopPrice = this.ruleForm.shopPrice
      params.stock = this.ruleForm.stock
      params.useDescription = this.ruleForm.useDescription

      params.discountType = 7
      params.merchantId = this.merchantId
      params.merchantName = this.merchantName
      this.sloading = true
      createService(params)
        .then(res => {
          if (res.code == 0) {
            this.sloading = false
            this.$message.success('操作成功')
            this.$router.push('/memberCenter/service')
          } else {
            this.sloading = false
            this.$message({
              type: 'error',
              message: res.message
            })
          }
        })
        .catch(err => {
          this.sloading = false
        })
        .finally(() => {
          this.sloading = false
        })
    },
    //更新服务
    updateService() {
      let param = {}
      param.anticipatedCost = this.ruleForm.anticipatedCost * 100
      param.discountType = 7
      param.merchantId = this.merchantId
      param.merchantName = this.merchantName
      param.couponId = this.$route.query.couponId
      param.stock = this.ruleForm.stock
      param.useDescription = this.ruleForm.useDescription
      this.sloading = true
      updateService(param)
        .then(res => {
          if (res.code == 0) {
            this.sloading = false
            this.$message.success('编辑服务成功')
            this.$router.push('/memberCenter/service')
          } else {
            this.sloading = false
            this.$message({
              type: 'error',
              message: res.message
            })
          }
        })
        .catch(err => {
          this.sloading = false
        })
        .finally(() => {
          this.sloading = false
        })
    },

    goBack() {
      if (JSON.stringify(this.ruleForm) == JSON.stringify(this.copyRuleForm)) {
        this.$router.push('/memberCenter/service')
      } else {
        // this.$message.error('是否保存信息')
        this.isDialogVisible = true
      }
    },
    handleClose() {
      this.isDialogVisible = false
    },
    handleConfirm() {
      this.$router.push('/memberCenter/service')
    },
    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 (Number(value) >= 999999999) {
        return (str = 999999999)
      }
      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
    },
    sub1() {
      if (this.ruleForm.limitTime1 <= 0) {
        return
      }
      this.ruleForm.limitTime1--
    },
    add1() {
      this.ruleForm.limitTime1++
    },
    sub2() {
      if (this.ruleForm.limitTime2 <= 0) {
        return
      }
      this.ruleForm.limitTime2--
    },
    add2() {
      this.ruleForm.limitTime2++
    }
  }
}
</script>

<style lang="scss" scoped>
.live-room {
  /deep/ .el-icon-warning {
    color: #5850ff !important;
  }
  .topMsg {
    margin: 20px 0px 0;
    padding: 0 20px;
    background-color: #fff;
    height: 56px;
    border-bottom: 1px solid#DCDFE6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .pageTitle {
      position: relative;
      // margin-bottom: 20px;
      // height: 20px;
      font-size: 20px;
      font-weight: 700;
      color: #333333;
      line-height: 20px;
      letter-spacing: 1px;
    }
  }
  .container {
    margin: 0 0px 16px;

    position: relative;
    /deep/ .el-form-item__content {
      .radioGroupWrap {
        width: 550px;
        height: 164px;
        background-color: #f4f6fc;
        padding-top: 10px;
        padding-left: 20px;
      }
    }
    .numWrap {
      display: inline-block;
      background-color: #fff;
      min-width: 34px;
      height: 22px;
      text-align: center;
      line-height: 22px;
      margin: 0 2px;
      vertical-align: text-bottom;
    }
    .addsubBtn {
      background-color: #fff;
      color: #5850ff;
      padding: 5px 9px;
    }
    .el-radio {
      display: block;
      &:not(:first-child) {
        margin-top: 18px;
      }
    }
    .itemBlock {
      margin-top: 10px;
    }
    // .serviceCard {
    //   position: absolute;
    //   padding: 10px;
    //   box-sizing: border-box;

    //   top: 136px;
    //   right: 78px;
    //   width: 343px;
    //   min-height: 184px;
    //   background: #ffffff;
    //   box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
    //   border-radius: 4px;
    //   border: 1px solid #e4e7ed;
    //   span {
    //     font-size: 12px;

    //     font-weight: 400;
    //     color: #999999;
    //   }
    //   .cardtop {
    //     position: relative;
    //     .serviceName {
    //       position: absolute;
    //       left: 88px;
    //       top: 5px;
    //       width: 230px;
    //       font-size: 14px;

    //       font-weight: 600;
    //       color: #333333;
    //     }
    //     .effectiveRange {
    //       position: absolute;
    //       left: 88px;
    //       top: 30px;
    //     }
    //     .timeRange {
    //       position: absolute;
    //       left: 88px;
    //       top: 60px;
    //     }
    //     .grayLine {
    //       position: absolute;
    //       width: 100%;
    //       left: 0;
    //       top: 90px;
    //       height: 1px;
    //       opacity: 0.14;
    //       background-color: #979797;
    //     }
    //     .desc {
    //       margin-top: 20px;
    //       margin-left: 88px;
    //       color: #333;
    //     }
    //     .detailDesc {
    //       display: inline-block;
    //       margin-left: 88px;
    //       margin-top: 10px;
    //       width: 230px;
    //       word-wrap: break-word;
    //     }
    //   }
    // }
  }
  .footer-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    width: 100%;
    bottom: 0px;
    height: 64px;
    background: #ffffff;
    z-index: 999;
    box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
  }
}
.right_show {
  position: absolute;
  z-index: 10;
  height: 566px;
  width: 290px;
  right: 44px;
  top: 92px;
  background-image: url(../../assets/coupon/phone.png);
}

.right_show .card-top {
  height: 59px;
  width: 251px;
  margin-left: 18px;
  margin-top: 55px;
}

.card_one {
  width: 243px;
  height: 285px;
  background: #ffffff;
  border-radius: 4px;
  margin-left: 22px;
  margin-top: 5.81px;
}

.cname {
  margin: 16px 0 10px 16px;
  display: inline-block;
  font-size: 18px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #fc5b32;
  max-width: 164px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 35px;
}

.ctype {
  width: 48px;
  height: 20px;
  background: #5850ff;
  border-radius: 2px;
  margin-right: 8px;
  margin-top: 8px;
  display: inline-block;
  float: right;
}

.ctypeName {
  width: 36px;
  height: 17px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #ffffff;
  font-weight: 400;
  margin-left: 6px;
}

.ctime {
  margin: 8px 16px 9px;
  text-align: center;
  color: #fc5b32;
}
/* .ctime_name {
  width: 48px;
  height: 17px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #333333;
  font-weight: 400;
} */

.ctime_content {
  height: 17px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  font-weight: 400;
  margin-left: 5px;
}

.ccode {
  width: 120px;
  height: 120px;
  margin: 0 16px;
  margin: auto;
}

.ccodeName {
  width: 68px;
  height: 17px;
  font-family: PingFangSC-Medium;
  font-size: 12px;
  color: #1d1d1d;
  font-weight: 500;
  margin-left: 88px;
  margin-top: 8px;
}

.link-top {
  width: 227px;
  height: 1px;
  background: #eeeeee;
  margin-left: 8px;
  margin-top: 8px;
}

.code_d {
  margin-left: 98px;
  margin-top: 10px;
}

.card_two {
  width: 243px;
  height: 162px;
  background: #ffffff;
  border-radius: 4px;
  margin-left: 22px;
  margin-top: 8px;
}

.cremarks {
  padding-left: 8px;
  padding-top: 8px;
  width: 60px;
  height: 17px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #333333;
  font-weight: 400;
}

.cremarks_content {
  margin-left: 8px;
  margin-right: 8px;
  margin-top: 4px;
  width: 227px;
  height: 80px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #666666;
  font-weight: 400;
  word-break: break-word;
  overflow: auto;
}
.promptCopy {
  font-size: 14px;
  font-family: PingFangSC-Regular, PingFang SC;
  color: #999;
  margin-left: -10px;
}
.couponImg {
  width: 69px;
  height: 69px;
  position: sticky;
  float: right;
  margin-top: -6px;
  margin-right: -6px;
}
.validityPeriod {
  font-size: 12px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #a0a0a0;
  margin: 0 16px 8px 16px;
}
.process {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.process .process_text {
  margin-left: 2px;
  font-size: 12px;
  color: #333;
}
.process img {
  width: 12px;
  height: 12px;
}
.process .rightArrow {
  padding: 0 4px;
}
.slider {
  height: 380px;
  overflow: auto;
}
.slider::-webkit-scrollbar-thumb {
  background: transparent;
}
.darkColor {
  color: #999;
}
</style>