index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
  4. <view class="C1b1b1b pb-20">
  5. <view style="width: 90%;margin:0 auto;">
  6. <view>
  7. <tm-search @confirm="sosoFun" class="fl" v-model="soso" color="white" confirm-text=""></tm-search>
  8. <text class="quxiao fr" @click="goindex()">取消</text>
  9. </view>
  10. <view style="clear: both;"></view>
  11. <view v-if="sosotype==1">
  12. <text class="text-size-m fl mt-30">搜索记录</text>
  13. <view class="fr mt-30 qingchu" @click="qingkong">
  14. <text class="text-size-s fl">清空记录</text>
  15. <tm-badges :offset="[0,-5]" icon="icon-times"></tm-badges>
  16. </view>
  17. </view>
  18. <view v-if="sosotype==2">
  19. <tm-tabs align="left" @change="yiji" class="qiehuan1" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  20. <!-- <tm-tabs align="left" class="qiehuan2" color="white" v-model="activeIndex1" :list="list1" range-key="title"></tm-tabs> -->
  21. </view>
  22. <view style="clear: both;"></view>
  23. </view>
  24. </view>
  25. <!-- 列表 -->
  26. <tm-grouplist class="liebiao mt-40" v-if="sosotype==1 && libiaoList.length !=0">
  27. <tm-listitem v-for="item in libiaoList" @click="tiaozhuan(item.type)" :title="item.title" left-icon="" show-left-icon :show-right-icon="false">
  28. </tm-listitem>
  29. </tm-grouplist>
  30. <tm-empty v-if="sosotype==1 && libiaoList.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
  31. <!-- 衣橱 -->
  32. <view class="zhuti">
  33. <tm-sheet class="yichu" v-if="sosotype==2" style="margin-bottom: 70px !important;">
  34. <view class="jihua">
  35. <view v-for="(item,index) in listdata" class="round-3 fl shadow-2 overflow pa-10 jihuaview" :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'white']">
  36. <image class="logo" :src="item.image" mode="widthFix"></image>
  37. <view class="pa-10 text-size-s">
  38. <view class="text-overflow-2">
  39. <text>{{item.text}}</text>
  40. </view>
  41. <view class="mt-2 flex-between flex-center">
  42. <view class="touxiang mt-30">
  43. <image src="/static/img/7.png" mode="widthFix"></image>
  44. <text class="text-white text-size-m">可樂crys</text>
  45. </view>
  46. <view >
  47. <image class="remenzan" :src="dianzan1?'/static/img/29.png':'/static/img/9.png'" mode="widthFix"></image>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view style="clear: both;" class="more mt-40 pb-40 pt-40" @click="gengmore()" v-if="listdata.length !=0">
  54. <image src="/static/img/30.png" mode="widthFix"></image>
  55. <text class="text-size-s">下拉加载更多~</text>
  56. </view>
  57. </tm-sheet>
  58. <tm-empty v-if="sosotype==2 && listdata.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
  59. </view>
  60. <!-- 弹出层消息 -->
  61. <tm-message ref="toast"></tm-message>
  62. </view>
  63. </template>
  64. <script>
  65. import{myRequest} from '@/api/request.js'
  66. export default {
  67. data() {
  68. return {
  69. soso:'',
  70. libiaoList:[],
  71. sosotype:1,
  72. list:[ '全部','搭配','衣橱'],
  73. activeIndex:0,
  74. activeIndex1:0,
  75. list1:[ '综合','高级感','黑色','灰色'],
  76. listdata:[],
  77. dianzan1:true,
  78. sys:null
  79. };
  80. },
  81. onLoad() {
  82. },
  83. created() {
  84. this.sys = uni.getSystemInfoSync();
  85. // this.randouh()
  86. this.getlishi()
  87. },
  88. methods: {
  89. yiji(e){
  90. this.activeIndex=e;
  91. this.sosoFun()
  92. },
  93. getlishi(){
  94. var that=this;
  95. myRequest({
  96. url: "/api/SearchHistory/searchList",
  97. method:'get',
  98. data:{}
  99. }).then(res => {
  100. if (res.data.code == 200) {
  101. }else{
  102. }
  103. })
  104. },
  105. qingkong(){
  106. var that=this;
  107. myRequest({
  108. url: "/api/SearchHistory/deleteSearch",
  109. method:'get',
  110. data:{}
  111. }).then(res => {
  112. if (res.data.code == 200) {
  113. }else{
  114. }
  115. })
  116. },
  117. gengmore(){
  118. this.randouh()
  119. },
  120. goindex(){
  121. uni.navigateBack();
  122. },
  123. sosoFun(){
  124. console.log(this.soso)
  125. var that=this;
  126. myRequest({
  127. url: "/api/Collocation/search",
  128. method:'post',
  129. data:{search:that.soso,type:that.activeIndex}
  130. }).then(res => {
  131. if (res.data.code == 200) {
  132. that.listdata=res.data.data;
  133. }else{
  134. that.listdata=[];
  135. }
  136. })
  137. this.sosotype=2
  138. },
  139. randouh(){
  140. let list2 = [],that=this;
  141. for(let i=0;i<4;i++){
  142. list2.push({
  143. image:'../../static/img/25.png',
  144. text:'西装穿搭 | 韩系又A又飒休闲西装 高级感'
  145. })
  146. }
  147. this.listdata=this.listdata.concat(list2)
  148. console.log(this.listdata)
  149. },
  150. },
  151. }
  152. </script>
  153. <style lang="scss">
  154. /deep/ .tm-menubars .body{
  155. background-color: #1b1b1b !important;
  156. }
  157. /deep/ .icon-search{
  158. font-size: 23px !important;
  159. color: #8E8E93 !important;
  160. }
  161. /deep/ .tm-search{
  162. width: 86%;
  163. margin: 0 auto;
  164. background-color: #414141 !important;
  165. border-radius: 10px;
  166. }
  167. /deep/ .tm-search .grey-darken-5{
  168. background-color: #414141 !important;
  169. }
  170. .quxiao{color: #707070;line-height: 47px;}
  171. /deep/ .tm--badges--cm{border: 1px solid #303440 !important;
  172. background-color: #303440 !important;right: -7px !important;top: 6px !important;}
  173. /deep/ .tm--badges{display: inherit !important;}
  174. .qingchu{background: #303440;padding:5px 15px;border-radius: 20px;width: 62px;}
  175. /deep/ .liebiao .grey-darken-4.bk{background-color: #0D0D0D !important;}
  176. /deep/ .liebiao .py-24{padding-top: 15px;padding-bottom: 15px;}
  177. /deep/ .tm-grouplist{margin:0 10px !important;}
  178. /deep/ .qiehuan2 .tm-tabs-con-item-border{display: none;}
  179. /deep/ .qiehuan1 .text-primary{color: white !important;}
  180. /deep/ .qiehuan2 .tm-tabs-con-item-text{
  181. font-size: 14px;
  182. background: none !important;
  183. height: 28px;
  184. vertical-align: middle;
  185. line-height: 28px;
  186. border-radius: 20px;
  187. padding-left: 14px;
  188. padding-right: 14px;
  189. margin-top: 17%;
  190. }
  191. /deep/ .qiehuan2 .text-weight-b{
  192. font-size: 14px;
  193. background: #303440 !important;
  194. height: 28px;
  195. vertical-align: middle;
  196. line-height: 28px;
  197. border-radius: 20px;
  198. padding-left: 14px;
  199. padding-right: 14px;
  200. margin-top: 17%;
  201. color: white !important;
  202. }
  203. .jihua image{width: 30px;height: 30px;}
  204. .jihua{position: relative;}
  205. .jihua .a_1{position: absolute;top: 10%;}
  206. .jihuaview{width: 43%;margin: 7px;}
  207. .remenzan{width: 18px !important;margin-top: 10px;}
  208. .jihua .logo{width: 100%;}
  209. .touxiang image{width: 40px;margin-right: 10px;vertical-align: middle;}
  210. .yichu{padding: 0px !important;margin:0 !important}
  211. .more{text-align: center;}
  212. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  213. </style>