<!-- 订单查看 - 支付 -->
<template>
	<el-form ref="formRef" :model="formData"  label-width="120px" :disabled="isDetail" :border="true" :class="{'mobile-card':mobile}">
    <el-row>
      <el-col :span="12">
        <el-form-item label="总金额" prop="no">
          {{ fenToYuan(formData.payPrice) }} 元
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="支付状态" prop="categoryId">
          {{ formData.payStatus }} 
        </el-form-item>
      </el-col>
    </el-row>
		
		<el-row>
      <el-col :span="12">
        <el-form-item label="支付方式" prop="brandId">
          {{ formData.payChannelCode=="wx_pub"? "微信支付":"其他" }} 
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="路径" prop="keyword">
          {{formData.path}}
        </el-form-item>
      </el-col>
    </el-row>
		
    <el-row>

      <el-col >
        <el-form-item label="备注" prop="keyword">
          {{formData.remark}}
        </el-form-item>
      </el-col>
    </el-row>
	</el-form>
  
</template>
<script lang="ts" setup>
	import { propTypes } from '@/utils/propTypes'
  import * as TradeOrderApi from '@/api/mall/trade/order'
  import { fenToYuan } from '@/utils'
  import { formatDate } from '@/utils/formatTime'
  import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
	const props = defineProps({
    id: propTypes.number.def(undefined), // 订单ID
    showPickUp: propTypes.bool.def(true) // 显示核销按钮
  })
  const formData = ref<TradeOrderApi.OrderVO>({
    logs: []
  })
  const id = props.id
  const getOrderPay = async () => {
    console.log(id)
    if (id) {
      const res = (await TradeOrderApi.getOrderPay(id)) as TradeOrderApi.OrderVO
      // 没有表单信息则关闭页面返回
      if (!res) {
        message.error('交易订单不存在')
      }
      formData.value = res
    }
  }
  import { useAppStore } from '@/store/modules/app'
  const appStore = useAppStore()
  const mobile = computed(() => appStore.getMobile)

	const message = useMessage() // 消息弹窗


	onMounted(async () => {
    getOrderPay()
	})
</script>
<style src="./OrderComponents.css"  lang="scss" scoped> </style>