Commit f7dda912 by 张立顺

Merge branch 'SAAS+V5.7.1' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into SAAS+V5.7.1
2 parents c4ea6a59 2134f9bd
......@@ -108,9 +108,9 @@
"root": "tabWorkOrder",
"name": "tabWorkOrder",
"pages": [
"pages/serviceCenter/pages/caseDetail/caseDetail",
"pages/serviceCenter/pages/companyNoticeDetail/companyNoticeDetail",
"pages/serviceCenter/pages/serviceNoticeList/serviceNoticeList",
"pages/serviceCenter/pages/caseDetail/caseDetail",
"pages/serviceCenter/pages/companyNoticeDetail/companyNoticeDetail",
"pages/serviceCenter/pages/serviceNoticeList/serviceNoticeList",
"pages/createOrder/createOrder",
"pages/additionRecordOrder/additionRecordOrder",
"pages/orderDetail/orderDetail",
......@@ -203,7 +203,7 @@
"pages/recruitManage/recruitInsert/recruitInsert",
"pages/recruitManage/recruitResult/recruitResult",
"pages/recruitManage/recruitManage/recruitManage",
"pages/salaryAppeal/salaryAppeal"
"pages/salaryAppeal/salaryAppeal"
]
},
{
......@@ -256,7 +256,8 @@
"pages/deliveryNote/deliveryDetail/deliveryDetail",
"pages/ocrUsedCarModules/ocrUsedCarModules",
"pages/indexPage/reportManage/reportList/reportList",
"pages/indexPage/reportManage/addReport/addReport"
"pages/indexPage/reportManage/addReport/addReport",
"pages/indexPage/vehicleList/vehicleList"
]
},
{
......@@ -298,17 +299,21 @@
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index",
"inventory-info":"components/InventoryInfo/InventoryInfo"
"van-switch": "@vant/weapp/switch/index",
"inventory-info": "components/InventoryInfo/InventoryInfo"
},
"preloadRule": {
"pages/tabWorkOrder/pages/index/index": {
"network": "all",
"packages": ["tabWorkOrder"]
"packages": [
"tabWorkOrder"
]
},
"tabIndex/pages/index/index": {
"network": "all",
"packages": ["tabWorkOrder"]
"packages": [
"tabWorkOrder"
]
}
},
"resolveAlias": {
......@@ -325,4 +330,4 @@
],
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
}
\ No newline at end of file
......@@ -353,5 +353,13 @@ module.exports = {
/** 校验是否有进入权限 */
checkPermissionsAPI(data) {
return newApi.post('/permissionAccess/checkVisitButton', data, {returnAll: true})
}
},
// 获取车况信息列表数据
getVehiclePage(data) {
return newApi.post('/carCondition/page', data, {returnAll: true})
},
// 获取车况信息列表统计数据
getVehicleStatistics(data) {
return newApi.post('/carCondition/getStatusCount', data, {returnAll: true})
}
};
......@@ -88,11 +88,11 @@ Component({
menuText: "检测管理",
icon: "crowdFunding/report"
}, {
menuText: "车况信息",
icon: "usedCar/vehicle-message",
checkReport: true,
getOpenId: true
}],
menuText: "车况信息",
icon: "usedCar/vehicle-message",
path: "vehicleList",
checkReport: true,
}],
current: 0,
itemDataList: [{
label: "二手车成交量",
......@@ -137,7 +137,7 @@ Component({
}
console.log('[report_webview] raw:', reportWebview, '=> final:', webviewUrl)
menuList = menuList.map(item =>
item.menuText === '检测管理' ? { ...item, webviewUrl } : item.menuText === '车况信息' ? { ...item, webviewUrl: `${vehicleWebView}/vehicle-list` } : item
item.menuText === '检测管理' ? { ...item, webviewUrl } : item
)
}
} catch (e) {
......@@ -202,58 +202,19 @@ Component({
const res = await newApi.checkPermissionsAPI({buttonCode: item.buttonCode})
wx.$util.hideLoading()
if (!res.data.data) return wx.$util.showToast('功能暂未开放')
}
if (item.checkReport) {
// 校验是否填写日报
wx.$util.showLoading()
let staffCheck = await checkDailyReport(7)
wx.$util.hideLoading()
if (staffCheck) return
}
if (item.webviewUrl) {
if (item.getOpenId) {
let openId = wx.$util.getOpenId()
let sessionId = wx.$util.getSessionId()
let userInfo = wx.$util.getUserInfo()
const queryObj = {
source: 2,
openId: openId,
sessionId: sessionId,
phone: userInfo.phone,
operator: userInfo.name,
operatorId: userInfo.uuid,
conversionUserId: userInfo.uuid,
conversionName: userInfo.name,
conversionMerchantId: userInfo.merchantId,
conversionMerchantName: userInfo.merchantName,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
};
const queryString = this.buildQuery(queryObj)
const finalPath = `${item.webviewUrl}?${queryString}`
return wx.requestSubscribeMessage({
tmplIds: ["MgjDgIpo1Xm8keYIUUtVbMbMj-Ms4q-xfbk7kM-L8EE"],
success(res) {
// wx.showToast({
// title: "订阅成功",
// icon: "none",
// });
return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(finalPath)}`,
})
},
fail(res) {
return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(finalPath)}`,
})
}
})
} else {
const targetUrl = `/pages/webView/h5FullNoShare?url=${encodeURIComponent(webviewUrl)}&openType=miniApp`
console.log('[navGo] webviewUrl:', webviewUrl, '=> navigateTo:', targetUrl)
wx.navigateTo({ url: targetUrl })
return
}
}
if (item.checkReport) {
// 校验是否填写日报
wx.$util.showLoading()
let staffCheck = await checkDailyReport(7)
wx.$util.hideLoading()
if (staffCheck) return
}
if (item.webviewUrl) {
const targetUrl = `/pages/webView/h5FullNoShare?url=${encodeURIComponent(webviewUrl)}&openType=miniApp`
console.log('[navGo] webviewUrl:', webviewUrl, '=> navigateTo:', targetUrl)
wx.navigateTo({ url: targetUrl })
return
}
if (!item.path) {
return wx.$util.showToast('功能暂不可用')
......
// packageUsedCar/pages/indexPage/vehicleList/vehicleList.js
const IMGURL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/'
import { getVehiclePage, getVehicleStatistics } from "~/packageUsedCar/api"
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
Page({
behaviors: [reportPageTrackMixin],
/**
* 页面的初始数据
*/
data: {
track_event_code: 'vehicleListBrowse',
IMGURL,
pageTitle: "车况信息",
navBarHeight: 0,
entryStatus: "",
currentPage: 1,
pageSize: 10,
typeList: [
{ text: "全部", count: 0, keyNum: "totalCount", key: "" },
{ text: "已录入", count: 0, keyNum: "submittedCount", key: '1' },
{ text: "待信息补全", count: 0, keyNum: "draftCount", key: '0' }
]
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() {
wx.$router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getConfigData()
},
async getConfigData() {
const { vehicle_webview } = await wx.$util.getMockData()
console.log(vehicle_webview)
this.setData({
usedcarWebviewUrl: vehicle_webview
})
},
tabClick(e) {
this.setData({
entryStatus: e?.detail || "",
pageNum: 1,
list: [],
nothing: false
},() => {
this.loadList()
this.loadStatistics()
})
},
loadStatistics() {
let { typeList } = this.data
let userInfo = wx.$util.getUserInfo()
getVehicleStatistics({operatorId: userInfo?.uuid, operator: userInfo?.name}).then(res => {
let { code, data, msg } = res?.data || {}
if (code == 0) {
typeList.forEach((item) => {
item.count = data[item.keyNum] || 0;
});
this.setData({
typeList,
});
} else {
wx.$util.showToast(msg)
}
})
},
listRefresh() {
this.setData({
currentPage: 1,
list: [],
nothing: false
},() => {
this.loadList()
this.loadStatistics()
})
},
loadMore() {
const { currentPage, pageSize, total } = this.data
if (Math.ceil(total / pageSize) > currentPage) {
this.setData({ currentPage: currentPage + 1 }, () => this.loadList())
} else {
this.setData({ nothing: true })
}
},
loadList() {
let { pageSize, currentPage, entryStatus, nothing } = this.data
let userInfo = wx.$util.getUserInfo()
if (nothing) return
wx.$util.showLoading("加载中")
let params = {
currentPage,
pageSize,
operatorId: userInfo?.uuid,
operator: userInfo?.name,
entryStatus
}
getVehiclePage(params).then(res => {
wx.$util.hideLoading()
let { code, data, msg } = res?.data || {}
if (code == 0) {
const list = data?.records || []
const total = data?.total || 0
this.setData({
list: this.data.currentPage === 1 ? list : this.data.list.concat(list),
total,
listTrigger: false
})
if (Math.ceil(total / pageSize) <= currentPage) {
this.setData({ nothing: true })
} else {
this.setData({ nothing: false })
}
} else {
wx.$util.showToast(msg)
}
}).catch(() => {
wx.$util.hideLoading()
})
},
buildQuery(params) {
if (!params) return ''
return Object.keys(params)
.map(key => {
return `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`;
})
.join('&')
},
async addVehicle(e) {
let openId = wx.$util.getOpenId()
let sessionId = wx.$util.getSessionId()
let userInfo = wx.$util.getUserInfo()
const { item } = e.currentTarget.dataset || {}
let { usedcarWebviewUrl } = this.data
const queryObj = {
source: 2,
openId: openId,
sessionId: sessionId,
phone: userInfo.phone,
operator: userInfo.name,
operatorId: userInfo.uuid,
conversionUserId: userInfo.uuid,
conversionName: userInfo.name,
conversionMerchantId: userInfo.merchantId,
conversionMerchantName: userInfo.merchantName,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
};
if (item && item?.id) {
queryObj.id = item.id;
queryObj.mode = item.entryStatus ? 'view' : 'create';
}
const queryString = this.buildQuery(queryObj)
const finalPath = `${usedcarWebviewUrl}/vehicle-detail?${queryString}`
wx.$track.setTrackData(0, `${item ? 'addVehicle' : 'editVehicle'}`, '')
if (item?.entryStatus) {
return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(finalPath)}`,
})
} else {
wx.requestSubscribeMessage({
tmplIds: ["MgjDgIpo1Xm8keYIUUtVbMbMj-Ms4q-xfbk7kM-L8EE"],
success(res) {
// wx.showToast({
// title: "订阅成功",
// icon: "none",
// });
return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(finalPath)}`,
})
},
fail(res) {
return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(finalPath)}`,
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.onPageShow()
this.setData({
currentPage: 1,
list: [],
nothing: false
},() => {
this.loadList()
this.loadStatistics()
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
this.onPageHide()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.onPageHide()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"tab-bar": "/packageUsedCar/components/TabBar/TabBar"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packageUsedCar/pages/indexPage/vehicleList/vehicleList.wxss */
.vehicle-list {
height: 100vh;
}
.content {
height: 100%;
box-sizing: border-box;
padding-bottom: var(--constantSafeAreaInsetBottom);
padding-bottom: var(--envSafeAreaInsetBottom);
}
.bg {
width: 100%;
height: var(--fontSize800);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/evaluationForm-bg.png');
background-size: 100% 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.list-content {
height: calc(100% - 196rpx);
.item {
display: flex;
align-items: center;
margin: 0 24rpx 28rpx;
padding: 24rpx;
background: #fff;
border-radius: 24rpx;
box-shadow: 0 6rpx 16rpx 0 #8192d633;
}
.left .avatar {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
background: #EEF3FF;
margin-right: 16rpx;
}
.right {
flex: 1;
min-width: 0;
}
.row {
display: flex;
gap: 8px;
align-items: center;
min-width: 0;
.left-title {
display: flex;
flex: 1;
align-items: center;
min-width: 0;
color: #1B233D;
font-size: 30rpx;
font-weight: 500;
.name {
flex: 0 0 auto;
min-width: 0;
max-width: 60%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.plate {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.status {
flex-shrink: 0;
padding: 2px 8px;
font-size: 12px;
font-weight: 500;
line-height: 18px;
border-radius: 2px;
}
.status.green {
background: #E9FFF1;
color: #22C55E;
}
.status.orange {
background: #FFF4E5;
color: #F59E0B;
}
}
.sub {
margin-top: 8rpx;
color: #9299AD;
font-size: 26rpx;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 70%;
color: #999999;
font-size: 26rpx;
}
.empty .icon {
width: 160rpx;
height: 160rpx;
margin-bottom: 16rpx;
}
.end-text {
width: 100%;
text-align: center;
padding: 24rpx 0 36rpx;
color: #999999;
font-size: 24rpx;
}
}
.fixed-add {
position: absolute;
left: 96rpx;
right: 96rpx;
bottom: var(--constantSafeAreaInsetBottom);
bottom: var(--envSafeAreaInsetBottom);
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
border-radius: 16rpx;
background: linear-gradient(-60.8deg, #556af5 0%, #7197ff 100%);
}
\ No newline at end of file
<!--packageUsedCar/pages/indexPage/vehicleList/vehicleList.wxml-->
<view class="vehicle-list">
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back">
<view class="title-text">{{pageTitle}}</view>
</navigation-bar>
<view class="bg"></view>
<view class="content" style="padding-top: {{navBarHeight}}px;">
<view style="position: relative;">
<tab-bar tabList="{{ typeList }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" />
</view>
<scroll-view class="list-content" scroll-y="true" scroll-top="{{scrollTop}}" lower-threshold="60" refresher-enabled refresher-triggered="{{listTrigger}}" bindrefresherrefresh="listRefresh" bindscrolltolower="loadMore">
<block wx:if="{{list.length}}">
<view style="width: 100%;height: 28rpx;"></view>
<view class="item" wx:for="{{list}}" wx:key="id" bind:tap="addVehicle" data-item="{{item}}">
<view class="left">
<image class="avatar" src="{{IMGURL}}store-assistant/vehicle_status_icon.png"></image>
</view>
<view class="right">
<view class="row">
<view class="left-title">
<view class="name">{{ item.ownerName || '-' }}</view>
<view wx:if="{{item.licensePlate}}" class="sep">/</view>
<view wx:if="{{item.licensePlate}}" class="plate">{{ item.licensePlate }}</view>
</view>
<view class="status {{item.entryStatus ? 'green' : 'orange'}}">{{item.entryStatus ? '已录入' : '信息待补全'}}</view>
</view>
<view class="sub">录入时间:{{item.entryTime}}</view>
</view>
</view>
</block>
<block wx:if="{{!list.length && !loading}}">
<view class="empty">
<image class="icon" src="{{IMGURL}}store-assistant/empty_data.png"></image>
暂无数据
</view>
</block>
<view class="end-text" wx:if="{{nothing && list.length}}">~到底了</view>
</scroll-view>
<view class="fixed-add" bindtap="addVehicle" style="bottom: {{bottomPx}}px;">新增车况</view>
</view>
</view>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!