xkxBuy.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>朗读小咖秀</title>
  7. </head>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. #container {
  14. overflow: hidden;
  15. width: 100%;
  16. height: 938px;
  17. background: url('./img/bg.jpg') no-repeat;
  18. background-size: 100% 100%;
  19. }
  20. .commoditys {
  21. display: flex;
  22. align-items: center;
  23. justify-content: space-between;
  24. margin: 30px auto;
  25. width: 9.0133rem;
  26. height: 3.4667rem;
  27. padding: 14px 10px;
  28. box-sizing: border-box;
  29. background: white;
  30. border-radius: 20px;
  31. }
  32. .commodity {
  33. position: relative;
  34. width: 97px;
  35. height: 97px;
  36. border-radius: 6px;
  37. border: 2px solid white;
  38. }
  39. .active {
  40. position: absolute;
  41. width: 27px;
  42. height: 18px;
  43. right: 0;
  44. bottom: 0;
  45. }
  46. .aborder {
  47. border-color: #ff935e;
  48. }
  49. .c-1 {
  50. background: url('./img/299.png');
  51. background-size: contain;
  52. }
  53. .c-2 {
  54. background: url('./img/99.png');
  55. background-size: contain;
  56. }
  57. .c-3 {
  58. background: url('./img/15.png');
  59. background-size: contain;
  60. }
  61. </style>
  62. <body>
  63. <div id="container">
  64. <div class="commoditys">
  65. <div :class="['commodity c-1', active==1?'aborder':'']" @click="selected(1)">
  66. <img src="./img/active.png" class="active" v-show="active==1" />
  67. </div>
  68. <div :class="['commodity c-2', active==2?'aborder':'']" @click="selected(2)">
  69. <img src="./img/active.png" class="active" v-show="active==2" />
  70. </div>
  71. <div :class="['commodity c-3', active==3?'aborder':'']" @click="selected(3)">
  72. <img src="./img/active.png" class="active" v-show="active==3" />
  73. </div>
  74. </div>
  75. </div>
  76. </body>
  77. <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
  78. <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.2/??flexible_css.js,flexible.js"></script>
  79. <script>
  80. let app = new Vue({
  81. el: '#container',
  82. data: {
  83. active: 1
  84. },
  85. mounted() {
  86. },
  87. methods: {
  88. selected(e) {
  89. this.active = e
  90. }
  91. }
  92. })
  93. </script>
  94. </html>