Commit 93a717f9 by 胡悦

feat(SecondHandCar): 更新二手车组件功能及样式

- 修改成交量字段为transactionCount并更新相关逻辑
- 优化排序组件样式和交互,使用图片替代箭头
- 修复日历组件重置逻辑,避免不必要的重置
- 更新请求配置,添加环境切换和错误处理
- 调整车辆列表图片加载逻辑,避免空数组报错
- 更新看板组件环比显示格式,添加正负号
- 添加页面最小高度设置
- 更新依赖包版本
1 parent 4ad47324
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.7", "@vant/weapp": "^1.10.7",
"dayjs": "^1.11.18", "dayjs": "^1.11.18",
"glsk-toolkit": "^1.0.4", "glsk-toolkit": "^1.0.5",
"glsx-applet-component": "^1.1.24", "glsx-applet-component": "^1.1.24",
"glsx-common-sdk": "^0.2.7" "glsx-common-sdk": "^0.2.7"
}, },
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<view class="first-row-title">{{item.name}}</view> <view class="first-row-title">{{item.name}}</view>
<view class="first-card-value"><view class="unit">¥</view>{{boardData[item.value] == null ? '-' : filter.money_three_for_two_thousands(boardData[item.value])}}</view> <view class="first-card-value"><view class="unit">¥</view>{{boardData[item.value] == null ? '-' : 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] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image> <glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</view> </view>
<view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : boardData[item.value]}}</view> <view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : 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] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image> <glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
</view> </view>
<view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : boardData[item.value]}}</view> <view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : 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] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image> <glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
</view> </view>
<view class="card-value">{{boardData[item.value] == null ? '-' : (item.unit ? boardData[item.value] + item.unit : boardData[item.value])}}</view> <view class="card-value">{{boardData[item.value] == null ? '-' : (item.unit ? boardData[item.value] + item.unit : 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] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image> <glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -12,7 +12,7 @@ Component({ ...@@ -12,7 +12,7 @@ Component({
// 可以从父组件传入的初始排序顺序 // 可以从父组件传入的初始排序顺序
defaultSortOrder: { defaultSortOrder: {
type: String, type: String,
value: 'asc' value: ''
} }
}, },
...@@ -21,7 +21,7 @@ Component({ ...@@ -21,7 +21,7 @@ Component({
*/ */
data: { data: {
sortField: '', // 当前排序字段:buyPrice(收车价) 或 sellPrice(卖出价) sortField: '', // 当前排序字段:buyPrice(收车价) 或 sellPrice(卖出价)
sortOrder: 'asc' // 排序顺序:asc(升序) 或 desc(降序) sortOrder: '' // 排序顺序:asc(升序) 或 desc(降序)
}, },
/** /**
...@@ -48,7 +48,6 @@ Component({ ...@@ -48,7 +48,6 @@ 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;
......
...@@ -29,8 +29,12 @@ ...@@ -29,8 +29,12 @@
.sort-arrows { .sort-arrows {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 30rpx; height: 32rpx;
width: 16rpx; width: 32rpx;
.icon {
width: 100%;
height: 100%;
}
.arrow-up { .arrow-up {
width: 0; width: 0;
......
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
<view class="sort-item {{sortField === 'buyPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="buyPrice"> <view class="sort-item {{sortField === 'buyPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="buyPrice">
<text>收车价</text> <text>收车价</text>
<view class="sort-arrows"> <view class="sort-arrows">
<view class="arrow-up {{sortField === 'buyPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view> <!-- <view class="arrow-up {{sortField === 'buyPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view>
<view class="arrow-down {{sortField === 'buyPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> <view class="arrow-down {{sortField === 'buyPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> -->
<glsx-image src="output/sort-{{ sortField === 'buyPrice' && sortOrder === 'desc' ? 'up' : sortField === 'buyPrice' && sortOrder === 'asc' ? 'down' : 'default'}}.png" class="icon" />
</view> </view>
</view> </view>
<view class="sort-item {{sortField === 'sellPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="sellPrice"> <view class="sort-item {{sortField === 'sellPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="sellPrice">
<text>卖出价</text> <text>卖出价</text>
<view class="sort-arrows"> <view class="sort-arrows">
<view class="arrow-up {{sortField === 'sellPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view> <!-- <view class="arrow-up {{sortField === 'sellPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view>
<view class="arrow-down {{sortField === 'sellPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> <view class="arrow-down {{sortField === 'sellPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> -->
<glsx-image src="output/sort-{{ sortField === 'sellPrice' && sortOrder === 'desc' ? 'up' : sortField === 'sellPrice' && sortOrder === 'asc' ? 'down' : 'default'}}.png" class="icon" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -131,11 +131,13 @@ Component({ ...@@ -131,11 +131,13 @@ Component({
title: '加载中', title: '加载中',
}) })
const result = await newApi.post('/minicarManage/findAllSoldPage', params); const result = await newApi.post('/minicarManage/findAllSoldPage', params);
result.records.forEach(item => { if (result.records.length) {
if (item.evalImageInfoList && item.evalImageInfoList.length) { result.records.forEach(item => {
item.img = item.evalImageInfoList.find(item => item.fileSubtype == 11)?.fileUrl if (item.evalImageInfoList && item.evalImageInfoList.length) {
} item.img = item.evalImageInfoList.find(item => item.fileSubtype == 11)?.fileUrl
}) }
})
}
let vehicleList let vehicleList
if (pageParams.pageNum == 1) { if (pageParams.pageNum == 1) {
vehicleList = result.records || [] vehicleList = result.records || []
......
...@@ -81,8 +81,8 @@ const third_cell = [ ...@@ -81,8 +81,8 @@ const third_cell = [
}, },
{ {
name: '成交量', name: '成交量',
value: 'acquisitionDeliveryCount', value: 'transactionCount',
rate: 'acquisitionDeliveryCountChainRatio', rate: 'transactionCountChainRatio',
type: 2 type: 2
}, },
{ {
......
...@@ -245,7 +245,13 @@ lifetimes: { ...@@ -245,7 +245,13 @@ lifetimes: {
show: true show: true
}) })
const calendar = this.selectComponent("#calendar") const calendar = this.selectComponent("#calendar")
calendar.reset() if (calendar && calendar.__data__ && calendar.__data__.currentDate) {
const _calendar = calendar.__data__.currentDate.map(item => dayjs(item).format('YYYY/MM/DD'))
const _value = date.split('-')
if (_value[0] != _calendar[0] || _value[1] != _calendar[1]) {
calendar.reset()
}
}
} else { } else {
this.setData({ this.setData({
dateShow: true dateShow: true
......
/* packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxss */ /* packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxss */
.vehicle-detail { .vehicle-detail {
min-height: 100vh;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
} }
......
...@@ -22,6 +22,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -22,6 +22,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
// newRequest里面是新接口也要修改
let index = 2 let index = 2
// 判断小程序环境 // 判断小程序环境
......
...@@ -2,8 +2,16 @@ import { Request } from 'glsk-toolkit'; ...@@ -2,8 +2,16 @@ import { Request } from 'glsk-toolkit';
import { domain } from './http.js' import { domain } from './http.js'
let { sessionId } = wx.$storage.get() let { sessionId } = wx.$storage.get()
console.log(sessionId, '=-====') console.log(sessionId, '=-====')
let target = 'test'
const requestObj = {
dev: 'http://gsc.dev.glsx.com.cn/gsc-vcp-miniapp-facade',
test: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
// preRelease: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
// prod: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
}
const newRequest = new Request({ const newRequest = new Request({
baseURL: 'http://gsc.dev.glsx.com.cn/gsc-vcp-miniapp-facade', baseURL: requestObj[target],
// baseURL: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
// baseURL: 'http://192.168.1.117:9898/gsc-vcp-miniapp-facade', // baseURL: 'http://192.168.1.117:9898/gsc-vcp-miniapp-facade',
// baseURL: 'http://192.168.1.114:9898/gsc-vcp-miniapp-facade', // baseURL: 'http://192.168.1.114:9898/gsc-vcp-miniapp-facade',
appId: 'Mini_StoreAssistant', appId: 'Mini_StoreAssistant',
...@@ -22,39 +30,40 @@ const newRequest = new Request({ ...@@ -22,39 +30,40 @@ 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);
// }, wx.$api.showToast(errorData.msg)
},
// // 需要登出时触发(业务状态码为登出值)
// logout: (data, config) => { // 需要登出时触发(业务状态码为登出值)
// console.log('logout事件触发', data, config); logout: (data, config) => {
// // 可以在这里处理登出逻辑 console.log('logout事件触发', data, config);
// }, // 可以在这里处理登出逻辑
},
// // 重复请求被阻止时触发
// duplicate: (duplicateData, config) => { // 重复请求被阻止时触发
// console.log('duplicate事件触发', duplicateData, config); 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!