123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
- <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
- <view class="C1b1b1b pb-20">
- <view style="width: 90%;margin:0 auto;">
- <view>
- <tm-search @confirm="sosoFun" class="fl" v-model="soso" color="white" confirm-text=""></tm-search>
- <text class="quxiao fr" @click="goindex()">取消</text>
- </view>
- <view style="clear: both;"></view>
- <view v-if="sosotype==1">
- <text class="text-size-m fl mt-30">搜索记录</text>
- <view class="fr mt-30 qingchu" @click="qingkong" v-if="libiaoList.length !=0">
- <text class="text-size-s fl">清空记录</text>
- <tm-badges :offset="[0,-5]" icon="icon-times"></tm-badges>
- </view>
- </view>
- <view v-if="sosotype==2">
- <tm-tabs align="left" @change="yiji" class="qiehuan1" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
- <!-- <tm-tabs align="left" class="qiehuan2" color="white" v-model="activeIndex1" :list="list1" range-key="title"></tm-tabs> -->
- </view>
- <view style="clear: both;"></view>
- </view>
- </view>
- <!-- 列表 -->
- <tm-grouplist class="liebiao mt-40" v-if="sosotype==1 && libiaoList.length !=0">
- <tm-listitem v-for="item in libiaoList" @click="sousuo(item.name)" :title="item.name" left-icon="" show-left-icon :show-right-icon="false">
- </tm-listitem>
- </tm-grouplist>
- <tm-empty v-if="sosotype==1 && libiaoList.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
- <!-- 衣橱 -->
- <view class="zhuti">
- <tm-sheet class="yichu" v-if="sosotype==2" style="margin-bottom: 70px !important;">
- <view class="jihua">
- <view v-for="(item,index) in listdata" @click="xiangqing(item)" class="round-3 fl shadow-2 overflow pa-10 jihuaview" :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'white']">
- <image class="logo" :src="item.image" mode="widthFix"></image>
- <view class="pa-10 text-size-s">
- <view class="text-overflow-2">
- <text>{{item.text}}</text>
- </view>
- <!-- <view class="mt-2 flex-between flex-center">
- <view class="touxiang mt-30">
- <image src="/static/img/7.png" mode="widthFix"></image>
- <text class="text-white text-size-m">可樂crys</text>
- </view>
- <view >
- <image class="remenzan" :src="dianzan1?'/static/img/29.png':'/static/img/9.png'" mode="widthFix"></image>
- </view>
- </view> -->
- </view>
- </view>
- </view>
- <view style="clear: both;">
- <!-- <image src="/static/img/30.png" mode="widthFix"></image>
- <text class="text-size-s">下拉加载更多~</text> -->
- </view>
- </tm-sheet>
- <tm-empty v-if="sosotype==2 && listdata.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
- </view>
- <!-- 弹出层消息 -->
- <tm-message ref="toast"></tm-message>
- </view>
- </template>
- <script>
- import{myRequest} from '@/api/request.js'
- export default {
- data() {
- return {
- soso:'',
- libiaoList:[],
- sosotype:1,
- list:[ '全部','搭配','衣橱'],
- activeIndex:0,
- activeIndex1:0,
- list1:[ '综合','高级感','黑色','灰色'],
- listdata:[],
- dianzan1:true,
- sys:null
- };
- },
- onLoad() {
-
- },
- created() {
- this.sys = uni.getSystemInfoSync();
- // this.randouh()
- this.getlishi()
- },
- methods: {
- yiji(e){
- this.activeIndex=e;
- this.sosoFun()
- },
- xiangqing(item){
- console.log(item)
- if(item.type=="衣物"){
- uni.navigateTo({
- url: "/pages/yifu/index?id="+item.id,
- })
- }else if(item.type=="搭配"){
- uni.navigateTo({
- url: "/pages/zidingyikan/index?id="+item.id+'&type=1',
- })
- }
- },
- getlishi(){
- var that=this;
- myRequest({
- url: "/api/SearchHistory/searchList",
- method:'get',
- data:{}
- }).then(res => {
- if (res.data.code == 200) {
- that.libiaoList=res.data.data;
- }else{
-
- }
- })
- },
- qingkong(){
- var that=this;
- myRequest({
- url: "/api/SearchHistory/deleteSearch",
- method:'get',
- data:{}
- }).then(res => {
- if (res.data.code == 200) {
- that.getlishi();
- that.$refs.toast.show({model:'success',label:res.data.msg})
- }else{
-
- }
- })
- },
- gengmore(){
- this.randouh()
- },
- goindex(){
- uni.navigateBack();
- },
- sousuo(name){
- this.soso=name;
- this.sosoFun();
- },
- sosoFun(){
- console.log(this.soso)
- var that=this;
- myRequest({
- url: "/api/Collocation/search",
- method:'post',
- data:{search:that.soso,type:that.activeIndex}
- }).then(res => {
- if (res.data.code == 200) {
- that.listdata=res.data.data;
- }else{
- that.listdata=[];
- }
- })
- this.sosotype=2
- },
- randouh(){
- let list2 = [],that=this;
- for(let i=0;i<4;i++){
- list2.push({
- image:'../../static/img/25.png',
- text:'西装穿搭 | 韩系又A又飒休闲西装 高级感'
- })
- }
- this.listdata=this.listdata.concat(list2)
- console.log(this.listdata)
- },
- },
- }
- </script>
- <style lang="scss">
- /deep/ .tm-menubars .body{
- background-color: #1b1b1b !important;
- }
- /deep/ .icon-search{
- font-size: 23px !important;
- color: #8E8E93 !important;
- }
- /deep/ .tm-search{
- width: 86%;
- margin: 0 auto;
- background-color: #414141 !important;
- border-radius: 10px;
- }
- /deep/ .tm-search .grey-darken-5{
- background-color: #414141 !important;
- }
- .quxiao{color: #707070;line-height: 47px;}
- /deep/ .tm--badges--cm{border: 1px solid #303440 !important;
- background-color: #303440 !important;right: -7px !important;top: 6px !important;}
- /deep/ .tm--badges{display: inherit !important;}
- .qingchu{background: #303440;padding:5px 15px;border-radius: 20px;width: 62px;}
- /deep/ .liebiao .grey-darken-4.bk{background-color: #0D0D0D !important;}
- /deep/ .liebiao .py-24{padding-top: 15px;padding-bottom: 15px;}
- /deep/ .tm-grouplist{margin:0 10px !important;}
-
- /deep/ .qiehuan2 .tm-tabs-con-item-border{display: none;}
- /deep/ .qiehuan1 .text-primary{color: white !important;}
- /deep/ .qiehuan2 .tm-tabs-con-item-text{
- font-size: 14px;
- background: none !important;
- height: 28px;
- vertical-align: middle;
- line-height: 28px;
- border-radius: 20px;
- padding-left: 14px;
- padding-right: 14px;
- margin-top: 17%;
- }
- /deep/ .qiehuan2 .text-weight-b{
- font-size: 14px;
- background: #303440 !important;
- height: 28px;
- vertical-align: middle;
- line-height: 28px;
- border-radius: 20px;
- padding-left: 14px;
- padding-right: 14px;
- margin-top: 17%;
- color: white !important;
- }
- .jihua image{width: 30px;height: 30px;}
- .jihua{position: relative;}
- .jihua .a_1{position: absolute;top: 10%;}
- .jihuaview{width: 43%;margin: 7px;}
- .remenzan{width: 18px !important;margin-top: 10px;}
- .jihua .logo{width: 100%;}
- .touxiang image{width: 40px;margin-right: 10px;vertical-align: middle;}
- .yichu{padding: 0px !important;margin:0 !important}
- .more{text-align: center;}
- .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
- </style>
|