index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']"
  3. class="bodycont">
  4. <tm-menubars ref="fenleig" title="分类" :shadow="0" :showback="true"></tm-menubars>
  5. <div class="cont" :style="{ height: (sys.windowHeight-80) + 'px' }">
  6. <tm-sheet black>
  7. <tm-sliderNav :style="{ height: (sys.windowHeight-80) + 'px' }" class="zuo fl" @change="change"
  8. :list="list" text color="red"></tm-sliderNav>
  9. <view class="fr you" :style="{ height: (sys.windowHeight-80) + 'px' }">
  10. <view class="huadong">
  11. <view class="py-10 text-size-g dianz mingri text-align-center mt-40">
  12. <image src="/static/img/88.png" mode="widthFix"></image>
  13. <text class="text-white">精选推荐</text>
  14. </view>
  15. <view class="yiguicla mt-20 ml-20 fl" v-for="item in quanbuList" @click="yifu()">
  16. <image :src="item.src" mode="widthFix"></image>
  17. <view class="wenzi text-align-center text-size-m mt-8">{{item.text}}</view>
  18. </view>
  19. <view style="width:100%;height:40px;clear: both;"></view>
  20. </view>
  21. </view>
  22. <view style="clear: both;"></view>
  23. </tm-sheet>
  24. </div>
  25. <!-- 弹出层消息 -->
  26. <tm-message ref="toast"></tm-message>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. myRequest
  32. } from '@/api/request.js'
  33. export default {
  34. data() {
  35. return {
  36. list: [],
  37. quanbuList: [{
  38. src: '/static/img/45.png',
  39. text: 'NEO CITY 涂鸦',
  40. type: '手提包'
  41. }, {
  42. src: '/static/img/46.png',
  43. text: '满印迷你标识',
  44. type: '围巾'
  45. }, {
  46. src: '/static/img/47.png',
  47. text: '大号版型夹克',
  48. type: '新品'
  49. }, {
  50. src: '/static/img/45.png',
  51. text: 'NEO CITY 涂鸦',
  52. type: '手提包'
  53. }, {
  54. src: '/static/img/46.png',
  55. text: '满印迷你标识',
  56. type: '围巾'
  57. }, {
  58. src: '/static/img/47.png',
  59. text: '大号版型夹克',
  60. type: '新品'
  61. }, {
  62. src: '/static/img/46.png',
  63. text: '满印迷你标识',
  64. type: '围巾'
  65. }, {
  66. src: '/static/img/47.png',
  67. text: '大号版型夹克',
  68. type: '新品'
  69. }, {
  70. src: '/static/img/45.png',
  71. text: 'NEO CITY 涂鸦',
  72. type: '手提包'
  73. }, {
  74. src: '/static/img/46.png',
  75. text: '满印迷你标识',
  76. type: '围巾'
  77. }, {
  78. src: '/static/img/47.png',
  79. text: '大号版型夹克',
  80. type: '新品'
  81. }, {
  82. src: '/static/img/46.png',
  83. text: '满印迷你标识',
  84. type: '围巾'
  85. }, {
  86. src: '/static/img/47.png',
  87. text: '大号版型夹克',
  88. type: '新品'
  89. }]
  90. };
  91. },
  92. onLoad() {
  93. },
  94. created() {
  95. this.sys = uni.getSystemInfoSync();
  96. this.getTop();
  97. },
  98. methods: {
  99. // 获取一级分类
  100. getTop() {
  101. let that = this;
  102. myRequest({
  103. url: '/api/ShopGoods/getMallClassification',
  104. method: 'get',
  105. data: that.reqData
  106. }).then(res => {
  107. console.log(res.data);
  108. if (res.data.code == 200) {
  109. res.data.data.forEach(item => {
  110. that.list.push({
  111. img: item.image,
  112. title: item.category_name
  113. })
  114. })
  115. } else {
  116. that.$refs.toast.show({
  117. model: 'error',
  118. label: res.data.msg
  119. })
  120. }
  121. })
  122. },
  123. // 二级分类
  124. getMiddle() {
  125. myRequest({
  126. url: "/api/ShopGoods/getMallClassification",
  127. method: 'get',
  128. data: that.reqData
  129. }).then(res => {
  130. console.log(res.data);
  131. if (res.data.code == 200) {
  132. res.data.data.forEach(item => {
  133. that.list3.push({
  134. icon: item.image,
  135. text: item.category_name
  136. })
  137. })
  138. } else {
  139. that.$refs.toast.show({
  140. model: 'error',
  141. label: res.data.msg
  142. })
  143. }
  144. })
  145. },
  146. change(e) {
  147. uni.$tm.toast(`您选中了:${e}`)
  148. }
  149. },
  150. }
  151. </script>
  152. <style lang="scss">
  153. /deep/ .tm-menubars .body {
  154. background-color: #1b1b1b !important;
  155. }
  156. // /deep/ .zhuti{padding: 10px 10px;}
  157. // page,.bodycont{height:100%;}
  158. /deep/ .cont {
  159. overflow: hidden;
  160. }
  161. /deep/ .kuang {
  162. margin: 0 !important;
  163. padding: 0px !important;
  164. }
  165. /deep/ .zuo .grey-darken-4.bk {
  166. background-color: #0D0D0D !important;
  167. }
  168. /deep/ .zuo .uni-scroll-view-content {
  169. background-color: #0D0D0D !important;
  170. }
  171. /deep/ .cont .shadow-white-5 {
  172. padding: 0px !important;
  173. margin: 0px !important
  174. }
  175. /deep/ .zuo .border-red-l-2.bk {
  176. border-left-color: #0178FD !important;
  177. }
  178. /deep/ .zuo .text-red,
  179. /deep/ .zuo .text-grey-darken-1 {
  180. color: white !important;
  181. }
  182. .yiguicla image {
  183. width: 100%;
  184. display: block;
  185. margin: 0 auto;
  186. margin-top: 5px;
  187. border-radius: 10px;
  188. }
  189. .yiguicla {
  190. width: 45%;
  191. border-radius: 10px;
  192. position: relative;
  193. padding: 0px !important;
  194. }
  195. .wenzi {
  196. position: absolute;
  197. bottom: 0px;
  198. background: #BCC2C7;
  199. color: white;
  200. width: 100%;
  201. height: 25px;
  202. border-radius: 0px 0px 10px 10px;
  203. }
  204. // /deep/ .zuo uni-scroll-view{height: calc(100% - 45px) !important;}
  205. .mingri image {
  206. width: 25px;
  207. margin-right: 12px;
  208. vertical-align: middle;
  209. }
  210. .mingri text {
  211. vertical-align: middle;
  212. }
  213. .you {
  214. width: calc(100% - 100px);
  215. overflow: auto;
  216. }
  217. .zuo {
  218. overflow: hidden;
  219. }
  220. </style>