Browse Source

2-6-2.17UI

featrue/v4.3
huziyuan 5 years ago
parent
commit
45cbb4829d
10 changed files with 231 additions and 21 deletions
  1. 1
      app.json
  2. BIN
      assets/info/sucessful.png
  3. 6
      pages/api/ztb.js
  4. 63
      pages/article/feedback/index.js
  5. 18
      pages/article/feedback/index.wxml
  6. 45
      pages/article/feedback/index.wxss
  7. 70
      pages/article/sucessFul/index.js
  8. 3
      pages/article/sucessFul/index.json
  9. 11
      pages/article/sucessFul/index.wxml
  10. 35
      pages/article/sucessFul/index.wxss

1
app.json

@ -36,6 +36,7 @@
"pages/article/feedback/index", "pages/article/feedback/index",
"pages/article/list/index", "pages/article/list/index",
"pages/article/attentionPaperFactory/index", "pages/article/attentionPaperFactory/index",
"pages/article/sucessFul/index",
"pages/goods/ablility/index", "pages/goods/ablility/index",
"pages/goods/index/index", "pages/goods/index/index",
"pages/goods/detail/index", "pages/goods/detail/index",

BIN
assets/info/sucessful.png

Before After
Width: 200  |  Height: 200  |  Size: 2.8 KiB

6
pages/api/ztb.js

@ -129,7 +129,8 @@ const updateUserInfoZtb = (params) => mPost(`/recycle-service/user/update/user-i
const userPushFollowMill = (params) => mPost(`/recycle-service/user/push/follow-mill`, params, zconfig) const userPushFollowMill = (params) => mPost(`/recycle-service/user/push/follow-mill`, params, zconfig)
//用户在情报中获取纸厂 //用户在情报中获取纸厂
const getPaperMillOfInformationList = (params) => mGet(`/recycle-service/get/paper-mill-of-information-list`, params, zconfig) const getPaperMillOfInformationList = (params) => mGet(`/recycle-service/get/paper-mill-of-information-list`, params, zconfig)
//反馈纸厂情报
const feedbackMillInformation = (params) => mPost(`/recycle-service/feedback/mill-information`, params, zconfig)
export { export {
@ -226,5 +227,6 @@ export {
updateUserInfo, updateUserInfo,
updateUserInfoZtb, updateUserInfoZtb,
userPushFollowMill, userPushFollowMill,
getPaperMillOfInformationList
getPaperMillOfInformationList,
feedbackMillInformation
} }

63
pages/article/feedback/index.js

@ -1,19 +1,30 @@
// pages/article/feedback/index.js // pages/article/feedback/index.js
import { getAllFactoryList,feedbackMillInformation} from "../../api/ztb"
const util = require('../../../utils/util')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
picker: ['喵喵喵', '汪汪汪', '哼唧哼唧'],
index: null,
millIdList:[],
fatoryNameList: [],
fatoryNameIndex: null,
typeIdList:['1','2','3'],
typeList:['价格','纸厂排队','最近扣点'],
typeIndex:null,
postForm:{
content:'',
millId:null,
type:null
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getAllFactoryListFct()
}, },
@ -68,7 +79,51 @@ Page({
PickerChange(e) { PickerChange(e) {
console.log(e); console.log(e);
this.setData({ this.setData({
index: e.detail.value
fatoryNameIndex: e.detail.value,
'postForm.millId':this.data.millIdList[e.detail.value]
}) })
}, },
typeChange(e) {
console.log(e);
this.setData({
typeIndex: e.detail.value,
'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
})
})
},
subFeedBack:function(){
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=>{
if(res.code==0){
util.showToast('提交成功!')
util.navigateTo('/pages/article/sucessFul/index')
}else{
util.showToast('提交失败失败!原因:'+res.message)
}
})
}
}) })

18
pages/article/feedback/index.wxml

@ -6,9 +6,9 @@
<view class="view1"> <view class="view1">
<view class="cu-form-group margin-top"> <view class="cu-form-group margin-top">
<view class="title">反馈纸厂</view> <view class="title">反馈纸厂</view>
<picker bindchange="PickerChange" value="{{index}}" range="{{picker}}">
<picker bindchange="PickerChange" value="{{fatoryNameIndex}}" range="{{fatoryNameList}}">
<view class="picker"> <view class="picker">
{{index?picker[index]:'禁止换行,超出容器部分会以 ... 方式截断'}}
{{fatoryNameIndex?fatoryNameList[fatoryNameIndex]:'请选择纸厂'}}
</view> </view>
</picker> </picker>
</view> </view>
@ -16,9 +16,9 @@
<view class="view2"> <view class="view2">
<view class="cu-form-group margin-top"> <view class="cu-form-group margin-top">
<view class="title">反馈类型</view> <view class="title">反馈类型</view>
<picker bindchange="PickerChange" value="{{index}}" range="{{picker}}">
<picker bindchange="typeChange" value="{{typeIndex}}" range="{{typeList}}">
<view class="picker"> <view class="picker">
{{index?picker[index]:'禁止换行,超出容器部分会以 ... 方式截断'}}
{{typeIndex?typeList[typeIndex]:'请选择反馈类型'}}
</view> </view>
</picker> </picker>
</view> </view>
@ -27,9 +27,15 @@
<view class="cu-form-group margin-top"> <view class="cu-form-group margin-top">
<view class="title">反馈内容</view> <view class="title">反馈内容</view>
</view> </view>
<view class="textareaView">
<textarea class="textarea"></textarea>
<view style="padding-left:32rpx;padding-right:32rpx">
<view class="textareaView">
<textarea class="textarea" value='{{postForm.content}}' bindinput='textareaBindblur'></textarea>
</view>
</view> </view>
</view>
<view class="view4" bindtap="subFeedBack">
<view class="sbtn">提交反馈</view>
</view> </view>
</view> </view>

45
pages/article/feedback/index.wxss

@ -1,30 +1,57 @@
/* pages/article/feedback/index.wxss */ /* pages/article/feedback/index.wxss */
page{
page {
background-color: white; background-color: white;
} }
.zt{
.zt {
width: 100%; width: 100%;
padding: 0rpx 32rpx 0rpx 32rpx; padding: 0rpx 32rpx 0rpx 32rpx;
} }
.view1{
.view1 {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
border-top: 2rpx solid #f3f3f3; border-top: 2rpx solid #f3f3f3;
} }
.view2{
.view2 {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
border-top: 2rpx solid #f3f3f3; border-top: 2rpx solid #f3f3f3;
} }
.view3{
.view3 {
width: 100%; width: 100%;
height: 394rpx; height: 394rpx;
border-top: 2rpx solid #f3f3f3; border-top: 2rpx solid #f3f3f3;
} }
.textarea{
height:306rpx;
.textarea {
height: 306rpx;
} }
.textareaView{
.textareaView {
border: 1px solid; border: 1px solid;
}
.view4 {
width: 100%;
height: 96rpx;
margin-top: 400rpx;
}
.sbtn {
width: 686rpx;
height: 96rpx;
background: #007AFF;
border-radius: 8rpx;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-size: 36rpx;
color: #FFFFFF;
letter-spacing: 0;
text-align: left;
line-height: 96rpx;
text-align: center;
} }

70
pages/article/sucessFul/index.js

@ -0,0 +1,70 @@
// pages/article/sucessFul/index.js
const util = require('../../../utils/util')
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
rt:function(){
wx.navigateBack()
}
})

3
pages/article/sucessFul/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

11
pages/article/sucessFul/index.wxml

@ -0,0 +1,11 @@
<!--pages/article/sucessFul/index.wxml-->
<view class="zt">
<view class="view1">
<image style="width:198.3rpx;height:198.3rpx" src="/assets/info/sucessful.png"></image>
</view>
<view class="view2">您反馈的情报信息已查收,谢谢您对平台的参与和支持。</view>
<view class="view3">
<view class="btnView" bindtap="rt">关闭</view>
</view>
</view>

35
pages/article/sucessFul/index.wxss

@ -0,0 +1,35 @@
/* pages/article/sucessFul/index.wxss */
page {
background-color: white;
}
.view1 {
padding: 120rpx 275rpx 97rpx 275.8rpx;
}
.view2 {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: rgba(0, 0, 0, 0.75);
text-align: center;
padding-left: 55rpx;
padding-right: 55rpx;
}
.view3 {
padding-left: 32rpx;
padding-right: 32rpx;
margin-top: 80rpx;
}
.btnView {
background: #007AFF;
height: 96rpx;
border-radius: 8rpx;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-size: 36rpx;
color: #FFFFFF;
text-align: center;
line-height: 96rpx;
}
Loading…
Cancel
Save