// component/relatedOrderItem/relatedOrderItem.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo

Component({
	/**
	 * 组件的属性列表
	 */
	properties: {
    selectShow: { // 显示标识
      type: Boolean,
      value: false
    }
	
  },
  attached () {
    if (this.data.selectShow){
      
    }
    this.getProList()
	},
	/**
	 * 组件的初始数据
	 */
	data: {
		isSelect:false,
    proList:[]
	},
	/**
	 * 组件的方法列表
	 */
	methods: {
		selectCoupon(e) {
      console.log(e)
      let params = {
        id: e.currentTarget.dataset.item
      }
      this.setData({
        isSelect: !this.data.isSelect
      })
      wxService.nextTick(() => {
        this.triggerEvent('_selectCoupon', params)
      })
    },

    getProList(){
      wxService.post(`/sale/product/buyer/listWithMember`).then(res => {
        const { result, data } = res.data
        if (result == 0) {
         this.setData({
           proList: data
         })
         console.log(data)
        }
      }).finally(() => {
      })

    }
  }
})
