Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
12e562f70d
7 changed files with 61 additions and 21 deletions
  1. 4
      pages/agent/factory/index.wxml
  2. 56
      pages/article/publish/index.js
  3. 6
      pages/article/publish/index.wxml
  4. 4
      pages/article/publish/index.wxss
  5. 3
      pages/moment/fragment/index.js
  6. 6
      pages/moment/fragment/index.wxml
  7. 3
      pages/moment/recommend/index.js

4
pages/agent/factory/index.wxml

@ -171,11 +171,11 @@
</view>
</view>
<!-- <view class="booking-tool" style="bottom:{{200 + safeBottom}}rpx" bindtap="postMoment" wx:if="{{factoryDetail && tabIndex== 1}}">
<view class="booking-tool" style="bottom:{{200 + safeBottom}}rpx;z-index: 22" bindtap="postMoment" wx:if="{{factoryDetail && tabIndex== 1}}">
<view class="roder-add flex flex-center">
<text class="cuIcon-add text-white" style="font-size:32px"></text>
</view>
</view> -->
</view>
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body"
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}">

56
pages/article/publish/index.js

@ -1,5 +1,4 @@
// pages/moment/create/index.js
import { getMomentDetail, postMoment, updateMoment } from "../../../api/moment"
import { getPreferType, getMomentDetail, postMoment, updateMoment } from "../../../api/moment"
import { getFactoryList } from "../../../api/ztb"
const util = require('../../../utils/util')
const event = require('../../../utils/event.js')
@ -12,7 +11,8 @@ Page({
form: {},
requesting: false,
factoryFlag: true,
factoryList: []
factoryList: [],
typeList: []
},
/**
* 生命周期函数--监听页面加载
@ -34,6 +34,13 @@ Page({
}
})
}
getPreferType().then(result => {
this.data.typeList = []
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index]
this.data.typeList.push({value: element.id, text: element.name })
}
})
if(options.id){
wx.showLoading({ title: '加载中', mask: true })
getMomentDetail(options.id).then(result => {
@ -111,27 +118,50 @@ Page({
}
this.pickerView = this.pickerView || this.selectComponent('#picker-view')
if(this.data.factoryList.length > 0){
this.pickerView.showPicker(this.data.factoryList)
this.pickerView.showPicker(this.data.factoryList, this.data.form.millPaperId, 0)
} else {
wx.showLoading({ title: '加载中', mask: true })
getFactoryList().then(result => {
this.data.factoryList = []
for (let index = 0; index < result.data.records.length; index++) {
const element = result.data.records[index]
this.data.factoryList.push({value: element.paperMillId, text: element.name })
getPreferType().then(result => {
this.data.typeList = []
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index]
this.data.typeList.push({value: element.id, text: element.name })
}
this.pickerView.showPicker(this.data.factoryList)
this.pickerView.showPicker(this.data.factoryList, this.data.form.millPaperId, 0)
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
},
onPickerChange: function (e) {
if(!e.detail){
selectType: function(){
this.pickerView = this.pickerView || this.selectComponent('#picker-view')
if(this.data.typeList.length > 0){
this.pickerView.showPicker(this.data.typeList, this.data.form.categoryId, 1)
} else {
wx.showLoading({ title: '加载中', mask: true })
getPreferType().then(result => {
tthis.data.typeList = []
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index]
this.data.typeList.push({value: element.id, text: element.name })
}
this.pickerView.showPicker(this.data.typeList, this.data.form.categoryId, 1)
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
},
onPickerChange: function ({detail}) {
if(!detail){
return
}
this.setData({ ['form.millPaperId']: e.detail.value, ['form.millPaperName']: e.detail.text })
if(detail.type == 1) {
this.setData({ ['form.categoryId']: detail.value, ['form.typeName']: detail.text })
} else {
this.setData({ ['form.millPaperId']: detail.value, ['form.millPaperName']: detail.text })
}
}
})

6
pages/article/publish/index.wxml

@ -12,10 +12,12 @@
<textarea id="content" class="textarea" maxlength="400" cursor-spacing="40" show-confirm-bar="{{false}}" adjust-position="{{true}}" bindinput="bindInput" placeholder="点击输入内容,限定在400字以内" placeholder-style="color:#aaa" auto-height="true" value="{{form.content}}"></textarea>
</view>
<wux-uploader count="9" fileList="{{fileList}}" bindcustomevent="onImageChange"></wux-uploader>
<view class="bg-white" style="padding:30rpx">
<view class="bg-white flex flex-justify" style="padding:30rpx">
<wux-button outline type="positive" size="join" bind:click="selectFactory">#{{form.millPaperName || '选择一个纸厂'}}</wux-button>
</view>
<view class="bg-white flex flex-justify" style="padding:0rpx 30rpx 30rpx 30rpx">
<wux-button outline type="positive" size="join" bind:click="selectType">#{{form.typeName || '选择类别'}}</wux-button>
</view>
</view>
<view style="padding: 48rpx 48rpx">

4
pages/article/publish/index.wxss

@ -1,7 +1,5 @@
/* pages/moment/create/index.wxss */
.textarea {
min-height: 160rpx;
min-height: 280rpx;
font-size: 14px;
position: relative;
display: block;

3
pages/moment/fragment/index.js

@ -86,6 +86,9 @@ Component({
util.navigateTo('/pages/article/feedback/index')
}
},
postMoment: function () {
util.navigateTo('/pages/article/publish/index')
},
searchList: function(){
var tab = this.data.tabIndex == 3 ? 3 : 1
util.navigateTo(`/pages/mall/search-list/index?tab=${tab}`)

6
pages/moment/fragment/index.wxml

@ -50,4 +50,10 @@
<view class="roder-add flex flex-center">
<image src="/assets/image/icon-{{tabIndex == 3 ? 'printer' : 'feedback'}}.png" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>
<view class="booking-tool" style="bottom:{{336 + safeBottom}}rpx;z-index: 22" bindtap="postMoment" wx:if="{{tabIndex== 3}}">
<view class="roder-add flex flex-center">
<text class="cuIcon-add text-blue" style="font-size:32px"></text>
</view>
</view>

3
pages/moment/recommend/index.js

@ -86,7 +86,7 @@ Component({
continue
}
lastTime = respList[i].latestQuoteTime
if (lastTime.length > 10) {
if (lastTime && lastTime.length > 10) {
lastTime = lastTime.substring(0, 10)
}
var itemtime = new Date(lastTime).getTime()
@ -112,6 +112,7 @@ Component({
this.setData({ finished: true, requesting: false, loading: false, token: this.data.token })
}
}).catch(err => {
console.log(err)
this.setData({ requesting: false, loading: false, token: this.data.token })
util.showToast(err)
})

Loading…
Cancel
Save