diff --git a/api/modules/book.js b/api/modules/book.js
index 9dd301e..87b657b 100644
--- a/api/modules/book.js
+++ b/api/modules/book.js
@@ -1,5 +1,91 @@
import request from "@/api/request";
+import http from "@/api/http";
export default {
+ // 删除书桌
+ async delStand(data){
+ return request({
+ url: "/books/delStand",
+ method: "POST",
+ data,
+ needToken: true,
+ })
+ },
+
+ // 加入书桌
+ async addStand(data){
+ return request({
+ url: "/books/addStand",
+ method: "POST",
+ data,
+ needToken: true,
+ })
+ },
+
+ // 查询书桌列表
+ async stand(data){
+ return request({
+ url: "/books/stand",
+ method: "GET",
+ data,
+ needToken: true,
+ })
+ },
+
+ // 查询书籍列表
+ async list(data, isDebounce = true){
+ if(isDebounce){
+ return http({
+ url: "/books/list",
+ method: "GET",
+ data,
+ debounce: 200
+ })
+ }else {
+ return request({
+ url: "/books/list",
+ method: "GET",
+ data
+ })
+ }
+ },
+
+ // 查询书籍标签
+ async label(data){
+ return request({
+ url: "/books/label",
+ method: "GET",
+ data
+ })
+ },
+
+// 获取课程列表
+ async course(data){
+ return request({
+ url: "/books/course",
+ method: "GET",
+ data
+ })
+ },
+
+
+ // 查询书籍分类
+ async category(data){
+ return request({
+ url: "/books/category",
+ method: "GET",
+ data
+ })
+ },
+
+
+ // 查询书籍详情
+ async detail(data){
+ return request({
+ url: "/books/detail",
+ method: "GET",
+ data
+ })
+ }
}
\ No newline at end of file
diff --git a/api/modules/promotion.js b/api/modules/promotion.js
index 84c5c3e..513851f 100644
--- a/api/modules/promotion.js
+++ b/api/modules/promotion.js
@@ -1,5 +1,23 @@
import request from "@/api/request";
export default {
-
+ async water(data){
+ return request({
+ url: "/promotion/water",
+ method: "GET",
+ data,
+ needToken: true
+ })
+ },
+
+
+ // 我的团队
+ async team(data){
+ return request({
+ url: "/promotion/team",
+ method: "GET",
+ data,
+ needToken: true
+ })
+ }
}
\ No newline at end of file
diff --git a/api/request.js b/api/request.js
index 314ae79..7677f26 100644
--- a/api/request.js
+++ b/api/request.js
@@ -24,7 +24,10 @@ export default function request({
icon: 'none'
})
uni.reLaunch({ url: '/subPages/login/login' })
- return
+ return Promise.reject({
+ code: 401,
+ message: '请先登录'
+ })
}
}
return new Promise((resolve, reject) => {
@@ -79,6 +82,9 @@ export default function request({
switch (res.statusCode) {
case 401:
+ uni.reLaunch({ url: '/subPages/login/login' })
+ error.message = '请先登录'
+ break;
case 403:
uni.removeStorageSync('token')
uni.reLaunch({ url: '/subPages/login/login' })
diff --git a/config/index.js b/config/index.js
index c8ac0d1..01a536e 100644
--- a/config/index.js
+++ b/config/index.js
@@ -12,14 +12,14 @@ const envParam = {
prod: 'production',
}
-const env = envParam['test']
+const env = envParam['dev']
// 全局配置
const config = {
// 网络全局配置
netConfig: {
development: {
- baseURL: 'http://h5.xzaiyp.top/englishread-admin/doc.html',
+ baseURL: 'http://h5.xzaiyp.top/englishread-admin/appletApi',
},
testing: {
baseURL: 'https://www.multipleculture.com/englishread-admin/appletApi',
diff --git a/mixins/list.js b/mixins/list.js
index e647bce..d358b63 100644
--- a/mixins/list.js
+++ b/mixins/list.js
@@ -23,7 +23,9 @@ export default {
// 列表是否需要上拉加载
isReachBottomLoad: true,
// 额外返回出去的数据的路径
- extraDataPath: ''
+ extraDataPath: '' ,
+ // 自定义onShow
+ customOnShow: false,
}
}
},
@@ -113,11 +115,11 @@ export default {
},
},
async onShow() {
- // if (!this.list.length) {
+ if (!this.mixinListConfig.customOnShow) {
if (this.mixinFnBeforePageShow) this.mixinFnBeforePageShow()
this.initPage()
await this.getList(true)
- // }
+ }
},
async onPullDownRefresh() {
// 在下拉还没结束前 不做任何操作
diff --git a/pages/index/desk.vue b/pages/index/desk.vue
index e088505..d9919b4 100644
--- a/pages/index/desk.vue
+++ b/pages/index/desk.vue
@@ -14,8 +14,12 @@
color="#C6C6C6"
height="32"
margin="0"
+ v-model="searchKeyword"
searchIconColor="#8B8B8B"
placeholderColor="#c6c6c6"
+ @search="handleSearch"
+ @clear="handleSearch"
+ @custom="handleSearch"
>
@@ -24,122 +28,125 @@
-
+
+
+
+
+
- {{ book.title }}
+ {{ book.book.booksName }}
- {{ book.grade }}/
+ {{ book.book.categoryName }}/
- {{ book.duration }}
+ {{ book.book.duration }}
+
+
@@ -189,11 +196,30 @@ export default {
border-radius: 16rpx;
overflow: hidden;
margin-bottom: 16rpx;
+ position: relative;
image {
width: 100%;
height: 100%;
}
+
+ .delete-btn {
+ position: absolute;
+ top: 8rpx;
+ right: 8rpx;
+ width: 32rpx;
+ height: 32rpx;
+ background: rgba(0, 0, 0, 0.6);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 10;
+
+ &:active {
+ background: rgba(0, 0, 0, 0.8);
+ }
+ }
}
.book-grid-info {
diff --git a/pages/index/home.vue b/pages/index/home.vue
index 0c45bde..798b46a 100644
--- a/pages/index/home.vue
+++ b/pages/index/home.vue
@@ -31,7 +31,7 @@
:class="{ active: activeTab === index }"
@click="switchTab(index)"
>
- {{ tab }}
+ {{ tab.title }}
@@ -53,93 +53,90 @@
>
-
-
-