学习中心接口联调

feature/v-xuexi
wangdong 10 months ago
parent 0c981a57ba
commit 982820b5d1
  1. 5
      api/learning.js
  2. 4
      api/special.js
  3. 8
      components/Course/offlineStyleCourse.vue
  4. 2
      components/Course/squareStyleCourse.vue
  5. 8
      components/NavBar/index.vue
  6. 50
      pages/activity/activity_list.vue
  7. 14
      pages/course/special_cate.vue
  8. 26
      pages/index/getLocation.js
  9. 122
      pages/index/index.vue
  10. 181
      pages/learning/index.vue
  11. 6
      pages/mine/index.vue
  12. 4
      pages/my/bill_detail.vue
  13. 6
      pages/special/specialCateCourse.vue
  14. 37
      pages/store/goodsCate.vue
  15. 2
      pages/store/index.vue
  16. 1
      store/modules/app.js

@ -0,0 +1,5 @@
import http from "@/utils/request";
export function getLearningData(params){
return http.get("/clearance/grade_index", params)
}

@ -424,4 +424,8 @@ export function groupWorks(){
return http.get("/special/groupWork",{},{
requireAuth:false
})
}
export function getSpecialSubject(){
return http.get("/special/getSpecialSubject",{})
}

@ -2,21 +2,21 @@
<view>
<view v-for="item in specialList" :key="item.id" class="offline-special-item flex" @click="getJumpUrl(item)">
<view class="image">
<image :src="item.pic" mode="aspectFill" :alt="item.title" />
<image :src="item.image" mode="aspectFill" :alt="item.title" />
</view>
<view class="text">
<view class="special-title">{{ item.title }}</view>
<view class="advert-info">
<image src="@/static/images/advert-time.png" mode="aspectFill"></image>
报名时间{{ item.apply_start_time }} - {{ item.apply_end_time }}
报名时间{{ item.baoming }}
</view>
<view class="advert-info">
<image src="@/static/images/advert-time.png" mode="aspectFill"></image>
活动时间{{ item.start_time }} - {{ item.end_time }}
活动时间{{ item.start }}
</view>
<view class="advert-info">
<image src="@/static/images/advert-position.png" mode="aspectFill"></image>
活动地址{{ item.address }}
活动地址{{ item.province }}{{ item.city }}{{ item.district }}{{ item.detail }}
</view>
</view>
</view>

@ -7,7 +7,7 @@
<view class="text">
<view class="special-title">{{ item.title }}</view>
<view class="special-info">
<view v-if="item.type == 3" class="type">视频</view>
<view v-if="(item.type || item.special_type) == 3" class="type">视频</view>
<view v-else class="type">直播</view>
<view class="count">{{ item.count }}人已学</view>
</view>

@ -1,7 +1,7 @@
<template>
<!-- #ifndef MP-TOUTIAO -->
<view class="nav-box" :class="[fixed ? 'fixed' : 'pos', blueTheme ? 'blue-theme' : '']" :style="{'background-color':backGround,'color':titleFontColor}">
<view class="left-btn-box btn-box abs flex flex-center" @click="handleBack">
<view v-if="showBack" class="left-btn-box btn-box abs flex flex-center" @click="handleBack">
<image mode="aspectFill" class="back-btn" :src="backIcon" />
@ -45,7 +45,11 @@ export default {
titleFontColor:{
type:String,
default:"#black"
}
},
showBack: {
type: Boolean,
default: true,
}
},
methods: {
handleBack() {

@ -6,14 +6,15 @@
<navigator v-for="(item, index) in activityList" :key="index" :url="'/pages/activity/index?id='+item.id" class="item">
<view class="image">
<image :src="item.image" class="img">
<view class="label" :class="{'active': item.end_time > new Date().getTime() }">{{ item.end_time > new Date().getTime() ? '进行中' : '已结束' }}</view>
</view>
<view class="text">
<view class="name">{{ item.title }}</view>
<view class="time">
<text class="iconfont iconshijian2"></text>报名时间{{ item.time }}
<text class="iconfont iconshijian2"></text>报名时间{{ item.baoming }}
</view>
<view class="time">
<text class="iconfont iconshijian2"></text>活动时间{{ item.time }}
<text class="iconfont iconshijian2"></text>活动时间{{ item.start }}
</view>
<view class="time">
<text class="iconfont icondidian"></text>活动地址{{ item.province }}{{ item.city }}{{ item.district }}{{ item.detail }}
@ -34,6 +35,7 @@
getActivityList,
getActivityDetail
} from "@/api/activity";
import store from "@/store";
export default {
data() {
@ -43,14 +45,21 @@
loading: false,
loadend: false,
page: 1,
limit: 20
limit: 20,
gradeId: '',
subjectId: '',
};
},
watch: {},
created() {
this.getActivityList();
// this.init();
},
computed: {
position() {
return store.getters.position;
},
},
onLoad(options) {
this.gradeId = options.gradeId;
this.subjectId = options.subjectId;
this.getActivityList();
},
methods: {
init: function () {
var that = this;
@ -65,7 +74,7 @@
if (that.loadend) return;
that.loadTitle = '';
that.loading = true;
getActivityList({ page: that.page, limit: that.limit }).then(res => {
getActivityList({ page: that.page, limit: that.limit, city: this.position, grade_id: this.gradeId, subject_id: this.subjectId }).then(res => {
let list = res.data;
that.activityList.push.apply(that.activityList, list);
that.loadend = list.length < that.limit;
@ -111,6 +120,29 @@
margin: 20rpx auto;
background: #fff;
padding: 25rpx 20rpx 32rpx;
.image{
position: relative;
.label {
width: 92rpx;
height: 39rpx;
border-radius: 6rpx 0rpx 6rpx 0rpx;
background: #535353;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(68,68,68,0.04);
color: #fff;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
&.active {
background: #FFEDE9;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(68,68,68,0.04);
color: #FF4B33;
}
}
}
.img {
width: 200rpx;
height: 160rpx;

@ -39,7 +39,7 @@
</view>
<line-style-course v-if="item.menuName === '我的课程'" :specialList="specialData[item.key]" @detail="(item) => { handleSpecialClick(item, 'my'); }"></line-style-course>
<square-style-course v-if="item.menuName === '热门课程'" :specialList="specialData[item.key]" @detail="handleSpecialClick"></square-style-course>
<offline-style-course v-if="item.menuName === '线下课堂'" :specialList="specialData[item.key]" @detail="handleSpecialClick"></offline-style-course>
<offline-style-course v-if="item.menuName === '线下课堂'" :specialList="specialData[item.key]"></offline-style-course>
<!-- 线下活动 -->
<!-- <view v-if="item.menuName === '线下课堂'" class="activity-offline">
<view class="list">
@ -196,13 +196,15 @@ import Advert from '@/components/Advert/index.vue';
});
} else {
uni.navigateTo({
url: `/pages/special/search?specialType=${key || ''}`
url: `/pages/special/search?specialType=0`
});
}
},
showCateCourse(item) {
if (item.name === '全部分类') {
uni.navigateTo({
url: '/pages/store/goodsCate?type=special'
});
} else {
uni.navigateTo({
url: `/pages/special/specialCateCourse?name=${item.name}&gradeId=${item.grade_id}&subjectId=${item.id}`,
@ -403,7 +405,6 @@ import Advert from '@/components/Advert/index.vue';
margin: 30rpx 30rpx;
width: 690rpx;
border-radius: 10rpx;
padding: 15rpx 16rpx 0;
}
.goodsClass .nav .item {
min-width: 0;
@ -412,11 +413,8 @@ import Advert from '@/components/Advert/index.vue';
text-align: center;
color: #666666;
word-break: break-all;
margin-right: 45rpx;
margin-bottom: 32rpx;
&:nth-child(4n) {
margin-right: 0;
}
width: 25%;
}
.goodsClass .nav .item .text {

@ -1,7 +1,7 @@
import permision from '../../libs/permission.js'
// 主函数
export const getLocation = async () => {
export const getLocation = async (callback) => {
return new Promise((resolve, reject) => {
uni.getSystemInfo({
success: res => {
@ -16,14 +16,20 @@ export const getLocation = async () => {
if (uniPlatform == "app") {
// 获取当前手机是否开启或关闭了定位服务
let isLocationPermision = permision.checkSystemEnableLocation();
if (!isLocationPermision) mShowModel("手机定位服务未开启,请到设置界面开启", '');
if (!isLocationPermision)
callback();
// mShowModel("手机定位服务未开启,请到设置界面开启", '');
if (isLocationPermision) {
let permisionStr = osName == "ios" ? "location" : "android.permission.ACCESS_FINE_LOCATION";
// 验证app是否被授权了获取位置权限
let result = osName == "ios" ? iosPermision(permisionStr) :
androidPermision(permisionStr).then(res => {
if (res == -1) mShowModel("你已拒绝获取位置信息授权,请到权限管理进行授权", "授权");
if (res == 0) mShowModel("应用未获取位置信息授权,请到权限管理进行授权", "授权");
if (res == -1)
callback();
// mShowModel("你已拒绝获取位置信息授权,请到权限管理进行授权", "授权");
if (res == 0)
callback();
// mShowModel("应用未获取位置信息授权,请到权限管理进行授权", "授权");
if (res == 1) getCoordinate().then(res => {
resolve(res);
})
@ -34,7 +40,7 @@ export const getLocation = async () => {
}
}
if (uniPlatform == "mp-weixin") weiXinPermision(locationEnabled,
locationAuthorized).then(res => {
locationAuthorized, callback).then(res => {
console.log(res, 38)
if (res == true) getCoordinate().then(res => {
resolve(res);
@ -60,10 +66,11 @@ const androidPermision = async (permisionStr) => {
})
}
const weiXinPermision = async (locationEnabled, locationAuthorized) => {
const weiXinPermision = async (locationEnabled, locationAuthorized, callback) => {
return new Promise((resolve, reject) => {
if (locationEnabled == false) {
mShowModel("手机定位服务未开启,请到设置界面进行开启", '');
// mShowModel("手机定位服务未开启,请到设置界面进行开启", '');
callback();
} else {
// 手机定位服务(GPS)已授权
uni.authorize({
@ -99,7 +106,8 @@ const weiXinPermision = async (locationEnabled, locationAuthorized) => {
}
})
} else {
mShowToast("你拒绝了授权,无法获取位置信息")
// mShowToast("你拒绝了授权,无法获取位置信息")
callback();
}
}
})
@ -154,6 +162,8 @@ const mShowModel = (content, confirmText) => {
if (confirmText) {
permision.gotoAppPermissionSetting();
}
} else {
}
},
fail: (e) => {

@ -47,7 +47,7 @@
</view>
</view>
</view>
<!-- 广告 -->
<!-- 广告 -->
<!-- <view v-for="(item, index) in recommend" v-if="item.type === 13">
<recommend-poster :advert-list="item.list"></recommend-poster>
</view> -->
@ -93,41 +93,7 @@
</view>
</view> -->
<advert />
<view class="special-content">
<view class="special-content-title">
梦航课堂
<text class="more-special" @click="toMenu('/pages/course/special_cate')">更多 ></text>
</view>
<square-style-course :specialList="specialList" @detail="handleSpecialClick"></square-style-course>
</view>
<advert />
<view class="special-content">
<view class="special-content-title">
知识商城
<text class="more-special" @click="toMenu('/pages/store/index')">更多 ></text>
</view>
<view class="goodsList">
<navigator hover-class="none" v-for="item in goodsList" :key="item.id" class="item"
:url="'/pages/store/detail?id=' + item.id">
<view class="image">
<image mode="aspectFit" class="img" :src="item.image" alt="" />
</view>
<view class="text">
<view class="title">{{ item.store_name }}</view>
<view class="label flex">
<view v-for="(label, k) in item.label">{{ label }}</view>
</view>
<view class="group">
<view class="price">
<span class="num">{{ item.price }}</span>
</view>
<view class="sale-num">已售{{ item.sales || 0 }}</view>
</view>
</view>
</navigator>
</view>
</view>
<!-- 自定义排版 -->
<!-- 自定义排版 -->
<template v-if="recommend.length">
<view v-for="(item, index) in recommend" >
<!--直播-->
@ -174,7 +140,40 @@
</swiper>
</view>
</view>
<view v-if="item.type === 0 && item.list.length" class="special-content">
<view class="special-content-title">
{{ item.title }}
<text class="more-special" @click="toMenu('/pages/course/special_cate')">更多 ></text>
</view>
<square-style-course :specialList="item.list" @detail="handleSpecialClick"></square-style-course>
</view>
<view v-if="item.type === 4 && item.list.length" class="special-content">
<view class="special-content-title">
{{ item.title }}
<text class="more-special" @click="toMenu('/pages/store/index')">更多 ></text>
</view>
<view class="goodsList">
<navigator hover-class="none" v-for="item in item.list" :key="item.id" class="item"
:url="'/pages/store/detail?id=' + item.id">
<view class="image">
<image mode="aspectFit" class="img" :src="item.image" alt="" />
</view>
<view class="text">
<view class="title">{{ item.store_name }}</view>
<view class="label flex">
<view v-for="(label, k) in item.label">{{ label }}</view>
</view>
<view class="group">
<view class="price">
<span class="num">{{ item.price }}</span>
</view>
<view class="sale-num">已售{{ item.sales || 0 }}</view>
</view>
</view>
</navigator>
</view>
</view>
<!-- 讲师 -->
<view v-else-if="item.type === 6 && item.list.length" class="teacher">
<view class="teacher-hd">
@ -438,7 +437,7 @@
</view>
</view>
<!-- 小图 -->
<view v-if="item.typesetting == 3 && item.list.length" :key="item.id" class="interest">
<!-- <view v-if="item.typesetting == 3 && item.list.length" :key="item.id" class="interest">
<view class="public_title acea-row row-between-wrapper">
<view class="name" v-text="item.title"></view>
<navigator v-if="item.type !== 10" :url="getNavHref(item)" hover-class="none"
@ -490,7 +489,7 @@
</view>
</navigator>
</view>
</view>
</view> -->
<!-- 宫图 -->
<view v-if="item.typesetting == 2 && item.id != 31 && item.list.length" :key="item.id" class="interest english">
<view class="public_title acea-row row-between-wrapper">
@ -607,8 +606,6 @@ export default {
topFocus: true,
groupWork: {},
ICP: {},
specialList: [],
goodsList: [],
scrollTop: 0,
unReadMsgNum: 0,
};
@ -628,17 +625,20 @@ export default {
wx.setNavigationBarTitle({
title:"一合知道"
});
if (!this.$util.getStorage('position')) {
getLocation(() => {
this.$store.commit("app/" + SET_POSITION, '南京');
}).then(res => {
console.log(res);
this.getPositionAddress(res.lng, res.lat);
});
} else {
this.$store.commit("app/" + SET_POSITION, this.$util.getStorage('position'));
}
this.getIndexData();
this.getSpecialList();
this.getGoodsList();
this.getNewsList();
this.getgroupWork();
this.getUnReadMsgNum();
if (!this.currentPosition) {
getLocation().then(res => {
this.getPositionAddress(res.lng, res.lat);
});
}
},
created() {
//#ifdef MP-WEIXIN
@ -679,18 +679,6 @@ export default {
}
});
},
async getSpecialList() {
try {
const { data } = await getSpecialList({
page: 1,
limit: 4,
});
this.specialList = data;
} catch (err) {
console.log(err);
}
},
async getUnReadMsgNum() {
try {
const { data } = await unReadMsgNum({});
@ -710,20 +698,6 @@ export default {
});
// }, this.showLoginPage);
},
async getGoodsList() {
try {
const { data } = await getGoodsList({
page: 1,
limit: 3,
});
this.goodsList = data;
} catch (err) {
console.log(err);
}
this.loading = false;
},
toMenu(url) {
uni.switchTab({
url,

@ -1,9 +1,10 @@
<template>
<BaseContainer class="learning" :fixedNav="false">
<NavBar v-if="scrollTop > 20" title="学习中心" :showBack="false" />
<view class="learning-box">
<view class="swiper-box">
<swiper class="custom-banner" indicator-dots autoplay @click="handleBannerClick" >
<swiper-item v-for="(item, index) in banner" :key="index" :data-url="item.url" class="swiper-item">
<swiper-item v-for="(item, index) in learningData.banner" :key="index" :data-url="item.url" class="swiper-item">
<image :data-url="item.url" mode="aspectFill" :src="item.pic" :alt="item.title" />
</swiper-item>
</swiper>
@ -62,61 +63,55 @@
<view class="practice flex">
2021-2022英语四级考试真题 <text>开始练习</text>
</view>
<view class="tab-container">
<view v-if="learningData.recite && learningData.recite.length > 0" class="tab-container">
<view class="content-title">
刷题过关
背诵过关
<text class="more-content">更多 ></text>
</view>
<view class="flex tab-content">
<view :data-idx="index" class="tab-item" v-for="(item, index) in categoryList" :key="item.id" @click="handleCateClick(item)">
<image :src="item.pic" mode="aspectFill"></image>
<view :data-idx="index" class="tab-item" v-for="(item, index) in learningData.recite" :key="item.id" @click="handleCateClick(item)">
<image :src="item.image" mode="aspectFill"></image>
<view>{{ item.name }}</view>
</view>
</view>
<advert :img="'/static/frontend/learning-advert.png'" :height="140"/>
</view>
<advert :img="'/static/frontend/learning-advert.png'" :height="140"/>
<view class="tab-container">
<view v-if="learningData.brush_questions && learningData.brush_questions.length > 0" class="tab-container">
<view class="content-title">
视频课
刷题过关
<text class="more-content">更多 ></text>
</view>
<view class="flex tab-content">
<view :data-idx="index" class="tab-item" v-for="(item, index) in categoryList" :key="item.id" @click="handleCateClick(item)">
<image :src="item.pic" mode="aspectFill"></image>
<view :data-idx="index" class="tab-item" v-for="(item, index) in learningData.brush_questions" :key="item.id" @click="handleCateClick(item)">
<image :src="item.image" mode="aspectFill"></image>
<view>{{ item.name }}</view>
</view>
</view>
<advert :img="'/static/frontend/learning-advert.png'" :height="140"/>
</view>
<advert :img="'/static/frontend/learning-advert.png'" :height="140"/>
<template v-for="(item, index) in indexMenu">
<view v-if="specialData[item.key] && specialData[item.key].length > 0" :key="index" class="special-content">
<view v-if="learningData[item.key] && learningData[item.key].length > 0" :key="index" class="special-content">
<view class="content-title">
{{ item.menuName }}
<text v-if="item.menuName !== '线下课堂'" class="more-content">更多 ></text>
<text v-if="item.menuName !== '线下课堂'" class="more-content" @click="toMoreCourse(item.key)">更多 ></text>
</view>
<square-style-course v-if="item.menuName === '直播课'" :specialList="specialData[item.key]" @detail="handleSpecialClick"></square-style-course>
<offline-style-course v-if="item.menuName === '线下课堂'" :specialList="specialData[item.key]" @detail="handleOfflineClick"></offline-style-course>
<square-style-course v-if="item.menuName === '视频课'" :specialList="learningData[item.key]" @detail="handleSpecialClick"></square-style-course>
<square-style-course v-if="item.menuName === '直播课'" :specialList="learningData[item.key]" @detail="handleSpecialClick"></square-style-course>
<offline-style-course v-if="item.menuName === '线下课堂'" :specialList="learningData[item.key]"></offline-style-course>
</view>
</template>
<view class="special-content">
<view class="content-title">
课程
<text class="more-content" @click="toMoreCourse">更多 ></text>
</view>
<square-style-course :specialList="specialList" @detail="handleSpecialClick"></square-style-course>
</view>
</view>
</view>
<!-- <message-box title="确认收货?" @submit="console.log('提交')"></message-box> -->
</BaseContainer>
</template>
<script>
import { getGoodsCateList, getIndexData } from "@/api/store";
import { getSpecialIndexData, getSpecialList } from "@/api/special";
import { getLearningData } from '@/api/learning';
import Advert from '@/components/Advert/index.vue';
import SquareStyleCourse from '@/components/Course/squareStyleCourse.vue';
import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
import MessageBox from '@/components/Message/index.vue';
import store from "@/store";
export default {
components: {
@ -127,8 +122,6 @@ import MessageBox from '@/components/Message/index.vue';
},
data() {
return {
banner: [],
categoryList: [],
loading: false,
myExam: {
examName: '职业技能考试',
@ -146,19 +139,33 @@ import MessageBox from '@/components/Message/index.vue';
currentRank: '--',
},
indexMenu: [
{ menuName: '直播课', key: 'hot_course' },
{ menuName: '视频课', key: 'video' },
{ menuName: '直播课', key: 'live' },
{ menuName: '线下课堂', key: 'offline_courses' },
],
specialData: [],
specialList: [],
learningData: {},
scrollTop: 0,
};
},
computed: {
position() {
return store.getters.position;
},
},
watch: {
myExam: {
deep: true,
handler() {
this.getLearningData();
},
}
},
onLoad() {
this.getGoodsCateList();
this.getIndexData();
this.getSpecialIndexData();
this.getSpecialList();
this.getLearningData();
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onShareAppMessage() {
return {};
},
@ -168,40 +175,16 @@ import MessageBox from '@/components/Message/index.vue';
mounted() {
},
methods: {
async getIndexData() {
try {
const { data } = await getIndexData();
this.banner = data;
if(!this.color_one && !this.color_two){
this.color_one = this.banner[0].color_one;
this.color_two = this.banner[0].color_two;
}
} catch (err) { }
},
async getSpecialIndexData() {
try {
const { data, code, msg } = await getSpecialIndexData();
this.loading = false;
if (code != 200) {
uni.showToast({
title: msg,
});
} else {
console.log(data, 646);
const { banner, category_list } = data;
this.bannerList = banner;
this.gradeCate = category_list;
// .concat([{
// grade_id: 0,
// name: '',
// }]);
this.specialData = { ...data };
console.log(this.gradeCate);
}
} catch (err) {
this.loading = false;
console.log(err);
async getLearningData() {
try {
const { data } = await getLearningData({
subject_id: this.myExam.subject_id,
city: this.position,
});
console.log(data);
this.learningData = { ...data };
} catch (err) {
console.log(err);
}
},
//
@ -212,66 +195,28 @@ import MessageBox from '@/components/Message/index.vue';
url: e.target.dataset.url,
});
},
//
async getGoodsCateList() {
try {
const { data } = await getGoodsCateList();
console.log(data);
this.categoryList = data.category_list.concat([
{
name: "全部",
id: 0,
},
]);
} catch (err) { }
},
async getSpecialList() {
try {
const { data } = await getSpecialList({
grade_id: this.myExam.grade_id,
subject_id: this.myExam.subject_id,
page: 1,
limit: 4,
});
this.specialList = data;
} catch (err) {
console.log(err);
}
this.loading = false;
},
handleSpecialClick(item) {
const url = item.is_light
? '/pages/special/single_details?id=' + item.id
: '/pages/special/details?id=' + item.id;
// this.$util.checkLogin(() => {
uni.navigateTo({
url,
});
// }, this.showLoginPage);
},
handleOfflineClick(item) {
uni.navigateTo({
url: `/pages/special/offline_details?id=${item.id}`,
});
},
checkRecord() {
uni.navigateTo({
url: '/pages/learningCenter/clockRecord',
})
},
changeCate() {
this.$util.checkLogin(() => {
// this.$util.checkLogin(() => {
uni.navigateTo({
url: '/pages/store/goodsCate?type=learning'
});
}, true)
// }, true)
},
toMoreCourse() {
uni.navigateTo({
url: `/pages/special/search?gradeId=${this.myExam.grade_id}&subjectId=${this.myExam.subject_id}`
})
toMoreCourse(key) {
if (key === 'offline_courses') {
uni.navigateTo({
url: '/pages/activity/activity_list'
});
} else {
uni.navigateTo({
url: `/pages/special/search?gradeId=${this.myExam.grade_id}&subjectId=${this.myExam.subject_id}&specialType=${ key === 'live' ? 4 : 3}`
})
}
},
},
};

@ -1,5 +1,6 @@
<template>
<BaseContainer class="user-page" :fixedNav="false">
<NavBar v-if="scrollTop > 20" title="我的" :showBack="false" />
<image :src="getImgPath('/static/frontend/mine-bg.png')" mode="aspectFill" class="bg"></image>
<view class="header">
<view class="user-section" data-eventsync="true" @tap="goProfilePage" >
@ -185,6 +186,7 @@
TOUTIAO_STATUS:false,
imId:'',
unReadMsgNum: 0,
scrollTop: 0,
};
},
computed: {
@ -206,6 +208,10 @@
this.TOUTIAO_STATUS = true;
/* #endif */
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
watch: {
isLogin() {
this.getMenu();

@ -9,7 +9,7 @@
账户余额
<view class="num"><text>{{ userInfo.now_money }}</text></view>
</view>
<view class="gold-coin">金币 <text>0</text> </view>
<!-- <view class="gold-coin">金币 <text>0</text> </view> -->
</view>
<view class="header-bottom">
<view class="withdrawal">提现</view>
@ -168,7 +168,7 @@ export default {
.bill .header {
width: 690rpx;
height: 337rpx;
margin: 18rpx auto 40rpx;
margin: 18rpx auto 0;
padding-top: 56rpx;
background: linear-gradient(156deg, #4795FF 0%, #0F74BB 100%);
border-radius: 30rpx;

@ -51,11 +51,11 @@
loadMore(key) {
if (key === 'offline_courses') {
uni.navigateTo({
url: `/pages/special/offlineCourseList?gradeId=${this.gradeId}&subjectId=${this.subjectId}&specialCate=${key}`
})
url: `/pages/activity/activity_list?gradeId=${this.gradeId}&subjectId=${this.subjectId}`
});
} else {
uni.navigateTo({
url: `/pages/special/search?gradeId=${this.gradeId}&subjectId=${this.subjectId}&specialCate=${key}`
url: `/pages/special/search?gradeId=${this.gradeId}&subjectId=${this.subjectId}&specialCate=0`
})
}
},

@ -27,6 +27,7 @@
<script>
import { getGoodsCateList, getGoodsList, getIndexData } from "@/api/store";
import { getSpecialSubject } from '@/api/special';
export default {
data() {
@ -41,7 +42,7 @@
if (this.type === 'store') {
this.getGoodsCateList();
} else {
this.getSpecialSubject();
}
},
methods: {
@ -61,6 +62,23 @@
console.log(this.goodsCateList);
} catch (err) { }
},
async getSpecialSubject() {
try {
const { data } = await getSpecialSubject();
console.log(data);
this.goodsCateList = [
{
name: "特别推荐",
id: 0,
children: data.recommend,
},
].concat(data.category_list);
this.bigCate = '特别推荐';
console.log(this.goodsCateList);
} catch (err) {
console.log(err);
}
},
toList(con) {
switch (this.type){
case 'store':
@ -69,14 +87,19 @@
});
break;
case 'special':
// uni.navigateTo({
// url: `/pages/store/goodsList?categoryId=${con.id}`
// });
uni.navigateTo({
url: `/pages/special/specialCateCourse?name=${con.name}&gradeId=${con.grade_id}&subjectId=${con.id}&specialCate=0`
});
break;
case 'learning':
// uni.navigateTo({
// url: `/pages/store/goodsList?categoryId=${con.id}`
// });
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
console.log(prevPage.$vm.myExam);
prevPage.$vm.myExam.examName = con.name;
prevPage.$vm.myExam.grade_id = con.grade_id;
prevPage.$vm.myExam.subject_id = con.id;
console.log(prevPage.$vm.myExam);
uni.navigateBack();
break;
default:
break;

@ -250,7 +250,7 @@ import Advert from '@/components/Advert/index.vue';
if (item.name === '全部') {
console.log(1);
uni.navigateTo({
url: '/pages/store/goodsCate'
url: '/pages/store/goodsCate?type=store'
});
} else {
uni.navigateTo({

@ -76,6 +76,7 @@ export default {
},
[SET_POSITION](state, res) {
state.position = res;
utils.setStorage('position', res);
},
},
actions: {

Loading…
Cancel
Save