diff --git a/src/wx/app.json b/src/wx/app.json index c4996ae..52c1499 100644 --- a/src/wx/app.json +++ b/src/wx/app.json @@ -54,7 +54,9 @@ "pages/myFaq/myFaq", "pages/faqSearch/faqSearch", "pages/faqDetail/faqDetail", - "pages/faqConsult/faqConsult" + "pages/faqConsult/faqConsult", + "pages/volunteerNews/volunteerNews", + "pages/vNewsDetail/vNewsDetail" ], "window": { "backgroundTextStyle": "light", diff --git a/src/wx/img/close.png b/src/wx/img/close.png new file mode 100644 index 0000000..a4c151d Binary files /dev/null and b/src/wx/img/close.png differ diff --git a/src/wx/img/share.png b/src/wx/img/share.png new file mode 100644 index 0000000..05dd639 Binary files /dev/null and b/src/wx/img/share.png differ diff --git a/src/wx/img/suo1.png b/src/wx/img/suo1.png new file mode 100644 index 0000000..7b3ced2 Binary files /dev/null and b/src/wx/img/suo1.png differ diff --git a/src/wx/img/zhifubg.png b/src/wx/img/zhifubg.png new file mode 100644 index 0000000..a54f651 Binary files /dev/null and b/src/wx/img/zhifubg.png differ diff --git a/src/wx/pages/circleDetails/circleDetails.wxml b/src/wx/pages/circleDetails/circleDetails.wxml index 4572c16..b3176ec 100644 --- a/src/wx/pages/circleDetails/circleDetails.wxml +++ b/src/wx/pages/circleDetails/circleDetails.wxml @@ -58,7 +58,7 @@ <view class='con_circleMoment'> <text class="con_circleMomentComment">{{momentDat.comment}}</text> <view class='con_circleMomentImages'> - <image src='{{item}}' wx:for="{{momentDat.images}}" mode="aspectFit"></image> + <image src='{{item}}' wx:for="{{momentDat.images}}"></image> </view> </view> </view> diff --git a/src/wx/pages/circleDetails/circleDetails.wxss b/src/wx/pages/circleDetails/circleDetails.wxss index ee9fc7a..eb08975 100644 --- a/src/wx/pages/circleDetails/circleDetails.wxss +++ b/src/wx/pages/circleDetails/circleDetails.wxss @@ -145,12 +145,13 @@ width: 90%; display: flex; flex-direction: row; - justify-content: space-between; align-items: center; } .con_circleMomentImages>image { - height: 75px; + width: 30%; + height: 120px; margin-top: 10px; margin-right: 5px; + border-radius: 5px; } \ No newline at end of file diff --git a/src/wx/pages/circleMoment/circleMoment.wxml b/src/wx/pages/circleMoment/circleMoment.wxml index 43265bd..bea4305 100644 --- a/src/wx/pages/circleMoment/circleMoment.wxml +++ b/src/wx/pages/circleMoment/circleMoment.wxml @@ -1,7 +1,7 @@ <!--pages/circleMoment/circleMoment.wxml--> -<custom-navi text="圈子动态" back="{{true}}" home="{{true}}"></custom-navi> +<custom-navi text="圈子动态" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff"></custom-navi> <view class='circleMoment'> - <view style='position: fixed;bottom: 0;left: 0;font-size:14px;color:#fff;background: #0D76ED;width: 100%;height: 40px;line-height: 40px;text-align: center;'bindtap="momentNew" wx:if="{{isOwner}}"> + <view class="momentNewBtn" bindtap="momentNew" wx:if="{{isOwner}}"> 发布动态 </view> <view class="momentItem" wx:for="{{momentList}}" wx:for-item='momentDat'> diff --git a/src/wx/pages/circleMoment/circleMoment.wxss b/src/wx/pages/circleMoment/circleMoment.wxss index a691c3a..9429350 100644 --- a/src/wx/pages/circleMoment/circleMoment.wxss +++ b/src/wx/pages/circleMoment/circleMoment.wxss @@ -1,33 +1,33 @@ -.circleMoment{ +.circleMoment { margin-top: 10px; margin-left: 2%; margin-bottom: 50px; width: 96%; display: flex; - flex-direction:column; - justify-content : space-between; - align-items:center; + flex-direction: column; + justify-content: space-between; + align-items: center; font-size: 14px; } -.momentItem{ +.momentItem { margin-top: 5px; margin-bottom: 5px; width: 100%; display: flex; - flex-direction:column; - justify-content : space-between; - align-items:center; + flex-direction: column; + justify-content: space-between; + align-items: center; border-bottom: 1rpx solid #ccc; } -.momentItem .comment{ - width:100%; +.momentItem .comment { + width: 100%; line-height: 20px; text-align: left; } -.momentItem .images{ +.momentItem .images { width: 100%; margin-bottom: 10px; display: flex; @@ -36,13 +36,13 @@ align-items: center; } -.images>image{ - height:75px; +.images>image { + height: 75px; margin-top: 10px; margin-right: 5px; } -.momentItem .actionRow{ +.momentItem .actionRow { width: 100%; margin-bottom: 10px; display: flex; @@ -51,6 +51,22 @@ align-items: center; } -.momentItem .actionRow>image{ +.momentItem .actionRow>image { width: 60px; } + +.momentNewBtn { + position: fixed; + bottom: 0; + left: 10%; + font-size: 14px; + width: 80%; + height: 40px; + text-align: center; + line-height: 40px; + font-size: 15px; + background: linear-gradient(to right, #e85c6d, #fb689b); + color: #fff; + border-radius: 20px; + margin: 20px auto; +} \ No newline at end of file diff --git a/src/wx/pages/classDetails/classDetails.js b/src/wx/pages/classDetails/classDetails.js index 58ec75d..5fdb037 100644 --- a/src/wx/pages/classDetails/classDetails.js +++ b/src/wx/pages/classDetails/classDetails.js @@ -8,19 +8,21 @@ Page({ */ data: { mediaId: 0, - courseTitle:'', + courseTitle: '', teacherName: '', teacherProfile: '', frontImage: '', courseComment: '', mediaCount: '', mediaList: [], - videoHeight:'150', - play:0, - fufeiPage:0, - playUrl:'', + videoHeight: '150', + play: 0, + fufeiPage: 0, + playUrl: '', detailComment: '', - money:0 + money: 0, + subTab1: true, + subTab2: false }, /** @@ -66,15 +68,45 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function () { + return { + title: this.data.courseTitle, + path: 'pages/classDetails/classDetails?mediaId='+this.data.mediaId, + } + }, + subTab(e) { + var index = e.currentTarget.dataset['index'] + if (index == 1) { + this.setData({ + subTab1: true, + subTab2: false + }) + } + if (index == 2) { + this.setData({ + subTab1: false, + subTab2: true + }) + } + }, + + classMoney(e) { + var id = e.currentTarget.dataset['id']; + var money = e.currentTarget.dataset['index']; + this.setData({ + mediaId: id, + check: id, + money: money + }) }, - cliLearn(e){ + + cliLearn(e) { var that = this; let id = e.currentTarget.dataset['id']; wx.getStorage({ key: 'config', - success: function(res) { - if(res){ + success: function (res) { + if (res) { wx.request({ url: app.url + 'ajax_get_play_media_detail.php', data: { @@ -83,17 +115,17 @@ Page({ }, success: function (resp) { console.log(resp) - if(resp.data.status=='OK'){ - if (resp.data.result.courseMediaDat.haveBuy && !resp.data.result.courseMediaDat.is_free || resp.data.result.courseMediaDat.is_free){ + if (resp.data.status == 'OK') { + if (resp.data.result.courseMediaDat.haveBuy && !resp.data.result.courseMediaDat.is_free || resp.data.result.courseMediaDat.is_free) { that.setData({ - play:1, - playUrl:resp.data.result.courseMediaDat.media, + play: 1, + playUrl: resp.data.result.courseMediaDat.media, detailComment: resp.data.result.courseMediaDat.comment }) - }else{ + } else { that.setData({ playUrl: resp.data.result.courseMediaDat.media, - fufeiPage:1, + fufeiPage: 1, money: resp.data.result.courseMediaDat.price }) } @@ -103,7 +135,7 @@ Page({ } }, }) - + // console.log(index) // var playUrl = this.data.mediaList[index].media; // playUrl=playUrl.split('?')[0]; @@ -113,43 +145,47 @@ Page({ // }) }, // 查询课程详细 - classDetails(){ + classDetails() { var that = this; var config = wx.getStorageSync('config'); wx: wx.request({ url: app.url + 'ajax_get_course_detail.php', data: { unionId: config.unionId, - mediaId:that.data.mediaId + mediaId: that.data.mediaId + }, + header: { + 'content-type': 'application/json' }, - header: { 'content-type': 'application/json' }, method: 'GET', dataType: 'json', success: function (res) { console.log(res) if (res.statusCode == 200) { that.setData({ - courseTitle:res.data.result.courseTitle, + courseTitle: res.data.result.courseTitle, teacherName: res.data.result.teacherName, teacherProfile: res.data.result.teacherProfile, frontImage: res.data.result.frontImage, courseComment: res.data.result.courseComment, mediaCount: res.data.result.mediaCount, + updateTime: res.data.result.updateTime, + viewCount: res.data.result.viewCount, mediaList: res.data.result.mediaList }) } }, - fail: function (res) { }, - complete: function (res) { }, + fail: function (res) {}, + complete: function (res) {}, }) }, - videoplay(){ - if(this.data.show1){ + videoplay() { + if (this.data.show1) { this.setData({ - fufeiPage:1 + fufeiPage: 1 }) this.fufeilook() - }else{ + } else { this.setData({ play: 1 }) @@ -164,53 +200,55 @@ Page({ }).exec(); } }, - backplay(){ + backplay() { this.setData({ - play:0 + play: 0 }) }, // 付费观看 - fufeilook(){ + fufeilook() { var config = wx.getStorageSync('config'); wx: wx.request({ url: app.url + 'ajax_set_buy_media.php', data: { unionId: config.unionId, - openId:1, - courseId:1, - mediaId:1 + openId: 1, + courseId: 1, + mediaId: 1 + }, + header: { + 'content-type': 'application/json' }, - header: { 'content-type': 'application/json' }, method: 'GET', dataType: 'json', success: function (res) { console.log(res) }, - fail: function (res) { }, - complete: function (res) { }, + fail: function (res) {}, + complete: function (res) {}, }) }, - backfufei(){ + backfufei() { this.setData({ - fufeiPage:0 + fufeiPage: 0 }) }, - surefufei(){ - var that=this; + surefufei() { + var that = this; wx.getStorage({ key: 'config', - success: function(res) { - if(res){ + success: function (res) { + if (res) { wx.request({ url: app.url + 'ajax_buy_course_media.php', data: { - unionId:res.data.unionId, - openId:res.data.openId, + unionId: res.data.unionId, + openId: res.data.openId, mediaId: that.data.mediaId }, - success:function(resp){ + success: function (resp) { console.log(resp) - if(resp.data.status=='OK'){ + if (resp.data.status == 'OK') { var result = JSON.parse(resp.data.result); wx.requestPayment({ timeStamp: result.timeStamp, @@ -221,12 +259,12 @@ Page({ success(res) { that.setData({ fufeiPage: 0, - play:1 + play: 1 }) }, fail(res) { Toast.fail('支付失败'); - } + } }) } } @@ -234,7 +272,7 @@ Page({ } }, }) - + // this.setData({ // fufeiPage: 0 // }) diff --git a/src/wx/pages/classDetails/classDetails.wxml b/src/wx/pages/classDetails/classDetails.wxml index 73913e5..84e6506 100644 --- a/src/wx/pages/classDetails/classDetails.wxml +++ b/src/wx/pages/classDetails/classDetails.wxml @@ -1,58 +1,96 @@ <!--pages/classDetails/classDetails.wxml--> -<custom-navi text="课程详情" back="{{true}}" home="{{true}}"></custom-navi> +<custom-navi text="课程详情" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff"></custom-navi> <view class='classDetails'> - <view class='top_classDetails'> - <text>{{courseTitle}}</text> - <view> - <image src='{{frontImage}}'></image> - <view> - <text>讲师:{{teacherName}}</text> - <view>讲师介绍:{{teacherProfile}}</view> - </view> - </view> - </view> - <view class='kechengjianjie'> - <view style="color:#363636">课程简介</view> - <view style="color:#969696">{{courseComment}}</view> - </view> - <view class='classfenji'> - <view class='top_classfenji'> - <image src='../../img/sanjiao.png'></image>课程分集({{mediaCount}}) - </view> - <view class='bot_classfenji'> - <view wx:for="{{mediaList}}" > - <text bindtap='videoplay'>{{item.title}}</text> - <view bindtap='cliLearn' data-id="{{item.id}}" data-index="{{index}}">学习<image src='../../img/suo.png' class='suo' wx:if="{{!item.haveBuy&&!item.is_free}}"></image></view> - </view> - </view> - </view> - <view class='play' wx:if="{{play==1}}"> - <video class='video' src="{{playUrl}}"></video> - <view style='font-size:14px;padding-left:5px;margin-top:10px;'> - <image src='../../img/sanjiao.png'></image>课程简介 - </view> - <view style='font-size:14px;padding-left:5px;margin-top:5px;'> - {{detailComment}} - </view> - - <!-- <view class='backplay' bindtap='backplay'>返回</view> --> - <view class="backButton" style="text-align:center;"> - <van-button type="warning" bind:click="backplay" size='large'>返回</van-button> - </view> - </view> - <view class='fufeilook' wx:if="{{fufeiPage==1}}"> - <view class='con_fufeilook'> - <image src="/img/money.png"></image> - <view class='top_con_fufeilook'>付费观看</view> - <view style="margin-top:50px;"> - 付费金额 - </view> - <view style="margin-top: 10px;font-size: 18px;">¥<text style="color:red;">{{money}}</text></view> - <view class='fufeiBtn'> - <view bindtap='backfufei'>取消</view> - <view style='background:rgb(91,155,213)' bindtap='surefufei'>确认</view> - </view> - </view> - </view> + <view class="top"> + <image src="{{frontImage}}" mode="widthFix" style="width:100%"></image> + </view> + <view class="title"> + <view class="courseTitle"> + <view class="line"></view> + <view>{{courseTitle}}</view> + </view> + <view class="comment">{{courseComment}}</view> + <view class="time_count"> + <text>{{updateTime}}</text> + <text>观看人数:{{viewCount}}</text> + </view> + </view> + <view class="content" wx:if="{{mediaList.length==1}}"> + <view class="courseTitle"> + <view class="line" style="margin-right: 10px;"></view> + <view>相关详情</view> + </view> + <view>讲师介绍</view> + <view>{{teacherProfile}}</view> + <view>课程介绍</view> + <view>{{courseComment}}</view> + </view> + <view class="content1" wx:if="{{mediaList.length > 1}}"> + <view class="sub_title"> + <view class="sub" bindtap='subTab' data-index="1"> + <text>相关详情</text> + <view class="{{subTab1?'secTab':''}}"></view> + </view> + <view class="sub" bindtap='subTab' data-index="2"> + <text>课程目录</text> + <view class="{{subTab2?'secTab':''}}"></view> + </view> + </view> + <view class="sub_content"> + <view class="sub_detail" wx:if="{{subTab1}}"> + <view>讲师介绍</view> + <view>{{teacherProfile}}</view> + <view>课程介绍</view> + <view>{{courseComment}}</view> + </view> + <view class="sub_detail" wx:if="{{subTab2}}"> + <block wx:for="{{mediaList}}"> + <view class="{{check == item.id?'catalog1':'catalog'}}" bindtap="classMoney" data-id="{{item.id}}" data-index="{{item.price}}"> + <text bindtap='videoplay'>{{item.title}}</text> + <image src='/img/suo1.png' class='suo' wx:if="{{!item.haveBuy&&!item.is_free}}"></image> + </view> + </block> + </view> + </view> + </view> + <view class="bottom_btn"> + <view class="share"> + <button open-type="share"></button> + <image src="/img/share.png"></image> + 课程分享 + </view> + <view class="buyBtn" wx:if="{{mediaList.length > 1 && !check}}">课程金额:{{money}}</view> + <view class="buyBtn" wx:if="{{mediaList.length > 1 && check}}" bindtap="cliLearn" data-id="{{mediaId}}">课程金额:{{money}}</view> + <view class="buyBtn" wx:if="{{mediaList.length==1}}" bindtap="cliLearn" data-id="{{mediaList[0].id}}">课程金额:{{mediaList[0].price}}</view> + </view> </view> -<van-toast id="van-toast" /> \ No newline at end of file +<view class='play' wx:if="{{play==1}}"> + <video class='video' src="{{playUrl}}"></video> + <view style='font-size:14px;padding-left:5px;margin-top:10px;'> + <image src='../../img/sanjiao.png'></image>课程简介 + </view> + <view style='font-size:14px;padding-left:5px;margin-top:5px;'> + {{detailComment}} + </view> + + <!-- <view class='backplay' bindtap='backplay'>返回</view> --> + <view class="backButton" style="text-align:center;"> + <van-button type="warning" bind:click="backplay" size='large'>返回</van-button> + </view> +</view> +<view class='fufeilook' wx:if="{{fufeiPage==1}}"> + <view class='con_fufeilook'> + <image class="zfbg" src="/img/zhifubg.png" mode="widthFix"></image> + <image bindtap='backfufei' src="/img/close.png"></image> + <view style="margin-top:70px;"> + 付费金额 + </view> + <view style="margin: 10px 0 50px;font-size: 18px;"><text style="color:red;">¥{{money}}</text></view> + <view style="color: #898989;font-size: 12px">费用用途:所收金额全部用于公益用途</view> + <view class='fufeiBtn'> + <view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surefufei'>确认</view> + <view style="border: 1rpx solid #fd66a1" bindtap='backfufei'>取消</view> + </view> + </view> +</view> +<!-- <van-toast id="van-toast" /> --> \ No newline at end of file diff --git a/src/wx/pages/classDetails/classDetails.wxss b/src/wx/pages/classDetails/classDetails.wxss index d61e923..e9b2cb4 100644 --- a/src/wx/pages/classDetails/classDetails.wxss +++ b/src/wx/pages/classDetails/classDetails.wxss @@ -1,106 +1,203 @@ /* pages/classDetails/classDetails.wxss */ -page{ +page { width: 100%; height: 100%; } -.classDetails{ - width: 100%; - height: 100%; + +.classDetails .top image { + border-radius: 0 0 10px 10px; + margin-bottom: 20px; } -.top_classDetails{ - width: 100%; - border-bottom: 1px solid #f0f0f0; + +.classDetails .title { + padding: 0 5%; } -.top_classDetails>text{ - display: block; - width: 100%; - height: 50px; - line-height: 50px; - text-align: center; - font-size: 15px; + +.classDetails .title view { + display: flex; + flex-direction: row; + align-items: center; } -.top_classDetails>view{ - width: 90%; - height: 170px; - margin: 0 auto; + +.title .courseTitle view { + font-size: 17px; + font-weight: 550; +} + +.title .comment { + margin-top: 20px; +} + +.title .time_count { + color: #898989; + padding: 10px 0; + border-bottom: 1rpx solid #f2f2f2; +} + +.title .time_count text { + margin-right: 20px; + font-size: 12px; +} + +.classDetails .content { + padding: 0 5%; + margin-bottom: 80px; +} + +.classDetails .content .courseTitle { display: flex; - justify-content: space-between; + flex-direction: row; + align-items: center; +} + + +.content .courseTitle view { + font-size: 17px; + font-weight: 550; +} + +.classDetails .content view { + margin: 15px 0; } -.top_classDetails>view>image{ - width: 40%; - height: 150px; + +.classDetails .content1 { + padding: 0 5%; + margin: 15px 0 60px 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } -.top_classDetails>view>view{ - width: 55%; - height: 150px; + +.classDetails .content1 .sub_title { + width: 100%; + height: 30px; + display: flex; + flex-direction: row; + align-items: center; } -.top_classDetails>view>view>text{ - display: block; + +.classDetails .content1 .sub_title .sub { width: 100%; - height: 40px; - font-size: 14px; - color:#4F4F4F; + height: 30px; + display: flex; + flex-direction: column; + align-items: center; +} + +.classDetails .content1 .sub_title .sub text { + font-size: 17px; + font-weight: 550; } -.top_classDetails>view>view>view{ + +.classDetails .content1 .sub_content { width: 100%; - font-size: 14px; - color:#969696; } -.kechengjianjie{ + +.classDetails .content1 .sub_content .sub_detail view { width: 100%; - box-sizing: border-box; - padding: 10px 5%; - font-size: 14px; - line-height: 25px; - border-bottom: 1px solid #f0f0f0; + margin: 15px 0; } -.top_classfenji{ + +.secTab { + width: 30px; + height: 10px; + border-radius: 5px; + margin-top: -5px; + background: linear-gradient(to right, #e55b66, #ff6aa5); + z-index: -1; + /* opacity: 0.7; */ +} + +.sub_content .sub_detail .catalog { width: 100%; - height: 50px; display: flex; + flex-direction: row; align-items: center; - box-sizing: border-box; - padding: 0 5%; - font-size: 14px; - color:#4F4F4F; -} -.top_classfenji>image{ - width: 13px; - height: 13px; - margin-right: 5px; + justify-content: space-between; + padding: 10px 0; + font-size: 16px; + border-radius: 5px; + box-shadow: 1px 1px 8px -2px rgba(0, 0, 0, 0.3); } -.bot_classfenji{ + +.sub_content .sub_detail .catalog1 { width: 100%; - font-size: 13px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + padding: 10px 0; + font-size: 16px; + border-radius: 5px; + box-shadow: 1px 1px 10px -2px rgba(255, 106, 165, 0.3); } -.bot_classfenji>view{ + +.sub_content .sub_detail text { + margin-left: 20px; +} + +.sub_content .sub_detail image { + width: 25px; + height: 25px; + margin-right: 20px; +} + +.line { + width: 6px; + height: 18px; + border-radius: 3px; + background: #efc04c; + margin-right: 10px; +} + +.bottom_btn { width: 90%; - margin: 10px auto; + left: 5%; + position: fixed; + bottom: 0; display: flex; + flex-direction: row; + align-items: center; justify-content: space-between; - margin-bottom: 15px; -} -.bot_classfenji>view>view{ - padding: 4px 15px; - border-radius: 8px; - position: relative; - background: #0D76ED; - font-size:14px; - color: #fff; + background: #fff; + padding-bottom: 20px; } -.bot_classfenji>view>text{ - flex: 1; - font-size: 14px; - color:#969696; + +.bottom_btn .share { + display: flex; + flex-direction: row; + align-items: center; } -.suo{ + +.bottom_btn .share button { position: absolute; - bottom: 4px; - right: 0; - width: 15px; - height: 15px; + background: transparent; + width: 35%; + height: 35px; +} + +.bottom_btn .share button:after { + border: none; +} + +.bottom_btn image { + width: 30px; + height: 30px; + margin-right: 10px; } -.play{ + +.bottom_btn .buyBtn { + width: 60%; + height: 30px; + line-height: 30px; + text-align: center; + border-radius: 15px; + color: #fff; + background: linear-gradient(to right, #e85c6d, #fb689b); +} + +.play { position: fixed; top: 0; left: 0; @@ -108,17 +205,18 @@ page{ height: 100%; background: #fff; } -.play>video{ + +.play>video { width: 100%; max-height: 500px; } -.play>view>image{ +.play>view>image { width: 10px; height: 10px; } -.play .backButton{ +.play .backButton { position: absolute; width: 100%; height: 40px; @@ -126,10 +224,12 @@ page{ left: 0; font-size: 14px; } -.play .van-button--large{ + +.play .van-button--large { height: 40px; } -.backplay{ + +.backplay { position: fixed; bottom: 0; left: 0; @@ -139,15 +239,17 @@ page{ line-height: 30px; font-size: 14px; } -.fufeilook{ + +.fufeilook { position: fixed; top: 0; left: 0; width: 100%; height: 100%; - background: rgba(0,0,0,0.5) + background: rgba(0, 0, 0, 0.5) } -.con_fufeilook{ + +.con_fufeilook { position: absolute; top: 0; left: 0; @@ -156,37 +258,45 @@ page{ margin: auto; width: 280px; height: 300px; - background: #fff; border-radius: 5px; text-align: center; } -.con_fufeilook>image{ - width:50px; - height: 50px; + +.con_fufeilook .zfbg { position: absolute; - top:-19px; - left:-16px; + width: 280px; + top: 0; + left: 0; + z-index: -1; } -.top_con_fufeilook{ - width: 100%; - text-align: center; - font-size: 18px; - margin-top:25px; - font-weight: 600; + +.con_fufeilook>image { + width: 20px; + height: 20px; + position: absolute; + top: 10px; + left: 10px; } -.fufeiBtn{ + + +.fufeiBtn { position: absolute; - bottom: 0; + bottom: 40px; left: 0; width: 100%; - height: 50px; + height: 30px; display: flex; - justify-content: space-between; - border-top: 1px solid #ccc; + flex-direction: column; + align-items: center; + justify-content: center; } -.fufeiBtn>view{ - width: 50%; - line-height: 50px; + +.fufeiBtn>view { + width: 70%; + height: 30px; + border-radius: 15px; + line-height: 30px; text-align: center; font-size: 14px; + margin-bottom: 10px; } \ No newline at end of file diff --git a/src/wx/pages/courseIndex/courseIndex.js b/src/wx/pages/courseIndex/courseIndex.js index e21d54b..4c6416a 100644 --- a/src/wx/pages/courseIndex/courseIndex.js +++ b/src/wx/pages/courseIndex/courseIndex.js @@ -116,7 +116,8 @@ Page({ this.setData({ tabIndex: index, parentId: this.data.parentCategorys[index].id, - subId: 0 + subId: 0, + erjiTab: -1 }) //检索课程数据 this.getCourselist() diff --git a/src/wx/pages/courseIndex/courseIndex.wxml b/src/wx/pages/courseIndex/courseIndex.wxml index d5318d2..92e7ad5 100644 --- a/src/wx/pages/courseIndex/courseIndex.wxml +++ b/src/wx/pages/courseIndex/courseIndex.wxml @@ -18,7 +18,12 @@ <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> + <block wx:for="{{subCategory2}}"> + <view bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}"> + <text>{{item.title}}</text> + <view class='{{erjiTab==index?"secTab":""}}'></view> + </view> + </block> </view> </view> <view class='lookHistory'> diff --git a/src/wx/pages/index/index.js b/src/wx/pages/index/index.js index 2dd188d..70af74a 100644 --- a/src/wx/pages/index/index.js +++ b/src/wx/pages/index/index.js @@ -316,6 +316,16 @@ Page({ }) }, + //跳转到志愿要闻 + volunteerNews() { + wx.navigateTo({ + url: '../volunteerNews/volunteerNews', + }); + wx.setNavigationBarTitle({ + title: '志愿要闻' + }) + }, + //跳转到公益课程详情 classDetails(e) { let medidaId = e.currentTarget.dataset['index'] diff --git a/src/wx/pages/index/index.wxml b/src/wx/pages/index/index.wxml index ef00e04..0027fc2 100644 --- a/src/wx/pages/index/index.wxml +++ b/src/wx/pages/index/index.wxml @@ -47,7 +47,7 @@ <image src='../../img/4.png'></image> <view>消息通知</view> </view> --> - <view bindtap=""> + <view bindtap="volunteerNews"> <image src='/img/zyyw.png'></image> <view>志愿要闻</view> </view> @@ -87,7 +87,7 @@ <view class='topTitle'> <view class='leftLine' style="background-color: #eb5e76;"></view> <text class="title">志愿要闻</text> - <view class='lookmore' bindtap=''> + <view class='lookmore' bindtap='volunteerNews'> <text>全部</text> <image src="/img/right.png"></image> </view> diff --git a/src/wx/pages/vNewsDetail/vNewsDetail.js b/src/wx/pages/vNewsDetail/vNewsDetail.js new file mode 100644 index 0000000..116aae8 --- /dev/null +++ b/src/wx/pages/vNewsDetail/vNewsDetail.js @@ -0,0 +1,56 @@ +// pages/vNewsDetail/vNewsDetail.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + newsDetail: {}, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + newsId: options.newsId + }, () => { + this.getNewDetail(); + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + //获取列表 + getNewDetail() { + var that = this; + var config = wx.getStorageSync('config'); + //获取用户消息列表 + wx.request({ + url: app.url + 'ajax_get_news_detail.php', + header: { + 'content-type': 'application/json' + }, + data: { + unionId: config.unionId, + newsId: that.data.newsId + }, + method: 'GET', + dataType: 'json', + success: function (res) { + if (res.statusCode == 200) { + that.setData({ + newsDetail: res.data.result.newsDat + }) + } + }, + fail: function (res) {}, + complete: function (res) {}, + }) + }, +}) \ No newline at end of file diff --git a/src/wx/pages/vNewsDetail/vNewsDetail.json b/src/wx/pages/vNewsDetail/vNewsDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wx/pages/vNewsDetail/vNewsDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wx/pages/vNewsDetail/vNewsDetail.wxml b/src/wx/pages/vNewsDetail/vNewsDetail.wxml new file mode 100644 index 0000000..1ab714b --- /dev/null +++ b/src/wx/pages/vNewsDetail/vNewsDetail.wxml @@ -0,0 +1,14 @@ +<!--pages/volunteers/volunteers.wxml--> +<custom-navi text="志愿要闻" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff"></custom-navi> +<view class='all'> + <view class='top'> + <text class="title">{{newsDetail.title}}</text> + <view> + <view>{{newsDetail.account_title}}</view> + <text>{{newsDetail.registration_date}}</text> + </view> + </view> + <view class="content"> + <rich-text nodes="{{newsDetail.content}}"></rich-text> + </view> +</view> \ No newline at end of file diff --git a/src/wx/pages/vNewsDetail/vNewsDetail.wxss b/src/wx/pages/vNewsDetail/vNewsDetail.wxss new file mode 100644 index 0000000..ee6c872 --- /dev/null +++ b/src/wx/pages/vNewsDetail/vNewsDetail.wxss @@ -0,0 +1,34 @@ +/* pages/volunteerNews/volunteerNews.wxss */ +.all { + width: 100%; +} + +.all .top { + padding: 10px; +} + +.top .title { + font-size: 22px; + font-weight: bold; + margin-bottom: 20px; +} + +.top view { + display: flex; + flex-direction: row; + align-items: center; +} + +.top view view { + font-size: 16px; + color: #515D87; +} + +.top view text { + margin: 0 10px; + color: #898989; +} + +.all .content { + padding: 10px; +} \ No newline at end of file diff --git a/src/wx/pages/volunteerNews/volunteerNews.js b/src/wx/pages/volunteerNews/volunteerNews.js new file mode 100644 index 0000000..8312f09 --- /dev/null +++ b/src/wx/pages/volunteerNews/volunteerNews.js @@ -0,0 +1,84 @@ +// pages/volunteerNews/volunteerNews.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + newsList:[], + page: 0,//当前页数 + pageCount: 0,//总页数 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getNewList(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + //获取列表 + getNewList() { + var that = this; + var config = wx.getStorageSync('config'); + //获取用户消息列表 + wx.request({ + url: app.url + 'ajax_get_news_top_dat.php', + header: { + 'content-type': 'application/json' + }, + data: { + unionId: config.unionId, + }, + method: 'GET', + dataType: 'json', + success: function (res) { + if (res.statusCode == 200) { + that.setData({ + newsList: res.data.result.newsList + }) + } + }, + fail: function (res) {}, + complete: function (res) {}, + }) + }, + + //跳转到详情页面 + detail(e){ + var newsId = e.currentTarget.dataset['index'] + wx.navigateTo({ + url: '../vNewsDetail/vNewsDetail?newsId='+newsId, + }) + }, + + //加载更多 + onReachBottom() { + if (this.data.page < this.data.pageCount) { + var pageIndex = this.data.page + 1 + this.setData({ + page: pageIndex + }) + } else { + wx.showToast({ + title: '没有更多内容啦。', + icon: 'success', + duration: 2000 + }); + } + }, +}) \ No newline at end of file diff --git a/src/wx/pages/volunteerNews/volunteerNews.json b/src/wx/pages/volunteerNews/volunteerNews.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wx/pages/volunteerNews/volunteerNews.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wx/pages/volunteerNews/volunteerNews.wxml b/src/wx/pages/volunteerNews/volunteerNews.wxml new file mode 100644 index 0000000..a13ea1b --- /dev/null +++ b/src/wx/pages/volunteerNews/volunteerNews.wxml @@ -0,0 +1,34 @@ +<!--pages/volunteers/volunteers.wxml--> +<custom-navi text="志愿要闻" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff"></custom-navi> +<block wx:for="{{newsList}}" wx:key="id"> + <view class='listActivity' bindtap="detail" data-index='{{item.id}}'> + <view class="activity" wx:if="{{item.front_image_big}}"> + <view class='activityContent'> + <image src='{{item.front_image_big}}' mode="widthFix"></image> + <text class="bottom_title">{{item.title}}</text> + </view> + <view class="promulgator"> + <view> + {{item.account_title}} + </view> + <view> + {{item.registration_date}} + </view> + </view> + </view> + <view class="activity" wx:if="{{!item.front_image_big}}"> + <view class="text1"> + <view style="color: #323232">{{item.title}}</view> + <image src='{{item.front_image_small}}'></image> + </view> + <view class="promulgator"> + <view> + {{item.account_title}} + </view> + <view> + {{item.registration_date}} + </view> + </view> + </view> + </view> +</block> \ No newline at end of file diff --git a/src/wx/pages/volunteerNews/volunteerNews.wxss b/src/wx/pages/volunteerNews/volunteerNews.wxss new file mode 100644 index 0000000..46fa2c0 --- /dev/null +++ b/src/wx/pages/volunteerNews/volunteerNews.wxss @@ -0,0 +1,65 @@ +/* pages/volunteerNews/volunteerNews.wxss */ +.listActivity { + width: 100%; +} + +.listActivity .activity { + margin: 10px 10px 0; +} + +.activity .promulgator { + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + color: #898989; + font-size: 16px; + border-bottom: 1rpx solid #f2f2f2; +} + +.activity .promulgator view { + margin: 10px 20px 10px 0; +} + +.listActivity .text1 { + padding-right: 10px; + display: flex; + flex-direction: row; +} + +.listActivity .text1 view { + width: 80%; + margin-right: 20px; + font-size: 14px; + font-weight: bolder; + display: flex; + align-items: center; +} + +.listActivity .text1 image { + width: 50px; + height: 50px; +} + +.activityContent { + position: relative; +} + +.listActivity .activityContent .bottom_title { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + position: absolute; + bottom: 3px; + left: 0; + background: rgba(0, 0, 0, 0.5); + font-size: 14px; + color: #fff; + padding: 5px 0; + font-weight: bold; +} + +.listActivity .activityContent image { + width: 100%; +} \ No newline at end of file diff --git a/src/wx/project.config.json b/src/wx/project.config.json index 9206d3b..0e446fe 100644 --- a/src/wx/project.config.json +++ b/src/wx/project.config.json @@ -83,23 +83,16 @@ }, { "id": -1, - "name": "pages/courseIndex/courseIndex", - "pathName": "pages/courseIndex/courseIndex", + "name": "pages/circle/circle", + "pathName": "pages/circle/circle", "query": "", "scene": null }, { - "id": 6, - "name": "pages/faqDetail/faqDetail", - "pathName": "pages/faqDetail/faqDetail", - "query": "faqId=15", - "scene": null - }, - { "id": -1, - "name": "pages/faqConsult/faqConsult", - "pathName": "pages/faqConsult/faqConsult", - "query": "", + "name": "pages/circleMoment/circleMoment", + "pathName": "pages/circleMoment/circleMoment", + "query": "circleId=6", "scene": null } ]