123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="cu-modal" :class="{ show: visible }">
- <view class="mask" @click="close"></view>
- <view class="cu-dialog" style="background-color: transparent; width: 100%">
- <view class="relative wrapper">
- <view v-if="type === 0" class="text">是否要合成蛋糕</view>
- <view v-else class="text">是否要购买材料《{{ material }}》</view>
- <view class="cancel">
- <image :src="resource.doll_btn_cancel" class="x" @click="close" />
- </view>
- <view class="confirm">
- <image :src="resource.doll_btn_confirm" class="x" @click="submit" />
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import resource from '@/utils/resource'
- export default {
- data() {
- return {
- resource,
- visible: false,
- id: null,
- material: '',
- type: 1
- }
- },
- methods: {
- show(data) {
- if (data === 0) {
- this.type = data
- } else {
- this.id = data.id
- this.material = data.name
- }
- this.visible = true
- },
- close() {
- this.visible = false
- },
- submit() {
- this.visible = false
- if (this.type === 0) {
- this.$emit('submit', this.type)
- } else {
- this.$emit('submit', this.id)
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mask {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- }
- .wrapper {
- width: 566rpx;
- height: 300rpx;
- background-color: #a4bef3;
- border: 10rpx solid #0035d9;
- border-radius: 48rpx;
- margin: 220rpx 92rpx 0;
- }
- .text {
- font-size: 40rpx;
- color: #fff;
- margin: 58rpx auto 0;
- text-align: center;
- }
- .cancel {
- position: absolute;
- bottom: 30rpx;
- left: 42rpx;
- }
- .confirm {
- position: absolute;
- bottom: 30rpx;
- right: 42rpx;
- }
- .x {
- width: 232rpx;
- height: 88rpx;
- }
- </style>
|