default-page.vue 1.3 KB

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