Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
c2c133e01f
12 changed files with 134 additions and 181 deletions
  1. BIN
      assets/image/icon-feedback.png
  2. 2
      components/select-view/index.wxml
  3. 3
      pages/agent/edit/index.wxml
  4. 2
      pages/agent/fragment/index.wxml
  5. 146
      pages/article/feedback/index.js
  6. 1
      pages/article/feedback/index.json
  7. 60
      pages/article/feedback/index.wxml
  8. 60
      pages/article/feedback/index.wxss
  9. 4
      pages/mall/fragment/index.wxml
  10. 8
      pages/moment/fragment/index.js
  11. 8
      pages/moment/fragment/index.wxml
  12. 21
      pages/moment/fragment/index.wxss

BIN
assets/image/icon-feedback.png

Before After
Width: 100  |  Height: 100  |  Size: 1.5 KiB

2
components/select-view/index.wxml

@ -2,7 +2,7 @@
<view class="cu-modal bottom-modal {{modalName=='bottomModal'?'show':''}}" bindtap="hideModal">
<view class="cu-dialog">
<view class="cu-bar bg-white" style="min-height:90rpx;height:90rpx;border-bottom:1px solid #f3f3f3">
<view class="action text-grey" style="font-size:16px;margin-left:16rpx" bindtap="hideModal">取消</view>
<view class="action text-gray" style="font-size:16px;margin-left:16rpx" bindtap="hideModal">取消</view>
<view class="action text-blue" style="font-size:16px;margin-right:16rpx" bindtap="confrimModal">确定</view>
</view>
<picker-view indicator-style="height:45px;" style="width:100%;height:225px;" value="{{value}}" bindchange="onChange">

3
pages/agent/edit/index.wxml

@ -90,7 +90,8 @@
</view>
</view>
<view class="margin-top bg-white" style="margin-top: 16rpx;padding: 24rpx 30rpx;border-bottom: 2rpx solid #f3f3f3">
<view style="height: 16rpx;background-color: #f3f3f3;"></view>
<view class="margin-top bg-white" style="padding: 24rpx 30rpx;border-bottom: 2rpx solid #f3f3f3">
<view class="text-sg text-gray">备注信息</view>
</view>
<view class="bg-white" style="padding-top:24rpx">

2
pages/agent/fragment/index.wxml

@ -13,7 +13,7 @@
<wux-tabi scroll="{{scrolled}}" tab-data="{{tabList}}" disable="{{requesting}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi>
</view>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
<view class="bg-white list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" />
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>

146
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 })
}
})

1
pages/article/feedback/index.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"wux-button": "/components/button/index",
"select-view": "/components/select-view/index"
}
}

60
pages/article/feedback/index.wxml

@ -2,39 +2,41 @@
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">反馈情报</view>
</cu-custom>
<view class="zt">
<view class="view1">
<view class="cu-form-group margin-top" style="border-bottom: none;">
<view class="title">反馈纸厂</view>
<picker bindchange="PickerChange" value="{{fatoryNameIndex}}" range="{{fatoryNameList}}">
<view class="picker">
{{fatoryNameIndex?fatoryNameList[fatoryNameIndex]:'请选择纸厂'}}
</view>
</picker>
</view>
</view>
<view class="view2">
<view class="cu-form-group margin-top" style="border-bottom: none;">
<view class="title">反馈类型</view>
<picker bindchange="typeChange" value="{{typeIndex}}" range="{{typeList}}">
<view class="picker">
{{typeIndex?typeList[typeIndex]:'请选择反馈类型'}}
</view>
</picker>
<view class="cu-list menu no-card sm-border" style="margin-top: 16rpx;">
<view id="millId" class="cu-item" style="border-bottom: 0rpx solid #ddd" bindtap="showPicker">
<view class="flex flex-justify content cu-item arrow">
<view class="text-sg" style="min-width:170rpx">反馈纸厂:</view>
<view class="flex" style="text-align:left">
<view class="text-sg {{fatoryName?'text-black':'input-grey'}}">{{fatoryName||'请选择纸厂'}}</view>
</view>
</view>
<text class="cuIcon-right text-gray" style="font-size:32rpx;padding-top:2rpx"></text>
</view>
<view class="view3">
<view class="cu-form-group margin-top">
<view class="title">反馈内容</view>
</view>
<view style="padding-left:32rpx;padding-right:32rpx">
<view class="textareaView">
<textarea class="textarea" placeholder="请输入反馈内容,最多200字" value='{{postForm.content}}' style="padding:16rpx" bindinput='textareaBindblur'></textarea>
<view class="cu-item" style="border-bottom: 1rpx solid #f3f3f3" bindtap="showPicker">
<view class="flex flex-justify content cu-item arrow">
<view class="text-sg" style="min-width:170rpx">反馈类型:</view>
<view class="flex" style="text-align:left">
<view class="text-sg {{typeName? 'text-black' :'input-grey'}}">{{typeName || '请选择反馈类型'}}</view>
</view>
</view>
<text class="cuIcon-right text-gray" style="font-size:32rpx;padding-top:2rpx"></text>
</view>
<view class="view4" bindtap="subFeedBack">
<view class="sbtn">提交反馈</view>
</view>
<view class="margin-top bg-white" style="margin-top: 16rpx;padding: 24rpx 30rpx;border-bottom: 2rpx solid #f3f3f3">
<view class="text-sg text-gray">反馈内容</view>
</view>
<view class="bg-white" style="padding-top:24rpx">
<view class="textarea {{form.remark?'text-black':'text-gray'}}" wx:if="{{picking}}">{{form.remark?form.remark:'请输入反馈内容,最多200字'}}</view>
<textarea wx:else id="remark" maxlength="200" value="{{form.remark}}" class="textarea" cursor-spacing="60" style="padding-top:4rpx"
show-confirm-bar="{{false}}" bindinput="bindInput" placeholder-style="color:#aaa" placeholder="请输入反馈内容,最多200字"></textarea>
</view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding: 32rpx 32rpx {{safeBottom + 32}}rpx 32rpx;">
<view style="width:100%">
<wux-button block type="positive" bind:click="subFeedBack" disabled="{{requesting}}">提交反馈</wux-button>
</view>
</view>
</view>
<select-view id="picker-view" bindcustomevent="onPickerChange"></select-view>

60
pages/article/feedback/index.wxss

@ -1,57 +1,7 @@
/* pages/article/feedback/index.wxss */
page {
background-color: white;
}
.zt {
width: 100%;
padding: 0rpx 32rpx 0rpx 32rpx;
}
.view1 {
padding: 0rxp;
width: 100%;
border-bottom: 2rpx solid #f3f3f3;
}
.view2 {
width: 100%;
border-bottom: 2rpx solid #f3f3f3;
}
.view3 {
width: 100%;
height: 394rpx;
/* border-top: 2rpx solid #f3f3f3; */
}
.textarea {
height: 306rpx;
}
.textareaView {
border: 1px solid #dfdfdf;
}
.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;
.textarea{
width:100%;
height: 120px;
padding:0px 30rpx;
font-size: 14px;
}

4
pages/mall/fragment/index.wxml

@ -51,8 +51,8 @@
</view>
</wux-skeleton>
<view wx:for="{{momentList}}" wx:key="index" data-index="{{index}}" class="flex flex-justify moment-pad" bindtap="postInfo">
<view class="text-df text-black text-cut">{{item.title}}</view>
<view class="text-gray text-cut">{{item.updateTime}}</view>
<view class="text-df text-black text-cut" style="max-width: 520rpx;">{{item.title}}</view>
<view class="text-gray text-cut" style="max-width: 120rpx;">{{item.updateTime}}</view>
</view>
</view>

8
pages/moment/fragment/index.js

@ -20,6 +20,7 @@ Component({
*/
data: {
height: app.globalData.safeFragmentHeight - 270,
safeBottom: app.globalData.safeBottom,
kg: app.globalData.kg,
firstShow: false,
noticeList: [],
@ -43,6 +44,7 @@ Component({
height: app.globalData.safeFragmentHeight - 270,
StatusBar: app.globalData.StatusBar || 40,
customHeight: app.globalData.customHeight,
safeBottom: app.globalData.safeBottom,
tabIndex: 0,
firstShow: true
})
@ -71,6 +73,9 @@ Component({
chooseCity: function(){
wx.navigateTo({url: `/pages/home/city-select/index?type=1` })
},
feedback: function(){
util.navigateTo('/pages/article/feedback/index')
},
searchList: function(){
util.navigateTo('/pages/mall/search-list/index')
},
@ -100,7 +105,8 @@ Component({
})
},
toNotice: function(e){
var item = this.data.noticeList[e.currentTarget.dataset.index]
console.log(item)
},
onResume: function(){
var fragment = null

8
pages/moment/fragment/index.wxml

@ -44,4 +44,10 @@
<swiper-item catchtouchmove="stopTouchMove">
<information id="information" height="{{height}}"/>
</swiper-item>
</swiper>
</swiper>
<view class="booking-tool" style="bottom:{{200 + safeBottom}}rpx" bindtap="feedback">
<view class="roder-add flex flex-center">
<image src="/assets/image/icon-feedback.png" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>

21
pages/moment/fragment/index.wxss

@ -32,4 +32,25 @@
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
}
.booking-tool {
width: calc(100% - 20px);
background-color: #fff;
position: fixed;
left: 25px;
}
.roder-add {
display: flex;
justify-content: center;
align-items: center;
width: 100rpx;
height: 100rpx;
background-color: #fff;
border-radius: 50rpx;
position: absolute;
top: 24px;
right: 24px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
}
Loading…
Cancel
Save