You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
2.3 KiB
130 lines
2.3 KiB
// pages/user/service/list/index.js
|
|
import util from "../../../../utils/util"
|
|
import commonApi from "../../../../utils/https/common"
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
typeid:null,
|
|
tagid:null,
|
|
list:[],
|
|
total:1,
|
|
page_no:1,
|
|
keyword:""
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
if(options.tagid){
|
|
this.setData({
|
|
tagid:options.tagid
|
|
})
|
|
}
|
|
else if(options.typeid){
|
|
this.setData({
|
|
typeid:options.typeid
|
|
})
|
|
}
|
|
else {
|
|
util.back();
|
|
return;
|
|
}
|
|
this.getList();
|
|
},
|
|
changeKeyword:function(e){
|
|
this.setData({
|
|
keyword:e.detail.value
|
|
})
|
|
},
|
|
search:function(){
|
|
this.setData({
|
|
list:[],
|
|
total:1,
|
|
page_no:1
|
|
})
|
|
this.getList();
|
|
},
|
|
showService:function(){
|
|
util.pagePoint({
|
|
event:'customer_service_human_click'
|
|
},1)
|
|
wx.showModal({
|
|
title: '提示',
|
|
content: '呼叫人工客服\n0512-66555111',
|
|
confirmColor:"#0B898E",
|
|
success (res) {
|
|
if (res.confirm) {
|
|
wx.makePhoneCall({
|
|
phoneNumber: '0512-66555111',
|
|
})
|
|
} else if (res.cancel) {
|
|
}
|
|
}
|
|
})
|
|
},
|
|
getList:function(){
|
|
let service = "ics/getQuestionByTypeId",data={
|
|
type_id:this.data.typeid,
|
|
tag_id:this.data.tagid,
|
|
page_no:this.data.page_no,
|
|
page_num:10,
|
|
keywords:this.data.keyword
|
|
},list = this.data.list;
|
|
if(list.length>=this.data.total) return;
|
|
if(this.data.tagid){
|
|
service="ics/getQuestionByTagId"
|
|
}
|
|
commonApi._post(service,data).then(res=>{
|
|
this.setData({
|
|
list:list.concat(res.data.rows),
|
|
total:res.data.total,
|
|
page_no:this.data.page_no+1
|
|
})
|
|
})
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
this.getList()
|
|
}
|
|
})
|