Commit 78b1f940 authored by lvtz's avatar lvtz

page add

parent e759471e
......@@ -3,7 +3,9 @@
"ucenter/index",
"business/pages/webview/index",
"business/pages/helpcenter/feedbacksubmit",
"business/pages/helpcenter/myfeedback"
"business/pages/helpcenter/myfeedback",
"business/pages/helpcenter/index",
"business/pages/helpcenter/detail"
],
"subpackages": [
{
......
// business/pages/helpcenter/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "帮助详情",
"usingComponents": {
"expiredTip": "../../components/expiredTip"
}
}
\ No newline at end of file
<!--business/pages/helpcenter/detail.wxml-->
<text>business/pages/helpcenter/detail.wxml</text>
/* business/pages/helpcenter/detail.wxss */
\ No newline at end of file
......@@ -18,7 +18,7 @@ Page({
onLoad: function(options) {
const {sid} = options;
this.setData({
sid: sid || 3
sid: sid
})
},
imgUpload(e) {
......
import { helpList } from "../../../service/common.js";
import { imagify } from "../../../utilities/index.js";
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: "../../../images/",
sid: 0,
page: 1,
perPage: 10,
list: [],
tatol: "",
hasmore: true,
emptyPage: false,
listLoading: false,
curbanner: 0
},
onLoad: function(options) {
const { sid } = options;
this.setData({
sid
});
this.getlist("init");
},
onPullDownRefresh: function() {
this.setData({
hasmore: true,
page: 1
});
this.getlist("down");
},
onReachBottom: function() {
this.getlist("up");
},
getlist(type) {
if (!this.data.hasmore) {
return;
}
if (this.data.listLoading) {
return;
}
this.setData({
listLoading: true
});
helpList({
page: this.data.page,
perPage: this.data.perPage
})
.then(res => {
const { code, data } = res;
wx.hideLoading();
this.setData({
listLoading: false
});
if (code != 200) {
// 失败的处理
} else {
if (data.total) {
this.setData({
total: data.total
});
}
switch (type) {
case "init": //页面进来第一次加载
this.setData({
list: [data.list]
});
if (data.total > this.caculateArrLength(this.data.list)) {
let page = this.data.page + 1;
this.setData({
page
});
} else {
// 没有更多了
this.setData({
hasmore: false
});
}
console.log(this.data.list, "11");
break;
case "down": // 页面下拉刷新
this.setData({
list: [data.list]
});
if (data.total > this.caculateArrLength(this.data.list)) {
let page = this.data.page + 1;
this.setData({
page
});
} else {
// 没有更多了
this.setData({
hasmore: false
});
}
wx.stopPullDownRefresh();
break;
case "up": // 页面上拉刷新
this.setData({
[`list[${this.data.page - 1}]`]: data.list
});
if (this.data.total > this.caculateArrLength(this.data.list)) {
let page = this.data.page + 1;
this.setData({
page
});
} else {
// 没有更多了
this.setData({
hasmore: false
});
}
break;
default:
break;
}
if (this.caculateArrLength(this.data.list) == 0) {
this.setData({
emptyPage: true
});
} else {
this.setData({
emptyPage: false
});
}
}
})
.catch(e => {
this.setData({
listLoading: false
});
});
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
});
return _length;
},
toHelpdetail(e){
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: `/business/pages/helpcenter/detail?sid=${this.data.sid}&id=${id}`
})
},
toPostFeedback() {
wx.navigateTo({
url: `/business/pages/helpcenter/feedbacksubmit?sid=${this.data.sid}`
})
}
});
{
"navigationBarTitleText": "帮助中心",
"usingComponents": {
"expiredTip": "../../components/expiredTip",
"empty-content": "../../components/emptycontent"
}
}
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="page_topline"></view>
<view class="container">
<view class="swiperbox">
<swiper class="swiperbox" autoplay circular bindchange="bindSwiperchange">
<swiper-item class="swiperitembox" wx:for="5" wx:key="index" wx:for-item="item">
<image class="swiperimg"
src="https://dss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/img/qrcode/zbios_09b6296.png"
data-url="{{item}}"
bindtap="previewBanner"
mode="aspectFill"
>
</image>
</swiper-item>
</swiper>
<view class="swiperdots">
<view class="dot {{curbanner==index?'active':''}}" wx:for="5" wx:key="index"></view>
</view>
</view>
<view class="section">
<view class="section-title">常见问题</view>
<view class="list" wx:if="{{list.length>0}}">
<block wx:for="{{list}}" wx:for-item="bigitem" wx:key="bigindex" wx:for-index="bigindex">
<view class="list-item" wx:for="{{bigitem}}" wx:for-item="item" wx:key="index" data-id="{{item.id}}" bindtap="toHelpdetail">
<view class="item-title">{{item.title}}</view>
<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</block>
</view>
<view class="empty-content" wx:else>
<empty-content text="暂未添加" emptyimg="common/empty/empty_b_search.png" width="255" height="198"></empty-content>
</view>
</view>
<view class="footer-box">
<view class="btn btn-feedback" bindtap="toPostFeedback"><image class="icon" src="{{imageRoot}}2b/organizationalmgt/pc-icon.png?{{imageVersion}}"/>建议反馈</view>
<view class="btn btn-contact" bindtap=""><image class="icon" src="{{imageRoot}}2b/organizationalmgt/pc-icon.png?{{imageVersion}}"/>在线咨询</view>
</view>
</view>
\ No newline at end of file
page {
position: relative;
}
.container {
padding-bottom: 100rpx;
}
.swiperbox {
width: 100%;
height: 500rpx;
position: relative;
}
.swiperitembox {
width: 100%;
height: 500rpx;
}
.swiperimg {
width: 100%;
height: 500rpx;
display: block;
}
.swiperbox {
height: 500rpx;
}
.swiperdots {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 20rpx;
display: flex;
align-items: center;
}
.swiperdots .dot {
width: 10rpx;
height: 10rpx;
margin: 0 4rpx;
border-radius: 50%;
background: #fff;
}
.swiperdots .dot.active {
width: 14rpx;
height: 14rpx;
background: #ff594d;
}
.section {
padding: 0 30rpx;
}
.section .section-title {
font-size: 36rpx;
color: rgba(34, 34, 34, 1);
line-height: 50rpx;
padding: 32rpx 0 20rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
}
.list {
}
.list .list-item {
position: relative;
display: flex;
padding: 18rpx 0;
}
.list .list-item::after {
content: "";
width: 100%;
height: 1px;
background: rgba(232, 232, 232, 1);
position: absolute;
left: 0;
bottom: 0;
}
.list .list-item .item-title {
font-size: 30rpx;
color: rgba(34, 34, 34, 1);
line-height: 42rpx;
max-width: 650rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.list .list-item .icon-arr {
width: 12rpx;
height: 24rpx;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}
.empty-content{
height: 500rpx;
position: relative;
}
.footer-box {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
padding: 20rpx 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 2;
}
.footer-box .btn {
width: 244rpx;
height: 84rpx;
border-radius: 42rpx;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.footer-box .btn.btn-feedback {
background: #fff;
color: rgba(22, 176, 253, 1);
box-shadow: 0 1px 12rpx 0 rgba(22, 176, 253, 0.3),
0 1px 4rpx 0 rgba(73, 194, 255, 0.2);
}
.footer-box .btn.btn-contact {
background: rgba(22, 176, 253, 1);
color: #fff;
box-shadow: 0 1px 12rpx 0 rgba(22, 176, 253, 0.4);
}
.footer-box .btn .icon {
width: 50rpx;
height: 50rpx;
margin-right: 14rpx;
}
......@@ -219,7 +219,7 @@ Page({
},
goHelpcenter() {
wx.navigateTo({
url: `/business/pages/helpcenter/feedbacksubmit?sid=${this.data.sid}`
url: `/business/pages/helpcenter/index?sid=${this.data.sid}`
})
}
})
\ No newline at end of file
......@@ -16,6 +16,11 @@ const apis = {
behaviorLog: `${api}student/data/behavior`,
sharerLog: `${api}student/data/share`,
},
// 帮助中心
help: {
helpList: `${api}common/helps`,//帮助列表
helpDetail: `${api}common/help/show`,//帮助详情
},
customer: {
integral: {
myIntegral: `${api}student/integral/me`,
......
......@@ -478,6 +478,23 @@ function courseGalleryCommentDelete(data) {
needToken: true,
})
}
function helpList(data) {
return wxRequest({
url: `${apis.help.helpList}`,
data,
method: 'GET',
errorresolve: 1,
})
}
function helpDetail(data) {
return wxRequest({
url: `${apis.help.helpDetail}`,
data,
method: 'GET',
errorresolve: 1,
})
}
export {
cOssAccess,
getCircleUserShow,
......@@ -526,5 +543,7 @@ export {
courseGalleryCommentsList,
courseGalleryCommentPost,
courseGalleryCommentDelete,
generateClassReviewPiiic
generateClassReviewPiiic,
helpList,
helpDetail
}
\ 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