Commit eff0b547 by 张立顺

Merge branch 'SAAS+V4.49' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.49

2 parents c0f41a0f 9bdd3e5d
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-19 11:02:01
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-08 15:20:30
* @LastEditTime: 2025-01-13 11:09:59
* @FilePath: \gl-tape\api\module\point.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -59,5 +59,86 @@ module.exports = {
projectName: 'boutique',
...data
})
},
badgeList(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.month.badge.list',
projectName: 'boutique',
...data
})
},
incomeMeasurementConfig(data) {
return http.post({
method: 'dj.smartcarlife.api.incomeMeasurement.switch.config.search',
projectName: 'boutique',
...data
})
},
/**员工收入测算获取员工信息 */
incomeCalculation(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.staffInfo',
projectName: 'boutique',
...data
})
},
/**获取员工绩效测算详情 */
incomeCalculationDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.detail',
projectName: 'boutique',
...data
})
},
/**分页查询员工月度工资统计列表 */
pageStat(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.monthSalary.pageStat',
projectName: 'boutique',
...data
})
},
/**获取员工(测算/历史)月度工资明细 */
monthSalaryDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.monthSalary.detail',
projectName: 'boutique',
...data
})
},
/**获取试算门店工资绩效配置详细 */
getLatestConfigDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.getLatestConfigDetail',
projectName: 'boutique',
...data
})
},
/**员工工资试算*/
monthSalaryCalculation(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.monthSalaryCalculation',
projectName: 'boutique',
...data
})
},
/**员工考勤日历 */
calendarDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.clock.in.staff.calendar',
projectName: 'boutique',
...data
})
},
/**查询员工提示信息 */
getTipsMessage(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.tipsMessage.list',
projectName: 'boutique',
...data
})
}
}
......@@ -2,10 +2,10 @@ import http from '../request/http'
import { env } from '../../env'
const serverConfig = {
mockRequestCount: null,
mockTimer: {},
mockCache: null
},
mockRequestCount: null,
mockTimer: {},
mockCache: null
},
bydServerConfig = {
mockRequestCount: null,
mockTimer: {},
......@@ -60,29 +60,49 @@ const getMockData = async (immediate = false) => {
return Promise.reject(error)
}
}
const imgToBase64 = (list, urlKey) => {
const imgToBase64 = (list, urlKey, isArray = true) => {
return new Promise((resolve, reject) => {
let arr = [],
newList = JSON.parse(JSON.stringify(list))
list.map((e, index) => {
if (!e[urlKey]) return resolve(list)
if (!e[urlKey].startsWith('https')) return resolve(list)
uni.request({
url: urlKey ? e[urlKey] : e,
method: 'GET',
responseType: 'arraybuffer',
success: res => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey]
arr.push(e)
if (arr.length === list.length) resolve(newList)
},
fail: err => {
reject(err)
}
if (isArray) {
list.map((e, index) => {
if (!e[urlKey]) return resolve(list)
if (!e[urlKey].startsWith('https')) return resolve(list)
uni.request({
url: urlKey ? e[urlKey] : e,
method: 'GET',
responseType: 'arraybuffer',
success: res => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey]
arr.push(e)
if (arr.length === list.length) resolve(newList)
},
fail: err => {
reject(err)
}
})
})
})
} else {
Object.keys(list).map(key => {
if (!list[key].startsWith('https')) return resolve(list)
uni.request({
url: list[key],
method: 'GET',
responseType: 'arraybuffer',
success: res => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
newList[key] = base64
arr.push(key)
if (arr.length === Object.keys(list).length) resolve(newList)
},
fail: err => {
reject(err)
}
})
})
}
})
}
const updateMockData = (dataList, keyList, storageName = 'mock_data') => {
......
No preview for this file type

7.47 MB | W: | H:

7.85 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin

28.9 KB | W: | H:

30.6 KB | W: | H:

assets/spritesmith/point-active.png
assets/spritesmith/point-active.png
assets/spritesmith/point-active.png
assets/spritesmith/point-active.png
  • 2-up
  • Swipe
  • Onion skin

6.17 KB | W: | H:

6.84 KB | W: | H:

assets/spritesmith/point.png
assets/spritesmith/point.png
assets/spritesmith/point.png
assets/spritesmith/point.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -20,8 +20,8 @@
<view class="calendar-date" v-for="(date, index) in dates" :key="index">
<template v-if="date">
<view class="date-num">{{ date }}</view>
<!-- <view class="date-desc">出勤</view> -->
<view class="date-desc date-card">未打卡</view>
<view class="date-desc" v-if="isClock(date) == 2">出勤</view>
<view class="date-desc date-card" v-if="isClock(date) == 1">未打卡</view>
</template>
</view>
</view>
......@@ -31,7 +31,9 @@
</template>
<script>
import point from '@/mixin/point'
export default {
mixins: [point],
name: 'calendar',
props: {
// 是否显示周标题
......@@ -49,6 +51,7 @@ export default {
// 当前所处日期 年月日
nowDate: '7',
datesd: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
clockInDateList: [],
// 当前所处年
year: new Date().getFullYear(),
// 当前所处月
......@@ -60,7 +63,6 @@ export default {
computed: {
dates() {
const firstDayOfMonth = new Date(this.year, this.month - 1, 1)
const lastDayOfMonth = new Date(this.year, this.month, 0)
const dates = []
for (let i = 0, len = this.datesd.length; i < len; i++) {
dates.push(this.datesd[i])
......@@ -79,63 +81,19 @@ export default {
return dates
}
},
watch: {
// month: {
// handler() {
// // 日期格式化获取当前月份
// const todayMonth = uni.$jy.formatDate(new Date(), 'M')
// // 日期格式化获取当前年
// const y = uni.$jy.formatDate(new Date(), 'YYYY')
// if (Number(todayMonth) == 12) {
// if (this.year > Number(y)) {
// this.showNextMonth = false
// return
// }
// }
// if (Number(y) < this.year) {
// this.showNextMonth = true
// return
// }
// if (Number(y) == this.year) {
// if (this.month < Number(todayMonth)) {
// this.showNextMonth = true
// return
// }
// let a = Math.abs(this.month - Number(todayMonth))
// if (a == 1) {
// this.showNextMonth = false
// return
// }
// }
// this.showNextMonth = true
// return
// }
// }
},
methods: {
/* 上个月 */
prevMonth() {
if (this.month === 1) {
this.year -= 1
this.month = 12
} else {
this.month -= 1
isClock(day) {
if (this.day < day) {
return
}
let callMonth = this.month >= 10 ? String(this.month) : '0' + String(this.month)
let callBackDate = String(this.year) + '-' + callMonth
this.$emit('prev', callBackDate)
const clock = this.clockInDateList.find(i => i.day == day)
return clock.isClock
},
/* 下个月 */
nextMonth() {
if (this.month === 12) {
this.year += 1
this.month = 1
} else {
this.month += 1
}
let callMonth = this.month >= 10 ? String(this.month) : '0' + String(this.month)
let callBackDate = String(this.year) + '-' + callMonth
this.$emit('next', callBackDate)
getDetail() {
const { phone: staffPhone } = uni.$storage.get('userInfo')
uni.$api.pointApi.calendarDetail({ staffPhone }).then(res => {
this.clockInDateList = res.clockInDateList || []
})
},
/** 回显每日日期文本
* @param {Object} date
......@@ -145,10 +103,6 @@ export default {
return '今天'
}
// return uni.$jy.formatDate(date, 'D')
},
/* 每日点击事件 */
itemHandle(item) {
this.$emit('item-cilck', item)
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-08 10:31:49
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-09 18:26:55
* @LastEditTime: 2025-01-10 09:34:32
* @FilePath: \gl-tape\components\HomeFrame\components\Income\Dailog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -10,7 +10,7 @@
<view class="dailog-panel">
<view class="dailog-box" :style="{ width: width }">
<view class="dailog-header flex">
<view :class="`sprite-icon icon-${icon}`" v-if="icon"></view>
<view :class="[`sprite-icon icon-${icon}`, { enlarge: icon }]" v-if="icon"></view>
<view class="sprite-icon icon-income-count" v-else></view>
<view class="dailog-title">{{ title }}</view>
<view class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view>
......@@ -79,6 +79,10 @@ export default {
font-weight: 600;
margin-top: -4rpx;
}
.enlarge {
transform: scale(1.5);
margin-right: 30rpx;
}
.dailog-close {
margin-left: auto;
text-align: right;
......
<template>
<Dailog @close="close" v-if="show" width="1288rpx" :title="detail.label" :icon="detail.icon">
<view class="dailog-body" slot="content">
<view class="table-container">
<table class="table-box">
<tr class="th">
<th v-for="(item, index) in tabelTh" :key="index" :style="{ width: item.width + '%' }">{{ item.title }}</th>
</tr>
<tr class="tr" v-for="(item, index) in detail.recordList" :key="index">
<td>{{ index + 1 }}</td>
<td v-for="(colValue, colKey) in tabelTr" :key="colKey">
{{ item[colValue] }}
</td>
</tr>
</table>
</view>
<view class="table-footer flex">
<text>{{ detail.label }}合计:</text>
<text class="price">¥ {{ detail.total }}</text>
</view>
</view>
</Dailog>
</template>
<script>
import Dailog from './Dailog'
export default {
props: {
detail: {
type: Object,
default: () => {}
},
show: {
type: Boolean,
default: false
},
tabelTh: {
type: Array,
default: () => []
},
tabelTr: {
type: Array,
default: () => []
}
},
components: {
Dailog
},
data() {
return {}
},
methods: {
close() {
this.$emit('close')
}
}
}
</script>
<style scoped lang="scss">
.table-container {
max-height: 50vh;
overflow: auto;
}
.table-box {
width: 100%;
padding: 0 64rpx;
border-collapse: separate;
/* 防止边框合并 */
border-spacing: 0;
border: none;
.th {
position: sticky;
top: 0;
}
/* 单元格之间没有间距 */
tr {
border: none;
text-align: center;
&.line {
td {
border-top: 16rpx solid rgba($color: #fff, $alpha: 0.9);
}
}
th {
border: 4rpx solid #fff;
/* 所有单元格都有边框 */
border-top: none;
/* 除了首行外,所有行的上方无边框 */
background: #edf2ff;
height: 88rpx;
font-size: 26rpx;
box-sizing: border-box;
color: #333333;
&:first-child {
border-left: none;
border-radius: 16rpx 0 0 16rpx;
}
&:last-child {
border-radius: 0 16rpx 16rpx 0;
text-align: right;
padding-right: 48rpx;
}
}
td {
border: 4rpx solid #fff;
/* 所有单元格都有边框 */
border-top: none;
/* 除了首行外,所有行的上方无边框 */
background: #f7f8fa;
height: 88rpx;
font-size: 26rpx;
color: #333333;
text-align: center;
box-sizing: border-box;
&:last-child {
text-align: right;
padding-right: 48rpx;
}
text {
color: #c8c8cc;
}
&.line {
border-bottom: 16rpx solid #fff;
}
&:first-child {
border-left: none;
}
&:last-child {
border-right: none;
}
}
}
}
.table-footer {
margin: 0 64rpx;
height: 88rpx;
padding: 0 48rpx;
background: #edf3ff;
border-radius: 0 0 16rpx 16rpx;
font-size: 26rpx;
color: #333333;
font-weight: 600;
.price {
margin-left: auto;
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-07 13:49:15
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-08 10:44:53
* @LastEditTime: 2025-01-13 10:56:02
* @FilePath: \gl-tape\components\HomeFrame\components\Income\History.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -17,7 +17,7 @@
<view class="history-box">
<view class="chart-box">
<view class="chart-header">
<text class="year-text">2025年</text>
<text class="year-text">{{ year }}年</text>
<view class="sprite-icon icon-tips-g"></view>
<text>点击柱形图切换月份</text>
</view>
......@@ -27,54 +27,52 @@
</view>
<view class="income-box">
<view class="income-header">
<text>2024年8月收入</text>
<text>{{ year }}年8月收入</text>
</view>
<view class="income-tips">
<view class="sprite-icon icon-tips-b"></view>
<text>以下未包括 个人所得税、社保等事项</text>
</view>
<view class="income-list">
<view class="income-item" v-for="(item, index) in caseList" :key="index">
<view class="item-label" @click="handleShow(item)">{{ item.title }}</view>
<uni-icons type="help" size="18" color="#A2A2A8"></uni-icons>
<view class="item-price">{{ item.price }}</view>
<view class="item-expand"></view>
<view class="income-item" v-for="(item, index) in IncomeList" :key="index">
<view class="item-label" @click="handleShow(item)">{{ item.label }}</view>
<uni-icons type="help" size="18" color="#A2A2A8" @click="clickTips(item)"></uni-icons>
<view class="item-price">{{ salaryDetail[item.value] || 0 }}</view>
<view class="item-expand" @click="showDetail(item)" v-if="salaryDetail[item.value] && item.tabelTh"></view>
</view>
</view>
<view class="income-footer">
<view class="footer-label">当月收入</view>
<view class="footer-price">
<text>¥</text>
23,746.60
{{ salaryDetail.correctSalary }}
</view>
</view>
</view>
</view>
<Tips @close="show = false" v-if="show">
<view class="dailog-body" slot="content">
<view class="dailog-content">6</view>
<view class="dailog-desc">6</view>
</view>
<template slot="footer">
<view class="dailog-footer">
<view class="dailog-btn">再测一次</view>
<view class="dailog-btn disabled">关闭</view>
</view>
</template>
</Tips>
<Detail @close="show = false" :show="show" :detail="detail" :tabelTh="detail.tabelTh" :tabelTr="detail.tabelTr"></Detail>
<Question @close="tipsShow = false" :show="tipsShow" :detail="tipsDetail"></Question>
</view>
</template>
<script>
import Tips from './Dailog.vue'
import Detail from './Detail'
import point from '@/mixin/point'
import Question from './Question.vue'
export default {
mixins: [point],
components: {
Tips
Detail,
Question
},
data() {
return {
title: '学习数据',
show: false,
tipsShow: false,
tipsDetail: {},
salaryDetail: {},
detail: {},
canvasList: [
{ date: '1月', num: 0 },
{ date: '2月', num: 24 },
......@@ -82,53 +80,18 @@ export default {
{ date: '4月', num: 45 },
{ date: '5月', num: 15 },
{ date: '6月', num: 54 },
{ date: '7月', num: 10 },
{ date: '8月', num: 10 },
{ date: '9月', num: 10 },
{ date: '10月', num: 10 },
{ date: '11月', num: 10 },
{ date: '12月', num: 10 }
],
caseList: [
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
},
{
title: '基本工资',
price: 100
}
{ date: '7月', num: 0 },
{ date: '8月', num: 0 },
{ date: '9月', num: 0 },
{ date: '10月', num: 0 },
{ date: '11月', num: 0 },
{ date: '12月', num: 0 }
],
width: 600,
height: 420,
canPersent: [], //百分比数组
listIndex: 0,
navList: ['最近七天', '最近七个月']
listIndex: 0
}
},
mounted() {
......@@ -138,21 +101,102 @@ export default {
.boundingClientRect(data => {
this.width = data.width
this.height = data.height - 60
this.showChart()
// this.showChart()
})
.exec()
},
methods: {
handleShow(item) {
this.selectItem = item
getDetail(date) {
uni.$api.pointApi.pageStat({ salaryMonthBegin: `${this.year - 1}-1`, salaryMonthEnd: `${this.year - 1}-12` }).then(res => {
const list = res.list || []
const canvasList = []
for (let i = 0; i < 12; i++) {
const num = list.find(item => {
const m = item.salaryMonth.replace(/\d+-/, '')
return m - 1 == i
})
canvasList.push({
date: `${i + 1}月`,
num: 0
})
if (num) {
canvasList[i].num = num.correctSalary
}
}
this.canvasList = canvasList
this.showChart()
})
this.monthSalaryDetail(date)
},
/**
* 个人月薪资明细
* @param {String} salaryMonth - 月份,格式为:YYYY-MM
* @return {Promise}
*/
monthSalaryDetail(salaryMonth) {
uni.$api.pointApi.monthSalaryDetail({ salaryMonth }).then(res => {
this.salaryDetail = res
})
},
/**
* 点击tips
* @param {Object} item - 点击的tips对象
*/
clickTips(item) {
this.tipsDetail = item
this.tipsShow = true
},
/**
* 显示薪资明细
* @param {Object} item - 点击的月份对象
*/
showDetail(item) {
console.log(this.salaryDetail)
const total = this.salaryDetail[item.value]
const recordList = this.salaryDetail[item.recordKey]
this.detail = { ...item, total, recordList }
console.log(this.detail, 'detail')
this.show = true
},
back() {},
/**
* 点击柱状图时的回调函数
* @param {Object} e - 点击事件对象
*/
handleCanvasClick(e) {
// 获取点击位置
const touchX = e.touches[0].x
const touchY = e.touches[0].y
// 计算柱状图之间的间隔
const gap = this.width / this.canPersent.length
// 判断点击的是哪个柱形图
for (let i = 0; i < this.canPersent.length; i++) {
const startX = 10 + gap * i
const endX = startX + 40 // 柱形图的宽度假设为10
const startY = 0
// const startY = this.height - this.canPersent[i] - 6;
const endY = this.height - 6
// 判断点击位置是否在柱形图内
if (touchX >= startX && touchX <= endX && touchY >= startY && touchY <= endY) {
// 点击了第 i 个柱形图
console.log(`点击了 ${this.canvasList[i].date} 的柱形图`)
// 在这里可以添加切换月份或显示详细信息的逻辑
if (this.canvasList[i].num) {
this.showChart(i) // 重新绘制图表,如果需要更新显示
const month = this.canvasList[i].date.replace(/\D+/, '')
this.monthSalaryDetail(this.year + '-' + month)
}
break
}
}
},
// 坐标图
showChart() {
showChart(index) {
const ctx = uni.createCanvasContext('DataCanvas')
ctx.lineWidth = 1
// 横坐标
......@@ -192,18 +236,22 @@ export default {
console.log('--gap----->', gap)
for (var i = 0; i < this.canPersent.length; i++) {
console.log(this.canvasList[i], 'this.canvasList[i]')
// 横坐标的数据
ctx.fillText(this.canvasList[i].date, 30 + gap * i, this.height + 10)
if (this.canvasList[i].num == 0) {
continue
}
// 柱状图上的数据
this.canvasList[i].num && ctx.fillText(this.canvasList[i].num, 33 + gap * i, this.height - this.canPersent[i] - 15)
ctx.fillText(this.canvasList[i].num, 33 + gap * i, this.height - this.canPersent[i] - 15)
if (this.canPersent[i] == 0) {
i++
ctx.fillText(this.canvasList[i].date, 30 + gap * i, this.height + 10)
this.canvasList[i].num && ctx.fillText(this.canvasList[i].num, 33 + gap * i, this.height - this.canPersent[i] - 15)
}
// if (this.canPersent[i] == 0) {
// i++
// ctx.fillText(this.canvasList[i].date, 30 + gap * i, this.height + 10)
// this.canvasList[i].num && ctx.fillText(this.canvasList[i].num, 33 + gap * i, this.height - this.canPersent[i] - 15)
// }
ctx.beginPath()
ctx.setStrokeStyle(i == 1 ? 'rgba(44, 102, 247, 1)' : 'rgba(44, 102, 247, 0.2)') //设置柱状图颜色
ctx.setStrokeStyle(i == index ? 'rgba(44, 102, 247, 1)' : 'rgba(44, 102, 247, 0.2)') //设置柱状图颜色
ctx.moveTo(40 + gap * i, this.height - this.canPersent[i] - 6)
ctx.lineTo(40 + gap * i, this.height - 6)
ctx.lineWidth = 10
......@@ -328,9 +376,9 @@ export default {
margin-left: 24rpx;
width: 0;
height: 0;
border-left: 14rpx solid transparent;
border-right: 14rpx solid transparent;
border-top: 14rpx solid #808291; /* 箭头颜色 */
border-left: 10rpx solid #808291;
border-bottom: 10rpx solid transparent;
border-top: 10rpx solid transparent; /* 箭头颜色 */
}
}
}
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-10 14:54:29
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-10 15:15:36
* @FilePath: \gl-tape\components\HomeFrame\components\Income\Promotion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<view class="calendar-container">
<view class="nav-bar">
......@@ -11,7 +19,9 @@
</template>
<script>
import point from '@/mixin/point'
export default {
mixins: [point],
data() {
return {}
},
......
<template>
<Tips @close="close" v-if="show" width="1288rpx" :title="detail.label">
<view class="dailog-body" slot="content">
<view class="dailog-content">{{ detail.content }}</view>
<view class="dailog-content" v-if="detail.subContent">{{ detail.subContent }}</view>
<view class="dailog-warn" v-if="detail.warnList">
<view class="warn-label">注:</view>
<view>
<view v-for="(item, index) in detail.warnList" :key="index" :style="item.style">{{ item.message }}</view>
</view>
</view>
<template v-if="detail.base">
<view class="base-line">
<view class="base-label">职级工资</view>
<view class="base-times">(初级销售)</view>
<view class="base-value">3,500</view>
</view>
<view class="base-line">
<view class="base-label">应出勤天数</view>
<view class="base-times">(本月31-4)</view>
<view class="base-value">27天</view>
</view>
<view class="base-line">
<view class="base-label">实际出勤天数</view>
<view class="base-times">(截至2025-1-6)</view>
<view class="base-value">22天</view>
</view>
</template>
<view class="dailog-desc" v-if="detail.desc">{{ detail.desc }}</view>
</view>
</Tips>
</template>
<script>
import Tips from './Tips'
export default {
props: {
detail: {
type: Object,
default: () => {}
},
show: {
type: Boolean,
default: false
}
},
components: {
Tips
},
data() {
return {}
},
methods: {
close() {
this.$emit('close')
}
}
}
</script>
<style scoped lang="scss">
.dailog-body {
padding: 0 152rpx;
.dailog-content {
font-size: 32rpx;
color: #1a1a1a;
line-height: 52rpx;
margin-bottom: 32rpx;
}
.dailog-warn {
display: flex;
.warn-label {
font-size: 28rpx;
color: #808291;
}
}
.dailog-desc {
font-size: 32rpx;
color: #808291;
line-height: 52rpx;
margin-top: 32rpx;
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-08 09:51:43
* @Date: 2025-01-08 10:31:49
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-08 10:31:05
* @FilePath: \gl-tape\components\HomeFrame\components\Income\Tips.vue
* @LastEditTime: 2025-01-10 17:47:07
* @FilePath: \gl-tape\components\HomeFrame\components\Income\Dailog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<view class="dailog-panel">
<view class="dailog-box">
<view class="dailog-header">
<view class="dailog-title">{{ selectItem.title }}</view>
<view class="dailog-box" :style="{ width: width }">
<view class="dailog-header flex">
<view class="sprite-icon icon-info-icon"></view>
<view class="dailog-title">{{ title }}</view>
<view class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view>
</view>
<view class="dailog-content">{{ selectItem.content }}</view>
<view class="dailog-desc">{{ selectItem.desc }}</view>
<slot name="content" />
</view>
</view>
</template>
<script>
export default {
props: {
width: {
type: String,
default: '1040rpx'
},
title: String
},
data() {
return {
show: '',
selectItem: {
title: '权益提成',
content: '权益提成 = 权益产值 × 提成系数 × 提成比例',
desc: '提成比例'
}
}
return {}
},
methods: {
close() {
......@@ -46,11 +46,11 @@ export default {
height: 100vh;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
.dailog-box {
position: fixed;
left: 50%;
top: 50%;
width: 1040rpx;
transform: translate(-50%, -50%);
background: #fff;
background-image: linear-gradient(179deg, #d6e9ff 12%, #ffffff 100%); /* 顶部渐变和底部白色 */
......@@ -62,12 +62,16 @@ export default {
border-radius: 48rpx;
padding-bottom: 96rpx;
.dailog-header {
display: flex;
padding: 40rpx 48rpx;
.dailog-title {
font-size: 40rpx;
color: #1a1a1a;
font-weight: 600;
margin-top: -10rpx;
}
.enlarge {
transform: scale(1.5);
margin-right: 30rpx;
}
.dailog-close {
margin-left: auto;
......@@ -78,21 +82,6 @@ export default {
}
}
}
.dailog-content {
font-size: 32rpx;
color: #1a1a1a;
line-height: 52rpx;
padding: 0 120rpx 0 152rpx;
margin-top: 32rpx;
}
.dailog-desc {
font-size: 32rpx;
color: #808291;
padding: 0 120rpx 0 152rpx;
margin-top: 32rpx;
line-height: 48rpx;
}
.dailog-logo {
text-align: center;
image {
......
<template>
<view class="income-container">
<view class="income-header">
<view class="level-box">
<view class="sprite-icon icon-zj-icon"></view>
<view class="level-label">职级</view>
<view class="level-desc">初级驻店</view>
<view class="sprite-icon icon-js-icon"></view>
<view class="income-container" @click="handleTouch">
<template v-if="isShow">
<view class="income-header">
<view class="level-box" @click="jump('Promotion')">
<view class="sprite-icon icon-zj-icon"></view>
<view class="level-label">职级</view>
<view class="level-desc">初级驻店</view>
<view class="sprite-icon icon-js-icon"></view>
</view>
<view class="time-box" @click="jump('Calendar')">
<view class="sprite-icon icon-work-icon"></view>
<view class="level-label">本月出勤</view>
<view class="time-day">{{ incomeDetail.checkInDays }}/{{ incomeDetail.shouldCheckInDays }}</view>
<view class="time-go"></view>
</view>
</view>
<view class="time-box">
<view class="sprite-icon icon-work-icon"></view>
<view class="level-label">本月出勤</view>
<view class="time-day">22/27</view>
<view class="time-go"></view>
<view class="footer-box flex-center">
<view class="sprite-icon icon-tips-b"></view>
最终的交付数以厂家提供的交付数为准,个人填写的交付数仅为工资测算参考。
</view>
</view>
<view class="footer-box flex-center">
<view class="sprite-icon icon-tips-b"></view>
最终的交付数以厂家提供的交付数为准,个人填写的交付数仅为工资测算参考。
</view>
<view class="income-body">
<view class="income-store">
<My-Store></My-Store>
<view class="income-body" v-if="incomeDetail.merchants.length">
<view class="income-store">
<My-Store :merchants="incomeDetail.merchants"></My-Store>
</view>
<view class="income-item">
<Day-Tips :merchants="incomeDetail.merchants"></Day-Tips>
</view>
</view>
<view class="income-item">
<Day-Tips></Day-Tips>
<Password v-if="showPassword" @close="showPassword = false"></Password>
</template>
<view class="dailog-panel" v-else>
<view class="dailog-box">
<view class="dailog-header flex">
<view class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view>
</view>
<view class="sprite-icon icon-prompt"></view>
<view class="dailog-tips">温馨提示</view>
<view class="dailog-desc">收入计算功能仅限广联直营驻店销售人员使用</view>
<view class="dailog-btn" @click="close">好的</view>
</view>
</view>
<Password v-if="showPassword" @close="showPassword = false"></Password>
</view>
</template>
......@@ -38,17 +52,82 @@ export default {
components: { DayTips, Password, MyStore },
data() {
return {
showPassword: true
// showPassword: true
showPassword: false,
incomeDetail: {
staffName: 'string',
staffPhone: 'string',
jobType: 'string',
checkInDays: 0,
shouldCheckInDays: 0,
merchants: []
},
isShow: true,
times: 0
}
},
inject: ['hideFooter'],
mounted() {
inject: ['hideFooter', 'showPage'],
async mounted() {
this.hideFooter(false)
const { phone } = uni.$storage.get('userInfo')
const res = await uni.$api.pointApi.incomeMeasurementConfig({ staffPhone: phone })
const phoneList = res.staffPhone || []
console.log(res.configFlag == 0, res.configFlag == 2 && phoneList.includes(phone))
if (res.configFlag == 0 || (res.configFlag == 2 && phoneList.includes(phone))) {
this.isShow = true
} else {
// return
}
this.incomeCalculation()
this.start()
},
destroyed() {
this.hideFooter(true)
clearInterval(this.interval)
},
methods: {}
methods: {
/**
* 每1s执行一次,执行60次后,触发close方法
* @returns {undefined}
*/
start() {
this.interval = setInterval(() => {
this.times++
if (this.times == 60) {
this.close()
clearInterval(this.interval)
}
}, 1000)
},
/**
* 点击页面时,清除定时器
*/
handleTouch() {
clearInterval(this.interval)
},
close() {
this.$emit('selectTab', 0)
},
/**
* 员工收入测算
* @returns {Promise<void>}
*/
incomeCalculation() {
uni.$api.pointApi.incomeCalculation().then(res => {
console.log(res, 999)
this.incomeDetail = res
})
},
/**
* 跳转到对应的页面
* @param {String} name pages/HomeFrame/components/Point/下的vue文件名
* @param {Number|String} val 传递的参数
*/
jump(name, val) {
console.log(name, 99)
this.showPage(name, val)
}
}
}
</script>
......@@ -116,7 +195,7 @@ export default {
}
.income-body {
display: grid;
grid-template-columns: 66% 34%;
grid-template-columns: 68% 32%;
column-gap: 48rpx;
height: calc(100vh - 260rpx);
width: calc(100% - 110rpx);
......@@ -136,4 +215,66 @@ export default {
border-radius: 48rpx;
}
}
.dailog-panel {
position: fixed;
width: 100vw;
height: 100vh;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
.dailog-box {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #fff;
background-image: linear-gradient(179deg, #d6e9ff 12%, #ffffff 100%); /* 顶部渐变和底部白色 */
background-size: 100% 110rpx, 100% calc(100% - 110rpx); /* 分别设置渐变和白色的背景大小 */
background-repeat: no-repeat, no-repeat; /* 确保背景不重复 */
background-position: top, bottom; /* 分别设置渐变和白色的位置 */
width: 1040rpx;
height: 784rpx;
background: #ffffff;
border-radius: 48rpx;
padding-bottom: 96rpx;
.dailog-header {
padding: 40rpx 48rpx;
.dailog-close {
margin-left: auto;
text-align: right;
.uni-icons {
color: #808291 !important;
font-size: 40rpx;
}
}
}
.icon-prompt {
margin: 0 auto;
}
.dailog-tips {
margin-top: 54rpx;
font-size: 40rpx;
color: #1a1a1a;
text-align: center;
}
.dailog-desc {
font-size: 32rpx;
color: #808291;
text-align: center;
margin-top: 16rpx;
}
.dailog-btn {
width: 400rpx;
height: 96rpx;
background-image: linear-gradient(180deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 32rpx 0 #ffffff80;
border-radius: 16rpx;
margin: 96rpx auto 0;
font-size: 36rpx;
color: #ffffff;
line-height: 96rpx;
text-align: center;
}
}
}
</style>
......@@ -53,7 +53,7 @@ export default {
icon: "record",
},
{
label: "积分权益",
label: "个人中心",
icon: "point",
},
],
......
......@@ -11,7 +11,7 @@
<view class="tab-box">
<view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view>
</view>
<component :is="tabName"></component>
<component :is="tabName" @selectTab="selectTab"></component>
</view>
</template>
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-08 11:30:30
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-09 10:38:48
* @LastEditTime: 2025-01-10 15:54:24
-->
<template>
<view class="point-box">
......@@ -12,21 +12,21 @@
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view v-if="isHigh" class="title"><text>兑换券介绍</text></view>
<!-- <view class="month-box" v-else>
<view class="month-box" v-else>
<view class="month-tabs">
<view class="tab-prev" v-if="month <= currentMonth" @click="prevTab">
<view class="tab-prev" v-if="month <= currentMonth && month > 1" @click="prevTab">
<view class="tab-icon">
<uni-icons type="left" size="20"></uni-icons>
<uni-icons type="left" size="16"></uni-icons>
</view>
</view>
<view class="tab-mid">{{ month == currentMonth ? '本' : (month + '').padStart(2, '0') }}月</view>
<view class="tab-next" v-if="month != currentMonth" @click="nextTab">
<view class="tab-icon">
<uni-icons type="right" size="20"></uni-icons>
<uni-icons type="right" size="16"></uni-icons>
</view>
</view>
</view>
</view> -->
</view>
</view>
<view class="point-body">
<view class="level-box">
......@@ -109,9 +109,15 @@ export default {
this.isHigh = isHigh
},
methods: {
getDetail() {
getDetail(countDate) {
this.getRule(1)
this.getRule(2)
this.getBadgeList(countDate)
},
getBadgeList(countDate) {
uni.$api.pointApi.badgeList({ countDate }).then(res => {
this.badgeList = res.map(item => item.medalType)
})
},
getRule(levelType) {
uni.$api.pointApi.rewardRule({ levelType }).then(res => {
......@@ -131,7 +137,7 @@ export default {
})
},
updateDetail(countDate) {
this.getDetail(countDate)
this.getBadgeList(countDate)
}
}
}
......
export default {
data() {
return {
IncomeList: [
{
label: '基本工资',
icon: 'jbgz-icon',
content: '基本工资 = 职级工资÷应出勤天数×实际出勤天数',
value: 'basicSalary'
},
{
label: '退单冲减',
icon: 'tdcj-icon',
content: '历史已发放提成订单客户本月退单,当月冲减该月提成',
value: 'refundOffset',
recordKey: 'refundOffsetRecord',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '退单记录描述'
},
{
title: '提成',
width: 20
}
]
},
{
label: '会员权益/升级',
icon: 'qytc-icon',
content: '权益提成 = 权益产值 × 提成系数 × 提成比例',
subContent: '延保提成 = 售前延保产值×提成系数×安心包max考核系数×提成比例 +售后延保产值×提成比例 +安心包Max产值×提成系数×提成比例',
warnList: [
{ style: 'font-size: 28rpx;color: #808291;line-height: 48rpx;', message: '当安心包Max渗透率<15%,安心包Max考核系数为 0.8' },
{
style: 'font-size: 28rpx;color: #808291;line-height: 48rpx;',
message: '当安心包Max渗透率>15%,安心包Max考核系数为 1.0'
},
{
style: 'font-size: 28rpx;color: #F47F13;line-height: 48rpx;',
message: '问界安心包、安心包PRO、轮胎服务,三项合计交付渗透率>15% 的部分,可以计入安心包Max渗透率;如三项渗透率为20%,其中5%计入安心包Max考核。'
}
],
value: 'equityCommission',
recordKey: 'equityMerchantCommissions',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '门店名称'
},
{
title: '提成',
width: 20
}
],
tabelTr: ['merchantName', 'commission']
},
{
label: '日报扣款',
icon: 'rbkk-icon',
content: '日报填写错误或未在约定时间内填写日版',
value: 'dailyDeductMoney',
recordKey: 'dailyDeductionRecords',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '扣款',
width: 20
}
],
tabelTr: ['deductDate', 'configDeductMoney']
},
{
label: '轻改提成',
icon: 'qgtc-icon',
content: '轻改产值x提成系数x提成比例',
value: 'lightCommission',
recordKey: 'lightMerchantCommissions',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '门店名称'
},
{
title: '提成',
width: 20
}
],
tabelTr: ['merchantName', 'commission']
},
{
label: '平板接待扣款',
icon: 'pbjd-icon',
content: '无效或虚假平板接待以及末使用平板接待',
value: 'padDeductMoney',
recordKey: 'padDeductionRecords',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '扣款',
width: 20
}
],
tabelTr: ['deductDate', 'configDeductMoney']
},
{
label: '本月递延金',
icon: 'bydyj-icon',
content: '本月递延金 = 本月提成 × 10%',
desc: '递延金将于6个月后提成发放时返还',
value: 'deferExpenses'
},
{
label: '返还递延金',
icon: 'ffdyj-icon',
content: '本月递延金 = 提成(M-6)× 10%',
desc: '6个月前提成递延金在本月返还',
value: 'deferIncome'
},
{
label: '其他',
icon: 'qt-icon',
content: '其他扣款、奖励事项',
recordKey: 'otherDeductionRecord',
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '备注'
},
{
title: '金额',
width: 20
}
],
tabelTr: ['createdDate', 'remark', 'deduction'],
value: 'otherDeduction'
}
],
year: '',
month: '',
currentMonth: ''
currentMonth: '',
date: ''
}
},
mounted() {
......@@ -12,8 +175,10 @@ export default {
const day = new Date().getDate()
this.year = year
this.month = month
this.day = day
this.currentMonth = month
this.getDetail && this.getDetail(`${this.year}-${this.month}`, day)
this.date = `${this.year}-${this.month}-${day}`
},
methods: {
back() {
......
<template>
<view class="layout">
<template v-if="views.length>1">
<view class="tabs-box">
<tabs
:list="views"
@tabclick="changeTab"
></tabs>
</view>
</template>
<wnCanvas
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
......@@ -17,15 +9,28 @@
>
<template slot="customContent">
<view class="layout-content">
<view class="title">{{title}}</view>
<image
:class="['content',modeName]"
:src="views[viewIndex].detailUrl"
/>
<image
:class="['bg',modeName]"
:src="views[viewIndex].bgUrl"
<page-title
:title="title"
:hasCarBrand="hasCarBrand"
:show="show"
/>
<template v-if="hasCarBrand">
<image
class="content"
:src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')"
/>
</template>
<template v-else>
<image
class="content"
:src="views[0].detailUrl"
/>
<image
class="bg"
:src="views[0].bgUrl"
/>
</template>
</view>
</template>
</wnCanvas>
......@@ -33,42 +38,35 @@
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
import PageTitle from './PageTitle.vue'
export default {
props: {
views: Array,
views: [Array, Object],
penSwitch: Boolean,
title: String,
madiaId: Number,
isByd: Boolean
isByd: Boolean,
show: Boolean,
hasCarBrand: Boolean
},
components: {
Tabs
PageTitle
},
name: 'MediaComponent',
data () {
return {
viewIndex: 0,
modeName: ''
}
},
watch: {
},
computed: {
customerInfo () {
return this.$store.state.user.customerInfo
},
},
mounted () {
},
methods: {
changeTab (index) {
if (this.viewIndex == index) return
let { viewIndex } = this
this.modeName = viewIndex > index ? 'to-left' : 'to-right'
this.viewIndex = index
this.$refs.canvasRef.clearBoard()
setTimeout(() => {
this.modeName = ''
}, 300)
}
}
}
</script>
......@@ -82,19 +80,6 @@ export default {
position: relative;
margin: $margin;
}
.title {
position: absolute;
left: 0;
top: toRpx(112);
font-weight: 700;
font-size: toRpx(48);
color: #1a1a1a;
letter-spacing: toRpx(4);
line-height: toRpx(64);
text-align: center;
width: 100%;
z-index: 2;
}
.content {
position: absolute;
width: 100%;
......@@ -108,35 +93,5 @@ export default {
left: 0;
top: 0;
}
.tabs-box {
width: toRpx(1112);
position: absolute;
top: toRpx(228);
left: 50%;
transform: translateX(-50%);
z-index: 100;
}
}
.to-left {
animation: to-left 0.25s forwards;
}
.to-right {
animation: to-right 0.25s forwards;
}
@keyframes to-left {
0% {
left: -100%;
}
100% {
left: 0;
}
}
@keyframes to-right {
0% {
left: 100%;
}
100% {
left: 0;
}
}
</style>
\ No newline at end of file
<template>
<view class="page-title-box flex">
{{title}}
<view
class="car-options flex"
v-if="hasCarBrand"
@click="$refs.carBrandListVisible.open()"
>
{{customerInfo.carModel}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue'
export default {
components: { CarBrands },
name: 'PageTitle',
props: {
title: String,
hasCarBrand: Boolean,
show: Boolean
},
data () {
return {
customerInfo: {}
}
},
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && this.hasCarBrand && !this.customerInfo.carModel && this.watchChannelType == 1) this.$refs.carBrandListVisible.autoSelect()
}
},
watchCustomerInfo: {
immediate: true,
handler (newval) {
if (newval) this.customerInfo = newval
}
},
},
computed: {
watchCustomerInfo () {
return this.$store.state.user.customerInfo
},
watchStatus () {
return this.$store.state.user.historyStatus
},
watchChannelType () {
// 默认1 1问界 2 比亚迪 3 其他
return uni.$storage.get('userInfo').channelType
}
},
mounted () {
},
methods: {
handleSelect (item, popkey) {
this.$refs[popkey].close()
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.customerInfo.carModelId = item.id
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
}
}
</script>
<style scoped lang='scss'>
.page-title-box {
justify-content: center;
position: absolute;
height: toRpx(96);
left: 0;
top: toRpx(48);
font-weight: 500;
font-size: toRpx(36);
color: #333;
text-align: center;
width: 100%;
z-index: 2;
.car-options {
&::before {
content: '';
width: 2rpx;
height: 36rpx;
opacity: 1;
background: #333333;
margin: 0 24rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<view :class="['layout',`${isByd?'byd-layout':'aito-layout'}`]">
<view :class="['layout',`${isByd?'byd-layout':''}`]">
<wnCanvas
saveImageType="3"
canvasId="c-1"
......@@ -9,9 +9,8 @@
>
<template slot="customContent">
<view class="layout-content">
<view class="title">
<view :class="['sprite-icon',`${isByd?'icon-byd':'icon-aito'}`]"></view>
<view class="text">{{title}}</view>
<view class="title flex">
{{title}}
</view>
<view class="content">
<view
......@@ -61,22 +60,18 @@
</template>
</view>
</view>
<view class="views-box">
<template v-for="(i,index) in views">
<view
:key="index"
class="item"
:style="i.style"
>
<image
:src="i.detailUrl"
class="img"
:style="i.imgStyle"
/>
</view>
</template>
</view>
<template v-if="isByd">
<image
class="content-image"
:src="views[0].detailUrl"
/>
</template>
<template v-else>
<image
class="content-image"
:src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')"
/>
</template>
</view>
</view>
</template>
......@@ -98,7 +93,7 @@ export default {
penSwitch: Boolean,
show: Boolean,
title: String,
views: Array,
views: [Array, Object],
isByd: Boolean,
},
name: 'Reception',
......@@ -161,6 +156,7 @@ export default {
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.customerInfo.carModelId = item.id
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -193,7 +189,7 @@ export default {
.layout {
width: 100%;
height: 100%;
background-image: url('@/assets/images/media/reception-bg.webp');
background-size: 100%;
&-content {
position: relative;
......@@ -201,29 +197,33 @@ export default {
margin: $margin;
}
.title {
padding: toRpx(160) 0 toRpx(32) toRpx(110);
.sprite-icon {
margin-bottom: toRpx(24);
}
.text {
line-height: toRpx(112);
font-weight: 700;
font-size: toRpx(80);
color: #333333;
}
position: fixed;
left: 0;
top: toRpx(48);
width: 100%;
justify-content: center;
z-index: 2;
height: toRpx(96);
align-items: center;
font-weight: 500;
font-size: toRpx(36);
color: #1a1a1a;
}
.content {
.form-box {
height: toRpx(80);
padding: 0 toRpx(110);
position: relative;
z-index: 1;
z-index: 2;
position: absolute;
left: toRpx(64);
top: toRpx(168);
padding: 0;
.form {
display: flex;
gap: 0 toRpx(28);
height: 100%;
&-item {
width: toRpx(368);
width: toRpx(524);
height: 100%;
position: relative;
......@@ -278,64 +278,25 @@ export default {
}
}
}
.views-box {
display: flex;
gap: 0 toRpx(48);
padding: 0 toRpx(72);
justify-content: center;
margin-top: toRpx(92);
.item {
height: toRpx(944);
position: relative;
.img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
aspect-ratio: 1/1;
height: toRpx(1020);
}
}
&-image {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
.bg {
width: 100vw;
height: 100vh;
position: fixed;
left: 0;
top: 0;
}
}
}
.byd-layout {
background-image: url('@/assets/images/media/byd-reception-bg.webp') !important;
.content .views-box {
margin-top: toRpx(44);
.item {
.img {
height: toRpx(960);
}
}
}
}
.aito-layout {
.title {
padding: toRpx(112) 0 toRpx(40) toRpx(112);
}
.content {
.form-box {
position: fixed;
right: toRpx(184);
top: toRpx(188);
padding: 0;
}
.views-box {
margin-top: 0;
display: flex;
flex-wrap: wrap;
padding: 0 toRpx(38);
gap: 0;
justify-content: flex-start;
.item {
width: toRpx(1132);
.img {
width: 100%;
height: 100%;
}
}
}
}
background-image: url('@/assets/images/media/reception-bg.webp');
}
</style>
......@@ -21,7 +21,7 @@
<template slot="customContent">
<view class="layout-content">
<view class="title">{{title}}</view>
<view class="title flex">{{title}}</view>
<view class="container">
<view class="left-tab">
<view
......@@ -155,14 +155,14 @@ export default {
position: relative;
}
.title {
justify-content: center;
position: absolute;
height: toRpx(96);
left: 0;
top: toRpx(112);
font-weight: 700;
font-size: toRpx(48);
color: #1a1a1a;
letter-spacing: toRpx(4);
line-height: toRpx(64);
top: toRpx(48);
font-weight: 500;
font-size: toRpx(36);
color: #333;
text-align: center;
width: 100%;
z-index: 2;
......
......@@ -6,28 +6,85 @@
* @LastEditTime: 2024-12-25 18:52:46
-->
<template>
<view class="detail-box" @dblclick="dbClick">
<view class="nav-bar" :style="{ 'z-index': backZindex }">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
<view
class="detail-box"
@dblclick="dbClick"
>
<view
class="nav-bar"
:style="{ 'z-index': backZindex }"
>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
</view>
<template v-for="(item, index) in media">
<view :class="['view', { showView: id == item.id }, modeName]" :key="index" @touchstart.stop="touchStart" @touchend.stop="touchEnd">
<component @full="handleFull" :detail="item" :is="item.componentName" :views="item.receptionSourceDetailList || []" :penSwitch="penSwitch" :show="id == item.id" :ref="'media' + item.id" :title="item.detailTitle || ''" :madiaId="item.id" @scale="scale" :ulList="item.ulList" :screenList="item.screenList" @onProductModel="productModelStatus = $event" :isPreview="isPreview" :isByd="isByd" />
<view
:class="['view', { showView: id == item.id }, modeName]"
:key="index"
@touchstart.stop="touchStart"
@touchend.stop="touchEnd"
>
<component
@full="handleFull"
:detail="item"
:is="item.componentName"
:views="item.receptionSourceDetailList || []"
:penSwitch="penSwitch"
:show="id == item.id"
:ref="'media' + item.id"
:title="item.detailTitle || ''"
:madiaId="item.id"
@scale="scale"
:ulList="item.ulList"
:screenList="item.screenList"
@onProductModel="productModelStatus = $event"
:isPreview="isPreview"
:isByd="isByd"
:hasCarBrand="item.hasCarBrand"
/>
</view>
</template>
<template v-if="type != 'preview'">
<template v-if="backZindex">
<tool-box ref="toolRef" :data="toolList" :type="type" @choose="choose" @finish="open" :id="id" @toPay="toPay" :showPayBtn="watchPayInfo" />
<view class="pen-box" @click="drawStatus = !drawStatus">
<tool-box
ref="toolRef"
:data="pageToolList"
:type="type"
@choose="choose"
@finish="open"
:id="id"
@toPay="toPay"
:showPayBtn="watchPayInfo"
/>
<view
class="pen-box"
@click="drawStatus = !drawStatus"
>
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"></view>
</view>
</template>
</template>
<pay-pop ref="pay" @jumpPay="showPayPage = true"></pay-pop>
<finish-step ref="stepRef" @submit="done" :titleTips="finishTips" />
<informationEntry :showPayPage.sync="showPayPage" @finish="open" />
<pay-pop
ref="pay"
@jumpPay="showPayPage = true"
></pay-pop>
<finish-step
ref="stepRef"
@submit="done"
:titleTips="finishTips"
/>
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
</view>
</template>
<script>
......@@ -65,10 +122,11 @@ export default {
type: String,
default: 'preview'
},
toolList: Array
toolList: Array,
aitoCarModelIds: Array
},
mixins: [receptionTrackMixin],
data() {
data () {
return {
backZindex: 9,
drawStatus: false,
......@@ -78,60 +136,83 @@ export default {
scaleValueObject: {},
showPayPage: false,
productModelStatus: false,
modeName: ''
modeName: '',
pageToolList: []
}
},
computed: {
watchStatus() {
channelType () {
const { channelType } = uni.$storage.get('userInfo')
return channelType
},
watchStatus () {
return this.$store.state.user.historyStatus
},
penSwitch() {
penSwitch () {
return !this.isPreview && this.drawStatus
},
watchPayInfo() {
watchPayInfo () {
return this.$store.state.user.paymentType.length ? true : false
},
title() {
title () {
let { id } = this,
name = this.media.find(e => e.id == id)?.detailTitle || ''
return name
},
finishTips() {
const { channelType } = uni.$storage.get('userInfo')
finishTips () {
let text = ''
if (channelType == 3) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
if (this.channelType == 3) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
return text
},
isByd() {
const { channelType } = uni.$storage.get('userInfo')
return channelType == 2
isByd () {
return this.channelType == 2
},
isPreview() {
isPreview () {
return this.type == 'preview'
}
},
CarModelId () {
return this.$store.state.user.customerInfo.carModelId
},
},
watch: {
watchStatus: {
immediate: true,
handler(newval) {
handler (newval) {
if (newval) this.drawStatus = false
}
}
},
CarModelId: {
immediate: true,
handler (newval) {
if (this.channelType == 1) {
const isAito = this.aitoCarModelIds.findIndex(e => e == newval)
if (isAito == -1) {
this.pageToolList = this.toolList.filter(e => !e.isAito)
} else this.pageToolList = this.toolList
}
}
},
toolList: {
immediate: true,
handler (newval) {
this.pageToolList = newval
}
},
},
mounted() {
mounted () {
const systemInfo = uni.getSystemInfoSync()
this.screenWidth = systemInfo.screenWidth
},
methods: {
...mapMutations('audio', ['setReceptionStatus']),
open() {
open () {
this.$refs.stepRef.open()
},
handleFull(val) {
handleFull (val) {
this.backZindex = val ? 0 : 9
},
/**切换素材 */
choose(e) {
choose (e) {
Object.keys(this.$refs).map(refKey => {
let ref = this.$refs[refKey]
if (ref) {
......@@ -143,42 +224,42 @@ export default {
this.$emit('update:id', e.id)
uni.$logger.local.info(`预览${e.title}`)
},
back() {
back () {
this.$refs?.toolRef?.hide()
this.$emit('back')
},
done(e) {
done (e) {
this.showPayPage = false
this.$refs.toolRef.hide()
this.$refs.stepRef.close()
this.receptionTrackLeave()
this.$emit('done', e)
},
toPay() {
toPay () {
this.$refs.pay.show()
},
dbClick() {
dbClick () {
if (!this.isPreview) this.drawStatus = !this.drawStatus
},
touchStart(e) {
touchStart (e) {
if (!this.drawStatus && e.changedTouches?.length) {
this.startX = e.changedTouches[0].pageX
this.startY = e.changedTouches[0].pageY
}
},
touchEnd(e) {
touchEnd (e) {
if (this.modeName) return
try {
let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this
if (!e || !e.changedTouches || drawStatus || toolList.length == 0 || e.changedTouches.length === 0) return
let { pageToolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this
if (!e || !e.changedTouches || drawStatus || pageToolList.length == 0 || e.changedTouches.length === 0) return
let halfScreenWidth = screenWidth / 2,
touch = e.changedTouches[0],
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3,
index = toolList.findIndex(item => item.id == id)
if (Math.abs(this.startY - touch.pageY) > 100) return
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 6,
index = pageToolList.findIndex(item => item.id == id)
if (Math.abs(this.startY - touch.pageY) > 150) return
if (!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1 && !productModelStatus) {
const { nextId, modeName, title } = this.getNextId(index, toolList, startX, halfScreenWidth)
const { nextId, modeName, title } = this.getNextId(index, pageToolList, startX, halfScreenWidth)
this.modeName = modeName
this.receptionTrackLeave()
this.$emit('update:id', nextId)
......@@ -191,14 +272,14 @@ export default {
console.log(error)
}
},
getNextId(index, toolList, startX, halfScreenWidth) {
getNextId (index, pageToolList, startX, halfScreenWidth) {
let nextItem = {},
modeName = ''
if (startX > halfScreenWidth) {
nextItem = index === toolList.length - 1 ? toolList[0] : toolList[index + 1]
nextItem = index === pageToolList.length - 1 ? pageToolList[0] : pageToolList[index + 1]
modeName = 'to-right'
} else {
nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1]
nextItem = index === 0 ? pageToolList[pageToolList.length - 1] : pageToolList[index - 1]
modeName = 'to-left'
}
return {
......@@ -207,7 +288,7 @@ export default {
title: nextItem.title
}
},
scale(e) {
scale (e) {
let { id } = this
this.scaleValueObject[id] = e
}
......@@ -228,12 +309,14 @@ export default {
left: 0;
top: toRpx(48);
z-index: 9;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
}
.pen-box {
......
<template>
<view>
<home-frame @preview="preview" @start="start" ref="home" :id="id" @openStep="openStep" @backHome="backHome" @changeTab="changeTab">
<view class="module-box" slot="module">
<home-frame
@preview="preview"
@start="start"
ref="home"
:id="id"
@openStep="openStep"
@backHome="backHome"
@changeTab="changeTab"
>
<view
class="module-box"
slot="module"
>
<template v-for="(i, index) in moduleList">
<view :key="index" :class="['item', i.class]" :style="i.style" @click="toDetail(i)" v-if="!i.hide">
<view
:key="index"
:class="['item', i.class]"
:style="i.style"
@click="toDetail(i)"
v-if="!i.hide"
>
<template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view>
</template>
<template v-else>
<image class="item-img" :src="i.thumbnail" mode="scaleToFill" @error="errorImg(index)" />
<image
class="item-img"
:src="i.thumbnail"
mode="scaleToFill"
@error="errorImg(index)"
/>
</template>
</view>
</template>
</view>
<template slot="detail">
<detail :id.sync="id" :media="moduleList" :type.sync="type" :toolList="toolList" @back="back" @done="done" ref="detail" />
<detail
:id.sync="id"
:media="moduleList"
:type.sync="type"
:toolList="toolList"
:aitoCarModelIds="aitoCarModelIds"
@back="back"
@done="done"
ref="detail"
/>
</template>
<template slot="content">
<!-- <novice-guide
......@@ -42,7 +73,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue'
export default {
// mixins: [storge],
components: { HomeFrame, detail, NoviceGuide },
data() {
data () {
return {
moduleList: [],
toolList: [],
......@@ -50,16 +81,17 @@ export default {
type: '',
chooseItem: {},
tabIndex: 0,
recording: false
recording: false,
aitoCarModelIds:[]
}
},
computed: {
channelType() {
channelType () {
const { channelType } = uni.$storage.get('userInfo')
return channelType || 1 //默认问界
}
},
onBackPress(options) {
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -69,12 +101,12 @@ export default {
// 其他情况允许正常返回
return false
},
onLoad() {
onLoad () {
this.setViewInfo()
this.getSoure()
this.get_Vehicle_Sales_Data()
},
onShow() {
onShow () {
const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo')
......@@ -88,11 +120,11 @@ export default {
},
methods: {
...mapMutations('audio', ['setReceptionStatus']),
init() {
init () {
this.findPayInfo()
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data() {
get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get('userInfo'),
storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'),
......@@ -128,7 +160,7 @@ export default {
},
// 查询素材
// 查询素材
async getSoure() {
async getSoure () {
/**比亚迪 */
if (this.channelType == 2) {
let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true)
......@@ -177,7 +209,7 @@ export default {
)
this.setViewInfo(moduleList, toolList)
} else {
let { moduleList, toolList, default_moduleList, default_toolList, boutiqueDefaultCarBrandId } = await uni.$api.systemApi.getMockData(true)
let { moduleList, toolList, default_moduleList, default_toolList, boutiqueDefaultCarBrandId,aitoCarModelIds } = await uni.$api.systemApi.getMockData(true)
if (this.channelType == 3) {
let configList
try {
......@@ -217,14 +249,19 @@ export default {
)
this.setViewInfo(default_moduleList, default_toolList)
} else {
this.aitoCarModelIds = aitoCarModelIds
/**默认问界 */
moduleList = await Promise.all(
moduleList.map(async e => ({
...e,
receptionSourceDetailList: e.receptionSourceDetailList ? await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl') : undefined,
carTypeList: e.carTypeList ? await uni.$api.systemApi.imgToBase64(e.carTypeList, 'url') : undefined,
screenList: e.screenList ? await uni.$api.systemApi.imgToBase64(e.screenList, 'url') : undefined
}))
moduleList.map(async e => {
const receptionSourceDetailListType = Array.isArray(e.receptionSourceDetailList)
return {
...e,
receptionSourceDetailList: e.receptionSourceDetailList ? await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList,
receptionSourceDetailListType ? 'detailUrl' : '', receptionSourceDetailListType) : undefined,
carTypeList: e.carTypeList ? await uni.$api.systemApi.imgToBase64(e.carTypeList, 'url') : undefined,
screenList: e.screenList ? await uni.$api.systemApi.imgToBase64(e.screenList, 'url') : undefined
}
})
)
toolList = await uni.$api.systemApi.imgToBase64(toolList, 'shortTitleUrl')
uni.$api.systemApi.updateMockData(
......@@ -240,11 +277,11 @@ export default {
}
}
},
errorImg(index) {
errorImg (index) {
this.moduleList[index].showAlt = true
},
async start() {
async start () {
if (this.recording) return
uni.showLoading({
mask: true
......@@ -267,14 +304,14 @@ export default {
uni.hideLoading()
}, 1e3)
},
toDetail(item) {
toDetail (item) {
this.chooseItem = item
this.$refs.home.previewRef.open()
},
cancel() {
cancel () {
this.$refs.home.previewRef.close()
},
preview() {
preview () {
let { id, title } = this.chooseItem
this.type = 'preview'
this.id = id
......@@ -282,7 +319,7 @@ export default {
this.cancel()
},
// 完成接待
done(e) {
done (e) {
this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio()
this.recording = false
......@@ -294,14 +331,14 @@ export default {
this.$store.dispatch('clearReceptionTrack')
}, 1500)
},
back() {
back () {
const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome()
},
backHome() {
backHome () {
if (this.recording) this.$refs.home.stopAudio(true)
this.$refs.home.finishRef.close()
this.id = ''
......@@ -310,23 +347,23 @@ export default {
this.init()
this.recording = false
},
nextStep() {
nextStep () {
let { id } = this.moduleList[0]
this.type = 'preview'
this.id = id
},
clearHistory() {
clearHistory () {
this.$store.dispatch('clearCustomerInfo')
this.$store.dispatch('clearHistory')
this.$refs.home.setBooks([])
this.$store.dispatch('clearReceptionTrack')
},
openStep() {
openStep () {
this.$refs.home.finishRef.close()
this.$refs.detail.open()
},
// 查询门店支付配置
async findPayInfo() {
async findPayInfo () {
const { shopMerchantId } = uni.$storage.get('userInfo')
const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId
......@@ -350,13 +387,13 @@ export default {
})
this.$store.dispatch('setPaymentType', paymentType)
},
changeTab(index) {
changeTab (index) {
this.tabIndex = index
if (index == 0) this.init()
},
/**按序加载车型 */
async getCarBrandsList(carBrandList, index) {
async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index]
if (!item) return
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
......@@ -373,7 +410,7 @@ export default {
}
},
/**素材内容 */
setViewInfo(_moduleList, _toolList) {
setViewInfo (_moduleList, _toolList) {
if (_moduleList && _toolList) {
this.moduleList = _moduleList
this.toolList = _toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!