1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- //logs.js
- const util = require('../../utils/util.js')
- // var util = require('../../utils/util.js');
- var app = getApp();
- //textarea.js
- Page({
- data: {
- height: 30,
- userInput: '',
- int_number: '100',
- list_number: '100',
- focus: false
- },
- bindButtonTap: function () {
- this.setData({
- focus: true
- })
- },
- bindFormSubmit: function (e) {
- var that = this, token = wx.getStorageSync('user').token, value = e.detail.value.textarea.replace(/(^\s*)|(\s*$)/g, "");
- if (value) {
- wx.request({
- url: app.globalData.HOST + '/user/wx/addMessage',
- method: 'POST',
- data: Object.assign({}, app.globalData.common, {
- token: token,
- content: value
- }),
- success: function (res) {
- if (res.data.errno == 0) {
- app.noticeModal('我们会及时处理,感谢您的反馈~', that.goMine)
- }
- }
- });
- }else{
- app.noticeModal('反馈内容不能为空')
- }
- },
- goMine () {
- wx.switchTab({
- url: '/pages/mine/mine'
- })
- },
- bindTextAreaBlur: function (e) {
- var that = this;
- var textvalue = e.detail.value, int_number = that.data.int_number, list_number = that.data.list_number,
- slen = '';
- var strlen = textvalue.length;
- int_number = strlen;
- if (int_number > list_number) {
- slen = textvalue.substr(0, list_number - 1);
- that.setData({
- userInput: slen
- })
- } else {
- var int_number = list_number - int_number;
- that.setData({
- int_number: int_number,
- })
- }
- }
- })
|