shenwu преди 8 месеца
родител
ревизия
6b4ed5d5bf

+ 1 - 1
src/pages/Distributor/Account/index.tsx

@@ -6,7 +6,7 @@ import { distributorAccountList } from "@/services/distributor/account"
 const Page: React.FC = () => {
     let getList = useAjax((params) => distributorAccountList(params), { type: 'table' })
     return <PageContainer>
-        <ProTable<any, API.PageParams>
+        <ProTable<any, any>
             headerTitle={"账号列表"}
             rowKey={(r) => r.id}
             search={{

+ 3 - 0
src/pages/Distributor/MiniApp/index.tsx

@@ -17,6 +17,9 @@ const Page: React.FC = () => {
                 return await getList.run(params)
             }}
             columns={columns()}
+            // showHeader={false}//隐藏标题
+            // options={false}//隐藏工具栏
+            // ghost={true}//幽灵模式
             // bordered
             expandable={{
                 rowExpandable: (record) => record.status,

+ 0 - 7
src/pages/Distributor/MiniApp/tableConfig.tsx

@@ -4,13 +4,6 @@ import { Badge, TableColumnsType } from "antd";
 
 export const columns = (): ProColumns<any>[] => {
     return [
-        // {
-        //     title: "ID",
-        //     dataIndex: 'id',
-        //     hideInSearch: true,
-        //     align: "center",
-        //     key: "id"
-        // },
         {
             title: "小程序名称",
             dataIndex: 'appName',

+ 2 - 2
src/pages/MiniApp/BookManage/Long/index.tsx

@@ -61,8 +61,8 @@ const Page: React.FC = () => {
         })
     }
     // 看小说
-    const lookBook = (id: any) => {
-        return getChapterContent.run(id).then(res => {
+    const lookBook = (params: any) => {
+        return getChapterContent.run(params).then(res => {
             return res.data
         })
     }

+ 7 - 22
src/pages/MiniApp/BookManage/components/readBook/index.tsx

@@ -29,10 +29,9 @@ function ReadBook(props: { next: (listData: { id: number }) => Promise<any>, lis
     }, []);
 
 
-    async function getBookContent(id: any) {
-        let content = await next(id)
-        console.log(content)
-        // setContent(content)
+    async function getBookContent(params: any) {
+        let content = await next(params)
+        setContent(content)
     }
     useEffect(() => {
         if (divRef.current) {
@@ -79,7 +78,7 @@ function ReadBook(props: { next: (listData: { id: number }) => Promise<any>, lis
                         <a
                             key={index}
                             style={{ display: 'inline-block', marginRight: ele.index % 4 === 0 ? 0 : 20, marginBottom: 10, width: 190, overflow: 'hidden' }}
-                            onClick={() => { getBookContent(ele?.chapterInfo?.id) }}
+                            onClick={() => { getBookContent({ bookId: ele?.chapterInfo?.bookId, chapterNo: ele?.chapterInfo?.chapterNo }) }}
                         >
                             <div style={{ display: 'flex', alignItems: 'center' }}>
                                 {ele.needPay && <MyIcon type="icon-jiesuo" style={{ marginRight: 5 }} />}
@@ -99,7 +98,7 @@ function ReadBook(props: { next: (listData: { id: number }) => Promise<any>, lis
                     destroyOnClose={true}
                     styles={{ body: { padding: 0 } }}
                     closeIcon={false}
-                // title={<div style={{ fontSize: 20 }}>{content?.chapterName}</div>}
+                title={<div style={{ fontSize: 20 }}>{content?.chapterName}</div>}
                 >
                     {
                         content && <>
@@ -109,24 +108,10 @@ function ReadBook(props: { next: (listData: { id: number }) => Promise<any>, lis
                             <div style={{ borderTop: '1px solid #efefef', display: 'flex', justifyContent: 'center' }}>
                                 <Space style={{ marginTop: 15 }}>
                                     {content?.chapterNo > 1 && <Button onClick={() => {
-                                        let upId = null
-                                        for (let i = 0; i < listData?.list?.length; i++) {
-                                            if (listData?.list[i].chapterInfo.id === content.id) {
-                                                upId = listData?.list[i - 1].chapterInfo.id
-                                                break;
-                                            }
-                                        }
-                                        getBookContent(upId)
+                                       getBookContent({bookId:content?.bookId,chapterNo:content?.chapterNo - 1})
                                     }}>上一章</Button>}
                                     {content?.chapterNo < listData?.list?.length && <Button onClick={() => {
-                                        let downId = null
-                                        for (let i = 0; i < listData?.list?.length; i++) {
-                                            if (listData?.list[i].chapterInfo.id === content.id) {
-                                                downId = listData?.list[i + 1].chapterInfo.id
-                                                break;
-                                            }
-                                        }
-                                        getBookContent(downId)
+                                        getBookContent({bookId:content?.bookId,chapterNo:content?.chapterNo + 1})
                                     }}>下一章</Button>}
                                 </Space>
                             </div>

+ 1 - 1
src/pages/MiniApp/Consume/tableConfig.tsx

@@ -66,7 +66,7 @@ export const columns = (enumList:any): ProColumns<any>[] => {
             hideInSearch: true,
             align: "center",
             render: (a: any) => {
-                return arr[a]?.description ||'-'
+                return new Map(arr?.map((item: { value: any; description: any; })=>[item.value,item.description])).get(a)
             }
         },
         {

+ 18 - 16
src/services/miniApp/bookManage/index.tsx

@@ -30,14 +30,14 @@ export interface Params extends Page, PublicParams {
   vipFree?: string,//vip 是否免费阅读;false-否,true-是
 }
 interface ConfigParmas {
-  id?:number,//配置ID
-  vipFree:boolean,//vip免费阅读
-  paymentType:any[],//小说付费方式(0:免费、1:按千字收费、2:整本收费、3:按段落收费
-  paymentCoin:number,//收费书币
-  remark:string,//配置
+  id?: number,//配置ID
+  vipFree: boolean,//vip免费阅读
+  paymentType: any[],//小说付费方式(0:免费、1:按千字收费、2:整本收费、3:按段落收费
+  paymentCoin: number,//收费书币
+  remark: string,//配置
 }
-interface LongConfigParmas extends PublicParams,BookId,ConfigParmas{
-  beginPayChapterNo:number,//付费章节
+interface LongConfigParmas extends PublicParams, BookId, ConfigParmas {
+  beginPayChapterNo: number,//付费章节
 }
 // ======================================长篇================================
 /**小说分页列表 */
@@ -69,9 +69,11 @@ export async function longBookInfoChapterAllList(params: any) {
   });
 }
 /**小说付费章节内容 */
-export async function longBookInfoChapterContent(chapterId: number) {
-  return request(api + `/admin/longBookInfo/chapterContent/${chapterId}`, {
+export async function longBookInfoChapterContent(data: { bookId: any, chapterNo: any }) {
+  let { bookId, ...params } = data
+  return request(api + `/admin/longBookInfo/chapterContent/${bookId}`, {
     method: 'GET',
+    params
   });
 }
 /**小说付费配置 */
@@ -82,12 +84,12 @@ export async function longBookInfoBookConfig(data: LongConfigParmas) {
   });
 }
 
-interface ShortConfigParmas extends PublicParams,BookId,ConfigParmas{
-  beginPayParagraphNo:number,//付费段落
-  paymentAmount:number,//收费金额
+interface ShortConfigParmas extends PublicParams, BookId, ConfigParmas {
+  beginPayParagraphNo: number,//付费段落
+  paymentAmount: number,//收费金额
 }
-interface ShortBookParams extends Page, BookId { 
-  backContent?:boolean,//是否返回段落的内容
+interface ShortBookParams extends Page, BookId {
+  backContent?: boolean,//是否返回段落的内容
 
 };
 // ======================================短篇================================
@@ -113,10 +115,10 @@ export async function shortBookInfoParagraphList(params: ShortBookParams) {
   });
 }
 /**小说段落全部列表 */
-export async function shortBookInfoParagraphAllList(data:any) {
+export async function shortBookInfoParagraphAllList(data: any) {
   return request(api + `/admin/shortBookInfo/paragraphAllList`, {
     method: 'GET',
-    params:data
+    params: data
   });
 }
 /**小说付费配置 */