33 changed files with 65 additions and 1417 deletions
Split View
Diff Options
-
2app.json
-
BINassets/image/ico_vip1.png
-
BINassets/image/ico_vip2.png
-
BINassets/image/ico_vip3.png
-
163pages/article/hot-index/index.js
-
18pages/article/hot-index/index.json
-
38pages/article/hot-index/index.wxml
-
98pages/article/hot-index/index.wxss
-
42pages/article/index/index.js
-
9pages/article/index/index.json
-
21pages/article/index/index.wxml
-
22pages/article/index/index.wxss
-
99pages/article/point-index/index.js
-
16pages/article/point-index/index.json
-
50pages/article/point-index/index.wxml
-
98pages/article/point-index/index.wxss
-
173pages/article/price-detail/index.js
-
7pages/article/price-detail/index.json
-
60pages/article/price-detail/index.wxml
-
16pages/article/price-detail/index.wxss
-
86pages/article/price-index/index.js
-
18pages/article/price-index/index.json
-
42pages/article/price-index/index.wxml
-
82pages/article/price-index/index.wxss
-
82pages/article/queue-detail/index.js
-
6pages/article/queue-detail/index.json
-
38pages/article/queue-detail/index.wxml
-
11pages/article/queue-detail/index.wxss
-
80pages/article/queue-index/index.js
-
16pages/article/queue-index/index.json
-
41pages/article/queue-index/index.wxml
-
45pages/article/queue-index/index.wxss
-
3utils/util.js
@ -1,163 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getPreferList } from "../../../api/moment" |
|||
import { getAllFactoryList, getIndexInfoId } from "../../../api/ztb" |
|||
const util = require('../../../utils/util') |
|||
const storage = require('../../../utils/storage') |
|||
const event = require('../../../utils/event.js') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.safeFragmentHeight - 90, |
|||
chartList: null, |
|||
momentList: [], |
|||
requesting: false, |
|||
finished: false, |
|||
idList: '', |
|||
form: { |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
}, |
|||
noticeList: [], |
|||
loopIndex: 0, |
|||
noticeIndex: 0, |
|||
loopRequesting: false, |
|||
content: '', |
|||
factoryList: [] |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.setData({ height: app.globalData.safeFragmentHeight - 90 }) |
|||
this.onRefreshList() |
|||
} |
|||
if(!this.data.noticeList.length && !this.data.status){ |
|||
this.fetchNoticeList() |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 570 || message.what == 571 || message.what == 572 || message.what == 573) { |
|||
// 帖子发布刷新
|
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
//***********************************参与纸厂讨论*****************************************//
|
|||
fetchFactoryList: function(){ |
|||
if(app.globalData.userInfo){ |
|||
var recommendedString = storage.get('recommended' + app.globalData.userInfo.userId) |
|||
if(!util.isEmpty(recommendedString)){ |
|||
this.setData({ factoryList: JSON.parse(recommendedString) }) |
|||
return |
|||
} |
|||
} |
|||
getAllFactoryList().then(result => { |
|||
result.data.sort((a, b)=> b.isRecommended - a.isRecommended) |
|||
this.setData({ factoryList: result.data.slice(0, 8) }) |
|||
}) |
|||
}, |
|||
toFactoryList: function(){ |
|||
wx.navigateTo({ url: '/pages/article/factory/index' }) |
|||
}, |
|||
toFactory: function(e){ |
|||
var item = this.data.factoryList[e.currentTarget.dataset.index] |
|||
util.navigateTo('/pages/agent/factory/index?tabIndex=1&id=' + item.paperMillId) |
|||
}, |
|||
toPaperList: function(){ |
|||
wx.navigateTo({ url: '/pages/moment/paper/index' }) |
|||
}, |
|||
//*************************************************momentList************************************************//
|
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
momentList: [], |
|||
factoryList: [], |
|||
['form.pageNum']: 1, |
|||
finished: false |
|||
}) |
|||
this.fetchFactoryList() |
|||
this.fetchMomentList() |
|||
}, |
|||
fetchMomentList: function(){ |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.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), |
|||
finished, |
|||
requesting: false |
|||
}) |
|||
} else { |
|||
this.setData({ finished: true, requesting: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false }) |
|||
}) |
|||
}, |
|||
//*************************************************noticeList************************************************//
|
|||
fetchNoticeList: function(){ |
|||
if (this.data.loopRequesting) { |
|||
return |
|||
} |
|||
this.data.loopRequesting = true |
|||
getIndexInfoId().then(result => { |
|||
this.data.loopRequesting = false |
|||
this.data.noticeList = result.data |
|||
if(result.data && result.data.length){ |
|||
this.data.noticeIndex = 0 |
|||
this.data.loopIndex = 0 |
|||
this.setData({ content: result.data[0].title}) |
|||
} |
|||
}).catch(err => { |
|||
this.data.loopRequesting = false |
|||
}) |
|||
}, |
|||
onLoop: function(){ |
|||
if(!this.data.noticeList.length){ |
|||
this.data.loopIndex++ |
|||
if(this.data.loopIndex >= 600){ |
|||
this.fetchNoticeList() |
|||
} |
|||
return |
|||
} |
|||
this.data.noticeIndex++ |
|||
if(this.data.noticeIndex >= this.data.noticeList.length){ |
|||
this.data.loopIndex++ |
|||
this.data.noticeIndex = 0 |
|||
} |
|||
if(this.data.loopIndex >= 60){ |
|||
this.fetchNoticeList() |
|||
} |
|||
this.setData({ content: this.data.noticeList[this.data.noticeIndex].title }) |
|||
}, |
|||
onClick: function(){ |
|||
wx.navigateTo({ url: '/pages/html/notice/index?id=' + this.data.noticeList[this.data.noticeIndex].id }) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,18 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"wux-skeleton": "/components/skeleton/index", |
|||
"wux-skeleton-avatar": "/components/skeleton-avatar/index", |
|||
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index", |
|||
"wux-row": "/components/row/index", |
|||
"wux-col": "/components/col/index", |
|||
"wux-grids": "/components/grids/index", |
|||
"wux-grid": "/components/grid/index", |
|||
"wux-divider": "/components/divider/index", |
|||
"wux-image": "/components/image/index", |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-tag": "/components/tag/index", |
|||
"article-item": "/pages/article/article-item/index" |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
<!-- <scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="fetchMomentList"> --> |
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> |
|||
<!----------------------------------------------------帖子列表----------------------------------------------------------------> |
|||
<wux-skeleton active wx:if="{{!momentList.length}}"> |
|||
<view class="cu-card dynamic no-card" wx:for="{{5}}" wx:key="index"> |
|||
<view class="cu-item shadow" style="padding-left:30rpx"> |
|||
<view class="cu-list menu-avatar"> |
|||
<view class="cu-item" style="justify-content: flex-start;"> |
|||
<wux-skeleton-avatar shape="circle" size="large" /> |
|||
<view class="content flex-sub"> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case2-class" /> |
|||
<view class="bg-white" style="height:8rpx"></view> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case-class" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<wux-skeleton-paragraph rounded rows="3" wux-class="case3-class" /> |
|||
</view> |
|||
</view> |
|||
</wux-skeleton> |
|||
<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"></view> |
|||
<article-item item="{{item}}"></article-item> |
|||
</view> |
|||
</view> |
|||
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> |
|||
<!-- </scroll-view> --> |
|||
@ -1,98 +0,0 @@ |
|||
/* pages/main/index.wxss */ |
|||
.container { |
|||
display: flex; |
|||
flex-direction: column; |
|||
box-sizing: border-box; |
|||
-webkit-text-size-adjust: none; |
|||
-webkit-user-select: none; |
|||
font-size: 35rpx; |
|||
color: #333; |
|||
background-color: white; |
|||
font-family: Helvetica, Arial, "Helvetica Neue", "Droid Sans", "Microsoft YaHei", sans-serif; |
|||
} |
|||
|
|||
.canvas { |
|||
width: 100%; |
|||
height: 200px; |
|||
} |
|||
|
|||
.swiper-image { |
|||
height: 150px; |
|||
border-radius: 6px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.item-host { |
|||
width: 200rpx; |
|||
padding-right: 20rpx |
|||
} |
|||
|
|||
.case-class { |
|||
width: 320rpx; |
|||
} |
|||
|
|||
.case2-class { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
.case3-class { |
|||
width: 600rpx; |
|||
} |
|||
|
|||
.host-class { |
|||
width: 120rpx; |
|||
margin-top: 4rpx; |
|||
} |
|||
|
|||
.image-load { |
|||
width: 50px; |
|||
height: 50px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
border-radius: 50rpx; |
|||
} |
|||
|
|||
|
|||
.booking-tool { |
|||
width: calc(100% - 20px); |
|||
background-color: #008AFF; |
|||
position: fixed; |
|||
left: 255rpx; |
|||
z-index: 39; |
|||
} |
|||
|
|||
.roder-add { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 240rpx; |
|||
height: 80rpx; |
|||
background-color: #008AFF; |
|||
border-radius: 50rpx; |
|||
position: absolute; |
|||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); |
|||
} |
|||
|
|||
.cu-tags { |
|||
border-radius: 24rpx; |
|||
/* border-bottom-right-radius: 24rpx; */ |
|||
background-color: #dd514c; |
|||
position: absolute; |
|||
top: -20rpx; |
|||
left: 180rpx; |
|||
font-size: 20rpx; |
|||
padding: 10rpx 16rpx; |
|||
color: var(--white); |
|||
} |
|||
|
|||
.f-tag { |
|||
justify-content: center; |
|||
padding: 0rpx; |
|||
width: 150rpx; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
const util = require('../../../utils/util') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.safeFragmentHeight - 90, |
|||
safeBottom: app.globalData.safeBottom, |
|||
firstShow: false, |
|||
tabList: [ '热门', '纸品价格', '车辆排队', '纸厂扣点' ], |
|||
tabIndex: 0 |
|||
}, |
|||
onLoad:function(){ |
|||
this.onRestart() |
|||
}, |
|||
onRestart: function () { |
|||
var fragment = this.selectComponent('#fragment' + this.data.tabIndex) |
|||
if (fragment) { |
|||
fragment.onRestart() |
|||
} |
|||
if (!this.data.firstShow) { |
|||
this.setData({ height: app.globalData.safeFragmentHeight - 90, tabList: this.data.tabList, safeBottom: app.globalData.safeBottom}) |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onTabChange: function({detail}){ |
|||
if(this.data.tabIndex == Number(detail.index)){ |
|||
return |
|||
} |
|||
this.setData({ tabIndex: Number(detail.index) }) |
|||
this.onRestart() |
|||
}, |
|||
stopTouchMove: function(e){ |
|||
return false |
|||
}, |
|||
postMoment: function(){ |
|||
util.navigateTo('/pages/article/publish/index') |
|||
} |
|||
}) |
|||
@ -1,9 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-tabi": "/components/tabi/index", |
|||
"hot": "/pages/article/hot-index/index", |
|||
"price": "/pages/article/price-index/index", |
|||
"queue": "/pages/article/queue-index/index", |
|||
"point": "/pages/article/point-index/index" |
|||
} |
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
<!--pages/main/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content" style="color:black;font-size:36rpx">全部资讯</view> |
|||
</cu-custom> |
|||
|
|||
<view class="bg-white" style="height:90rpx;border-bottom:2rpx solid #eee"> |
|||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi> |
|||
</view> |
|||
|
|||
<swiper current="{{tabIndex}}" duration="0" style="height:{{height}}rpx"> |
|||
<swiper-item catchtouchmove="stopTouchMove"><hot id=fragment0"/></swiper-item> |
|||
<swiper-item catchtouchmove="stopTouchMove"><price id=fragment1"/></swiper-item> |
|||
<swiper-item catchtouchmove="stopTouchMove"><queue id=fragment2"/></swiper-item> |
|||
<swiper-item catchtouchmove="stopTouchMove"><point id=fragment3"/></swiper-item> |
|||
</swiper> |
|||
|
|||
<view class="booking-tool" style="bottom:{{200 + safeBottom}}rpx" bindtap="postMoment"> |
|||
<view class="roder-add flex flex-center"> |
|||
<text class="cuIcon-add text-white" style="font-size:32px"></text> |
|||
</view> |
|||
</view> |
|||
@ -1,22 +0,0 @@ |
|||
/* pages/main/index.wxss */ |
|||
.booking-tool { |
|||
width: calc(100% - 20px); |
|||
background-color: #008AFF; |
|||
position: fixed; |
|||
left: 25px; |
|||
} |
|||
|
|||
.roder-add { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
background-color: #008AFF; |
|||
border-radius: 50rpx; |
|||
position: absolute; |
|||
top: 24px; |
|||
right: 24px; |
|||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); |
|||
} |
|||
|
|||
@ -1,99 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getPreferList } from "../../../api/moment" |
|||
const event = require('../../../utils/event.js') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.safeFragmentHeight - 90, |
|||
userInfo: null, |
|||
momentList: [], |
|||
requesting: false, |
|||
finished: false, |
|||
form: { |
|||
categoryId: 3, |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.setData({ height: app.globalData.safeFragmentHeight - 90, userInfo: app.globalData.userInfo }) |
|||
} |
|||
if (this.data.momentList.length <= 0) { |
|||
this.onRefreshList() |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 573) { |
|||
// 帖子发布刷新
|
|||
this.onRefreshList() |
|||
} else if(message.what == 200 || message.what == 888){ |
|||
// Vip的变化
|
|||
this.setData({ userInfo: app.globalData.userInfo }) |
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
//*************************************************momentList************************************************//
|
|||
onRefreshList: function () { |
|||
if(!app.globalData.userInfo || !app.globalData.userInfo.isVIP){ |
|||
this.setData({ requesting: false }) |
|||
return |
|||
} |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ momentList: [], ['form.pageNum']: 1, finished: false }) |
|||
this.fetchMomentList() |
|||
}, |
|||
fetchMomentList: function(){ |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.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), |
|||
finished, |
|||
requesting: false |
|||
}) |
|||
} else { |
|||
this.setData({ requesting: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false }) |
|||
}) |
|||
}, |
|||
toVip: function(){ |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/ztbvip/index' }) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,16 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"wux-skeleton": "/components/skeleton/index", |
|||
"wux-skeleton-avatar": "/components/skeleton-avatar/index", |
|||
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index", |
|||
"wux-row": "/components/row/index", |
|||
"wux-col": "/components/col/index", |
|||
"wux-divider": "/components/divider/index", |
|||
"wux-image": "/components/image/index", |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-tag": "/components/tag/index", |
|||
"article-item": "/pages/article/article-item/index" |
|||
} |
|||
} |
|||
@ -1,50 +0,0 @@ |
|||
<!--pages/main/index.wxml--> |
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> |
|||
<view wx:if="{{userInfo && userInfo.isVIP}}"> |
|||
<wux-skeleton active wx:if="{{!momentList.length}}"> |
|||
<view class="cu-card dynamic no-card" wx:for="{{4}}" wx:key="index"> |
|||
<view class="cu-item shadow" style="padding-left:30rpx"> |
|||
<view class="cu-list menu-avatar"> |
|||
<view class="cu-item" style="justify-content: flex-start;"> |
|||
<wux-skeleton-avatar shape="circle" size="large" /> |
|||
<view class="content flex-sub"> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case2-class" /> |
|||
<view class="bg-white" style="height:8rpx"></view> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case-class" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<wux-skeleton-paragraph rounded rows="3" wux-class="case3-class" /> |
|||
</view> |
|||
</view> |
|||
</wux-skeleton> |
|||
<view wx:else> |
|||
<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"> |
|||
<!-- <wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> --> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<article-item item="{{item}}"></article-item> |
|||
</view> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bg-white list-empty" style="height: {{height}}rpx;" wx:else> |
|||
<view class="flex" style="margin-bottom:48rpx"> |
|||
<text class="cuIcon-info text-blue" style="font-size:42rpx;"></text> |
|||
<view style="width:540rpx;margin-left: 12rpx"> |
|||
<view class="text-bold" style="font-size:32rpx;margin-bottom: 12rpx">需要开通会员才能查看纸厂扣点信息</view> |
|||
<text class="text-gray">限时优惠开通会员,获取更多货源、尊享会员权益,买卖更赚钱</text> |
|||
</view> |
|||
</view> |
|||
<wux-button type="positive" size="join" bind:click="toVip">立即开通</wux-button> |
|||
</view> |
|||
</refresh-view> |
|||
@ -1,98 +0,0 @@ |
|||
/* pages/main/index.wxss */ |
|||
.container { |
|||
display: flex; |
|||
flex-direction: column; |
|||
box-sizing: border-box; |
|||
-webkit-text-size-adjust: none; |
|||
-webkit-user-select: none; |
|||
font-size: 35rpx; |
|||
color: #333; |
|||
background-color: white; |
|||
font-family: Helvetica, Arial, "Helvetica Neue", "Droid Sans", "Microsoft YaHei", sans-serif; |
|||
} |
|||
|
|||
.canvas { |
|||
width: 100%; |
|||
height: 200px; |
|||
} |
|||
|
|||
.swiper-image { |
|||
height: 150px; |
|||
border-radius: 6px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.item-host { |
|||
width: 200rpx; |
|||
padding-right: 20rpx |
|||
} |
|||
|
|||
.case-class { |
|||
width: 320rpx; |
|||
} |
|||
|
|||
.case2-class { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
.case3-class { |
|||
width: 600rpx; |
|||
} |
|||
|
|||
.host-class { |
|||
width: 120rpx; |
|||
margin-top: 4rpx; |
|||
} |
|||
|
|||
.image-load { |
|||
width: 50px; |
|||
height: 50px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
border-radius: 50rpx; |
|||
} |
|||
|
|||
|
|||
.booking-tool { |
|||
width: calc(100% - 20px); |
|||
background-color: #008AFF; |
|||
position: fixed; |
|||
left: 255rpx; |
|||
z-index: 39; |
|||
} |
|||
|
|||
.roder-add { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 240rpx; |
|||
height: 80rpx; |
|||
background-color: #008AFF; |
|||
border-radius: 50rpx; |
|||
position: absolute; |
|||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); |
|||
} |
|||
|
|||
.cu-tags { |
|||
border-radius: 24rpx; |
|||
/* border-bottom-right-radius: 24rpx; */ |
|||
background-color: #dd514c; |
|||
position: absolute; |
|||
top: -20rpx; |
|||
left: 180rpx; |
|||
font-size: 20rpx; |
|||
padding: 10rpx 16rpx; |
|||
color: var(--white); |
|||
} |
|||
|
|||
.f-tag { |
|||
justify-content: center; |
|||
padding: 0rpx; |
|||
width: 150rpx; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,113 +1,66 @@ |
|||
// pages/moment/price/index.js
|
|||
import { getFactoryPrice } from "../../../api/ztb" |
|||
const event = require('../../../utils/event') |
|||
const storage = require('../../../utils/storage') |
|||
const app = getApp() |
|||
|
|||
// pages/article/price-detail/index.js
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
kg: app.globalData.kg, |
|||
loading: false, |
|||
requesting: false, |
|||
finished: false, |
|||
top: 0, |
|||
orderList: [], |
|||
form: { pageNum: 1, |
|||
pageSize:15 } |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
var ids = storage.get('ztb-paper-price') |
|||
if(ids){ |
|||
this.data.form.paperMillIdList = ids |
|||
this.onRefreshList() |
|||
} |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
onEvent: function (message) { |
|||
if(message.what == 508){ |
|||
this.data.form.paperMillIdList = message.obj |
|||
storage.put('ztb-paper-price', message.obj) |
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
// 下拉刷新...
|
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
orderList: [], |
|||
['form.pageNum']: 1, |
|||
loading: true, |
|||
kg: app.globalData.kg, |
|||
height: app.globalData.fragmentHeight, |
|||
finished: false |
|||
}) |
|||
this.fetchPapersList() |
|||
}, |
|||
// 获取特价列表
|
|||
fetchPapersList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getFactoryPrice(this.data.form).then(result => { |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = result.data.current |
|||
var finished = result.data.current >= result.data.pages |
|||
if(this.data.form.pageNum == 1){ |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
top: 0, |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
} else { |
|||
this.setData({ |
|||
finished: true, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ |
|||
requesting: false, |
|||
finished: true, |
|||
loading: false |
|||
}) |
|||
}) |
|||
}, |
|||
selectMill: function(){ |
|||
wx.navigateTo({ url: '/pages/article/factory/index?type=4&ids=' + this.data.form.paperMillIdList}) |
|||
}, |
|||
onUnload: function(){ |
|||
event.remove('EventMessage', this) |
|||
} |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -1,7 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-divider": "/components/divider/index", |
|||
"wux-button": "/components/button/index" |
|||
} |
|||
} |
|||
@ -1,58 +1,2 @@ |
|||
<!--pages/moment/price/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">纸厂价格</view> |
|||
</cu-custom> |
|||
|
|||
<scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="fetchPapersList"> |
|||
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> |
|||
<view wx:if="{{loading}}"> |
|||
<view class="load-spinner text-gray" style="margin-bottom:24px" /> |
|||
<view class="text-empty">正在加载</view> |
|||
</view> |
|||
<view class="flex flex-center" style="height:90rpx;line-height:90rpx" bindtap="selectMill" wx:else> |
|||
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text> |
|||
<text class="text-blue text-sg" style="margin-left:8rpx">添加纸厂</text> |
|||
</view> |
|||
</view> |
|||
<view wx:else> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<view wx:for="{{pageItem}}" wx:key="index"> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<view class="flex flex-center item-content flex-column"> |
|||
<view class="text-lg">{{item.name}}</view> |
|||
<view class="text-sm text-gray">(单位:{{kg? '元/KG' : '元/吨'}})</view> |
|||
</view> |
|||
<view class="bg-white" style="padding:0rpx 30rpx 10rpx 30rpx"> |
|||
<view class="flex flex-justify" style="padding-bottom:10rpx"> |
|||
<text class="text-df text-gray" style="flex:3">品类信息</text> |
|||
<text class="text-df text-gray" style="flex:2;text-align: center">昨日价格</text> |
|||
<text class="text-df text-gray" style="flex:2;text-align: center">今日价格</text> |
|||
<text class="text-df text-gray" style="flex:1.5;text-align: center">涨跌</text> |
|||
</view> |
|||
<view class="flex flex-justify cateItem" wx:for-item="cateItem" wx:for-index="ck" wx:for="{{item.paperCategoryList}}" wx:key="ck"> |
|||
<text class="text-sg text-black text-cut" style="flex:3">{{cateItem.categoryName}}</text> |
|||
<text class="text-sg text-black" style="flex:2;text-align: center">{{formate.formatePrice(cateItem.yesterdayUnitPrice, kg)}}</text> |
|||
<text class="text-sg text-black" style="flex:2;text-align: center">{{formate.formatePrice(cateItem.unitPrice, kg)}}</text> |
|||
<view class="flex flex-center" style="flex:1.5" wx:if="{{cateItem.floatingPrice > 0}}"> |
|||
<text class="cuIcon-refresharrow text-red transform" style="font-size:28rpx;padding-top:2rpx;"></text> |
|||
<text class="text-red">{{formate.formatePrice(cateItem.floatingPrice, kg)}}</text> |
|||
</view> |
|||
<view class="flex flex-center" style="flex:1.5" wx:elif="{{cateItem.floatingPrice < 0}}"> |
|||
<text class="cuIcon-refresharrow text-green" style="font-size:28rpx;padding-top:2rpx;"></text> |
|||
<text class="text-green">{{formate.formatePrice(-cateItem.floatingPrice, kg)}}</text> |
|||
</view> |
|||
<view class="flex flex-center" style="flex:1.5" wx:else> |
|||
<text class="text-xl text-gray">-</text> |
|||
<text class="text-xl text-gray" style="margin-left:4rpx">-</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bg-white flex flex-center" style="height:90rpx;line-height:90rpx;border-top:2rpx solid #eee" bindtap="selectMill"> |
|||
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text> |
|||
<text class="text-blue text-sg" style="margin-left:8rpx">添加纸厂</text> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
<!--pages/article/price-detail/index.wxml--> |
|||
<text>pages/article/price-detail/index.wxml</text> |
|||
@ -1,16 +0,0 @@ |
|||
/* pages/moment/price/index.wxss */ |
|||
.item-content { |
|||
background: rgba(255, 255, 255, 1); |
|||
padding: 30rpx; |
|||
} |
|||
|
|||
.cateItem{ |
|||
border-top: 2rpx solid #f3f3f3; |
|||
padding-top: 8rpx; |
|||
padding-bottom: 8rpx; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,86 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getPreferList } from "../../../api/moment" |
|||
const event = require('../../../utils/event.js') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.safeFragmentHeight - 90, |
|||
firstShow: false, |
|||
momentList: [], |
|||
requesting: false, |
|||
finished: false, |
|||
form: { |
|||
categoryId: 1, |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.setData({ height: app.globalData.safeFragmentHeight - 90, kg: app.globalData.kg }) |
|||
this.onRefreshList() |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 571) { |
|||
// 帖子发布刷新
|
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
//*************************************************momentList************************************************//
|
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
momentList: [], |
|||
['form.pageNum']: 1, |
|||
finished: false |
|||
}) |
|||
this.fetchMomentList() |
|||
}, |
|||
fetchMomentList: function(){ |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.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), |
|||
finished, |
|||
requesting: false |
|||
}) |
|||
} else { |
|||
this.setData({ finished: true, requesting: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false }) |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,18 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"wux-skeleton": "/components/skeleton/index", |
|||
"wux-skeleton-avatar": "/components/skeleton-avatar/index", |
|||
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index", |
|||
"wux-row": "/components/row/index", |
|||
"wux-col": "/components/col/index", |
|||
"wux-grids": "/components/grids/index", |
|||
"wux-grid": "/components/grid/index", |
|||
"wux-divider": "/components/divider/index", |
|||
"wux-image": "/components/image/index", |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-tag": "/components/tag/index", |
|||
"article-item": "/pages/article/article-item/index" |
|||
} |
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
<!--pages/main/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<!-- <scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="fetchMomentList"> --> |
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> |
|||
<!----------------------------------------------------帖子列表----------------------------------------------------------------> |
|||
<wux-skeleton active wx:if="{{!momentList.length}}"> |
|||
<view class="cu-card dynamic no-card" wx:for="{{6}}" wx:key="index"> |
|||
<view class="cu-item shadow" style="padding-left:30rpx"> |
|||
<view class="cu-list menu-avatar"> |
|||
<view class="cu-item" style="justify-content: flex-start;"> |
|||
<wux-skeleton-avatar shape="circle" size="large" /> |
|||
<view class="content flex-sub"> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case2-class" /> |
|||
<view class="bg-white" style="height:8rpx"></view> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case-class" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<wux-skeleton-paragraph rounded rows="3" wux-class="case3-class" /> |
|||
</view> |
|||
</view> |
|||
</wux-skeleton> |
|||
<view wx:else> |
|||
<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"> |
|||
<!-- <wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> --> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<article-item item="{{item}}"></article-item> |
|||
</view> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> |
|||
<!-- </scroll-view> --> |
|||
@ -1,82 +0,0 @@ |
|||
/* pages/main/index.wxss */ |
|||
.item-cate { |
|||
flex: 5; |
|||
padding: 10rpx 30rpx; |
|||
border-radius: 10rpx; |
|||
border: 2rpx solid #d9d9d9 |
|||
} |
|||
|
|||
.item-host { |
|||
width: 200rpx; |
|||
padding-right: 20rpx |
|||
} |
|||
|
|||
.case-class { |
|||
width: 320rpx; |
|||
} |
|||
|
|||
.case2-class { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
.case3-class { |
|||
width: 600rpx; |
|||
} |
|||
|
|||
.host-class { |
|||
width: 120rpx; |
|||
margin-top: 4rpx; |
|||
} |
|||
|
|||
.image-load { |
|||
width: 50px; |
|||
height: 50px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
border-radius: 50rpx; |
|||
} |
|||
|
|||
|
|||
.booking-tool { |
|||
width: calc(100% - 20px); |
|||
background-color: #008AFF; |
|||
position: fixed; |
|||
left: 255rpx; |
|||
z-index: 39; |
|||
} |
|||
|
|||
.roder-add { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 240rpx; |
|||
height: 80rpx; |
|||
background-color: #008AFF; |
|||
border-radius: 50rpx; |
|||
position: absolute; |
|||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); |
|||
} |
|||
|
|||
.cu-tags { |
|||
border-radius: 24rpx; |
|||
/* border-bottom-right-radius: 24rpx; */ |
|||
background-color: #dd514c; |
|||
position: absolute; |
|||
top: -20rpx; |
|||
left: 180rpx; |
|||
font-size: 20rpx; |
|||
padding: 10rpx 16rpx; |
|||
color: var(--white); |
|||
} |
|||
|
|||
.f-tag { |
|||
justify-content: center; |
|||
padding: 0rpx; |
|||
width: 150rpx; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,82 +0,0 @@ |
|||
// pages/moment/price/index.js
|
|||
import { getFactoryTodayList } from "../../../api/ztb" |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
orderList: [], |
|||
form: { pageNum: 1, |
|||
pageSize:30 } |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.onRefreshList() |
|||
}, |
|||
// 下拉刷新...
|
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
orderList: [], |
|||
['form.pageNum']: 1, |
|||
loading: true, |
|||
height: app.globalData.fragmentHeight, |
|||
finished: false |
|||
}) |
|||
this.fetchPapersList() |
|||
}, |
|||
// 获取特价列表
|
|||
fetchPapersList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getFactoryTodayList(this.data.form).then(result => { |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = result.data.current |
|||
var finished = result.data.current >= result.data.pages |
|||
if(this.data.form.pageNum == 1){ |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
top: 0, |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
} else { |
|||
this.setData({ finished: true, requesting: false, loading: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false, finished: true, loading: false }) |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-divider": "/components/divider/index" |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
<!--pages/moment/price/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">车辆排队情况</view> |
|||
</cu-custom> |
|||
|
|||
<scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="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> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
<view class="bg-white" wx:else> |
|||
<view class="flex flex-justify" style="padding:20rpx 30rpx"> |
|||
<text class="text-df text-gray" style="flex:1.8">纸厂名称</text> |
|||
<text class="text-df text-gray" style="flex:1;text-align: center">昨日车辆</text> |
|||
<text class="text-df text-gray" style="flex:1;text-align: center">今日车辆</text> |
|||
</view> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<view class="flex flex-justify" wx:for="{{pageItem}}" wx:key="index" style="padding:20rpx 30rpx;border-top:2rpx solid #f3f3f3"> |
|||
<text class="text-df text-balck" style="flex:1.8">{{item.paperMillName}}</text> |
|||
<text class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}辆{{retainedString(item.yesterdayRetainedQuantity)}}</text> |
|||
<text class="text-df text-balck" style="flex:1;text-align: center">{{item.totalQuantity || 0}}辆{{retainedString(item.retainedQuantity)}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<wxs module="retainedString"> |
|||
// 状态。0:生产中,1:已发货,2:已完成 |
|||
function retainedString(quatity) { |
|||
if(quatity > 0){ |
|||
return '压' + quatity + '辆' |
|||
} |
|||
return '' |
|||
} |
|||
module.exports = retainedString |
|||
</wxs> |
|||
@ -1,11 +0,0 @@ |
|||
/* pages/moment/price/index.wxss */ |
|||
.item-content { |
|||
background: rgba(255, 255, 255, 1); |
|||
padding: 30rpx; |
|||
} |
|||
|
|||
.cateItem{ |
|||
border-top: 2rpx solid #f3f3f3; |
|||
padding-top: 8rpx; |
|||
padding-bottom: 8rpx; |
|||
} |
|||
@ -1,80 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getPreferList } from "../../../api/moment" |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
dev: app.globalData.dev, |
|||
firstShow: false, |
|||
height: app.globalData.safeFragmentHeight - 90, |
|||
momentList: [], |
|||
requesting: false, |
|||
finished: false, |
|||
form: { categoryId: 2, pageNum: 1, |
|||
pageSize:15 } |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.setData({ dev: app.globalData.dev, height: app.globalData.safeFragmentHeight - 90 }) |
|||
this.onRefreshList() |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 572) { |
|||
// 帖子发布刷新
|
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
//*************************************************momentList************************************************//
|
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ momentList: [], ['form.pageNum']: 1, finished: false }) |
|||
this.fetchMomentList() |
|||
}, |
|||
fetchMomentList: function(){ |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.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), |
|||
finished, |
|||
requesting: false |
|||
}) |
|||
} else { |
|||
this.setData({ finished: true, requesting: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false }) |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,16 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"wux-skeleton": "/components/skeleton/index", |
|||
"wux-skeleton-avatar": "/components/skeleton-avatar/index", |
|||
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index", |
|||
"wux-row": "/components/row/index", |
|||
"wux-col": "/components/col/index", |
|||
"wux-divider": "/components/divider/index", |
|||
"wux-image": "/components/image/index", |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-tag": "/components/tag/index", |
|||
"article-item": "/pages/article/article-item/index" |
|||
} |
|||
} |
|||
@ -1,41 +0,0 @@ |
|||
<!--pages/main/index.wxml--> |
|||
<!-- <scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="fetchMomentList"> --> |
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> |
|||
<!----------------------------------------------------帖子列表----------------------------------------------------------------> |
|||
<wux-skeleton active wx:if="{{!momentList.length}}"> |
|||
<view class="cu-card dynamic no-card" wx:for="{{5}}" wx:key="index"> |
|||
<view class="cu-item shadow" style="padding-left:30rpx"> |
|||
<view class="cu-list menu-avatar"> |
|||
<view class="cu-item" style="justify-content: flex-start;"> |
|||
<wux-skeleton-avatar shape="circle" size="large" /> |
|||
<view class="content flex-sub"> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case2-class" /> |
|||
<view class="bg-white" style="height:8rpx"></view> |
|||
<wux-skeleton-paragraph rounded rows="1" wux-class="case-class" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<wux-skeleton-paragraph rounded rows="3" wux-class="case3-class" /> |
|||
</view> |
|||
</view> |
|||
</wux-skeleton> |
|||
<view wx:else> |
|||
<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"> |
|||
<!-- <wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> --> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<article-item item="{{item}}"></article-item> |
|||
</view> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> |
|||
<!-- </scroll-view> --> |
|||
@ -1,45 +0,0 @@ |
|||
/* pages/main/index.wxss */ |
|||
|
|||
.canvas { |
|||
width: 100%; |
|||
height: 200px; |
|||
} |
|||
|
|||
.item-host { |
|||
width: 200rpx; |
|||
padding-right: 20rpx |
|||
} |
|||
|
|||
.case-class { |
|||
width: 320rpx; |
|||
} |
|||
|
|||
.case2-class { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
.case3-class { |
|||
width: 600rpx; |
|||
} |
|||
|
|||
.host-class { |
|||
width: 120rpx; |
|||
margin-top: 4rpx; |
|||
} |
|||
|
|||
.image-load { |
|||
width: 50px; |
|||
height: 50px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
border-radius: 50rpx; |
|||
} |
|||
|
|||
.queue{ |
|||
text-align: center; |
|||
width:160px; |
|||
border:2rpx solid #CCCCCC; |
|||
padding:10rpx 0rpx; |
|||
border-radius:36px |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save