Commit 2d02aa7d by 前端

Merge branch 'v1.0.7' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.7

2 parents e24b1ac8 e346c639
......@@ -900,9 +900,10 @@ export default {
},
/**缩放 */
scale: utils.throttle(function (e) {
scale (e) {
this.scaleValue = e.scale
}, 200),
this.$emit('scale', e.scale)
}
}
}
</script>
......
......@@ -76,7 +76,6 @@ export default {
[this.startX, this.startY] = [e.touches[0].pageX, e.touches[0].pageY];
this.moveX = 0
this.moveY = 0
this.transformOriginStyle = `${this.startX}px ${this.startY}px`;
}
},
handleTouchMove: utils.throttle(function (e) {
......@@ -89,10 +88,12 @@ export default {
this.setScale(newScale, this.getTouchCenter(e.touches)); // 更新缩放同时更新中心点
this.lastTouchDistance = currentDistance;
} else if (this.isDragging && e.touches.length === 1 && this.scale !== 1) {
this.transformOriginStyle = `${this.startX}px ${this.startY}px`;
const newX = e.touches[0].pageX;
const newY = e.touches[0].pageY;
this.moveX = (newX - this.startX) / this.scale;
this.moveY = (newY - this.startY) / this.scale;
// 确保计算基于初始未缩放的触摸点,并考虑当前缩放比例
this.updatePosition();
}
}, 16),
......
......@@ -7,7 +7,7 @@
-->
<template>
<view class="layout" @click.prevent="touch">
<wnCanvas :drawStatus="penSwitch" :canvasId="`c-${madiaId}`" custom>
<wnCanvas :drawStatus="penSwitch" :canvasId="`c-${madiaId}`" custom @scale="$emit('scale',$event)">
<template slot="customContent">
<view class="title">{{ title }}</view>
<view class="container">
......
......@@ -4,6 +4,7 @@
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
@scale="$emit('scale',$event)"
>
<template slot="customContent">
<view class="title">{{title}}</view>
......
......@@ -5,6 +5,7 @@
canvasId="c-1"
:drawStatus="penSwitch"
custom
@scale="$emit('scale',$event)"
>
<template slot="customContent">
<view class="carType">
......@@ -147,7 +148,7 @@ export default {
return this.$store.state.user.historyStatus
},
carImg () {
let name = {
let name = {
'问界M5': 0,
'问界M7': 1,
'问界M9': 2
......@@ -159,7 +160,7 @@ export default {
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleSelect(item, popkey) {
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
......@@ -317,37 +318,37 @@ export default {
* animation slide-bl
* ----------------------------------------
*/
@-webkit-keyframes slide-bl {
@-webkit-keyframes slide-bl {
0% {
-webkit-transform: translateY(-100%) translateX(-100%);
transform: translateY(-100%) translateX(-100%);
opacity: 0.2;
filter: blur(0.5px);
transform: translateY(-100%) translateX(-100%);
opacity: 0.2;
filter: blur(0.5px);
}
100% {
-webkit-transform: translateY(0) translateX(0);
transform: translateY(0) translateX(0);
opacity: 1;
filter: blur(0);
transform: translateY(0) translateX(0);
opacity: 1;
filter: blur(0);
}
}
@keyframes slide-bl {
0% {
-webkit-transform: translateY(-100%) translateX(100%) scale(0.5);
transform: translateY(-100%) translateX(100%) scale(0.5);
opacity: 0.2;
filter: blur(0.5px);
-webkit-transform: translateY(-100%) translateX(100%) scale(0.5);
transform: translateY(-100%) translateX(100%) scale(0.5);
opacity: 0.2;
filter: blur(0.5px);
}
100% {
-webkit-transform: translateY(0) translateX(0);
transform: translateY(0) translateX(0);
opacity: 1;
filter: blur(0);
transform: translateY(0) translateX(0);
opacity: 1;
filter: blur(0);
}
}
.slide-bl {
-webkit-animation: slide-bl 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
animation: slide-bl 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
-webkit-animation: slide-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
animation: slide-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
</style>
......@@ -11,6 +11,7 @@
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
@scale="$emit('scale',$event)"
>
<template slot="customContent">
<view class="title">{{title}}</view>
......
......@@ -38,6 +38,7 @@
:title="item.detailTitle || ''"
:madiaId="item.id"
:carTypeList="item.carTypeList || []"
@scale="scale"
/>
</view>
</template>
......@@ -103,7 +104,8 @@ export default {
drawStatus: false,
startX: null,
startY: null,
screenWidth: null
screenWidth: null,
scaleValueObject: {}
};
},
computed: {
......@@ -174,14 +176,15 @@ export default {
},
touchEnd (e) {
try {
let { toolList, drawStatus, startX, screenWidth, id } = this
let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject } = this
if (!e || !e.changedTouches || drawStatus || toolList.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
if (isDistanceSignificant && index != -1) {
if (Math.abs(this.startY - touch.pageY) > 100) return
if(!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1) {
const nextId = this.getNextId(index, toolList, startX, halfScreenWidth)
this.$emit('update:id', nextId)
}
......@@ -195,6 +198,10 @@ export default {
} else {
return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id;
}
},
scale(e){
let {id} = this
this.scaleValueObject[id] = e
}
},
......
......@@ -81,6 +81,11 @@ export default {
// 其他情况允许正常返回
return false;
},
onLoad () {
const mock_data = uni.$storage.get('mock_data') || {}
this.moduleList = mock_data.moduleList || []
this.toolList = mock_data.toolList || []
},
onShow () {
const userInfo = uni.$storage.get("userInfo")
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
......@@ -148,7 +153,7 @@ export default {
},
// 查询素材
async getSoure () {
let { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
const { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
await moduleList.map(async e => {
if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!