payCard.vue 1.59 KB
<!--
 * @Date: 2023-12-20 14:11:11
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2023-12-20 14:56:37
 * @FilePath: /meihuaApp/src/components/payCard.vue
 * @Description: 文件描述
-->
<template>
  <div class="pay-card">
    <nut-action-sheet v-model:visible="props.visible" title="" @close="onClose">
      <view style="padding: 2rem 1rem; text-align: center;">
        <view style="font-size: 32rpx;">实付金额</view>
        <view style="color: red; margin: 10rpx 0;"><text style="font-size: 50rpx;">¥</text><text style="font-size: 80rpx;">{{ price }}</text></view>
        <view style="font-size: 28rpx; margin-bottom: 20rpx;">支付剩余时间 <text style="color: red;">{{ remain_time }}</text></view>
        <nut-button block color="#6A4925" @tap="goToPay">立即支付</nut-button>
      </view>
    </nut-action-sheet>
  </div>
</template>

<script setup>
import Taro from '@tarojs/taro'
import { ref, watch, onMounted } from 'vue'

const props = defineProps({
  visible: {
    type: Boolean,
    default: false,
  },
  data: {
    type: Object,
    default: {},
  },
});

const emit = defineEmits(['close']);

const onClose = () => {
  emit('close');
}

const id = ref('');
const price = ref('');
const remain_time = ref('');

watch(
  () => props.visible,
  (val) => {
    if (val) {
      id.value = props.data.id;
      price.value = props.data.price;
      remain_time.value = props.data.remain_time;
    } else {

    }
  }
)

onMounted(() => {
})

const goToPay = () => {
  Taro.navigateTo({
    url: '/pages/payInfo/index?id=123',
  });
}
</script>

<style lang="less">

</style>