123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <div class="working-area">
- <img
- v-show="innerState === 0"
- class="helper-board"
- src="@/assets/images/helper-board.png"
- alt=""
- draggable="false"
- >
- <video
- v-show="innerState === 0 && workState === 'working'"
- ref="videoRef1"
- class="helper-board"
- src="@/assets/videos/step-4-1.mp4"
- playsinline
- webkit-playsinline="true"
- muted
- @ended="workState = 'init', innerState = 1"
- />
- <img
- v-show="innerState == 1 || innerState === 2"
- class="helper-board"
- src="@/assets/images/helper-board-middle.png"
- alt=""
- draggable="false"
- >
- <video
- v-show="(innerState === 1 && workState === 'working') || (innerState === 2)"
- ref="videoRef2"
- class="helper-board"
- src="@/assets/videos/step-4-2.mp4"
- playsinline
- webkit-playsinline="true"
- muted
- @ended="innerState = 2, videoRef3.play()"
- />
- <!-- <img
- v-show="innerState == 2"
- class="helper-board"
- src="@/assets/images/helper-board-done.png"
- alt=""
- draggable="false"
- > -->
- <img
- class="rubber-board-init"
- src="@/assets/images/step-4-init.png"
- alt=""
- draggable="false"
- >
- <video
- ref="videoRef3"
- class="rubber-board"
- src="@/assets/videos/step-4-3.mp4"
- playsinline
- webkit-playsinline="true"
- muted
- @ended="workState = 'done'"
- />
- </div>
- </template>
- <script setup>
- import { ref, computed, watch } from "vue"
- import { toolList, selectedToolNum, workState } from "@/store/index.js"
- const {
- windowSizeInCssForRef,
- windowSizeWhenDesignForRef,
- } = useSizeAdapt()
- const props = defineProps(['requiredToolList'])
- const requiredToolList = computed(() => {
- return props.requiredToolList
- })
- watch(selectedToolNum, (vNew) => {
- if (vNew === 1) {
- setTimeout(() => {
- workState.value = 'working'
- }, 500)
- } else if (vNew === 2) {
- setTimeout(() => {
- workState.value = 'working'
- }, 500)
- }
- })
- const videoRef1 = ref(null)
- const videoRef2 = ref(null)
- const videoRef3 = ref(null)
- const innerState = ref(0) //0:初始,1:颜料已挤出,2:滚筒已粘上颜料
- watch(workState, (vNew) => {
- if (vNew === 'working' && innerState.value === 0) {
- videoRef1.value.play()
- } else if (vNew === 'working' && innerState.value === 1) {
- videoRef2.value.play()
- }
- })
- </script>
- <style lang="less" scoped>
- .working-area{
- position: absolute;
- left: 50%;
- top: calc(314 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
- transform: translate(-50%, -50%);
- width: calc(328 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
- height: calc(438 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));;
- >img.helper-board{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- // height: 100%;
- }
- >video.helper-board{
- position: absolute;
- left: 0;
- top: 0;
- width: 98%;
- // height: 100%;
- }
- >img.rubber-board-init{
- position: absolute;
- left: 0;
- top: calc(168 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));;
- width: 100%;
- }
- >video.rubber-board{
- position: absolute;
- left: 0;
- top: calc(169 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));;
- width: 97.5%;
- }
- }
- </style>
|