packPage.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="imagecontent">
  3. <nav-bar title="活动"></nav-bar>
  4. <movable-area scale-area class="movable-area">
  5. <movable-view
  6. class="movable-view"
  7. direction="all"
  8. @scale="onScale"
  9. scale="true"
  10. scale-min="1"
  11. :x="-80"
  12. scale-max="4"
  13. :scale-value="scale"
  14. @dblclick="dblclick"
  15. >
  16. <image
  17. src="https://web.xyyxt.net/static/img/a88848d9321bc1706685815ea2103b5.4a36b7f.png"
  18. mode="widthFix"
  19. class="qqqqq"
  20. >
  21. </image>
  22. <view class="image-box" :style="{ height: height + 'px' }">
  23. <view
  24. class="box"
  25. :class="'box' + index"
  26. @click="to(item.type)"
  27. v-for="(item, index) in goodsList"
  28. :style="{
  29. left: item.start[0] * 1.4 - (110 / width) * 100 + '%',
  30. top: item.start[1] + '%',
  31. }"
  32. :key="index"
  33. >
  34. </view>
  35. </view>
  36. </movable-view>
  37. </movable-area>
  38. </view>
  39. </template>
  40. <script>
  41. // 19.8
  42. // 7.83
  43. // 1920
  44. // 3319
  45. export default {
  46. name: "SaasMiniprogramSprint",
  47. data() {
  48. return {
  49. scale: 1,
  50. height: 0,
  51. width: 0,
  52. goodsList: [
  53. {
  54. start: [18.75, 43.4],
  55. end: [38.55, 51.23],
  56. type: 1,
  57. },
  58. {
  59. start: [40.1, 43.4],
  60. end: [59.9, 51.23],
  61. type: 1,
  62. },
  63. {
  64. start: [61.45, 43.4],
  65. end: [81.25, 51.23],
  66. type: 2,
  67. },
  68. {
  69. start: [18.75, 52.12],
  70. end: [38.55, 59.95],
  71. type: 1,
  72. },
  73. {
  74. start: [40.1, 52.12],
  75. end: [59.9, 59.95],
  76. type: 2,
  77. },
  78. {
  79. start: [18.75, 79.99],
  80. end: [38.55, 87.82],
  81. type: 1,
  82. },
  83. {
  84. start: [40.1, 79.99],
  85. end: [59.9, 87.82],
  86. type: 1,
  87. },
  88. {
  89. start: [61.45, 79.99],
  90. end: [81.25, 87.82],
  91. type: 1,
  92. },
  93. {
  94. start: [18.75, 88.73],
  95. end: [38.55, 96.56],
  96. type: 2,
  97. },
  98. {
  99. start: [40.1, 88.73],
  100. end: [59.9, 96.56],
  101. type: 2,
  102. },
  103. ],
  104. };
  105. },
  106. onReady() {
  107. setTimeout(() => {
  108. uni
  109. .createSelectorQuery()
  110. .in(this)
  111. .select(".qqqqq")
  112. .boundingClientRect((rect) => {
  113. this.height = rect.height;
  114. this.width = rect.width;
  115. })
  116. .exec();
  117. }, 1000);
  118. },
  119. methods: {
  120. to(type) {
  121. if (type == 1) {
  122. uni.reLaunch({
  123. url: "/pages/course/index?cur=1&ename=考前培训&bname=一级建造师",
  124. });
  125. } else {
  126. this.$store.state.current = 3
  127. uni.switchTab({
  128. url: '/pages/course/index'
  129. });
  130. // uni.reLaunch({
  131. // url: "/pages/information/index",
  132. // });
  133. }
  134. },
  135. dblclick() {
  136. if (this.scale == 10) {
  137. this.scale = 1;
  138. } else {
  139. this.scale = 10;
  140. }
  141. },
  142. },
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .movable-view {
  147. width: 100%;
  148. height: calc(100% + 260rpx + 128rpx);
  149. display: flex;
  150. justify-content: center;
  151. position: relative;
  152. }
  153. .movable-area {
  154. height: 100%;
  155. width: 100%;
  156. }
  157. .movable-view image {
  158. width: 100%;
  159. transform: scale(1.4);
  160. margin-top: 260rpx;
  161. }
  162. .imagecontent {
  163. width: 100%;
  164. height: 100%;
  165. background: rgba(0, 0, 0, 1);
  166. top: 0;
  167. position: fixed;
  168. }
  169. .image-box {
  170. width: 100%;
  171. position: absolute;
  172. }
  173. .box {
  174. // width: 19.8%;
  175. // height: 100rpx;
  176. width: 28%;
  177. height: 140rpx;
  178. // background: red;
  179. position: absolute;
  180. }
  181. </style>