Commit 140ce5a0 by 李伟康

commit 修复

1 parent c9c79915
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
}, },
computed: { computed: {
watchStatus () { watchStatus () {
return this.$store.state.user.canvasStatus return this.$store.state.user.historyStatus
}, },
}, },
mounted (opt) { mounted (opt) {
...@@ -330,8 +330,16 @@ export default { ...@@ -330,8 +330,16 @@ export default {
this.drawContext.draw(true); this.drawContext.draw(true);
}, },
// 绘制线条结束 // 绘制线条结束
lineEnd () { lineEnd (x, y) {
console.log(this.startX, this.startY) if (this.startX == x && this.startY == y && !this.lastX && !this.lastY) {
this.drawContext.beginPath()
this.drawContext.moveTo(this.startX - 1, this.startY - 1)
this.drawContext.lineTo(x + 1, y + 1);
this.drawContext.stroke();
this.drawContext.draw(true);
}
this.lastX = ''
this.lastY = ''
this.drawContext.closePath(); this.drawContext.closePath();
this.begin = false; this.begin = false;
}, },
...@@ -608,11 +616,11 @@ export default { ...@@ -608,11 +616,11 @@ export default {
// console.log("touch结束"); // console.log("touch结束");
switch (this.mode) { switch (this.mode) {
case "pen": case "pen":
this.lineEnd() this.lineEnd(x, y)
break; break;
case "eraser": case "eraser":
this.drawContext.setFillStyle(this.currentColor) this.drawContext.setFillStyle(this.currentColor)
this.lineEnd() this.lineEnd(x, y)
break; break;
case "rect": case "rect":
this.drawRect(x, y, true); this.drawRect(x, y, true);
......
...@@ -118,6 +118,7 @@ export default { ...@@ -118,6 +118,7 @@ export default {
this.setReasonType(0); this.setReasonType(0);
uni.$storage.set("storageFile", ""); uni.$storage.set("storageFile", "");
} catch (error) { } catch (error) {
this.$store.dispatch("clearCustomerInfo");
console.log(error) console.log(error)
} }
}, },
......
...@@ -163,6 +163,19 @@ export default { ...@@ -163,6 +163,19 @@ export default {
receptionStatus: -1, receptionStatus: -1,
} }
}, },
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
if (newval) this.receptionStatus = -1
}
},
},
mounted () { mounted () {
}, },
...@@ -181,6 +194,7 @@ export default { ...@@ -181,6 +194,7 @@ export default {
}, },
close () { close () {
this.errorTip = false this.errorTip = false
this.receptionStatus = -1
this.$refs.formRef.close() this.$refs.formRef.close()
}, },
// 保存 // 保存
......
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
}, },
computed: { computed: {
watchStatus () { watchStatus () {
return this.$store.state.user.canvasStatus return this.$store.state.user.historyStatus
}, },
penSwitch () { penSwitch () {
return this.type != 'preview' && this.drawStatus return this.type != 'preview' && this.drawStatus
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
</view> </view>
<view <view
class="footer-btn cancel flex" class="footer-btn cancel flex"
@click="done" @click="backHome"
> >
仍要退出<text>(不推荐)</text> 仍要退出<text>(不推荐)</text>
</view> </view>
...@@ -207,6 +207,7 @@ export default { ...@@ -207,6 +207,7 @@ export default {
return false; return false;
}, },
onShow () { onShow () {
this.getSoure(); this.getSoure();
}, },
async onReachBottom () { async onReachBottom () {
...@@ -231,6 +232,7 @@ export default { ...@@ -231,6 +232,7 @@ export default {
}); });
return; return;
} }
this.clearHistory()
this.startAudio(); this.startAudio();
this.id = this.moduleList[0].id; this.id = this.moduleList[0].id;
this.type = "edit"; this.type = "edit";
...@@ -256,6 +258,7 @@ export default { ...@@ -256,6 +258,7 @@ export default {
let { id } = this.chooseItem; let { id } = this.chooseItem;
this.type = "preview"; this.type = "preview";
this.id = id; this.id = id;
this.clearHistory()
this.$refs.previewRef.close(); this.$refs.previewRef.close();
}, },
// 完成接待 // 完成接待
...@@ -266,15 +269,18 @@ export default { ...@@ -266,15 +269,18 @@ export default {
setTimeout(() => { setTimeout(() => {
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.$store.dispatch("clearCanvas", true); this.$store.dispatch("clearHistory", true);
this.setReceptionStatus(e); this.setReceptionStatus(e);
}, 1500); }, 1500);
}, },
back () { back () {
if (!this.id) return uni.navigateBack(); if (!this.id) return uni.navigateBack();
if (this.type != "preview") return this.$refs.finish.open(); if (this.type != "preview") return this.$refs.finish.open();
this.$store.dispatch("clearCustomerInfo"); this.backHome()
this.$store.dispatch("clearCanvas", true); },
backHome () {
this.$refs.finish.close()
this.clearHistory()
this.id = ""; this.id = "";
this.type = ""; this.type = "";
}, },
...@@ -291,10 +297,9 @@ export default { ...@@ -291,10 +297,9 @@ export default {
this.type = "preview"; this.type = "preview";
this.id = id; this.id = id;
}, },
nextStep () { clearHistory(){
let { id } = this.moduleList[0] this.$store.dispatch("clearCustomerInfo");
this.type = 'preview' this.$store.dispatch("clearHistory", true);
this.id = id
}, },
openStep () { openStep () {
this.$refs.finish.close() this.$refs.finish.close()
......
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
this.stopAudio(); this.stopAudio();
this.infoList = INFO_LIST.map((item) => delete item.imgUrl); this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.redirectTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
}, 1500); }, 1500);
......
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
salesUuid: "", salesUuid: "",
staffName: "", staffName: "",
}, },
canvasStatus:false, historyStatus:false,
carBrands:[], carBrands:[],
employeeList:[], employeeList:[],
}; };
...@@ -51,8 +51,8 @@ export default { ...@@ -51,8 +51,8 @@ export default {
clearCustomerInfo({ commit }) { clearCustomerInfo({ commit }) {
commit("clearCustomerInfo"); commit("clearCustomerInfo");
}, },
clearCanvas({state}, value = false){ clearHistory({state}, value = false){
state.canvasStatus = value state.historyStatus = value
}, },
setCarBrandsList({state},value){ setCarBrandsList({state},value){
state.carBrands = value state.carBrands = value
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!