├── php-api/ # 改造后的PHP接口层 ├── java-ad-service/ # 若依框架微服务(广告+VIP+分账) ├── uniapp-reader/ # UniApp前端项目 │ ├── pages/ # 各端页面 │ └──
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PartnerTask.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="partner-task">
  3. <view class="header">
  4. <text class="title">合作任务</text>
  5. <text class="subtitle">完成任务赚金币</text>
  6. </view>
  7. <scroll-view scroll-x class="task-scroll">
  8. <view
  9. v-for="task in tasks"
  10. :key="task.id"
  11. class="task-card"
  12. @click="handleTask(task)"
  13. >
  14. <image :src="task.logo" class="logo" />
  15. <view class="info">
  16. <text class="name">{{ task.name }}</text>
  17. <text class="reward">+{{ task.reward }}金币</text>
  18. </view>
  19. <button class="action-btn">{{ task.completed ? '已完成' : '去完成' }}</button>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. </template>
  24. <script setup>
  25. import { ref } from 'vue'
  26. // 合作任务数据
  27. const tasks = ref([
  28. {
  29. id: 1,
  30. name: '百度地图签到',
  31. logo: '/static/partners/baidu.png',
  32. reward: 30,
  33. completed: false,
  34. handler: () => {
  35. uni.navigateToMiniProgram({
  36. appId: 'wx4f1b24bdc99fa23e',
  37. path: 'pages/index/index',
  38. success: () => console.log('跳转百度地图成功')
  39. })
  40. }
  41. },
  42. {
  43. id: 2,
  44. name: '快手看视频',
  45. logo: '/static/partners/kuaishou.png',
  46. reward: 50,
  47. completed: false,
  48. handler: () => {
  49. uni.navigateToMiniProgram({
  50. appId: 'wx9188fa3c6a2d1e87',
  51. path: 'pages/index/index',
  52. success: () => console.log('跳转快手成功')
  53. })
  54. }
  55. },
  56. {
  57. id: 3,
  58. name: '京东金融',
  59. logo: '/static/partners/jd.png',
  60. reward: 80,
  61. completed: true,
  62. handler: () => {
  63. uni.navigateToMiniProgram({
  64. appId: 'wx91d27dbf599dff74',
  65. path: 'pages/index/index',
  66. success: () => console.log('跳转京东金融成功')
  67. })
  68. }
  69. },
  70. {
  71. id: 4,
  72. name: '美团外卖',
  73. logo: '/static/partners/meituan.png',
  74. reward: 100,
  75. completed: false,
  76. handler: () => {
  77. uni.navigateToMiniProgram({
  78. appId: 'wxde8ac0a21135c07d',
  79. path: 'pages/index/index',
  80. success: () => console.log('跳转美团成功')
  81. })
  82. }
  83. }
  84. ])
  85. // 处理任务点击
  86. const handleTask = (task) => {
  87. if (task.completed) {
  88. uni.showToast({ title: '任务已完成', icon: 'none' })
  89. return
  90. }
  91. // 执行任务处理逻辑
  92. task.handler()
  93. // 模拟完成任务
  94. setTimeout(() => {
  95. task.completed = true
  96. uni.showToast({ title: `任务完成!获得${task.reward}金币`, icon: 'success' })
  97. }, 2000)
  98. }
  99. </script>
  100. <style scoped>
  101. .partner-task {
  102. background-color: var(--card-bg);
  103. border-radius: 16px;
  104. padding: 20px;
  105. margin: 20px 0;
  106. }
  107. .header {
  108. margin-bottom: 15px;
  109. }
  110. .title {
  111. font-size: 18px;
  112. font-weight: bold;
  113. display: block;
  114. }
  115. .subtitle {
  116. font-size: 14px;
  117. color: #666;
  118. }
  119. .task-scroll {
  120. white-space: nowrap;
  121. }
  122. .task-card {
  123. display: inline-block;
  124. width: 280px;
  125. background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
  126. border-radius: 12px;
  127. padding: 15px;
  128. margin-right: 15px;
  129. box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  130. }
  131. .logo {
  132. width: 50px;
  133. height: 50px;
  134. border-radius: 10px;
  135. margin-right: 12px;
  136. vertical-align: middle;
  137. }
  138. .info {
  139. display: inline-block;
  140. vertical-align: middle;
  141. width: calc(100% - 120px);
  142. }
  143. .name {
  144. font-size: 16px;
  145. font-weight: 500;
  146. display: block;
  147. }
  148. .reward {
  149. font-size: 14px;
  150. color: #f5222d;
  151. display: block;
  152. }
  153. .action-btn {
  154. display: inline-block;
  155. vertical-align: middle;
  156. background-color: var(--primary-color);
  157. color: white;
  158. border: none;
  159. border-radius: 16px;
  160. height: 36px;
  161. line-height: 36px;
  162. padding: 0 15px;
  163. font-size: 14px;
  164. margin-left: 10px;
  165. }
  166. </style>