Commit eb0b281f by tangjinlin

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

parents 22ee4ea0 00ae2888
......@@ -50,7 +50,8 @@
"pages/circleEvents/circleEvents",
"pages/editCircle/editCircle",
"pages/editCircle2/editCircle2",
"pages/faq/faq"
"pages/faq/faq",
"pages/myFaq/myFaq"
],
"window": {
"backgroundTextStyle": "light",
......
......@@ -87,6 +87,13 @@ Page({
})
},
//我的咨询
myFaq(e) {
wx.navigateTo({
url: '../myFaq/myFaq',
})
},
//立即咨询
newFaq(e) {
wx.navigateTo({
......
// pages/myFaq/myFaq.js
import Notify from '../../dist/notify/notify';
import Dialog from '../../dist/dialog/dialog';
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
faqList:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getMyFaqList();
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//获取我的在线答疑列表
getMyFaqList() {
var that = this;
var config = wx.getStorageSync('config');
//获取用户消息列表
wx.request({
url: app.url + 'ajax_get_my_faq_list.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) { },
})
},
//咨询删除
delFaq(e) {
var that = this;
let faqId = e.currentTarget.dataset['index']
//对话框确认
Dialog.confirm({
message: '确定删除吗?'
}).then(() => {
var config = wx.getStorageSync('config');
//删除操作
wx.request({
url: app.url + 'ajax_delete_my_faq.php',
data: {
unionId: config.unionId,
faqId: faqId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
Notify(res.data.result.message)
that.getMyFaqList()
}
},
fail: function (res) { },
complete: function (res) { },
})
});
wx.navigateTo({
url: '../myFaqDel/myFaqDel?faqId=' + faqId,
})
},
//咨询详细页面
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
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/myNews/myNews.wxml-->
<custom-navi text="我的咨询" back="{{true}}" home="{{true}}" ></custom-navi>
<view class="hotFaqs">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
<view class="faqCol1">
<view class="faqContent">
<image src="/img/rpoint.png"></image>
<text>{{item.content}}</text>
</view>
<view class="faqReplycount">回复:{{item.reply_count}}</view>
</view>
<view class="delFaqButton" data-index='{{item.id}}' bindtap='delFaq'>删除</view>
</view>
</view>
<view bindtap='newFaq' class="newFaqButton">立即咨询</view>
<van-dialog id="van-dialog" />
<van-notify id="van-notify" />
\ No newline at end of file
/* pages/myNews/myFaq.wxss */
.hotFaqs{
width:100%;
}
.faqItem{
width:90%;
margin-top: 10px;
margin-left: 0;
margin-right: 0;
padding:10px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-radius: 5px;
border: 1rpx solid gray;
}
.faqCol1{
width:82%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: left;
}
.faqCotent{
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
font-size: 17px;
}
.faqContent image {
width: 10px;
height: 10px;
}
.faqContent text {
margin-left: 5px;
width: 90%;
word-break:break-all;
}
.faqReplycount{
font-size: 14px;
margin-left: 15px;
}
.faqCol2{
width:17%;
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;
}
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