<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) {
			if(val) {
				this.showdialog = true;
			}else {
				this.showdialog = false;
			}
		}
	},
	created() {
		console.log(this.orderCancel)
	},
    methods: {
      cancelDialog() {
        this.show = false;
        this.$emit('colseDialog')
      },
      confirmOrder() {
        this.show = false;
        this.$emit('confirmPay')
      },
    }
  }
</script>

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