lighting.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="lighting-index">
  3. <view class="lighting-box" @click="isOpen = !isOpen">
  4. <view class="lighting-icon">
  5. <uni-icons type="icon-diandeng" custom-prefix="iconfont" size="60" color="#a1a1a1"></uni-icons>
  6. </view>
  7. <view class="lighting-content">
  8. <uni-icons type="icon-caozuo-kaiguan" custom-prefix="iconfont" size="40"
  9. :color="isOpen ? '#08979c' : '#cccccc'"></uni-icons>
  10. <view class="lighting-title">{{title}}</view>
  11. <view class="lighting-space">{{space}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: ['title', 'space'],
  19. data() {
  20. return {
  21. isOpen: false
  22. }
  23. },
  24. }
  25. </script>
  26. <style lang="scss">
  27. .lighting-index {
  28. padding: 60rpx;
  29. .lighting-box {
  30. background: #fff;
  31. width: 560rpx;
  32. height: 560rpx;
  33. margin: 0 auto;
  34. background: linear-gradient(to bottom, #dcdee1, #f2f2f2);
  35. box-shadow: 0px 5px 10px rgba(3, 3, 3, 0.08);
  36. display: flex;
  37. flex-direction: column;
  38. .lighting-icon {
  39. flex: 1;
  40. text-align: center;
  41. padding-top: 40rpx;
  42. }
  43. .lighting-content {
  44. text-align: center;
  45. padding-bottom: 30rpx;
  46. color: $uni-secondary-color;
  47. font-weight: 300;
  48. }
  49. .lighting-title {
  50. margin: 30rpx 0 15rpx 0;
  51. }
  52. .lighting-space {
  53. font-size: 12px;
  54. }
  55. }
  56. }
  57. </style>