Merge branch 'test' of e.coding.net:g-cphe0354/duanju/new_app into gyq
This commit is contained in:
commit
96c378c54c
24
App.vue
24
App.vue
|
|
@ -1,8 +1,9 @@
|
|||
<script>
|
||||
import http from '@/http/http.js';
|
||||
import { init } from '@/api/init.js'
|
||||
import http from '@/http/http.js'
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch');
|
||||
console.log('App Launch')
|
||||
// const systemInfo = uni.getSystemInfoSync();
|
||||
// const isA = systemInfo.platform === 'android'
|
||||
// if (isA) {
|
||||
|
|
@ -10,26 +11,28 @@ export default {
|
|||
// } else {
|
||||
// uni.setStorageSync('isAI', false)
|
||||
// }
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
init()
|
||||
// ios是否在审核
|
||||
http.request({
|
||||
url: 'app/common/type/919'
|
||||
}).then((res) => {
|
||||
url: '/common/type/919',
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.setStorageSync('isExamine', res.data.value);
|
||||
uni.setStorageSync('isExamine', res.data.value)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide');
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import 'uview-plus/index.scss';
|
||||
@import "uview-plus/index.scss";
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
|
@ -86,9 +89,6 @@ web-view {
|
|||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
image {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.initStyle {
|
||||
padding: 20rpx;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
import http from '@/http/http.js'
|
||||
|
||||
// 获取弹窗信息
|
||||
export const announcement = (data) => {
|
||||
return http.request({
|
||||
url: '/announcement',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 获取公告
|
||||
export const messageselectMessage = (data) => {
|
||||
return http.request({
|
||||
url: '/message/selectMessage',
|
||||
data: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
state: 1
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取推荐视频
|
||||
export const courseselectCourse = (data) => {
|
||||
return http.request({
|
||||
url: '/course/selectCourse',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 搜索
|
||||
export const selectCourseTitles = (data) => {
|
||||
return http.request({
|
||||
url: '/course/selectCourseTitles',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import http from '@/http/http.js'
|
||||
|
||||
export async function init() {
|
||||
|
||||
//热搜词
|
||||
http.request({
|
||||
url: 'common/type/249',
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.setStorageSync('moreSearch', res.data.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@ const loadingShowTime = 200
|
|||
|
||||
function getHeader() {
|
||||
const headerObject = {}
|
||||
// headerObject["token"] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNjkyNSIsImlhdCI6MTczNTg4OTk5NCwiZXhwIjoxNzM2NDk0Nzk0fQ.j-KFEE1FHckmFCO8UA884RBWvpMv8MfEGj7GPGf3kVo6sHeORl043Yle_w7HdTZKPpQqSr2LQLCq_rUxG4qqwA'
|
||||
headerObject["token"] = uni.getStorageSync('token')
|
||||
return headerObject
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { announcement, messageselectMessage,courseselectCourse } from '@/api/index/index.js'
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
|
|
@ -91,10 +92,8 @@
|
|||
})
|
||||
|
||||
// 获取弹窗信息
|
||||
function getPop() {
|
||||
http.request({
|
||||
url: 'app/announcement',
|
||||
}).then(res => {
|
||||
async function getPop() {
|
||||
let res = await announcement()
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.state == 1) {
|
||||
datas.ruleShow = true
|
||||
|
|
@ -108,7 +107,6 @@
|
|||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
// 搜索跳转
|
||||
function moreVideo() {
|
||||
|
|
@ -117,15 +115,8 @@
|
|||
});
|
||||
}
|
||||
// 公告
|
||||
function getMsg() {
|
||||
http.request({
|
||||
url: 'app/message/selectMessage',
|
||||
data: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
state: 1
|
||||
}
|
||||
}).then(res => {
|
||||
async function getMsg() {
|
||||
let res = await messageselectMessage()
|
||||
if (res.code == 0) {
|
||||
datas.noticeList = res.data.list
|
||||
} else {
|
||||
|
|
@ -135,23 +126,20 @@
|
|||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取推荐视频
|
||||
function getrecomVideo(sort, active = 1) {
|
||||
async function getrecomVideo(sort, active = 1) {
|
||||
datas.active = active
|
||||
if (sort) {
|
||||
datas.page = 1
|
||||
}
|
||||
http.request({
|
||||
url: 'app/course/selectCourse',
|
||||
data: {
|
||||
let res = await courseselectCourse({
|
||||
page: datas.page,
|
||||
limit: 12,
|
||||
sort: sort,
|
||||
classifyId: ''
|
||||
}
|
||||
}).then(res => {
|
||||
})
|
||||
|
||||
if (res.code == 0) {
|
||||
if (datas.page == 1) {
|
||||
datas.list = res.data.list
|
||||
|
|
@ -165,7 +153,6 @@
|
|||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<u-sticky :enable="true">
|
||||
<view class="search-box">
|
||||
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" :focus="true" :show-action="true"
|
||||
:animation="true" action-text="取消" @custom="goBack()" @search="doSearch(false)"></u-search>
|
||||
:animation="true" action-text="取消" v-model="datas.keyword" @custom="goBack()"
|
||||
@search="doSearch(false)"></u-search>
|
||||
</view>
|
||||
</u-sticky>
|
||||
</view>
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { selectCourseTitles } from '@/api/index/index.js'
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
|
|
@ -34,6 +36,8 @@
|
|||
} from '@dcloudio/uni-app'
|
||||
let datas = reactive({
|
||||
hotKeywordList: [], //热搜
|
||||
keywordList: [],// 搜索列表
|
||||
keyword: "",// 搜索关键字
|
||||
})
|
||||
onShow(() => {
|
||||
getList()
|
||||
|
|
@ -46,6 +50,20 @@
|
|||
datas.hotKeywordList = []
|
||||
}
|
||||
}
|
||||
// 搜索
|
||||
async function doSearch() {
|
||||
let res = await selectCourseTitles({
|
||||
title: datas.keyword,
|
||||
limit: 20,
|
||||
page: 1,
|
||||
})
|
||||
datas.keywordList = res.data.list
|
||||
}
|
||||
|
||||
// 取消返回首页
|
||||
function goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
Loading…
Reference in New Issue