<template>
  <div class="good__cellGroup">
    <good-cell title="已选" @click.native="showSkuInfo"
      >{{ selectedSku.spec }}{{ selectedSku.spec ? '；' : '' }}{{ selectedSku.skuNum }}件</good-cell
    >
    <good-cell title="送至" @click.native="showAddrInfo">
      <cr-icon
        type="location-o"
        size="0.373rem"
        :color="receiverInfo.txt ? '#ec1500' : '#999999'"
        class="addr-icon"
      />
      {{ receiverInfo.txt || '请添加收货地址' }}
    </good-cell>
  </div>
</template>
<script>
import { mapGetters, mapActions } from '../store';

import goodCell from './goodsCell.vue';
export default {
  name: 'CellGroup',
  components: {
    goodCell
  },
  computed: {
    ...mapGetters(['selectedSku', 'receiverInfo'])
  },
  methods: {
    ...mapActions(['setPopupState']),
    showSkuInfo() {
      this.setPopupState({ type: 'sku', title: '' });
    },
    showAddrInfo() {
      this.setPopupState({ type: 'addr', title: '配送至' });
    }
  }
};
</script>
<style lang="less" scoped>
.addr-icon {
  margin-right: @padding-unit;
}
</style>
