Commit 40a3764d by tangjinlin

0513

parent 1441ac29
......@@ -357,9 +357,10 @@ web-view {
}
.right_listPublicWelfare>view {
height: 30px;
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
color: #999999;
}
.right_listPublicWelfare>view>image {
......
......@@ -6,61 +6,78 @@ Page({
* 页面的初始数据
*/
data: {
parentCategorys:[],
tabIndex:0,
erjiTab:0,
subCategory1:[],
parentCategorys: [],
tabIndex: 0,
erjiTab: -1,
subCategory1: [],
subCategory2: [],
parentId:1,
subId:1,
page:0,//当前页数
pageCount:0,//总页数
list:[],
listH: '',
parentId: 1,
subId: 0,
page: 0, //当前页数
pageCount: 0, //总页数
list: [],
resultList: {},
//数据加载loading
showLoading: false,
isMember:false
isMember: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
var winH = wx.getSystemInfoSync().windowHeight;
//创建节点选择器
var query = wx.createSelectorQuery();
//选择id
query.select('.top_gongyiClass').boundingClientRect()
query.select('.lookHistory').boundingClientRect()
query.select('.entrance').boundingClientRect()
query.exec(function (res) {
var listH = winH - res[0].height - res[1].height - res[2].height - 162
that.setData({
listH: listH
})
})
// console.log(app.url)
var isMember = wx.getStorageSync('isMember');
if (isMember){
if (isMember) {
this.setData({
isMember:isMember
isMember: isMember
})
}
var that=this;
var that = this;
wx.request({
url: app.url+'ajax_get_course_category.php',
header: { 'content-type': 'application/json'},
success: function(res) {
url: app.url + 'ajax_get_course_category.php',
header: {
'content-type': 'application/json'
},
success: function (res) {
console.log(res)
if(res.statusCode==200){
if (res.statusCode == 200) {
that.setData({
parentCategorys:res.data.result,
parentCategorys: res.data.result,
subCategory1: res.data.result[0].subCategorys,
subCategory2: res.data.result[1].subCategorys,
//默认为第1条
parentId: res.data.result[0].id,
subId: res.data.result[0].subCategorys[0].id
// subId: res.data.result[0].subCategorys[0].id
})
}
that.getCourselist()
},
fail: function(res) {},
complete: function(res) {},
fail: function (res) {},
complete: function (res) {},
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
onReady: function () {},
/**
* 生命周期函数--监听页面显示
......@@ -79,15 +96,14 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onShareAppMessage: function () {},
//课程详细页面
classDetails(e){
classDetails(e) {
//获取参数
let mediaId = e.currentTarget.dataset['index']
wx.navigateTo({
url: '../classDetails/classDetails?mediaId='+mediaId,
url: '../classDetails/classDetails?mediaId=' + mediaId,
});
wx.setNavigationBarTitle({
title: '课程详情'
......@@ -95,11 +111,12 @@ Page({
},
//切换一级分类
parentTab(e){
parentTab(e) {
let index = e.currentTarget.dataset['index']
this.setData({
tabIndex:index,
parentId: this.data.parentCategorys[index].id
tabIndex: index,
parentId: this.data.parentCategorys[index].id,
subId: 0
})
//检索课程数据
this.getCourselist()
......@@ -108,15 +125,19 @@ Page({
//切换二级分类
subTab(e) {
let index = e.currentTarget.dataset['index']
if (this.data.tabIndex==0) {
if (this.data.tabIndex == 0) {
this.setData({
erjiTab:index,
subId: this.data.subCategory1[index].id
erjiTab: index,
subId: index == -1 ? '0' : this.data.subCategory1[index].id,
resultList: [],
list: []
})
} else {
this.setData({
erjiTab: index,
subId: this.data.subCategory2[index].id
subId: index == -1 ? '0' : this.data.subCategory2[index].id,
resultList: [],
list: []
})
}
......@@ -143,7 +164,7 @@ Page({
},
//观看历史
history(){
history() {
wx.navigateTo({
url: '../history/history',
});
......@@ -153,34 +174,42 @@ Page({
},
// 获取分类的对应的课程列表
getCourselist(){
var that=this;
getCourselist() {
var that = this;
that.setData({
showLoading: true,
});
wx: wx.request({
url: app.url + 'ajax_get_course_by_category.php',
data: {
parentId:this.data.parentId,
parentId: this.data.parentId,
subId: this.data.subId,
page: this.data.page,
},
header: { 'content-type': 'application/json' },
header: {
'content-type': 'application/json'
},
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
that.setData({
list: that.data.list.concat(res.data.result.list),
pageCount:res.data.result.pageCount
})
if (that.data.erjiTab == -1) {
that.setData({
resultList: res.data.result,
pageCount: res.data.result.pageCount
})
} else {
that.setData({
list: that.data.list.concat(res.data.result.list),
pageCount: res.data.result.pageCount
})
}
},
fail: function (res) { },
fail: function (res) {},
complete: function (res) {
that.setData({
showLoading: false,
});
},
},
})
},
// 跳到会员
......
<!--pages/gongyiClass/gongyiClass.wxml-->
<custom-navi text="公益课程" back="{{true}}" home="{{true}}"></custom-navi>
<custom-navi text="公益课程" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff" color="#333333"></custom-navi>
<view class='gongyiClass'>
<view class='top_gongyiClass'>
<view style='border-bottom:1px solid #f0f0f0;height:46px'>
<view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' class='{{tabIndex==index?"firstTab":""}}'>
{{item.title}}<view></view>
</view>
</view>
<view>
<text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text>
</view>
</view>
<view class='conSwiper' wx:if="{{!isMember}}">
<image src='../../img/dongNews.png'></image>购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>查看</view>
</view>
<view class='lookHistory'>
<view><view class='leftLine'></view>全部<view class='rightLine'></view></view>
<text bindtap='history'>历史</text>
</view>
<view class='top_gongyiClass'>
<view class="tab1">
<view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' class='{{tabIndex==index?"firstTab":""}}'>
{{item.title}}
</view>
</view>
<view class="tab2">
<view bindtap='subTab' data-index='-1'>
<text>推荐</text>
<view class='{{erjiTab==-1?"secTab":""}}'></view>
</view>
<block wx:for="{{subCategory1}}">
<view bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}">
<text>{{item.title}}</text>
<view class='{{erjiTab==index?"secTab":""}}'></view>
</view>
</block>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}">{{item.title}}</text>
</view>
</view>
<view class='lookHistory'>
<image class="right_img" src="/img/right.png"></image>
<text bindtap='history'>观看历史</text>
</view>
<view class='entrance' wx:if="{{!isMember}}">
<view class="bgColor">
<image class="logo_img" src='/img/logo.png'></image>
<view bindtap='memberChange'>
<text>志愿者正式会员申请入口</text>
<image class="right_img" src="/img/right.png"></image>
</view>
</view>
</view>
<scroll-view scroll-y="true" style='height:660rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' bindtap='classDetails' wx:for="{{list}}" data-index="{{list[index].id}}">
<view class='left_listPublicWelfare'>
<image src='{{item.front_image}}'></image>
</view>
<view class='right_listPublicWelfare'>
<text>{{item.title}}</text>
<view>
<!--<van-button type="default" size="mini">小学课堂</van-button>-->
<image src='../../img/kefu.png'></image>
<text>{{item.view_count}}</text>
</view>
<text>主讲教师:{{item.teacher}}</text>
</view>
<text></text>
</view>
</scroll-view>
<!--
<scroll-view scroll-y="true" style='height:{{listH}}px;bottom:10rpx;' wx:if="{{erjiTab==-1}}" class="listPublicWelfare" bindscrolltolower='loadMore'>
<block wx:for="{{resultList.recommendMediaList}}" wx:for-item="rec" wx:key="resultList.recommendMediaList">
<view class='recommend' wx:if="{{rec.mediaList.length != 0}}">
<view class="topContent">
<view></view>
<text>{{rec.category}}</text>
</view>
<view class="bottomCon">
<block wx:for="{{rec.mediaList}}" wx:for-item="med" wx:key="rec.mediaList">
<view class="conDetail" bindtap='classDetails' data-index="{{med.id}}">
<view class="btn" wx:if="{{med.course_id != 0}}">合集</view>
<image src="{{med.front_image}}" mode="widthFix"></image>
<view class="conTitle">{{med.title}}</view>
<view class="conCount">
<text>{{med.view_count}}观看</text>
<text style="color:#{{med.price==0?'369c25':'d30000'}}">{{med.price==0?'免费':'¥'+med.price}}</text>
</view>
</view>
</block>
</view>
</view>
</block>
</scroll-view>
<scroll-view scroll-y="true" style='height:{{listH}}px;bottom:10rpx;' wx:if="{{erjiTab!=-1}}" class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' bindtap='classDetails' wx:for="{{list}}" data-index="{{list[index].id}}">
<view class='left_listPublicWelfare'>
<image src='{{item.front_image}}'></image>
</view>
<view class='right_listPublicWelfare'>
<text>{{item.title}}</text>
<text style="margin: 5px 0">主讲教师:{{item.teacher}}</text>
<view>
<text>{{item.view_count}}观看</text>
<text style="color:#{{item.price==0?'369c25':'d30000'}};margin-right: 10px">{{item.price==0?'免费':'¥'+item.price}}</text>
</view>
</view>
<text></text>
</view>
</scroll-view>
<!--
<view class='listPublicWelfare'>
<view bindtap='classDetails' wx:for="{{list}}" wx:key="{{index}}">
<view class='left_listPublicWelfare'>
......@@ -56,8 +95,4 @@
</view>
</view>
-->
</view>
<!--默认隐藏加载等待-->
<view ><loading wx:if="{{showLoading}}">正在加载</loading></view>
</view>
\ No newline at end of file
/* pages/gongyiClass/gongyiClass.wxss */
.top_gongyiClass{
.entrance {
width: 90%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
box-shadow: 1px 1px 8px -2px rgba(0, 0, 0, 0.3);
margin-left: 5%;
}
.entrance .bgColor {
width: 100%;
height: 50px;
background-color: white;
font-size: 13px;
font-weight: bolder;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
}
.entrance .bgColor .logo_img {
width: 40px;
height: 48px;
}
.entrance .bgColor view {
display: flex;
align-items: center;
}
.entrance .bgColor text {
padding: 0 10px;
color: #333333;
font-weight: 600;
}
.entrance .bgColor view .right_img {
width: 8px;
height: 15px;
}
.recommend {
display: flex;
flex-direction: column;
margin-bottom: 10px;
}
.recommend .topContent {
display: flex;
flex-direction: row;
margin: 30px 0 0 20px;
align-items: center;
}
.recommend .topContent view {
width: 6px;
height: 22px;
border-radius: 3px;
background: #eb5e76;
margin-right: 10px;
}
.recommend .topContent text {
color: #333333;
font-size: 18px;
font-weight: bold;
}
.recommend .bottomCon {
display: flex;
flex-direction: row;
padding: 20px 0 0 20px;
}
.recommend .bottomCon .conDetail {
position: relative;
width: 100%;
margin-right: 20px;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 5px;
box-shadow: 0 0 8px -3px rgba(0, 0, 0, 0.3);
}
.recommend .bottomCon .conDetail image {
width: 100%;
border-radius: 5px 5px 0 0;
}
.recommend .bottomCon .conDetail .conTitle {
padding: 10px;
color: #333333;
}
.recommend .bottomCon .conDetail .conCount {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px 10px;
}
.recommend .bottomCon .conDetail text {
color: #999999;
}
.recommend .bottomCon .btn {
position: absolute;
top: 0;
right: 0;
width: 50px;
height: 25px;
line-height: 25px;
border-radius: 0 5px 5px;
background: #369c25;
color: #fff;
font-size: 13px;
text-align: center;
}
/** ------------------------------------------------- **/
.top_gongyiClass {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.top_gongyiClass .tab1 {
width: 100%;
display: flex;
flex-wrap: wrap;
color: #666666;
}
.top_gongyiClass>view{
.top_gongyiClass .tab2 {
width: 100%;
display: flex;
flex-wrap: wrap;
color: #333333;
}
.top_gongyiClass>view>view{
.top_gongyiClass .tab2 view {
display: flex;
flex-direction: column;
align-items: center;
}
.top_gongyiClass>view>view {
height: 36px;
text-align: center;
line-height: 30px;
font-size: 14px;
font-size: 17px;
margin-top: 10px;
padding: 0 20px;
font-weight: 500;
}
.top_gongyiClass>view>view>view{
width: 40px;
height: 6px;
margin: 0 auto;
border-radius: 30px;
.top_gongyiClass>view>view>text {
z-index: 100;
}
.firstTab{
color: #ff3535;
.firstTab {
color: #d8477f;
}
.firstTab>view{
background: #ff9696;
.tab2 .secTab {
width: 45px;
height: 10px;
border-radius: 5px;
margin-top: -12px;
background: linear-gradient(to right, #e55b66, #ff6aa5);
/* opacity: 0.7; */
}
.top_gongyiClass>view>text{
.top_gongyiClass>view>text {
display: block;
padding: 3px 20px;
font-size: 13px;
height: 25px;
line-height: 25px;
margin-top: 5px;
font-size: 14px;
}
.lookHistory{
width: 100%;
position: relative;
margin-bottom: 20px;
}
.lookHistory>view{
.lookHistory {
width: 100%;
height: 30px;
display: flex;
justify-content: center;
flex-direction: row-reverse;
align-items: center;
color: #000;
margin-bottom: 5px;
}
.leftLine{
width: 22%;
height: 2px;
background: linear-gradient(to left, #599eff, #fff);
.lookHistory>text {
height: 20px;
line-height: 20px;
font-size: 13px;
color: #999999;
margin-right: 10px;
}
.rightLine{
width: 22%;
height: 2px;
background: linear-gradient(to right, #599eff, #fff);
margin-left: 10px;
}
.lookHistory>text{
position: absolute;
right: 10px;
top: 0;
bottom: 0;
margin: auto;
display: block;
height: 40px;
line-height: 40px;
text-align: right;
font-size: 12px;
box-sizing: border-box;
color: #599eff;
.lookHistory>image {
width: 8px;
height: 15px;
margin-right: 35px;
}
\ No newline at end of file
......@@ -177,10 +177,16 @@
.faqRow1 text {
font-size: 16px;
color: #333333;
}
.faqReplycount {
font-size: 14px;
color: #666666;
}
.faqRow2 {
color: #666666;
}
.newFaqButton {
......
......@@ -80,6 +80,15 @@
.faqRow1 .faqCotent {
width: 80%;
word-break: break-all;
color: #333333;
}
.faqRow1 .faqReplycount {
color: #666666;
}
.faqRow2 {
color: #666666;
}
.newFaqButton {
......
......@@ -85,7 +85,7 @@
</view>
</view> -->
<view class='topTitle'>
<view class='leftLine' style="border-left: 5px solid #eb5e76;"></view>
<view class='leftLine' style="background-color: #eb5e76;"></view>
<text class="title">志愿要闻</text>
<view class='lookmore' bindtap='moreVolunteers'>
<text>全部</text>
......@@ -123,7 +123,7 @@
</view>
</view> -->
<view class='topTitle'>
<view class='leftLine' style="border-left: 5px solid #eb5e76;"></view>
<view class='leftLine' style="background-color: #efc04c;"></view>
<text class="title">最新活动</text>
<view class='lookmore' bindtap='moreVolunteers'>
<text>全部</text>
......@@ -193,7 +193,7 @@
<!-- 公益课堂 wx:if="{{ismediaList}}" -->
<view class='publicWelfare'>
<view class='topTitle'>
<view class='leftLine' style="border-left: 5px solid #eb5e76;"></view>
<view class='leftLine' style="background-color: #9cc64d;"></view>
<text class="title">公益课堂</text>
<view class='lookmore' bindtap='moreVolunteers'>
<text>全部</text>
......
......@@ -122,7 +122,8 @@
.topTitle .leftLine {
height: 20px;
border-left: 5px solid #efc04c;
width: 6px;
border-radius: 3px;
margin-left: 30px;
}
......
......@@ -43,12 +43,14 @@
margin-left: 5px;
width: 90%;
word-break: break-all;
color: #333333;
}
.faqReplycount {
font-size: 14px;
margin-left: 15px;
margin-top: 10px;
color: #666666;
}
.newFaqButton {
......
......@@ -83,37 +83,10 @@
},
{
"id": -1,
"name": "pages/circle/circle",
"pathName": "pages/circle/circle",
"query": "圈子",
"scene": null
},
{
"id": -1,
"name": "pages/circleDetails/circleDetails",
"pathName": "pages/circleDetails/circleDetails",
"query": "circleId=5",
"scene": null
},
{
"id": 7,
"name": "在线答疑",
"pathName": "pages/faq/faq",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/myFaq/myFaq",
"pathName": "pages/myFaq/myFaq",
"name": "pages/courseIndex/courseIndex",
"pathName": "pages/courseIndex/courseIndex",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/faqSearch/faqSearch",
"pathName": "pages/faqSearch/faqSearch",
"scene": null
}
]
}
......
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