ShuangGouSheSeDetail.vue 6.6 KB

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