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 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-19 11:02:01 * @Date: 2024-12-19 11:02:01
* @LastEditors: 前端 qianduan01@didihu.com.cn * @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 * @FilePath: \gl-tape\api\module\point.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -59,5 +59,86 @@ module.exports = { ...@@ -59,5 +59,86 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...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' ...@@ -2,10 +2,10 @@ import http from '../request/http'
import { env } from '../../env' import { env } from '../../env'
const serverConfig = { const serverConfig = {
mockRequestCount: null, mockRequestCount: null,
mockTimer: {}, mockTimer: {},
mockCache: null mockCache: null
}, },
bydServerConfig = { bydServerConfig = {
mockRequestCount: null, mockRequestCount: null,
mockTimer: {}, mockTimer: {},
...@@ -60,29 +60,49 @@ const getMockData = async (immediate = false) => { ...@@ -60,29 +60,49 @@ const getMockData = async (immediate = false) => {
return Promise.reject(error) return Promise.reject(error)
} }
} }
const imgToBase64 = (list, urlKey) => { const imgToBase64 = (list, urlKey, isArray = true) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let arr = [], let arr = [],
newList = JSON.parse(JSON.stringify(list)) newList = JSON.parse(JSON.stringify(list))
list.map((e, index) => { if (isArray) {
if (!e[urlKey]) return resolve(list) list.map((e, index) => {
if (!e[urlKey].startsWith('https')) return resolve(list) if (!e[urlKey]) return resolve(list)
uni.request({ if (!e[urlKey].startsWith('https')) return resolve(list)
url: urlKey ? e[urlKey] : e, uni.request({
method: 'GET', url: urlKey ? e[urlKey] : e,
responseType: 'arraybuffer', method: 'GET',
success: res => { responseType: 'arraybuffer',
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}` success: res => {
newList[index][urlKey] = base64 const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
newList[index][`original_${urlKey}`] = e[urlKey] newList[index][urlKey] = base64
arr.push(e) newList[index][`original_${urlKey}`] = e[urlKey]
if (arr.length === list.length) resolve(newList) arr.push(e)
}, if (arr.length === list.length) resolve(newList)
fail: err => { },
reject(err) 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') => { 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 @@ ...@@ -20,8 +20,8 @@
<view class="calendar-date" v-for="(date, index) in dates" :key="index"> <view class="calendar-date" v-for="(date, index) in dates" :key="index">
<template v-if="date"> <template v-if="date">
<view class="date-num">{{ date }}</view> <view class="date-num">{{ date }}</view>
<!-- <view class="date-desc">出勤</view> --> <view class="date-desc" v-if="isClock(date) == 2">出勤</view>
<view class="date-desc date-card">未打卡</view> <view class="date-desc date-card" v-if="isClock(date) == 1">未打卡</view>
</template> </template>
</view> </view>
</view> </view>
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
</template> </template>
<script> <script>
import point from '@/mixin/point'
export default { export default {
mixins: [point],
name: 'calendar', name: 'calendar',
props: { props: {
// 是否显示周标题 // 是否显示周标题
...@@ -49,6 +51,7 @@ export default { ...@@ -49,6 +51,7 @@ export default {
// 当前所处日期 年月日 // 当前所处日期 年月日
nowDate: '7', 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], 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(), year: new Date().getFullYear(),
// 当前所处月 // 当前所处月
...@@ -60,7 +63,6 @@ export default { ...@@ -60,7 +63,6 @@ export default {
computed: { computed: {
dates() { dates() {
const firstDayOfMonth = new Date(this.year, this.month - 1, 1) const firstDayOfMonth = new Date(this.year, this.month - 1, 1)
const lastDayOfMonth = new Date(this.year, this.month, 0)
const dates = [] const dates = []
for (let i = 0, len = this.datesd.length; i < len; i++) { for (let i = 0, len = this.datesd.length; i < len; i++) {
dates.push(this.datesd[i]) dates.push(this.datesd[i])
...@@ -79,63 +81,19 @@ export default { ...@@ -79,63 +81,19 @@ export default {
return dates 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: { methods: {
/* 上个月 */ isClock(day) {
prevMonth() { if (this.day < day) {
if (this.month === 1) { return
this.year -= 1
this.month = 12
} else {
this.month -= 1
} }
let callMonth = this.month >= 10 ? String(this.month) : '0' + String(this.month) const clock = this.clockInDateList.find(i => i.day == day)
let callBackDate = String(this.year) + '-' + callMonth return clock.isClock
this.$emit('prev', callBackDate)
}, },
/* 下个月 */ getDetail() {
nextMonth() { const { phone: staffPhone } = uni.$storage.get('userInfo')
if (this.month === 12) { uni.$api.pointApi.calendarDetail({ staffPhone }).then(res => {
this.year += 1 this.clockInDateList = res.clockInDateList || []
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)
}, },
/** 回显每日日期文本 /** 回显每日日期文本
* @param {Object} date * @param {Object} date
...@@ -145,10 +103,6 @@ export default { ...@@ -145,10 +103,6 @@ export default {
return '今天' return '今天'
} }
// return uni.$jy.formatDate(date, 'D') // return uni.$jy.formatDate(date, 'D')
},
/* 每日点击事件 */
itemHandle(item) {
this.$emit('item-cilck', item)
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-08 10:31:49 * @Date: 2025-01-08 10:31:49
* @LastEditors: 前端 qianduan01@didihu.com.cn * @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 * @FilePath: \gl-tape\components\HomeFrame\components\Income\Dailog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="dailog-panel"> <view class="dailog-panel">
<view class="dailog-box" :style="{ width: width }"> <view class="dailog-box" :style="{ width: width }">
<view class="dailog-header flex"> <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="sprite-icon icon-income-count" v-else></view>
<view class="dailog-title">{{ title }}</view> <view class="dailog-title">{{ title }}</view>
<view class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view> <view class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view>
...@@ -79,6 +79,10 @@ export default { ...@@ -79,6 +79,10 @@ export default {
font-weight: 600; font-weight: 600;
margin-top: -4rpx; margin-top: -4rpx;
} }
.enlarge {
transform: scale(1.5);
margin-right: 30rpx;
}
.dailog-close { .dailog-close {
margin-left: auto; margin-left: auto;
text-align: right; 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 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-07 13:49:15 * @Date: 2025-01-07 13:49:15
* @LastEditors: 前端 qianduan01@didihu.com.cn * @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 * @FilePath: \gl-tape\components\HomeFrame\components\Income\History.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="history-box"> <view class="history-box">
<view class="chart-box"> <view class="chart-box">
<view class="chart-header"> <view class="chart-header">
<text class="year-text">2025年</text> <text class="year-text">{{ year }}年</text>
<view class="sprite-icon icon-tips-g"></view> <view class="sprite-icon icon-tips-g"></view>
<text>点击柱形图切换月份</text> <text>点击柱形图切换月份</text>
</view> </view>
...@@ -27,54 +27,52 @@ ...@@ -27,54 +27,52 @@
</view> </view>
<view class="income-box"> <view class="income-box">
<view class="income-header"> <view class="income-header">
<text>2024年8月收入</text> <text>{{ year }}年8月收入</text>
</view> </view>
<view class="income-tips"> <view class="income-tips">
<view class="sprite-icon icon-tips-b"></view> <view class="sprite-icon icon-tips-b"></view>
<text>以下未包括 个人所得税、社保等事项</text> <text>以下未包括 个人所得税、社保等事项</text>
</view> </view>
<view class="income-list"> <view class="income-list">
<view class="income-item" v-for="(item, index) in caseList" :key="index"> <view class="income-item" v-for="(item, index) in IncomeList" :key="index">
<view class="item-label" @click="handleShow(item)">{{ item.title }}</view> <view class="item-label" @click="handleShow(item)">{{ item.label }}</view>
<uni-icons type="help" size="18" color="#A2A2A8"></uni-icons> <uni-icons type="help" size="18" color="#A2A2A8" @click="clickTips(item)"></uni-icons>
<view class="item-price">{{ item.price }}</view> <view class="item-price">{{ salaryDetail[item.value] || 0 }}</view>
<view class="item-expand"></view> <view class="item-expand" @click="showDetail(item)" v-if="salaryDetail[item.value] && item.tabelTh"></view>
</view> </view>
</view> </view>
<view class="income-footer"> <view class="income-footer">
<view class="footer-label">当月收入</view> <view class="footer-label">当月收入</view>
<view class="footer-price"> <view class="footer-price">
<text>¥</text> <text>¥</text>
23,746.60 {{ salaryDetail.correctSalary }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<Tips @close="show = false" v-if="show"> <Detail @close="show = false" :show="show" :detail="detail" :tabelTh="detail.tabelTh" :tabelTr="detail.tabelTr"></Detail>
<view class="dailog-body" slot="content"> <Question @close="tipsShow = false" :show="tipsShow" :detail="tipsDetail"></Question>
<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>
</view> </view>
</template> </template>
<script> <script>
import Tips from './Dailog.vue' import Detail from './Detail'
import point from '@/mixin/point'
import Question from './Question.vue'
export default { export default {
mixins: [point],
components: { components: {
Tips Detail,
Question
}, },
data() { data() {
return { return {
title: '学习数据', title: '学习数据',
show: false, show: false,
tipsShow: false,
tipsDetail: {},
salaryDetail: {},
detail: {},
canvasList: [ canvasList: [
{ date: '1月', num: 0 }, { date: '1月', num: 0 },
{ date: '2月', num: 24 }, { date: '2月', num: 24 },
...@@ -82,53 +80,18 @@ export default { ...@@ -82,53 +80,18 @@ export default {
{ date: '4月', num: 45 }, { date: '4月', num: 45 },
{ date: '5月', num: 15 }, { date: '5月', num: 15 },
{ date: '6月', num: 54 }, { date: '6月', num: 54 },
{ date: '7月', num: 10 }, { date: '7月', num: 0 },
{ date: '8月', num: 10 }, { date: '8月', num: 0 },
{ date: '9月', num: 10 }, { date: '9月', num: 0 },
{ date: '10月', num: 10 }, { date: '10月', num: 0 },
{ date: '11月', num: 10 }, { date: '11月', num: 0 },
{ date: '12月', num: 10 } { date: '12月', num: 0 }
],
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
}
], ],
width: 600, width: 600,
height: 420, height: 420,
canPersent: [], //百分比数组 canPersent: [], //百分比数组
listIndex: 0, listIndex: 0
navList: ['最近七天', '最近七个月']
} }
}, },
mounted() { mounted() {
...@@ -138,21 +101,102 @@ export default { ...@@ -138,21 +101,102 @@ export default {
.boundingClientRect(data => { .boundingClientRect(data => {
this.width = data.width this.width = data.width
this.height = data.height - 60 this.height = data.height - 60
this.showChart() // this.showChart()
}) })
.exec() .exec()
}, },
methods: { methods: {
handleShow(item) { getDetail(date) {
this.selectItem = item 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 this.show = true
}, },
back() {}, /**
* 点击柱状图时的回调函数
* @param {Object} e - 点击事件对象
*/
handleCanvasClick(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') const ctx = uni.createCanvasContext('DataCanvas')
ctx.lineWidth = 1 ctx.lineWidth = 1
// 横坐标 // 横坐标
...@@ -192,18 +236,22 @@ export default { ...@@ -192,18 +236,22 @@ export default {
console.log('--gap----->', gap) console.log('--gap----->', gap)
for (var i = 0; i < this.canPersent.length; i++) { 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) 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) { // if (this.canPersent[i] == 0) {
i++ // i++
ctx.fillText(this.canvasList[i].date, 30 + gap * i, this.height + 10) // 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) // this.canvasList[i].num && ctx.fillText(this.canvasList[i].num, 33 + gap * i, this.height - this.canPersent[i] - 15)
} // }
ctx.beginPath() 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.moveTo(40 + gap * i, this.height - this.canPersent[i] - 6)
ctx.lineTo(40 + gap * i, this.height - 6) ctx.lineTo(40 + gap * i, this.height - 6)
ctx.lineWidth = 10 ctx.lineWidth = 10
...@@ -328,9 +376,9 @@ export default { ...@@ -328,9 +376,9 @@ export default {
margin-left: 24rpx; margin-left: 24rpx;
width: 0; width: 0;
height: 0; height: 0;
border-left: 14rpx solid transparent; border-left: 10rpx solid #808291;
border-right: 14rpx solid transparent; border-bottom: 10rpx solid transparent;
border-top: 14rpx solid #808291; /* 箭头颜色 */ 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> <template>
<view class="calendar-container"> <view class="calendar-container">
<view class="nav-bar"> <view class="nav-bar">
...@@ -11,7 +19,9 @@ ...@@ -11,7 +19,9 @@
</template> </template>
<script> <script>
import point from '@/mixin/point'
export default { export default {
mixins: [point],
data() { data() {
return {} 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 * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-08 09:51:43 * @Date: 2025-01-08 10:31:49
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-08 10:31:05 * @LastEditTime: 2025-01-10 17:47:07
* @FilePath: \gl-tape\components\HomeFrame\components\Income\Tips.vue * @FilePath: \gl-tape\components\HomeFrame\components\Income\Dailog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<view class="dailog-panel"> <view class="dailog-panel">
<view class="dailog-box"> <view class="dailog-box" :style="{ width: width }">
<view class="dailog-header"> <view class="dailog-header flex">
<view class="dailog-title">{{ selectItem.title }}</view> <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 class="dailog-close" @click="close"><uni-icons type="closeempty" size="20"></uni-icons></view>
</view> </view>
<view class="dailog-content">{{ selectItem.content }}</view> <slot name="content" />
<view class="dailog-desc">{{ selectItem.desc }}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
width: {
type: String,
default: '1040rpx'
},
title: String
},
data() { data() {
return { return {}
show: '',
selectItem: {
title: '权益提成',
content: '权益提成 = 权益产值 × 提成系数 × 提成比例',
desc: '提成比例'
}
}
}, },
methods: { methods: {
close() { close() {
...@@ -46,11 +46,11 @@ export default { ...@@ -46,11 +46,11 @@ export default {
height: 100vh; height: 100vh;
inset: 0; inset: 0;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
.dailog-box { .dailog-box {
position: fixed; position: fixed;
left: 50%; left: 50%;
top: 50%; top: 50%;
width: 1040rpx;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
background: #fff; background: #fff;
background-image: linear-gradient(179deg, #d6e9ff 12%, #ffffff 100%); /* 顶部渐变和底部白色 */ background-image: linear-gradient(179deg, #d6e9ff 12%, #ffffff 100%); /* 顶部渐变和底部白色 */
...@@ -62,12 +62,16 @@ export default { ...@@ -62,12 +62,16 @@ export default {
border-radius: 48rpx; border-radius: 48rpx;
padding-bottom: 96rpx; padding-bottom: 96rpx;
.dailog-header { .dailog-header {
display: flex;
padding: 40rpx 48rpx; padding: 40rpx 48rpx;
.dailog-title { .dailog-title {
font-size: 40rpx; font-size: 40rpx;
color: #1a1a1a; color: #1a1a1a;
font-weight: 600; font-weight: 600;
margin-top: -10rpx;
}
.enlarge {
transform: scale(1.5);
margin-right: 30rpx;
} }
.dailog-close { .dailog-close {
margin-left: auto; margin-left: auto;
...@@ -78,21 +82,6 @@ export default { ...@@ -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 { .dailog-logo {
text-align: center; text-align: center;
image { image {
......
<template> <template>
<view class="income-container"> <view class="income-container" @click="handleTouch">
<view class="income-header"> <template v-if="isShow">
<view class="level-box"> <view class="income-header">
<view class="sprite-icon icon-zj-icon"></view> <view class="level-box" @click="jump('Promotion')">
<view class="level-label">职级</view> <view class="sprite-icon icon-zj-icon"></view>
<view class="level-desc">初级驻店</view> <view class="level-label">职级</view>
<view class="sprite-icon icon-js-icon"></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>
<view class="time-box"> <view class="footer-box flex-center">
<view class="sprite-icon icon-work-icon"></view> <view class="sprite-icon icon-tips-b"></view>
<view class="level-label">本月出勤</view> 最终的交付数以厂家提供的交付数为准,个人填写的交付数仅为工资测算参考。
<view class="time-day">22/27</view>
<view class="time-go"></view>
</view> </view>
</view> <view class="income-body" v-if="incomeDetail.merchants.length">
<view class="footer-box flex-center"> <view class="income-store">
<view class="sprite-icon icon-tips-b"></view> <My-Store :merchants="incomeDetail.merchants"></My-Store>
最终的交付数以厂家提供的交付数为准,个人填写的交付数仅为工资测算参考。 </view>
</view> <view class="income-item">
<view class="income-body"> <Day-Tips :merchants="incomeDetail.merchants"></Day-Tips>
<view class="income-store"> </view>
<My-Store></My-Store>
</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>
</view> </view>
<Password v-if="showPassword" @close="showPassword = false"></Password>
</view> </view>
</template> </template>
...@@ -38,17 +52,82 @@ export default { ...@@ -38,17 +52,82 @@ export default {
components: { DayTips, Password, MyStore }, components: { DayTips, Password, MyStore },
data() { data() {
return { 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'], inject: ['hideFooter', 'showPage'],
mounted() { async mounted() {
this.hideFooter(false) 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() { destroyed() {
this.hideFooter(true) 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> </script>
...@@ -116,7 +195,7 @@ export default { ...@@ -116,7 +195,7 @@ export default {
} }
.income-body { .income-body {
display: grid; display: grid;
grid-template-columns: 66% 34%; grid-template-columns: 68% 32%;
column-gap: 48rpx; column-gap: 48rpx;
height: calc(100vh - 260rpx); height: calc(100vh - 260rpx);
width: calc(100% - 110rpx); width: calc(100% - 110rpx);
...@@ -136,4 +215,66 @@ export default { ...@@ -136,4 +215,66 @@ export default {
border-radius: 48rpx; 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> </style>
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
icon: "record", icon: "record",
}, },
{ {
label: "积分权益", label: "个人中心",
icon: "point", icon: "point",
}, },
], ],
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="tab-box"> <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 @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view>
</view> </view>
<component :is="tabName"></component> <component :is="tabName" @selectTab="selectTab"></component>
</view> </view>
</template> </template>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-08 11:30:30 * @Date: 2024-04-08 11:30:30
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-09 10:38:48 * @LastEditTime: 2025-01-10 15:54:24
--> -->
<template> <template>
<view class="point-box"> <view class="point-box">
...@@ -12,21 +12,21 @@ ...@@ -12,21 +12,21 @@
<uni-icons type="left" :size="20" color="#000"></uni-icons> <uni-icons type="left" :size="20" color="#000"></uni-icons>
</view> </view>
<view v-if="isHigh" class="title"><text>兑换券介绍</text></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="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"> <view class="tab-icon">
<uni-icons type="left" size="20"></uni-icons> <uni-icons type="left" size="16"></uni-icons>
</view> </view>
</view> </view>
<view class="tab-mid">{{ month == currentMonth ? '本' : (month + '').padStart(2, '0') }}月</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-next" v-if="month != currentMonth" @click="nextTab">
<view class="tab-icon"> <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> --> </view>
</view> </view>
<view class="point-body"> <view class="point-body">
<view class="level-box"> <view class="level-box">
...@@ -109,9 +109,15 @@ export default { ...@@ -109,9 +109,15 @@ export default {
this.isHigh = isHigh this.isHigh = isHigh
}, },
methods: { methods: {
getDetail() { getDetail(countDate) {
this.getRule(1) this.getRule(1)
this.getRule(2) this.getRule(2)
this.getBadgeList(countDate)
},
getBadgeList(countDate) {
uni.$api.pointApi.badgeList({ countDate }).then(res => {
this.badgeList = res.map(item => item.medalType)
})
}, },
getRule(levelType) { getRule(levelType) {
uni.$api.pointApi.rewardRule({ levelType }).then(res => { uni.$api.pointApi.rewardRule({ levelType }).then(res => {
...@@ -131,7 +137,7 @@ export default { ...@@ -131,7 +137,7 @@ export default {
}) })
}, },
updateDetail(countDate) { updateDetail(countDate) {
this.getDetail(countDate) this.getBadgeList(countDate)
} }
} }
} }
......
export default { export default {
data() { data() {
return { 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: '', year: '',
month: '', month: '',
currentMonth: '' currentMonth: '',
date: ''
} }
}, },
mounted() { mounted() {
...@@ -12,8 +175,10 @@ export default { ...@@ -12,8 +175,10 @@ export default {
const day = new Date().getDate() const day = new Date().getDate()
this.year = year this.year = year
this.month = month this.month = month
this.day = day
this.currentMonth = month this.currentMonth = month
this.getDetail && this.getDetail(`${this.year}-${this.month}`, day) this.getDetail && this.getDetail(`${this.year}-${this.month}`, day)
this.date = `${this.year}-${this.month}-${day}`
}, },
methods: { methods: {
back() { back() {
......
<template> <template>
<view class="layout"> <view class="layout">
<template v-if="views.length>1">
<view class="tabs-box">
<tabs
:list="views"
@tabclick="changeTab"
></tabs>
</view>
</template>
<wnCanvas <wnCanvas
:drawStatus="penSwitch" :drawStatus="penSwitch"
:canvasId="`c-${madiaId}`" :canvasId="`c-${madiaId}`"
...@@ -17,15 +9,28 @@ ...@@ -17,15 +9,28 @@
> >
<template slot="customContent"> <template slot="customContent">
<view class="layout-content"> <view class="layout-content">
<view class="title">{{title}}</view> <page-title
<image :title="title"
:class="['content',modeName]" :hasCarBrand="hasCarBrand"
:src="views[viewIndex].detailUrl" :show="show"
/>
<image
:class="['bg',modeName]"
:src="views[viewIndex].bgUrl"
/> />
<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> </view>
</template> </template>
</wnCanvas> </wnCanvas>
...@@ -33,42 +38,35 @@ ...@@ -33,42 +38,35 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import Tabs from './Tabs.vue' import PageTitle from './PageTitle.vue'
export default { export default {
props: { props: {
views: Array, views: [Array, Object],
penSwitch: Boolean, penSwitch: Boolean,
title: String, title: String,
madiaId: Number, madiaId: Number,
isByd: Boolean isByd: Boolean,
show: Boolean,
hasCarBrand: Boolean
}, },
components: { components: {
Tabs PageTitle
}, },
name: 'MediaComponent', name: 'MediaComponent',
data () { data () {
return { return {
viewIndex: 0,
modeName: ''
} }
}, },
watch: { watch: {
}, },
computed: { computed: {
customerInfo () {
return this.$store.state.user.customerInfo
},
}, },
mounted () { mounted () {
}, },
methods: { 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> </script>
...@@ -82,19 +80,6 @@ export default { ...@@ -82,19 +80,6 @@ export default {
position: relative; position: relative;
margin: $margin; 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 { .content {
position: absolute; position: absolute;
width: 100%; width: 100%;
...@@ -108,35 +93,5 @@ export default { ...@@ -108,35 +93,5 @@ export default {
left: 0; left: 0;
top: 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> </style>
\ No newline at end of file \ 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 \ No newline at end of file
<template> <template>
<view :class="['layout',`${isByd?'byd-layout':'aito-layout'}`]"> <view :class="['layout',`${isByd?'byd-layout':''}`]">
<wnCanvas <wnCanvas
saveImageType="3" saveImageType="3"
canvasId="c-1" canvasId="c-1"
...@@ -9,9 +9,8 @@ ...@@ -9,9 +9,8 @@
> >
<template slot="customContent"> <template slot="customContent">
<view class="layout-content"> <view class="layout-content">
<view class="title"> <view class="title flex">
<view :class="['sprite-icon',`${isByd?'icon-byd':'icon-aito'}`]"></view> {{title}}
<view class="text">{{title}}</view>
</view> </view>
<view class="content"> <view class="content">
<view <view
...@@ -61,22 +60,18 @@ ...@@ -61,22 +60,18 @@
</template> </template>
</view> </view>
</view> </view>
<view class="views-box"> <template v-if="isByd">
<template v-for="(i,index) in views"> <image
<view class="content-image"
:key="index" :src="views[0].detailUrl"
class="item" />
:style="i.style" </template>
> <template v-else>
<image <image
:src="i.detailUrl" class="content-image"
class="img" :src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')"
:style="i.imgStyle" />
/> </template>
</view>
</template>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -98,7 +93,7 @@ export default { ...@@ -98,7 +93,7 @@ export default {
penSwitch: Boolean, penSwitch: Boolean,
show: Boolean, show: Boolean,
title: String, title: String,
views: Array, views: [Array, Object],
isByd: Boolean, isByd: Boolean,
}, },
name: 'Reception', name: 'Reception',
...@@ -161,6 +156,7 @@ export default { ...@@ -161,6 +156,7 @@ export default {
} else { } else {
this.$refs.carBrandListVisible.close() this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
this.customerInfo.carModelId = item.id
} }
this.resetFocusIndex() this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
...@@ -193,7 +189,7 @@ export default { ...@@ -193,7 +189,7 @@ export default {
.layout { .layout {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url('@/assets/images/media/reception-bg.webp');
background-size: 100%; background-size: 100%;
&-content { &-content {
position: relative; position: relative;
...@@ -201,29 +197,33 @@ export default { ...@@ -201,29 +197,33 @@ export default {
margin: $margin; margin: $margin;
} }
.title { .title {
padding: toRpx(160) 0 toRpx(32) toRpx(110); position: fixed;
.sprite-icon { left: 0;
margin-bottom: toRpx(24); top: toRpx(48);
} width: 100%;
.text { justify-content: center;
line-height: toRpx(112); z-index: 2;
font-weight: 700; height: toRpx(96);
font-size: toRpx(80); align-items: center;
color: #333333; font-weight: 500;
} font-size: toRpx(36);
color: #1a1a1a;
} }
.content { .content {
.form-box { .form-box {
height: toRpx(80); height: toRpx(80);
padding: 0 toRpx(110); padding: 0 toRpx(110);
position: relative; z-index: 2;
z-index: 1; position: absolute;
left: toRpx(64);
top: toRpx(168);
padding: 0;
.form { .form {
display: flex; display: flex;
gap: 0 toRpx(28); gap: 0 toRpx(28);
height: 100%; height: 100%;
&-item { &-item {
width: toRpx(368); width: toRpx(524);
height: 100%; height: 100%;
position: relative; position: relative;
...@@ -278,64 +278,25 @@ export default { ...@@ -278,64 +278,25 @@ export default {
} }
} }
} }
.views-box { &-image {
display: flex; position: absolute;
gap: 0 toRpx(48); width: 100%;
padding: 0 toRpx(72); height: 100%;
justify-content: center; z-index: 1;
margin-top: toRpx(92); }
.item { .bg {
height: toRpx(944); width: 100vw;
position: relative; height: 100vh;
.img { position: fixed;
position: absolute; left: 0;
top: 50%; top: 0;
left: 50%;
transform: translate(-50%, -50%);
aspect-ratio: 1/1;
height: toRpx(1020);
}
}
} }
} }
} }
.byd-layout { .byd-layout {
background-image: url('@/assets/images/media/byd-reception-bg.webp') !important; 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 { .aito-layout {
.title { background-image: url('@/assets/images/media/reception-bg.webp');
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%;
}
}
}
}
} }
</style> </style>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<template slot="customContent"> <template slot="customContent">
<view class="layout-content"> <view class="layout-content">
<view class="title">{{title}}</view> <view class="title flex">{{title}}</view>
<view class="container"> <view class="container">
<view class="left-tab"> <view class="left-tab">
<view <view
...@@ -155,14 +155,14 @@ export default { ...@@ -155,14 +155,14 @@ export default {
position: relative; position: relative;
} }
.title { .title {
justify-content: center;
position: absolute; position: absolute;
height: toRpx(96);
left: 0; left: 0;
top: toRpx(112); top: toRpx(48);
font-weight: 700; font-weight: 500;
font-size: toRpx(48); font-size: toRpx(36);
color: #1a1a1a; color: #333;
letter-spacing: toRpx(4);
line-height: toRpx(64);
text-align: center; text-align: center;
width: 100%; width: 100%;
z-index: 2; z-index: 2;
......
...@@ -6,28 +6,85 @@ ...@@ -6,28 +6,85 @@
* @LastEditTime: 2024-12-25 18:52:46 * @LastEditTime: 2024-12-25 18:52:46
--> -->
<template> <template>
<view class="detail-box" @dblclick="dbClick"> <view
<view class="nav-bar" :style="{ 'z-index': backZindex }"> class="detail-box"
<view class="back" @click="back"> @dblclick="dbClick"
<uni-icons type="left" :size="20" color="#000"></uni-icons> >
<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>
</view> </view>
<template v-for="(item, index) in media"> <template v-for="(item, index) in media">
<view :class="['view', { showView: id == item.id }, modeName]" :key="index" @touchstart.stop="touchStart" @touchend.stop="touchEnd"> <view
<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" /> :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> </view>
</template> </template>
<template v-if="type != 'preview'"> <template v-if="type != 'preview'">
<template v-if="backZindex"> <template v-if="backZindex">
<tool-box ref="toolRef" :data="toolList" :type="type" @choose="choose" @finish="open" :id="id" @toPay="toPay" :showPayBtn="watchPayInfo" /> <tool-box
<view class="pen-box" @click="drawStatus = !drawStatus"> 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 :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"></view>
</view> </view>
</template> </template>
</template> </template>
<pay-pop ref="pay" @jumpPay="showPayPage = true"></pay-pop> <pay-pop
<finish-step ref="stepRef" @submit="done" :titleTips="finishTips" /> ref="pay"
<informationEntry :showPayPage.sync="showPayPage" @finish="open" /> @jumpPay="showPayPage = true"
></pay-pop>
<finish-step
ref="stepRef"
@submit="done"
:titleTips="finishTips"
/>
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
</view> </view>
</template> </template>
<script> <script>
...@@ -65,10 +122,11 @@ export default { ...@@ -65,10 +122,11 @@ export default {
type: String, type: String,
default: 'preview' default: 'preview'
}, },
toolList: Array toolList: Array,
aitoCarModelIds: Array
}, },
mixins: [receptionTrackMixin], mixins: [receptionTrackMixin],
data() { data () {
return { return {
backZindex: 9, backZindex: 9,
drawStatus: false, drawStatus: false,
...@@ -78,60 +136,83 @@ export default { ...@@ -78,60 +136,83 @@ export default {
scaleValueObject: {}, scaleValueObject: {},
showPayPage: false, showPayPage: false,
productModelStatus: false, productModelStatus: false,
modeName: '' modeName: '',
pageToolList: []
} }
}, },
computed: { computed: {
watchStatus() { channelType () {
const { channelType } = uni.$storage.get('userInfo')
return channelType
},
watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
penSwitch() { penSwitch () {
return !this.isPreview && this.drawStatus return !this.isPreview && this.drawStatus
}, },
watchPayInfo() { watchPayInfo () {
return this.$store.state.user.paymentType.length ? true : false return this.$store.state.user.paymentType.length ? true : false
}, },
title() { title () {
let { id } = this, let { id } = this,
name = this.media.find(e => e.id == id)?.detailTitle || '' name = this.media.find(e => e.id == id)?.detailTitle || ''
return name return name
}, },
finishTips() { finishTips () {
const { channelType } = uni.$storage.get('userInfo')
let text = '' let text = ''
if (channelType == 3) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。' if (this.channelType == 3) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
return text return text
}, },
isByd() { isByd () {
const { channelType } = uni.$storage.get('userInfo') return this.channelType == 2
return channelType == 2
}, },
isPreview() { isPreview () {
return this.type == 'preview' return this.type == 'preview'
} },
CarModelId () {
return this.$store.state.user.customerInfo.carModelId
},
}, },
watch: { watch: {
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler(newval) { handler (newval) {
if (newval) this.drawStatus = false 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() const systemInfo = uni.getSystemInfoSync()
this.screenWidth = systemInfo.screenWidth this.screenWidth = systemInfo.screenWidth
}, },
methods: { methods: {
...mapMutations('audio', ['setReceptionStatus']), ...mapMutations('audio', ['setReceptionStatus']),
open() { open () {
this.$refs.stepRef.open() this.$refs.stepRef.open()
}, },
handleFull(val) { handleFull (val) {
this.backZindex = val ? 0 : 9 this.backZindex = val ? 0 : 9
}, },
/**切换素材 */ /**切换素材 */
choose(e) { choose (e) {
Object.keys(this.$refs).map(refKey => { Object.keys(this.$refs).map(refKey => {
let ref = this.$refs[refKey] let ref = this.$refs[refKey]
if (ref) { if (ref) {
...@@ -143,42 +224,42 @@ export default { ...@@ -143,42 +224,42 @@ export default {
this.$emit('update:id', e.id) this.$emit('update:id', e.id)
uni.$logger.local.info(`预览${e.title}`) uni.$logger.local.info(`预览${e.title}`)
}, },
back() { back () {
this.$refs?.toolRef?.hide() this.$refs?.toolRef?.hide()
this.$emit('back') this.$emit('back')
}, },
done(e) { done (e) {
this.showPayPage = false this.showPayPage = false
this.$refs.toolRef.hide() this.$refs.toolRef.hide()
this.$refs.stepRef.close() this.$refs.stepRef.close()
this.receptionTrackLeave() this.receptionTrackLeave()
this.$emit('done', e) this.$emit('done', e)
}, },
toPay() { toPay () {
this.$refs.pay.show() this.$refs.pay.show()
}, },
dbClick() { dbClick () {
if (!this.isPreview) this.drawStatus = !this.drawStatus if (!this.isPreview) this.drawStatus = !this.drawStatus
}, },
touchStart(e) { touchStart (e) {
if (!this.drawStatus && e.changedTouches?.length) { if (!this.drawStatus && e.changedTouches?.length) {
this.startX = e.changedTouches[0].pageX this.startX = e.changedTouches[0].pageX
this.startY = e.changedTouches[0].pageY this.startY = e.changedTouches[0].pageY
} }
}, },
touchEnd(e) { touchEnd (e) {
if (this.modeName) return if (this.modeName) return
try { try {
let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this let { pageToolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this
if (!e || !e.changedTouches || drawStatus || toolList.length == 0 || e.changedTouches.length === 0) return if (!e || !e.changedTouches || drawStatus || pageToolList.length == 0 || e.changedTouches.length === 0) return
let halfScreenWidth = screenWidth / 2, let halfScreenWidth = screenWidth / 2,
touch = e.changedTouches[0], touch = e.changedTouches[0],
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3, isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 6,
index = toolList.findIndex(item => item.id == id) index = pageToolList.findIndex(item => item.id == id)
if (Math.abs(this.startY - touch.pageY) > 100) return if (Math.abs(this.startY - touch.pageY) > 150) return
if (!scaleValueObject[id]) scaleValueObject[id] = 1 if (!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1 && !productModelStatus) { 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.modeName = modeName
this.receptionTrackLeave() this.receptionTrackLeave()
this.$emit('update:id', nextId) this.$emit('update:id', nextId)
...@@ -191,14 +272,14 @@ export default { ...@@ -191,14 +272,14 @@ export default {
console.log(error) console.log(error)
} }
}, },
getNextId(index, toolList, startX, halfScreenWidth) { getNextId (index, pageToolList, startX, halfScreenWidth) {
let nextItem = {}, let nextItem = {},
modeName = '' modeName = ''
if (startX > halfScreenWidth) { 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' modeName = 'to-right'
} else { } else {
nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1] nextItem = index === 0 ? pageToolList[pageToolList.length - 1] : pageToolList[index - 1]
modeName = 'to-left' modeName = 'to-left'
} }
return { return {
...@@ -207,7 +288,7 @@ export default { ...@@ -207,7 +288,7 @@ export default {
title: nextItem.title title: nextItem.title
} }
}, },
scale(e) { scale (e) {
let { id } = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
} }
...@@ -228,12 +309,14 @@ export default { ...@@ -228,12 +309,14 @@ export default {
left: 0; left: 0;
top: toRpx(48); top: toRpx(48);
z-index: 9; z-index: 9;
pointer-events: none;
.back { .back {
height: 100%; height: 100%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
pointer-events: auto;
} }
} }
.pen-box { .pen-box {
......
<template> <template>
<view> <view>
<home-frame @preview="preview" @start="start" ref="home" :id="id" @openStep="openStep" @backHome="backHome" @changeTab="changeTab"> <home-frame
<view class="module-box" slot="module"> @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"> <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"> <template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view> <view class="item-text flex">{{ i.title }}</view>
</template> </template>
<template v-else> <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> </template>
</view> </view>
</template> </template>
</view> </view>
<template slot="detail"> <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>
<template slot="content"> <template slot="content">
<!-- <novice-guide <!-- <novice-guide
...@@ -42,7 +73,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue' ...@@ -42,7 +73,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue'
export default { export default {
// mixins: [storge], // mixins: [storge],
components: { HomeFrame, detail, NoviceGuide }, components: { HomeFrame, detail, NoviceGuide },
data() { data () {
return { return {
moduleList: [], moduleList: [],
toolList: [], toolList: [],
...@@ -50,16 +81,17 @@ export default { ...@@ -50,16 +81,17 @@ export default {
type: '', type: '',
chooseItem: {}, chooseItem: {},
tabIndex: 0, tabIndex: 0,
recording: false recording: false,
aitoCarModelIds:[]
} }
}, },
computed: { computed: {
channelType() { channelType () {
const { channelType } = uni.$storage.get('userInfo') const { channelType } = uni.$storage.get('userInfo')
return channelType || 1 //默认问界 return channelType || 1 //默认问界
} }
}, },
onBackPress(options) { onBackPress (options) {
if (options.from === 'backbutton') { if (options.from === 'backbutton') {
// 物理返回按钮触发 // 物理返回按钮触发
// 阻止默认行为,即不执行页面返回 // 阻止默认行为,即不执行页面返回
...@@ -69,12 +101,12 @@ export default { ...@@ -69,12 +101,12 @@ export default {
// 其他情况允许正常返回 // 其他情况允许正常返回
return false return false
}, },
onLoad() { onLoad () {
this.setViewInfo() this.setViewInfo()
this.getSoure() this.getSoure()
this.get_Vehicle_Sales_Data() this.get_Vehicle_Sales_Data()
}, },
onShow() { onShow () {
const userInfo = uni.$storage.get('userInfo') const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) { if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo') uni.$storage.rm('userInfo')
...@@ -88,11 +120,11 @@ export default { ...@@ -88,11 +120,11 @@ export default {
}, },
methods: { methods: {
...mapMutations('audio', ['setReceptionStatus']), ...mapMutations('audio', ['setReceptionStatus']),
init() { init () {
this.findPayInfo() this.findPayInfo()
}, },
/**获取车型&销售数据 */ /**获取车型&销售数据 */
get_Vehicle_Sales_Data() { get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get('userInfo'), const userInfo = uni.$storage.get('userInfo'),
storageCarBrandList = uni.$storage.get('carBrandList'), storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'), storageEmployeeList = uni.$storage.get('employeeList'),
...@@ -128,7 +160,7 @@ export default { ...@@ -128,7 +160,7 @@ export default {
}, },
// 查询素材 // 查询素材
// 查询素材 // 查询素材
async getSoure() { async getSoure () {
/**比亚迪 */ /**比亚迪 */
if (this.channelType == 2) { if (this.channelType == 2) {
let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true) let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true)
...@@ -177,7 +209,7 @@ export default { ...@@ -177,7 +209,7 @@ export default {
) )
this.setViewInfo(moduleList, toolList) this.setViewInfo(moduleList, toolList)
} else { } 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) { if (this.channelType == 3) {
let configList let configList
try { try {
...@@ -217,14 +249,19 @@ export default { ...@@ -217,14 +249,19 @@ export default {
) )
this.setViewInfo(default_moduleList, default_toolList) this.setViewInfo(default_moduleList, default_toolList)
} else { } else {
this.aitoCarModelIds = aitoCarModelIds
/**默认问界 */ /**默认问界 */
moduleList = await Promise.all( moduleList = await Promise.all(
moduleList.map(async e => ({ moduleList.map(async e => {
...e, const receptionSourceDetailListType = Array.isArray(e.receptionSourceDetailList)
receptionSourceDetailList: e.receptionSourceDetailList ? await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl') : undefined, return {
carTypeList: e.carTypeList ? await uni.$api.systemApi.imgToBase64(e.carTypeList, 'url') : undefined, ...e,
screenList: e.screenList ? await uni.$api.systemApi.imgToBase64(e.screenList, 'url') : undefined 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') toolList = await uni.$api.systemApi.imgToBase64(toolList, 'shortTitleUrl')
uni.$api.systemApi.updateMockData( uni.$api.systemApi.updateMockData(
...@@ -240,11 +277,11 @@ export default { ...@@ -240,11 +277,11 @@ export default {
} }
} }
}, },
errorImg(index) { errorImg (index) {
this.moduleList[index].showAlt = true this.moduleList[index].showAlt = true
}, },
async start() { async start () {
if (this.recording) return if (this.recording) return
uni.showLoading({ uni.showLoading({
mask: true mask: true
...@@ -267,14 +304,14 @@ export default { ...@@ -267,14 +304,14 @@ export default {
uni.hideLoading() uni.hideLoading()
}, 1e3) }, 1e3)
}, },
toDetail(item) { toDetail (item) {
this.chooseItem = item this.chooseItem = item
this.$refs.home.previewRef.open() this.$refs.home.previewRef.open()
}, },
cancel() { cancel () {
this.$refs.home.previewRef.close() this.$refs.home.previewRef.close()
}, },
preview() { preview () {
let { id, title } = this.chooseItem let { id, title } = this.chooseItem
this.type = 'preview' this.type = 'preview'
this.id = id this.id = id
...@@ -282,7 +319,7 @@ export default { ...@@ -282,7 +319,7 @@ export default {
this.cancel() this.cancel()
}, },
// 完成接待 // 完成接待
done(e) { done (e) {
this.$refs.home.finishRef.close() this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio() if (this.recording) this.$refs.home.stopAudio()
this.recording = false this.recording = false
...@@ -294,14 +331,14 @@ export default { ...@@ -294,14 +331,14 @@ export default {
this.$store.dispatch('clearReceptionTrack') this.$store.dispatch('clearReceptionTrack')
}, 1500) }, 1500)
}, },
back() { back () {
const detailRef = this.$refs.detail const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false) if (detailRef.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack() if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open() if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome() this.backHome()
}, },
backHome() { backHome () {
if (this.recording) this.$refs.home.stopAudio(true) if (this.recording) this.$refs.home.stopAudio(true)
this.$refs.home.finishRef.close() this.$refs.home.finishRef.close()
this.id = '' this.id = ''
...@@ -310,23 +347,23 @@ export default { ...@@ -310,23 +347,23 @@ export default {
this.init() this.init()
this.recording = false this.recording = false
}, },
nextStep() { nextStep () {
let { id } = this.moduleList[0] let { id } = this.moduleList[0]
this.type = 'preview' this.type = 'preview'
this.id = id this.id = id
}, },
clearHistory() { clearHistory () {
this.$store.dispatch('clearCustomerInfo') this.$store.dispatch('clearCustomerInfo')
this.$store.dispatch('clearHistory') this.$store.dispatch('clearHistory')
this.$refs.home.setBooks([]) this.$refs.home.setBooks([])
this.$store.dispatch('clearReceptionTrack') this.$store.dispatch('clearReceptionTrack')
}, },
openStep() { openStep () {
this.$refs.home.finishRef.close() this.$refs.home.finishRef.close()
this.$refs.detail.open() this.$refs.detail.open()
}, },
// 查询门店支付配置 // 查询门店支付配置
async findPayInfo() { async findPayInfo () {
const { shopMerchantId } = uni.$storage.get('userInfo') const { shopMerchantId } = uni.$storage.get('userInfo')
const data = await uni.$api.commonApi.findPayInfo({ const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId merchantId: shopMerchantId
...@@ -350,13 +387,13 @@ export default { ...@@ -350,13 +387,13 @@ export default {
}) })
this.$store.dispatch('setPaymentType', paymentType) this.$store.dispatch('setPaymentType', paymentType)
}, },
changeTab(index) { changeTab (index) {
this.tabIndex = index this.tabIndex = index
if (index == 0) this.init() if (index == 0) this.init()
}, },
/**按序加载车型 */ /**按序加载车型 */
async getCarBrandsList(carBrandList, index) { async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index] const item = carBrandList[index]
if (!item) return if (!item) return
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`) const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
...@@ -373,7 +410,7 @@ export default { ...@@ -373,7 +410,7 @@ export default {
} }
}, },
/**素材内容 */ /**素材内容 */
setViewInfo(_moduleList, _toolList) { setViewInfo (_moduleList, _toolList) {
if (_moduleList && _toolList) { if (_moduleList && _toolList) {
this.moduleList = _moduleList this.moduleList = _moduleList
this.toolList = _toolList this.toolList = _toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!