Commit 77eec04e by cen

feat: 新增车型组件,地区组件

1 parent 5cd7c165
......@@ -345,5 +345,14 @@ module.exports = {
projectName: 'boutique',
...data
})
},
/** 退款中拦截 */
refundApplyRecordIsExist(data) {
return http.post({
method: 'dj.api.smartcarlife.refundApplyRecord.isExist',
projectName: 'boutique',
...data
})
}
}
import http from '../request/http'
module.exports = {
/** 车型 */
carBandList(data) {
return http.post({
method: 'glsx.accounts.base.car.brand.complete',
projectName: 'evaluation',
...data
})
}
}
No preview for this file type
......@@ -135,6 +135,9 @@
.ml-48 {
margin-left: toRpx(48);
}
.mt-8 {
margin-top: toRpx(8);
}
.mt-12 {
margin-top: toRpx(12);
}
......@@ -162,6 +165,9 @@
.mb-30 {
margin-bottom: toRpx(30);
}
.mb-40 {
margin-bottom: toRpx(40);
}
.mb-48 {
margin-bottom: toRpx(48);
}
......

2.74 MB | W: | H:

2.75 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view class="employee-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey]}]"
>
<view :key="index" @click="choose(i)" :class="['item flex', { active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey] }]">
<view class="sprite-icon icon-tag-checked"></view>
{{i.staffName}}
{{ i.staffName }}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
......@@ -27,10 +23,12 @@ export default {
},
methods: {
async getList (searchValue, search) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (!search && cacheData && cacheData.length) {
console.log('getList', params,data)
this.initData(cacheData)
return
}
......@@ -51,6 +49,7 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
console.log('choose', i)
let { params: { idKey }, data } = this,
value = {
userId: data.deliveryUserId,
......@@ -68,7 +67,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.employee-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
......@@ -99,4 +98,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -104,7 +104,8 @@ module.exports = {
status: {
12: {
text: '已退款',
color: '#8F959E'
color: '#F7A431',
background: '#FFF5E6'
},
11: {
text: '已失效',
......
......@@ -240,6 +240,23 @@
</view>
</template>
</PublishPopup>
<PublishPopup ref="IsExistTipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false">
<template #content>
<view>
<image class="tipsPopupBg" :src="bg" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>订单已发起退款,禁止撤销!</view>
<view>如需撤销请联系总部运营。</view>
</view>
</view>
</template>
<template #footer>
<view class="isExistTips-btn-box">
<view class="sure-btn btn flex-1" @click="closeIsExistTipsPopup">好的</view>
</view>
</template>
</PublishPopup>
<PublishPopup :key="popupKey" ref="warrantyPopup" popupClass="warrantyPopup" type="center" title="质保价格" :showClose="true" @confirm="confirmEdit">
<template #content>
<view class="warranty-content">
......@@ -592,26 +609,40 @@ export default {
},
// 撤销该工单
async repeal() {
this.$refs.tipsPopup
.open()
.then(() => {
let _this = this
uni.$api.boutiqueApi
.revokeOrder({
orderCode: this.transmissionOfData.orderCode
})
.then(data => {
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.getDetail(this.transmissionOfData.orderCode)
})
const that = this
uni.$api.boutiqueApi
.refundApplyRecordIsExist({
orderCode: this.transmissionOfData.orderCode
})
.catch(() => {
console.log('用户点击了取消或关闭')
.then(data => {
console.log(data)
if (data === 'Y') {
that.$refs.IsExistTipsPopup.open()
} else {
that.$refs.tipsPopup
.open()
.then(() => {
uni.$api.boutiqueApi
.revokeOrder({
orderCode: that.transmissionOfData.orderCode
})
.then(data => {
uni.showToast({
title: '操作成功',
icon: 'success'
})
that.getDetail(that.transmissionOfData.orderCode)
})
})
.catch(() => {
console.log('用户点击了取消或关闭')
})
}
})
},
closeIsExistTipsPopup() {
this.$refs.IsExistTipsPopup.closePopup()
},
customizeDate() {
console.log(this.$refs.calendarPopup, 'this.$refs.calendarPopup')
this.$refs.calendarPopup.open()
......@@ -705,6 +736,30 @@ export default {
color: #347bff;
}
}
.isExistTips-btn-box {
display: flex;
justify-content: center;
position: absolute;
border-radius: 0 0 toRpx(42) toRpx(42);
bottom: toRpx(40);
width: 100%;
.btn {
height: toRpx(80);
border-radius: toRpx(48);
opacity: 1;
line-height: toRpx(80);
text-align: center;
color: rgba(26, 26, 26, 0.6);
font-size: toRpx(32);
font-weight: 500;
margin: auto toRpx(64);
}
.sure-btn {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
}
}
::v-deep .warrantyPopup .uni-popup__wrapper {
width: 36%;
......
......@@ -114,6 +114,13 @@ export default {
}
</script>
<style scoped lang="scss">
::v-deep .customPopup .uni-popup__wrapper.bottom {
overflow: hidden;
border-radius: toRpx(32) toRpx(32) 0 0;
.popup-top-box {
padding: toRpx(32) toRpx(48);
}
}
::v-deep .customPopup .center {
width: toRpx(848);
border-radius: toRpx(36);
......@@ -127,6 +134,7 @@ export default {
.footer-box {
width: calc(100% - #{toRpx(128)});
left: toRpx(64);
border-radius: 0 0 toRpx(42) toRpx(42);
}
}
.popup-top-box {
......@@ -135,9 +143,10 @@ export default {
font-weight: 500;
text-align: center;
padding: toRpx(48) toRpx(64);
background-color: #fff;
.popup-top-box-title {
flex: 1;
text-align: left;
text-align: center;
}
.icon-close {
text-align: end;
......@@ -160,10 +169,8 @@ export default {
.footer-box {
width: 100%;
height: toRpx(164);
// background-color: #fff;
position: absolute;
border-radius: 0 0 toRpx(42) toRpx(42);
bottom: 0;
background-color: #fff;
.btn {
flex: 1;
height: toRpx(80);
......
<template>
<GeneralPopup ref="carPopup" popupClass="carPopup" :list="list" :title="title">
<template v-slot:content>
<StepTab :steps="steps" :currentStep="currentStep" :clickable="true" @step-change="onStepChange" :isShowStepNumber="false"></StepTab>
<SortByNameList :items="currentStepData" :activeValue="currentSelectedId" :activeField="'id'" :itemNameField="'name'" :groupKeyField="'letter'" :itemsPerRow="3" :itemSpacing="32" @item-click="handleItemClick" />
</template>
</GeneralPopup>
</template>
<script>
import GeneralPopup from './GeneralPopup.vue'
import SortByNameList from './SortByNameList.vue'
import StepTab from './StepTab.vue'
import { sign, md532, md516 } from 'utils/common'
export default {
name: 'SelectCar',
components: {
GeneralPopup,
SortByNameList,
StepTab
},
props: {
title: {
type: String,
default: '选择车型'
},
list: {
type: Array,
default: () => []
}
},
data() {
return {
currentStep: 0,
currentSelectedId: null,
steps: [
{ label: '品牌选择', number: 1 },
{ label: '系列选择', number: 2 },
{ label: '车型选择', number: 3 },
{ label: '年份选择', number: 4 }
],
carBrandData: [],
selectedBrand: null,
selectedSeries: null,
selectedModel: null,
selectedYear: null
}
},
created() {
this.loadCarData()
},
computed: {
currentStepData() {
let data = []
switch (this.currentStep) {
case 0:
data = this.carBrandData
break
case 1:
data = this.selectedBrand?.childs || []
break
case 2:
data = this.selectedSeries?.childs || []
break
case 3:
data = this.selectedModel?.childs || []
break
default:
data = []
}
console.log(`Step ${this.currentStep} data:`, data.length, 'items')
return data
}
},
methods: {
loadCarData() {
const params = {
username: 'test',
timestamp: '1234567890',
nonce: 'abcdefg'
}
const secret = 'your_secret_key'
const signature = sign(params, secret)
console.log('签名结果:', signature)
// uni.$api.evaluationApi
// .carBandList({
// content: element.cardCode
// })
// .then(data => {})
// 使用Promise模拟API请求
new Promise((resolve, reject) => {
try {
const jsonData = require('./carData.json')
resolve(jsonData)
} catch (error) {
console.error('Failed to load carData.json:', error)
reject(error)
}
})
.then(result => {
console.log('Loaded car data successfully')
if (result && result.code === '0' && result.data && result.data.carinfos) {
const carDataWithYears = this.addMockYearsToModels(result.data.carinfos)
this.carBrandData = carDataWithYears
} else {
console.error('Invalid car data format:', result)
}
})
.catch(error => {
console.error('Error loading car data:', error)
this.carBrandData = this.getDefaultCarData()
})
},
addMockYearsToModels(carinfos) {
const carinfosCopy = JSON.parse(JSON.stringify(carinfos))
const addYearsToModelsRecursive = items => {
if (!Array.isArray(items)) return items
return items.map(item => {
if (!item.childs || !Array.isArray(item.childs) || item.childs.length === 0) {
const yearsCount = Math.floor(Math.random() * 2) + 2
const currentYear = new Date().getFullYear()
item.childs = []
for (let i = 0; i < yearsCount; i++) {
const year = currentYear - i
item.childs.push({
letter: String(year).charAt(0),
name: `${year}款`,
id: item.id * 1000 + i + 1
})
}
} else {
item.childs = addYearsToModelsRecursive(item.childs)
}
return item
})
}
return addYearsToModelsRecursive(carinfosCopy)
},
// 默认的备用数据,当JSON加载失败时使用
getDefaultCarData() {
return [
{
letter: '2',
name: '212',
id: 3256,
childs: [
{
letter: 'B',
name: '北京汽车制造厂',
id: 3257,
childs: [
{
letter: 'J',
name: '狙击手',
id: 1150349,
childs: [
{ letter: '2', name: '2023款', id: 1001 },
{ letter: '2', name: '2022款', id: 1002 },
{ letter: '2', name: '2021款', id: 1003 }
]
}
]
}
],
logoUrl: 'https://qcwx.glsx.com.cn/upload/carbrand/2e1210f1-32d4-4e82-abf3-c38e9754b12c.png'
}
]
},
open() {
console.log('Opening car selector popup')
this.$refs.carPopup.open()
},
onStepChange(index) {
console.log(`Changing step from ${this.currentStep} to ${index}`)
// 限制只能前进到已选择的下一级
if (index === 0) {
this.currentStep = 0
} else if (index === 1 && this.selectedBrand) {
this.currentStep = 1
} else if (index === 2 && this.selectedSeries) {
this.currentStep = 2
} else if (index === 3 && this.selectedModel) {
this.currentStep = 3
}
// 重置当前步骤的选中ID
this.currentSelectedId = null
},
// 处理项目点击事件
handleItemClick(item) {
console.log('Item clicked:', item)
this.currentSelectedId = item.id
if (this.currentStep === 0) {
this.selectedBrand = item
this.selectedSeries = null
this.selectedModel = null
this.selectedYear = null
this.currentStep = 1
this.$emit('brand-selected', item)
} else if (this.currentStep === 1) {
this.selectedSeries = item
this.selectedModel = null
this.selectedYear = null
this.currentStep = 2
this.$emit('series-selected', item)
} else if (this.currentStep === 2) {
this.selectedModel = item
this.selectedYear = null
if (item.childs && item.childs.length > 0) {
this.currentStep = 3
}
this.$emit('model-selected', item)
} else if (this.currentStep === 3) {
this.selectedYear = item
const selectionResult = {
brand: this.selectedBrand,
series: this.selectedSeries,
model: this.selectedModel,
year: this.selectedYear
}
this.$emit('car-selected', selectionResult)
// 可选:关闭弹窗
// this.$refs.carPopup.close();
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .carPopup {
.content {
width: 100%;
height: toRpx(764);
background-color: #fff;
box-sizing: border-box;
overflow: hidden;
}
}
</style>
<template>
<view class="container-list">
<view v-if="groupedItems && Object.keys(groupedItems).length > 0">
<view v-for="(groupItems, groupKey) in groupedItems" :key="groupKey">
<view class="group-header">
<text class="group-label">{{ groupKey }}</text>
</view>
<view class="items-box">
<view v-for="item in groupItems" :key="getItemKey(item)" v-if="item[itemNameField]" :class="['item', { active: isActiveItem(item) }]" @tap="onItemClick(item)">
{{ item[itemNameField] }}
</view>
</view>
</view>
</view>
<view v-else-if="items && items.length === 0" class="empty-state">
<text>暂无数据</text>
</view>
<view v-else class="loading-state">
<text>加载中...</text>
</view>
</view>
</template>
<script>
export default {
name: 'SortByNameList',
props: {
items: {
type: Array,
default: () => []
},
activeValue: {
type: [String, Number],
default: ''
},
activeField: {
type: String,
default: 'id'
},
clickable: {
type: Boolean,
default: true
},
itemsPerRow: {
type: Number,
default: 3
},
itemSpacing: {
type: Number,
default: 32
},
itemKeyField: {
type: String,
default: 'id'
},
itemNameField: {
type: String,
default: 'name'
},
groupKeyField: {
type: String,
default: 'letter'
}
},
computed: {
groupedItems() {
if (!this.items || this.items.length === 0) {
console.log('No items provided to SortByNameList')
return {}
}
console.log('Items received:', this.items)
console.log('Using groupKeyField:', this.groupKeyField)
const groups = {}
this.items.forEach(item => {
const groupKey = item[this.groupKeyField] || '#'
const key = String(groupKey).toUpperCase()
if (!groups[key]) {
groups[key] = []
}
groups[key].push(item)
})
const sortedGroups = {}
Object.keys(groups)
.sort()
.forEach(key => {
sortedGroups[key] = groups[key]
})
return sortedGroups
}
},
methods: {
onItemClick(item) {
if (this.clickable) {
this.$emit('item-click', item)
}
},
getItemKey(item) {
return item[this.itemKeyField] || item[this.itemNameField]
},
isActiveItem(item) {
return item[this.activeField] === this.activeValue
}
}
}
</script>
<style scoped lang="scss">
.container-list {
background-color: #ffffff;
height: 100%;
overflow-y: auto;
.group-header {
display: flex;
align-items: center;
padding: toRpx(0) toRpx(48);
background-color: #f5f7fa;
height: toRpx(40);
.group-label {
font-size: toRpx(28);
font-weight: 400;
color: #888;
}
}
.items-box {
display: flex;
flex-wrap: wrap;
padding: toRpx(16) toRpx(48);
box-sizing: border-box;
margin: 0 -toRpx(16);
border-bottom: toRpx(1) solid #f0f2f5;
}
.item {
width: calc(33.333% - #{toRpx(32)});
margin: toRpx(16);
padding: toRpx(12) toRpx(24);
color: #333333;
font-size: toRpx(32);
font-weight: 400;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
text-align: center;
box-sizing: border-box;
&:active {
background-color: #f5f7fa;
}
&.active {
background: #dee7ff;
color: #347bff;
}
}
.empty-state {
padding: toRpx(60) toRpx(48);
text-align: center;
color: #999;
font-size: toRpx(32);
}
.loading-state {
padding: toRpx(60) toRpx(48);
text-align: center;
color: #666;
font-size: toRpx(32);
}
}
</style>
<template>
<view class="step-tab flex items-center justify-center">
<view v-for="(step, index) in steps" :key="step.key || index" class="flex">
<view v-if="index > 0" :class="['step-line', { active: index == currentStep }]"></view>
<view class="step-item" @click="handleStepClick(index)">
<view :class="['step-label', { active: index == currentStep }]">
{{ step.label || '步骤' + (index + 1) }}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'StepTab',
props: {
steps: {
type: Array,
default: () => [{ label: '步骤1' }, { label: '步骤2' }, { label: '步骤3' }]
},
currentStep: {
type: Number,
default: 0
},
clickable: {
type: Boolean,
default: true
},
isShowStepNumber: {
type: Boolean,
default: true
}
},
methods: {
handleStepClick(index) {
if (this.clickable) {
this.$emit('step-change', index)
}
}
}
}
</script>
<style scoped lang="scss">
.step-tab {
width: 100%;
padding: toRpx(20) 0;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
overflow-x: auto;
position: relative;
}
.step-item {
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: toRpx(12) toRpx(32);
border-radius: toRpx(12);
background: #f2f2f2;
z-index: 1;
transition: all 0.3s ease;
.step-label.active + & {
background: #dee7ff;
}
.step-label {
font-size: toRpx(28);
color: #666;
text-align: center;
transition: all 0.3s ease;
&.active {
color: #347bff;
font-size: toRpx(28);
font-weight: 400;
}
}
&:before {
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 0;
}
}
.step-line {
height: toRpx(4);
width: toRpx(40);
background-color: #e6e6e6;
margin: 0 toRpx(40);
z-index: 1;
transition: all 0.3s ease;
align-self: center;
}
</style>
......@@ -2,12 +2,10 @@
<view class="type-tab">
<view class="type-box">
<view class="tab-item" :class="[tabClass(index)]" v-for="(i, index) in typeList" :key="index" @click="tabClick(index)">
<view
:class="['sprite-icon', tabClass(index)]"
:style="{
left: blockLeft
}"
></view>
<view v-if="tabIndex == index && index == 0" class="sprite-icon tab-first-left icon-first-left"></view>
<view v-if="tabIndex == index && index == 0" class="sprite-icon tab-first-right icon-first-right"></view>
<view v-if="tabIndex == index && index != 0" class="sprite-icon tab-second-right icon-second-right"></view>
<view v-if="tabIndex == index && index != 0" class="sprite-icon tab-second-left icon-second-left"></view>
<view class="text flex justify-center align-center" :class="[tabIndex == index ? `active` : '']">
<view>{{ i[nameKey] }}</view>
<view v-if="isShowCount" class="count ml-8">{{ i.count }}</view>
......@@ -52,7 +50,7 @@ export default {
tabClass (index) {
let className = ''
if (this.tabIndex == index) {
className = 'active tab-'
className = 'active '
if (index == 0) className += 'first-nav'
else className += 'second-nav'
}
......@@ -84,27 +82,38 @@ export default {
font-weight: 400;
font-size: toRpx(32);
color: #1f2133;
position: relative;
.text {
position: relative;
text-align: center;
height: toRpx(80);
height: toRpx(96);
padding: 0 toRpx(64);
.count {
font-size: toRpx(24);
}
}
.text.active {
position: relative;
}
.text.active::before {
content: '';
position: absolute;
top: 0;
left: toRpx(64);
right: toRpx(64);
height: 100%;
background-color: #fff;
z-index: -1;
}
.active {
position: relative;
font-weight: 700;
font-size: toRpx(32);
color: #2c66f7;
&::after {
content: '';
position: absolute;
bottom: 0;
bottom: toRpx(16);
left: 50%;
transform: translateX(-50%);
width: toRpx(48);
......@@ -116,6 +125,22 @@ export default {
.sprite-icon {
transition: left 0.15s;
}
.tab-first-left {
left: - toRpx(64);
position: absolute;
}
.tab-first-right {
right: - toRpx(64);
position: absolute;
}
.tab-second-right {
right: - toRpx(64);
position: absolute;
}
.tab-second-left {
left: - toRpx(64);
position: absolute;
}
}
.tab-first-nav {
background: url('@/assets/spritesmith/first-nav.png') no-repeat;
......
This diff could not be displayed because it is too large.
......@@ -89,6 +89,13 @@ export default {
padding: toRpx(24) toRpx(40);
background: #ffffff;
box-shadow: 0 toRpx(6) toRpx(24) 0 #2a61eb1a;
margin: 0 toRpx(50);
&:first-child {
margin-top: toRpx(40);
}
&:last-child {
margin-bottom: toRpx(40);
}
.status-box {
.label {
......
<template>
<view class="search-box">
<view class="search-box mt-8 ml-8">
<view class="form">
<template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index">
......
......@@ -10,10 +10,10 @@
<searchBox />
<view class="box-class mt-32">
<type-tab-component :typeList="typeList" :isShowCount="true" :tabIndex.sync="tabIndex"></type-tab-component>
<z-paging ref="paging" :fixed="false" paging-class="paging-class px-50" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
<EvaluationCard @button-click="handleButtonClick" v-for="(item, index) in dataList" :key="index" :carInfo="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()" :class="{ 'mb-20': index < dataList.length - 1 }"></EvaluationCard>
<z-paging ref="paging" :fixed="false" paging-class="paging-class " :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
<EvaluationCard @button-click="handleButtonClick" v-for="(item, index) in dataList" :key="index" :carInfo="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()" :class="{ 'mb-40': index < dataList.length - 1 }"></EvaluationCard>
</z-paging>
<view class="mask-box flex flex-col justify-center align-center">
<view class="mask-box flex flex-col justify-center align-center" v-if="dataList.length == 0">
<image src="@/assets/images/evaluationForm/noData.png" />
<view>暂无客户工单</view>
</view>
......@@ -191,8 +191,7 @@ export default {
border-radius: toRpx(48);
overflow: hidden;
.paging-class {
padding-top: toRpx(40);
background-color: #fff;
height: calc(100% - #{toRpx(96)});
box-sizing: border-box;
}
......
export * from './constants'
export * from './signature'
import md5 from '../../lib/md5.js'
/**
* 生成签名,与Java的sign方法对应
* @param {Object} paramValues - 参数对象
* @param {string} secret - 密钥
* @returns {string} 32位MD5签名
*/
export function sign(paramValues, secret) {
const sb = []
const paramNames = Object.keys(paramValues)
// 对参数名进行排序
paramNames.sort()
// 构建签名字符串:secret + paramName1 + paramValue1 + paramName2 + paramValue2 + ... + secret
sb.push(secret)
for (const paramName of paramNames) {
sb.push(paramName)
sb.push(paramValues[paramName])
}
sb.push(secret)
// 生成32位MD5签名
return md5(sb.join(''))
}
/**
* 生成16位MD5签名
* @param {string} str - 要签名的字符串
* @returns {string} 16位MD5签名
*/
export function md516(str) {
return md5(str).substring(8, 24)
}
/**
* 生成32位MD5签名
* @param {string} str - 要签名的字符串
* @returns {string} 32位MD5签名
*/
export function md532(str) {
return md5(str)
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!