Browse Source

feat: 添加webview页面并优化章节状态显示

- 新增webview页面用于展示外部链接内容
- 修改环境配置为生产环境
- 优化章节列表状态标签显示和空状态提示
- 重构阅读成就设置页面的状态管理和样式
- 移除未使用的API接口定义
- 更新导航栏标题为"布丁笔录"
master
前端-胡立永 2 days ago
parent
commit
4be223c284
8 changed files with 128 additions and 74 deletions
  1. +0
    -12
      api/model/index.js
  2. +0
    -12
      api/model/order.js
  3. +1
    -1
      config.js
  4. +4
    -1
      pages.json
  5. +7
    -0
      pages/index/center.vue
  6. +25
    -5
      pages_order/author/chapterList.vue
  7. +22
    -0
      pages_order/mine/webview.vue
  8. +69
    -43
      pages_order/novel/ReaderAchievement.vue

+ 0
- 12
api/model/index.js View File

@ -1,12 +1,6 @@
// 首页相关接口 // 首页相关接口
const api = { const api = {
// 批量订阅章节
batchSubscribeBookCatalog: {
url: '/all_index/batchSubscribeBookCatalog',
method: 'GET',
auth: true,
},
// 获取首页banner // 获取首页banner
getBanner: { getBanner: {
url: '/all_index/getBanner', url: '/all_index/getBanner',
@ -73,12 +67,6 @@ const api = {
method: 'GET', method: 'GET',
auth: true, auth: true,
}, },
// 订阅章节
subscribeBook: {
url: '/all_index/subscribeBook',
method: 'GET',
auth: true,
},
// 根据书本标识进行投票 // 根据书本标识进行投票
vote: { vote: {
url: '/all_index/vote', url: '/all_index/vote',


+ 0
- 12
api/model/order.js View File

@ -25,18 +25,6 @@ const api = {
method: 'GET', method: 'GET',
auth: true, auth: true,
}, },
// 支付订单
payOrder : {
url: '/my_order/payOrder',
method: 'POST',
auth: true,
},
// 支付成功
paySuccess : {
url: '/my_order/paySuccess',
method: 'POST',
auth: true,
},
// 创建支付套餐订单 // 创建支付套餐订单
createPayPackageOrder : { createPayPackageOrder : {
url: '/my_order/createPayPackageOrder', url: '/my_order/createPayPackageOrder',


+ 1
- 1
config.js View File

@ -8,7 +8,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'local'
const type = 'prod'
// 环境配置 // 环境配置


+ 4
- 1
pages.json View File

@ -118,12 +118,15 @@
}, },
{ {
"path": "mine/recharge" "path": "mine/recharge"
},
{
"path": "mine/webview"
} }
] ]
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "小说",
"navigationBarTitleText": "布丁笔录",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"navigationStyle": "custom" "navigationStyle": "custom"


+ 7
- 0
pages/index/center.vue View File

@ -110,6 +110,13 @@
</view> </view>
<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon> <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
</view> </view>
<!-- <view class="section-item" @click="$utils.navigateTo('/pages_order/mine/webview')">
<view class="section-item-left">
<uv-icon name="star" size="40rpx" color="#333"></uv-icon>
<text>测试</text>
</view>
<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
</view> -->
</view> </view>
</view> </view>
</view> </view>


+ 25
- 5
pages_order/author/chapterList.vue View File

@ -37,10 +37,12 @@
<view class="chapter-info"> <view class="chapter-info">
<text class="chapter-title">章节名</text> <text class="chapter-title">章节名</text>
<text class="chapter-number"> <text class="chapter-number">
{{ chapter.title }} {{ chapter.title }}
<text v-if="chapter.isPay == 'Y'" class="vip-tag theme-transition">付费</text> <text v-if="chapter.isPay == 'Y'" class="vip-tag theme-transition">付费</text>
<text v-if="activeTab == 1 && chapter.state != null"
class="status-tag"
:class="'status-' + (chapter.state == 0 ? 'pending' : chapter.state == 1 ? 'approved' : chapter.state == 2 ? 'rejected' : '')">
{{ chapter.state == 0 ? '审核中' : chapter.state == 1 ? '已发布' : chapter.state == 2 ? '已驳回' : '' }}</text>
</text> </text>
</view> </view>
<uv-icon name="arrow-right" color="#999" size="28"></uv-icon> <uv-icon name="arrow-right" color="#999" size="28"></uv-icon>
@ -50,10 +52,10 @@
<!-- 空状态 --> <!-- 空状态 -->
<view style="padding-bottom: 60rpx;" <view style="padding-bottom: 60rpx;"
v-if="list.length === 0" >
v-if="list.length == 0" >
<uv-empty <uv-empty
:text="activeTab === 0 ? '还没有草稿章节' : '还没有发布章节'"
:icon="activeTab === 0 ? 'edit-pen' : 'list'"
:text="activeTab == 0 ? '还没有发布章节' : '还没有草稿章节'"
:icon="activeTab == 0 ? 'list' : 'edit-pen'"
iconSize="60" iconSize="60"
iconColor="#ccc" iconColor="#ccc"
textColor="#999" textColor="#999"
@ -256,6 +258,24 @@
padding: 2rpx 18rpx; padding: 2rpx 18rpx;
margin-left: 16rpx; margin-left: 16rpx;
} }
.status-tag {
border-radius: 20rpx;
font-size: 24rpx;
padding: 2rpx 18rpx;
margin-left: 16rpx;
}
.status-pending {
background: #ff9500;
color: #fff;
}
.status-approved {
background: #07c160;
color: #fff;
}
.status-rejected {
background: #e23d3d;
color: #fff;
}
} }
.icon-arrow { .icon-arrow {


+ 22
- 0
pages_order/mine/webview.vue View File

@ -0,0 +1,22 @@
<template>
<view>
<web-view :src="urlData"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
urlData : 'https://mp.weixin.qq.com/s/dl6c7giLLp_9UlsPyLU3CQ'
}
},
methods: {
}
}
</script>
<style>
</style>

+ 69
- 43
pages_order/novel/ReaderAchievement.vue View File

@ -4,7 +4,7 @@
<view class="achievement-card"> <view class="achievement-card">
<view class="card-title-row"> <view class="card-title-row">
<view class="card-title">阅读成就设置</view> <view class="card-title">阅读成就设置</view>
<view v-if="isPending" class="pending-tag">设置审核中</view>
<view v-if="statusText" class="status-tag" :class="statusClass">{{ statusText }}</view>
</view> </view>
<view class="achievement-list"> <view class="achievement-list">
<view class="achievement-item" <view class="achievement-item"
@ -22,7 +22,8 @@
<input class="input" <input class="input"
v-model="form[keys[index] + 'Name']" v-model="form[keys[index] + 'Name']"
placeholder="请输入" placeholder="请输入"
placeholder-class="input-placeholder" />
placeholder-class="input-placeholder"
:disabled="!canEdit" />
</view> </view>
<view class="input-area" v-if="form[keys[index] + 'Num']"> <view class="input-area" v-if="form[keys[index] + 'Num']">
<view class="label-row"> <view class="label-row">
@ -63,10 +64,10 @@
</view> </view>
</view> </view>
<view class="bottom-btn-area"> <view class="bottom-btn-area">
<button class="submit-btn" :disabled="isPending"
:class="{disabled: isPending}"
<button class="submit-btn" :disabled="!canEdit"
:class="{disabled: !canEdit}"
@click="submit"> @click="submit">
{{ form.id ? '设置' : '提交申请' }}
{{ submitButtonText }}
</button> </button>
</view> </view>
</view> </view>
@ -79,45 +80,52 @@
data() { data() {
return { return {
mixinsListApi : 'getAchievementList', mixinsListApi : 'getAchievementList',
isPending: false,
keys : ['one', 'two', 'three'], keys : ['one', 'two', 'three'],
form : {}, form : {},
} }
}, },
computed: {
//
canEdit() {
// status=0()status=1()status=2()(form.id)
return this.form.status != 0
},
//
statusText() {
//
if (!this.form.id) return ''
//
if (this.form.status == 0) return '审核中'
if (this.form.status == 1) return '已通过'
if (this.form.status == 2) return '不通过'
return ''
},
//
statusClass() {
if (this.form.status == 0) return 'status-pending'
if (this.form.status == 1) return 'status-approved'
if (this.form.status == 2) return 'status-rejected'
return ''
},
//
submitButtonText() {
if (!this.form.id) return '提交申请'
if (this.form.status == 2) return '重新提交'
return '设置'
}
},
onLoad() { onLoad() {
this.getDetail() this.getDetail()
}, },
methods: { methods: {
async getDetail(){ async getDetail(){
this.form = await this.$fetch('getAchievement') || {}
this.isPending = this.form.status == 0
const data = await this.$fetch('getAchievement') || {}
// 使
this.form = { ...data }
}, },
async submit() { async submit() {
// for (var index = 0; index < this.list.length; index++) {
// var element = this.list[index];
// if (!element.levelName) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return
// }
// }
// this.isPending = true
// let arr = []
// for (var index = 0; index < this.list.length; index++) {
// var element = this.list[index];
// arr.push(this.$fetch('setAchievementName', {
// name : element.levelName
// }))
// }
// await Promise.all(arr)
if(this.$utils.verificationAll(this.form, { if(this.$utils.verificationAll(this.form, {
oneName : '请填写' + this.list[0].title, oneName : '请填写' + this.list[0].title,
twoName : '请填写' + this.list[1].title, twoName : '请填写' + this.list[1].title,
@ -179,6 +187,29 @@
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.status-tag {
font-size: 24rpx;
border-radius: 10rpx;
padding: 6rpx 24rpx;
margin-left: 20rpx;
margin-bottom: 32rpx;
}
.status-pending {
background: #ff9500;
color: #fff;
}
.status-approved {
background: #07c160;
color: #fff;
}
.status-rejected {
background: #e23d3d;
color: #fff;
}
.achievement-list { .achievement-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -241,6 +272,11 @@
margin-bottom: 2rpx; margin-bottom: 2rpx;
} }
.input:disabled {
background: #f5f5f5;
color: #999;
}
.input-placeholder { .input-placeholder {
color: #d2d2d2; color: #d2d2d2;
font-size: 26rpx; font-size: 26rpx;
@ -279,14 +315,4 @@
background: #0a226d; background: #0a226d;
color: #fff; color: #fff;
} }
.pending-tag {
background: #807a7a;
color: #fff;
font-size: 24rpx;
border-radius: 10rpx;
padding: 6rpx 24rpx;
margin-left: 20rpx;
margin-bottom: 32rpx;
}
</style> </style>

Loading…
Cancel
Save