taskList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="content">
  3. <view class="task-list" v-for="(item,index) in list" :key="index">
  4. <view class="task-l">
  5. <u-image width="80rpx" height="80rpx" :src="`/static/${item.taskCode}.png`"></u-image>
  6. <view class="task-l-info">
  7. <view class="task-l-title">{{item.taskCodeDictValue}}</view>
  8. <view class="task-l-desc">赚<text>{{item.giveTimes}}</text>次抽奖 <u-image width="22rpx" height="22rpx" src="/static/zpIcon.png"></u-image></view>
  9. </view>
  10. </view>
  11. <view class="task-r">
  12. <u-button size="medium" v-if="item.state==1||item.taskCode=='NEW_CUSTOMER'" :custom-style="{padding:'6px 10px',width:'100%',background:'#989898',color:'#ffffff'}">已完成</u-button>
  13. <u-button size="medium" v-else-if="item.state==0 && item.taskCode=='SHARE_FRIEND'" open-type="share" :custom-style="{padding:'6px 10px',width:'100%',background:'#02c9b2',color:'#ffffff'}">立即分享</u-button>
  14. <u-button size="medium" v-else @click="showYdao" :custom-style="{padding:'6px 10px',width:'100%',background:'#02c9b2',color:'#ffffff'}">立即前往</u-button>
  15. </view>
  16. </view>
  17. <u-popup v-model="showYd" mode="center" close-icon-color="#ffffff" closeable :border-radius="30" width="500rpx" height="550rpx">
  18. <view class="lottery-content">
  19. <view class="lottery-title">
  20. <image src="/static/tdsm.jpg"></image>
  21. </view>
  22. <view @click="toViewZn" class="lottery-confrim-btn">
  23. 查看使用指南
  24. </view>
  25. </view>
  26. </u-popup>
  27. </view>
  28. </template>
  29. <script>
  30. import { findCustomerTask } from '@/api/luckyDraw.js'
  31. export default {
  32. data() {
  33. return {
  34. showYd: false,
  35. list: [], // 任务列表
  36. }
  37. },
  38. onLoad(option) {
  39. if(option.id) {
  40. this.getTaskList(option.id)
  41. }
  42. },
  43. methods: {
  44. // 获取任务列表
  45. getTaskList (id) {
  46. findCustomerTask({id:id}).then(res =>{
  47. if(res.status == 200) {
  48. console.log(res)
  49. this.list = res.data
  50. } else {
  51. this.list = []
  52. }
  53. })
  54. },
  55. showYdao(){
  56. this.showYd = true
  57. },
  58. toViewZn(){
  59. uni.redirectTo({
  60. url: '/pages/userCenter/zhinan'
  61. })
  62. }
  63. },
  64. onShareAppMessage() {
  65. return {
  66. title: '[乐色管家]年末活动来袭,幸福大转盘, 精彩好礼等你来抽!',
  67. path: '/pagesA/luckDraw/luckDraw',
  68. imageUrl:'/static/zpthumbr.jpg'
  69. }
  70. },
  71. onShareTimeline() {
  72. return {
  73. title: '[乐色管家]年末活动来袭,幸福大转盘, 精彩好礼等你来抽!',
  74. imageUrl:'/static/zpthumbr.jpg'
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="less">
  80. .content{
  81. width: 100%;
  82. padding: 0;
  83. // 弹框提示
  84. .lottery-content{
  85. display: flex;
  86. justify-content: center;
  87. height: 100%;
  88. position: relative;
  89. background: url(../../static/lottery_winbg1.png) no-repeat center top;
  90. background-size: 100% auto;
  91. .lottery-confrim-btn{
  92. width: 100%;
  93. display: flex;
  94. justify-content: center;
  95. position: absolute;
  96. bottom: 0;
  97. left: 0;
  98. color: #21d5c0;
  99. font-size: 32rpx;
  100. border-top: 1px solid #eee;
  101. padding: 30rpx 0;
  102. }
  103. .lottery-title{
  104. padding: 100rpx 50rpx;
  105. display: flex;
  106. text-align: center;
  107. image{
  108. width: 450rpx;
  109. height: 320rpx;
  110. }
  111. }
  112. }
  113. }
  114. .task-list{
  115. display: flex;
  116. align-items: center;
  117. padding: 20rpx 40rpx;
  118. border-bottom: 1px solid #eee;
  119. background-color: #FFFFFF;
  120. .task-l{
  121. width: 80%;
  122. display: flex;
  123. align-items: center;
  124. .task-l-info{
  125. flex-grow: 1;
  126. padding: 0 15rpx;
  127. .task-l-title{
  128. font-weight: bold;
  129. }
  130. .task-l-desc{
  131. display: flex;
  132. align-items: center;
  133. font-size: 24rpx;
  134. color: #666;
  135. margin-top: 5rpx;
  136. }
  137. }
  138. }
  139. .task-r{
  140. width: 20%;
  141. }
  142. }
  143. </style>