liguorui před 7 roky
rodič
revize
dd6837337a

+ 6 - 0
app.js

@@ -1,6 +1,7 @@
 //app.js
 App({
   onLaunch: function () {
+    var _self=this;
     // // 展示本地存储能力
     // var logs = wx.getStorageSync('logs') || []
     // logs.unshift(Date.now())
@@ -32,6 +33,11 @@ App({
     //     }
     //   }
     // })
+    wx.getSystemInfo({
+      success:function(res) {
+        _self.globalData.windowh = res.windowHeight*2
+      }
+    });
   },
   globalData: {
     serverpath:"https://api.jasonre.cn"

+ 7 - 3
app.json

@@ -1,15 +1,19 @@
 {
   "pages":[
+    "pages/buy/buy",
     "pages/index/index",
     "pages/logs/logs",
     "pages/search/search",
-    "pages/searchresult/searchresult"
+    "pages/searchresult/searchresult",
+    "pages/shop/shop",
+    "pages/sell/sell"
   ],
   "window":{
-    "backgroundTextStyle":"light",
     "navigationBarBackgroundColor": "#fede18",
     "navigationBarTitleText": "第一好车",
     "navigationBarTextStyle":"black",
-    "navigationStyle":"custom"
+    "navigationStyle": "custom",
+    "enablePullDownRefresh":false,
+    "backgroundColor":"black"
   }
 }

+ 15 - 2
app.wxss

@@ -6,12 +6,25 @@
   align-items: center;
   justify-content: space-between;
   box-sizing: border-box;
+  background-color:#F9F9F9;
 } 
 /***********header************/
+.page_head_place{
+  padding-top:70rpx;
+  height:58rpx;
+  text-align: center;
+  line-height: 36rpx;
+  font-size:26rpx;
+  color:#cccccc;
+  background: white;
+}
 .page_head{
   background-color:#fede18;
   height:128rpx;
-  position: relative;
+  position: fixed;
+  z-index:100;
+  top:0rpx;
+  width: 100%;
 }
 .page_head_back{
   width:30rpx;
@@ -48,7 +61,7 @@
   flex: 1;
 }
 .page_footer_navs{
-  width:50rpx;
+  width:60rpx;
   margin:0px auto;
 }
 .page_footer_navs image{

+ 4 - 0
common/pathmap.js

@@ -1,3 +1,5 @@
+//接口地址汇总
+
 export default{
   "login":"/api/login",
   "phonecode":"/api/get_yzm",
@@ -7,4 +9,6 @@ export default{
   "like":"/api/home_guess_likes",
   "goodcar":"/api/good_car",
   "goodcardetail":"/api/good_car_detail",
+  "storeinfo":"/api/store_info",
+  "searchcar":"/api/cars"
 }

+ 42 - 1
common/request.js

@@ -1,5 +1,22 @@
 var app = getApp();
+var requestnum = 0;
+const addnum = function(){
+  if (requestnum==0){
+    wx.showLoading({
+      title:"加载中...",
+      // mask:true
+    })
+  }
+  requestnum++;
+}
+const reducenum = function(){
+  requestnum--;
+  if (requestnum==0){
+    wx.hideLoading();
+  }
+}
 export const get=(url,data,callback,failback)=>{
+  addnum();
   wx.request({
     url: app.globalData.serverpath+url,
     method: "GET",
@@ -12,7 +29,31 @@ export const get=(url,data,callback,failback)=>{
       callback && callback(res);
     },
     fail: function (error){
-      failback && failback(error)
+      failback && failback(error);
+    },
+    complete: function () {
+      reducenum();
+    }
+  })
+} 
+export const post=(url,data,callback,failback)=>{
+  addnum();
+  wx.request({
+    url: app.globalData.serverpath+url,
+    method: "POST",
+    header: {
+      "Content-Type": "json"
+    },
+    data:data,
+    success: function (res){
+      console.debug(res);
+      callback && callback(res);
+    },
+    fail: function (error){
+      failback && failback(error);
+    },
+    complete: function () {
+      reducenum();
     }
   })
 } 

+ 17 - 13
data/car.js

@@ -1,15 +1,19 @@
 export const retCartData = function(list){
-  list.forEach(function(item){
-    if (item.license_time){
-      var date = new Date(item.license_time.replace(/-/g,"/"));
-      item.licensetime = `${date.getFullYear()}年${date.getMonth()+1}月`
-    }
-    if (item.sale_price){
-      item.saleprice = (item.sale_price / 10000).toFixed(2)
-    }
-    if (item.guide_price){
-      item.guideprice = (item.guide_price / 10000).toFixed(2)
-    }
-  })
-  return list;
+  if(Object.prototype.toString.call(list) =="[object Array]"){
+    list.forEach(function(item){
+      if (item.license_time){
+        var date = new Date(item.license_time.replace(/-/g,"/"));
+        item.licensetime = `${date.getFullYear()}年${date.getMonth()+1}月`
+      }
+      if (item.sale_price){
+        item.saleprice = (item.sale_price / 10000).toFixed(2)
+      }
+      if (item.guide_price){
+        item.guideprice = (item.guide_price / 10000).toFixed(2)
+      }
+    })
+    return list;
+  }else{
+    return [];
+  }
 }

binární
img/sort_active.png


binární
img/sortby.png


+ 23 - 0
module/caritem/caritem.wxml

@@ -0,0 +1,23 @@
+<template name="caritem">
+  <view class="caritem_b">
+    <view class="caritem_img" style="background-image:url({{car.img}})"/>
+    <view class="caritem_info">
+      <view class="caritem_t">{{car.title}}</view>
+      <view class="caritem_time">
+        {{car.licensetime}}年上牌|{{car.mileage}}万公里
+        <navigator 
+          url="../shop/shop?id={{car.store_id}}"
+          class="caritem_store"
+        >
+          {{car.store_name}}
+        </navigator>
+      </view>
+      <view class="caritem_p">
+        {{car.saleprice}}万
+      </view>
+      <view class="caritem_guide_p">
+        新手指导价:<view class="caritem_guidep">{{car.guideprice}}万</view>
+      </view>
+    </view>
+  </view>
+</template>

+ 64 - 0
module/caritem/caritem.wxss

@@ -0,0 +1,64 @@
+
+.caritem_b{
+  height: 200rpx;
+  width:100%;
+  display: flex;
+  margin-top:20rpx;
+  border-top:1px solid #F9F9F9;
+  background: white;
+}
+
+.caritem_img{
+  display: block;
+  width:290rpx;
+  height:100%;
+  background-repeat: no-repeat;
+  background-size: 100%;
+  background-position: center;
+}
+.caritem_info{
+  padding:10rpx 0rpx 0rpx 40rpx;
+  align-items:center;
+}
+.caritem_t{
+  height: 36rpx;
+  line-height: 36rpx;
+  color: rgba(56, 55, 53, 1);
+  font-size: 26rpx;
+  text-align: left;
+}
+ .caritem_store{
+  height: 28rpx;
+  line-height: 28rpx;
+  color: rgba(245, 166, 35, 1);
+  font-size: 20rpx;
+  text-align: center;
+  display: inline-block;
+  border:1px solid rgba(245, 166, 35, 1);
+  border-radius: 8rpx;
+} 
+.caritem_time{
+  height: 30rpx;
+  line-height: 30rpx;
+  color: rgba(135, 135, 135, 1);
+  font-size: 20rpx;
+  text-align: left;
+}
+.caritem_p{
+  height: 33rpx;
+  line-height: 33rpx;
+  color: rgba(33, 36, 37, 1);
+  font-size: 28rpx;
+  font-family: NotoSansHans-Medium;
+}
+.caritem_guide_p{
+  height: 33rpx;
+  line-height: 33rpx;
+  color: rgba(104, 104, 104, 1);
+  font-size: 22rpx;
+  text-align: left;
+}
+.caritem_guidep{
+  display: inline;
+  text-decoration:line-through;
+}

+ 4 - 1
module/header.wxml

@@ -1,6 +1,9 @@
 <!-- 公用 用于页面顶部文字  -->
 
-<template name="header">
+<template name="header">  
+  <view class="page_head_place">
+    本网页由m.dyhc.com提供
+  </view>
   <view class="page_head">
     <navigator
       wx:if="{{hasback}}"

+ 55 - 0
module/search/search.js

@@ -0,0 +1,55 @@
+const events = ["inputBlur", "inputConfirm","searchFocus"];
+
+const bindSearch = function (_self){
+  Object.assign(_self, searchmodule);
+}
+
+/*
+  搜索失去聚焦事件
+  */
+export const searchmodule = {
+  inputBlur: function(e) {
+    this.setData({
+      searchshow: false,
+      searchfocus: false
+    })
+  },
+/*
+    搜索确定时事件
+  */
+  inputConfirm : function(e) {
+    var word = e.detail.value;
+    if (word) {
+      if(typeof this.submitsearchword=="function"){
+        this.submitsearchword(word);
+      }
+    } else {
+      this.setData({
+        searchshow: false,
+        searchfocus: false
+      })
+      if (this.focusani){
+        clearTimeout(this.focusani);
+      }
+    }
+  },
+/*
+  搜索聚焦事件
+*/
+  searchFocus:function(e) {
+    var _self = this;
+    this.setData({
+      searchshow: true
+    })
+    this.focusani = setTimeout(function () {
+      _self.setData({
+        searchfocus: true
+      })
+    }, 500)
+  }
+}
+export const linkToSearch = function (word) {
+  wx.navigateTo({ url: `../searchresult/searchresult?value=${word}` });
+}
+
+export default bindSearch

+ 67 - 1
module/search/search.wxml

@@ -1,6 +1,6 @@
 <!-- 公用 用于页面顶部搜索框  -->
 
-  <view class="search">
+  <!-- <view class="search">
     <navigator 
       class="search_input" 
       url="../../pages/search/search"
@@ -11,4 +11,70 @@
       />
       搜索
     </navigator>
+  </view> -->  
+  <view class="search_space"></view>
+  <view class="search {{searchshow?'search_focus':''}}">
+    <view 
+      class="search_input_b"
+    >
+    </view>
+    <view class="search_input_ani">
+      <image
+        class="search_input_ic"
+        src="../../img/search.png"
+      />
+      <input 
+        class="search_input"  
+        placeholder-class="search_input_holder"
+        placeholder="搜索"
+        confirm-type="search"
+        bindblur="inputBlur"
+        bindconfirm="inputConfirm"
+        focus='{{searchfocus}}'
+      />        
+      <view
+        class='cancel_search'
+        bindtap='cancelSearch'
+      >
+        取消
+      </view>
+    </view>
+    <view 
+      class="input_supernatant"
+      style="display:{{searchshow?'none':'block'}}"
+    >
+      <view
+        class="inputbind_focus"    
+        bindtap='searchFocus'
+      >
+      </view>
+    </view>
+    <view 
+      class="hot_search"
+      style="min-height:{{windowh-206}}px"
+    >
+      <view class="hot_search_t">
+        热门搜索
+      </view>
+      <view class="hot_search_w" bindtap="tapHot">
+        <view  class="hot_search_i" data-val = "玛莎拉蒂">
+          玛莎拉蒂
+        </view>
+        <view  class="hot_search_i" data-val = "劳斯莱斯">
+          劳斯莱斯
+        </view>
+        <view  class="hot_search_i" data-val = "宾利">
+          宾利
+        </view>
+        <view  class="hot_search_i" data-val = "法拉利">
+          法拉利
+        </view>
+        <view  class="hot_search_i" data-val = "兰博基尼">
+          兰博基尼
+        </view>
+        <view  class="hot_search_i" data-val = "布加迪">
+          布加迪
+        </view>
+      </view>
+    </view>
   </view>

+ 120 - 1
module/search/search.wxss

@@ -1,5 +1,5 @@
 /***********search************/
-.search{
+/*.search{
   display: block;
   height: 78rpx;
   background: #fede18;
@@ -23,4 +23,123 @@
   position: absolute;
   top:15rpx;
   left:285rpx;
+}*/
+/* pages/search/search.wxss */
+.content{
+  
+}
+.search_space{  
+  height: 78rpx;
+}
+.search{
+  display: block;
+  height: 78rpx;
+  background: #fede18;
+  width:100%;
+  position: fixed;
+  top:128rpx;
+  z-index: 10;
+}
+.search_input_b{
+  position: absolute;
+  height: 52rpx;
+  width:600rpx;
+  top:13rpx;
+  left:75rpx;
+  background: white;
+  border-radius: 10rpx;
+  transition:all 0.5s;
+}
+.search_input_ani{
+  position: absolute;
+  top:13rpx;
+  left:315rpx;
+  display: flex;
+  transition:all 0.5s;
+}
+.search_input_ic{
+  width:22rpx;
+  height:22rpx;
+  margin-top:14rpx;
+}
+.search_input{
+  margin-left:15rpx;
+  width:500rpx;
+  line-height: 52rpx;
+  font-size: 24rpx;
+}
+.search_input_holder{
+  color: rgba(183, 183, 183, 1);
+}
+.cancel_search{
+  margin-left:60rpx;
+  top:13rpx;
+  height: 52rpx;
+  line-height: 52rpx;
+  color: rgba(56, 55, 53, 1);
+  font-size: 26rpx;
+  font-family: NotoSansHans-DemiLight;
+}
+.input_supernatant{  
+  position: absolute;
+  top: 13rpx;
+  height: 52rpx;
+  width: 100%;
+  background: rgba(235, 235, 235, 0);
+  z-index: 1;
+}
+.inputbind_focus{
+  height: 52rpx;
+  width:600rpx;
+  margin-left:75rpx;
+}
+/*************hotsearch**************/
+.hot_search{
+  position: absolute;
+  top:78rpx;
+  left: 100%;
+  width:100%;
+  padding-top: 30px;
+  background:white;
+  transition:all 0.5s;
+}
+.hot_search_t{
+  text-indent: 38rpx;
+  height: 33rpx;
+  line-height: 33rpx;
+  color: rgba(56, 55, 53, 1);
+  font-size: 22rpx;
+}
+.hot_search_w{
+  width:702rpx;
+  margin-left:18rpx;
+  display: flex;
+  flex-wrap:wrap;
+}
+.hot_search_i{
+  display: block;
+  width:142rpx;
+  height: 52rpx;
+  margin-top:30rpx;
+  margin-left:28rpx;
+  border-radius: 6rpx;
+  border: 1px solid rgba(235, 235, 235, 1);
+  line-height: 52rpx;
+  color: rgba(56, 55, 53, 1);
+  font-size: 24rpx;
+  text-align: center;
+  font-family: NotoSansHans-Regular;
+}
+
+/*******focus*******/
+
+
+.search_focus .search_input_b{
+  left:38rpx;
+}
+.search_focus .search_input_ani{
+  left:75rpx;
+}
+.search_focus .hot_search{
+  left:0rpx;
 }

+ 145 - 0
pages/buy/buy.js

@@ -0,0 +1,145 @@
+import { get,post } from "../../common/request.js"
+import pathmap from "../../common/pathmap"
+import { retCartData } from "../../data/car"
+import bindSearch from "../../module/search/search.js"
+
+const app = getApp();
+// pages/buy/buy.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    windowh: app.globalData.windowh,
+    list:[],
+    pagesize:15,
+    pageindex:0,
+    lock:false,
+    searchfouce:false,
+    selectbar:null,
+    filters:[
+      {
+        title:"排序",
+        name:"sortby"
+      },
+      {
+        title:"品牌",
+        name:"brand"
+      },
+      {
+        title:"价格",
+        name:"price"
+      },
+      {
+        title:"更多",
+        name:"more"
+      }
+    ],
+    sortbymap:[
+      {
+        title:"默认排序",
+        value:""
+      },
+      {
+        title:"价格最低",
+        value:"price&asc"
+      },
+      {
+        title:"价格最高",
+        value:"price&desc"
+      },
+      {
+        title:"车龄最短",
+        value:"car_age&asc"
+      },
+      {
+        title:"里程最少",
+        value:"mileage&asc"
+      },
+      {
+        title:"最新发布",
+        value:"new&asc"
+      }
+    ],
+    searchdata:{
+      sortby:""
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    bindSearch(this);
+    var searchdata = Object.assign(this.data.searchdata,{keys:options.keys||""});
+    this.getList(this.data.searchdata);
+  },
+  transformSearchData:function(searchdata){
+    var para = Object.assign({},searchdata);
+    var sortby = para.sortby;
+    if(sortby){
+      var sortinfo = sortby.split("&");
+      para.order_key = sortinfo[0];
+      para.order_val = sortinfo[1];
+    }
+    delete para.sortby;
+    return para;
+  },
+  getList:function(searchdata){
+    var _self = this;
+    var para = this.transformSearchData(searchdata);
+    para.offset = 0;
+    para.limit = this.data.pagesize;
+    if(!this.data.lock){
+      this.setData({
+        lock:true
+      })
+      get(pathmap.searchcar, para, function (json) {
+        var list = retCartData(json.data&&json.data.list)
+        _self.setData({
+          lock:false,
+          list:list,
+          searchdata:searchdata,
+          offset:0
+        })
+        if(list.length==0){
+          _self.loadLikeCar()
+        }
+      })
+    }
+  },
+  showFilter:function(e){
+    var el = e.currentTarget;
+    var name = el.dataset.name;
+    if(name==this.data.selectbar){
+      name=null;
+    }
+    this.setData({
+      selectbar:name
+    })
+  },
+  changeSort:function(e){
+    var el = e.currentTarget;
+    var name = el.dataset.sort;
+    var searchdata = Object.assign(this.data.searchdata,{sortby:name});
+    this.setData({
+      selectbar:""
+    })
+    this.getList(searchdata);
+  },
+  loadLikeCar:function(){
+    var _self = this;
+    if(!this.data.like){
+      get(pathmap.like, {
+        offset: 0,
+        limit: 10
+      }, function (json) {
+        var list = retCartData(json.data.list)
+        _self.setData({
+          like: list
+        })
+      })
+    }
+  }
+})

+ 3 - 0
pages/buy/buy.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我要买车"
+}

+ 75 - 0
pages/buy/buy.wxml

@@ -0,0 +1,75 @@
+<!--pages/buy/buy.wxml-->
+<import src="../../module/header.wxml"/>
+<import src="../../module/footer.wxml"/>
+<import src="../../module/caritem/caritem.wxml"/>
+<scroll-view class="conent">
+ <template 
+    is="header" 
+    data="{{title:'我要买车'}}"
+  />
+  <include src="../../module/search/search.wxml"/>
+  <view class="filter_space"></view>
+
+  <!--筛选模块-->
+  <view class="filter_c">
+    <view class="filter_nav">
+      <block wx:for="{{filters}}" wx:key="name">
+        <view  
+          class="filter_nav_item {{selectbar==item.name?'filter_nav_item_active':''}}"
+          bindtap="showFilter"
+          data-name="{{item.name}}"
+        >
+          <view class="filter_nav_name">
+            {{item.title}}
+          </view>
+          <image src="../../img/sortby.png" class="filter_nav_switch"/>
+        </view>
+      </block>
+    </view>
+    <!--筛选排序模块-->
+    <view 
+      class="sortby_c"
+      style="height: {{selectbar=='sortby'?windowh:'0'}}rpx;"
+    >
+      <view class="sortby_list">
+        <block wx:for="{{sortbymap}}" wx:key="value">
+          <view 
+            class="sortby_item" 
+            data-sort="{{item.value}}"
+            bindtap="changeSort"
+          >
+            {{item.title}}
+            <image 
+              src="../../img/sort_active.png"
+              wx:if="{{searchdata.sortby == item.value}}"
+              class="sortby_active"
+            />
+          </view>
+        </block>
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{list.length>0}}" class="cart_list">
+    <block wx:for="{{list}}" wx:key="id">
+      <template is="caritem" data="{{car:item}}"/>
+    </block>
+  </view>
+  <view wx:else class="you_may_like">
+    <view class="recommend">
+      <view class="recommend_t">
+        <image class="recommend_img" src="../../img/like.png"/>
+      </view>
+    </view>
+    <view class="nocar_w">没有相关结果,可以试试其他条件</view>
+    <view class="nocar_back">查看所有好车</view>
+    <view class="like_cart_c">
+      <block wx:for="{{like}}" wx:key="id">
+        <template is="caritem" data="{{car:item}}"/>
+      </block>
+    </view>
+  </view>
+  <template 
+    is="footer"
+    data="{{local:1}}"
+  />
+</scroll-view>

+ 103 - 0
pages/buy/buy.wxss

@@ -0,0 +1,103 @@
+/* pages/buy/buy.wxss */
+@import "../../module/search/search.wxss"
+@import "../../module/caritem/caritem.wxss"
+.filter_space{
+	height: 88rpx;
+}
+.filter_c{
+  height: 88rpx;
+  position: fixed;
+  top:206rpx;
+  width:100%;
+  background: white;
+}
+.filter_nav{
+	display: flex;
+}
+.filter_nav_item{
+	flex: 1;
+	text-align: center;
+	height: 85rpx;
+	border-bottom: 3rpx solid white;
+	transition: all 0.5s;
+}
+.filter_nav_item_active{
+	border-bottom: 3rpx solid #FFE600;
+	color:red;
+}
+.filter_nav_name{
+	line-height: 80rpx;
+	color: rgba(56, 55, 53, 1);
+	font-size: 28rpx;
+	display: inline;
+}
+.filter_nav_switch{
+	transition: all 0.5s;
+	height: 16rpx;
+	width: 16rpx;
+}
+.filter_nav_item_active .filter_nav_switch{
+	transform: rotate(180deg);
+}
+.sortby_c{
+	overflow: hidden;
+	transition: all 0.5s;
+	background-color: rgba(56, 55, 53, 0.2);
+}
+.sortby_list{
+	background: white;
+	padding: 0rpx 38rpx;
+}
+.sortby_item{
+	border-top:1px solid rgba(235, 235, 235, 1);
+	height: 78rpx;
+	line-height: 78rpx;
+	font-size:26rpx;
+	background-color: white;
+	color: rgba(56, 55, 53, 1);
+
+}
+.sortby_active{
+	width:26rpx;
+	height: 26rpx;
+	float:right;
+	margin:30rpx 15rpx 0rpx; 
+}
+
+
+/*******like*******/
+.nocar_w{
+	mrgin-top:55rpx;
+	height: 39rpx;
+	line-height: 39rpx;
+	color: rgba(56, 55, 53, 1);
+	font-size: 26rpx;
+	text-align: center;
+}
+.nocar_back{
+	height: 68rpx;
+	border-radius: 6rpx;
+	line-height: 68rpx;
+	color: rgba(56, 55, 53, 1);
+	font-size: 26rpx;
+	text-align: center;
+
+
+}
+.recommend{
+  margin-top:20rpx;
+  background: white;
+}
+.recommend_t{
+  padding:64rpx 0rpx 60rpx;
+
+}
+.recommend_img{
+  height: 32rpx;
+  display: block;
+  margin:0px auto;
+  width:176rpx;
+}
+.like_cart_c{
+  margin-top:-20rpx;
+}

+ 1 - 1
pages/index/banner.wxml

@@ -8,7 +8,7 @@
       bindchange='switchTab'
       circular='true'
     >
-      <block wx:for="{{banner}}" wx:key="key">
+      <block wx:for="{{banner}}" wx:key="id">
         <swiper-item>
           <image class='banner_item' src="{{item.banner_img}}"/>
         </swiper-item>

+ 44 - 8
pages/index/index.js

@@ -3,20 +3,17 @@
 import {get} from "../../common/request.js"
 import pathmap from "../../common/pathmap"
 import { retCartData} from "../../data/car"
-const app = getApp()
+import bindSearch from "../../module/search/search.js"
+const app = getApp();
 
 Page({
   data: {
+    windowh: app.globalData.windowh,
     banner:[],
     goodcars:[],
     recommended:[],
-    like:[]
-  },
-  //事件处理函数
-  bindViewTap: function() {
-    wx.navigateTo({
-      url: '../logs/logs'
-    })
+    like:[],
+    searchfouce:false
   },
   onLoad: function () {
     var _self = this;
@@ -24,6 +21,7 @@ Page({
     this.loadGoodCar();
     this.loadRecommendedCar();
     this.loadLikeCar();
+    bindSearch(this);
   },
   loadBanner: function () {
     var _self = this;
@@ -74,6 +72,9 @@ Page({
       })
     })
   },
+   /*
+    切换头部banner自定义指示点
+    */
   switchTab: function (e) {
     var banner = this.data.banner;
     var i, item;
@@ -84,6 +85,9 @@ Page({
       banner: banner
     });
   },
+  /*
+    切换今日推荐自定义指示点
+    */
   switchReTab:function(e){
     var recommended = this.data.recommended;
     var i, item;
@@ -93,5 +97,37 @@ Page({
     this.setData({
       recommended: recommended
     });
+  },
+  submitsearchword:function(word){
+    wx.navigateTo({ url: `../searchresult/searchresult?value=${word}`});
   }
+//   /*
+//     搜索失去聚焦事件
+//    */
+//   inputBlur:function(e){
+//     inputBlur.call(this,e);
+//   },
+//   /*
+//    触发搜索聚焦事件
+//   */
+//   searchFocus: function (e) {
+//     searchFocus.call(this, e);
+//   }
+//  /*
+//     搜索确定时事件
+//    */
+  // inputConfirm:function(e){
+  //   inputConfirm.call(this,e)
+  // },
+  // scroll:function(e){
+  //   this.setData({
+  //     scrolltop: e.detail.scrollTop == 0
+  //   })
+  // },
+  // checkshowout:function(e){
+
+  // },
+  // checkshowoutend:function(e){
+
+  // }
 })

+ 8 - 6
pages/index/index.wxml

@@ -4,8 +4,10 @@
 <import src="banner.wxml"/>
 <import src="goodcar.wxml"/>
 <import src="cardetail.wxml"/>
-<import src="likecardetail.wxml"/>
-<view class="conent">
+<import src="../../module/caritem/caritem.wxml"/>
+<scroll-view 
+  class="conent"
+>
   <template 
     is="header" 
     data="{{title:'第一好车'}}"
@@ -124,7 +126,7 @@
         </block>      
       </swiper>
       <view class="recommended_tab">
-        <block wx:for="{{banner}}" wx:key="key">
+        <block wx:for="{{banner}}" wx:key="id">
           <view wx:if="{{item.selected}}" class='recommended_tab-item recommend_selected'></view>
           <view wx:else class="recommended_tab-item"></view>
         </block>
@@ -138,8 +140,8 @@
     </view>
   </view>
   <view class="like_cart_c">
-    <block wx:for="{{recommended}}" wx:key="key">
-      <template is="likecardetail" data="{{car:item}}"/>
+    <block wx:for="{{like}}" wx:key="id">
+      <template is="caritem" data="{{car:item}}"/>
     </block>
   </view>
   <view class="show_more">加载更多></view>
@@ -148,4 +150,4 @@
     is="footer" 
     data="{{local:0}}"
   />
-</view>
+</scroll-view>

+ 2 - 37
pages/index/index.wxss

@@ -1,4 +1,6 @@
 @import "../../module/search/search.wxss"
+@import "../../module/caritem/caritem.wxss"
+
 /*******topbanner*********/
 
 .conent{
@@ -194,14 +196,6 @@
 .like_cart_c{
   margin-top:-20rpx;
 }
-.likecar_b{
-  height: 200rpx;
-  width:100%;
-  display: flex;
-  margin-top:20rpx;
-  border-top:1px solid #F9F9F9;
-  background: white;
-}
 .car_img{
   display: block;
   width:336rpx;
@@ -210,14 +204,6 @@
   background-size: 100%;
   background-position: center;
 }
-.likecar_img{
-  display: block;
-  width:290rpx;
-  height:100%;
-  background-repeat: no-repeat;
-  background-size: 100%;
-  background-position: center;
-}
 .car_info{
   padding:10rpx 0rpx 0rpx 40rpx;
   align-items:center;
@@ -236,16 +222,6 @@
   font-size: 20rpx;
   text-align: left;
 }
- .car_store{
-  height: 28rpx;
-  line-height: 28rpx;
-  color: rgba(245, 166, 35, 1);
-  font-size: 20rpx;
-  text-align: center;
-  display: inline-block;
-  border:1px solid rgba(245, 166, 35, 1);
-  border-radius: 8rpx;
-} 
 .car_p{
   height: 33rpx;
   line-height: 33rpx;
@@ -266,17 +242,6 @@
   background-color: rgba(255, 230, 0, 1);
   color: rgba(56, 55, 53, 1);
 }
-.car_guide_p{
-  height: 33rpx;
-  line-height: 33rpx;
-  color: rgba(104, 104, 104, 1);
-  font-size: 22rpx;
-  text-align: left;
-}
-.car_guidep{
-  display: inline;
-  text-decoration:line-through;
-}
 .show_more{
   line-height: 68rpx;
   height: 68rpx;

+ 7 - 2
pages/index/likecardetail.wxml

@@ -1,11 +1,16 @@
-<template name="likecardetail">
+<template name="caritem">
   <view class="likecar_b">
     <view class="likecar_img" style="background-image:url({{car.img}})"/>
     <view class="car_info">
       <view class="car_t">{{car.title}}</view>
       <view class="car_time">
         {{car.licensetime}}年上牌|{{car.mileage}}万公里
-        <view class="car_store">{{car.store_name}}</view>
+        <navigator 
+          url="../shop/shop?id={{car.store_id}}"
+          class="car_store"
+        >
+          {{car.store_name}}
+        </navigator>
       </view>
       <view class="car_p">
         {{car.saleprice}}万

+ 66 - 0
pages/sell/sell.js

@@ -0,0 +1,66 @@
+// pages/sell/sell.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  }
+})

+ 1 - 0
pages/sell/sell.json

@@ -0,0 +1 @@
+{}

+ 2 - 0
pages/sell/sell.wxml

@@ -0,0 +1,2 @@
+<!--pages/sell/sell.wxml-->
+<text>pages/sell/sell.wxml</text>

+ 1 - 0
pages/sell/sell.wxss

@@ -0,0 +1 @@
+/* pages/sell/sell.wxss */

+ 82 - 0
pages/shop/shop.js

@@ -0,0 +1,82 @@
+// pages/shop/shop.js
+import { get } from "../../common/request.js"
+import pathmap from "../../common/pathmap"
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      id:options.id
+    })
+    this.loadDetail();
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  },
+  loadDetail:function(){
+    var _self = this;
+    get(pathmap.storeinfo, {
+      store_id:this.data.id
+    }, function (json) {
+      _self.setData({
+        info: json.data
+      })
+    })
+  }
+})

+ 1 - 0
pages/shop/shop.json

@@ -0,0 +1 @@
+{}

+ 2 - 0
pages/shop/shop.wxml

@@ -0,0 +1,2 @@
+<!--pages/shop/shop.wxml-->
+<text>pages/shop/shop.wxml</text>

+ 1 - 0
pages/shop/shop.wxss

@@ -0,0 +1 @@
+/* pages/shop/shop.wxss */

+ 2 - 2
project.config.json

@@ -6,8 +6,8 @@
 	"setting": {
 		"urlCheck": false,
 		"es6": true,
-		"postcss": false,
-		"minified": false,
+		"postcss": true,
+		"minified": true,
 		"newFeature": true
 	},
 	"compileType": "miniprogram",