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.

157 lines
2.8 KiB

5 years ago
// 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:"",
showModal: false,
// 成功
ses:true,
5 years ago
},
/**
* 生命周期函数--监听页面加载
*/
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(){
4 years ago
util.pagePoint({
event:'customer_service_human_click'
},1)
5 years ago
wx.showModal({
title: '提示',
3 years ago
content: '呼叫人工客服\n0512-66555111',
5 years ago
confirmColor:"#0B898E",
success (res) {
if (res.confirm) {
wx.makePhoneCall({
3 years ago
phoneNumber: '0512-66555111',
5 years ago
})
} 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
})
})
},
showDialogBtn: function () {
this.setData({
showModal: true
})
},
hideModal: function () {
this.setData({
showModal: false
});
},
onCancel: function () {
this.hideModal();
},
onConfirm: function (e) {
console.log(e.currentTarget.dataset.name);
this.hideModal();
},
phoneCall:function(){
console.log(1111);
wx.makePhoneCall({
phoneNumber: '0512-66555111',
})
},
5 years ago
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getList()
}
})