更换版本
This commit is contained in:
97
pages/home/index/index.js
Normal file
97
pages/home/index/index.js
Normal file
@@ -0,0 +1,97 @@
|
||||
var t;
|
||||
(t = getApp()),
|
||||
Page({
|
||||
data: {
|
||||
leftid: 1,
|
||||
check_name: "",
|
||||
carList: [],
|
||||
show: !0,
|
||||
name: "",
|
||||
title: "没有匹配结果,换个关键词吧!",
|
||||
plate_type: 1,
|
||||
},
|
||||
onLoad: function (t) {
|
||||
(this.data.name = t.name), this._list(), this._info_set();
|
||||
},
|
||||
_info_set: function () {
|
||||
var a = this;
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: { m: "monai_market", r: "home.index.info_set" },
|
||||
cachetime: "0",
|
||||
success: function (t) {
|
||||
2 == t.data.data.plate_type && a.setData({ plate_type: 2 });
|
||||
},
|
||||
});
|
||||
},
|
||||
_list: function () {
|
||||
var a = this;
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
m: "monai_market",
|
||||
r: "home.index.search_index",
|
||||
name: this.data.name,
|
||||
leftid: this.data.leftid++,
|
||||
},
|
||||
cachetime: "0",
|
||||
success: function (t) {
|
||||
var e;
|
||||
console.log(t),
|
||||
t.data.data.length > 0
|
||||
? ((e = a.data.carList).push.apply(
|
||||
e,
|
||||
(function (t) {
|
||||
if (Array.isArray(t)) {
|
||||
for (var a = 0, e = Array(t.length); a < t.length; a++)
|
||||
e[a] = t[a];
|
||||
return e;
|
||||
}
|
||||
return Array.from(t);
|
||||
})(t.data.data)
|
||||
),
|
||||
a.setData({ carList: a.data.carList }))
|
||||
: (a.data.show = !1);
|
||||
},
|
||||
});
|
||||
},
|
||||
onReachBottom: function () {
|
||||
this.data.show && this._list();
|
||||
},
|
||||
detile: function (a) {
|
||||
var e = t.getAttr(a, "id");
|
||||
wx.navigateTo({ url: "/pages/home/carMessage/carMessage?id=" + e });
|
||||
},
|
||||
previewImage: function (a) {
|
||||
var e = t.getAttr(a, "src"),
|
||||
r = t.getAttr(a, "index");
|
||||
console.log(r);
|
||||
var i = [],
|
||||
n = !0,
|
||||
s = !1,
|
||||
o = void 0;
|
||||
try {
|
||||
for (
|
||||
var c, d = this.data.carList[r].image[Symbol.iterator]();
|
||||
!(n = (c = d.next()).done);
|
||||
n = !0
|
||||
) {
|
||||
var l = c.value;
|
||||
i.push(l.img_patch);
|
||||
}
|
||||
} catch (a) {
|
||||
(s = !0), (o = a);
|
||||
} finally {
|
||||
try {
|
||||
!n && d.return && d.return();
|
||||
} finally {
|
||||
if (s) throw o;
|
||||
}
|
||||
}
|
||||
wx.previewImage({ current: e, urls: i });
|
||||
},
|
||||
store: function (a) {
|
||||
var e = t.getAttr(a, "uid");
|
||||
wx.navigateTo({ url: "/pages/store/index?uid=" + e });
|
||||
},
|
||||
});
|
1
pages/home/index/index.json
Normal file
1
pages/home/index/index.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "搜索列表", "usingComponents": {} }
|
47
pages/home/index/index.wxml
Normal file
47
pages/home/index/index.wxml
Normal file
@@ -0,0 +1,47 @@
|
||||
<view wx:if="{{carList.length>0}}">
|
||||
<view class="shop_border">
|
||||
<view class="shop_modle" hidden="{{plate_type!=1}}" wx:for="{{carList}}" wx:for-index="indexs" wx:key="6">
|
||||
<view class="shop_modle_headImg_view">
|
||||
<image bindtap="store" class="shop_modle_headImg" data-uid="{{item.uid}}" src="{{item.head_image.head_image}}"></image>
|
||||
<view class="shop_modle_headImg_view_btmTextView" wx:if="{{item.top_status}}">推荐</view>
|
||||
</view>
|
||||
<view class="shop_modle_right">
|
||||
<view bindtap="detile" data-id="{{item.id}}">
|
||||
<view class="shop_modle_right_title">
|
||||
<text class="shop_modle_right_title_name">{{item.head_image.nickname?item.head_image.nickname:item.username}}</text>
|
||||
<text class="ziying" wx:if="{{item.uid==0}}">自营</text>
|
||||
<text class="shop_modle_right_title_right">{{item.price}}万</text>
|
||||
</view>
|
||||
<view class="shop_modle_message">
|
||||
<text style="font-weight:normal"></text> 【{{item.name}}】 {{item.km}}公里 {{item.agelimit==0?'全新车':'车龄 '+item.agelimit+'年'}}</view>
|
||||
<view class="shop_modle_area">
|
||||
<text class="shop_modle_area_dian">·</text>{{item.timestr}}·{{item.caraddress}}</view>
|
||||
</view>
|
||||
<scroll-view class="solid_modle_scroll" scrollX="true">
|
||||
<view class="solid_modle_scroll_modle" wx:for="{{item['image']}}">
|
||||
<image bindtap="previewImage" class="solid_modle_scroll_modle_img" data-index="{{index}}" data-src="{{item.img_patch}}" src="{{item.img_patch}}"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="shop_modle_num">浏览 {{item.browse}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btm_nav"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="modle" hidden="{{plate_type!=2}}" wx:for="{{carList}}" wx:for-index="indexs" wx:key="6">
|
||||
<view class="tuijian" wx:if="{{item['top_status']}}">推荐</view>
|
||||
<image bindtap="detile" class="modle_img" data-id="{{item.id}}" mode="aspectFill" src="{{item.carimg}}"></image>
|
||||
<view bindtap="detile" class="message_border" data-id="{{item.id}}">
|
||||
<view class="modle_name">
|
||||
<view class="ziying" wx:if="{{item.is_vip==1}}">认证车商</view>
|
||||
<view class="ziying" wx:if="{{item.uid==0}}">自营</view> {{item.name}} {{item.agelimit==0?'全新车':'车龄 '+item.agelimit+'年'}} {{item.exhaust}} {{item.gearbox==0?'手自一体':''}}{{item.gearbox==2?'手动档':''}}{{item.gearbox==2?'手自一体':''}}{{item.gearbox==2?'自动档':''}}</view>
|
||||
<view class="modle_chexing"> {{item.year}} | {{item.km}}万公里 </view>
|
||||
<view class="modle_price">{{item.price}}万 </view>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:if="{{carList.length<=0}}">
|
||||
<import src="/pages/data_null/index.wxml"></import>
|
||||
<view>
|
||||
<template is="title" data="{{title:title}}"></template>
|
||||
</view>
|
||||
</block>
|
462
pages/home/index/index.wxss
Normal file
462
pages/home/index/index.wxss
Normal file
@@ -0,0 +1,462 @@
|
||||
.serch_view,
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
.serch_view {
|
||||
padding-bottom: 10rpx;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
.serch_border {
|
||||
background: #f2f2f2;
|
||||
border-radius: 100px;
|
||||
display: inline-block;
|
||||
height: 60rpx;
|
||||
margin-left: 3%;
|
||||
margin-top: 14rpx;
|
||||
width: 94%;
|
||||
z-index: 10;
|
||||
}
|
||||
.serch_border_nav {
|
||||
height: 90rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.serch_border_img {
|
||||
border-right: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
float: left;
|
||||
height: 38rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 13rpx;
|
||||
padding-right: 10rpx;
|
||||
width: 38rpx;
|
||||
}
|
||||
.serch_border_text {
|
||||
color: #333;
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 60rpx;
|
||||
padding-left: 15rpx;
|
||||
width: 80%;
|
||||
}
|
||||
.scroll_size {
|
||||
height: 375rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.xiaoxi {
|
||||
background: #fff;
|
||||
border-bottom: 20rpx solid #f9f9f9;
|
||||
display: block;
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
padding-top: 1rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.xiaoxi_leftImg {
|
||||
float: left;
|
||||
height: 40rpx;
|
||||
margin-top: 20rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 15rpx;
|
||||
width: 40rpx;
|
||||
}
|
||||
.xiaoxi_right_btn {
|
||||
border: 1px solid #3d61f0;
|
||||
border-radius: 5rpx;
|
||||
color: #3d61f0;
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 45rpx;
|
||||
line-height: 45rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 17.5rpx;
|
||||
text-align: center;
|
||||
width: 100rpx;
|
||||
}
|
||||
.update_scroll_modle {
|
||||
color: #555;
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 505rpx;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.nav {
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1);
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.nav_modle {
|
||||
color: #b2b2b2;
|
||||
display: inline-block;
|
||||
font-size: 26rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 20%;
|
||||
}
|
||||
.nav_modle_active {
|
||||
color: #3d61f0;
|
||||
}
|
||||
.nav_modle_img {
|
||||
height: 30rpx;
|
||||
padding-left: 10rpx;
|
||||
vertical-align: middle;
|
||||
width: 30rpx;
|
||||
}
|
||||
.shop_modle {
|
||||
margin-left: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
width: 720rpx;
|
||||
}
|
||||
.shop_modle_left {
|
||||
border-radius: 100%;
|
||||
display: inline-block;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
}
|
||||
.shop_modle_right {
|
||||
display: inline-block;
|
||||
padding-left: 20rpx;
|
||||
vertical-align: top;
|
||||
width: 570rpx;
|
||||
}
|
||||
.shop_modle_right_title {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.shop_modle_right_title_right {
|
||||
color: #f75f5f;
|
||||
float: right;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.shop_modle_area {
|
||||
color: #9295a8;
|
||||
font-size: 24rpx;
|
||||
margin-top: 10rpx;
|
||||
width: 570rpx;
|
||||
}
|
||||
.shop_modle_area_dian {
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
.shop_modle_area_dian,
|
||||
.shop_modle_message {
|
||||
color: #f75f5f;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.shop_modle_message,
|
||||
.shop_modle_num {
|
||||
margin-top: 10rpx;
|
||||
width: 570rpx;
|
||||
}
|
||||
.shop_modle_num {
|
||||
color: #9295a8;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.solid_modle_scroll_img {
|
||||
width: 100%;
|
||||
}
|
||||
.solid_modle_scroll {
|
||||
overflow-x: scroll;
|
||||
display: block;
|
||||
height: 180rpx;
|
||||
margin-top: 10rpx;
|
||||
white-space: nowrap;
|
||||
width: 600rpx;
|
||||
}
|
||||
.solid_modle_scroll_modle {
|
||||
display: inline-block;
|
||||
height: 180rpx;
|
||||
margin-left: 10rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
.solid_modle_scroll_modle_img {
|
||||
border-radius: 5rpx;
|
||||
height: 180rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
.btm_nav {
|
||||
height: 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
@-webkit-keyframes top {
|
||||
0% {
|
||||
top: 565rpx;
|
||||
}
|
||||
100% {
|
||||
top: 90rpx;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes down {
|
||||
0% {
|
||||
top: 90rpx;
|
||||
}
|
||||
100% {
|
||||
top: 565rpx;
|
||||
}
|
||||
}
|
||||
.shop_view {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
.shop_border {
|
||||
width: 100%;
|
||||
}
|
||||
.shop_view_topactive {
|
||||
-webkit-animation: top 1s;
|
||||
top: 90rpx;
|
||||
}
|
||||
.shop_view_downactive {
|
||||
-webkit-animation: down 1s;
|
||||
top: 565rpx;
|
||||
}
|
||||
.nav_fenlei {
|
||||
background: #fff;
|
||||
padding-bottom: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
.nav_fenlei_title {
|
||||
color: #333;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.nav_fenlei_modle {
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
color: #555;
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
margin-left: 27rpx;
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
width: 150rpx;
|
||||
}
|
||||
.nav_fenlei_modle_img {
|
||||
display: block;
|
||||
height: 30rpx;
|
||||
margin-left: 120rpx;
|
||||
margin-top: 20rpx;
|
||||
position: absolute;
|
||||
width: 30rpx;
|
||||
}
|
||||
.nav_fenlei_modle_active {
|
||||
border: 1px solid #3d61f0;
|
||||
color: #3d61f0;
|
||||
}
|
||||
.nav_fenlei_mengceng {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
height: 100vh;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 5;
|
||||
}
|
||||
.type_btn_border {
|
||||
border-top: 1rpx solid #f9f9f9;
|
||||
height: 90rpx;
|
||||
margin-left: 5%;
|
||||
margin-top: 20rpx;
|
||||
width: 90%;
|
||||
}
|
||||
.type_btn_border_index {
|
||||
background: #fff;
|
||||
border: 1rpx solid #f75f5f;
|
||||
border-radius: 0;
|
||||
color: #f75f5f;
|
||||
line-height: 48rpx;
|
||||
margin: 30rpx 0 0 100rpx;
|
||||
}
|
||||
.type_btn_border_index,
|
||||
.type_btn_border_second {
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 50rpx;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
width: 150rpx;
|
||||
}
|
||||
.type_btn_border_second {
|
||||
background: #3d61f0;
|
||||
border-radius: 0;
|
||||
color: #fff;
|
||||
line-height: 50rpx;
|
||||
margin: 30rpx 0 0 210rpx;
|
||||
}
|
||||
button::after {
|
||||
border: none;
|
||||
}
|
||||
.paixu_modle {
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
color: #333;
|
||||
font-size: 24rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
}
|
||||
.paixu_modle_img {
|
||||
float: right;
|
||||
height: 40rpx;
|
||||
margin-top: 20rpx;
|
||||
width: 40rpx;
|
||||
}
|
||||
.paixu_modle_active {
|
||||
color: #3d61f0;
|
||||
}
|
||||
.choose_view {
|
||||
background: #f2f2f2;
|
||||
padding: 1rpx 2% 12rpx;
|
||||
width: 96%;
|
||||
}
|
||||
.choose_view_modle {
|
||||
background: #fff;
|
||||
color: #555;
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
height: 46rpx;
|
||||
line-height: 46rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 15rpx;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.choose_view_modle_img {
|
||||
height: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
vertical-align: middle;
|
||||
width: 20rpx;
|
||||
}
|
||||
.shop_modle_headImg_view {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.shop_modle_headImg,
|
||||
.shop_modle_headImg_view {
|
||||
border-radius: 100%;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
}
|
||||
.shop_modle_headImg_view_btmTextView {
|
||||
background: #f5a623;
|
||||
color: #fff;
|
||||
font-size: 16rpx;
|
||||
line-height: 28rpx;
|
||||
margin-top: -35rpx;
|
||||
overflow: hidden;
|
||||
padding-bottom: 10rpx;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
width: 100rpx;
|
||||
}
|
||||
.ziying {
|
||||
height: 27rpx;
|
||||
line-height: 27rpx;
|
||||
margin-top: -20rpx;
|
||||
}
|
||||
.ziying:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
.shop_modle_right_title_name {
|
||||
display: inline-block;
|
||||
max-width: 65%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.modle {
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
height: 180rpx;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
width: 690rpx;
|
||||
}
|
||||
.modle_img {
|
||||
background: #e0e0e0;
|
||||
border-radius: 10rpx;
|
||||
float: left;
|
||||
height: 180rpx;
|
||||
width: 270rpx;
|
||||
}
|
||||
.modle_name {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
color: #333;
|
||||
display: -webkit-box;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
overflow: hidden;
|
||||
padding-left: 20rpx;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
}
|
||||
.modle_chexing {
|
||||
color: #7a7a7a;
|
||||
font-size: 24rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.modle_chexing,
|
||||
.modle_price {
|
||||
overflow: hidden;
|
||||
padding-left: 20rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.modle_price {
|
||||
bottom: 0rpx;
|
||||
color: #f75f5f;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
position: absolute;
|
||||
}
|
||||
.modle_price_ago {
|
||||
color: #7a7a7a;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.modle_price_ago_fen {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.message_border {
|
||||
float: left;
|
||||
height: 180rpx;
|
||||
position: relative;
|
||||
width: 420rpx;
|
||||
}
|
||||
.ziying {
|
||||
background: #3d61f0;
|
||||
display: inline-block;
|
||||
margin-left: 10rpx;
|
||||
margin-top: -5rpx;
|
||||
vertical-align: middle;
|
||||
width: 80rpx;
|
||||
}
|
||||
.tuijian,
|
||||
.ziying {
|
||||
border-radius: 5rpx;
|
||||
color: #fff;
|
||||
font-size: 16rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.tuijian {
|
||||
background: #ec6d6e;
|
||||
margin-top: 152rpx;
|
||||
position: absolute;
|
||||
width: 56rpx;
|
||||
}
|
Reference in New Issue
Block a user