Commit e0e2e4aa by 李伟康

commit 加载新素材回到顶部

1 parent 3f422606
......@@ -88,10 +88,10 @@ export default {
}
.canvas-box {
.left {
animation: show-view-left 0.15s forwards;
animation: show-view-left 0.15s;
}
.right{
animation: show-view-right 0.15s forwards;
animation: show-view-right 0.15s;
}
}
}
......
......@@ -88,10 +88,10 @@ export default {
}
.canvas-box {
.left {
animation: show-view-left 0.15s forwards;
animation: show-view-left 0.15s;
}
.right{
animation: show-view-right 0.15s forwards;
animation: show-view-right 0.15s;
}
}
}
......
......@@ -6,35 +6,69 @@
* @LastEditTime: 2024-04-10 18:23:43
-->
<template>
<view class="detail-box" @click="handleTouchStart()">
<view
class="detail-box"
@click="handleTouchStart()"
>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="32"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="32"
></uni-icons>
</view>
</view>
<view :class="['view', { showView: id == 1 }]">
<media_1 :views="media[1]" :penSwitch="penSwitch" />
<media_1
:views="media[1]"
:penSwitch="penSwitch"
/>
</view>
<view :class="['view', { showView: id == 2 }]">
<media_2 :views="media[2]" :penSwitch="penSwitch" />
<media_2
:views="media[2]"
:penSwitch="penSwitch"
/>
</view>
<view :class="['view', { showView: id == 3 }]">
<media_3 :views="media[3]" :penSwitch="penSwitch" />
<media_3
:views="media[3]"
:penSwitch="penSwitch"
/>
</view>
<view :class="['view', { showView: id == 4 }]">
<media_4 :views="media[4]" :penSwitch="penSwitch" />
<media_4
:views="media[4]"
:penSwitch="penSwitch"
/>
</view>
<view :class="['view', { showView: id == 5 }]">
<media_5 :views="media[5]" :penSwitch="penSwitch" />
<media_5
:views="media[5]"
:penSwitch="penSwitch"
/>
</view>
<view :class="['view', { showView: id == 6 }]">
<media_6 ref="history" :show="id == 6" />
<media_6
ref="history"
:show="id == 6"
/>
</view>
<pay-pop ref="pay"></pay-pop>
<template v-if="type != 'preview'">
<tool-box :type="type" @choose="choose" @finish="open" />
<view class="pen-box" @click="drawStatus = !drawStatus">
<tool-box
:type="type"
@choose="choose"
@finish="open"
/>
<view
class="pen-box"
@click="drawStatus = !drawStatus"
>
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view>
</template>
......@@ -88,7 +122,7 @@ export default {
Media_6,
},
mixins: [myClick],
data() {
data () {
return {
type: "preview",
id: "",
......@@ -103,18 +137,18 @@ export default {
finishVisible: false,
};
},
computed:{
penSwitch(){
return this.type != 'preview' && this.drawStatus
computed: {
penSwitch () {
return this.type != 'preview' && this.drawStatus
}
},
onLoad(options) {
onLoad (options) {
console.log(options);
this.type = options.type;
this.id = options.id;
this.getFindSoureDetail(options.id);
},
onBackPress(options) {
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -124,40 +158,44 @@ export default {
// 其他情况允许正常返回
return false;
},
async onReachBottom() {
async onReachBottom () {
this.$refs.history.getQuotationList();
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
open() {
open () {
this.$refs.payRef.open();
},
/**切换素材 */
choose(e) {
choose (e) {
this.id = e.id;
this.getFindSoureDetail(e.id);
},
async getFindSoureDetail(id) {
async getFindSoureDetail (id) {
try {
if (id == 6) return;
if (!this.media[id].length)
if (!this.media[id].length) {
this.media[id] =
(await uni.$api.commonApi.getFindSoureDetail({ id })) || [];
uni.pageScrollTo({
scrollTop: 0
})
}
} catch (error) {
console.log(error);
}
},
// 完成接待
done() {
done () {
this.stopAudio();
uni.navigateBack();
this.setReceptionStatus(0);
},
// 选择付款方式
toPay() {
toPay () {
this.$refs.pay.show();
},
back() {
back () {
if (this.type != "preview") return this.$refs.finish.open();
this.$store.dispatch("clearCustomerInfo");
uni.navigateBack();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!