Commit 1441ac29 by tangjinlin

Merge branch 'master' of http://gitlib.occloud.net/biao/ZhiNanZhen into znz_dev

parents 79dea6de 066d5a82
......@@ -52,7 +52,8 @@
"pages/editCircle2/editCircle2",
"pages/faq/faq",
"pages/myFaq/myFaq",
"pages/faqSearch/faqSearch"
"pages/faqSearch/faqSearch",
"pages/faqDetail/faqDetail"
],
"window": {
"backgroundTextStyle": "light",
......
// pages/faqDetail/faqDetail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
faqId:0,
faqDat:null,
replyList:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
faqId: options.faqId
});
//检索
this.getFaqDetail();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getFaqDetail();
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
//获取在线答疑详细
getFaqDetail() {
var that = this;
var config = wx.getStorageSync('config');
//获取用户消息列表
wx.request({
url: app.url + 'ajax_get_faq_top_dat.php',
header: {
'content-type': 'application/json'
},
data: {
unionId: config.unionId,
keyword: that.data.keyword,
page: that.data.page,
},
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res.data)
if (res.statusCode == 200) {
that.setData({
pageCount: res.data.result.pageCount,
faqList: that.data.faqList.concat(res.data.result.faqList)
})
}
},
fail: function (res) {},
complete: function (res) {},
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
//触底以后加载更多
if ((this.data.page + 1) < this.data.pageCount) {
var pageIndex = this.data.page + 1
this.setData({
page: pageIndex
})
this.searchFaqList();
} else {
wx.showToast({
title: '没有更多咨询啦。',
icon: 'success',
duration: 2000
});
}
},
//点击检索
searchFaq() {
if (this.data.keyword == null || this.data.keyword == '') {
wx.showToast({
title: '请输入关键词',
icon: 'success',
duration: 1500
});
return;
}
this.searchFaqList();
},
//咨询详细页面
faqDetail(e) {
let faqId = e.currentTarget.dataset['index']
wx.navigateTo({
url: '../faqDetail/faqDetail?faqId=' + faqId,
})
},
//我的咨询
myFaq(e) {
wx.navigateTo({
url: '../myFaq/myFaq',
})
},
//立即咨询
newFaq(e) {
wx.navigateTo({
url: '../newFaq/newFaq',
})
},
back: function () {
wx.navigateBack({
delta: 1
})
},
})
\ No newline at end of file
{
"usingComponents": {},
"onReachBottomDistance":100
}
\ No newline at end of file
<!--pages/myNews/myNews.wxml-->
<custom-navi text="咨询页面" back="{{true}}" home="{{false}}" bg1="#FFF" bg2="#FFF" bg3="#FFF"></custom-navi>
<view class="content">
<view class="hotFaqs">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
<view class="faqContent">
<view class="faqRow1">
<view class="faqCotent">{{item.content}}</view>
<view class="faqReplycount">回复:{{item.reply_count}}</view>
</view>
<view class="faqRow2">最佳答案:{{item.best_detail_content}}</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/myNews/faq.wxss */
.searchArea {
position: fixed;
top: 30%;
width: 100%;
height: 60px;
background-color: #fff;
z-index: 190;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.searchArea text {
font-size: 16px;
font-weight: 400;
margin: 0 10px;
}
.searchArea>input {
flex: 1;
margin-right:10px;
height: 40px;
line-height: 40px;
font-size: 14px;
background: #f6f6f6;
border-radius: 30px;
text-align: center;
}
.searchArea view {
font-size: 16px;
color: #fb689b;
font-weight: 400;
margin: 0 10px;
}
.input_center {
text-align: center;
color: #bcbcbc;
}
.topTitle {
position: fixed;
top: 38%;
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background-color: #fff;
z-index: 200;
}
.topTitle .leftTitle {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
.topTitle .leftTitle .leftLine {
height: 20px;
width: 6px;
border-radius: 3px;
background-color: #ed5f77;
margin-left: 5%;
}
.topTitle .leftTitle .hot_title {
margin-left: 10px;
font-size: 20px;
font-weight: bolder;
color: #000;
}
.topTitle .rightTitle {
width: 100%;
display: flex;
flex-direction: row-reverse;
align-items: center;
margin-right: 5%;
}
.topTitle .rightTitle view {
background-color: #e70012;
width: 10px;
height: 10px;
border-radius: 50%;
}
.topTitle .rightTitle text {
margin-left: 10px;
font-size: 16px;
font-weight: 400;
border-bottom: 1px solid #333333;
}
.content {
width: 100%;
height: 100%;
position: absolute;
top: 45%;
}
.hotFaqs {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.faqItem {
width: 100%;
margin-top: 20px;
}
.faqContent {
margin: 0 3%;
padding: 3% 5%;
display: flex;
flex-direction: column;
border-radius: 10px;
box-shadow: 0 0 15px -3px rgb(0, 0, 0, 0.3);
}
.faqRow1 {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 10px;
}
.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
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