Files
CompanyProject/衣莎项目/源码/YiShaXiYi/user/feedback/feedback.js
2024-09-27 01:32:49 +08:00

113 lines
2.1 KiB
JavaScript

// user/feedback/feedback.js
const app = getApp();
const regeneratorRuntime = app.loadAsync()
const model = app.loadModel("index")
const http = app.loadHttp()
Page({
/**
* 页面的初始数据
*/
data: {
system: app.globalData.system, //设备相关信息
pageTitle: "问题反馈", //头部标题
isBack: true,//显示返回
text: "",//输入的文字
},
//
feedText(e) {
this.setData({
text: e.detail.value
})
},
questionBack() {
let that = this
if (that.data.text.length <= 0) {
wx.showToast({
title: '请填写您的问题',
icon: 'none',
duration: 1000
})
return
}
wx.showModal({
title: '问题反馈',
content: '对于您的反馈我们一定尽快处理',
cancelText: '取消',
confirmText: '提交',
success(res) {
if (res.confirm) {
http.http.request2({ url: `${http.api.questionBack}`, method: "POST", data: { remarks: that.data.text } })
.then(res => {
if (res.data.status == 1) {
that.setData({
text: ''
})
wx.showToast({
title: '提交成功',
icon: 'none',
duration: 2000
})
}
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})