Browse Source

no message

feature/v1.5
xpz2018 4 years ago
parent
commit
0af3c89456
17 changed files with 30 additions and 175 deletions
  1. BIN
      assets/image/message_black.png
  2. BIN
      assets/image/message_blue.png
  3. BIN
      assets/image/prase_black.png
  4. BIN
      assets/image/prase_blue.png
  5. BIN
      assets/info/feedback-white.png
  6. BIN
      assets/info/feedback.png
  7. BIN
      assets/tabbar/message-blue.png
  8. BIN
      assets/tabbar/message-gray.png
  9. 21
      pages/agent/factory-detail/index.js
  10. 1
      pages/agent/factory-detail/index.json
  11. 21
      pages/agent/factory-detail/index.wxml
  12. 42
      pages/moment/article-item/index.js
  13. 9
      pages/moment/article-item/index.json
  14. 41
      pages/moment/article-item/index.wxml
  15. 9
      pages/moment/article-item/index.wxss
  16. 2
      pages/process/index/index.wxml
  17. 59
      pages/process/outside-list/index.js

BIN
assets/image/message_black.png

Before After
Width: 42  |  Height: 34  |  Size: 592 B

BIN
assets/image/message_blue.png

Before After
Width: 42  |  Height: 34  |  Size: 576 B

BIN
assets/image/prase_black.png

Before After
Width: 40  |  Height: 42  |  Size: 579 B

BIN
assets/image/prase_blue.png

Before After
Width: 40  |  Height: 38  |  Size: 450 B

BIN
assets/info/feedback-white.png

Before After
Width: 40  |  Height: 40  |  Size: 452 B

BIN
assets/info/feedback.png

Before After
Width: 32  |  Height: 32  |  Size: 437 B

BIN
assets/tabbar/message-blue.png

Before After
Width: 50  |  Height: 50  |  Size: 1.3 KiB

BIN
assets/tabbar/message-gray.png

Before After
Width: 50  |  Height: 50  |  Size: 2.1 KiB

21
pages/agent/factory-detail/index.js

@ -1,7 +1,6 @@
// pages/message/detail/index.js // pages/message/detail/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import { getFactoryPriceDetail, userPushFollowMill } from "../../../api/ztb" import { getFactoryPriceDetail, userPushFollowMill } from "../../../api/ztb"
import { getPreferList} from "../../../api/moment"
const event = require('../../../utils/event') const event = require('../../../utils/event')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const app = getApp() const app = getApp()
@ -108,26 +107,6 @@ Scene({
} }
wx.navigateTo({url: `/pages/agent/appointment/index?id=${this.data.factoryDetail.paperMillId}&categoryId=${item.categoryId}`}) wx.navigateTo({url: `/pages/agent/appointment/index?id=${this.data.factoryDetail.paperMillId}&categoryId=${item.categoryId}`})
}, },
//*************************************************momentList************************************************//
fetchMomentList: function () {
if (this.data.requesting || this.data.finished) {
return
}
this.setData({ requesting: true })
getPreferList(this.data.form).then(result => {
if (result.data.records.length) {
var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]`
var num = this.data.form.pageNum
var finished = this.data.form.pageNum >= result.data.pages
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), requesting: false, finished })
} else {
this.setData({ finished: true, requesting: false })
}
}).catch(err => {
this.setData({ requesting: false })
})
},
onAttentionChange: function (e) { onAttentionChange: function (e) {
var model = { follow: !this.data.hasFollowed, paperMillId: this.data.id } var model = { follow: !this.data.hasFollowed, paperMillId: this.data.id }
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })

1
pages/agent/factory-detail/index.json

@ -7,7 +7,6 @@
"van-image": "/components/image/index", "van-image": "/components/image/index",
"van-button": "/components/button/index", "van-button": "/components/button/index",
"submit-layout": "/components/submit-layout/index", "submit-layout": "/components/submit-layout/index",
"article-item": "/pages/moment/article-item/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

21
pages/agent/factory-detail/index.wxml

@ -4,7 +4,7 @@
<view slot="content">纸厂详情</view> <view slot="content">纸厂详情</view>
</cu-custom> </cu-custom>
<scroll-view scroll-y style="height: {{height}}rpx;" bindscroll="onScroll" scroll-into-view="{{toView}}" bind:scrolltolower="fetchMomentList" wx:if="{{factoryDetail}}">
<scroll-view scroll-y style="height: {{height}}rpx;" bindscroll="onScroll" scroll-into-view="{{toView}}" wx:if="{{factoryDetail}}">
<view class="bg-white flex" style="padding:30rpx"> <view class="bg-white flex" style="padding:30rpx">
<van-image use-loading-slot width="108rpx" height="108rpx" radius="4" lazy-load src="{{factoryDetail.logoImg}}"> <van-image use-loading-slot width="108rpx" height="108rpx" radius="4" lazy-load src="{{factoryDetail.logoImg}}">
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> <image class="image-load" slot="loading" src="/assets/image/def_image.png"></image>
@ -82,25 +82,6 @@
</view> </view>
<view style="height:{{120 + safeBottom}}rpx"></view> <view style="height:{{120 + safeBottom}}rpx"></view>
</view> </view>
<!-- <view style="display:{{tabIndex == 1 ? 'block' : 'none'}}">
<view class="list-empty" style="height:{{height - 400}}rpx" wx:if="{{!momentList.length}}">
<view style="margin-bottom:24px" wx:if="{{requesting}}">
<van-loading type="spinner" size="32" />
</view>
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{momentList}}" wx:key="pageIndex">
<view wx:for="{{pageItem}}" wx:key="index" class="cu-card dynamic no-card">
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view>
<article-item item="{{item}}" mclick="{{false}}"></article-item>
</view>
</view>
<van-divider content-position="center" wx:if="{{ form.pageNum > 1}}">
<van-loading type="spinner" size="16" wx:if="{{!finished}}" />
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text>
</van-divider>
</view> -->
<view class="bg-white" style="display:{{tabIndex == 1 ? 'block' : 'none'}}"> <view class="bg-white" style="display:{{tabIndex == 1 ? 'block' : 'none'}}">
<view style="padding: 0rpx 30rpx" wx:for="{{factoryDetail.paperCategoryList}}" wx:key="index"> <view style="padding: 0rpx 30rpx" wx:for="{{factoryDetail.paperCategoryList}}" wx:key="index">
<wux-divider show-text="{{ false }}" wx:if="{{ index != 0 }}"></wux-divider> <wux-divider show-text="{{ false }}" wx:if="{{ index != 0 }}"></wux-divider>

42
pages/moment/article-item/index.js

@ -1,42 +0,0 @@
// pages/stock/index.js
import { likeMoment } from "../../../api/moment"
const util = require('../../../utils/util')
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
item: { type: Object, value: null },
mclick: { type: Boolean, value: true }
},
methods: {
toMill: function(){
if(!this.data.mclick){
return
}
util.navigateTo('/pages/agent/factory/index?tabIndex=1&id=' + this.data.item.millPaperId)
},
lookItem: function(e){
util.navigateTo('/pages/article/detail/index?id=' + this.data.item.id)
},
likeItem: function(e){
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
if(this.data.item.isLiked){
util.showToast('请勿重复点赞')
return
}
// /article/like-or-cancel/article/{id}
likeMoment({articleId: this.data.item.id}).then(result => {
this.setData({ ['item.likeQuantity']: result.data.likeQuantity, ['item.isLiked']: 1 })
}).catch(error => {
util.showToast(error)
})
}
}
})

9
pages/moment/article-item/index.json

@ -1,9 +0,0 @@
{
"component": true,
"usingComponents": {
"van-image": "/components/image/index",
"sudoku-image": "/components/sudoku-image/index",
"fold-text": "/components/fold-text/index",
"van-tag": "/components/tag/index"
}
}

41
pages/moment/article-item/index.wxml

@ -1,41 +0,0 @@
<!--pages/main/index.wxml-->
<wxs module="moment" src="../index.wxs"></wxs>
<view class="cu-item shadow bg-white" bindtap="lookItem">
<view class="flex flex-justify" style="padding:20rpx 32rpx">
<view class="flex" style="justify-content: flex-start;">
<van-image use-loading-slot width="108rpx" height="108rpx" round src="{{item.creatorAvatarUrl}}">
<image class="image-load" slot="loading" src="/assets/image/ygImg.png"></image>
</van-image>
<view class="flex flex-column" style="margin-left:20rpx;justify-content: center">
<view class="text-cut text-df" style="max-width:480rpx">{{item.creatorName || ''}}</view>
<view class="text-gray text-sm" style="margin-top:4rpx">{{moment.formatMTime(item.createTime)}}</view>
</view>
</view>
</view>
<view class="text-black text-bold text-lg" style="padding:0rpx 32rpx 20rpx 32rpx">{{item.title}}</view>
<fold-text content="{{item.content}}"></fold-text>
<view style="padding:0rpx 32rpx;margin-top:16rpx" wx:if="{{item.imageUrlList.length}}">
<sudoku-image image-list="{{item.imageUrlList}}"></sudoku-image>
</view>
<view class="flex flex-justify text-black" style="height:112rpx; padding:0rpx 32rpx">
<view>
<van-tag plain round wx:if="{{item.millPaperId}}" bind:click="toMill">
<text style="background-color:#ddd;border-radius: 32rpx;text-align: center;width:32rpx;height:32rpx;line-height:32rpx">#</text>
<text class="text-df text-cut" style="margin-left:16rpx;max-width:340rpx">{{item.millPaperName}}</text>
<text class="cuIcon-right text-balck" style="font-size:24rpx;margin-left:12rpx;padding-top:2rpx"></text>
</van-tag>
</view>
<view class="flex flex-center text-df">
<view class="flex flex-center" catchtap="likeItem">
<!-- <text class="cuIcon-appreciate{{item.isLiked ? 'fill' : ''}} text-{{item.isLiked ? 'blue' : 'black'}}" style="font-size:16px"></text> -->
<image style="width:40rpx;height:38rpx" src="/assets/image/prase_blue.png" wx:if="{{item.isLiked}}"></image>
<image style="width:40rpx;height:38rpx" src="/assets/image/prase_black.png" wx:else></image>
<text class="text-df" style="margin-left:12rpx">{{item.likeQuantity}}</text>
</view>
<view class="flex flex-center" style="margin-left:48rpx;">
<image style="width:42rpx;height:34rpx" src="/assets/image/message_black.png"></image>
<text style="margin-left:12rpx">{{item.replyQuantity}}</text>
</view>
</view>
</view>
</view>

9
pages/moment/article-item/index.wxss

@ -1,9 +0,0 @@
/* pages/main/index.wxss */
.image-load {
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
}

2
pages/process/index/index.wxml

@ -44,7 +44,7 @@
<view style="padding: 0rpx 28rpx;margin-top:24rpx"> <view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx"> <view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx">
<view class="flex flex-justify" style="padding: 0rpx 28rpx 8rpx 28rpx"> <view class="flex flex-justify" style="padding: 0rpx 28rpx 8rpx 28rpx">
<view class="text-black text-sg text-bold">收货管理</view>
<view class="text-black text-sg text-bold">厂内收货</view>
<view class="flex flex-center" style="padding:4rpx 0rpx 4rpx 4rpx" bindtap="orderList"> <view class="flex flex-center" style="padding:4rpx 0rpx 4rpx 4rpx" bindtap="orderList">
<view class="text-gray text-sm" style="margin-right:8rpx">查看全部订单</view> <view class="text-gray text-sm" style="margin-right:8rpx">查看全部订单</view>
<van-icon name="arrow" color="#aaa"/> <van-icon name="arrow" color="#aaa"/>

59
pages/process/outside-list/index.js

@ -91,7 +91,34 @@ Scene({
this.setData({ requesting: true }) this.setData({ requesting: true })
} }
getFactoryOrderList(this.data.form).then(result => { getFactoryOrderList(this.data.form).then(result => {
this.handResult(result)
if (result.data && result.data.records && result.data.records.length) {
var respList = result.data.records
// 对返回的消息列表进行处理,将同一天的消息显示在一起
for (let i = 0; i < respList.length; i++) {
if (util.isEmpty(this.data.lastTime)) {
this.data.lastTime = respList[i].createTime
if (this.data.lastTime.length > 10) {
this.data.lastTime = this.data.lastTime.substring(0, 10)
}
respList[i].tipsTime = this.data.lastTime
} else {
var itemTime = respList[i].createTime
if (itemTime.length > 10) {
itemTime = itemTime.substring(0, 10)
}
if (this.data.lastTime !== itemTime) {
respList[i].tipsTime = itemTime
}
this.data.lastTime = itemTime
}
}
let nowList = `orderList[${this.data.orderList.length}]`
var num = this.data.form.pageNum
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else {
this.setData({ finished: true, requesting: false, loading: false })
}
}).catch(err => { }).catch(err => {
this.setData({ requesting: false, loading: false }) this.setData({ requesting: false, loading: false })
util.showToast(err) util.showToast(err)
@ -100,36 +127,6 @@ Scene({
this.refresh.setRefresh(false) this.refresh.setRefresh(false)
}) })
}, },
handResult: function(result){
if (result.data && result.data.records && result.data.records.length) {
var respList = result.data.records
// 对返回的消息列表进行处理,将同一天的消息显示在一起
for (let i = 0; i < respList.length; i++) {
if (util.isEmpty(this.data.lastTime)) {
this.data.lastTime = respList[i].createTime
if (this.data.lastTime.length > 10) {
this.data.lastTime = this.data.lastTime.substring(0, 10)
}
respList[i].tipsTime = this.data.lastTime
} else {
var itemTime = respList[i].createTime
if (itemTime.length > 10) {
itemTime = itemTime.substring(0, 10)
}
if (this.data.lastTime !== itemTime) {
respList[i].tipsTime = itemTime
}
this.data.lastTime = itemTime
}
}
let nowList = `orderList[${this.data.orderList.length}]`
var num = this.data.form.pageNum
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else {
this.setData({ finished: true, requesting: false, loading: false })
}
},
cancelOrder: function(e){ cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })

Loading…
Cancel
Save