From 1b9b07020c291b2fbba12de9359e3bc6e805a9c2 Mon Sep 17 00:00:00 2001
From: biao <zb182838>
Date: Tue, 12 May 2020 17:45:30 +0800
Subject: [PATCH] 11111

---
 src/wx/app.json               |   3 ++-
 src/wx/img/rpoint.png         | Bin 0 -> 17885 bytes
 src/wx/pages/faq/faq.js       |  78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/wx/pages/faq/faq.json     |   5 +++++
 src/wx/pages/faq/faq.wxml     |  26 ++++++++++++++++++++++++++
 src/wx/pages/faq/faq.wxss     | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/wx/pages/index/index.js   |   7 +++++++
 src/wx/pages/index/index.wxml |   2 +-
 src/wx/project.config.json    |   7 +++++++
 9 files changed, 235 insertions(+), 2 deletions(-)
 create mode 100644 src/wx/img/rpoint.png
 create mode 100644 src/wx/pages/faq/faq.js
 create mode 100644 src/wx/pages/faq/faq.json
 create mode 100644 src/wx/pages/faq/faq.wxml
 create mode 100644 src/wx/pages/faq/faq.wxss

diff --git a/src/wx/app.json b/src/wx/app.json
index 71d7f82..7eeb067 100644
--- a/src/wx/app.json
+++ b/src/wx/app.json
@@ -49,7 +49,8 @@
     "pages/newCircleMoment/newCircleMoment",
     "pages/circleEvents/circleEvents",
     "pages/editCircle/editCircle",
-    "pages/editCircle2/editCircle2"
+    "pages/editCircle2/editCircle2",
+    "pages/faq/faq"
   ],
   "window": {
     "backgroundTextStyle": "light",
diff --git a/src/wx/img/rpoint.png b/src/wx/img/rpoint.png
new file mode 100644
index 0000000..9d917a5
Binary files /dev/null and b/src/wx/img/rpoint.png differ
diff --git a/src/wx/pages/faq/faq.js b/src/wx/pages/faq/faq.js
new file mode 100644
index 0000000..2f7e7a2
--- /dev/null
+++ b/src/wx/pages/faq/faq.js
@@ -0,0 +1,78 @@
+// pages/myNews/myNews.js
+var app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    faqList:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+  },
+  
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getFaqList();
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  },
+
+  //获取在线答疑列表
+  getFaqList() {
+    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,
+      },
+      method: 'GET',
+      dataType: 'json',
+      success: function (res) {
+        console.log(res.data)
+        if (res.statusCode == 200) {
+          that.setData({
+            faqList: res.data.result.faqList
+          })
+        }
+      },
+      fail: function (res) { },
+      complete: function (res) { },
+    })
+  },
+
+  //咨询详细页面
+  faqDetail(e){
+    let faqId = e.currentTarget.dataset['index']
+    wx.navigateTo({
+      url: '../faqDetail/faqDetail?faqId=' + faqId,
+    })
+  },
+
+  //立即咨询
+  newFaq(e) {
+    wx.navigateTo({
+      url: '../newFaq/newFaq',
+    })
+  }
+})
\ No newline at end of file
diff --git a/src/wx/pages/faq/faq.json b/src/wx/pages/faq/faq.json
new file mode 100644
index 0000000..102980b
--- /dev/null
+++ b/src/wx/pages/faq/faq.json
@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "在线答疑",
+  "onReachBottomDistance":100
+}
\ No newline at end of file
diff --git a/src/wx/pages/faq/faq.wxml b/src/wx/pages/faq/faq.wxml
new file mode 100644
index 0000000..5c2ec74
--- /dev/null
+++ b/src/wx/pages/faq/faq.wxml
@@ -0,0 +1,26 @@
+<!--pages/myNews/myNews.wxml-->
+<custom-navi text="在线答疑" back="{{true}}" home="{{true}}" ></custom-navi>
+<view class="titleArea">
+  <text>亲爱的志愿者\n欢迎来到志愿者服务大厅</text>
+</view>
+
+<view class='topTitle'>
+  <view class='leftLine' style="border-left: 5px solid #eb5e76;"></view>
+  <text class="title">热门资讯</text>
+  <view class='rightTitle' bindtap='myFaq'>
+    <image src="/img/rpoint.png"></image>
+    <text>我的咨询</text>
+  </view>
+</view>
+<view class="hotFaqs">
+  <view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
+    <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 bindtap='newFaq' class="newFaqButton">立即咨询</view>
\ No newline at end of file
diff --git a/src/wx/pages/faq/faq.wxss b/src/wx/pages/faq/faq.wxss
new file mode 100644
index 0000000..937a5c1
--- /dev/null
+++ b/src/wx/pages/faq/faq.wxss
@@ -0,0 +1,109 @@
+/* pages/myNews/faq.wxss */
+.titleArea {
+  margin-top: 20px;
+  font-size: 20px;
+  color: #fff;
+  background: pink;
+  text-align: center;
+}
+.searchArea{
+  margin: 1%;
+  width:98%;
+  white-space:nowrap;
+  padding: 10px;
+}
+
+.topTitle {
+  position: static;
+  width: 100%;
+  height: 30px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.topTitle .title {
+  margin-left: 10px;
+  font-size: 20px;
+  font-weight: bolder;
+  color: #000;
+}
+
+.topTitle .leftLine {
+  height: 20px;
+  border-left: 5px solid #efc04c;
+  margin-left: 5%;
+}
+
+.topTitle .rightTitle {
+  position: absolute;
+  right: 5%;
+  display: flex;
+  flex-direction: row;
+}
+
+.topTitle .rightTitle text {
+  margin-right: 5px;
+}
+
+.topTitle .rightTitle image {
+  margin-top: 3px;
+  margin-right: 5px;
+  width: 12px;
+  height: 12px;
+}
+
+.hotFaqs{
+  width:100%;
+  white-space:nowrap;
+}
+
+.faqItem{
+  width:90%;
+  margin-top: 10px;
+  margin-left: 0;
+  margin-right: 0;
+  padding:10px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-around;
+  align-items: center;
+  border-radius: 5px;
+  border: 1rpx solid gray;
+}
+
+.faqRow1{
+  width:100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.faqCotent{
+  font-size: 18px;
+}
+
+.faqReplycount{
+  font-size: 16px;
+}
+
+.faqRow2{
+  width:100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items: center;
+  font-size: 16px;
+}
+
+.newFaqButton{
+  position: fixed;
+  bottom: 10px;
+  height: 30px;
+  line-height: 30px;
+  border-radius: 15px;
+  background: linear-gradient(to right, #e85c6d, #fb689b);
+  color: #fff;
+  font-size: 14px;
+}
diff --git a/src/wx/pages/index/index.js b/src/wx/pages/index/index.js
index d44aa3d..2dd188d 100644
--- a/src/wx/pages/index/index.js
+++ b/src/wx/pages/index/index.js
@@ -299,6 +299,13 @@ Page({
     })
   },
 
+  //在线答疑
+  faqEvent() {
+    wx.navigateTo({
+      url: '../faq/faq',
+    })
+  },
+
   //跳转到公益课程
   mediaCourse() {
     wx.navigateTo({
diff --git a/src/wx/pages/index/index.wxml b/src/wx/pages/index/index.wxml
index f74a6dc..1dbc675 100644
--- a/src/wx/pages/index/index.wxml
+++ b/src/wx/pages/index/index.wxml
@@ -34,7 +34,7 @@
 			<image src='../../img/2.png'></image>
 			<view>亲子活动</view>
 		</view> -->
-		<view bindtap="familyEvent">
+		<view bindtap="faqEvent">
 			<image src='/img/zxdy.png'></image>
 			<view>在线答疑</view>
 		</view>
diff --git a/src/wx/project.config.json b/src/wx/project.config.json
index 7d44a3a..451a5b5 100644
--- a/src/wx/project.config.json
+++ b/src/wx/project.config.json
@@ -94,6 +94,13 @@
 					"pathName": "pages/circleDetails/circleDetails",
 					"query": "circleId=5",
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "在线答疑",
+					"pathName": "pages/faq/faq",
+					"query": "",
+					"scene": null
 				}
 			]
 		}
--
libgit2 0.27.0