index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="container">
  3. <uni-search-bar class="uni-mt-10" radius="100" placeholder="搜索" clearButton="auto" cancelButton="none" @confirm="search" />
  4. <view class="iconBox">
  5. <view class="box">
  6. <view class="item" v-for="(item,index) in iconType" :key="index">
  7. <uni-icons class="icons" :type="item.icon" size="26"></uni-icons>
  8. <text>{{ item.name }}</text>
  9. </view>
  10. </view>
  11. </view>
  12. <goosList class="goos" :data="marketList"></goosList>
  13. <text>分类</text>
  14. <text>推荐</text>
  15. <text>悬浮购物车</text>
  16. </view>
  17. </template>
  18. <script>
  19. import { mapActions, mapState } from "vuex";
  20. export default {
  21. data() {
  22. return {
  23. iconType: [
  24. { name: '会员', icon: 'vip-filled' },
  25. { name: '期刊', icon: 'vip-filled' },
  26. { name: '文章', icon: 'vip-filled' },
  27. { name: '商品', icon: 'vip-filled' }
  28. ]
  29. };
  30. },
  31. computed: {
  32. ...mapState(['marketList'])
  33. },
  34. async mounted() {
  35. await this.marketQuery();
  36. },
  37. methods: {
  38. ...mapActions(['marketQuery']),
  39. search (e) {
  40. console.log(e);
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scope>
  46. .search-result {
  47. padding-top: 10px;
  48. padding-bottom: 20px;
  49. text-align: center;
  50. }
  51. .search-result-text {
  52. text-align: center;
  53. font-size: 14px;
  54. color:#666;
  55. }
  56. .example-body {
  57. /* #ifndef APP-NVUE */
  58. display: block;
  59. /* #endif */
  60. padding: 0px;
  61. }
  62. .goos /deep/ .uni-list {
  63. display: flex;
  64. flex-direction: row !important;
  65. flex-wrap: wrap;
  66. padding: 5px;
  67. box-sizing: border-box;
  68. }
  69. .iconBox {
  70. width: 100%;
  71. padding:15px 0;
  72. background: #fff;
  73. margin-bottom: 10px;
  74. .box {
  75. margin: 0 auto;
  76. width: 90%;
  77. height: 80%;
  78. display: flex;
  79. }
  80. .item {
  81. width: 27%;
  82. .icons {
  83. display: block;
  84. }
  85. text {
  86. width: 100%;
  87. display: block;
  88. text-align: center;
  89. }
  90. }
  91. }
  92. </style>