소스 검색

积分规则改为接口获取

Xiao_123 8 달 전
부모
커밋
525e3374b4
2개의 변경된 파일23개의 추가작업 그리고 12개의 파일을 삭제
  1. 13 0
      api/integral.js
  2. 10 12
      pages/index/welfare.vue

+ 13 - 0
api/integral.js

@@ -22,4 +22,17 @@ export const rewardEventTrackClick = (url) => {
       auth: true
     }
   })
+}
+
+// 推荐任务
+export const getTaskList = (params) => {
+  return request({
+    url: '/admin-api/menduner/reward/event-track/get/mark/task',
+    method: 'GET',
+    params,
+    custom: {
+      showLoading: false,
+      auth: false
+    }
+  })
 }

+ 10 - 12
pages/index/welfare.vue

@@ -60,12 +60,13 @@
               <uni-list>
                 <uni-list-item v-for="(k, i) in integralRules" :key="i" :showArrow="false">
                   <template v-slot:header>
-                    <text class="ss-m-t-10">{{ k.text }}</text>
+                    <text class="ss-m-t-10">{{ k.title }}</text>
                   </template>
                   <template v-slot:footer>
-                    <view class="d-flex align-center" style="width: 100px; text-align: start;">
+                    <view class="d-flex align-center" style="width: 130px; text-align: start; position: relative;">
                       <image src="/static/svg/integral.svg" style="width: 30px; height: 30px;"></image>
                       <view class="color-primary ss-m-l-10">{{ k.point }}</view>
+                      <uni-tag :inverted="true" :text="k.complete ? '已完成' : '未完成'" :type="k.complete ? 'success' : 'error'" style="position: absolute; right: 0;" />
                     </view>
                   </template>
                 </uni-list-item>
@@ -99,6 +100,7 @@ import {
   getAccountBalance,
   getUserAccount,
 } from '@/api/sign'
+import { getTaskList } from '@/api/integral'
 import { onShow } from '@dcloudio/uni-app'
 import { userStore } from '@/store/user'
 import { showAuthModal } from '@/hooks/useModal'
@@ -108,16 +110,12 @@ const useUserStore = userStore()
 
 const SignItems = ref([])
 // 积分规则
-const integralRules = [
- { text: '个人注册', point: 100 },
- { text: '个人拉新注册', point: 50 },
- { text: '完善在线简历信息', point: 50 },
- { text: '购买14天双周卡', point: 200 },
- { text: '购买30天月卡', point: 350 },
- { text: '购买60天月卡', point: 500 },
- { text: '购买90天月卡', point: 800 },
- { text: '购买年度卡', point: 1200 }
-]
+const integralRules = ref([])
+const getTask = async () => {
+  const { data } = await getTaskList({ mark: '推荐任务', type: 0 })
+  integralRules.value = data
+}
+getTask()
 // 商品列表
 const goodsList = [
   { name: '房券-高端酒店房券', point: 12000, url: 'https://minio.menduner.com/dev/menduner/hotalRoomVoucher.png' },