Commit 2ff3ccba by tangjinlin

Merge branch 'znz_dev' into 'master'

Znz dev

See merge request !7
parents 644038db 08849e02
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
"pages/faq/faq", "pages/faq/faq",
"pages/myFaq/myFaq", "pages/myFaq/myFaq",
"pages/faqSearch/faqSearch", "pages/faqSearch/faqSearch",
"pages/faqDetail/faqDetail" "pages/faqDetail/faqDetail",
"pages/faqConsult/faqConsult"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
...@@ -357,9 +357,10 @@ web-view { ...@@ -357,9 +357,10 @@ web-view {
} }
.right_listPublicWelfare>view { .right_listPublicWelfare>view {
height: 30px;
display: flex; display: flex;
align-items: center; flex-direction: row;
justify-content: space-between;
color: #999999;
} }
.right_listPublicWelfare>view>image { .right_listPublicWelfare>view>image {
......
...@@ -6,61 +6,78 @@ Page({ ...@@ -6,61 +6,78 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
parentCategorys:[], parentCategorys: [],
tabIndex:0, tabIndex: 0,
erjiTab:0, erjiTab: -1,
subCategory1:[], subCategory1: [],
subCategory2: [], subCategory2: [],
listH: '',
parentId:1, parentId: 1,
subId:1, subId: 0,
page:0,//当前页数 page: 0, //当前页数
pageCount:0,//总页数 pageCount: 0, //总页数
list:[], list: [],
resultList: {},
//数据加载loading //数据加载loading
showLoading: false, showLoading: false,
isMember:false isMember: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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) // console.log(app.url)
var isMember = wx.getStorageSync('isMember'); var isMember = wx.getStorageSync('isMember');
if (isMember){ if (isMember) {
this.setData({ this.setData({
isMember:isMember isMember: isMember
}) })
} }
var that=this; var that = this;
wx.request({ wx.request({
url: app.url+'ajax_get_course_category.php', url: app.url + 'ajax_get_course_category.php',
header: { 'content-type': 'application/json'}, header: {
success: function(res) { 'content-type': 'application/json'
},
success: function (res) {
console.log(res) console.log(res)
if(res.statusCode==200){ if (res.statusCode == 200) {
that.setData({ that.setData({
parentCategorys:res.data.result, parentCategorys: res.data.result,
subCategory1: res.data.result[0].subCategorys, subCategory1: res.data.result[0].subCategorys,
subCategory2: res.data.result[1].subCategorys, subCategory2: res.data.result[1].subCategorys,
//默认为第1条 //默认为第1条
parentId: res.data.result[0].id, parentId: res.data.result[0].id,
subId: res.data.result[0].subCategorys[0].id // subId: res.data.result[0].subCategorys[0].id
}) })
} }
that.getCourselist() that.getCourselist()
}, },
fail: function(res) {}, fail: function (res) {},
complete: function(res) {}, complete: function (res) {},
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -79,15 +96,14 @@ Page({ ...@@ -79,15 +96,14 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {},
},
//课程详细页面 //课程详细页面
classDetails(e){ classDetails(e) {
//获取参数 //获取参数
let mediaId = e.currentTarget.dataset['index'] let mediaId = e.currentTarget.dataset['index']
wx.navigateTo({ wx.navigateTo({
url: '../classDetails/classDetails?mediaId='+mediaId, url: '../classDetails/classDetails?mediaId=' + mediaId,
}); });
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '课程详情' title: '课程详情'
...@@ -95,11 +111,12 @@ Page({ ...@@ -95,11 +111,12 @@ Page({
}, },
//切换一级分类 //切换一级分类
parentTab(e){ parentTab(e) {
let index = e.currentTarget.dataset['index'] let index = e.currentTarget.dataset['index']
this.setData({ this.setData({
tabIndex:index, tabIndex: index,
parentId: this.data.parentCategorys[index].id parentId: this.data.parentCategorys[index].id,
subId: 0
}) })
//检索课程数据 //检索课程数据
this.getCourselist() this.getCourselist()
...@@ -108,15 +125,19 @@ Page({ ...@@ -108,15 +125,19 @@ Page({
//切换二级分类 //切换二级分类
subTab(e) { subTab(e) {
let index = e.currentTarget.dataset['index'] let index = e.currentTarget.dataset['index']
if (this.data.tabIndex==0) { if (this.data.tabIndex == 0) {
this.setData({ this.setData({
erjiTab:index, erjiTab: index,
subId: this.data.subCategory1[index].id subId: index == -1 ? '0' : this.data.subCategory1[index].id,
resultList: [],
list: []
}) })
} else { } else {
this.setData({ this.setData({
erjiTab: index, erjiTab: index,
subId: this.data.subCategory2[index].id subId: index == -1 ? '0' : this.data.subCategory2[index].id,
resultList: [],
list: []
}) })
} }
...@@ -143,7 +164,7 @@ Page({ ...@@ -143,7 +164,7 @@ Page({
}, },
//观看历史 //观看历史
history(){ history() {
wx.navigateTo({ wx.navigateTo({
url: '../history/history', url: '../history/history',
}); });
...@@ -153,34 +174,42 @@ Page({ ...@@ -153,34 +174,42 @@ Page({
}, },
// 获取分类的对应的课程列表 // 获取分类的对应的课程列表
getCourselist(){ getCourselist() {
var that=this; var that = this;
that.setData({ that.setData({
showLoading: true, showLoading: true,
}); });
wx: wx.request({ wx: wx.request({
url: app.url + 'ajax_get_course_by_category.php', url: app.url + 'ajax_get_course_by_category.php',
data: { data: {
parentId:this.data.parentId, parentId: this.data.parentId,
subId: this.data.subId, subId: this.data.subId,
page: this.data.page, page: this.data.page,
}, },
header: { 'content-type': 'application/json' }, header: {
'content-type': 'application/json'
},
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res) if (that.data.erjiTab == -1) {
that.setData({ that.setData({
list: that.data.list.concat(res.data.result.list), resultList: res.data.result,
pageCount:res.data.result.pageCount 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) { complete: function (res) {
that.setData({ that.setData({
showLoading: false, showLoading: false,
}); });
}, },
}) })
}, },
// 跳到会员 // 跳到会员
......
<!--pages/gongyiClass/gongyiClass.wxml--> <!--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='gongyiClass'>
<view class='top_gongyiClass'> <view class='top_gongyiClass'>
<view style='border-bottom:1px solid #f0f0f0;height:46px'> <view class="tab1">
<view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' class='{{tabIndex==index?"firstTab":""}}'> <view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' class='{{tabIndex==index?"firstTab":""}}'>
{{item.title}}<view></view> {{item.title}}
</view> </view>
</view> </view>
<view> <view class="tab2">
<text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text> <view bindtap='subTab' data-index='-1'>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text> <text>推荐</text>
</view> <view class='{{erjiTab==-1?"secTab":""}}'></view>
</view> </view>
<view class='conSwiper' wx:if="{{!isMember}}"> <block wx:for="{{subCategory1}}">
<image src='../../img/dongNews.png'></image>购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>查看</view> <view bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}">
</view> <text>{{item.title}}</text>
<view class='lookHistory'> <view class='{{erjiTab==index?"secTab":""}}'></view>
<view><view class='leftLine'></view>全部<view class='rightLine'></view></view> </view>
<text bindtap='history'>历史</text> </block>
</view> <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'>
<swiper style="width:100%;height:342rpx;border-radius: 0 0 5px 5px;" indicator-dots="true" autoplay="false" interval="2000" duration="500">
<block wx:for="{{resultList.topMediaList}}" wx:key="id">
<swiper-item>
<navigator url="">
<image src="{{item.front_image}}" style="width:100%;border-radius: 0 0 5px 5px;" mode="widthFix" />
</navigator>
</swiper-item>
</block>
</swiper>
<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 class='listPublicWelfare'>
<view bindtap='classDetails' wx:for="{{list}}" wx:key="{{index}}"> <view bindtap='classDetails' wx:for="{{list}}" wx:key="{{index}}">
<view class='left_listPublicWelfare'> <view class='left_listPublicWelfare'>
...@@ -56,8 +104,4 @@ ...@@ -56,8 +104,4 @@
</view> </view>
</view> </view>
--> -->
</view>
</view> \ No newline at end of file
<!--默认隐藏加载等待-->
<view ><loading wx:if="{{showLoading}}">正在加载</loading></view>
/* pages/gongyiClass/gongyiClass.wxss */ /* 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%;
margin-bottom: 10px;
}
.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: 15px;
}
.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%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
color: #666666;
} }
.top_gongyiClass>view{
.top_gongyiClass .tab2 {
width: 100%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; 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; height: 36px;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
font-size: 14px; font-size: 17px;
margin-top: 10px; margin-top: 10px;
padding: 0 20px; padding: 0 20px;
font-weight: 500;
} }
.top_gongyiClass>view>view>view{ .top_gongyiClass>view>view>text {
width: 40px; z-index: 100;
height: 6px;
margin: 0 auto;
border-radius: 30px;
} }
.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; display: block;
padding: 3px 20px; padding: 3px 20px;
font-size: 13px;
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
margin-top: 5px; margin-top: 5px;
font-size: 14px;
} }
.lookHistory{
width: 100%; .lookHistory {
position: relative;
margin-bottom: 20px;
}
.lookHistory>view{
width: 100%; width: 100%;
height: 30px;
display: flex; display: flex;
justify-content: center; flex-direction: row-reverse;
align-items: center; align-items: center;
color: #000; margin-bottom: 5px;
} }
.leftLine{
width: 22%; .lookHistory>text {
height: 2px; height: 20px;
background: linear-gradient(to left, #599eff, #fff); line-height: 20px;
font-size: 13px;
color: #999999;
margin-right: 10px; margin-right: 10px;
} }
.rightLine{
width: 22%; .lookHistory>image {
height: 2px; width: 8px;
background: linear-gradient(to right, #599eff, #fff); height: 15px;
margin-left: 10px; margin-right: 35px;
}
.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;
} }
\ No newline at end of file
...@@ -101,7 +101,7 @@ Page({ ...@@ -101,7 +101,7 @@ Page({
//立即咨询 //立即咨询
newFaq(e) { newFaq(e) {
wx.navigateTo({ wx.navigateTo({
url: '../newFaq/newFaq', url: '../faqConsult/faqConsult',
}) })
}, },
......
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "在线答疑", "navigationBarTitleText": "在线答疑"
"onReachBottomDistance":100
} }
\ No newline at end of file
...@@ -177,10 +177,16 @@ ...@@ -177,10 +177,16 @@
.faqRow1 text { .faqRow1 text {
font-size: 16px; font-size: 16px;
color: #333333;
} }
.faqReplycount { .faqReplycount {
font-size: 14px; font-size: 14px;
color: #666666;
}
.faqRow2 {
color: #666666;
} }
.newFaqButton { .newFaqButton {
......
// pages/myNews/myNews.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
keyword: '',
fileList: [],
imgPaths: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {},
//
delete(event) {
const {
index
} = event.detail;
const fList = this.data[`fileList`];
const imgList = this.data[`imgPaths`];
fList.splice(index, 1);
imgList.splice(index, 1);
this.setData({
[`fileList`]: fList,
[`imgPaths`]: imgList
});
},
afterRead(event) {
const {
file
} = event.detail;
const fList = this.data[`fileList`];
let images = this.data.imgPaths;
file.forEach(item => {
images.push(item.path)
})
this.setData({
[`fileList`]: fList.concat(file),
imgPaths: images
});
},
beforeRead(event) {
const {
file,
callback
} = event.detail;
if (file[0].path.indexOf('jpg') < 0 && file[0].path.indexOf('png') < 0) {
wx.showToast({
title: '请选择图片文件上传',
icon: 'none'
});
callback(false);
return;
}
callback(true);
},
//上传素材
upload() {
var that = this;
console.log(that.data.imgPaths)
//感想必须输入
if (that.data.keyword == null || that.data.keyword.trim() == "") {
Notify('请输入文字')
return
}
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_set_faq_new.php',
data: {
unionId: config.unionId,
content: that.data.keyword,
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
//循环上传图片
console.log(res)
var completeCount = 0;
for (var i = 0; i < that.data.imgPaths.length; i++) {
//停顿1秒
var imgPath = that.data.imgPaths[i];
console.log(imgPath)
setTimeout(function () {
wx.uploadFile({
url: app.url + 'ajax_set_faq_new.php?unionId=' + config.unionId + "&faqId=" + res.data.result.faqDat.id,
filePath: imgPath,
name: 'images',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
},
fail: function (res) {
console.log(res, '上传失败')
},
complete: function (res) {
completeCount++;
},
})
}, 1000) //延迟时间 这里是1秒
}
//循环执行等待全部结束
var a = setInterval(function () {
//循环执行代码
if (that.data.imgPaths.length == completeCount) {
//跳转到首页
wx.showToast({
title: '上传成功!',
icon: 'success',
duration: 2000
});
clearInterval(a)
//返回上一页
wx.navigateBack({
delta: 1
})
}
}, 1000) //循环时间 这里是1秒
},
fail: function (res) { },
complete: function (res) { },
})
},
keywordInput(e) {
this.setData({
keyword: e.detail.value
})
},
back: function () {
wx.navigateBack({
delta: 1
})
},
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "立即咨询"
}
\ No newline at end of file
<!--pages/myNews/myNews.wxml-->
<custom-navi text="立即咨询" back="{{true}}" home="{{true}}" bg1="#fff" bg2="#fff" bg3="#fff"></custom-navi>
<view class="content">
<view class="top">
<view class="title">
<view class="leftLine" style="background:#eb5e76"></view>
<text>文字</text>
(100字以内)
</view>
<textarea bindinput="keywordInput"></textarea>
</view>
<view class="top">
<view class="title">
<view class="leftLine" style="background:#efc04c"></view>
<text>图片</text>
(至多上传6张)
</view>
</view>
<view class="upload">
<van-uploader file-list="{{ fileList }}" max-count="6" multiple bind:after-read="afterRead" bind:before-read="beforeRead" use-before-read="{{ true }}" bind:delete="delete"/>
</view>
</view>
<view bindtap='upload' class="newFaqButton">
<view>发布</view>
</view>
\ No newline at end of file
/* pages/myNews/faq.wxss */
.content {
position: fixed;
width: 100%;
height: 100%;
}
.content .top {
padding: 0 5%;
}
.content .upload {
padding: 0 5%;
}
.content .title {
display: flex;
flex-direction: row;
align-items: center;
color: #999999;
font-size: 16px;
margin: 20px 0;
}
.content .leftLine {
width: 6px;
height: 22px;
border-radius: 3px;
background: #eb5e76;
}
.content .title text {
color: #333333;
font-size: 18px;
font-weight: bold;
margin: 0 10px;
}
.content .top textarea {
width: 100%;
height: 100px;
}
.newFaqButton {
position: fixed;
bottom: 0;
width: 100%;
display: flex;
align-items: center;
}
.newFaqButton view {
text-align: center;
margin: 0 auto;
width: 80%;
height: 50px;
line-height: 50px;
border-radius: 25px;
margin-bottom: 10px;
background: linear-gradient(to right, #e85c6d, #fb689b);
color: #fff;
font-size: 18px;
}
\ No newline at end of file
...@@ -6,10 +6,12 @@ Page({ ...@@ -6,10 +6,12 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
faqId:0, faqId: 0,
isOwner:false, isOwner: false,
faqDat:null, faqDat: null,
faqDetailList:[], faqDetailList: [],
answerFlag: false,
answerInfo: ''
}, },
/** /**
...@@ -33,7 +35,7 @@ Page({ ...@@ -33,7 +35,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getFaqDetail(); // this.getFaqDetail();
}, },
/** /**
...@@ -58,7 +60,6 @@ Page({ ...@@ -58,7 +60,6 @@ Page({
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res.data)
if (res.statusCode == 200) { if (res.statusCode == 200) {
that.setData({ that.setData({
isOwner: res.data.result.isOwner, isOwner: res.data.result.isOwner,
...@@ -92,8 +93,44 @@ Page({ ...@@ -92,8 +93,44 @@ Page({
let faqDetailId = e.currentTarget.dataset['index'] let faqDetailId = e.currentTarget.dataset['index']
//调用接口设置最佳答案 //调用接口设置最佳答案
//ajax_set_faq_best.php //ajax_set_faq_best.php
wx.navigateTo({ var that = this;
url: '../faqDetail/faqDetail?faqId=' + faqId, var config = wx.getStorageSync('config');
//获取用户消息列表
wx.request({
url: app.url + 'ajax_set_faq_best.php',
header: {
'content-type': 'application/json'
},
data: {
unionId: config.unionId,
faqId: that.data.faqId,
faqDetailId: faqDetailId
},
method: 'GET',
dataType: 'json',
success: function (res) {
if (res.statusCode == 200) {
wx.showToast({
title: res.data.result.message,
})
that.getFaqDetail();
}
},
fail: function (res) {},
complete: function (res) {},
})
},
// 回复弹框
answerBtn() {
this.setData({
answerFlag: !this.data.answerFlag
})
},
answer_input(e) {
this.setData({
answerInfo: e.detail.value
}) })
}, },
...@@ -102,6 +139,35 @@ Page({ ...@@ -102,6 +139,35 @@ Page({
//调用接口设置最佳答案 //调用接口设置最佳答案
//ajax_set_faq_answer.php.php //ajax_set_faq_answer.php.php
//回复以后调用接口刷新本页面 //回复以后调用接口刷新本页面
var that = this;
var config = wx.getStorageSync('config');
//获取用户消息列表
wx.request({
url: app.url + 'ajax_set_faq_answer.php',
header: {
'content-type': 'application/json'
},
data: {
unionId: config.unionId,
faqId: that.data.faqId,
content: that.data.answerInfo
},
method: 'GET',
dataType: 'json',
success: function (res) {
if (res.statusCode == 200) {
wx.showToast({
title: res.data.result.message,
})
that.getFaqDetail();
}
},
fail: function (res) {},
complete: function (res) {},
})
this.setData({
answerFlag: !this.data.answerFlag
})
}, },
//立即咨询 //立即咨询
......
...@@ -2,40 +2,54 @@ ...@@ -2,40 +2,54 @@
<custom-navi text="咨询页面" back="{{true}}" home="{{false}}" bg1="#FFF" bg2="#FFF" bg3="#FFF"></custom-navi> <custom-navi text="咨询页面" back="{{true}}" home="{{false}}" bg1="#FFF" bg2="#FFF" bg3="#FFF"></custom-navi>
<view class="content"> <view class="content">
<view class="faqDat"> <view class="faqDat">
<!--作者--> <!--作者-->
<view class="authorRow"> <view class="authorRow">
<image src='{{faqDat.headImg}}' mode="widthFix"></image> <image src='{{faqDat.headImg}}' mode="widthFix"></image>
<view>{{faqDat.name}}</view> <view>{{faqDat.name}}</view>
</view> </view>
<!--咨询内容--> <!--咨询内容-->
<view class="contentRow"> <view class="contentRow">
<text>{{faqDat.content}}</text> <text>{{faqDat.content}}</text>
<view class="images"> <view class="images">
<image wx:for="{{faqDat.images}}" src='{{item}}' mode="widthFix"></image> <image wx:for="{{faqDat.images}}" src='{{item}}' mode="widthFix"></image>
</view> </view>
<view>{{faqDat.publishDate}}</view> <view>{{faqDat.publishDate}}</view>
</view> </view>
</view>
<!--咨询回复-->
<view class="replyList">
<!--板块分割-->
<view class="replayTitle">
<view></view>评论
</view>
<view class="replyContentRow">
<view class="replyItem" wx:for="{{faqDetailList}}">
<view class="row1">
<view>
<image src='{{item.headImg}}' mode="widthFix"></image>
<view class="replyName">{{item.name}}</view>
<view wx:if="{{item.isBest}}" class="isBest">最佳答案</view>
<view wx:elif="{{isOwner}}" class="isNotBest" bindtap="setBest" data-index='{{item.id}}'>设为最佳</view>
</view>
<view class="replyTime">{{item.replyTime}}</view>
</view>
<view class="row2">
<view>{{item.content}}</view>
</view>
</view>
</view>
</view>
<view class="answer_btn" wx:if="{{answerFlag}}">
<view class="answer_cont">
<textarea bindinput="answer_input" focus="{{answerFlag}}"></textarea>
</view>
<view class="cont_btn">
<view class="cBtn" bindtap='answerBtn'>取消</view>
<view class="aBtn" bindtap="answerFaq">回复</view>
</view>
</view>
<view bindtap='answerBtn' class="newFaqButton" wx:if="{{!answerFlag}}">
<view>回复</view>
</view> </view>
<!--咨询回复-->
<view class="replyList">
<!--板块分割-->
<view class="replayTitle">评论</view>
<view class="replyContentRow">
<view class="replyItem" wx:for="{{faqDetailList}}">
<view class="row1">
<image src='{{item.headImg}}' mode="widthFix"></image>
<view class="replyName">{{item.name}}</view>
<view wx:if="{{item.isBest && isOwwner}}" class="isBest">最佳答案</view>
<view wx:elif="{{isOwwner}}" class="isNotBest" bindtap="setBest" data-index='{{item.id}}'>设为最佳</view>
<view class="replyTime">{{item.replyTime}}</view>
</view>
<view class="row2">
<view>{{item.content}}</view>
</view>
</view>
</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
height: 100%; height: 100%;
position: absolute; position: absolute;
top: 20px; top: 20px;
margin-bottom: 40px;
} }
.faqDat { .faqDat {
...@@ -25,13 +26,14 @@ ...@@ -25,13 +26,14 @@
} }
.authorRow image { .authorRow image {
width:40px; width: 40px;
height:40px; height: 40px;
border-radius: 20px; border-radius: 20px;
} }
.authorRow view { .authorRow view {
margin-left: 5px; margin-left: 5px;
font-size: 18px;
} }
.faqDat .contentRow { .faqDat .contentRow {
...@@ -43,13 +45,15 @@ ...@@ -43,13 +45,15 @@
align-items: left; align-items: left;
} }
.faqDat .contentRow text{ .faqDat .contentRow text {
width:100%; width: 100%;
word-break: break-all; word-break: break-all;
font-size: 18px;
font-weight: bold;
} }
.faqDat .contentRow .images{ .faqDat .contentRow .images {
width:100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
...@@ -57,15 +61,16 @@ ...@@ -57,15 +61,16 @@
align-items: center; align-items: center;
} }
.faqDat .contentRow .images image{ .faqDat .contentRow .images image {
width:32%; width: 32%;
margin-top: 5px; margin-top: 5px;
margin-right: 1%; margin-right: 1%;
} }
.faqDat .contentRow view{ .faqDat .contentRow view {
margin-top: 5px; font-size: 15px;
width:100%; margin-top: 10px;
width: 100%;
} }
.replyList { .replyList {
...@@ -82,78 +87,180 @@ ...@@ -82,78 +87,180 @@
width: 100%; width: 100%;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
padding-left: 10px; margin-left: 3%;
font-size: 18px; font-size: 18px;
border-left: 5px solid #9BCD9B; display: flex;
flex-direction: row;
align-items: center;
}
.replyList .replayTitle view {
width: 6px;
height: 22px;
border-radius: 3px;
background: #9BCD9B;
margin-right: 15px;
} }
.replyList .replyContentRow { .replyList .replyContentRow {
width: 100%; width: 100%;
margin-left: 3%;
margin: 20px 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: left; align-items: left;
} }
.replyList .replyContentRow .replyItem{ .replyList .replyContentRow .replyItem {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
.replyItem .row1{ .replyItem .row1 {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: space-between;
align-items: center;
}
.replyItem .row1 view {
display: flex;
flex-direction: row;
align-items: center; align-items: center;
} }
.replyItem .row1 image{ .replyItem .row1 image {
width:40px; width: 40px;
height:40px; height: 40px;
border-radius: 20px; border-radius: 20px;
} }
.replyItem .row1 .replyName{ .replyItem .row1 .replyName {
margin-left: 5px; margin-left: 15px;
font-size: 18px; font-size: 18px;
color:#FF69B4; color: #FF69B4;
} }
.replyItem .row1 .isBest{ .replyItem .row1 .isBest {
margin-left: 5px; margin-left: 10px;
width: 80px; padding: 0 10px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
font-size: 14px; font-size: 14px;
background:pink; background: linear-gradient(to right, #2f89c2, #7c47ca);
color:#FFF; color: #FFF;
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
} }
.replyItem .row1 .isNotBest{ .replyItem .row1 .isNotBest {
margin-left: 5px; margin-left: 10px;
width: 80px; padding: 0 10px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
font-size: 14px; font-size: 14px;
background:#A020F0; background: linear-gradient(to right, #2f89c2, #7c47ca);
color:#FFF; color: #FFF;
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
} }
.replyItem .row1 .replyTime{ .replyItem .row1 .replyTime {
margin-left: 5px; color: #999999;
} }
.replyItem .row2{ .replyItem .row2 {
width: 100%; width: 100%;
margin-left: 45px; margin-left: 3%;
margin-right: 20px; }
.replyItem .row2 view {
margin-left: 50px;
font-size: 16px;
}
.answer_btn {
position: fixed;
bottom: 2%;
left: 5%;
width: 90%;
height: 200px;
border-radius: 10px;
border: 2px solid #ed5f77;
display: flex;
flex-direction: column;
background: #fff;
}
.answer_btn .answer_cont {
margin: 20px 20px 0;
height: 65%;
border-bottom: 1rpx solid #999999;
}
.answer_btn .answer_cont textarea {
width: 100%;
height: 90%;
}
.answer_btn .cont_btn {
padding: 8px 0;
height: 20%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.answer_btn .cont_btn .cBtn {
text-align: center;
margin: 0 10px;
width: 30%;
height: 40px;
line-height: 40px;
border-radius: 20px; border-radius: 20px;
background: transparent;
color: #fb689b;
font-size: 18px;
border: 1rpx solid #fb689b;
}
.answer_btn .cont_btn .aBtn {
text-align: center;
margin: 0 10px;
width: 30%;
height: 40px;
line-height: 40px;
border-radius: 20px;
background: linear-gradient(to right, #fb689b, #e85c6d);
color: #fff;
font-size: 18px;
}
.newFaqButton {
position: fixed;
bottom: 0;
width: 100%;
display: flex;
align-items: center;
/* background: #fff; */
}
.newFaqButton view {
text-align: center;
margin: 0 auto;
width: 80%;
height: 50px;
line-height: 50px;
border-radius: 25px;
margin-bottom: 10px;
background: linear-gradient(to right, #e85c6d, #fb689b);
color: #fff;
font-size: 18px;
} }
\ No newline at end of file
...@@ -80,6 +80,15 @@ ...@@ -80,6 +80,15 @@
.faqRow1 .faqCotent { .faqRow1 .faqCotent {
width: 80%; width: 80%;
word-break: break-all; word-break: break-all;
color: #333333;
}
.faqRow1 .faqReplycount {
color: #666666;
}
.faqRow2 {
color: #666666;
} }
.newFaqButton { .newFaqButton {
......
...@@ -85,9 +85,9 @@ ...@@ -85,9 +85,9 @@
</view> </view>
</view> --> </view> -->
<view class='topTitle'> <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> <text class="title">志愿要闻</text>
<view class='lookmore' bindtap='moreVolunteers'> <view class='lookmore' bindtap=''>
<text>全部</text> <text>全部</text>
<image src="/img/right.png"></image> <image src="/img/right.png"></image>
</view> </view>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</view> </view>
</view> --> </view> -->
<view class='topTitle'> <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> <text class="title">最新活动</text>
<view class='lookmore' bindtap='moreVolunteers'> <view class='lookmore' bindtap='moreVolunteers'>
<text>全部</text> <text>全部</text>
...@@ -193,9 +193,9 @@ ...@@ -193,9 +193,9 @@
<!-- 公益课堂 wx:if="{{ismediaList}}" --> <!-- 公益课堂 wx:if="{{ismediaList}}" -->
<view class='publicWelfare'> <view class='publicWelfare'>
<view class='topTitle'> <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> <text class="title">公益课堂</text>
<view class='lookmore' bindtap='moreVolunteers'> <view class='lookmore' bindtap='mediaCourse'>
<text>全部</text> <text>全部</text>
<image src="/img/right.png"></image> <image src="/img/right.png"></image>
</view> </view>
......
...@@ -122,7 +122,8 @@ ...@@ -122,7 +122,8 @@
.topTitle .leftLine { .topTitle .leftLine {
height: 20px; height: 20px;
border-left: 5px solid #efc04c; width: 6px;
border-radius: 3px;
margin-left: 30px; margin-left: 30px;
} }
......
...@@ -43,12 +43,14 @@ ...@@ -43,12 +43,14 @@
margin-left: 5px; margin-left: 5px;
width: 90%; width: 90%;
word-break: break-all; word-break: break-all;
color: #333333;
} }
.faqReplycount { .faqReplycount {
font-size: 14px; font-size: 14px;
margin-left: 15px; margin-left: 15px;
margin-top: 10px; margin-top: 10px;
color: #666666;
} }
.newFaqButton { .newFaqButton {
......
...@@ -83,36 +83,23 @@ ...@@ -83,36 +83,23 @@
}, },
{ {
"id": -1, "id": -1,
"name": "pages/circle/circle", "name": "pages/courseIndex/courseIndex",
"pathName": "pages/circle/circle", "pathName": "pages/courseIndex/courseIndex",
"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": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": 6,
"name": "pages/myFaq/myFaq", "name": "pages/faqDetail/faqDetail",
"pathName": "pages/myFaq/myFaq", "pathName": "pages/faqDetail/faqDetail",
"query": "", "query": "faqId=15",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/faqSearch/faqSearch", "name": "pages/faqConsult/faqConsult",
"pathName": "pages/faqSearch/faqSearch", "pathName": "pages/faqConsult/faqConsult",
"query": "",
"scene": null "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