ShuangGouSheSeDetail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <script setup>
  2. import { onMounted, ref, computed } from 'vue'
  3. import { useRouter } from 'vue-router'
  4. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  5. const router = useRouter()
  6. const goBack = () => {
  7. router.push({
  8. name: 'MoreContent',
  9. query: {
  10. anchorIdx: 0,
  11. }
  12. })
  13. }
  14. const {
  15. windowSizeInCssForRef,
  16. windowSizeWhenDesignForRef,
  17. } = useSizeAdapt()
  18. const reverseArray = (array) => {
  19. return array.slice().reverse()
  20. }
  21. const goPaintingDetail = () => {
  22. router.push(`/shuanggou-painting-detail?idx=0&&m=${curIndex.value}`)
  23. }
  24. const x = window.innerWidth / window.innerHeight
  25. onMounted(() => {
  26. console.log('shuchubili', x)
  27. })
  28. const text = [
  29. ['双钩,中国画技法名。用线条钩描',
  30. '物象的轮廓,通称“勾勒”,因基本上',
  31. '是用左右或上下两笔钩描合拢,故亦',
  32. '称“双钩”。大部用于工笔花鸟画。又',
  33. '旧时摹搨法书。沿字的笔迹两边用细',
  34. '劲的墨线线钩出轮廓,也叫“双钩”;',
  35. '双钩后填墨的称为“双钩”'],
  36. ['设色,国画中晕染彩色的意思,“廓',
  37. '填”。画面中只要出现彩色就可以说',
  38. '是设色作品。与设色相反的是“水墨”,',
  39. '指画面中不出现彩色,或者极少出现',
  40. '彩色的,以墨色为主绘制的作品。', ]
  41. ]
  42. const curIndex = ref(0)
  43. const lastX = ref(0)
  44. // 开始滑动
  45. const handletouchstart = (event) => {
  46. lastX.value = event.changedTouches[0].pageX
  47. }
  48. // 监听活动
  49. const touchEnd = (event) => {
  50. let currentX = event.changedTouches[0].pageX
  51. let tx = currentX - lastX.value
  52. if (tx < 0) {
  53. if (curIndex.value == 0) {
  54. curIndex.value = 1
  55. }
  56. } else if (tx > 0) {
  57. if (curIndex.value == 1) {
  58. curIndex.value = 0
  59. }
  60. }
  61. }
  62. const goToSlide = (index) => {
  63. curIndex.value = index
  64. }
  65. const curPercentage = computed(() => {
  66. return curIndex.value
  67. }
  68. )
  69. </script>
  70. <template>
  71. <div
  72. class="home"
  73. @touchstart="handletouchstart($event)"
  74. @touchend="touchEnd($event)"
  75. >
  76. <div class="title">
  77. <span :style="{ color: curIndex == 1 ? 'rgba(71, 71, 71, 0.50)' : '' }">双钩</span>
  78. <span :style="{ color: curIndex == 0 ? 'rgba(71, 71, 71, 0.50)' : '' }">设色</span>
  79. </div>
  80. <div class="shuanggou-yezi">
  81. <img
  82. src="@/assets/images/shuanggou-top-left.png"
  83. alt=""
  84. >
  85. <HotspotComp
  86. v-show="true"
  87. class="hotspot-1"
  88. @click="goPaintingDetail"
  89. />
  90. </div>
  91. <!-- <img
  92. class="text"
  93. src="@/assets/images/shuanggou-text.png"
  94. alt=""
  95. > -->
  96. <div
  97. class="text"
  98. :style="{ top: x > 0.5 ? 'auto' : '', bottom: x > 0.5 ? '15vh' : 'auto' }"
  99. >
  100. <div
  101. v-for="(item, index) in reverseArray(text[curIndex])"
  102. :key="index"
  103. >
  104. {{ item }}
  105. </div>
  106. <!-- <img
  107. v-show="curIndex == 0"
  108. src="@/assets/images/shuanggou-text.png"
  109. alt=""
  110. > -->
  111. <!-- <img
  112. v-show="curIndex == 1"
  113. src="@/assets/images/shese-text.png"
  114. alt=""
  115. > -->
  116. </div>
  117. <ProgressBar
  118. class="progress-bar"
  119. :totle-unit="2"
  120. :cur-percentage="curPercentage"
  121. color-ac="#7B916B"
  122. color="#7B916B60"
  123. type="1"
  124. @go-to-slide="goToSlide"
  125. />
  126. <img
  127. class="right-bottom"
  128. src="@/assets/images/right-bottom.png"
  129. alt=""
  130. >
  131. <div class="system-btns">
  132. <BtnBack
  133. color="green"
  134. @click="goBack"
  135. />
  136. <!-- <OperationTip
  137. class="operation-h"
  138. color="green"
  139. text=""
  140. direction="h"
  141. /> -->
  142. </div>
  143. </div>
  144. </template>
  145. <style lang='less' scoped>
  146. *{
  147. transition: all 1s ease;
  148. }
  149. .home {
  150. width: 100%;
  151. height: 100%;
  152. position: relative;
  153. background: #ffffff;
  154. .title {
  155. color: #474747;
  156. font-size: calc(48 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  157. line-height: calc(48 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  158. writing-mode: vertical-rl;
  159. font-family: 'KingHwa_OldSong';
  160. position: absolute;
  161. right: 13%;
  162. top: 26%;
  163. letter-spacing: 10px;
  164. }
  165. .shuanggou-yezi {
  166. width: 100%;
  167. animation: fade-in 2s forwards;
  168. position: relative;
  169. z-index: 2;
  170. @keyframes fade-in {
  171. 0% {
  172. opacity: 0;
  173. }
  174. 100% {
  175. opacity: 1;
  176. }
  177. }
  178. >img {
  179. width: 100%;
  180. margin-top: -3%;
  181. }
  182. >.hotspot-1 {
  183. position: absolute;
  184. bottom: 28%;
  185. left: 17%;
  186. pointer-events: initial;
  187. z-index: 3;
  188. }
  189. }
  190. .text {
  191. display: flex;
  192. position: absolute;
  193. right: 30%;
  194. top: 40vh;
  195. // top: calc(50 /v-bind('windowSizeWhenDesignForRef')/v-bind('windowSizeInCssForRef'));
  196. color: #707F48;
  197. font-size: calc(18 /v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  198. line-height: calc(26 /v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  199. font-family: 'KaiTi';
  200. >div {
  201. writing-mode: vertical-rl;
  202. letter-spacing: 2px;
  203. text-align: justify;
  204. }
  205. }
  206. .right-bottom {
  207. width: 100%;
  208. position: absolute;
  209. bottom: 0;
  210. right: 0;
  211. }
  212. .progress-bar{
  213. position: absolute;
  214. left: 0;
  215. bottom: 15px;
  216. left: 50%;
  217. transform: translateX(-50%);
  218. width: 90%;
  219. height: 15px;
  220. z-index: 3;
  221. color: #e1edd95d;
  222. transition: all 1s;
  223. z-index: 1;
  224. }
  225. .system-btns {
  226. width: 100%;
  227. padding: 0 calc(20 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef));
  228. display: flex;
  229. // flex-direction: column;
  230. justify-content: flex-end;
  231. position: absolute;
  232. bottom: calc(60 /v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef));
  233. z-index: 2;
  234. .operation-h {
  235. width: calc(36 /v-bind('windowSizeWhenDesignForRef')* v-bind('windowSizeInCssForRef'));
  236. transition: opacity 0.5s ease-in-out;
  237. }
  238. }
  239. }
  240. </style>