更换版本
This commit is contained in:
70
pages/collection/index.js
Normal file
70
pages/collection/index.js
Normal file
@@ -0,0 +1,70 @@
|
||||
var t, a;
|
||||
(t = getApp()),
|
||||
(a = 2),
|
||||
Page({
|
||||
data: { carslist: [] },
|
||||
onLoad: function (a) {
|
||||
var e = this;
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
m: "monai_market",
|
||||
uid: t.getuid(),
|
||||
leftid: "",
|
||||
r: "sale.salelist.getcollection",
|
||||
},
|
||||
success: function (t) {
|
||||
e.setData({ carslist: t.data.data });
|
||||
},
|
||||
});
|
||||
},
|
||||
delcollection: function (a) {
|
||||
var e = this;
|
||||
console.log(a.currentTarget.dataset.id),
|
||||
t.util.getUserInfo(function (t) {
|
||||
t.memberInfo || that.setData({ isShow: !0 });
|
||||
}),
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
m: "monai_market",
|
||||
r: "me.follow",
|
||||
uid: t.getuid(),
|
||||
type: 2,
|
||||
ucar_id: a.currentTarget.dataset.id,
|
||||
},
|
||||
cachetime: "0",
|
||||
success: function (t) {
|
||||
var s = e.data.carslist;
|
||||
s.splice(a.currentTarget.dataset.index, 1),
|
||||
e.setData({ carslist: s });
|
||||
},
|
||||
});
|
||||
},
|
||||
retocards: function (t) {
|
||||
console.log(t.currentTarget.dataset.id),
|
||||
wx.navigateTo({
|
||||
url:
|
||||
"/pages/home/carMessage/carMessage?id=" +
|
||||
t.currentTarget.dataset.id,
|
||||
});
|
||||
},
|
||||
onReachBottom: function () {
|
||||
var e = this,
|
||||
s = e.data.carslist;
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
m: "monai_market",
|
||||
uid: t.getuid(),
|
||||
leftid: a,
|
||||
r: "sale.salelist.getcollection",
|
||||
},
|
||||
success: function (t) {
|
||||
var i = t.data.data.length;
|
||||
if ((a++, i > 0)) for (var r = 0; r < i; r++) s.push(t.data.data[r]);
|
||||
e.setData({ carslist: s });
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
1
pages/collection/index.json
Normal file
1
pages/collection/index.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "我的收藏", "usingComponents": {} }
|
16
pages/collection/index.wxml
Normal file
16
pages/collection/index.wxml
Normal file
@@ -0,0 +1,16 @@
|
||||
<view class="modle_border" wx:if="{{carslist.length>0}}">
|
||||
<view bindtap="{{item.status<3?'':item.delete_time>0?'':'retocards'}}" class="modle" data-id="{{item.id}}" wx:for="{{carslist}}" wx:key="carslist">
|
||||
<image class="modle_img" src="{{item.img_patch}}"></image>
|
||||
<view class="{{item.status<3?'mengceng1':item.delete_time>0?'mengceng1':'nones'}}">{{item.status<3?'已下架':item.delete_time>0?'已删除':''}}</view>
|
||||
<view class="modle_name">{{item.name}} {{item.km}}万公里 {{item.agelimit<1?'准新车':item.agelimit+'年车'}}</view>
|
||||
<view class="modle_chexing">车型:{{item.class_name}} <view bindtap="delcollection" class="modle_chexing_btn" data-id="{{item.id}}" data-index="{{index}}">删除</view>
|
||||
</view>
|
||||
<view class="modle_price">{{item.price}}万</view>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:else>
|
||||
<import src="/pages/data_null/index.wxml"></import>
|
||||
<view>
|
||||
<template is="title" data="{{title:'暂无收藏数据'}}"></template>
|
||||
</view>
|
||||
</block>
|
68
pages/collection/index.wxss
Normal file
68
pages/collection/index.wxss
Normal file
@@ -0,0 +1,68 @@
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
.mengceng1 {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
height: 180rpx;
|
||||
line-height: 180rpx;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
width: 180rpx;
|
||||
}
|
||||
.nones {
|
||||
display: none;
|
||||
}
|
||||
.modle_border {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
.modle {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
height: 180rpx;
|
||||
margin-left: 5%;
|
||||
padding-bottom: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
width: 90%;
|
||||
}
|
||||
.modle_img {
|
||||
float: left;
|
||||
height: 180rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
.modle_name {
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.modle_chexing,
|
||||
.modle_name {
|
||||
float: left;
|
||||
padding-left: 25rpx;
|
||||
width: 470rpx;
|
||||
}
|
||||
.modle_chexing {
|
||||
color: #555;
|
||||
font-size: 26rpx;
|
||||
line-height: 54rpx;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.modle_chexing_btn {
|
||||
background: #3d61f0;
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
float: right;
|
||||
font-size: 28rpx;
|
||||
height: 54rpx;
|
||||
line-height: 54rpx;
|
||||
text-align: center;
|
||||
width: 146rpx;
|
||||
}
|
||||
.modle_price {
|
||||
color: #f75f5f;
|
||||
float: left;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
margin-top: 35rpx;
|
||||
padding-left: 25rpx;
|
||||
width: 470rpx;
|
||||
}
|
Reference in New Issue
Block a user