diff --git a/src/subpackages/profile/modules/components/History.tsx b/src/subpackages/profile/modules/components/History.tsx index 9ec389f..4357a99 100644 --- a/src/subpackages/profile/modules/components/History.tsx +++ b/src/subpackages/profile/modules/components/History.tsx @@ -1,63 +1,44 @@ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { View } from '@tarojs/components'; import Taro from '@tarojs/taro'; -import React, { memo } from 'react'; +import { memo, useEffect, useState } from 'react'; +import { CommentInfo } from '@/common/assets/types'; import { Comment } from '@/common/components'; +import { get } from '@/common/utils/fetch'; import uniqueKeyUtil from '@/common/utils/keyGen'; const History: React.FC = memo(() => { + const [comments, setComments] = useState([]); + + useEffect(() => { + const fetchData = async () => { + const res = await get( + `evaluations/list/mine?cur_evaluation_id=${0}&limit=${10}&status=${'Public'}` + ); + console.log(res.data); + setComments(res.data); + }; + void fetchData(); + }, []); + return ( - { - const serializedComment = encodeURIComponent(JSON.stringify(props)); - void Taro.navigateTo({ - url: `/pages/evaluateInfo/index?comment=${serializedComment}`, - }); - }} - key={uniqueKeyUtil.nextKey()} - type="inner" - /> - { - const serializedComment = encodeURIComponent(JSON.stringify(props)); - void Taro.navigateTo({ - url: `/pages/evaluateInfo/index?comment=${serializedComment}`, - }); - }} - key={uniqueKeyUtil.nextKey()} - type="inner" - /> - { - const serializedComment = encodeURIComponent(JSON.stringify(props)); - void Taro.navigateTo({ - url: `/pages/evaluateInfo/index?comment=${serializedComment}`, - }); - }} - key={uniqueKeyUtil.nextKey()} - type="inner" - /> - { - const serializedComment = encodeURIComponent(JSON.stringify(props)); - void Taro.navigateTo({ - url: `/pages/evaluateInfo/index?comment=${serializedComment}`, - }); - }} - key={uniqueKeyUtil.nextKey()} - type="inner" - /> - { - const serializedComment = encodeURIComponent(JSON.stringify(props)); - void Taro.navigateTo({ - url: `/pages/evaluateInfo/index?comment=${serializedComment}`, - }); - }} - key={uniqueKeyUtil.nextKey()} - type="inner" - /> + {comments.map((item) => ( + { + const serializedComment = encodeURIComponent(JSON.stringify(props)); + void Taro.navigateTo({ + url: `/pages/evaluateInfo/index?comment=${serializedComment}`, + }); + }} + /> + ))} ); });