<template>
  <view>

    <view class="flex card">
      <view class="flex label">
        <image class="icon" src="/pages_order/static/center/icon-wx.png" mode="scaleToFill"></image>
        <view>官方微信公众号</view>
      </view>
      <button class="flex btn" @click="openPopup">
        <text class="btn-text">即刻关注</text>
        <uv-icon name="arrow-right" color="#C6C6C6" size="24rpx"></uv-icon>
      </button>
    </view>

    <popupQrCode ref="popup" :src="qrCodeUrl"></popupQrCode>
  </view>
</template>

<script>
	import { mapState } from 'vuex'

  import popupQrCode from './popupQrCode.vue';

  export default {
    components: {
      popupQrCode,
    },
		computed: {
			...mapState(['configList']),
      qrCodeUrl() {
        // todo: check key
        return this.configList['account']
      },
		},
    methods: {
      openPopup() {
        this.$refs.popup.open()
      },
    },
  }
</script>

<style scoped lang="scss">
@import './styles/card.scss';

.card {
  padding: 24rpx 32rpx;
  justify-content: space-between;
}

.icon {
  width: 64rpx;
  height: 64rpx;
}

.label {
  column-gap: 16rpx;
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 28rpx;
  line-height: 1;
  color: #252545;
}


.btn {
  font-family: PingFang SC;
  font-size: 24rpx;
  font-weight: 400;
  line-height: 1.4;
  color: #A8A8A8;

  &-text {
    margin-right: 4rpx;
  }
}
</style>