<template>
    <view v-if="showdialog">
		<van-dialog  title="确定取消订单？"
		show-cancel-button="true"
		:show="showdialog"
		@cancel="cancelDialog" @confirm="confirmOrder"
		>
		</van-dialog>
	</view>
</template>

<script>
  export default {
    props:{
      orderCancel:{
        default: false,
        type: Boolean
      }
    },
    data() {
      return {
        showdialog: false
      }
    },
	watch:{
		'orderCancel':function(val) {
			console.log("监听中")
			if(val) {
				this.showdialog = true;
				console.log(this.showdialog)
			}
		}
	},
	created() {
		console.log(this.orderCancel)
	},
    methods: {
      cancelDialog() {
        this.show = false;
        this.$emit('colseDialog')
        console.log("取消")
        console.log(this.orderCancel);
      },
      confirmOrder() {
        this.show = false;
        this.$emit('confirmPay')
      },
    }
  }
</script>

<style>
	  
  .showdialog {
	  width: 100%;
	  height: 100vh;
  }
</style>
