绿满眶商城微信小程序-uniapp
xiangpei
2025-05-09 c3e6cdbb29580e77444541c7953aca33581a4267
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<template>
    <view class="default-page">
        <view class="default-wrap">
            
            <text>{{title}}</text>
            <view v-if="isBtn" class="btn" @click="toHome">
                去逛逛
            </view>
        </view>
    </view>
</template>
 
<script>
export default {
    props: {
        // 购物车 cart 消息 msg  订单 order 查询 search
        type: {
            type: String,
            default: 'search'
        },
        isBtn:{
            type: Boolean,
            default: false
        },
        title:{
            type: String,
            default: '没有相关内容'
        }
    },
    
    data() {
        return {
            src:''
        };
    },
    mounted() {
        this.src ='/static/default/default_'+ this.type + '.png';
    },
    methods: {
        toHome() {
            uni.switchTab({
                url: '/pages/home/home'
            });
        }
    }
};
</script>
 
<style lang="scss" scoped>
    .default-page{
        background: #FFFFFF;
        width: 100%;
        height: 100vh;
        .default-wrap{
            position: absolute;
            top: calc(50vh - 320rpx);
            left: calc(50% - 120rpx);
            display: flex;
            flex-direction: column;
            align-items: center;
            
            >image{
                width: 260rpx;
                height: 240rpx;
                
                margin-bottom: 24rpx;
            }
            text{
                font-size: 32rpx;
                color: #828385;
            }
            .btn{
                width: 160rpx;
                height: 56rpx;
                border: 2rpx solid #3180F6;
                border-radius: 6rpx;
                text-align: center;
                line-height: 56rpx;
                margin-top: 32rpx;
                font-size: 24rpx;
                color: #3180F6;
            }
        }
        
    }
</style>