li.shaoyi 3 年之前
父節點
當前提交
a3e1ee7400
共有 3 個文件被更改,包括 18 次插入8 次删除
  1. 1 1
      public/config/appconfig.json
  2. 13 3
      src/business/credit/index.ts
  3. 4 4
      src/packages/mobile/views/credit/lottery/index.vue

+ 1 - 1
public/config/appconfig.json

@@ -1,5 +1,5 @@
 {
   "version": "1.0.3",
   "versionCode": "100003",
-  "apiUrl": "http://192.168.31.167:8080/cfg?key=test_167"
+  "apiUrl": "http://218.17.158.45:16021/cfg?key=test_thj"
 }

+ 13 - 3
src/business/credit/index.ts

@@ -46,8 +46,8 @@ export function useCreditStatementList(stype?: ScoreConfigType) {
 // 积分抽奖
 export function useCreditLottery() {
     const { getUserId } = useLoginStore()
-    const { dataList, getCreditStatementList } = useCreditStatementList(ScoreConfigType.Lottery)
     const loading = shallowRef(false)
+    const creditList = shallowRef<Model.UserScoreLogRsp[]>([])
     const creditConfig = shallowRef<Partial<Model.THJScoreConfigRsp>>({})
     const userAccount = shallowRef<Partial<Model.UserAccount>>({})
 
@@ -75,7 +75,17 @@ export function useCreditLottery() {
                 userAccount.value = res.data
             }
         })
-        getCreditStatementList()
+        queryUserScoreLog({
+            data: {
+                stype: ScoreConfigType.Lottery,
+                userid: getUserId(),
+                page: 1,
+                pagesize: 10,
+            },
+            success: (res) => {
+                creditList.value = res.data
+            },
+        })
     }
 
     const formSubmit = () => {
@@ -100,7 +110,7 @@ export function useCreditLottery() {
         loading,
         creditConfig,
         userAccount,
-        dataList,
+        creditList,
         redEnvelope,
         formSubmit,
         formRefresh,

+ 4 - 4
src/packages/mobile/views/credit/lottery/index.vue

@@ -34,7 +34,7 @@
             <div class="credit-lottery__box credit-lottery__record">
                 <dl class="block">
                     <dt class="block-title">- 我的红包 -</dt>
-                    <dd class="block-item" v-for="(item, index) in dataList" :key="index">
+                    <dd class="block-item" v-for="(item, index) in creditList" :key="index">
                         <span>{{ item.createtime }}</span>
                         <span>{{ item.score }}</span>
                     </dd>
@@ -52,7 +52,7 @@ import { fullloading } from '@/utils/vant'
 import { useCreditLottery } from '@/business/credit'
 import Reward from './components/reward/index.vue'
 
-const { creditConfig, userAccount, dataList, redEnvelope, formSubmit, formRefresh } = useCreditLottery()
+const { creditConfig, userAccount, creditList, redEnvelope, formSubmit, formRefresh } = useCreditLottery()
 const showReward = shallowRef(false) // 显示抽奖红包
 
 const onSubmit = () => {
@@ -61,8 +61,8 @@ const onSubmit = () => {
         formSubmit().then(() => {
             hideLoading()
             showReward.value = true
-        }).catch((err) => {
-            Toast.fail(err)
+        }).catch(() => {
+            Toast.fail('抽奖失败')
         })
     })
 }