Commit 6c717e48 authored by Mac's avatar Mac

修改

parent 15f45dd5
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
<text class="good-rb-text">{{cx.course_score!=null &&cx.course_score>0?cx.course_score.toFixed(1):'5.0'}}</text> <text class="good-rb-text">{{cx.course_score!=null &&cx.course_score>0?cx.course_score.toFixed(1):'5.0'}}</text>
</view> </view>
<view class="good-rb-box" v-if="cx.is_pay==false && cx.price!=0"> <view class="good-rb-box" v-if="cx.is_pay==false && cx.price!=0">
<text style="font-size: 10px;color: #999999;text-decoration:line-through;margin-right: 2px;margin-top: 2px;">{{cx.original_price}}</text> <!-- <text style="font-size: 10px;color: #999999;text-decoration:line-through;margin-right: 2px;margin-top: 2px;">{{cx.original_price}}</text> -->
<text :style="{'font-size': '11px','color': pricecolor,'margin-top':'2px'}">¥</text> <text :style="{'font-size': '11px','color': pricecolor,'margin-top':'2px'}">¥</text>
<text :style="{'font-size': '16px','color': pricecolor}">{{cx.price.split('.')[0]}}</text> <text :style="{'font-size': '16px','color': pricecolor}">{{cx.price.split('.')[0]}}</text>
</view> </view>
<view class="good-rb-box" v-if="cx.is_pay==true&& cx.price!=0"> <view class="good-rb-box" v-if="cx.is_pay==true&& cx.price!=0">
<text :style="{'font-size': '14px','color': pricecolor}">已购买</text> <text :style="{'font-size': '14px','color': pricecolor}">已购买</text>
</view> </view>
<view v-if="cx.price==0" style="font-size: 12px;color: #999999;">免费</view> <view v-if="cx.price==0" style="font-size: 13px;color: #999999;">免费</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -58,9 +58,7 @@ ...@@ -58,9 +58,7 @@
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({ uni.navigateTo({ url: "/pages/school/articleDetails?ID=" + item.id });
url: '/pages/school/courseInfo?GoodsId=' + item.id
});
} }
}, },
reloadUserinfo() { reloadUserinfo() {
......
...@@ -56,9 +56,8 @@ ...@@ -56,9 +56,8 @@
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({
url: '/pages/school/courseInfo?GoodsId=' + item.id uni.navigateTo({ url: "/pages/school/articleDetails?ID=" + item.id });
});
} }
}, },
reloadUserinfo() { reloadUserinfo() {
......
...@@ -59,9 +59,8 @@ ...@@ -59,9 +59,8 @@
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({
url: '/pages/school/courseInfo?GoodsId=' + item.id uni.navigateTo({ url: "/pages/school/articleDetails?ID=" + item.id });
});
} }
}, },
reloadUserinfo() { reloadUserinfo() {
......
...@@ -384,10 +384,10 @@ ...@@ -384,10 +384,10 @@
},{ },{
"path":"personal/cardList"//学习卡中心 "path":"personal/cardList"//学习卡中心
},{ },{
"path":"mystudy/mystudy", "path":"mystudy/mystudy"
"style": { // "style": {
"navigationStyle": "custom" // "navigationStyle": "custom"
} // }
},{ },{
"path":"mystudy/studyrecord", "path":"mystudy/studyrecord",
"style": { "style": {
......
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
.coursesubmit .filed { .coursesubmit .filed {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
padding: 0 10px;
} }
.coursesubmit .filed .left, .coursesubmit .filed .left,
.coursesubmit .filed .right { .coursesubmit .filed .right {
...@@ -619,10 +619,11 @@ ...@@ -619,10 +619,11 @@
} }
.coursesubmit .good{ .coursesubmit .good{
background: #fff; background: #fff;
padding: 10px 13px; padding: 10px 0px ;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
font-family: aa; font-family: aa;
border-bottom: 1px solid #F5F6F7;
} }
.coursesubmit .good-img{ .coursesubmit .good-img{
......
...@@ -64,20 +64,24 @@ ...@@ -64,20 +64,24 @@
style="height: 100%;"> --> style="height: 100%;"> -->
<view class="scrollitem" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)"> <view class="scrollitem" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)">
<view class="catalog-box-l" :style="{color:index==ci?'#00D6A6':'#121212'}"> <view class="catalog-box-l" :style="{color:index==ci?'#00D6A6':'#121212'}">
<view class="cb-l-bt" :style="{border:index==ci?'0.5px solid #00D6A6':'0.5px solid #121212'}">{{cl.TypeName}}</view> <view style="min-width: 40px;display: flex;">
{{cl.SortName}}{{cl.Name}} <view class="cb-l-bt" :style="{border:index==ci?'0.5px solid #00D6A6':'0.5px solid #121212'}">{{cl.TypeName}}</view>
</view>
{{cl.SortName}}:{{cl.Name}}
</view> </view>
<!-- IsPay 0不可看 1已付款 2已下单 --> <!-- IsPay 0不可看 1已付款 2已下单 -->
<view :style="{color:mc}" class="catalog-box-r" v-if="cl.IsPay!=1"> <view :style="{color:mc}" class="catalog-box-r" v-if="cl.IsPay!=1">
{{cl.IsTrySee==1?'可试看':'购买'}} {{cl.IsTrySee==1?'可试看':'购买'}}
</view> </view>
</view> </view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#FFF" />
<!-- </scroll-view> --> <!-- </scroll-view> -->
</view> </view>
<!-- <view class="goback" @click="goback" :style="{'padding-top':paddingHTop}">
<u-icon name="arrow-left" size="48" color="#fff"></u-icon>
</view> -->
<coupon <coupon
v-if="showCoupons" v-if="showCoupons"
:coupon-message="couponMessage" :coupon-message="couponMessage"
...@@ -112,15 +116,33 @@ ...@@ -112,15 +116,33 @@
couponMessage: "", couponMessage: "",
img:[], img:[],
studybg:true, studybg:true,
studytext:'立即试看' studytext:'立即试看',
status: "nomore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
cover_pic:'',
count:0,
learned:0
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options,'options') console.log(options,'options')
if(options && options.id){ if(options && options.id){
this.id = options.id this.id = options.id
this.index = options.index; }
if(options && options.index){
this.index = options.index
}
if(options && options.name){
this.name = options.name this.name = options.name
}
if(options && options.cover_pic){
this.cover_pic = options.cover_pic
}
this.getGoodsCourseList()//获取课程目录 this.getGoodsCourseList()//获取课程目录
this.getAppletCourseCollect()//获取课程是否收藏 this.getAppletCourseCollect()//获取课程是否收藏
this.setMyStudyTime()//增加课程学习时间 this.setMyStudyTime()//增加课程学习时间
...@@ -128,7 +150,7 @@ ...@@ -128,7 +150,7 @@
this.setMyStudyTime(10) this.setMyStudyTime(10)
},10000) },10000)
}
// 多反了个字段 IsRead 是否已学习, 1是 2否 // 多反了个字段 IsRead 是否已学习, 1是 2否
}, },
created() { created() {
...@@ -210,11 +232,27 @@ ...@@ -210,11 +232,27 @@
res => { res => {
this.courseList = res.data.pageData; this.courseList = res.data.pageData;
this.selectcourse=this.courseList[this.index]; this.selectcourse=this.courseList[this.index];
this.count =res.data.count;
this.img=[]; this.img=[];
this.courseList[this.index].ImageList.forEach((x) => { this.courseList[this.index].ImageList.forEach((x) => {
this.img.push(x.Path); this.img.push(x.Path);
}); });
this.loading=true; this.loading=true;
this.learned=0;
this.courseList.forEach(x=>{
if(x.IsRead==1){
this.learned++;
}
})
let obj = {
name:this.name,
cover_pic:this.cover_pic,
Sort:this.selectcourse.Sort,
learned:this.learned,
count:this.count,
}
uni.setStorageSync("laststudy", obj);
this.setMyCourseStudyOK()//课程已阅读 this.setMyCourseStudyOK()//课程已阅读
} }
); );
......
...@@ -87,8 +87,9 @@ ...@@ -87,8 +87,9 @@
<text <text
class="numfont" :style="{ color: pricecolor }" class="numfont" :style="{ color: pricecolor }"
>{{ g.price }}</text> >{{ g.price }}</text>
<text class="oprice" v-if="setting.is_underline_price == 1">{{ g.original_price }}</text> <text class="oprice" v-if="setting.is_underline_price == 1 && (g.original_price>g.price)">{{ g.original_price }}</text>
</view> </view>
<view v-else class="price" :style="{'font-size': '16px','color': pricecolor}">免费</view>
<view class="sell u-skeleton-rect"> <view class="sell u-skeleton-rect">
<text v-if="setting.is_sales == 1">{{ g.sales }}人学习过</text> <text v-if="setting.is_sales == 1">{{ g.sales }}人学习过</text>
...@@ -148,8 +149,11 @@ ...@@ -148,8 +149,11 @@
<view class="catalog"> <view class="catalog">
<view class="catalog-box" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)"> <view class="catalog-box" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)">
<view class="catalog-box-l"> <view class="catalog-box-l">
<view class="cb-l-bt" >{{cl.TypeName}}</view> <view style="min-width: 40px;display: flex;">
{{cl.SortName}}{{cl.Name}} <view class="cb-l-bt" >{{cl.TypeName}}</view>
</view>
{{cl.SortName}}:{{cl.Name}}
</view> </view>
<!-- IsPay 0不可看 1已付款 2已下单 --> <!-- IsPay 0不可看 1已付款 2已下单 -->
<view :style="{color:mc}" class="catalog-box-r" v-if="cl.IsPay!=1"> <view :style="{color:mc}" class="catalog-box-r" v-if="cl.IsPay!=1">
...@@ -593,7 +597,7 @@ export default { ...@@ -593,7 +597,7 @@ export default {
if(item.IsPay!=1){ if(item.IsPay!=1){
if(item.IsTrySee==1){ if(item.IsTrySee==1){
uni.navigateTo({ uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&cover_pic='+this.g.cover_pic+'&index='+index
}) })
}else{ }else{
uni.showToast({ uni.showToast({
...@@ -604,7 +608,7 @@ export default { ...@@ -604,7 +608,7 @@ export default {
} }
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&cover_pic='+this.g.cover_pic+'&index='+index
}) })
} }
...@@ -1004,7 +1008,7 @@ font-family: aa; ...@@ -1004,7 +1008,7 @@ font-family: aa;
} }
.goods .gwuche{ .goods .gwuche{
padding: 10px 18px; padding: 10px 18px;
margin-top: 6px; /* margin-top: 6px; */
margin-right: 15px; margin-right: 15px;
border-radius: 6px; border-radius: 6px;
......
<template> <template>
<view class="mystudy"> <view class="mystudy">
<view style="padding-top: 74px;"> <view >
<view <!-- <view
class="headStatus" class="headStatus"
:style="[ :style="[
headStyle, headStyle,
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mc'></u-tabs> <u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mc'></u-tabs>
</view> </view>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view> -->
<view v-if="current==0" class="studyBox"> <view v-if="current==0" class="studyBox">
<view class="plot"> <view class="plot">
<!-- TODO 图表--> <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" @touchstart="touchLineA"></canvas>
</view> </view>
<view class="studyB-b"> <view class="studyB-b">
<view class="s-b-time"> <view class="s-b-time">
...@@ -105,9 +105,14 @@ ...@@ -105,9 +105,14 @@
import hParse from "@/components/u-parse/parse.vue"; import hParse from "@/components/u-parse/parse.vue";
import auth from "@/components/auth/index.vue"; import auth from "@/components/auth/index.vue";
import uCharts from '../components/u-charts/u-charts.js';
var _self;
var canvaLineA=null;
export default { export default {
data(){ data(){
return{ return{
pageTitle:'学习概况',
mc:'', mc:'',
pricecolor:'', pricecolor:'',
secondary:'', secondary:'',
...@@ -120,7 +125,6 @@ ...@@ -120,7 +125,6 @@
windowWidth:0, windowWidth:0,
scrollTop:0, scrollTop:0,
headStyle:{}, headStyle:{},
pageTitle:'我的学习',
UserId:0, UserId:0,
u:{}, u:{},
showAuth:false, showAuth:false,
...@@ -128,6 +132,10 @@ ...@@ -128,6 +132,10 @@
studyTime:{}, studyTime:{},
RecentStudy:[], RecentStudy:[],
StudyRecord:[], StudyRecord:[],
cWidth:'',
cHeight:'',
pixelRatio:1,
textarea:''
} }
}, },
components: { components: {
...@@ -135,6 +143,9 @@ ...@@ -135,6 +143,9 @@
auth auth
}, },
onLoad(options) { onLoad(options) {
_self = this;
this.cWidth=uni.upx2px(750);
this.cHeight=uni.upx2px(400);
}, },
created() { created() {
...@@ -145,7 +156,18 @@ ...@@ -145,7 +156,18 @@
this.paddingHTop = this.nav +'px'; this.paddingHTop = this.nav +'px';
this.windowWidth = this.$utils.SystemInfo().windowWidth; this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.headStyle.paddingTop = this.nav +'px'; this.headStyle.paddingTop = this.nav +'px';
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title : [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -176,6 +198,14 @@ ...@@ -176,6 +198,14 @@
}, },
res => { res => {
this.studyTime = res.data this.studyTime = res.data
let LineA={categories:[],series:[{data:[],name:'学习时间'}]};
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
res.data.MyStudyTimeList.forEach(x=>{
let obj = x.Date.split('-')[1]+'.'+x.Date.split('-')[2]
LineA.categories.push(obj)
LineA.series[0].data.push(x.TimeFormat.Time)
})
_self.showLineA("canvasLineA",LineA);
} }
); );
}, },
...@@ -217,7 +247,67 @@ ...@@ -217,7 +247,67 @@
uni.navigateTo({ uni.navigateTo({
url:'/pages/school/mystudy/orderStudy' url:'/pages/school/mystudy/orderStudy'
}) })
} },
showLineA(canvasId,chartData){
canvaLineA=new uCharts({
$this:_self,
canvasId: canvasId,
type: 'line',
fontSize:11,
padding:[15,20,0,15],
legend:{show:false},
dataLabel:true,
dataPointShape:true,
background:'#FFFFFF',
pixelRatio:_self.pixelRatio,
categories: chartData.categories,
series: chartData.series,
animation: true,
xAxis: {
// disabled:true,
type:'grid',
gridColor:'#CCCCCC',
gridType:'dash',
dashLength:8,
splitNumber:1,
axisLine:true,
boundaryGap:'justify',
disableGrid:true,
},
yAxis: {
disabled:true,
},
width: _self.cWidth*_self.pixelRatio,
height: _self.cHeight*_self.pixelRatio,
extra: {
line:{
type: 'curve',//curve曲线,straight直线
}
}
});
// //下面是默认选中索引
// let cindex=5;
// //下面是自定义文案
// let textList=[{text:'我是一个标题',color:null},{text:'自定义1:值1',color:'#2fc25b'},{text:'自定义2:值2',color:'#facc14'},{text:'自定义3:值3',color:'#f04864'}];
// //下面是event的模拟,tooltip的Y坐标值通过这个mp.changedTouches[0].y控制
// let tmpevent={mp:{changedTouches:[{x: 0, y: 120}]}};
// setTimeout(()=>{
// canvaLineA.showToolTip( tmpevent , {
// index:cindex,
// // textList:textList
// });
// },200)
},
touchLineA(e) {
canvaLineA.touchLegend(e);
canvaLineA.showToolTip(e, {
format: function (item, category) {
console.log(item,category,e)
return category + ' ' + item.name + ':' + item.data+'分钟'
}
});
},
} }
} }
...@@ -257,10 +347,15 @@ ...@@ -257,10 +347,15 @@
align-items: center; align-items: center;
} }
.mystudy .plot{ .mystudy .plot{
width: 100%; width: 750upx;
height: 160px; height: 400upx;
} }
.plot .charts {
width: 750upx;
height: 400upx;
background-color: #FFFFFF;
}
.mystudy .studyB-b{ .mystudy .studyB-b{
width: 100%; width: 100%;
padding: 15px; padding: 15px;
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
padding-top: 10px; padding-top: 10px;
"> ">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" style="height: 100%; padding-bottom: 0px;"> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" style="height: 100%; padding-bottom: 0px;">
<view class="u-collect-list" v-for="(item,index) in goodslist" :key="index"> <view class="u-collect-list" v-for="(item,index) in goodslist" :key="index" @click="clickHandler(item)">
<view class="collect-img"> <view class="collect-img">
<image mode="aspectFill" :src="item.CoverImage" style="width: 100%; height: 100%;border-radius: 4px;" ></image> <image mode="aspectFill" :src="item.CoverImage" style="width: 100%; height: 100%;border-radius: 4px;" ></image>
</view> </view>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#f3f4f6" /> <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#FFF" />
</scroll-view> </scroll-view>
<u-empty v-if="goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty> <u-empty v-if="goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty>
</view> </view>
...@@ -188,10 +188,8 @@ ...@@ -188,10 +188,8 @@
gbAuth() { gbAuth() {
uni.navigateBack() uni.navigateBack()
}, },
clickHandler(cx) { clickHandler(item) {
uni.navigateTo({ uni.navigateTo({ url: "/pages/school/courseInfo?GoodsId=" + item.Id });
url: '/pages/goods/goods?GoodsId=' + cx.Id,
});
}, },
lower(e) { lower(e) {
if (this.msg.pageIndex < this.page_count) { if (this.msg.pageIndex < this.page_count) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
:scroll-y="true" :scroll-y="true"
@scroll="scrollHandler" @scroll="scrollHandler"
@scrolltoupper="scrollTopHandler" @scrolltoupper="scrollTopHandler"
@scrolltolower="lower"
style="height: 100vh;"> style="height: 100vh;">
<view class="teacherDetails"> <view class="teacherDetails">
...@@ -68,19 +69,22 @@ ...@@ -68,19 +69,22 @@
<view class="tiaoti-l"></view> <view class="tiaoti-l"></view>
<text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">课程目录</text> <text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">课程目录</text>
</view> </view>
<view class="good" v-for="(cx, ci) in teacher.goodsResult" :key="ci" @click="clickHandler(cx)"> <view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)" v-if="g.length>0">
<view class="good-img"> <view class="good-img">
<image mode="aspectFill" :src="cx.CoverImage" style="width: 100%; height: 100%;border-radius: 4px;" ></image> <image mode="aspectFill" :src="cx.cover_pic" style="width: 100%; height: 100%;border-radius: 4px;" ></image>
</view> </view>
<view class="good-r" :style="{'width': (windowWidth -15 - 125 -26)+'px'}"> <view class="good-r" :style="{'width': (windowWidth -15 - 125 -26)+'px'}">
<view class="good-name"> <view class="good-name">
{{ cx.Name }} {{ cx.name }}
</view> </view>
<view class="good-r-b"> <view class="good-r-b">
<text>本教程共分{{cx.CourseNum}}个章节</text> <text>本教程共分{{cx.CourseNum}}个章节</text>
</view> </view>
</view> </view>
</view> </view>
<u-empty text="暂无课程" v-if='g.length==0' font-size="36" mode="list" ></u-empty>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#FFF" />
</view> </view>
<view class="goback" @click="goback" :style="{'padding-top':paddingHTop}"> <view class="goback" @click="goback" :style="{'padding-top':paddingHTop}">
<u-icon name="arrow-left" size="48" color="#121212"></u-icon> <u-icon name="arrow-left" size="48" color="#121212"></u-icon>
...@@ -110,6 +114,20 @@ ...@@ -110,6 +114,20 @@
UserId:0, UserId:0,
u:{}, u:{},
showAuth:false, showAuth:false,
msg:{
pageIndex: 1,
pageSize: 10,
TeacherId: 0,
},
page_count: 1,
g: [],
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多课程了",
},
} }
}, },
components: { components: {
...@@ -119,12 +137,13 @@ ...@@ -119,12 +137,13 @@
onLoad(options) { onLoad(options) {
console.log(options,'options') console.log(options,'options')
if(options && options.ID){ if(options && options.ID){
this.id = options.ID this.id = options.ID;
this.msg.TeacherId = options.ID;
if(uni.getStorageSync("mall_UserInfo")){ if(uni.getStorageSync("mall_UserInfo")){
this.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId:0 this.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId:0
} }
this.getTeacher()//根据老师id获取老师详情 this.getTeacher()//根据老师id获取老师详情
this.init()//根据老师id获取老师的课程列表
} }
}, },
created() { created() {
...@@ -143,6 +162,26 @@ ...@@ -143,6 +162,26 @@
goback(){ goback(){
uni.navigateBack({}) uni.navigateBack({})
}, },
init(){
this.request2({
url: '/api/AppletSchool/GetAppletCoursePageList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
} else {
this.status = "loadmore";
}
}
uni.hideNavigationBarLoading();
}
);
},
getTeacher(){ getTeacher(){
this.request2({ this.request2({
url: '/api/AppletSchool/GetTeacherModel', url: '/api/AppletSchool/GetTeacherModel',
...@@ -213,7 +252,16 @@ ...@@ -213,7 +252,16 @@
gob(){ gob(){
this.showAuth = false; this.showAuth = false;
}, },
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.status = "loading";
this.msg.pageIndex++;
this.init();
} else {
this.status = "nomore";
}
},
} }
} }
......
...@@ -91,8 +91,9 @@ ...@@ -91,8 +91,9 @@
style="height: 100%;" style="height: 100%;"
v-if="g.length > 0" v-if="g.length > 0"
> >
<view style="padding: 12px;"> <view :style="{'padding': IsEducation!=1?'12px':0,}">
<goodlist :list="g"></goodlist> <goodlist :list="g" v-if="IsEducation!=1"></goodlist>
<glist :list="g" v-if="IsEducation==1"></glist>
<u-loadmore <u-loadmore
v-if="showLoading" v-if="showLoading"
:status="status" :status="status"
...@@ -116,11 +117,12 @@ ...@@ -116,11 +117,12 @@
margin-top="24" margin-top="24"
padding-top="0" padding-top="0"
></u-empty> ></u-empty>
<view style="padding: 12px;"> <view :style="{'padding': IsEducation!=1?'12px':0,}">
<view class="recommed"> <view class="recommed" :style="{'padding-left': IsEducation==1?'12px':0,}">
<view class="title">为你推荐</view> <view class="title">为你推荐</view>
</view> </view>
<goodlist :list="recommedGoods"></goodlist> <goodlist :list="recommedGoods" v-if="IsEducation!=1"></goodlist>
<glist :list="recommedGoods" v-if="IsEducation==1"></glist>
</view> </view>
</view> </view>
</view> </view>
...@@ -129,9 +131,11 @@ ...@@ -129,9 +131,11 @@
<script> <script>
import goodlist from "@/components/goods/list"; import goodlist from "@/components/goods/list";
import glist from "@/components/school/list";
export default { export default {
components: { components: {
goodlist, goodlist,
glist
}, },
data() { data() {
return { return {
...@@ -155,6 +159,7 @@ export default { ...@@ -155,6 +159,7 @@ export default {
isover: false, isover: false,
loading: false, loading: false,
recommedGoods: [], recommedGoods: [],
IsEducation:0,//为1的时候是校园风格
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -164,6 +169,7 @@ export default { ...@@ -164,6 +169,7 @@ export default {
this.searchHistory = uni.getStorageSync("search_his"); this.searchHistory = uni.getStorageSync("search_his");
} }
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.IsEducation = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation :0;
}, },
methods: { methods: {
//为你推荐 //为你推荐
...@@ -250,10 +256,16 @@ export default { ...@@ -250,10 +256,16 @@ export default {
this.isover = false; this.isover = false;
this.loading = true; this.loading = true;
this.showLoading = this.page != 1; this.showLoading = this.page != 1;
var UserPageType = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0; var UserPageType = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
let url
if(this.IsEducation==1){
url= '/api/AppletSchool/GetAppletCoursePageList';
}else{
url= "/api/AppletGoods/GetAppletGoodsPageListForZY";
}
this.request2( this.request2(
{ {
url: "/api/AppletGoods/GetAppletGoodsPageListForZY", url:url,
data: { data: {
pageIndex:this.page, pageIndex:this.page,
pageSize:20, pageSize:20,
...@@ -267,13 +279,20 @@ export default { ...@@ -267,13 +279,20 @@ export default {
(res) => { (res) => {
console.log(res,'搜索ress'); console.log(res,'搜索ress');
this.showLoading = true; this.showLoading = true;
res.data.pageData.forEach(x=>{ if(res.data.pageData.length>0){
x.marketingLogo = JSON.parse(x.marketingLogo) console.log(res.data.pageData)
x.totalStock = 0; res.data.pageData.forEach(x=>{
x.attr.forEach(j=>{ x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock+=j.stock x.totalStock = 0;
}) if(x.attr && x.attr.length>0){
}) x.attr.forEach(j=>{
x.totalStock+=j.stock
})
}
})
}
this.g = this.g.concat(res.data.pageData); this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</view> </view>
</view> </view>
<view class="ReceiptAdder" @click="goUrl('/pages/address/address')" :style="{top:modelstype==0?'160rpx':(modelstype==1?'180rpx':'160rpx')}"> <view class="ReceiptAdder" v-if="IsEducation!=1" @click="goUrl('/pages/address/address')" :style="{top:modelstype==0?'160rpx':(modelstype==1?'180rpx':'160rpx')}">
<u-icon name="location" color="#fff" size="23"></u-icon> <u-icon name="location" color="#fff" size="23"></u-icon>
<Text style="color: #fff;font-size: 12px;margin-left: 20rpx;">收货地址</Text> <Text style="color: #fff;font-size: 12px;margin-left: 20rpx;">收货地址</Text>
</view> </view>
...@@ -234,7 +234,7 @@ export default { ...@@ -234,7 +234,7 @@ export default {
modelstype:0,//机型类型 modelstype:0,//机型类型
shopBasics:{}, shopBasics:{},
mall_UserInfo:{}, mall_UserInfo:{},
IsEducation:0,//1是0否是网课模式
}; };
}, },
components: { components: {
...@@ -244,6 +244,7 @@ export default { ...@@ -244,6 +244,7 @@ export default {
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
this.IsEducation = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation :0;
this.userinfo(); this.userinfo();
}, },
onLoad() { onLoad() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment