Commit ae3329f4 by 胡悦

feat(二手车): 添加二手车功能模块及优化相关组件

- 新增二手车功能模块,包括车辆列表、详情页和业务数据展示
- 优化排序功能,支持升序、降序和默认排序
- 添加分页加载和空状态显示
- 完善日期选择器功能,支持日、周、月视图切换
- 修复样式问题和数据展示格式
- 增加图片预览功能
- 根据usedCarFlag控制二手车功能显示
1 parent 0588f22b
...@@ -49,6 +49,15 @@ ...@@ -49,6 +49,15 @@
font-size: 36rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
line-height: 64rpx; line-height: 64rpx;
display: flex;
align-items: center;
.unit {
display: inline-block;
font-size: 28rpx;
color: #222222;
line-height: 50rpx;
}
} }
.card-compare { .card-compare {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="data-row"> <view class="data-row">
<view class="data-card" wx:for="{{firstCell}}" wx:key="index"> <view class="data-card" wx:for="{{firstCell}}" wx:key="index">
<view class="first-row-title">{{item.name}}</view> <view class="first-row-title">{{item.name}}</view>
<view class="first-card-value">¥{{boardData[item.value] == null ? '-' : item.haswan ? filter.threeNumForTwoPriceFormat(boardData[item.value]) : filter.money_three_for_two_thousands(boardData[item.value])}}</view> <view class="first-card-value"><view class="unit">¥</view>{{boardData[item.value] == null ? '-' : item.haswan ? filter.threeNumForTwoPriceFormat(boardData[item.value]) : filter.money_three_for_two_thousands(boardData[item.value])}}</view>
<view class="card-compare neutral"> <view class="card-compare neutral">
环比{{boardData[item.rate] == null ? '-' : boardData[item.rate] + '%'}} 环比{{boardData[item.rate] == null ? '-' : boardData[item.rate] + '%'}}
<glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image> <glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
......
...@@ -48,17 +48,23 @@ Component({ ...@@ -48,17 +48,23 @@ Component({
* @param {Object} e - 事件对象 * @param {Object} e - 事件对象
*/ */
handleSort(e) { handleSort(e) {
console.log(e, 'handleSort')
const field = e.currentTarget.dataset.field; const field = e.currentTarget.dataset.field;
let order = this.data.sortOrder; let order = this.data.sortOrder;
// 如果点击的是当前排序字段,则切换排序顺序 // 如果点击的是当前排序字段,则切换排序顺序
if (field === this.data.sortField) { if (field === this.data.sortField) {
order = order === 'asc' ? 'desc' : 'asc'; if (order === 'asc') {
order = 'desc';
} else if (order === 'desc') {
order = '';
} else {
order = 'asc';
}
} else { } else {
// 如果点击的是新字段,则默认使用升序 // 如果点击的是新字段,则默认使用升序
order = 'asc'; order = 'asc';
} }
this.setData({ this.setData({
sortField: field, sortField: field,
sortOrder: order sortOrder: order
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
margin-bottom: 4rpx; margin-bottom: 4rpx;
&.active { &.active {
border-bottom-color: #4265f5; border-bottom-color: #3666FE;
} }
} }
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
border-top: 10rpx solid #ccc; border-top: 10rpx solid #ccc;
&.active { &.active {
border-top-color: #4265f5; border-top-color: #3666FE;
} }
} }
} }
......
// packagesList/outDetail/components/SecondHandCar/components/VehicleList/index.js // packagesList/outDetail/components/SecondHandCar/components/VehicleList/index.js
import {newApi} from '~/api/secondHandApi' import {newApi} from '~/api/secondHandApi'
import {vehicle_category} from '../../contant' import {vehicle_category} from '../../contant'
import dayjs from 'dayjs'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
timeType: {
type: String,
value: 'date'
},
date: {
type: String,
value: '',
observer(newVal) {
console.log(newVal, 'date')
if (newVal) {
const params = this.computedDate(newVal)
this.setData({
pageParams: {
pageNum: 1,
pageSize: 5
},
scrollTop: 0
})
this.getVehicleList(params, 'date')
}
}
},
currentWeek: {
type: String,
value: ''
},
}, },
/** /**
...@@ -15,12 +41,20 @@ Component({ ...@@ -15,12 +41,20 @@ Component({
*/ */
data: { data: {
vehicleList: [], vehicleList: [],
vehicle_category vehicle_category,
pageParams: {
pageNum: 1,
pageSize: 5
},
total: 0,
sortParams: {},
scrollTop: 0,
isEnd: false
}, },
lifetimes: { lifetimes: {
attached() { attached() {
console.log('=======getVehicleList') console.log('=======getVehicleList')
this.getVehicleList() // this.getVehicleList()
} }
}, },
/** /**
...@@ -30,11 +64,29 @@ Component({ ...@@ -30,11 +64,29 @@ Component({
// 父组件中 // 父组件中
onSort(e) { onSort(e) {
const { field, order } = e.detail; const { field, order } = e.detail;
// 调用接口进行排序 console.log(field, order, 'onSort')
this.fetchData({ const params = {}
sortField: field, if (order) {
sortOrder: order if (order == 'asc') {
}); params.asc = true
} else if (order == 'desc') {
params.asc = false
}
if (field == 'buyPrice') {
params.sortBy = 1
} else if (field == 'sellPrice') {
params.sortBy = 2
}
}
this.setData({
sortParams: params,
pageParams: {
pageNum: 1,
pageSize: 5
},
scrollTop: 0
})
this.getVehicleList(params, 'sort')
}, },
jumpDetail(e) { jumpDetail(e) {
console.log(e.currentTarget.dataset.evalorderno, 'evalOrderNo') console.log(e.currentTarget.dataset.evalorderno, 'evalOrderNo')
...@@ -43,25 +95,74 @@ Component({ ...@@ -43,25 +95,74 @@ Component({
evalorderno evalorderno
}) })
}, },
computedDate(date) {
const {timeType} = this.data
let dateParams = {}
if (timeType == 'date') {
dateParams.startDate = dateParams.endDate = dayjs(date).format('YYYY-MM-DD');
} else if (timeType == 'year-month') {
dateParams.startDate = dayjs(date).startOf('month').format('YYYY-MM-DD');
dateParams.endDate = dayjs(date).endOf('month').format('YYYY-MM-DD');
} else {
const [start, end] = date.split('-').map(d => dayjs(d.trim()));
dateParams.startDate = start.format('YYYY-MM-DD');
dateParams.endDate = end.format('YYYY-MM-DD');
}
return dateParams
},
getParams() {
const {pageParams, sortParams} = this.data
const dateParams = this.computedDate(this.data.date)
return {...pageParams, ...sortParams, ...dateParams}
},
// 车辆列表 // 车辆列表
async getVehicleList() { async getVehicleList(params = {}, type) {
const result = await newApi.post('/minicarManage/findAllSoldPage', { const {pageParams, sortParams} = this.data
endDate: '2025-01-01', if (type == 'date') {
startDate: '2024-01-01', params = {...params, ...pageParams, ...sortParams}
sortBy: 1, } else if (type == 'sort') {
asc: true, const dateParams = this.computedDate(this.data.date)
pageNum: 1, params = {...params, ...pageParams, ...dateParams}
pageSize: 10 } else {
}); params = this.getParams()
}
console.log(params, 'params')
wx.showLoading({
title: '加载中',
})
const result = await newApi.post('/minicarManage/findAllSoldPage', params);
result.records.forEach(item => { result.records.forEach(item => {
if (item.evalImageInfoList && item.evalImageInfoList.length) { if (item.evalImageInfoList && item.evalImageInfoList.length) {
item.img = item.evalImageInfoList.find(item => item.fileSubtype == 11)?.fileUrl item.img = item.evalImageInfoList.find(item => item.fileSubtype == 11)?.fileUrl
} }
}) })
let vehicleList
if (pageParams.pageNum == 1) {
vehicleList = result.records || []
} else {
vehicleList = this.data.vehicleList.concat(result.records || [])
}
this.setData({ this.setData({
vehicleList: result.records || [] vehicleList,
total: result.total || 0
}) })
wx.hideLoading()
console.log(result, 'vehicleList') console.log(result, 'vehicleList')
}, },
scrollonReachBottom(e) {
console.log(e, 'scrollonReachBottom')
let { total, pageParams } = this.data
console.log(total)
if (Math.floor(total / pageParams.pageSize) == pageParams.pageNum - 1) {
return this.setData({
isEnd: true
})
}
this.setData({
pageParams: {...pageParams, pageNum: pageParams.pageNum + 1}
}, () => {
this.getVehicleList()
})
}
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -97,9 +97,36 @@ ...@@ -97,9 +97,36 @@
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
.footer-item { .footer-item {
display: flex;
align-items: center;
.name {
max-width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 16rpx;
}
} }
} }
} }
} }
} }
.bottom-tip {
text-align: center;
padding: 30rpx 0;
font-size: 20rpx;
color: #BEC1C7;
}
.no-data {
font-size: 24rpx;
color:#CCCED1;
text-align: center;
&-img {
width: 512rpx;
height: 512rpx;
margin: 84rpx auto 0;
}
.text {
margin-top: -66rpx;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<wxs src="../../index.wxs" module="filter" /> <wxs src="../../index.wxs" module="filter" />
<view class="vehicle-list"> <view class="vehicle-list">
<sort-tab bind:sort="onSort"></sort-tab> <sort-tab bind:sort="onSort"></sort-tab>
<scroll-view scroll-y="true" class="vehicle-ul"> <block wx:if="{{vehicleList.length > 0}}">
<scroll-view scroll-y="true" class="vehicle-ul" bindscrolltolower="scrollonReachBottom" model:scroll-top="{{scrollTop}}">
<view style="padding-bottom: 60rpx;"> <view style="padding-bottom: 60rpx;">
<block wx:for="{{vehicleList}}" wx:key="index"> <block wx:for="{{vehicleList}}" wx:key="index">
<view class="vehicle-li" bind:tap="jumpDetail" data-evalOrderNo="{{item.evalOrderNo}}"> <view class="vehicle-li" bind:tap="jumpDetail" data-evalOrderNo="{{item.evalOrderNo}}">
...@@ -33,11 +34,19 @@ ...@@ -33,11 +34,19 @@
</view> </view>
</view> </view>
<view class="vehicle-footer"> <view class="vehicle-footer">
<view class="footer-item">{{item.evalOrder && item.evalOrder.sellerName ? item.evalOrder.sellerName : '-'}} 15718122929</view> <view class="footer-item"><view class="name">{{item.evalOrder && item.evalOrder.sellerName ? item.evalOrder.sellerName : '-'}}</view> {{item.sellPhone ? item.sellPhone : '-'}}</view>
<view class="footer-item">{{filter.dateFormat(item.sellingTime)}}成交</view> <view class="footer-item">{{filter.dateFormat(item.sellingTime)}}成交</view>
</view> </view>
</view> </view>
</block> </block>
<view wx:if="{{isEnd}}" class="bottom-tip">到底了~</view>
</view> </view>
</scroll-view> </scroll-view>
</block>
<block wx:else>
<view class="no-data">
<glsx-image src="store-assistant-assemble/output/no_data_1.png" class="no-data-img"></glsx-image>
<view class="text">暂无数据~</view>
</view>
</block>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -2,14 +2,24 @@ ...@@ -2,14 +2,24 @@
import { MENUS, DATELIST } from './contant.js' import { MENUS, DATELIST } from './contant.js'
import {newApi} from '~/api/secondHandApi' import {newApi} from '~/api/secondHandApi'
import dayjs from 'dayjs' import dayjs from 'dayjs'
let currentWeek = {} let currentObj
let weekObj
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
usedCarFlag: {
type: Number,
value: 0,
observer(newVal) {
console.log(newVal, '======newVal')
this.setData({
usedCarFlag: newVal
})
}
}
}, },
/** /**
...@@ -49,11 +59,13 @@ Component({ ...@@ -49,11 +59,13 @@ Component({
boardData: {}, boardData: {},
leftCurrent: false, leftCurrent: false,
rightCurrent: false, rightCurrent: false,
defaultIndex: 1 defaultIndex: 1,
usedCarFlag: 0,
}, },
lifetimes: { lifetimes: {
attached() { attached() {
console.log('attached', wx.$router.getPageInstance()) console.log('attached', this.data.usedCarFlag)
if (this.data.usedCarFlag == 0) return
// 获取当前页面的merchantId // 获取当前页面的merchantId
const merchantId = wx.$router.getPageInstance().options.merchantId const merchantId = wx.$router.getPageInstance().options.merchantId
this.setData({ this.setData({
...@@ -128,18 +140,23 @@ lifetimes: { ...@@ -128,18 +140,23 @@ lifetimes: {
}, },
// 日历的关闭 // 日历的关闭
onClose() { onClose() {
this.setData({ show: false }); this.setData({
show: false,
// currentDate: dayjs().valueOf(),
});
}, },
// 日历的确认 // 日历的确认
onConfirm(event) { onConfirm(event) {
console.log(event) console.log(event)
const {current} = this.data
const start = event.detail[0] const start = event.detail[0]
const end = event.detail[1] const end = event.detail[1]
this.setData({ this.setData({
show: false, show: false,
date: `${dayjs(start).format('YYYY/MM/DD')}-${dayjs(end).format('YYYY/MM/DD')}`, date: `${dayjs(start).format('YYYY/MM/DD')}-${dayjs(end).format('YYYY/MM/DD')}`,
}); });
this.getUsedCarBusinessData() console.log(current, 'current')
if (current == 0) this.getUsedCarBusinessData()
}, },
// 初始化日期 // 初始化日期
/** /**
...@@ -148,9 +165,10 @@ lifetimes: { ...@@ -148,9 +165,10 @@ lifetimes: {
*/ */
initDate(type = 'date') { initDate(type = 'date') {
const now = dayjs(); const now = dayjs();
const {current} = this.data
const setData = (payload) => { const setData = (payload) => {
this.setData(payload); this.setData(payload);
this.getUsedCarBusinessData(this.data.merchantId); if (current == 0) this.getUsedCarBusinessData(this.data.merchantId);
}; };
switch (type) { switch (type) {
...@@ -210,31 +228,81 @@ lifetimes: { ...@@ -210,31 +228,81 @@ lifetimes: {
const { index } = event.currentTarget.dataset; const { index } = event.currentTarget.dataset;
console.log(index, 'current') console.log(index, 'current')
this.setData({ this.setData({
current: index current: index,
timeType: 'date',
dateCurrent: 0,
rightCurrent: false,
leftCurrent: false,
}); });
console.log(index, 'selectMenu')
this.initDate('date')
}, },
// 日选择 // 日选择
onDisplayDate() { onDisplayDate() {
if (this.data.timeType == 'custom') { const { timeType, date, currentDate } = this.data
if (timeType == 'custom') {
this.setData({ this.setData({
show: true show: true
}) })
const calendar = this.selectComponent("#calendar")
calendar.reset()
} else { } else {
this.setData({ this.setData({
dateShow: true dateShow: true
}) })
if (timeType == 'date' && currentObj) {
const c_value = currentObj.getValues()
const _date = date.split('/')
if (c_value[0] != _date[0] || c_value[1] != _date[1] || c_value[2] != _date[2]) {
const picker = this.selectComponent("#datePicker")
console.log(picker.picker, 'picker')
console.log(date)
this.setData({
minDate: dayjs().subtract(1, 'year').valueOf(),
maxDate: dayjs().valueOf(),
},
() => {
picker.picker.setValues(_date)
})
}
} else if (timeType == 'year-month'&& currentObj) {
const c_value = currentObj.getValues()
const _date = date.split('/')
if (c_value[0] != _date[0] || c_value[1] != _date[1]) {
const picker = this.selectComponent("#datePicker")
console.log(picker.picker, 'picker')
console.log(date)
this.setData({
minDate: dayjs().subtract(1, 'year').valueOf(),
maxDate: dayjs().valueOf(),
},
() => {
picker.picker.setValues(_date)
})
}
} else if (timeType == 'week') {
const { date, weekColumns} = this.data
const picker = this.selectComponent("#weekPicker")
console.log(picker.getColumnIndex(0), 'picker')
const label = date.replace('-', '至').replace(/\//g, '-');
const index = weekColumns.findIndex(i => i.label == label)
console.log(label, index)
setTimeout(() => {
picker.setColumnIndex(0, index)
}, 0)
}
} }
}, },
// 取消 // 取消
cancel() { cancel() {
this.setData({ this.setData({
dateShow: false, dateShow: false
}) })
}, },
// 年月日确认 // 年月日确认
confirm() { confirm() {
const { selectedDate, timeType, currentWeek } = this.data; const { selectedDate, timeType, currentWeek, current } = this.data;
const formatMap = { const formatMap = {
date: () => dayjs(selectedDate).format('YYYY/MM/DD'), date: () => dayjs(selectedDate).format('YYYY/MM/DD'),
'year-month': () => dayjs(selectedDate).format('YYYY/MM'), 'year-month': () => dayjs(selectedDate).format('YYYY/MM'),
...@@ -279,10 +347,17 @@ lifetimes: { ...@@ -279,10 +347,17 @@ lifetimes: {
dateShow: false, dateShow: false,
date: (formatMap[timeType] || (() => ''))() date: (formatMap[timeType] || (() => ''))()
}); });
console.log(current, 'current')
if (current == 0) this.getUsedCarBusinessData(this.data.merchantId);
}, },
onChange(e) {
console.log(e, e.detail.getValues(), 'onChange')
currentObj = e.detail
},
// 日选择 // 日选择
onInput(event) { onInput(event) {
console.log(dayjs(event.detail).format('YYYY/MM/DD'), 'onInput')
// 防止选择之后,取消选择,导致日期不变 // 防止选择之后,取消选择,导致日期不变
this.setData({ this.setData({
selectedDate: event.detail selectedDate: event.detail
...@@ -299,7 +374,7 @@ lifetimes: { ...@@ -299,7 +374,7 @@ lifetimes: {
}, },
// 上一个月 // 上一个月
last() { last() {
const {timeType, merchantId, date, minDate} = this.data const {timeType, merchantId, date, minDate, current} = this.data
if (timeType == 'year-month') { if (timeType == 'year-month') {
// 使用 dayjs 处理年月逻辑 // 使用 dayjs 处理年月逻辑
const currentDisplayDate = dayjs(date); const currentDisplayDate = dayjs(date);
...@@ -337,11 +412,11 @@ lifetimes: { ...@@ -337,11 +412,11 @@ lifetimes: {
}); });
} }
} }
this.getUsedCarBusinessData(merchantId) if (current == 0) this.getUsedCarBusinessData(merchantId)
}, },
// 下一个月 // 下一个月
next() { next() {
const {timeType, merchantId, date} = this.data const {timeType, merchantId, date, current} = this.data
if (timeType == 'year-month') { if (timeType == 'year-month') {
// 获取当前显示的日期 // 获取当前显示的日期
const currentDisplayDate = dayjs(date); const currentDisplayDate = dayjs(date);
...@@ -388,7 +463,8 @@ lifetimes: { ...@@ -388,7 +463,8 @@ lifetimes: {
console.log(nextWeek == 0, this.data.currentDate) console.log(nextWeek == 0, this.data.currentDate)
} }
} }
this.getUsedCarBusinessData(merchantId) console.log(current, 'current')
if (current == 0) this.getUsedCarBusinessData(merchantId)
}, },
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
.date-section { .date-section {
width: 528rpx; width: 528rpx;
margin: 0 auto; margin: 0 auto;
padding: 0 24rpx; // padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -73,8 +73,27 @@ ...@@ -73,8 +73,27 @@
height: 30rpx; height: 30rpx;
font-size: 30rpx; font-size: 30rpx;
color: #666; color: #666;
.arrow-left {
padding-left: 24rpx;
}
.arrow-right {
padding-right: 24rpx;
}
} }
} }
} }
} }
.no-data {
font-size: 24rpx;
color:#CCCED1;
text-align: center;
&-img {
width: 512rpx;
height: 512rpx;
margin: 84rpx auto 0;
}
.text {
margin-top: -66rpx;
}
}
\ No newline at end of file \ No newline at end of file
<wxs src="../index.wxs" module="filter" /> <wxs src="../index.wxs" module="filter" />
<view class="second-hand-car"> <view class="second-hand-car" wx:if="{{usedCarFlag == 1}}">
<view class="header"> <view class="header">
<view class="title-section"> <view class="title-section">
<block wx:for="{{menus}}" wx:key="index"> <block wx:for="{{menus}}" wx:key="index">
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<view class="date-section"> <view class="date-section">
<view class="arrow left"> <view class="arrow left">
<van-icon wx:if="{{timeType != 'custom' && !leftCurrent}}" name="arrow-left" bind:tap="last" /> <van-icon wx:if="{{timeType != 'custom' && !leftCurrent}}" class="arrow-left" name="arrow-left" bind:tap="last" />
</view> </view>
<view class="date" bind:tap="onDisplayDate">{{date}}</view> <view class="date" bind:tap="onDisplayDate">{{date}}</view>
<view class="arrow right"> <view class="arrow right">
<van-icon wx:if="{{timeType != 'custom' && !rightCurrent}}" name="arrow" bind:tap="next" /> <van-icon wx:if="{{timeType != 'custom' && !rightCurrent}}" class="arrow-right" name="arrow" bind:tap="next" />
</view> </view>
</view> </view>
</view> </view>
...@@ -28,20 +28,25 @@ ...@@ -28,20 +28,25 @@
<board boardData="{{boardData}}"></board> <board boardData="{{boardData}}"></board>
</block> </block>
<block wx:if="{{current==1}}"> <block wx:if="{{current==1}}">
<vehicleList></vehicleList> <vehicleList timeType="{{timeType}}" date="{{date}}" currentWeek="{{currentWeek}}"></vehicleList>
</block> </block>
</view> </view>
<view class="no-data" wx:else>
<glsx-image src="store-assistant-assemble/output/no_data_1.png" class="no-data-img"></glsx-image>
<view class="text">暂未开通~</view>
</view>
<!-- 年月日 --> <!-- 年月日 -->
<popup bind:hidePopup="cancel" bind:confirm="confirm" show="{{dateShow}}" title="{{titleEnum[timeType]}}" height="50vh"> <popup bind:hidePopup="cancel" bind:confirm="confirm" show="{{dateShow}}" title="{{titleEnum[timeType]}}" height="50vh">
<block wx:if="{{timeType == 'date' || timeType == 'year-month'}}"> <block wx:if="{{timeType == 'date' || timeType == 'year-month'}}">
<van-datetime-picker show-toolbar="{{false}}" min-date="{{ minDate }}" max-date="{{ maxDate }}" value="{{ currentDate }}" type="{{timeType=='date'?'date':'year-month'}}" bind:input="onInput" /> <van-datetime-picker id="datePicker" show-toolbar="{{false}}" min-date="{{ minDate }}" max-date="{{ maxDate }}" model:value="{{ currentDate }}" type="{{timeType=='date'?'date':'year-month'}}" bind:change="onChange" bind:input="onInput" />
</block> </block>
<!-- 周 --> <!-- 周 -->
<block wx:if="{{timeType == 'week'}}"> <block wx:if="{{timeType == 'week'}}">
<van-picker show-toolbar="{{false}}" model:value="{{ currentDate }}" default-index="{{defaultIndex}}" value-key="label" columns="{{ weekColumns }}" bind:change="onWeekChange" /> <van-picker id="weekPicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" default-index="{{defaultIndex}}" value-key="label" columns="{{ weekColumns }}" bind:change="onWeekChange" />
</block> </block>
</popup> </popup>
<van-calendar <van-calendar
id="calendar"
max-range="{{ 31 }}" max-range="{{ 31 }}"
min-date="{{ minDate }}" min-date="{{ minDate }}"
max-date="{{ maxDate }}" max-date="{{ maxDate }}"
......
...@@ -16,6 +16,7 @@ Component({ ...@@ -16,6 +16,7 @@ Component({
totals_zc: 0, totals_zc: 0,
ids: [], ids: [],
currentServiceType: 0, currentServiceType: 0,
usedCarFlag: 0,
}, },
methods: { methods: {
// 获取众筹总数 // 获取众筹总数
...@@ -69,10 +70,9 @@ Component({ ...@@ -69,10 +70,9 @@ Component({
}, },
onLoad(options) { onLoad(options) {
const { merchantId, merchantName } = options; const { merchantId, merchantName, usedCarFlag } = options;
this.setData({ merchantId, merchantName }) this.setData({ merchantId, merchantName, usedCarFlag })
this.getSubscribeConfig(options) this.getSubscribeConfig(options)
console.log(Date.now())
this.addEvent() this.addEvent()
}, },
// 获取活动订阅配置 // 获取活动订阅配置
...@@ -82,10 +82,13 @@ Component({ ...@@ -82,10 +82,13 @@ Component({
{ serviceTypeName: '售后众筹', serviceType: 0 }, { serviceTypeName: '售后众筹', serviceType: 0 },
{ serviceTypeName: '会员权益/升级', serviceType: 2 }, { serviceTypeName: '会员权益/升级', serviceType: 2 },
{ serviceTypeName: '二手车', serviceType: 7 }] { serviceTypeName: '二手车', serviceType: 7 }]
const index = tab.findIndex(item => item.serviceType == obj.type) || 0
this.setData({ this.setData({
tab, tab,
fresh: obj && obj.fresh, fresh: obj && obj.fresh,
currentServiceType: obj.type currentServiceType: obj.type || 0,
tabIndex: index,
to: `to-${index}`,
}) })
console.log(Date.now()) console.log(Date.now())
setTimeout(() => { setTimeout(() => {
......
...@@ -64,6 +64,8 @@ page { ...@@ -64,6 +64,8 @@ page {
white-space: nowrap; white-space: nowrap;
box-sizing: border-box; box-sizing: border-box;
padding: 0 32rpx; padding: 0 32rpx;
background-color: #fff;
font-size: 0;
.tab-scroll { .tab-scroll {
height: 100%; height: 100%;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="tab-box" style="top: {{navHeight}}px"> <view class="tab-box" style="top: {{navHeight}}px">
<scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation> <scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view id="{{tab.length<3?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}"> <view id="{{tab.length<4?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view class="inner {{currentServiceType == item.serviceType? 'active' : '' }}"> <view class="inner {{currentServiceType == item.serviceType? 'active' : '' }}">
{{item.serviceTypeName}} {{item.serviceTypeName}}
<block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block> <block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<OutputWork entranceType="{{currentServiceType}}" /> <OutputWork entranceType="{{currentServiceType}}" />
</view> </view>
<view wx:if="{{currentServiceType == 7}}" style="height: 100%;"> <view wx:if="{{currentServiceType == 7}}" style="height: 100%;">
<secondHandCar></secondHandCar> <secondHandCar usedCarFlag="{{usedCarFlag}}"></secondHandCar>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -41,6 +41,7 @@ Page({ ...@@ -41,6 +41,7 @@ Page({
console.log(options, 'onRoute') console.log(options, 'onRoute')
this.getDetail(options.evalorderno) this.getDetail(options.evalorderno)
}, },
// 获取车辆详情
async getDetail(evalOrderNo) { async getDetail(evalOrderNo) {
const result = await newApi.post('/minicarManage/findSoldCarInfoByEvalOrderNo', { const result = await newApi.post('/minicarManage/findSoldCarInfoByEvalOrderNo', {
evalOrderNo evalOrderNo
...@@ -57,6 +58,27 @@ Page({ ...@@ -57,6 +58,27 @@ Page({
detail: result detail: result
}) })
}, },
// 预览图片
preview(e) {
const {url, type} = e.currentTarget.dataset
const {detail} = this.data
if (type == 'bannerList') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: detail.bannerList.map(item => item.fileUrl) // 需要预览的图片http链接列表
})
} else if (type == 'registrationImg') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: detail.registrationImg.map(item => item.fileUrl) // 需要预览的图片http链接列表
})
} else if (type == 'driverImg') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: [url] // 需要预览的图片http链接列表
})
}
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
/* packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxss */ /* packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxss */
.vehicle-detail { .vehicle-detail {
height: 100vh; height: 100%;
background-color: #fff; background-color: #fff;
} }
...@@ -75,6 +75,11 @@ ...@@ -75,6 +75,11 @@
} }
} }
} }
.gap {
width: 100%;
background-color: #F8F9F9;
height: 16rpx;
}
.vehicle-info-box { .vehicle-info-box {
padding: 24rpx 32rpx 80rpx; padding: 24rpx 32rpx 80rpx;
.vehicle-info-title { .vehicle-info-title {
...@@ -85,7 +90,6 @@ ...@@ -85,7 +90,6 @@
} }
.vehicle-info { .vehicle-info {
display: flex; display: flex;
margin: 0 32rpx;
background-color: #F8F9FC; background-color: #F8F9FC;
border-radius: 12rpx; border-radius: 12rpx;
.info-item { .info-item {
...@@ -93,13 +97,14 @@ ...@@ -93,13 +97,14 @@
text-align: center; text-align: center;
padding: 28rpx 0; padding: 28rpx 0;
.label { .label {
font-size: 24rpx;
color: #8A8C90;
}
.value {
font-size: 26rpx; font-size: 26rpx;
color: #393B3E; color: #393B3E;
margin-bottom: 6rpx; margin-bottom: 6rpx;
} font-weight: 500;
.value {
font-size: 24rpx;
color: #8A8C90;
} }
} }
} }
...@@ -117,8 +122,17 @@ ...@@ -117,8 +122,17 @@
margin-right: 12rpx; margin-right: 12rpx;
} }
&-value { &-value {
display: inline-flex;
font-size: 26rpx; font-size: 26rpx;
color: #393B3E; color: #393B3E;
font-weight: 500;
.name {
max-width: 380rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 16rpx;
}
} }
&.small { &.small {
width: 300rpx; width: 300rpx;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<swiper class="swiper-box" current="{{current}}" bindchange="onSwiperChange"> <swiper class="swiper-box" current="{{current}}" bindchange="onSwiperChange">
<block wx:for="{{detail.bannerList}}" wx:key="*this"> <block wx:for="{{detail.bannerList}}" wx:key="*this">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<image class="image" mode="aspectFit" src="{{item.fileUrl}}"></image> <image class="image" mode="aspectFit" bind:tap="preview" data-url="{{item.fileUrl}}" data-type="{{'bannerList'}}" src="{{item.fileUrl}}"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="gap"></view>
<view class="vehicle-info-box"> <view class="vehicle-info-box">
<view class="vehicle-info-title">车辆资料</view> <view class="vehicle-info-title">车辆资料</view>
<view class="vehicle-info"> <view class="vehicle-info">
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
</view> </view>
<view class="other-info long"> <view class="other-info long">
<view class="other-info-label">销售顾问</view> <view class="other-info-label">销售顾问</view>
<view class="other-info-value">{{detail.evalOrder && detail.evalOrder.sellerName ? detail.evalOrder.sellerName : '-'}} 15718122929</view> <view class="other-info-value"><view class="name">{{detail.evalOrder && detail.evalOrder.sellerName ? detail.evalOrder.sellerName : '-'}}</view> {{detail.sellPhone ? detail.sellPhone : '-'}}</view>
</view> </view>
<view class="other-info long"> <view class="other-info long">
<view class="other-info-label">卖出时间</view> <view class="other-info-label">卖出时间</view>
...@@ -91,6 +92,9 @@ ...@@ -91,6 +92,9 @@
class="vehicle-image" class="vehicle-image"
src="{{detail.driverImg}}" src="{{detail.driverImg}}"
mode="aspectFit" mode="aspectFit"
bind:tap="preview"
data-url="{{detail.driverImg}}"
data-type="{{'driverImg'}}"
/> />
</view> </view>
<view class="other-info long" wx:if="{{detail.registrationImg.length}}"> <view class="other-info long" wx:if="{{detail.registrationImg.length}}">
...@@ -101,6 +105,9 @@ ...@@ -101,6 +105,9 @@
class="vehicle-image" class="vehicle-image"
src="{{item.fileUrl}}" src="{{item.fileUrl}}"
mode="aspectFit" mode="aspectFit"
bind:tap="preview"
data-url="{{item.fileUrl}}"
data-type="{{'registrationImg'}}"
/> />
</view> </view>
</view> </view>
......
...@@ -59,7 +59,7 @@ Component({ ...@@ -59,7 +59,7 @@ Component({
const {item:{type,name},info} = e.currentTarget.dataset const {item:{type,name},info} = e.currentTarget.dataset
if(info[name] == '未开通')return if(info[name] == '未开通')return
wx.navigateTo({ wx.navigateTo({
url: `/packagesList/outDetail/index?merchantId=${info.merchantId4s}&type=${type}&merchantName=${info.merchantName4s}`, url: `/packagesList/outDetail/index?merchantId=${info.merchantId4s}&type=${type}&merchantName=${info.merchantName4s}&usedCarFlag=${info.usedCarFlag}`,
}) })
} }
} }
......
...@@ -29,7 +29,7 @@ const clientFormObj = { ...@@ -29,7 +29,7 @@ const clientFormObj = {
name: 'usedCarTotal', name: 'usedCarTotal',
prefix: '¥', prefix: '¥',
isNum: true, isNum: true,
type: 4 type: 7
}], }],
'SC002': [{ 'SC002': [{
label: '营业额', label: '营业额',
......
...@@ -42,7 +42,7 @@ Component({ ...@@ -42,7 +42,7 @@ Component({
}, { }, {
label: '二手车', label: '二手车',
asc: '', asc: '',
value: 4 value: 7
}], }],
'SC002': [{ 'SC002': [{
label: '营业额', label: '营业额',
......
...@@ -22,39 +22,39 @@ const newRequest = new Request({ ...@@ -22,39 +22,39 @@ const newRequest = new Request({
errId_logout_value: '21' // 登出错误ID值 errId_logout_value: '21' // 登出错误ID值
}, },
// 事件配置 // 事件配置
events: { // events: {
// 请求发送前触发 // // 请求发送前触发
request: (requestData, config) => { // request: (requestData, config) => {
console.log('request事件触发', requestData, config); // console.log('request事件触发', requestData, config);
}, // },
// 收到响应时触发(无论成功或失败) // // 收到响应时触发(无论成功或失败)
response: (responseData, config) => { // response: (responseData, config) => {
console.log('response事件触发', responseData, config); // console.log('response事件触发', responseData, config);
}, // },
// 请求成功时触发(业务状态码为成功值) // // 请求成功时触发(业务状态码为成功值)
success: (data, config) => { // success: (data, config) => {
console.log('success事件触发', data, config); // console.log('success事件触发', data, config);
}, // },
// 请求失败时触发(业务状态码为失败值) // // 请求失败时触发(业务状态码为失败值)
error: (errorData, config) => { // error: (errorData, config) => {
console.log('error事件触发', errorData, config); // console.log('error事件触发', errorData, config);
}, // },
// 需要登出时触发(业务状态码为登出值) // // 需要登出时触发(业务状态码为登出值)
logout: (data, config) => { // logout: (data, config) => {
console.log('logout事件触发', data, config); // console.log('logout事件触发', data, config);
// 可以在这里处理登出逻辑 // // 可以在这里处理登出逻辑
}, // },
// 重复请求被阻止时触发 // // 重复请求被阻止时触发
duplicate: (duplicateData, config) => { // duplicate: (duplicateData, config) => {
console.log('duplicate事件触发', duplicateData, config); // console.log('duplicate事件触发', duplicateData, config);
// 可以在这里处理重复请求的逻辑,如显示提示信息 // // 可以在这里处理重复请求的逻辑,如显示提示信息
} // }
} // }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!