index.vue 2.73 KB
<template>

	<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
		:mask-close-able="false">
		<view class="order-pop-view">
			<view class="order-pop-title">
				<text>{{title}}</text>
			</view>
			<view class="line-view" />
			<view class="order-content">
				<view v-if="count">
				你本月还有<text class="order-content-count">{{count}}</text>次拒单机会
				</view>
			</view>
			<view class="order-pop-text">
				<text>{{message}}</text>
			</view>
			<view class="order-pop-btn-view">
				<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary"
					@click="handleClickCancel">
					取消
				</u-button>
				<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure">
					{{buttonText}}
				</u-button>
			</view>
		</view>
	</u-popup>

</template>

<script>
	export default {
		props: {
			visible: Boolean,
			title: String,
			message: String,
			count: Number, // 剩余次数
			buttonText: {  // 确定按钮
				type: String,
				default: '查看'
			},
		},
		data() {
			return {}
		},
		computed: {
			customStyleCancel() {
				return {
					'background-color': '#D1D4D4',
					'width': '300rpx',
					'height': '104rpx',
					'background-color': 'transparent',
					'border': '1px solid #2272FF',
					'color': '#2272FF',
					'font-weight': 'bold',
					'font-size': '32rpx',
				}
			},
			customStyleSave() {
				return {
					'background-color': '#2272FF',
					'width': '300rpx',
					'height': '104rpx',
					'font-weight': 'bold',
					'font-size': '32rpx',
					'margin-left': '30rpx'
				}
			}
		},
		methods: {
			changeVisibleValue(val) {
				this.$emit('update:visible', val)
			},
			handleClickCancel() {
				this.changeVisibleValue(false)
				this.$emit('cancel')
			},
			handleClickSure() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.order-pop-view {
		padding: 30rpx;
		min-height: 520rpx;
		.order-pop-title {
			font-size: 40rpx;
			margin-top: 30rpx;
			margin-bottom: 34rpx;
			text-align: center;
			color: #333333;
		}
		
		.order-content {
			min-height: 14rpx;
			text-align: center;
			color: #333333;
			font-size: 32rpx;
			margin-top: 26rpx;
			.order-content-count {
				color: #FA5A49;
			}
		}

		.order-pop-text {
			color: #999999;
			text-align: center;
			margin-top: 30rpx;
			font-size: 28rpx;
			// margin-bottom: 180rpx;
		}

		.line-view {
			background-color: #F4F5F7;
			height: 2rpx;
			width: 100%;
		}

		.order-pop-btn-view {
			display: flex;
			position: absolute;
			bottom: 50rpx;
			align-items: center;
			justify-content: center;
		}
	}
</style>