shenwu 2 bulan lalu
induk
melakukan
b98b6cdb3b

+ 1 - 1
project.config.json

@@ -2,7 +2,7 @@
   "miniprogramRoot": "./dist",
   "projectname": "new-taro-mini-book",
   "description": "mini-book",
-  "appid": "touristappid",
+  "appid": "wxed3542b04192b2ee",
   "setting": {
     "urlCheck": true,
     "es6": false,

+ 1 - 0
src/app.config.ts

@@ -11,6 +11,7 @@ export default {
     'pages/book/bookArticle/index',//书籍内容 阅读页
     'pages/search/index',//搜索
     'pages/indexMore/index', // 更多
+    "pages/Ldpage/index"
   ],
   window: {
     backgroundTextStyle: 'dark',

+ 7 - 1
src/app.tsx

@@ -19,6 +19,8 @@ import { getUserInfo } from './server/wx/login'
 // 引入兼容性工具
 import { getAccountInfoSync } from './utils/compatibility'
 import { bookrackShrotAddOrRemove } from './server/bookrack'
+import { View } from '@tarojs/components'
+import { getPage } from './server/index/index'
 //引入官方小说阅读插件
 const novelPlugin = Taro.requirePlugin('novel-plugin')
 
@@ -45,6 +47,11 @@ class App extends Component {
 
   //每次打开小程序触发,后台切入不算
   onLaunch(options) {
+    console.log("apponLaunch", options)
+    const {query} =options
+    if(query?.pageId){
+      Taro.navigateTo({url:"/pages/Ldpage/index?pageId="+query.pageId})
+    }
     // 监听进入插件页事件
     novelPlugin.onPageLoad(this.onNovelPluginLoad)
   }
@@ -140,7 +147,6 @@ class App extends Component {
 
   componentDidCatchError() { }
   render() {
-    console.log("store.userInfoStore.userInfo", store.userInfoStore.userInfo)
     return <Provider store={store}>
       {(this.props as ProviderProps).children}
     </Provider >

+ 1 - 1
src/components/PupPetry/BookBox/BookboxColumnSmall.tsx

@@ -28,7 +28,7 @@ function BookboxColumnSmall(props: BookboxColumnSmallProps) {
                    let encode = encodeURIComponent(json)
                    if (wechatBookId) {
                        Taro.navigateTo({
-                           url: `plugin-private://wx293c4b6097a8a4d0/pages/novel/index?bookId=${wechatBookId}&customServerParams=${encode}`
+                           url: `plugin-private://wx293c4b6097a8a4d0/pages/novel/index?bookId=${wechatBookId}&customServerParams=${encode}&fontSize=5`
                        })
                    }else{
                        Taro.showToast({

+ 13 - 13
src/globaStyle.less

@@ -73,19 +73,19 @@
 
 /**书封面vip图片展示*/ 
 .isVip {
-    position: relative;
-    &::after {
-        content: "";
-        display: inline-block;
-        position: absolute;
-        height: 100%;
-        background: url("./icon/isVip.png") no-repeat;
-        background-size: 50%;
-        top: 0;
-        left: 0;
-        right: 0;
-        z-index: 999;
-    }
+    // position: relative;
+    // &::after {
+    //     content: "";
+    //     display: inline-block;
+    //     position: absolute;
+    //     height: 100%;
+    //     background: url("./icon/isVip.png") no-repeat;
+    //     background-size: 50%;
+    //     top: 0;
+    //     left: 0;
+    //     right: 0;
+    //     z-index: 999;
+    // }
     // &::before{
     //     content: "";
     //     display: inline-block;

+ 1 - 1
src/pages/book/bookDetails/index.tsx

@@ -39,7 +39,7 @@ class BookDetails extends Component<Props> {
         // 获取页面的路径和参数
         const route = currentPage.route // 页面路径
         if (route) {
-            let shareInfo = await share({ pagePath: route, bookId: this.props?.store?.bookStore?.openBookData?.bookId })
+            let shareInfo:any = await share({ pagePath: route, bookId: this.props?.store?.bookStore?.openBookData?.bookId })
             let { sharePicUrl, shareTitles, pageName, pagePath } = shareInfo
             return {
                 title: shareTitles || app.appInfo?.appName + '-' + pageName,

+ 11 - 9
src/pages/index/index.tsx

@@ -17,6 +17,9 @@ import BookboxColumnBig from '@src/components/PupPetry/BookBox/BookboxColumnBig'
 import { share } from '@src/utils';
 import BookboxRowBig from '@src/components/PupPetry/BookBox/BookboxRowBig';
 
+// 导入图片资源
+import rightIcon from '../../icon/right.png';
+
 interface Props {
     store: Store;
 }
@@ -174,7 +177,7 @@ const Index: React.FC<Props> = ({ store }) => {
         // 获取页面的路径和参数
         const route = currentPage.route // 页面路径
         if (route) {
-            let shareInfo = await share({ pagePath: route })
+            let shareInfo:any = await share({ pagePath: route })
             let { sharePicUrl, shareTitles, pageName, pagePath } = shareInfo
             return {
                 title: shareTitles || app.appInfo?.appName + '-' + pageName,
@@ -192,7 +195,6 @@ const Index: React.FC<Props> = ({ store }) => {
     const completeMessage = () => {
         console.log('完成');
     };
-    console.log("bookStore?.bookList", bookStore?.bookList?.total)
     return <ScrollViewHoc load={load} filterClassName='.searchTs' navHeight={indexStore.navHeight}>
         <TopNavBar1 {...{
             tab: true,
@@ -208,7 +210,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 今日热门 */}
                 {indexConfig['hot_books'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexHotBooks?.showRightButton} title={indexStore?.indexHotBooks?.name || "今日热书"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexHotBooks?.showRightButton} title={indexStore?.indexHotBooks?.name || "今日热书"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=今日热书&dataName=indexHotBooks` })
                     }}></BookHead>
                     <View ><BookboxRowMiddle {...indexStore?.indexHotBooks?.[app?.appInfo?.appCategory === 1 ? "longBookInfoAppVOS" : "shortBookInfoAppVOS"]?.[0]} /></View>
@@ -224,7 +226,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 热门分类 */}
                 {indexConfig['hot_category'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexHotCategory?.showRightButton} title={indexStore?.indexHotCategory?.name || "热门分类"} fitTitle="全部分类" imgUrl={require('../../icon/right.png')} fitOnBack={() => { Taro.switchTab({ url: '/pages/classify/index' }) }} />
+                    <BookHead showBtn={indexStore?.indexHotCategory?.showRightButton} title={indexStore?.indexHotCategory?.name || "热门分类"} fitTitle="全部分类" imgUrl={rightIcon} fitOnBack={() => { Taro.switchTab({ url: '/pages/classify/index' }) }} />
                     <BookHotTabs hotValue={indexStore?.indexHotCategory?.bookCategoryList || []} onBack={(value) => {
                         getHotBooks(value)
                     }} />
@@ -238,7 +240,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 重磅新书 new_books*/}
                 {indexConfig['new_books'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexNewBooks?.showRightButton} title={indexStore?.indexNewBooks?.name || "重磅新书"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexNewBooks?.showRightButton} title={indexStore?.indexNewBooks?.name || "重磅新书"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=重磅新书&dataName=indexNewBooks` })
                     }} />
                     <View className='w row'>
@@ -253,7 +255,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 热门推荐 hot_rec*/}
                 {indexConfig['hot_rec'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexHotRec?.showRightButton} title={indexStore?.indexHotRec?.name || "热门推荐"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexHotRec?.showRightButton} title={indexStore?.indexHotRec?.name || "热门推荐"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=热门推荐&dataName=indexHotRec` })
                     }} />
                     <View className='w  row for_top'>
@@ -268,7 +270,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 口碑佳作 best_reviews*/}
                 {indexConfig['best_reviews'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexBestReviews?.showRightButton} title={indexStore?.indexBestReviews?.name || "口碑佳作"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexBestReviews?.showRightButton} title={indexStore?.indexBestReviews?.name || "口碑佳作"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=口碑佳作&dataName=indexBestReviews` })
                     }} />
                     <View className='w row'>
@@ -283,7 +285,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 经典热书 classic_books*/}
                 {indexConfig['classic_books'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexClassicBooks?.showRightButton} title={indexStore?.indexClassicBooks?.name || "经典热书"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexClassicBooks?.showRightButton} title={indexStore?.indexClassicBooks?.name || "经典热书"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=经典热书&dataName=indexClassicBooks` })
                     }} />
                     <View className='w row'>
@@ -298,7 +300,7 @@ const Index: React.FC<Props> = ({ store }) => {
                 </View>}
                 {/* 必看好书 best_books*/}
                 {indexConfig['best_books'] && <View style={{ order: indexConfig['banners'].eq }}>
-                    <BookHead showBtn={indexStore?.indexBestBooks?.showRightButton} title={indexStore?.indexBestBooks?.name || "必看好书"} fitTitle="更多" imgUrl={require('../../icon/right.png')} fitOnBack={() => {
+                    <BookHead showBtn={indexStore?.indexBestBooks?.showRightButton} title={indexStore?.indexBestBooks?.name || "必看好书"} fitTitle="更多" imgUrl={rightIcon} fitOnBack={() => {
                         Taro.navigateTo({ url: `/pages/indexMore/index?title=必看好书&dataName=indexBestBooks` })
                     }} />
                     <View className='w  row for_top'>

+ 4 - 0
src/pages/ldPage/index.config.ts

@@ -0,0 +1,4 @@
+export default {
+  navigationBarTitleText: '首页',
+  navigationStyle: 'custom',
+}

+ 0 - 0
src/pages/ldPage/index.less


+ 82 - 0
src/pages/ldPage/index.tsx

@@ -0,0 +1,82 @@
+
+
+import { View, Image } from "@tarojs/components";
+import Taro, { useRouter } from "@tarojs/taro";
+import { getPage } from "@src/server/index/index";
+import { useEffect, useState } from "react";
+function LdPage() {
+    let systemInfo = Taro.getSystemInfoSync();
+    let [data, setDate] = useState<any>(null)
+    const router = useRouter()
+    useEffect(() => {
+        let params = router.params
+        console.log("router", router.params)
+        if (params.pageId) {
+            Taro.showLoading({
+                title: '加载中',
+            })
+            getPage(params.pageId).then((res: any) => {
+                if (res.data.code === 200) {
+                    let content = res.data.data.content
+                    try {
+                        content = JSON.parse(content)
+                    } catch (error) {
+                        console.log("error", error)
+                    }
+                    let obj = {
+                    }
+                    console.log("content", content)
+                    content?.elementsSpecList?.map((item, index) => {
+                        if (item.elementType === "QR_CODE") {
+                            let url = res.data.data.qrCodeList.find(q => q.siteId == item.id)?.urlList[0]
+                            obj[item.elementType] = { ...item, url, eq: index }
+                        } else if (item.elementType === "FLOAT_BUTTON") {
+                            let url = res.data.data.qrCodeFloatList.find(q => q.siteId == item.id)?.urlList[0]
+                            console.log("url", url)
+                            obj[item.elementType] = { ...item, url, eq: index }
+                        } else if (item.elementType === "TEXT") {
+                             obj[item.elementType] = obj[item.elementType] ? [...obj[item.elementType], { ...item, eq: index }] : [{ ...item, eq: index }]
+                        } else {
+                            obj[item.elementType] = { ...item, eq: index }
+                        }
+                    })
+                    setDate({ ...res.data.data, ...obj })
+                }
+                Taro.hideLoading()
+            })
+        }
+    }, [])
+    console.log("data", data)
+    return <View >
+        <View style={{ marginTop: (systemInfo.statusBarHeight as any) + 10 }}></View>
+        {/* 标题 */}
+        <View style={{ textAlign: 'center', paddingBottom: 10 }}>&nbsp;标题</View>
+        {/* 内容 */}
+        <View style={{ height: `calc(100vh - ${(systemInfo.statusBarHeight || 0) + 32}px)`, backgroundColor: "#d5e8d6", overflowY: "auto", display: 'flex', flexFlow: 'column' }}>
+            {
+                data ? <View>
+                    {/* 顶图 */}
+                    {data["TOP_IMAGE"] && <Image src={data["TOP_IMAGE"].url} mode="widthFix" style={{ height: "auto", width: "100vw", order: data["TOP_IMAGE"].eq }} />}
+                    {/* 文本 */}
+                    {data["TEXT"] && data["TEXT"].map((textObj, index) => {
+                        return index === 0 ? <View style={{ fontSize: 24, fontWeight: "bold", color: "", padding: "10px 20px", display: 'grid', gap: 10, order: textObj.eq }}>{textObj?.text?.split(/\s/ig)?.map((item, index) => {
+                            return <View style={index === 0 ? { color: "#D0021B", marginBottom: -10 } : {}}>{item}</View>
+                        })}</View> : <View style={{ fontSize: 24, fontWeight: "bold", color: "", padding: "10px 20px", display: 'grid', gap: 10, order: textObj.eq }}>{textObj?.text?.split(/\s/ig)?.map((item, index) => {
+                            return <View>{item}</View>
+                        })}</View>
+                    })}
+                    {/* 图 */}
+                    {data["IMAGE"] && <Image src={data["IMAGE"].url} mode="widthFix" style={{ height: "auto", width: "100vw", order: data["IMAGE"].eq }} />}
+                    {/* 二维码 */}
+                    {data["QR_CODE"] && <Image src={data["QR_CODE"].url} mode="widthFix" showMenuByLongpress style={{ height: "auto", width: "70vw", display: 'block', margin: '0 auto' }} />}
+                    {/* 动图 */}
+                    <Image src={"https://app-cloud-images.oss-cn-hangzhou.aliyuncs.com/1768559009681.gif"} mode="widthFix" style={{ height: "auto", width: "100vw", marginTop: -30, paddingBottom: 70 }} />
+                    {/* 底部浮选图 */}
+                    {data["FLOAT_BUTTON"] && <Image src={data["FLOAT_BUTTON"].url} mode="widthFix" showMenuByLongpress style={{ height: "auto", width: "100vw", position: 'fixed', bottom: 0, left: 0, zIndex: 999 }} />}
+                </View> : <View></View>
+            }
+        </View>
+    </View>
+}
+
+export default LdPage;

+ 7 - 0
src/pages/my/contactService/index.less

@@ -0,0 +1,7 @@
+.content{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 100vw;
+    height: 100vh;
+}

+ 2 - 4
src/pages/my/contactService/index.tsx

@@ -2,7 +2,6 @@ import { Component } from 'react'
 import { View, Text, Image } from '@tarojs/components'
 import { observer, inject } from 'mobx-react'
 import './index.less'
-import Taro from '@tarojs/taro'
 type PageStateProps = {
     store: {
         indexStore: {
@@ -32,9 +31,8 @@ class AboutWe extends Component {
         let { indexStore } = this.props.store
         return (
             <View className='aboutWe'>
-                <View className="content">
-                    <Image src={""}  mode="widthFix" className="logo" style={{width: Taro.pxTransform(152)}}/>
-                    此处为二维码或者跳转至客服聊天功能
+                <View className="content" >
+                    <Image src={"https://app-cloud-images.oss-cn-hangzhou.aliyuncs.com/kf.png"} showMenuByLongpress  mode="widthFix" className="logo" style={{width: "80vw"}}/>
                 </View>
             </View>
         )

+ 18 - 15
src/pages/my/index.tsx

@@ -9,7 +9,10 @@ import IosShowPay from '@src/components/pay/IosShowPay'
 import GlobalModal from '@src/components/bottomModal'
 import { share } from '@src/utils'
 import { setClipboardData, showToast } from '@src/utils/compatibility'
-
+import phoneImg from '@src/icon/phone.png'
+import jtRight from '@src/icon/jtRight.png'
+import we from '@src/icon/we.png'
+import copyImg from '@src/icon/copy.png'
 interface Props {
     store: Store;
 }
@@ -75,21 +78,21 @@ function My(props: Props) {
                         <View className="name" style={userInfoStore.isAuth ? { width: Taro.pxTransform(120) } : {}}>
                             <View className='name_id'>
                                 <Text className="ID">ID:{userInfoStore?.userInfo?.nickname || userInfoStore?.userInfo?.openId}</Text>
-                                <Image onClick={copy} className='copy' lazy-load src={require('../../icon/copy.png')} />
+                                <Image onClick={copy} className='copy' lazy-load src={copyImg} />
                             </View>
-                            {
+                            {/* {
                                 userInfoStore.isVip && <View className="grade">
                                     <Image lazy-load src={require('../../icon/grade.png')} />
                                     <Text>V1</Text>
                                 </View>
-                            }
+                            } */}
                         </View>
                     </View>
                 </View>
                 {/* 付费功能 */}
                 <IosShowPay>
                     {/* vip续费  模板存在才显示*/}
-                    {!!indexStore?.rechargeTemplate?.find(item => item.templateType === 2) && <View className="bottom">
+                    {/* {!!indexStore?.rechargeTemplate?.find(item => item.templateType === 2) && <View className="bottom">
                         <View>
                             <View className="left">
                                 <Image lazy-load src={require('../../icon/VIP.png')} />
@@ -105,9 +108,9 @@ function My(props: Props) {
                             }}>{userInfoStore.isVip ? '立即续费' : '立即开通'}</View>
                         </View>
                         <Image lazy-load src={require('../../icon/vipBack.png')} />
-                    </View>}
+                    </View>} */}
                     {/*我的账户  模板存在才显示*/}
-                    {!!indexStore?.rechargeTemplate?.find(item => item.templateType === 1) && <View className='account_info'>
+                    {/* {!!indexStore?.rechargeTemplate?.find(item => item.templateType === 1) && <View className='account_info'>
                         <View className='account_info_title'>我的账户</View>
                         <View className='account_info_content'>
                             <View className='account_info_content_left'>
@@ -115,38 +118,38 @@ function My(props: Props) {
                                     <Text>{userInfoStore.userInfo?.coinNum || 0}</Text>
                                     <Text>书币</Text>
                                 </View>
-                                {/* <View className='account_info_content_text' onClick={() => { }}>
+                                <View className='account_info_content_text' onClick={() => { }}>
                                     <Text>0</Text>
                                     <Text>赠币</Text>
-                                </View> */}
+                                </View>
                             </View>
                             <View className='account_info_content_btn' onClick={(e) => {
                                 payBtn(e, "shubi")
                             }}>充值</View>
                         </View>
-                    </View>}
+                    </View>} */}
                     {/* 支付弹窗 */}
-                    <GlobalModal type={payType} isBook={false} />
+                    {/* <GlobalModal type={payType} isBook={false} /> */}
                 </IosShowPay>
                 {/* 底部功能入口 */}
                 <View className="list_bt" >
                     <Navigator className="item" url="/pages/my/contactService/index">
                         <View className="left">
-                            <Image lazy-load src={require('../../icon/phone.png')} mode="widthFix" />
+                            <Image lazy-load src={phoneImg} mode="widthFix" />
                             <Text>联系客服</Text>
                         </View>
                         <View className="right">
-                            <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
+                            <Image lazy-load src={jtRight} mode="widthFix" />
                         </View>
                     </Navigator>
                     <View className="line"></View>
                     <Navigator className="item" url="/pages/my/aboutUs/index">
                         <View className="left">
-                            <Image lazy-load src={require('../../icon/we.png')} mode="widthFix" />
+                            <Image lazy-load src={we} mode="widthFix" />
                             <Text>关于我们</Text>
                         </View>
                         <View className="right">
-                            <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
+                            <Image lazy-load src={jtRight} mode="widthFix" />
                         </View>
                     </Navigator>
                 </View>

+ 22 - 1
src/server/index/index.ts

@@ -296,4 +296,25 @@ export function getShareInfo(data) {
             reject(error);
         }
     })
-}
+}
+/**
+ * getpage*/
+export function getPage(id) {
+    return new Promise(async (resolve, reject) => {
+        try {
+            // 获取页面
+            Taro.request({
+                url: `https://api.zanxiangwl.com/corpOperation/api/landing/page/getById?id=${id}`,
+                method: 'GET',
+                success: (res) => {
+                    resolve(res)
+                },
+                fail: (err) => {
+                    reject(err);
+                }
+            })
+        } catch (error) {
+            reject(error);
+        }
+    })
+}