index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <page title="隐藏任务" ref="pageRef" light nav-color="transparent">
  3. <view class="bg"></view>
  4. <image :src="resource.popularize_bg" class="bg-2" />
  5. <view class="container">
  6. <view v-if="isActivity">
  7. <view
  8. class="task"
  9. v-for="item in data"
  10. :key="item.taskId"
  11. :style="item.synthesis !== 2 ? 'height: 387rpx' : null"
  12. >
  13. <view class="task_img">
  14. <image
  15. class="img"
  16. :src="item.synthesis === 2 ? resource.taskBgc : resource.taskBgc2x"
  17. />
  18. <view class="title">
  19. {{ item.taskName }}
  20. </view>
  21. <view class="task_show">
  22. <view class="img_border marginR12">
  23. <image
  24. class="img_1"
  25. :style="
  26. item.needSynthesisSpu[0].exists === 1 &&
  27. item.synthesis !== 2
  28. ? 'filter: brightness(0%)'
  29. : null
  30. "
  31. :src="item.needSynthesisSpu[0].spuImg"
  32. @click.stop="showGoodsDetail(item.needSynthesisSpu[0].spuVO)"
  33. />
  34. </view>
  35. <image class="img_2" :src="resource.hidden_add" />
  36. <view class="img_border marginR26">
  37. <image
  38. class="img_1"
  39. :style="
  40. item.needSynthesisSpu[1].exists === 1 &&
  41. item.synthesis !== 2
  42. ? 'filter: brightness(0%)'
  43. : null
  44. "
  45. :src="item.needSynthesisSpu[1].spuImg"
  46. @click.stop="showGoodsDetail(item.needSynthesisSpu[1].spuVO)"
  47. />
  48. </view>
  49. <image class="img_3" :src="resource.hidden_equal" />
  50. <view class="img_border">
  51. <image
  52. class="img_1"
  53. :src="item.spuSynthesis[0].spuImg"
  54. @click.stop="showGoodsDetail(item.spuSynthesis[0].spuVO)"
  55. />
  56. </view>
  57. </view>
  58. </view>
  59. <view v-if="item.synthesis === 2" class="done">
  60. <image class="done_img" :src="resource.hidden_done" />
  61. </view>
  62. <view class="text" :style="textStyle[item.synthesis]">
  63. {{ textData[item.synthesis] }}
  64. </view>
  65. <view
  66. v-if="item.synthesis !== 2"
  67. class="taskBtn"
  68. :style="
  69. item.synthesis === 1
  70. ? 'background: linear-gradient(107deg, #B45CFE 0%, #9141FF 100%)'
  71. : null
  72. "
  73. @click="handleTask(item)"
  74. >
  75. {{ item.synthesis === 1 ? '继续去抽盒' : '合成奖品' }}
  76. </view>
  77. </view>
  78. </view>
  79. <view class="task" v-else>
  80. <view class="task_img">
  81. <image class="img" :src="resource.taskBgc" />
  82. <view class="title">
  83. 隐藏任务
  84. <image class="lockImg" :src="resource.hidden_lock" />
  85. </view>
  86. <view class="task_show">
  87. <image class="img_1 marginR12" :src="resource.hidden_img1" />
  88. <image class="img_2" :src="resource.hidden_add" />
  89. <image class="img_1 marginR29" :src="resource.hidden_img1" />
  90. <image class="img_3" :src="resource.hidden_equal" />
  91. <image class="img_1" :src="resource.hidden_img2" />
  92. </view>
  93. </view>
  94. <view class="text">宝箱抽中特定隐藏任务款即可开启</view>
  95. </view>
  96. <view class="content paddingX15">
  97. <view class="title-wrapper translateX">
  98. <image :src="resource.popularize_content_bg" class="image" />
  99. <view class="relative font4 color-white bold">规则</view>
  100. </view>
  101. <view class="flex paddingT2 rule">
  102. <view class="font5 paddingL10 paddingB16 bold">
  103. 1、宝箱奖池内抽中特定隐藏任务款,即可触发完整任务于活动页面合成奖品。
  104. </view>
  105. <view class="font5 paddingL10 paddingB16 bold">
  106. 2、任务款仅可在每轮任务限时内触发掉落,于每轮任务结束时截止合成,单用户单任务限合成一次。
  107. </view>
  108. <view class="font5 paddingL10 paddingB16 bold">
  109. 3、任务款仅可通过宝箱获取,其他途径(包括但不限于福利房、魔换等)获得均无法用于合成。
  110. </view>
  111. <view class="font5 paddingL10 paddingB16 bold">
  112. 4、合成后原有任务款即消耗,此操作不可逆,一经合成无法找回,合成后的奖品可在仓库中查看。
  113. </view>
  114. <view class="font5 paddingL10 bold">活动解释权归平台所有</view>
  115. </view>
  116. </view>
  117. <view class="lifting"></view>
  118. <view class="btn" @click="handleSubmit">
  119. <image class="img" :src="resource.hidden_activity" />
  120. </view>
  121. </view>
  122. <taskDialog ref="taskRef" @refresh="getTask" />
  123. <goods-detail ref="goodsDetailRef" />
  124. </page>
  125. </template>
  126. <script>
  127. import resource from '@/utils/resource'
  128. import service from '../../service'
  129. import taskDialog from './activity_dialog.vue'
  130. import goodsDetail from '../store/goods_detail'
  131. export default {
  132. components: { taskDialog, goodsDetail },
  133. data() {
  134. return {
  135. resource,
  136. isActivity: true, // 活动是否开启
  137. data: [],
  138. textData: ['隐藏任务款已集齐,可发起合成', '隐藏任务已开启', '任务已完成,奖品已合成'],
  139. textStyle: [
  140. 'background: linear-gradient(180deg, #34A7F9 0%, #10CBD4 100%);',
  141. 'background: linear-gradient(180deg, #A466FF 0%, #904CF2 100%);',
  142. 'background: #4A5DFF'
  143. ]
  144. }
  145. },
  146. onShow() {
  147. this.getTask()
  148. },
  149. mounted() {},
  150. computed: {
  151. dynamicStyles() {
  152. return {
  153. color: this.textColor
  154. }
  155. }
  156. },
  157. methods: {
  158. async getTask() {
  159. const res = await this.$service.award.hideTaskUserList()
  160. this.data = res.data.filter((item) => item.activation === 0)
  161. this.isActivity = this.data.length > 0
  162. },
  163. handleTask(item) {
  164. if (item.synthesis === 0) {
  165. this.$refs.taskRef.show(item.spuSynthesis[0].spuImg, item.taskId)
  166. } else {
  167. this.handleSubmit()
  168. }
  169. },
  170. handleSubmit() {
  171. this.$router.index()
  172. },
  173. showGoodsDetail(item) {
  174. this.$refs.goodsDetailRef.show(item)
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .bg {
  181. position: fixed;
  182. left: 0;
  183. right: 0;
  184. top: 0;
  185. bottom: 0;
  186. background: linear-gradient(180deg, #8332f5 0%, #2f4abd 100%);
  187. z-index: -1;
  188. }
  189. .bg-2 {
  190. position: fixed;
  191. z-index: -1;
  192. left: 0;
  193. top: 0;
  194. width: 100%;
  195. height: 1624rpx;
  196. z-index: 0;
  197. }
  198. .content {
  199. position: relative;
  200. background: #ffffff;
  201. box-shadow: inset 0px 0px 10px 5px rgba(143, 75, 241, 0.15);
  202. border: 4rpx solid #0f11b2;
  203. border-radius: 16px;
  204. margin: 30rpx 32rpx;
  205. .title-wrapper {
  206. position: absolute;
  207. top: -8rpx;
  208. width: 250rpx;
  209. height: 50rpx;
  210. line-height: 50rpx;
  211. text-align: center;
  212. .image {
  213. position: absolute;
  214. left: 0;
  215. top: 0;
  216. width: 250rpx;
  217. height: 50rpx;
  218. z-index: 0;
  219. }
  220. }
  221. .rule {
  222. flex-direction: column;
  223. padding: 79rpx 0 36rpx 0;
  224. color: #6e39e7;
  225. }
  226. }
  227. .lifting {
  228. height: 150rpx;
  229. }
  230. .btn {
  231. position: fixed;
  232. left: 50%;
  233. transform: translateX(-50%);
  234. bottom: 59rpx;
  235. height: 102rpx;
  236. z-index: 9;
  237. .img {
  238. height: 100%;
  239. }
  240. }
  241. .task {
  242. position: relative;
  243. height: 291rpx;
  244. margin: 43rpx 32rpx 0;
  245. .task_img {
  246. height: 100%;
  247. .img {
  248. width: 100%;
  249. height: 100%;
  250. z-index: 1;
  251. }
  252. .title {
  253. position: absolute;
  254. top: 19rpx;
  255. left: 37rpx;
  256. font-size: 32rpx;
  257. font-weight: 600;
  258. color: #5c3ddb;
  259. width: 190rpx;
  260. white-space: nowrap;
  261. text-overflow: ellipsis;
  262. overflow: hidden;
  263. z-index: 2;
  264. .lockImg {
  265. width: 32rpx;
  266. height: 32rpx;
  267. vertical-align: text-top;
  268. margin-left: 8rpx;
  269. }
  270. }
  271. .task_show {
  272. display: flex;
  273. position: absolute;
  274. left: 32rpx;
  275. top: 120rpx;
  276. z-index: 3;
  277. .img_border {
  278. width: 180rpx;
  279. height: 139rpx;
  280. border: 2rpx solid #9b68e8;
  281. background-color: #f4ebff;
  282. border-radius: 10rpx;
  283. overflow: hidden;
  284. }
  285. .img_1 {
  286. width: 180rpx;
  287. height: 139rpx;
  288. }
  289. .img_2 {
  290. position: absolute;
  291. left: 163rpx;
  292. bottom: 42rpx;
  293. width: 56rpx;
  294. height: 56rpx;
  295. z-index: 5;
  296. }
  297. .img_3 {
  298. position: absolute;
  299. left: 399rpx;
  300. bottom: 56rpx;
  301. width: 28rpx;
  302. height: 28rpx;
  303. z-index: 5;
  304. }
  305. }
  306. }
  307. .done {
  308. position: absolute;
  309. top: 24rpx;
  310. right: 24rpx;
  311. width: 96rpx;
  312. height: 84rpx;
  313. z-index: 999;
  314. .done_img {
  315. width: 100%;
  316. height: 100%;
  317. }
  318. }
  319. .text {
  320. position: absolute;
  321. top: 8rpx;
  322. right: 8rpx;
  323. width: 450rpx;
  324. height: 76rpx;
  325. font-style: 24rpx;
  326. font-weight: 500;
  327. color: #fff;
  328. line-height: 76rpx;
  329. text-align: left;
  330. padding-left: 45rpx;
  331. border-radius: 0rpx 16rpx 0rpx 0rpx;
  332. }
  333. .taskBtn {
  334. position: absolute;
  335. bottom: 32rpx;
  336. left: 50%;
  337. transform: translateX(-50%);
  338. width: 362rpx;
  339. height: 64rpx;
  340. line-height: 64rpx;
  341. text-align: center;
  342. font-size: 32rpx;
  343. font-weight: 500;
  344. color: #fff;
  345. background: linear-gradient(90deg, #eb9466 0%, #eb3c65 100%);
  346. border-radius: 44rpx;
  347. border: 1rpx solid rgba(255, 255, 255, 0.51);
  348. z-index: 2;
  349. }
  350. }
  351. </style>