activity.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view>
  3. <view v-if="isShow" class="specialArea acea-row row-between-wrapper">
  4. <view class="assemble skeleton-rect" hover-class="none" @click="gopage(activityOne.info[2].value)">
  5. <!-- <easy-loadimage mode="widthFix" :image-src="activityOne.img"></easy-loadimage> -->
  6. <image :src="activityOne.img" alt="" srcset="">
  7. <!-- <view class="text" v-if="activityOne.info">
  8. <view class="name">{{ activityOne.info[0].value }}</view>
  9. <view class="infor">{{ activityOne.info[1].value }}</view>
  10. </view> -->
  11. </view>
  12. <view class="list acea-row row-column-between">
  13. <view class="item skeleton-rect" v-for="(item, index) in activity" :key="index"
  14. @click="gopage(item.info[2].value)">
  15. <easy-loadimage mode="widthFix" :image-src="item.img"></easy-loadimage>
  16. <!-- <view class="text">
  17. <view class="name">{{ item.info[0].value }}</view>
  18. <view class="infor">{{ item.info[1].value}}</view>
  19. </view> -->
  20. </view>
  21. </view>
  22. </view>
  23. <view v-if="!isShow && isIframe" class="specialArea acea-row row-between-wrapper">
  24. <view class="assemble" hover-class="none" @click="gopage(activityOne.info[2].value)">
  25. <image :src="activityOne.img" alt="img" />
  26. <!-- <view class="text" v-if="activityOne.info">
  27. <view class="name">{{ activityOne.info[0].value }}</view>
  28. <view class="infor">{{ activityOne.info[1].value }}</view>
  29. </view> -->
  30. </view>
  31. <view class="list acea-row row-column-between">
  32. <view class="item" v-for="(item, index) in activity" :key="index" @click="gopage(item.info[2].value)">
  33. <image :src="item.img" alt="img" />
  34. <!-- <view class="text">
  35. <view class="name">{{ item.info[0].value }}</view>
  36. <view class="infor">{{ item.info[1].value}}</view>
  37. </view> -->
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. let app = getApp()
  45. import {
  46. goPage
  47. } from '@/libs/order.js'
  48. export default {
  49. name: 'activity',
  50. props: {
  51. dataConfig: {
  52. type: Object,
  53. default: () => {}
  54. }
  55. },
  56. watch: {
  57. dataConfig: {
  58. immediate: true,
  59. handler(nVal, oVal) {
  60. if (nVal) {
  61. let data = JSON.parse(JSON.stringify(nVal.imgList.list))
  62. this.activityOne = nVal.imgList.list[0]
  63. data.splice(0, 1)
  64. this.activity = data
  65. this.isShow = nVal.isShow.val
  66. }
  67. }
  68. }
  69. },
  70. data() {
  71. return {
  72. activity: [],
  73. activityOne: {},
  74. name: this.$options.name,
  75. isShow: true,
  76. isIframe: app.globalData.isIframe
  77. }
  78. },
  79. created() {},
  80. methods: {
  81. gopage(url) {
  82. goPage().then(res => {
  83. if (url.indexOf("http") != -1) {
  84. // #ifdef H5
  85. location.href = url
  86. // #endif
  87. } else {
  88. if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart',
  89. '/pages/user/index'
  90. ].indexOf(url) ==
  91. -1) {
  92. uni.navigateTo({
  93. url: url
  94. })
  95. } else {
  96. uni.navigateTo({
  97. url: url
  98. })
  99. }
  100. }
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .specialArea {
  108. background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  109. // background-color: $uni-bg-color;
  110. padding: 0 $uni-index-margin-col 0 $uni-index-margin-col;
  111. border-radius: $uni-border-radius-index;
  112. // box-shadow: $uni-index-box-shadow;
  113. }
  114. .specialArea .assemble {
  115. width: 336rpx;
  116. height: 300rpx;
  117. position: relative;
  118. }
  119. .specialArea .assemble image {
  120. width: 100%;
  121. height: 100%;
  122. border-radius: 5rpx;
  123. }
  124. .specialArea .assemble {
  125. /deep/,
  126. /deep/image,
  127. /deep/.easy-loadimage,
  128. /deep/uni-image {
  129. width: 336rpx;
  130. height: 300rpx;
  131. border-radius: 5rpx;
  132. }
  133. }
  134. .specialArea .assemble .text {
  135. position: absolute;
  136. top: 37rpx;
  137. left: 22rpx;
  138. }
  139. .specialArea .name {
  140. font-size: 30rpx;
  141. color: #fff;
  142. }
  143. .specialArea .infor {
  144. font-size: 22rpx;
  145. color: rgba(255, 255, 255, 0.8);
  146. margin-top: 5rpx;
  147. }
  148. .specialArea .list {
  149. width: 344rpx;
  150. height: 300rpx;
  151. }
  152. .specialArea .item {
  153. width: 100%;
  154. height: 146rpx;
  155. position: relative;
  156. }
  157. .specialArea .item img {
  158. width: 100%;
  159. height: 100%;
  160. }
  161. .specialArea .item {
  162. /deep/,
  163. /deep/image,
  164. /deep/.easy-loadimage,
  165. /deep/uni-image {
  166. width: 100%;
  167. height: 146rpx;
  168. }
  169. }
  170. .specialArea .item .text {
  171. position: absolute;
  172. top: 23rpx;
  173. left: 28rpx;
  174. }
  175. .specialArea .item image {
  176. width: 100%;
  177. height: 100%;
  178. }
  179. .specialArea .item .text {
  180. position: absolute;
  181. top: 23rpx;
  182. left: 28rpx;
  183. }
  184. </style>