master
parent
81d3c30d62
commit
fd0e00e300
@ -1,76 +1,133 @@
|
|||||||
// pages/opinion/index.js
|
// pages/opinion/index.js
|
||||||
|
const app = getApp();
|
||||||
Page({
|
Page({
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
textVal: "",
|
textVal: "",
|
||||||
loading: false,
|
loading: false,
|
||||||
success: false,
|
subLoad: false,
|
||||||
},
|
success: false,
|
||||||
goList(){
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../opinionList/index',
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onReady() {},
|
onLoad (options) { },
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady () { },
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow () { },
|
||||||
|
/**
|
||||||
|
* 意见提交事件
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
submit () {
|
||||||
|
const that = this;
|
||||||
|
if (that.data.subLoad) return
|
||||||
|
that.data.subLoad = true
|
||||||
|
console.log(that.data.textVal)
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
success: true,
|
||||||
|
loading: false,
|
||||||
|
subLoad:false
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if (that.data.textVal.trim() != '') {
|
||||||
|
// console.log(312313123);
|
||||||
|
// that.setData({
|
||||||
|
// loading: true,
|
||||||
|
// });
|
||||||
|
// wx.request({
|
||||||
|
// url: app.globalData.ip + "/daotian/feedback/add",
|
||||||
|
// method: 'post',
|
||||||
|
// header: app.globalData.headers,
|
||||||
|
// data: {
|
||||||
|
// content: that.data.textVal
|
||||||
|
// },
|
||||||
|
// success: function (res) {
|
||||||
|
// console.log(res);
|
||||||
|
// if (res.data.status == 200) {
|
||||||
|
// that.setData({
|
||||||
|
// success: true,
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// wx.showToast({
|
||||||
|
// title: res.data.msg,
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// that.setData({
|
||||||
|
// loading: false,
|
||||||
|
// });
|
||||||
|
// that.data.subLoad = false
|
||||||
|
|
||||||
/**
|
// },
|
||||||
* 生命周期函数--监听页面显示
|
// fail: function (res) {
|
||||||
*/
|
// that.setData({
|
||||||
onShow() {},
|
// loading: false,
|
||||||
/**
|
// });
|
||||||
* 意见提交事件
|
// },
|
||||||
*
|
// });
|
||||||
*
|
// } else {
|
||||||
*/
|
// wx.showToast({
|
||||||
submit() {
|
// title: '请输入内容再提交',
|
||||||
const that = this;
|
// icon: 'none'
|
||||||
that.setData({
|
// })
|
||||||
loading: true,
|
// }
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
that.setData({
|
},
|
||||||
loading: false,
|
getVal (e) {
|
||||||
success: true,
|
console.log(e);
|
||||||
});
|
this.setData({
|
||||||
}, 2000);
|
textVal: e.detail.value
|
||||||
},
|
})
|
||||||
goback() {
|
console.log(this.data.textVal);
|
||||||
wx.navigateBack({
|
},
|
||||||
delta: 1,
|
goback () {
|
||||||
});
|
wx.navigateBack({
|
||||||
},
|
delta: 1,
|
||||||
/**
|
});
|
||||||
* 生命周期函数--监听页面隐藏
|
},
|
||||||
*/
|
goList () {
|
||||||
onHide() {},
|
wx.navigateTo({
|
||||||
|
url: "/pages/opinionList/index",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide () { },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onUnload() {},
|
onUnload () { },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh () { },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom() {},
|
onReachBottom () { },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage() {},
|
onShareAppMessage () { },
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="submit" wx:if="{{!success}}" hover-class="none" hover-stop-propagation="false">
|
<view class="submit" wx:if="{{!success}}" hover-class="none" hover-stop-propagation="false">
|
||||||
<textarea class="bgf textarea br8 f14" value="{{textVal}}" maxlength="140" placeholder="我们想听听您的心声,您的描述信息越全,问题越可能有效解决。" placeholder-class="f14 cccc" bindinput bindfocus bindblur bindconfirm></textarea>
|
<textarea class="bgf textarea br8 f14" value="{{textVal}}" bindinput="getVal" maxlength="140" placeholder="我们想听到您的心声..." placeholder-class="f14 cccc" bindfocus bindconfirm></textarea>
|
||||||
<button class="normalBtn loginOut f16" bindtap="submit" style="margin-top:90px" loading="{{loading}}">提交</button>
|
<button class="normalBtn loginOut f16" hover-class="thover" bindtap="submit" style="margin-top:90px" loading="{{loading}}">提交</button>
|
||||||
<view class="tac mt16" style="color:#576B95" hover-class="thover" bindtap="goList" hover-stop-propagation="false">查看记录</view>
|
<!-- <view class="tac mt16 f14" style="color:#576B95" bindtap="goList" hover-class="thover" hover-stop-propagation="false">查看记录</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="success" wx:else hover-class="none" hover-stop-propagation="false">
|
<view class="success" wx:else hover-class="none" hover-stop-propagation="false">
|
||||||
<view class="tc" style="padding-top: 100px;">
|
<view class="tc" style="padding-top: 100px;">
|
||||||
<icon class="iconfont icon-tijiaochenggong lh1" style="color:#07c160;font-size:70px"></icon>
|
<icon class="iconfont icon-tijiaochenggong lh1" style="color:#07c160;font-size:70px"></icon>
|
||||||
<view class="successText mt20 f22 fw500 lh1">已提交</view>
|
<view class="successText mt20 f22 fw500 lh1">已提交</view>
|
||||||
<view class="f14 c9 mt16" hover-class="none" hover-stop-propagation="false">感谢您的宝贵意见,我们会第一时间处理哈~</view>
|
<view class="f14 c9 mt16" hover-class="none" hover-stop-propagation="false">感谢您的宝贵意见,我们会第一时间处理哈~</view>
|
||||||
<button class="normalBtn loginOut f16" bindtap="goback" style="margin-top:50px" loading="{{loading}}">返回</button>
|
<button class="normalBtn loginOut f16" hover-class="thover" bindtap="goback" style="margin-top:50px" loading="{{loading}}">返回</button>
|
||||||
<view class="tac mt16" style="color:#576B95" hover-class="thover" bindtap="goList" hover-stop-propagation="false">查看记录</view>
|
<!-- <view class="tac mt16 f14" style="color:#576B95" bindtap="goList" hover-class="thover" hover-stop-propagation="false">查看记录</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
Reference in New Issue