Commit c2939f2e authored by wangxuelai's avatar wangxuelai

'帮助中心完结'

parent 6f897c6f
// business/pages/helpcenter/detail.js
import {
helpDetail
} from '../../../service/common.js';
Page({
/**
* 页面的初始数据
*/
data: {
sid: 0,
alias: 0,
detail: {
title: '',
content: [],
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const { alias, sid } = options;
this.setData({
alias,
sid,
})
this.helpDetail();
},
/**
......@@ -62,5 +75,25 @@ Page({
*/
onShareAppMessage: function () {
},
helpDetail () {
helpDetail({
alias: this.data.alias
}).then((res) => {
const { code, data } = res;
if (code == 200) {
let content = [];
try {
content = JSON.parse(data.content);
} catch (error) {
content = [];
}
console.log(content, 'content');
data.content = content;
this.setData({
detail: data,
})
}
})
}
})
\ No newline at end of file
<!--business/pages/helpcenter/detail.wxml-->
<text>business/pages/helpcenter/detail.wxml</text>
<view class="container">
<view class="questionbox">
<view class="title">
{{detail.title}}
</view>
<view class="detailbox" wx:if="{{detail.content.length > 0}}">
<rich-text
class="rich-text-box"
nodes="{{detail.content[0].value}}"
space="nbsp"
/>
</view>
</view>
</view>
\ No newline at end of file
/* business/pages/helpcenter/detail.wxss */
\ No newline at end of file
.container {
min-height: 100vh;
background-color: #EFEFF4;
padding: 20rpx;
}
.questionbox {
background-color: #fff;
border-radius: 12rpx;
border: 1px solid rgba(221,221,221,1);
}
.title {
padding: 32rpx 26rpx;
font-size: 34rpx;
color: #222222;
border-bottom: 1px solid #E8E8E8;
word-break: break-all;
}
.detailbox {
padding: 30rpx 24rpx;
}
/* .rich-text-box {
max-width: 100%;
} */
/* .rich-text-box img{
max-width: 100%;
} */
\ No newline at end of file
import { helpList } from "../../../service/common.js";
import { helpList, helpAds } from "../../../service/common.js";
import { imagify } from "../../../utilities/index.js";
var app = getApp();
......@@ -15,7 +15,8 @@ Page({
hasmore: true,
emptyPage: false,
listLoading: false,
curbanner: 0
curbanner: 0,
adsList: [],
},
onLoad: function(options) {
const { sid } = options;
......@@ -23,6 +24,7 @@ Page({
sid
});
this.getlist("init");
this.getAds();
},
onPullDownRefresh: function() {
this.setData({
......@@ -34,6 +36,32 @@ Page({
onReachBottom: function() {
this.getlist("up");
},
bindSwiperchange (e) {
const { current } = e.detail;
this.setData({
curbanner: current
})
},
getAds () {
helpAds({
type: 1,
page: 1,
perPage: 10
}).then((res) => {
const { code, data } = res;
if (code == 200) {
// this.adsList = data.list;
this.setData({
adsList: data.list
})
} else {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
getlist(type) {
if (!this.data.hasmore) {
return;
......@@ -79,7 +107,6 @@ Page({
hasmore: false
});
}
console.log(this.data.list, "11");
break;
case "down": // 页面下拉刷新
this.setData({
......@@ -142,14 +169,26 @@ Page({
return _length;
},
toHelpdetail(e){
const { id } = e.currentTarget.dataset;
const { alias } = e.currentTarget.dataset;
wx.navigateTo({
url: `/business/pages/helpcenter/detail?sid=${this.data.sid}&id=${id}`
url: `/business/pages/helpcenter/detail?sid=${this.data.sid}&alias=${alias}`
})
},
toPostFeedback() {
wx.navigateTo({
url: `/business/pages/helpcenter/feedbacksubmit?sid=${this.data.sid}`
})
},
goLink (e) {
const { ad } = e.currentTarget.dataset; // 1-小程序 2-公众号文章 3-自定义连接 4-无
if (ad.redirect_type == 1) {
console.log(ad.redirect_type, 'adsads');
} else if (ad.redirect_type == 2) {
console.log(ad.redirect_type, 'adsads');
} else if (ad.redirect_type == 3) {
console.log(ad.redirect_type, 'adsads');
} else if (ad.redirect_type == 4) {
console.log(ad.redirect_type, 'adsads');
}
}
});
......@@ -3,25 +3,27 @@
<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"
<swiper-item class="swiperitembox" wx:for="{{adsList}}" wx:key="id" wx:for-item="ads">
<image
class="swiperimg"
src="{{filter.imagify(ads.img)}}"
data-url="{{item}}"
bindtap="goLink"
mode="aspectFill"
data-ad="{{ads}}"
>
</image>
</swiper-item>
</swiper>
<view class="swiperdots">
<view class="dot {{curbanner==index?'active':''}}" wx:for="5" wx:key="index"></view>
<view wx:for="{{adsList}}" class="dot {{curbanner==index?'active':''}}" wx:key="id" wx:for-item="ads"></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="list-item" wx:for="{{bigitem}}" wx:for-item="item" wx:key="index" data-alias="{{item.alias}}" bindtap="toHelpdetail">
<view class="item-title">{{item.title}}</view>
<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
......
......@@ -2,7 +2,7 @@ page {
position: relative;
}
.container {
padding-bottom: 100rpx;
padding-bottom: 140rpx;
}
.swiperbox {
width: 100%;
......@@ -73,9 +73,10 @@ page {
color: rgba(34, 34, 34, 1);
line-height: 42rpx;
max-width: 650rpx;
overflow: hidden;
word-wrap: break-word;
/* overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-overflow: ellipsis; */
}
.list .list-item .icon-arr {
width: 12rpx;
......
......@@ -55,7 +55,7 @@
</view>
<view class="line" bindtap="goHelpcenter">
<view class="left">
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/set-icon.png?{{imageVersion}}" />意见反馈
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/helpcenter.png?{{imageVersion}}" />意见反馈
</view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
......
......@@ -18,6 +18,7 @@ const apis = {
},
// 帮助中心
help: {
ads: `${api}common/ads`,
helpList: `${api}common/helps`,//帮助列表
helpDetail: `${api}common/help/show`,//帮助详情
},
......
......@@ -495,6 +495,14 @@ function helpDetail(data) {
errorresolve: 1,
})
}
function helpAds(data) {
return wxRequest({
url: `${apis.help.ads}`,
data,
method: 'GET',
errorresolve: 1,
})
}
export {
cOssAccess,
getCircleUserShow,
......@@ -545,5 +553,6 @@ export {
courseGalleryCommentDelete,
generateClassReviewPiiic,
helpList,
helpDetail
helpDetail,
helpAds
}
\ 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