160 lines
2.9 KiB
JavaScript
160 lines
2.9 KiB
JavaScript
|
|
// pages/userMsgDel/userMsgDel.js
|
||
|
|
var app = getApp()
|
||
|
|
Page({
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面的初始数据
|
||
|
|
*/
|
||
|
|
data: {
|
||
|
|
show:false,
|
||
|
|
typeList:[
|
||
|
|
{name:'挂号相关',type:'0'},
|
||
|
|
{name:'缴费相关',type:'1'},
|
||
|
|
{name:'使用问题',type:'2'},
|
||
|
|
],
|
||
|
|
typeName:'',
|
||
|
|
typeId:'',
|
||
|
|
msgDes:'',
|
||
|
|
yx:'',
|
||
|
|
phone:''
|
||
|
|
},
|
||
|
|
save(){
|
||
|
|
let yx = this.data.yx
|
||
|
|
let phone = this.data.phone
|
||
|
|
let type = this.data.typeId
|
||
|
|
let msg = this.data.msgDes
|
||
|
|
if(yx == '' &&phone ==''){
|
||
|
|
wx.showModal({
|
||
|
|
title: '',
|
||
|
|
content: '至少输入一个联系方式,方便我们解决您的问题!',
|
||
|
|
cancelText:"否",
|
||
|
|
confirmText:'是',
|
||
|
|
success: function(res) {
|
||
|
|
if (res.confirm) {
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}else{
|
||
|
|
wx.request({
|
||
|
|
url:'https://fy.btlsoln.com:8443/problemFeedback?type&content&phone&email',
|
||
|
|
method:"GET",
|
||
|
|
data:{
|
||
|
|
type:type,
|
||
|
|
content:msg,
|
||
|
|
phone:phone,
|
||
|
|
email:yx
|
||
|
|
},
|
||
|
|
header: {
|
||
|
|
'content-type': 'application/json'
|
||
|
|
},
|
||
|
|
success: (res)=> {
|
||
|
|
console.log(res,"提交反馈")
|
||
|
|
if(res.data.errCode == 0){
|
||
|
|
wx.showToast({
|
||
|
|
title: '提交成功',
|
||
|
|
icon: 'success',
|
||
|
|
duration: 2000
|
||
|
|
})
|
||
|
|
}
|
||
|
|
setTimeout(item => {
|
||
|
|
wx.navigateBack({
|
||
|
|
delta: 1 //返回上一级页面
|
||
|
|
})
|
||
|
|
},1000)
|
||
|
|
},
|
||
|
|
fail (err) {
|
||
|
|
console.error('失败', err)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
},
|
||
|
|
showPop(){
|
||
|
|
this.setData({ show: true });
|
||
|
|
},
|
||
|
|
onClose() {
|
||
|
|
this.setData({ show: false, });
|
||
|
|
},
|
||
|
|
confirm(e){
|
||
|
|
console.log(e.currentTarget.dataset.item)
|
||
|
|
let item = e.currentTarget.dataset.item
|
||
|
|
this.setData({
|
||
|
|
show: false,
|
||
|
|
typeName:item.name,
|
||
|
|
typeId:item.type
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
msgDes:function(e){
|
||
|
|
this.setData({
|
||
|
|
msgDes:e.detail.value
|
||
|
|
})
|
||
|
|
},
|
||
|
|
yx:function(e){
|
||
|
|
this.setData({
|
||
|
|
yx:e.detail.value
|
||
|
|
})
|
||
|
|
},
|
||
|
|
phone:function(e){
|
||
|
|
this.setData({
|
||
|
|
phone:e.detail.value
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面加载
|
||
|
|
*/
|
||
|
|
onLoad: function (options) {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
|
*/
|
||
|
|
onReady: function () {
|
||
|
|
wx.setNavigationBarTitle({
|
||
|
|
title:'问题反馈'
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面显示
|
||
|
|
*/
|
||
|
|
onShow: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面隐藏
|
||
|
|
*/
|
||
|
|
onHide: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面卸载
|
||
|
|
*/
|
||
|
|
onUnload: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
|
*/
|
||
|
|
onPullDownRefresh: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面上拉触底事件的处理函数
|
||
|
|
*/
|
||
|
|
onReachBottom: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 用户点击右上角分享
|
||
|
|
*/
|
||
|
|
onShareAppMessage: function () {
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|