sc
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 寻驾-无人机
|
||||
VITE_APP_TITLE = 耕读社
|
||||
|
||||
# 开发环境配置
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 寻驾-无人机/开发环境
|
||||
# 耕读社/开发环境
|
||||
VITE_APP_BASE_API = 'https://cloud.ahfkbg.com/'
|
||||
# VITE_APP_BASE_API = 'https://xj.ahduima.com/'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 寻驾-无人机
|
||||
VITE_APP_TITLE = 耕读社
|
||||
|
||||
# 开发环境配置
|
||||
VITE_APP_ENV = 'production'
|
||||
|
||||
18
src/App.vue
18
src/App.vue
@@ -1,29 +1,11 @@
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import { getSysConfig } from '@/jtools/api/index';
|
||||
|
||||
export default {
|
||||
onLaunch: function (options) {
|
||||
if (useUserStore().isLogin) {
|
||||
useUserStore().getUserInfo()
|
||||
}
|
||||
getSysConfig({ configKey: 'AppletShowAll', driverTypeId: -1 }).then(res => {
|
||||
let arr = []
|
||||
if(res?.data?.configValue == 1) {
|
||||
arr = [
|
||||
{ text: '首页', icon: 'home', name: '/pages/index/index' },
|
||||
{ text: '题库', icon: 'grid', name: '/pages/questionBank/index' },
|
||||
{ text: '我', icon: 'account', name: '/pages/me/index' }
|
||||
|
||||
]
|
||||
} else {
|
||||
arr = [
|
||||
{ text: '题库', icon: 'grid', name: '/pages/questionBank/index' },
|
||||
{ text: '我', icon: 'account', name: '/pages/me/index' }
|
||||
]
|
||||
}
|
||||
useUserStore().setTabbarList(arr)
|
||||
});
|
||||
},
|
||||
onShow: function (options) {
|
||||
// 如果是二维码扫描过来的,需要保存公司id
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function getExamQuestion(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionTest/test',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function getCurrentTest(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionTest/getCurrentTest',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function getExamInfo(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionTest/getQuestionTestMessageById',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 交卷
|
||||
export function submitExam(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionTest/testSubmit',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取考试记录
|
||||
export function getExamRecord(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionTest/getTestScore',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -1,94 +1,36 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function getCarTypeList(data) {
|
||||
export function getCourseList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjModel/list',
|
||||
method: 'GET',
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
export function getDriverTypeList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjDriverType/list',
|
||||
method: 'GET',
|
||||
url: 'sinology-api/sinologyLesson/page',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
// 获取章节列表
|
||||
export function getChapterOptions(data) {
|
||||
export function getCourseChapter(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjChapter/queryChapter',
|
||||
url: 'sinology-api/sinologyChapter/queryChapter',
|
||||
method: 'POST',
|
||||
data
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
export function getChapterInfo(data) {
|
||||
export function getChapterDetail(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjChapter/queryChapterInfo',
|
||||
url: 'sinology-api/sinologyChapter/getInfo',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function getChapterDoneList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjChapter/queryChapterQuestionNumWithUser',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadFile(data) {
|
||||
return request({
|
||||
url: 'wrj-api/system/file/upload',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 查询考点列表
|
||||
export function queryExamPoint(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjExamPlace/pageList',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 查询考点时间
|
||||
export function queryExamPointTime(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjExamPlace/queryDate',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 根据时间查询考点
|
||||
export function queryExamPointByTime(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjExamPlace/query',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 收藏考点
|
||||
export function collectExamPoint(placeId) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjUserCollectPlace/update?placeId=' + placeId,
|
||||
method: 'POST'
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
// 获取配置项
|
||||
export function getSysConfig(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjSysConfig/queryConfigByKey',
|
||||
url: 'sinology-api/sysConfig/queryConfigByKey',
|
||||
method: 'GET',
|
||||
data,
|
||||
noToken: true
|
||||
|
||||
@@ -2,7 +2,7 @@ import request from '../request/index.js';
|
||||
|
||||
export function login(data) {
|
||||
return request({
|
||||
url: 'wrj-api/sysUser/login',
|
||||
url: 'sinology-api/sysUser/login',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken: true
|
||||
@@ -11,14 +11,14 @@ export function login(data) {
|
||||
|
||||
export function logout() {
|
||||
return request({
|
||||
url: 'wrj-api/sysUser/loginOut',
|
||||
url: 'sinology-api/sysUser/loginOut',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: 'wrj-api/sysUser/queryUserMessage',
|
||||
url: 'sinology-api/sysUser/queryUserMessage',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function queryQuestion(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestion/queryQuestionWithUser',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function queryQuestionEmpty(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestion/queryQuestion',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function doExercise(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestionPractice/insert',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function clearPractice(params) {
|
||||
return request({
|
||||
url: `wrj-api/wrjQuestionPractice/clear?practiceType=${params.practiceType}&businessCode=${params.businessCode}`,
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
|
||||
// 收藏
|
||||
export function collectQuestion(questionId) {
|
||||
return request({
|
||||
url: `wrj-api/wrjUserCollectQuestion/update?questionId=${questionId}`,
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取收藏题目
|
||||
export function queryLikeQuestion(data) {
|
||||
return request({
|
||||
url: `wrj-api/wrjUserCollectQuestion/getUserCollectQuestion`,
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取错题
|
||||
export function queryErrorQuestion(data) {
|
||||
return request({
|
||||
url: `wrj-api/wrjUserErrorQuestion/getUserErrorQuestion`,
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取收藏的列表
|
||||
export function queryCollectList(driverTypeId) {
|
||||
return request({
|
||||
url: `wrj-api/wrjUserCollectQuestion/getUserCollectQuestionId?driverTypeId=${driverTypeId}`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
// 移除错题
|
||||
export function removeErrorQuestion(questionId) {
|
||||
return request({
|
||||
url: `wrj-api/wrjUserErrorQuestion/remove?questionId=${questionId}`,
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取首页信息
|
||||
export function queryIndexInfo(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjQuestion/getIndexData',
|
||||
method: 'GET',
|
||||
data,
|
||||
publicApi: true
|
||||
});
|
||||
}
|
||||
|
||||
// 获取考试信息
|
||||
export function queryIndexDetail(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjDriverType/detail',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function getStationList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjSchool/pageList',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
// 培训机构注册
|
||||
export function registerStation(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjSchool/insert',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
export function getStationDetail(schoolId) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjSchool/detail?schoolId=' + schoolId,
|
||||
method: 'GET',
|
||||
publicApi: true
|
||||
});
|
||||
}
|
||||
|
||||
// 收藏
|
||||
export function collectStation(schoolId) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjUserCollectSchool/update?schoolId=' + schoolId,
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取驾培机型
|
||||
export function getCarTypeList() {
|
||||
return request({
|
||||
url: 'wrj-api/wrjSchoolDriverType/list',
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
// 查询收藏的机构
|
||||
export function queryCollectList() {
|
||||
return request({
|
||||
url: 'wrj-api/wrjUserCollectSchool/myList',
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
@@ -1,45 +1,33 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function chooseType(data) {
|
||||
export function userGood(data) {
|
||||
return request({
|
||||
url: 'wrj-api/sysUser/driverTypeChoose',
|
||||
url: 'sinology-api/sinologyUserGood/click',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改用户资料
|
||||
export function updateUserInfo(data) {
|
||||
export function getUserGoodList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/sysUser/update',
|
||||
url: 'sinology-api/sinologyUserGood/query',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 教员入驻
|
||||
export function teacherRegister(data) {
|
||||
export function userLike(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjTeacher/apply',
|
||||
url: 'sinology-api/sinologyUserCollect/click',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 报名咨询
|
||||
export function applyConsult(data) {
|
||||
export function getUserLikeList(data) {
|
||||
return request({
|
||||
url: 'wrj-api/wrjClue/consult',
|
||||
url: 'sinology-api/sinologyUserCollect/query',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取收藏的考点
|
||||
export function getCollecRoomList() {
|
||||
return request({
|
||||
url: 'wrj-api/wrjUserCollectPlace/myList',
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
@@ -9,11 +9,6 @@ const useUserStore = defineStore({
|
||||
isLogin: storage.get('isLogin'), // 是否登陆
|
||||
userInfo: {}, // 用户信息
|
||||
sellManId: '', // 分销人id
|
||||
currentType: {
|
||||
modelId: '10001',
|
||||
typeId: '20021',
|
||||
showName: '多旋翼 - 视距内驾驶员'
|
||||
},
|
||||
tabbarList: []
|
||||
}),
|
||||
|
||||
@@ -87,13 +82,6 @@ const useUserStore = defineStore({
|
||||
storage.remove('token');
|
||||
storage.remove('userInfo');
|
||||
},
|
||||
setType(modelId, typeId, showName) {
|
||||
this.currentType = {
|
||||
modelId,
|
||||
typeId,
|
||||
showName
|
||||
};
|
||||
},
|
||||
setTabbarList(list) {
|
||||
this.tabbarList = list;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "寻驾-无人机",
|
||||
"name": "耕读社",
|
||||
"appid": "__UNI__59447F7",
|
||||
"description": "",
|
||||
"versionName": "1.0.2",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "寻驾-无人机",
|
||||
"navigationBarTitleText": "耕读社",
|
||||
"navigationBarBackgroundColor": "#FFF",
|
||||
"backgroundColor": "#FFF"
|
||||
},
|
||||
|
||||
@@ -2,46 +2,70 @@
|
||||
<view class="p15">
|
||||
<view class="chapter_item" v-for="(item, index) of chapterList" :key="index" @tap="toDetail(item)">
|
||||
<view style="line-height: 20px;">
|
||||
<text class="j-tag" style="background: #DDEEFF;color: #1A8CFE">第{{ String(index+1).padStart(2,'0') }}讲·庄子</text>
|
||||
<text class="fs14 ml5 ">阴极阳转,阳转阴转,实现生命永恒的自然轮转</text>
|
||||
<text class="j-tag" style="background: #DDEEFF;color: #1A8CFE">{{ item.chapterIndex }}</text>
|
||||
<text class="fs14 ml5 ">{{ item.chapterName }}</text>
|
||||
</view>
|
||||
<view class="mt10 flex ai-c jc-sb fs12 mt8 cor-999">
|
||||
<text>郭老师</text>
|
||||
<text>2020-01-01 19:00</text>
|
||||
<view class="flex ai-c">
|
||||
<u-icon name="eye" color="#999" size="14" :label="index*7" label-color="#999" label-size="12"></u-icon>
|
||||
<u-icon class="ml20" name="thumb-up" color="#999" size="14" :label="index*3" label-color="#999" label-size="12"></u-icon>
|
||||
<u-icon name="eye" color="#999" size="14" :label="item.browseCount" label-color="#999" label-size="12"></u-icon>
|
||||
<u-icon class="ml20" name="thumb-up" color="#999" size="14" :label="item.goodCount" label-color="#999" label-size="12"></u-icon>
|
||||
</view>
|
||||
<text>{{ item.author }}</text>
|
||||
<text>{{ item.publicTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getChapterDoneList } from '@/jtools/api/index'
|
||||
import { getCourseChapter } from '@/jtools/api/index'
|
||||
import { mapState } from 'pinia'; //引入映射函数
|
||||
import useUserStore from '@/jtools/store/user'; //引入store
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState(useUserStore, ['isLogin'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chapterList:[],
|
||||
chapterList: [],
|
||||
lessonId: undefined
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.getChapterList()
|
||||
onLoad(op){
|
||||
this.lessonId = op.id
|
||||
this.getChapterList(op.id)
|
||||
},
|
||||
onShow() {
|
||||
if(this.lessonId) {
|
||||
this.getChapterList(this.lessonId)
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getChapterList(){
|
||||
this.chapterList = [1,2,3]
|
||||
// getChapterDoneList({driverTypeId}).then(resp=>{
|
||||
// if(resp.code==='0000'){
|
||||
// this.chapterList=resp.data
|
||||
// }
|
||||
// })
|
||||
getChapterList(lessonId){
|
||||
getCourseChapter({lessonId}).then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.chapterList=resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(chapter){
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/detail?id=${chapter.id}`
|
||||
if(!this.isLogin){
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/login'
|
||||
});
|
||||
}, 1500);
|
||||
return
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/detail?id=${chapter.chapterId}`
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -59,11 +83,7 @@
|
||||
}
|
||||
|
||||
.j-tag {
|
||||
// display: inline-flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
padding: 1px 3px;
|
||||
// height: 16px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,22 +1,22 @@
|
||||
<template>
|
||||
<view class="wp100 hp100">
|
||||
<view class="p5" style="background-color: #fff;">
|
||||
<u-search v-model="queryParams.placeName" placeholder="搜索标题/作者" :showAction="false"
|
||||
<u-search v-model="queryParams.searchValue" placeholder="搜索标题/作者" :showAction="false"
|
||||
@search="handleSearch">搜索</u-search>
|
||||
</view>
|
||||
<u-list v-if="pageList.length > 0" @scrolltolower="scrolltolower" class="course-list">
|
||||
<u-list-item v-for="(item, index) in pageList" :key="index">
|
||||
<view class="flex ai-c jc-sb p10lr p5tb bc-fff" @click="handleClick(item)">
|
||||
<view class="flex ai-c">
|
||||
<image src="https://ss-cloud.ahduima.com/wrj/file/1949715991365947392.jpg" mode="aspectFill" style="width: 160px;height: 100px;border-radius: 6px;" />
|
||||
<image :src="item.image" mode="aspectFill" style="width: 160px;height: 100px;border-radius: 6px;" />
|
||||
</view>
|
||||
<view class="flex-1 ml10 overflow-h">
|
||||
<view class="fs14">课程标题 {{ index + 1 }}</view>
|
||||
<view class="fs13 mt8 cor-999 text-ellipsis">课程简介内容,简要描述课程内容和目标。</view>
|
||||
<view class="fl1 ml10 overflow-h">
|
||||
<view class="fs14">{{ item.lessonName }}</view>
|
||||
<view class="fs13 mt8 cor-999 text-ellipsis">{{ item.introduction }}</view>
|
||||
<view class="flex ai-c jc-sb fs12 mt8 cor-999">
|
||||
<u-icon name="eye" color="#999" size="14" :label="index*7" label-color="#999" label-size="12"></u-icon>
|
||||
<u-icon name="thumb-up" color="#999" size="14" :label="index*3" label-color="#999" label-size="12"></u-icon>
|
||||
<text>2020-01-01 19:00</text>
|
||||
<u-icon name="eye" color="#999" size="14" :label="item.browseCount" label-color="#999" label-size="12"></u-icon>
|
||||
<u-icon name="thumb-up" color="#999" size="14" :label="item.goodCount" label-color="#999" label-size="12"></u-icon>
|
||||
<text>{{ item.author }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -27,13 +27,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCourseList } from '@/jtools/api/index'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
placeName: '',
|
||||
searchValue: '',
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -55,18 +57,16 @@
|
||||
this.getPageList()
|
||||
},
|
||||
getPageList() {
|
||||
this.pageList = [1,2,3]
|
||||
this.total = 3
|
||||
// const _this = this
|
||||
// const params = { ...this.queryParams }
|
||||
// queryExamPoint(params).then(res => {
|
||||
// _this.pageList = [..._this.pageList, ...res.data.records]
|
||||
// _this.total = res.data.total
|
||||
// });
|
||||
const _this = this
|
||||
const params = { ...this.queryParams }
|
||||
getCourseList(params).then(res => {
|
||||
_this.pageList = [..._this.pageList, ...res.data.records]
|
||||
_this.total = res.data.total
|
||||
});
|
||||
},
|
||||
handleClick(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/chapter`
|
||||
url: `/pages/course/chapter?id=${item.lessonId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,82 @@
|
||||
<template>
|
||||
<view>我的点赞</view>
|
||||
<view>
|
||||
<u-list v-if="pageList.length > 0" @scrolltolower="scrolltolower" class="course-list">
|
||||
<u-list-item v-for="(item, index) in pageList" :key="index">
|
||||
<view class="flex ai-c jc-sb p10lr p5tb bc-fff" @click="handleClick(item)">
|
||||
<view class="flex ai-c">
|
||||
<image :src="item.image" mode="aspectFill" style="width: 150px;height: 100px;border-radius: 6px;" />
|
||||
</view>
|
||||
<view class="fl1 ml10">
|
||||
<view class="fs14">{{ item.lessonName }}</view>
|
||||
<view class="fs13 mt8 cor-999">
|
||||
<text class="j-tag" style="background: #DDEEFF;color: #1A8CFE">{{ item.chapterIndex }}</text>
|
||||
<text>{{ item.chapterName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<u-empty v-else mode="list" text="暂无数据"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import { getUserGoodList } from '@/jtools/api/user'
|
||||
import { mapState } from 'pinia'; //引入映射函数
|
||||
import useUserStore from '@/jtools/store/user'; //引入store
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState(useUserStore, ['userInfo'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.handleSearch()
|
||||
},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
if (this.pageList.length < this.total) {
|
||||
this.queryParams.pageNo++
|
||||
this.getPageList()
|
||||
}
|
||||
},
|
||||
handleSearch() {
|
||||
this.pageList = []
|
||||
this.queryParams.pageNo = 1
|
||||
this.getPageList()
|
||||
},
|
||||
getPageList() {
|
||||
const _this = this
|
||||
const params = { ...this.queryParams, userId: this.userInfo.userId }
|
||||
getUserGoodList(params).then(res => {
|
||||
_this.pageList = [..._this.pageList, ...res.data.records]
|
||||
_this.total = res.data.total
|
||||
});
|
||||
},
|
||||
handleClick(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/detail?id=${chapter.chapterId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.j-tag {
|
||||
padding: 1px 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -17,10 +17,6 @@
|
||||
<u-cell-group :customStyle="{ 'background-color': '#fff', 'margin-top': '10px', 'border-radius': '8px' }">
|
||||
<u-cell icon="thumb-up" size="large" title="我的点赞" isLink @tap="next('/pages/me/good')"></u-cell>
|
||||
<u-cell icon="heart" size="large" title="我的收藏" isLink @tap="next('/pages/me/like')"></u-cell>
|
||||
<!-- <button open-type="share" class="share">
|
||||
<u-cell icon="share" title="分享" size="large" isLink></u-cell>
|
||||
</button> -->
|
||||
<!-- <u-cell v-if="isLogin" icon="thumb-up" size="large" title="我的关注" isLink @tap="next('/pages/me/look')"></u-cell> -->
|
||||
|
||||
<u-cell icon="level" size="large" title="当前版本" :value="version"></u-cell>
|
||||
<u-cell icon="phone" size="large" title="联系我们" :value="contactInfo.configDesc" isLink @tap="makePhone"></u-cell>
|
||||
|
||||
@@ -1,13 +1,86 @@
|
||||
<template>
|
||||
<view>我的收藏</view>
|
||||
<view>
|
||||
<u-list v-if="pageList.length > 0" @scrolltolower="scrolltolower" class="course-list">
|
||||
<u-list-item v-for="(item, index) in pageList" :key="index">
|
||||
<view class="flex ai-c jc-sb p10lr p5tb bc-fff" @click="handleClick(item)">
|
||||
<view class="flex ai-c">
|
||||
<image :src="item.image" mode="aspectFill" style="width: 150px;height: 100px;border-radius: 6px;" />
|
||||
</view>
|
||||
<view class="fl1 ml10">
|
||||
<view class="fs14">{{ item.lessonName }}</view>
|
||||
<view class="fs13 mt8 cor-999">
|
||||
<text class="j-tag" style="background: #DDEEFF;color: #1A8CFE">{{ item.chapterIndex }}</text>
|
||||
<text>{{ item.chapterName }}</text>
|
||||
</view>
|
||||
<view class="mt5 flex ai-c jc-sb fs13 cor-999">
|
||||
<text>{{ item.author }}</text>
|
||||
<text>{{ item.publicTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<u-empty v-else mode="list" text="暂无数据"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import { getUserLikeList } from '@/jtools/api/user'
|
||||
import { mapState } from 'pinia'; //引入映射函数
|
||||
import useUserStore from '@/jtools/store/user'; //引入store
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState(useUserStore, ['userInfo'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.handleSearch()
|
||||
},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
if (this.pageList.length < this.total) {
|
||||
this.queryParams.pageNo++
|
||||
this.getPageList()
|
||||
}
|
||||
},
|
||||
handleSearch() {
|
||||
this.pageList = []
|
||||
this.queryParams.pageNo = 1
|
||||
this.getPageList()
|
||||
},
|
||||
getPageList() {
|
||||
const _this = this
|
||||
const params = { ...this.queryParams, userId: this.userInfo.userId }
|
||||
getUserLikeList(params).then(res => {
|
||||
_this.pageList = [..._this.pageList, ...res.data.records]
|
||||
_this.total = res.data.total
|
||||
});
|
||||
},
|
||||
handleClick(chapter) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/detail?id=${chapter.chapterId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.j-tag {
|
||||
padding: 1px 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user