|
@@ -69,7 +69,9 @@ const BookArticle: React.FC<BookArticleProps> = ({ store }) => {
|
|
|
for (let item of res?.data?.data?.records) {
|
|
|
let needPay = item.needPay //是否付费解锁
|
|
|
let isPay = item.isPay //是否已付费
|
|
|
- if (!showPay && needPay && !isPay) {
|
|
|
+ let vipFree = userInfoStore?.isVip && item?.vipFree
|
|
|
+ // 不是VIP 并且 没有显示支付 并且 本段落需要支付 并且 本段落没有支付解锁
|
|
|
+ if (!vipFree && !showPay && needPay && !isPay) {
|
|
|
setShowPay(true)
|
|
|
setShowVip(item.vipFree)
|
|
|
setPayBook(item)
|
|
@@ -176,6 +178,7 @@ const BookArticle: React.FC<BookArticleProps> = ({ store }) => {
|
|
|
const onLoad = async (reload?: boolean) => {
|
|
|
console.log("下拉加载")
|
|
|
if (openBookData?.contentData) {
|
|
|
+ console.log(openBookData?.contentData)
|
|
|
let { size, current, total, records } = openBookData.contentData
|
|
|
if (records.length < total || reload) {
|
|
|
console.log("加载")
|
|
@@ -185,8 +188,9 @@ const BookArticle: React.FC<BookArticleProps> = ({ store }) => {
|
|
|
for (let item of res?.data?.data?.records) {
|
|
|
let needPay = item.needPay //是否付费解锁
|
|
|
let isPay = item.isPay //是否已付费
|
|
|
- // let isVip =
|
|
|
- if (!showPay && needPay && !isPay) {
|
|
|
+ let vipFree = userInfoStore?.isVip && item?.vipFree
|
|
|
+ // 不是VIP 并且 没有显示支付 并且 本段落需要支付 并且 本段落没有支付解锁
|
|
|
+ if (!vipFree && !showPay && needPay && !isPay) {
|
|
|
setShowPay(true)
|
|
|
setShowVip(item.vipFree)
|
|
|
setPayBook(item)
|
|
@@ -317,18 +321,10 @@ const BookArticle: React.FC<BookArticleProps> = ({ store }) => {
|
|
|
let showText = true //是否显示内容
|
|
|
let arr = item.paragraphInfo.content?.match(/[^\n]*\n?/g);
|
|
|
// 是否需要付费
|
|
|
- if (!showPay && needPay && !isPay) {
|
|
|
- console.log("是否需要付费====>", item,)
|
|
|
+ let vipFree = userInfoStore?.isVip && item?.vipFree
|
|
|
+ // 不是VIP 并且 没有显示支付 并且 本段落需要支付 并且 本段落没有支付解锁
|
|
|
+ if (!vipFree && !showPay && needPay && !isPay) {
|
|
|
showText = false
|
|
|
- // setShowPay(true)
|
|
|
- // setShowVip(item.vipFree)
|
|
|
- // setPayBook(item)
|
|
|
- } else {
|
|
|
- // if (showPay) {
|
|
|
- // setShowPay(false)
|
|
|
- // setShowVip(false)
|
|
|
- // setPayBook(null)
|
|
|
- // }
|
|
|
}
|
|
|
return showText ? <View
|
|
|
id={'paragraphNo-' + item.paragraphInfo.paragraphNo}
|