product-list.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template name="secondList">
  2. <view class="container">
  3. <view class="good-search-top">
  4. <view class="search-from name">
  5. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  6. <input class="input"
  7. type="text"
  8. :focus="isFocus"
  9. confirm-type="search"
  10. v-model="searchKeyword"
  11. placeholder="请输入商品关键词"
  12. @input="onShowClose"
  13. @confirm="searchOpertor"
  14. maxlength="20"/>
  15. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText"></text>
  16. </view>
  17. </view>
  18. <view class="ListImg">
  19. <img src="/static/second/banner.png"/>
  20. </view>
  21. <view class="main-content">
  22. <ul class="secondTitle">
  23. <li class="ClassA mIcon off" @click="handle('1')" :class="currentId == '1' ? 'active':''">
  24. {{ tabTitleName }}
  25. <span class="line" v-if="currentId == '1'"></span>
  26. </li>
  27. <li class="ClassA" @click="handle('2')" :class="[currentId == '2' ? 'active':'',currentId == '2' ? 'off':'']">
  28. 临期产品
  29. <span class="line" v-if="currentId == '2'"></span>
  30. </li>
  31. <li class="ClassA" @click="handle('3')" :class="[currentId == '3' ? 'active':'',currentId == '3' ? 'off':'']">
  32. 其他
  33. <span class="line" v-if="currentId == '3'"></span>
  34. </li>
  35. </ul>
  36. </view>
  37. <ul class="mainTab" v-if="mainflag">
  38. <li v-for="(item,index) in tabList" @click='handleChild(item)' :class="currentID2 ==index?'addstyle':' '">{{item.name}}</li>
  39. </ul>
  40. <view class="shopList">
  41. <!-- <view class="Listitem" v-if="isShow" v-for="(item, index) in tabchildList"> -->
  42. <!-- <a class="itemImg onhref" href=''>
  43. <img :src="item.imageList[0]" :class="item.sold==1?'activeImg':''" class="bigImg">
  44. </a>
  45. <view class="ItemInfo">
  46. <view class="tag">
  47. <span class="infotag news" v-if="item.sold==0&&item.newAdded==1">最新</span>
  48. <span class="infotag brand" v-if="item.brandName!=null&&item.brandName!=''&&item.brandID!=161">{{item.brandName}}</span>
  49. <span class="infotag sold" v-if="item.sold==1&&item.newAdded==1||item.sold==1&&item.newAdded==0">已售</span>
  50. <span class="infotag other" v-if="item.brandID==161&&item.brandName!=''&&item.brandName!=null">{{item.brandName}}</span>
  51. </view>
  52. <a class="productname" :href="'/flea-market-'+item.productID+'.html'">
  53. {{item.name}}
  54. </a>
  55. <view class="targetprice">
  56. <span v-if="item.detailTalkFlag ==2 && userID==null">价格详聊</span>
  57. <span v-else-if="userID==null" class="priceparam" @click="toLogin">登录查看价格></span>
  58. <span v-else-if="userID!=null && item.detailTalkFlag==2">价格详聊</span>
  59. <span v-else>¥{{item.price1Str}}</span>
  60. </view>
  61. <view class="shijian">
  62. <view>
  63. <i class="icon mIcon liulanliang"></i> {{item.viewingNum}}
  64. </view>
  65. <view>
  66. <i class="icon mIcon shijian"></i> {{item.onLineDateStr}}
  67. </view>
  68. </view>
  69. <view class="dizhi">
  70. <i class="icon mIcon dizhi"></i>
  71. {{item.provinceCityDistrict}}
  72. </view>
  73. </view>
  74. </view>
  75. <view class="no-content" v-show="showflag" :class="showflag?'show':''">
  76. <img src="/img/flea-market/nologo.png" v-if="isPC" />
  77. <img src="/img/flea-market/kong_m.png" v-else />
  78. <view class="error-message">
  79. <p>此分类下面没有商品,换其它分类瞅瞅</p>
  80. </view>
  81. </view>
  82. --> </view>
  83. </view>
  84. </template>
  85. <script>
  86. import { mapState,mapMutations } from 'vuex';
  87. export default{
  88. name:'secondList',
  89. data(){
  90. return{
  91. isShowClose:false,
  92. isFocus:false,
  93. searchKeyword:'',//搜索关键字
  94. currentId:1,
  95. currentID2:0,
  96. mainflag:false,
  97. tabTitleName:'二手仪器',
  98. tabTitle: [
  99. {value:'1',name:'二手仪器'},
  100. {value:'2',name:'临期产品'},
  101. {value:'3',name:'其他'}
  102. ],
  103. tabList : [
  104. {value:'0',name:'全部'},
  105. {value:'1',name:'轻光电'},
  106. {value:'2',name:'重光电'},
  107. {value:'3',name:'耗材配件'},
  108. ],
  109. }
  110. },
  111. created() {
  112. },
  113. methods:{
  114. handle: function (index) {//一級分类
  115. var _this = this;
  116. _this.currentId = index;
  117. _this.tabTitleName = '二手仪器';
  118. if ( _this.currentId == '1'){
  119. _this.mainflag = true;
  120. }else {
  121. _this.mainflag=false;
  122. _this.currentID2 = 0;
  123. }
  124. // _this.gettabList();
  125. },
  126. handleChild:function(item){ //二级分类
  127. var _this = this;
  128. _this.currentID2 = item.value;
  129. if(!isPC){
  130. _this.tabTitleName = item.name;
  131. if (_this.currentID2==item.value){
  132. _this.mainflag=false;
  133. }
  134. }
  135. // _this.gettabList();
  136. },
  137. },
  138. }
  139. </script>
  140. <style>
  141. .warp-container{
  142. width: 100%;
  143. height: 100%;
  144. }
  145. .good-search-top{
  146. width: 702rpx;
  147. height: 70rpx;
  148. flex: 1;
  149. margin: 32rpx auto;
  150. }
  151. .search-from{
  152. width: 702rpx;
  153. height: 66rpx;
  154. background: #F7F7F7;
  155. border-radius: 40rpx;
  156. float: left;
  157. position: relative;
  158. }
  159. .input{
  160. width: 340rpx;
  161. height: 66rpx;
  162. float: left;
  163. line-height: 66rpx;
  164. color: $text-color;
  165. font-size: 28rpx;
  166. }
  167. .icon-iconfonticonfontsousuo1{
  168. width: 64rpx;
  169. height: 66rpx;
  170. line-height: 66rpx;
  171. text-align: center;
  172. display: block;
  173. font-size: $font-size-38;
  174. float: left;
  175. color: #999999;
  176. }
  177. .icon-shanchu1{
  178. font-size: $font-size-32;
  179. color: #999999;
  180. position: absolute;
  181. width: 120rpx;
  182. height: 70rpx;
  183. line-height: 70rpx;
  184. top: 0;
  185. right: 0;
  186. text-align: center;
  187. z-index: 10;
  188. }
  189. .ListImg{
  190. width: 750rpx;
  191. height: 266rpx;
  192. }
  193. .ListImg>img{
  194. width: 100%;
  195. height: 100%;
  196. }
  197. .secondTitle {
  198. width: 100%;
  199. height:90rpx;
  200. background-color: #ffffff;
  201. border-bottom: 2rpx solid #F0F2F4;
  202. position: relative;
  203. }
  204. .ClassA.active {
  205. color: #E15621;
  206. }
  207. .ClassA {
  208. width: 240rpx;
  209. height: 90rpx;
  210. display: inline-block;
  211. text-align: center;
  212. line-height: 90rpx;
  213. font-size: 30rpx;
  214. cursor: pointer;
  215. color: #666666;
  216. border: 0;
  217. position: relative;
  218. }
  219. .mainTab {
  220. background: #fff;
  221. width: 29vw;
  222. position: absolute;
  223. z-index: 1;
  224. }
  225. .mainTab li.addstyle {
  226. color: #e15616;
  227. }
  228. .mainTab li {
  229. height: 9.6vw;
  230. line-height: 9.6vw;
  231. text-align: center;
  232. color: #627386;
  233. cursor: pointer;
  234. }
  235. </style>