scenePopup.js 2.3 KB
/*
 * @Description: 
 * @Author: huyue
 * @Date: 2024-05-07 15:29:35
 * @LastEditors: huyue
 * @LastEditTime: 2024-05-22 14:01:16
 */
// packageEquity/pages/aiCheck/components/scenePopup/scenePopup.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      type: Boolean
    },
    popType: {
      type: String
    },
    avatar:String,
    // 话术攻防的数据列表
    scriptList: {
      type: Array
    },
    // 对话灵感内容
    inspirationContent: {
      type: String,
      observer: function (n) {
        this.setData({content:n})
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    customeTypeList: [
      {
        id: 1,
        name: '独裁型',
        imgUrl: '2'
      },
      {
        id: 2,
        name: '沉默型',
        imgUrl: '1'
      },
      {
        id: 3,
        name: '理智型',
        imgUrl: '5'
      },
      {
        id: 4,
        name: '人际型',
        imgUrl: '7'
      },
      {
        id: 5,
        name: '犹豫型',
        imgUrl: '9'
      },
      {
        id: 6,
        name: '价格型',
        imgUrl: '3'
      },
      {
        id: 7,
        name: '新手司机',
        imgUrl: '4'
      },
      {
        id: 8,
        name: '老手司机',
        imgUrl: '1'
      },
      {
        id: 9,
        name: '女司机',
        imgUrl: '6'
      }
    ],
    selectedIndex: 0,
    config: {
      heightObj: {
        'scene': '960rpx',
        'inspiration': '720rpx',
        'script': '912rpx'
      },
      titleObj: {
        'scene': '场景设置',
        'inspiration': '',
        'script': '话术攻防'
      },
      hasClose: {
        'scene': true,
        'inspiration': false,
        'script': true
      }
    }
   
  },

  /**
   * 组件的方法列表
   */
  methods: {
    selectScript:wx.$util.throttle(function (e) {
      const {content,index} = e.currentTarget.dataset;
      this.triggerEvent('handleScript',{content,index})
    },2000),
    selectCustomerType(e) {
      this.setData({
        selectedIndex: e.currentTarget.dataset.index
      })
    },
    preserve() {
      this.triggerEvent('scene', { selectedIndex: this.data.selectedIndex })
    },
    cancel() {
      this.triggerEvent('cancel')
    },
    handleMask() {
      this.triggerEvent('handleMask')
    }
  }
})