Browse Source

no message

featrue/v4.3
xpz2018 5 years ago
parent
commit
f66f7371c0
21 changed files with 711 additions and 498 deletions
  1. 87
      colorui/main.wxss
  2. 96
      pages/agent/ability/index.js
  3. 14
      pages/agent/ability/index.json
  4. 32
      pages/agent/ability/index.wxml
  5. 63
      pages/agent/ability/index.wxss
  6. 151
      pages/agent/factory-fragment/index.js
  7. 14
      pages/agent/factory-fragment/index.json
  8. 32
      pages/agent/factory-fragment/index.wxml
  9. 1
      pages/agent/factory-fragment/index.wxss
  10. 141
      pages/agent/focus-fragment/index.js
  11. 15
      pages/agent/focus-fragment/index.json
  12. 41
      pages/agent/focus-fragment/index.wxml
  13. 60
      pages/agent/focus-fragment/index.wxss
  14. 233
      pages/agent/index/index.js
  15. 12
      pages/agent/index/index.json
  16. 138
      pages/agent/index/index.wxml
  17. 6
      pages/article/newInfo/index.js
  18. 6
      pages/article/newInfo/index.wxml
  19. 64
      pages/home/attentionPaperList/index.js
  20. 1
      pages/index/index.js
  21. 2
      pages/message/index/index.js

87
colorui/main.wxss

@ -1065,93 +1065,6 @@ button.icon.lg {
border-bottom: 4rpx solid;
}
/* ==================
时间轴
==================== */
.cu-timeline {
display: block;
background-color: var(--white);
}
.cu-timeline .cu-time {
width: 120rpx;
text-align: center;
padding: 20rpx 0;
font-size: 26rpx;
color: #888;
display: block;
}
.cu-timeline>.cu-item {
padding: 24rpx 30rpx 30rpx 90rpx;
position: relative;
display: block;
z-index: 0;
}
.cu-timeline>.cu-item:not([class*="text-"]) {
color: #ccc;
}
.cu-timeline>.cu-item::after {
content: "";
display: block;
position: absolute;
width: 1rpx;
background-color: #ddd;
left: 60rpx;
height: 100%;
top: 0;
z-index: 8;
}
.cu-timeline>.cu-item::before {
font-family: "cuIcon";
display: block;
position: absolute;
top: 36rpx;
z-index: 9;
background-color: var(--white);
width: 50rpx;
height: 50rpx;
text-align: center;
border: none;
line-height: 50rpx;
left: 36rpx;
}
.cu-timeline>.cu-item:not([class*="cuIcon-"])::before {
content: "\e763";
}
.cu-timeline>.cu-item[class*="cuIcon-"]::before {
background-color: var(--white);
width: 50rpx;
height: 50rpx;
text-align: center;
border: none;
line-height: 50rpx;
left: 36rpx;
}
.cu-timeline>.cu-item>.content {
padding: 30rpx;
border-radius: 6rpx;
display: block;
line-height: 1.6;
}
.cu-timeline>.cu-item>.content:not([class*="bg-"]) {
/* background-color: var(--ghostWhite); */
color: var(--black);
}
.cu-timeline>.cu-item>.content+.content {
margin-top: 20rpx;
}
/* ==================
模态窗口
==================== */

96
pages/agent/ability/index.js

@ -0,0 +1,96 @@
// pages/agent/index/index.js
import { getFactoryPrice } from "../../api/ztb"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight,
kg: app.globalData.kg,
loading: true,
requesting: false,
finished: false,
scrolled: false,
top: 0,
orderList: [],
form: {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 0
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight })
this.fetchPapersList()
},
// 下拉刷新...
onRefreshList: function () {
this.setData({
orderList: [],
['form.pageNum']: 1,
loading: true,
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,
pageNum: 1
})
}
}).catch(err => {
//异常回调
this.setData({
requesting: false,
finished: true,
loading: false,
})
})
}
})

14
pages/agent/ability/index.json

@ -0,0 +1,14 @@
{
"usingComponents": {
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-button": "/components/button/index",
"refresh-view": "/components/refresher/index",
"wux-tabi": "/components/tabi/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index",
"agent-item": "/pages/agent/agent-item/index",
"wux-dialog": "/components/dialog/index"
}
}

32
pages/agent/ability/index.wxml

@ -0,0 +1,32 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">代卖活动</view>
</cu-custom>
<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>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</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>
<agent-item item="{{item}}"></agent-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>
<wux-dialog id="wux-dialog" />

63
pages/agent/ability/index.wxss

@ -0,0 +1,63 @@
/* pages/agent/index/index.wxss */
.bj{
height: 1300rpx;
background-color: white;
}
.bgImgView {
width: 100%;
height: 548rpx;
padding: 160rpx 186rpx 94rpx 186rpx;
background-color: white;
}
.imgsj {
height: 294rpx;
width: 378rpx;
}
.midText {
width: 100%;
height: 67rpx;
padding: 0rpx 279rpx 0rpx 279rpx;
}
.midText2 {
font-size: 48rpx;
color: #000000;
letter-spacing: 0;
text-align: left;
}
.midText3 {
width: 100%;
height: 45px;
padding: 0rpx 199rpx 0rpx 199rpx;
margin-top: 12rpx;
}
.midText4 {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.75);
letter-spacing: 0;
text-align: left;
}
.bg-blue{
color: #FFFFFF;
background-color: #008AFF;
}
.offer-btn {
width: 480rpx;
height: 88rpx;
background: linear-gradient(312deg, rgba(38, 125, 214, 1) 0%, rgba(0, 138, 255, 1) 100%);
box-shadow: 0px 10px 13px -8px rgba(35, 126, 217, 0.53);
border-radius: 10rpx;
color: white;
font-size: 32rpx;
margin-left: 32rpx;
}
.bottomBtn{
width: 100%;
height: 88rpx;
padding:0rpx 135rpx 0rpx 135rpx;
}

151
pages/agent/factory-fragment/index.js

@ -0,0 +1,151 @@
// pages/agent/index/index.js
import { getFactoryPrice, getFactoryCity } from "../../api/ztb"
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight - 90,
CustomBar: app.globalData.CustomBar,
kg: app.globalData.kg,
loading: true,
requesting: false,
finished: false,
tabList: [],
tabIndex: 0,
cateList: [],
scrolled: false,
top: 0,
orderList: [],
form: {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 0
}
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
this.setData({ height: app.globalData.fragmentHeight - 90, kg: app.globalData.kg })
this.fetchRegionList()
this.fetchPapersList()
}
},
methods: {
onEvent: function (message) {
if (message.what == 1100 || message.what == 1101) {
this.data.form = {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 1
}
this.setData({ bidType: 2 })
this.data.orderList = []
this.fetchPapersList()
}
},
onRestart: function(){
},
fetchRegionList: function () {
getFactoryCity().then(result => {
//成功回调
this.data.cateList = [{
cityId: '',
cityName: '全部'
}].concat(result.data)
for (let index = 0; index < this.data.cateList.length; index++) {
this.data.tabList.push(this.data.cateList[index].cityName)
}
this.setData({
tabList: this.data.tabList,
scrolled: this.data.cateList.length >= 5
})
})
},
onTabChange: function ({ detail }) {
if (this.data.tabIndex == Number(detail.index)) {
return
}
this.data.tabIndex = Number(detail.index)
this.data.form.cityId = this.data.cateList[this.data.tabIndex].cityId
this.onRefreshList()
},
// 下拉刷新...
onRefreshList: function () {
this.setData({
orderList: [],
tabIndex: this.data.tabIndex,
['form.pageNum']: 1,
loading: true,
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,
pageNum: 1
})
}
}).catch(err => {
//异常回调
this.setData({
requesting: false,
finished: true,
loading: false,
})
})
},
goattentionIndex: function () {
wx.navigateTo({ url: '/pages/home/attentionPaperList/index' })
}
}
})

14
pages/agent/factory-fragment/index.json

@ -0,0 +1,14 @@
{
"component": true,
"usingComponents": {
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-button": "/components/button/index",
"refresh-view": "/components/refresher/index",
"wux-tabi": "/components/tabi/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index",
"agent-item": "/pages/agent/agent-item/index"
}
}

32
pages/agent/factory-fragment/index.wxml

@ -0,0 +1,32 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<view class="nav bg-white fixed" style="top:{{CustomBar}}px;height:90rpx;" wx:if="{{tabList.length}}">
<wux-tabi scroll="{{scrolled}}" tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi>
</view>
<view class="bg-white" style="height:90rpx;width:100%" wx:if="{{tabList.length}}"></view>
<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>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</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>
<agent-item item="{{item}}"></agent-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>

1
pages/agent/factory-fragment/index.wxss

@ -0,0 +1 @@
/* pages/agent/index/index.wxss */

141
pages/agent/focus-fragment/index.js

@ -0,0 +1,141 @@
// pages/agent/index/index.js
import { getFactoryPrice, getBaseInfo, updateUserInfo } from "../../api/ztb"
const event = require('../../../utils/event')
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight - 90,
CustomBar: app.globalData.CustomBar,
kg: app.globalData.kg,
loading: true,
requesting: false,
finished: false,
tabList: [],
tabIndex: 0,
cateList: [],
scrolled: false,
top: 0,
orderList: [],
form: {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 1
}
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
this.setData({ height: app.globalData.fragmentHeight, kg: app.globalData.kg })
this.fetchPapersList()
event.on('factoryDetails', this, this.onEvent)
event.on('attentionPaperList', this, this.onEvent)
},
detached: function () {
event.remove('factoryDetails', this)
event.remove('attentionPaperList', this)
}
},
methods: {
onEvent: function (message) {
if (message.what == 1100 || message.what == 1101) {
this.onRefreshList()
}
},
onRestart: function () {
getBaseInfo().then(result => {
if (result.data.isSetProxyTag == false) {
updateUserInfo({ isSetProxyTag: true }).then(result => {})
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
this.wuxDialog.open({
resetOnClose: true,
title: '温馨提示',
content: '是否选择关注您常卖的纸厂?',
buttons: [{
text: '取消'
}, {
text: '确定',
type: 'primary',
onTap(e) {
wx.navigateTo({
url: '/pages/home/attentionPaperList/index'
})
}
}]
})
}
})
},
// 下拉刷新...
onRefreshList: function () {
this.setData({
orderList: [],
['form.pageNum']: 1,
loading: true,
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,
pageNum: 1
})
}
}).catch(err => {
//异常回调
this.setData({ requesting: false, finished: true, loading: false })
})
},
goattentionIndex: function () {
wx.navigateTo({ url: '/pages/home/attentionPaperList/index' })
}
}
})

15
pages/agent/focus-fragment/index.json

@ -0,0 +1,15 @@
{
"component": true,
"usingComponents": {
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-button": "/components/button/index",
"refresh-view": "/components/refresher/index",
"wux-tabi": "/components/tabi/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index",
"agent-item": "/pages/agent/agent-item/index",
"wux-dialog": "/components/dialog/index"
}
}

41
pages/agent/focus-fragment/index.wxml

@ -0,0 +1,41 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<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 && loading}}">
<view class="load-spinner text-gray" style="margin-bottom:24px" />
<view class="text-empty">正在加载</view>
</view>
<view class="bg-white" style="height:{{height}}rpx" wx:elif="{{!orderList.length}}">
<view class="bgImgView">
<image class="imgsj" src="/assets/image/noattention.png" />
</view>
<view class="midText">
<text class="midText2">暂无关注</text>
</view>
<view class="midText3">
<text class="midText4">可前往纸厂列表添加关注</text>
</view>
<view class="bottomBtn">
<wux-button block type="positive" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="goattentionIndex">添加关注</wux-button>
</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>
<agent-item item="{{item}}"></agent-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>
<wux-dialog id="wux-dialog" />

60
pages/agent/focus-fragment/index.wxss

@ -0,0 +1,60 @@
/* pages/agent/index/index.wxss */
.bgImgView {
width: 100%;
height: 548rpx;
padding: 160rpx 186rpx 94rpx 186rpx;
background-color: white;
}
.imgsj {
height: 294rpx;
width: 378rpx;
}
.midText {
width: 100%;
height: 67rpx;
padding: 0rpx 279rpx 0rpx 279rpx;
}
.midText2 {
font-size: 48rpx;
color: #000000;
letter-spacing: 0;
text-align: left;
}
.midText3 {
width: 100%;
height: 45px;
padding: 0rpx 199rpx 0rpx 199rpx;
margin-top: 12rpx;
}
.midText4 {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.75);
letter-spacing: 0;
text-align: left;
}
.bg-blue{
color: #FFFFFF;
background-color: #008AFF;
}
.offer-btn {
width: 480rpx;
height: 88rpx;
background: linear-gradient(312deg, rgba(38, 125, 214, 1) 0%, rgba(0, 138, 255, 1) 100%);
box-shadow: 0px 10px 13px -8px rgba(35, 126, 217, 0.53);
border-radius: 10rpx;
color: white;
font-size: 32rpx;
margin-left: 32rpx;
}
.bottomBtn{
width: 100%;
height: 88rpx;
padding:0rpx 135rpx 0rpx 135rpx;
}

233
pages/agent/index/index.js

@ -1,11 +1,4 @@
// pages/agent/index/index.js
import {
getFactoryPrice,
getFactoryCity,
getBaseInfo,
updateUserInfo
} from "../../api/ztb"
const event = require('../../../utils/event')
const app = getApp()
Page({
@ -15,231 +8,43 @@ Page({
data: {
height: app.globalData.fragmentHeight - 90,
CustomBar: app.globalData.CustomBar,
kg: app.globalData.kg,
loading: true,
requesting: false,
finished: false,
tabList: [],
tabIndex: 0,
cateList: [],
scrolled: false,
top: 0,
orderList: [],
form: {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 0
},
bidType: 1,
bidTypeHight: 210,
isSetProxyTag: false, //是否已经选择过代卖标签
TabList: [
{ index: 0, value: 'focus', name: '关注' },
{ index: 1, value: 'factory', name: '全部' }
],
pageIndex: 1,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
height: app.globalData.fragmentHeight - 90,
height: app.globalData.fragmentHeight,
kg: app.globalData.kg,
CustomBar: app.globalData.CustomBar
StatusBar: app.globalData.StatusBar || 40,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
})
this.fetchRegionList()
this.fetchPapersList()
event.on('factoryDetails', this, this.onEvent)
event.on('attentionPaperList', this, this.onEvent)
},
onEvent: function (message) {
if (message.what == 1100 || message.what == 1101) {
this.data.form = {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
listType: 1
}
this.setData({
bidType: 2
})
this.data.orderList = []
this.fetchPapersList()
}
backspace() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// this.fetchPapersList()
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
getBaseInfo().then(result => {
this.setData({
isSetProxyTag: result.data.isSetProxyTag
})
if (this.data.isSetProxyTag == false) {
this.updateUserInfoFct({
isSetProxyTag: true
})
this.wuxDialog.open({
resetOnClose: true,
title: '温馨提示',
content: '是否选择关注您常卖的纸厂?',
buttons: [{
text: '取消'
}, {
text: '确定',
type: 'primary',
onTap(e) {
wx.navigateTo({
url: '/pages/home/attentionPaperList/index'
})
}
}]
})
}
})
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value)
if (pageView) {
pageView.onRestart()
}
},
updateUserInfoFct: function (model) {
updateUserInfo(model).then(result => {})
},
fetchRegionList: function () {
getFactoryCity().then(result => {
//成功回调
this.data.cateList = [{
cityId: '',
cityName: '全部'
}].concat(result.data)
for (let index = 0; index < this.data.cateList.length; index++) {
this.data.tabList.push(this.data.cateList[index].cityName)
}
this.setData({
tabList: this.data.tabList,
scrolled: this.data.cateList.length >= 5
})
})
stopTouchMove: function (e) {
return false
},
onTabChangeTop: function (e) {
if (this.data.bidType == Number(e.currentTarget.dataset.index)) {
return
}
var tabIndex = Number(e.currentTarget.dataset.index)
this.data.firstCategoryId = ''
this.setData({
pageIndex: 0,
['bidType']: tabIndex
})
if (this.data.bidType == 1) {
this.setData({
bidTypeHight: 210,
'form.listType': 0,
'form.cityId': '',
'form.enableSalesAgent': 1,
'form.pageNum': 1,
})
} else {
this.setData({
bidTypeHight: 50,
'form.listType': 1,
'form.cityId': '',
'form.enableSalesAgent': 1,
'form.pageNum': 1,
})
}
this.onRefreshList()
},
onTabChange: function ({
detail
}) {
if (this.data.tabIndex == Number(detail.index)) {
if (this.data.pageIndex == Number(e.currentTarget.dataset.index)) {
return
}
this.data.tabIndex = Number(detail.index)
this.data.form.cityId = this.data.cateList[this.data.tabIndex].cityId
this.onRefreshList()
},
// 下拉刷新...
onRefreshList: function () {
this.setData({
orderList: [],
tabIndex: this.data.tabIndex,
['form.pageNum']: 1,
loading: true,
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,
pageNum: 1
})
}
}).catch(err => {
//异常回调
this.setData({
requesting: false,
finished: true,
loading: false,
})
})
},
goattentionIndex: function () {
wx.navigateTo({
url: '/pages/home/attentionPaperList/index'
})
},
onUnload: function () {
event.remove('attentionPaperList', this)
event.remove('factoryDetails', this)
this.setData({ pageIndex: Number(e.currentTarget.dataset.index) })
this.onShow()
}
})

12
pages/agent/index/index.json

@ -1,14 +1,6 @@
{
"usingComponents": {
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-button": "/components/button/index",
"refresh-view": "/components/refresher/index",
"wux-tabi": "/components/tabi/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index",
"agent-item": "/pages/agent/agent-item/index",
"wux-dialog": "/components/dialog/index"
"focus": "/pages/agent/focus-fragment/index",
"factory": "/pages/agent/factory-fragment/index"
}
}

138
pages/agent/index/index.wxml

@ -1,124 +1,28 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">纸厂代卖</view>
</cu-custom>
<view class="nav bg-white fixed" style="top:{{CustomBar}}px;height:{{bidTypeHight}}rpx;" wx:if="{{tabList.length}}">
<view class="flex bg-white" style="height:80rpx;padding:6rpx 6rpx 0rpx 6rpx;border-bottom: 2rpx solid #eee">
<view data-index="2" class="flex flex-center flex-column" style="flex:1;" bindtap="onTabChangeTop">
<view class="text-bold" style="font-size:24rpx;color:{{bidType == 2 ? '#008AFF' : '#333'}}">关注</view>
</view>
<view data-index="1" class="flex flex-center flex-column" style="flex:1;" bindtap="onTabChangeTop">
<view class="text-bold" style="font-size:24rpx;color:{{bidType == 1 ? '#008AFF' : '#333'}}">全部</view>
<view class="cu-custom bg-white" style="height:{{CustomBar}}px;z-index: 99;">
<view class="cu-bar fixed {{bgColor}}"
style="height:{{CustomBar}}px;padding-top:{{StatusBar}}rpx;{{shadow?'box-shadow: none': ''}};{{shadow?'border-bottom: none': ''}}">
<view class="action" bindtap="backspace">
<text class="weui_goback"></text>
</view>
<view class="flex" style="top:{{StatusBar}}rpx;color:black;font-size:36rpx;width:340rpx;height:80rpx">
<view data-index="0" class="flex flex-center flex-column" style="flex:1;" catchtap="onTabChangeTop">
<view class="text-sg text-bold" style="color:{{pageIndex == 0 ? '#008AFF' : '#333'}}">关注</view>
</view>
<view data-index="1" class="flex flex-center flex-column" style="flex:1;" catchtap="onTabChangeTop">
<view class="text-sg text-bold" style="color:{{pageIndex == 1 ? '#008AFF' : '#333'}}">全部</view>
</view>
</view>
</view>
<wux-tabi wx:if="{{bidType == 1}}" scroll="{{scrolled}}" tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi>
</view>
<view class="bg-white" style="height:{{bidTypeHight}}rpx;width:100%"></view>
<refresh-view wx:if="{{bidType == 1}}" 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>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</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>
<!-- <wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> -->
<agent-item item="{{item}}"></agent-item>
<!-- <view class="flex flex-justify item-content" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<wux-image width="{{50}}" height="{{50}}" shape="rounded" lazyLoad="true" src="{{item.logoImg}}" mode="aspectFill">
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image>
<image class="image-load" slot="error" src="/assets/image/def_image.png"></image>
<image class="image-load" slot="empty" src="/assets/image/def_image.png"></image>
</wux-image>
<view style="margin-left:24rpx;flex:1">
<view class="flex flex-justify">
<view class="text-lg text-cut" style="max-width:320rpx">{{item.name}}</view>
<view class="flex flex-center" data-page="{{pageIndex}}" data-index="{{index}}" catchtap="unflodItem" wx:if="{{item.paperCategoryList.length > 3}}">
<text class="text-blue text-df">{{item.fold ? '点击收起' : '查看全部' }}({{item.paperCategoryList.length}})</text>
<text class="cuIcon-{{item.fold ? 'fold' : 'unfold'}} text-blue" style="font-size:16px;margin-left:4rpx;padding-top:8rpx"></text>
</view>
</view>
<view class="text-sm" style="margin-top:8rpx">{{item.locProvinceName + item.locCityName + item.locDistrictName}}</view>
</view>
</view> -->
<!-- <view class="bg-white" style="padding:0rpx 32rpx 10rpx 32rpx">
<view class="flex" wx:for-item="cateItem" wx:for-index="ck" wx:for="{{item.paperCategoryList}}" wx:key="ck"
wx:if="{{item.fold || ck < 3}}" style="margin-bottom: 20rpx">
<view class="flex flex-justify item-cate {{item.cateIndex == ck ? 'cate-tag' : ''}}" data-page="{{pageIndex}}" data-index="{{index}}" data-ck="{{ck}}" catchtap="checkTag">
<text class="text-sg">{{cateItem.categoryName}}</text>
<view class="flex flex-center">
<text class="text-sg">{{formate.formatePrice(cateItem.unitPrice)}}元/吨</text>
<view class="flex flex-center" style="margin-left:40rpx" 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)}}</text>
</view>
<view class="flex flex-center" style="margin-left:40rpx" 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)}}</text>
</view>
<view class="flex flex-center" style="margin-left:40rpx" 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 style="padding: 2rpx 10% 0rpx 10%;" wx:if="{{item.paperCategoryList.length > 0}}">
<wux-button block type="positive" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-button>
</view>
</view> -->
</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>
<refresh-view wx:if="{{bidType == 2}}" bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
<view class="bj" wx:if="{{!orderList.length}}">
<view class="bgImgView">
<image class="imgsj" src="/assets/image/noattention.png" />
</view>
<view class="midText">
<text class="midText2">暂无关注</text>
</view>
<view class="midText3">
<text class="midText4">可前往纸厂列表添加关注</text>
</view>
<view class="bottomBtn">
<wux-button block type="positive" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="goattentionIndex">添加关注</wux-button>
</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>
<agent-item item="{{item}}"></agent-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>
<wux-dialog id="wux-dialog" />
<swiper current="{{pageIndex}}" duration="0" style="height:{{height}}rpx">
<swiper-item catchtouchmove="stopTouchMove">
<focus id="{{TabList[0].value}}" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<factory id="{{TabList[1].value}}" />
</swiper-item>
</swiper>

6
pages/article/newInfo/index.js

@ -27,16 +27,14 @@ Component({
priceSort:1
},
factoryList:[],
scorllHeight:app.globalData.fragmentHeight
scorllHeight:app.globalData.safeFragmentHeight
},
methods: {
onRestart: function () {
console.log(app.globalData.fragmentHeight)
this.setData({
StatusBar: app.globalData.StatusBar || 40,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
scorllHeight:app.globalData.fragmentHeight
scorllHeight:app.globalData.safeFragmentHeight - 100
})
this.data.querFrom.queryWay=0
this.getPaperMillOfInformationListFct(this.data.querFrom)

6
pages/article/newInfo/index.wxml

@ -9,7 +9,7 @@
<view class="topRightText" style="margin-top:15rpx" id="toAllFactory" bindtap="toPage">全部纸厂></view>
</view>
</view>
<view style="height:15rpx;width:100%"></view>
<!-- <view style="height:15rpx;width:100%"></view> -->
<view style="width:100%;height:70rpx;background-color:#F4F4F4;" class="topTitle">
<view class="topLeft">
<picker mode="date" value="{{curDate}}" start="2015-09-01" end="2099-09-01" bindchange="curDateChange">
@ -31,8 +31,8 @@
</view>
</view>
</view>
<view style="width:100%;height:15rpx;"></view>
<scroll-view scroll-y="true" style='max-height:{{scorllHeight-266}}rpx;width:100%;background-color:white'>
<scroll-view scroll-y="true" style='max-height:{{scorllHeight-70}}rpx;width:100%;background-color:white'>
<view style="width:100%;height:15rpx;"></view>
<view class="zt">
<view class="flex flex-justify" style="width:100%;height:80rpx;lineheight:80rpx;font-size: 28px;color: rgba(0,0,0,0.65);letter-spacing: 0;padding: 0rpx 40rpx 0rpx 40rpx;">
<view class="text-df text-gray" style="flex:1.2;overflow: hidden;">纸厂名称</view>

64
pages/home/attentionPaperList/index.js

@ -1,10 +1,6 @@
// pages/home/tab4/index.js
import {
getFactoryPrice,
userPushFollowMill
} from '../../api/ztb'
import { getFactoryPrice, userPushFollowMill } from '../../api/ztb'
const event = require('../../../utils/event.js')
const storage = require('../../../utils/storage')
const app = getApp()
Page({
@ -41,57 +37,7 @@ Page({
},
toMyInfo: function () {
event.emit('attentionPaperList', { what: 1100, desc: 'attentionPaperList' })
wx.navigateBack({
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
wx.navigateBack({})
},
backspace: function () {
// console.log('点击返回被触发4')
@ -109,11 +55,7 @@ Page({
})
},
checkboxChange: function (e) {
console.log(e)
this.setData({
'form.paperMillIds':e.detail.value,
'form.follow':true
})
this.setData({ 'form.paperMillIds':e.detail.value, 'form.follow':true })
},
bindtap: function (e) {
console.log(e)

1
pages/index/index.js

@ -177,7 +177,6 @@ Page({
}
getBaseInfo().then(result => {
app.globalData.userInfo = result.data
console.log(app.globalData.userInfo)
wx.hideLoading()
this.defaultIndex()
}).catch(err => {

2
pages/message/index/index.js

@ -166,7 +166,7 @@ Page({
},
readAllMessage: function(){
wx.showLoading({ title: '加载中', mask: true })
readMessage().then(result => {
readMessage({ idList: [] }).then(result => {
this.setData({ ['tabList[0].badge']: 0, ['tabList[1].badge']: 0 })
wx.hideLoading()
}).catch(err => {

Loading…
Cancel
Save