index.vue 5.28 KB
<template>
  <div class="task-wrap">
    <div class="task-hd">
      <div class="sprite-icon icon-remind"></div>
      <span class="tip">客户跟进提醒</span>
    </div>
    <div class="task-ct">
      <div class="ct-title">跟进内容</div>
      <div>{{ params.noticeContent }}</div>
    </div>
    <div class="task-target">
      <h3>营销对象</h3>
      <div class="target-list">
        <scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
          <div class="target" v-for="(item, index) in targetList" :key="index" @click="gotoInfo(item)">
            <div class="target-top">
              <div class="portrait">
                <img :src="item.customerAvatarUrl" alt="" v-if="item.customerAvatarUrl" />
                <img src="../../assets/images/user.png" alt="" v-else />
              </div>
              <div class="info">
                <div class="info-name text-hide">{{ item.customerName }}</div>
                <div class="info-phone flex">
                  {{ item.customerPhone }}
                  <div class="sprite-icon icon-copy" @click.stop="copy(item.customerPhone)"></div>
                </div>
              </div>
              <div class="sprite-icon icon-phone" @click.stop="makePhone(item.customerPhone)" v-if="item.customerPhone"></div>
            </div>
            <div class="target-car flex">
              <div class="vehicleNo">
                车牌号:
                <span>{{ item.carNumber?item.carNumber:'--' }}</span>
              </div>
            </div>
          </div>
        </scroll-view>
      </div>
    </div>
  </div>
</template>
<script>
import { sopApi } from '@/api'
import { Toast } from 'vant'
export default {
  data() {
    return {
      params: {},
      targetList: []
    }
  },
  created() {
    this.params = this.getParams()
    this.params.noticeContent = decodeURIComponent(this.params.noticeContent)
    this.getNoticeCustomerList()
  },
  methods: {
    copy(text) {
      let input = document.createElement('input')
      input.value = text
      document.body.appendChild(input)
      input.select()
      input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
      document.body.removeChild(input)
      Toast('复制成功')
    },
    getNoticeCustomerList() {
      let { notebatchNo, batchNo, nodeId, userId } = this.params,
        data = {
          notebatchNo,
          batchNo,
          nodeId,
          userId
        }
      sopApi.getNoticeCustomerList(data).then(res => {
        this.targetList = res
      })
    },
    makePhone(phoneNumber) {
      this.makePhoneCall(phoneNumber)
    },
    getParams(name) {
      let [url, paramsList] = window.location.href.split('?')
      if (!paramsList) return name ? null : {}
      let param = paramsList.split('&')
      let obj = {}
      param.map(e => {
        let [key, value] = e.split('=')
        obj[key] = value
      })
      return name ? obj[name] : obj
    },
    onReachBottom() {}
  }
}
</script>
<style lang="scss" scoped>
.task-wrap {
  .task-hd {
    width: 100%;
    height: 104px;
    padding: 10px 20px;
    box-sizing: border-box;
    background: #4873c1;
    display: flex;
    .icon-remind {
      width: 32px;
      height: 32px;
    }
    .tip {
      font-size: 16px;
      color: #ffffff;
      line-height: 24px;
      margin-left: 8px;
    }
  }
  .task-ct {
    width: 351px;
    height: 98px;
    font-size: 14px;
    color: #1b233d;
    background: #ffffff;
    border-radius: 6px;
    padding: 12px 16px;
    margin: -50px 12px 16px;
    box-sizing: border-box;
    .ct-title {
      font-size: 15px;
      line-height: 22px;
      margin-bottom: 8px;
    }
  }
  .task-target {
    margin: 12px;
    h3 {
      font-size: 15px;
      color: #1b233d;
      font-weight: 500;
      margin-bottom: 8px;
    }
    .target-list {
      /deep/ .van-list {
        background: #f6f6f6;
      }
      //   background: #fff;
      .content {
        height: calc(100vh - 164px);
      }
      .target {
        padding: 0 16px;
        background: #ffffff;
        border-radius: 6px;
        box-sizing: border-box;
        position: relative;
        margin-bottom: 8px;
        .target-top {
          padding: 12px 0;
          display: flex;
          align-items: center;
          border-bottom: 1px solid #f6f6f6;
          .portrait {
            width: 40px;
            height: 40px;
            margin-right: 10px;
            img {
              width: 100%;
            }
          }
          .info {
            .info-name {
              font-size: 15px;
              color: #1b233d;
              line-height: 22px;
              width: 150px;
            }
            .info-phone {
              font-size: 13px;
              color: #7a8299;
            }
            .icon-copy {
              margin-left: 8px;
            }
          }

          .icon-phone {
            // width: 32px;
            // height: 32px;
            position: absolute;
            right: 16px;
            top: 16px;
          }
        }
        .target-car {
          padding: 8px 0;
          display: flex;
          align-items: center;
          .vehicleNo {
            font-size: 13px;
            color: #7a8299;
            line-height: 20px;
            span {
              color: #1b233d;
            }
          }
        }
      }
    }
  }
}
</style>