diff --git a/assets/image/icon-feedback.png b/assets/image/icon-feedback.png
new file mode 100644
index 0000000..7152587
Binary files /dev/null and b/assets/image/icon-feedback.png differ
diff --git a/components/select-view/index.wxml b/components/select-view/index.wxml
index bb6efda..81cbae2 100644
--- a/components/select-view/index.wxml
+++ b/components/select-view/index.wxml
@@ -2,7 +2,7 @@
- 取消
+ 取消
确定
diff --git a/pages/agent/edit/index.wxml b/pages/agent/edit/index.wxml
index 6d6b9b1..dab66f0 100644
--- a/pages/agent/edit/index.wxml
+++ b/pages/agent/edit/index.wxml
@@ -90,7 +90,8 @@
-
+
+
备注信息
diff --git a/pages/agent/fragment/index.wxml b/pages/agent/fragment/index.wxml
index 5256779..f37db08 100644
--- a/pages/agent/fragment/index.wxml
+++ b/pages/agent/fragment/index.wxml
@@ -13,7 +13,7 @@
-
+
diff --git a/pages/article/feedback/index.js b/pages/article/feedback/index.js
index cdf49bf..449ffdd 100644
--- a/pages/article/feedback/index.js
+++ b/pages/article/feedback/index.js
@@ -1,17 +1,21 @@
import { getAllFactoryList, feedbackMillInformation } from "../../../api/ztb"
const util = require('../../../utils/util')
+const app = getApp()
+
Page({
/**
* 页面的初始数据
*/
data: {
- millIdList: [],
+ safeBottom: app.globalData.safeBottom,
+ fatoryName: null,
fatoryNameList: [],
- fatoryNameIndex: null,
- typeIdList: ['1', '2', '3'],
- typeList: ['价格', '纸厂排队', '最近扣点'],
- typeIndex: null,
+ typeList: [
+ {value: '1', text: '价格'},
+ {value: '2', text: '纸厂排队'},
+ {value: '3', text: '最近扣点'}
+ ],
postForm: {
content: '',
millId: null,
@@ -23,63 +27,21 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
- this.getAllFactoryListFct()
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
+ wx.showLoading({ title: '加载中', mask: true })
+ getAllFactoryList().then(result => {
+ var fatoryNameList = []
+ result.data.forEach(element => {
+ fatoryNameList.push({value: element.paperMillId, text: element.name})
+ })
+ this.setData({ fatoryNameList, safeBottom: app.globalData.safeBottom })
+ wx.hideLoading()
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ })
},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- },
- /**
- * 分享至朋友圈
- */
- onShareTimeline: function () {
- },
+
PickerChange(e) {
console.log(e);
this.setData({
@@ -94,52 +56,56 @@ Page({
'postForm.type': this.data.typeIdList[e.detail.value]
})
},
- getAllFactoryListFct: function () {
- this.data.fatoryNameList = []
- this.data.millIdList = []
- var jxFatoryNameList = []
- var jxMillIdList = []
- getAllFactoryList().then(res => {
- res.data.forEach(element => {
- jxFatoryNameList.push(element.name)
- jxMillIdList.push(element.paperMillId)
- });
- this.setData({
- fatoryNameList: jxFatoryNameList,
- millIdList: jxMillIdList
- })
-
- })
+ showPicker: function(e){
+ this.pickerView = this.pickerView || this.selectComponent('#picker-view')
+ if(e.currentTarget.id == 'millId'){
+ this.pickerView.showPicker(this.data.fatoryNameList, this.data.postForm.millId, 1)
+ } else {
+ this.pickerView.showPicker(this.data.typeList, this.data.postForm.type, 2)
+ }
+ this.setData({ picking: true })
+ },
+ onPickerChange: function ({detail}) {
+ this.setData({ picking: false })
+ if(!detail){
+ return
+ }
+ if(detail.type == 1){
+ this.data.postForm.millId = detail.value
+ this.setData({ fatoryName: detail.text })
+ } else if(detail.type == 2){
+ this.data.postForm.type = detail.value
+ this.setData({ typeName: detail.text })
+ }
},
subFeedBack: function () {
- if (this.data.postForm.millId == '' || this.data.postForm.millId == null) {
+ if (util.isEmpty(this.data.postForm.millId)) {
util.showToast('请选择纸厂')
return
}
- if (this.data.postForm.type == '' || this.data.postForm.type == null) {
+ if (util.isEmpty(this.data.postForm.type)) {
util.showToast('请选类型')
return
}
- if (this.data.postForm.content == '' || this.data.postForm.content == null) {
+ if (util.isEmpty(this.data.postForm.content)) {
util.showToast('请填写内容')
return
}
- this.feedbackMillInformationFct(this.data.postForm)
- },
- textareaBindblur: function (e) {
- // console.log(e.detail.value)
- this.setData({
- 'postForm.content': e.detail.value
- })
- },
- feedbackMillInformationFct: function (model) {
- feedbackMillInformation(model).then(res => {
+ wx.showLoading({ title: '处理中', mask: true })
+ feedbackMillInformation(this.data.postForm).then(res => {
+ wx.hideLoading()
if (res.code == 0) {
util.showToast('提交成功!')
- util.navigateTo('/pages/article/sucessful/index')
+ wx.redirectTo({ url: '/pages/article/sucessful/index'})
} else {
util.showToast('提交失败失败!原因:' + res.message)
}
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
})
+ },
+ bindInput: function (e) {
+ this.setData({ 'postForm.content': e.detail.value })
}
})
\ No newline at end of file
diff --git a/pages/article/feedback/index.json b/pages/article/feedback/index.json
index c791e97..973018c 100644
--- a/pages/article/feedback/index.json
+++ b/pages/article/feedback/index.json
@@ -1,5 +1,6 @@
{
"usingComponents": {
+ "wux-button": "/components/button/index",
"select-view": "/components/select-view/index"
}
}
\ No newline at end of file
diff --git a/pages/article/feedback/index.wxml b/pages/article/feedback/index.wxml
index 707153b..05979e5 100644
--- a/pages/article/feedback/index.wxml
+++ b/pages/article/feedback/index.wxml
@@ -2,39 +2,41 @@
反馈情报
-
-
-
- 反馈纸厂
-
-
- {{fatoryNameIndex?fatoryNameList[fatoryNameIndex]:'请选择纸厂'}}
-
-
-
-
-
-
- 反馈类型
-
-
- {{typeIndex?typeList[typeIndex]:'请选择反馈类型'}}
-
-
+
+