diff --git a/api/moment.js b/api/moment.js
new file mode 100644
index 0000000..fe0c312
--- /dev/null
+++ b/api/moment.js
@@ -0,0 +1,56 @@
+/**
+ * Copyright © 2020-present LiuDanYang. All rights Reserved.
+ */
+import { mGet, mPost } from "./request"
+const app = getApp()
+const urls = ['https://api-client-ztb-dev.qniao.cn', 'https://api-client-ztb-test.qniao.cn', 'https://api-client-ztb.qniao.cn']
+
+const mconfig = {
+ baseUrl: urls[app.evn]
+}
+// *******************************************************************账户业务***********************************************************
+// /article/save/Article 发文章
+const postMoment = (params) => mPost(`/information-center/article/save/Article`, params, mconfig)
+// /article/update/Article/{id} 编辑文章
+const updateMoment = (id, params) => mPost(`/information-center/article/update/Article/${id}`, params, mconfig)
+// /article/get/Article-list/文章列表
+const getPreferList = (params) => mGet(`/information-center/article/get/Article-list/`, params, mconfig)
+// /article/get/Article-view-list 浏览文章历史列表
+const getViewedList = (params) => mGet(`/information-center/article/get/Article-view-list`, params, mconfig)
+// /article/delete/Article删除文章
+const deleteMoment = (params) => mPost(`/information-center/article/delete/Article`, params, mconfig)
+// /article/get/my-Article-list 我的文章列表
+const getMyList = (params) => mGet(`/information-center/article/get/my-Article-list`, params, mconfig)
+// /article/get/Article-detail/{id} 文章详情
+const getMomentDetail = (id) => mGet(`/information-center/article/get/Article-detail/${id}`, null, mconfig)
+// /article-reply/get/my-reply-list 我的评论列表
+const getReplyList = (params) => mGet(`/information-center/article-reply/get/my-reply-list`, params, mconfig)
+// /article-reply/get/reply-list/in/{articleId} 帖子评论列表
+const getCommentList = (id, params) => mGet(`/information-center/article-reply/get/reply-list/in/${id}`, params, mconfig)
+// /article-reply/like-or-cancel/article 点赞文章
+const likeMoment = (params) => mPost(`/information-center/article-reply/like-or-cancel/article`, params, mconfig)
+// /article-reply/like-or-cancel/reply 点赞评论
+const likeComment = (params) => mPost(`/information-center/article-reply/like-or-cancel/reply`, params, mconfig)
+// /article-reply/reply 评论
+const commentMoment = (params) => mPost(`/information-center/article-reply/reply`, params, mconfig)
+const getCategoryPrice = (params) => mGet(`/information-center/getPaperCategoryPrice/new`, params, mconfig)
+const getCategoryList = (params) => mGet(`/information-center/paper-index-category`, params, mconfig)
+
+
+export {
+ mconfig,
+ getPreferList,
+ postMoment,
+ updateMoment,
+ getViewedList,
+ deleteMoment,
+ getMyList,
+ getMomentDetail,
+ getReplyList,
+ getCommentList,
+ likeMoment,
+ likeComment,
+ commentMoment,
+ getCategoryPrice,
+ getCategoryList
+}
\ No newline at end of file
diff --git a/api/saas.js b/api/saas.js
index c054e62..fd7dd99 100644
--- a/api/saas.js
+++ b/api/saas.js
@@ -50,7 +50,7 @@ const readMessage = (params) => mPost(`/message-center/message/read`, params, sc
const getChanelList = (params) => mGet(`/ztb-factory/factorydeliverychannel/get/self-factory-delivery-channel-list`, params, sconfig)
const saveChanel = (params) => mPost(`/ztb-factory/factorydeliverychannel/save/factory-delivery-channel`, params, sconfig)
const getCardList = (params) => mGet(`/ztb-factory/get/self-factory/card-list`, params, sconfig)
-const getAllFactoryList = () => mGet(`/recycle-service/get/all-paper-mill`, null, sconfig)
+
const getPoundList = () => mGet(`/ztb-factory/get/self-factory-weight-note-list`, null, sconfig)
const getPoundInfo = (id) => mGet(`/ztb-factory/get/weight-note-detail/${id}`, null, sconfig)
const repeatPound = (params) => mPost(`/ztb-factory/renew/second-weight`, params, sconfig)
@@ -95,7 +95,6 @@ export {
bindCustomer,
registeCustomer,
getPaperList,
- getAllFactoryList,
repeatOrder,
getStatisticsInfo,
getCustomerOrderList,
diff --git a/api/user.js b/api/user.js
index 5327115..8e6cf97 100644
--- a/api/user.js
+++ b/api/user.js
@@ -5,6 +5,7 @@ import { mGet, mPost } from "./request"
import { sconfig } from "./saas"
import { pconfig } from "./payment"
import { zconfig } from "./ztb"
+import { mconfig } from "./moment"
const util = require('../utils/util')
const storage = require('../utils/storage')
const app = getApp()
@@ -179,15 +180,32 @@ function phoneWechat(form) {
return promise
}
+function initToken(token){
+ sconfig.header = { 'Authorization': 'QNT ' + token }
+ pconfig.header = { 'Authorization': 'QNT ' + token }
+ zconfig.header = { 'Authorization': 'QNT ' + token }
+ mconfig.header = { 'Authorization': 'QNT ' + token }
+}
+
+function headerFactoryId(factoryId){
+ sconfig.header.X_FactoryId = factoryId
+ pconfig.header.X_FactoryId = factoryId
+ zconfig.header.X_FactoryId = factoryId
+ mconfig.header.X_FactoryId = factoryId
+}
+
function finalizeToken(){
config.header = null
sconfig.header = null
pconfig.header = null
zconfig.header = null
+ mconfig.header = null
}
export {
config,
+ initToken,
+ headerFactoryId,
finalizeToken,
wechatApplet,
updateUserInfo,
diff --git a/app.js b/app.js
index 93a202a..11324b5 100644
--- a/app.js
+++ b/app.js
@@ -1,8 +1,8 @@
//app.js
App({
- evn: 0, // 0: 开发版本;1:测试版本;2:生产版本
+ evn: 2, // 0: 开发版本;1:测试版本;2:生产版本
tmplIds: [''],
- version: 162,
+ version: '1.4.1',
xAppId: '503258978847953926',
userInfo: null,
//----------------------------------------------globalData--------------------------------------
diff --git a/app.json b/app.json
index cbcd171..95ba4df 100644
--- a/app.json
+++ b/app.json
@@ -2,6 +2,7 @@
"pages":[
"pages/login/index",
"pages/index/index",
+ "pages/home/user-info/index",
"pages/home/employee/index",
"pages/home/employee-info/index",
"pages/home/customer-list/index",
@@ -26,9 +27,10 @@
"pages/storage/order-list/index",
"pages/storage/order-info/index",
"pages/storage/order-settlement/index",
- "pages/agent/factory-list/index",
+ "pages/agent/agent-list/index",
"pages/agent/factory-detail/index",
"pages/agent/order-list/index",
+ "pages/agent/focus-list/index",
"pages/agent/order-detail/index",
"pages/agent/appointment/index",
"pages/settlement/index/index",
diff --git a/assets/image/icon-none.png b/assets/image/icon-none.png
new file mode 100644
index 0000000..cf61c71
Binary files /dev/null and b/assets/image/icon-none.png differ
diff --git a/colorui/main.wxss b/colorui/main.wxss
index 772d5e0..4958536 100644
--- a/colorui/main.wxss
+++ b/colorui/main.wxss
@@ -1285,6 +1285,7 @@ swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active {
font-size: 44rpx;
}
+
.text-sl {
font-size: 80rpx;
}
@@ -1398,6 +1399,7 @@ swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active {
}
.list-empty {
+ margin-top: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
diff --git a/components/refresh-view/index.wxml b/components/refresh-view/index.wxml
index a5229fb..9068d74 100644
--- a/components/refresh-view/index.wxml
+++ b/components/refresh-view/index.wxml
@@ -11,10 +11,8 @@
-
-
+
+
diff --git a/components/refresh-view/index.wxss b/components/refresh-view/index.wxss
index 9994fad..21617e0 100644
--- a/components/refresh-view/index.wxss
+++ b/components/refresh-view/index.wxss
@@ -14,7 +14,7 @@
width: 100%;
height: 100%;
position: absolute;
- z-index: 10;
+ z-index: 8;
}
.circle-progress-bar {
diff --git a/components/search/index.wxml b/components/search/index.wxml
index 2446613..bc04664 100644
--- a/components/search/index.wxml
+++ b/components/search/index.wxml
@@ -1,7 +1,7 @@
+ style="background: {{ background }};z-index:12">
{{ label }}
diff --git a/components/stickys/index.js b/components/stickys/index.js
new file mode 100644
index 0000000..25fcdac
--- /dev/null
+++ b/components/stickys/index.js
@@ -0,0 +1,101 @@
+//吸顶容器组件
+Component({
+ externalClasses: ['tui-sticky-class'], //自定义样式
+ options: {
+ multipleSlots: true
+ },
+ properties: {
+ scrollTop: {
+ type: Number,
+ observer(val) {
+ this.updateStickyChange();
+ }
+ },
+ //吸顶容器距离顶部距离 px
+ stickyTop: {
+ type: Number,
+ value: 0
+
+ },
+ //吸顶容器 高度 rpx
+ stickyHeight: {
+ type: String,
+ value: "auto"
+ },
+ //占位容器背景颜色
+ bgColor: {
+ type: String,
+ value: "none"
+ },
+ //列表中的索引值
+ index: {
+ type: Number,
+ value: 0
+ }
+ },
+ data: {
+ timer: null,
+ top: 0,
+ height: 0,
+ isFixed: false
+ },
+ lifetimes: {
+ ready: function() {
+ //在组件在视图层布局完成后执行
+ this.updateScrollChange()
+ },
+ moved: function() {
+ //在组件实例被移动到节点树另一个位置时执行
+ this.updateScrollChange()
+
+ },
+ detached: function() {
+ //在组件实例被从页面节点树移除时执行
+ this.updateScrollChange()
+ }
+ },
+ methods: {
+ updateStickyChange() {
+ const data = this.data;
+ const top = data.top;
+ const height = data.height;
+ const scrollTop = this.data.scrollTop
+ let stickyTop = this.data.stickyTop
+ stickyTop = stickyTop < 0 ? 0 : stickyTop
+
+ this.setData({
+ isFixed: (scrollTop + stickyTop >= top) ? true : false
+ }, () => {
+ // console.log(this.data.isFixed)
+ this.triggerEvent('fixed', { fixed: this.data.isFixed })
+ })
+ },
+ updateScrollChange() {
+ if (this.data.timer) {
+ clearTimeout(this.data.timer)
+ this.setData({
+ timer: null
+ })
+ }
+ this.data.timer = setTimeout(() => {
+ const className = '.tui-sticky-class';
+ const query = wx.createSelectorQuery().in(this);
+ query.select(className).boundingClientRect((res) => {
+ if (res) {
+ this.setData({
+ top: res.top + (this.data.scrollTop || 0),
+ height: res.height
+ })
+ this.triggerEvent('change', {
+ index: Number(this.data.index),
+ top: res.top + (this.data.scrollTop || 0)
+ })
+ }
+ }).exec()
+ }, 0)
+ this.setData({
+ timer: this.data.timer
+ })
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/stickys/index.json b/components/stickys/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/stickys/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/stickys/index.wxml b/components/stickys/index.wxml
new file mode 100644
index 0000000..73e0346
--- /dev/null
+++ b/components/stickys/index.wxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/stickys/index.wxss b/components/stickys/index.wxss
new file mode 100644
index 0000000..b74c7b4
--- /dev/null
+++ b/components/stickys/index.wxss
@@ -0,0 +1,5 @@
+.tui-sticky-fixed {
+ width: 100%;
+ position: fixed;
+ z-index: 99999;
+ }
\ No newline at end of file
diff --git a/components/tab/index.wxml b/components/tab/index.wxml
index f5e99f2..0428200 100644
--- a/components/tab/index.wxml
+++ b/components/tab/index.wxml
@@ -1,8 +1,6 @@
-
+
-
+
\ No newline at end of file
diff --git a/components/tabi/index.js b/components/tabi/index.js
new file mode 100644
index 0000000..599077e
--- /dev/null
+++ b/components/tabi/index.js
@@ -0,0 +1,112 @@
+Component({
+ properties: {
+ // 数据源
+ tabData: {
+ type: Array,
+ value: [],
+ observer: "dataChange"
+ },
+ // 是否可以超出滚动
+ tabIndex: {
+ type: Number,
+ value: 0,
+ observer: "tabIndexChange"
+ },
+ // 是否可以超出滚动
+ scroll: {
+ type: Boolean,
+ value: false
+ },
+ // view宽度
+ padding: {
+ type: Number,
+ value: 0,
+ },
+ // tab高度
+ size: {
+ type: Number,
+ value: 90,
+ observer: "sizeChange"
+ },
+ // 颜色
+ color: {
+ type: String,
+ value: ""
+ }
+ },
+ data: {
+ /* 未渲染数据 */
+ tabItems: [], // 所有 tab 节点信息
+ /* 渲染数据 */
+ scrolling: true, // 控制 scroll-view 滚动以在异步加载数据的时候能正确获得 dom 信息
+ needTransition: false, // 下划线是否需要过渡动画
+ translateX: 0, // 下划 line 的左边距离
+ lineWidth: 0, // 下划 line 宽度
+ scrollLeft: 0, // scroll-view 左边滚动距离
+ },
+ methods: {
+ /**
+ * 切换菜单
+ */
+ toggleTab(e) {
+ this.triggerEvent('change', {index: e.currentTarget.dataset.index});
+ this.scrollByIndex(e.currentTarget.dataset.index);
+ },
+ /**
+ * 滑动到指定位置
+ * @param tabIndex: 当前激活的tabItem的索引
+ * @param needTransition: 下划线是否需要过渡动画, 第一次进来应设置为false
+ */
+ scrollByIndex(tabIndex, needTransition = true) {
+ let item = this.data.tabItems[tabIndex];
+ if (!item) return;
+ let itemWidth = item.width || 0,
+ itemLeft = item.left || 0;
+
+ this.setData({needTransition: needTransition})
+ if(this.data.padding){
+ itemLeft -= this.data.padding
+ }
+ if (this.data.scroll) { // 超出滚动的情况
+ // 保持滚动后当前 item '尽可能' 在屏幕中间
+ let scrollLeft = itemLeft - (this.data.windowWidth - itemWidth) / 2;
+ this.setData({ tabIndex: tabIndex, scrollLeft: scrollLeft, translateX: itemLeft, lineWidth: itemWidth })
+ } else { // 不超出滚动的情况
+ this.setData({ tabIndex: tabIndex, translateX: itemLeft, lineWidth: itemWidth })
+ }
+ },
+ /**
+ * 监听数据变化, 如果改变重新初始化参数
+ */
+ dataChange(newVal, oldVal) {
+ this.setData({ scrolling: false })
+ // 异步加载数据时候, 延迟执行 init 方法, 防止基础库 2.7.1 版本及以下无法正确获取 dom 信息
+ setTimeout(() => this.init(), 10)
+ },
+ /**
+ * 监听 tabIndex 变化, 做对应处理
+ */
+ tabIndexChange(newVal, oldVal) {
+ this.scrollByIndex(newVal)
+ },
+ /**
+ * 监听 tab 高度变化, 最小值为80rpx
+ */
+ sizeChange(newVal, oldVal) {
+ if (newVal <= 60) {
+ this.setData({size: 60})
+ }
+ },
+ /**
+ * 初始化函数
+ */
+ init() {
+ const {windowWidth} = wx.getSystemInfoSync()
+ this.setData({windowWidth: windowWidth || 375})
+ this.createSelectorQuery().selectAll(".tabs__item-child").boundingClientRect((res) => {
+ this.setData({ scrolling: true, tabItems: res })
+ this.scrollByIndex(this.data.tabIndex, false)
+ }).exec()
+ }
+ }
+})
diff --git a/components/tabi/index.json b/components/tabi/index.json
new file mode 100644
index 0000000..6a1b9ce
--- /dev/null
+++ b/components/tabi/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/components/tabi/index.wxml b/components/tabi/index.wxml
new file mode 100644
index 0000000..eeb9d7b
--- /dev/null
+++ b/components/tabi/index.wxml
@@ -0,0 +1,10 @@
+
+
+
+
+ {{item}}
+
+
+
+
+
\ No newline at end of file
diff --git a/components/tabi/index.wxss b/components/tabi/index.wxss
new file mode 100644
index 0000000..34599f7
--- /dev/null
+++ b/components/tabi/index.wxss
@@ -0,0 +1,56 @@
+.scroll-view {
+ width: 100%;
+ height: 90rpx;
+ overflow: hidden;
+}
+.tabs-wrap {
+ padding-bottom: 20rpx;
+}
+.tabs {
+ position: relative;
+ height: 90rpx;
+ color: #999999;
+ display: flex;
+}
+.tabs--scroll {
+ white-space: nowrap !important;
+ display: block !important;
+}
+.tabs--scroll .tabs__item {
+ flex: initial !important;
+ text-align: initial !important;
+ display: inline-block !important;
+ padding: 0 30rpx;
+}
+.tabs--scroll .tabs__item-child {
+ display: block !important;
+}
+.tabs__item {
+ flex: 1;
+ text-align: center;
+ height: 90rpx;
+ line-height: 90rpx;
+ padding: 0 10rpx;
+ box-sizing: border-box;
+ transition: color 0.3s ease-in-out;
+ font-size: 30rpx;
+}
+.tabs__item--cur {
+ color: #008AFF;
+ /* font-size: 30rpx; */
+}
+.tabs__item-child {
+ display: inline-block;
+}
+.tabs__line {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ background-color: #008AFF;
+ height: 4rpx;
+ width: 0rpx;
+ display: inline-block;
+}
+.tabs__line.transition {
+ transition: width 0.3s, transform 0.3s;
+}
diff --git a/components/tabs/index.wxml b/components/tabs/index.wxml
index 28f0277..492ed68 100644
--- a/components/tabs/index.wxml
+++ b/components/tabs/index.wxml
@@ -1,12 +1,11 @@
-
+
-
{
+ if (result.data.paperCategoryList && result.data.paperCategoryList.length) {
+ this.data.cateId = result.data.paperCategoryList[this.data.cateIndex].categoryId
+ }
+ this.setData({ factoryDetail: result.data, hasFollowed: result.data.hasFollowed })
+ wx.hideLoading()
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ })
+ }
+ this.setData({
+ safeBottom: app.globalData.safeBottom,
+ fragmentHeight: app.globalData.fragmentHeight - 90,
+ height: app.globalData.fragmentHeight,
+ stickyTop: app.globalData.CustomBar,
+ daytimes: util.formatDate(new Date(), 'Y-M-D')
+ // tabIndex: options.tabIndex ? parseInt(options.tabIndex) : 0
+ })
}
})
\ No newline at end of file
diff --git a/pages/agent/factory-detail/index.json b/pages/agent/factory-detail/index.json
index 19bbcd2..11cd2e7 100644
--- a/pages/agent/factory-detail/index.json
+++ b/pages/agent/factory-detail/index.json
@@ -1,5 +1,12 @@
{
"usingComponents": {
+ "van-tab": "/components/tab/index",
+ "van-tabs": "/components/tabs/index",
+ "van-sticky": "/components/sticky/index",
+ "van-tabi": "/components/tabi/index",
+ "van-image": "/components/image/index",
+ "van-button": "/components/button/index",
+ "submit-layout": "/components/submit-layout/index",
"notification": "/pages/message/notification/index"
}
}
\ No newline at end of file
diff --git a/pages/agent/factory-detail/index.wxml b/pages/agent/factory-detail/index.wxml
index 79f99dd..7739b0e 100644
--- a/pages/agent/factory-detail/index.wxml
+++ b/pages/agent/factory-detail/index.wxml
@@ -1,6 +1,55 @@
-
- 消息情况
-
+
+
+
+
+
+
+
+
+
+ {{factoryDetail.name}}
+ {{ hasFollowed ? '取消关注' : '关注'}}
+
+
+ {{factoryDetail.locProvinceName + factoryDetail.locCityName + factoryDetail.locDistrictName}}
+ |
+ 已代卖:{{formate.formateWeight(factoryDetail.cumulativeWeight)}}吨
+ |
+ 昨日排队:{{factoryDetail.yesterdayTotalQuantity}}辆
+ 昨日排队:--
+
+
+
+ 代卖费:
+ {{formate.formatePrice(factoryDetail.proxypaySurcharge)}}元/吨
+
+
+ 纸厂账期:
+ {{factoryDetail.foreignPaybackIntever}}天
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
diff --git a/pages/agent/factory-fragment/index.js b/pages/agent/factory-fragment/index.js
index 0800ac9..16cce7b 100644
--- a/pages/agent/factory-fragment/index.js
+++ b/pages/agent/factory-fragment/index.js
@@ -1,7 +1,7 @@
// pages/index/index.js
import Dialog from '../../../components/dialog/dialog'
import { getFactoryPrice, getFactoryCity, hasActivity } from "../../../api/ztb"
-import util from '../../../utils/util'
+
const app = getApp()
Component({
@@ -12,7 +12,6 @@ Component({
/** 页面的初始数据 */
data: {
height: app.globalData.fragmentHeight - 90,
- CustomBar: app.globalData.CustomBar,
loading: true,
requesting: false,
finished: false,
@@ -101,7 +100,6 @@ Component({
this.setData({ requesting: false, finished: true, loading: false, })
}
}).catch(err => {
- //异常回调
this.setData({ requesting: false, finished: true, loading: false, })
}).finally(() => {
this.refresh = this.refresh || this.selectComponent('#refresh')
diff --git a/pages/agent/focus-fragment/index.js b/pages/agent/focus-fragment/index.js
index 6ba4ca3..46134b7 100644
--- a/pages/agent/focus-fragment/index.js
+++ b/pages/agent/focus-fragment/index.js
@@ -1,6 +1,6 @@
// pages/index/index.js
import Dialog from '../../../components/dialog/dialog'
-import { getStatisticsInfo } from "../../../api/saas"
+import { getFactoryPrice } from "../../../api/ztb"
import util from '../../../utils/util'
const event = require('../../../utils/event')
const app = getApp()
@@ -12,19 +12,20 @@ Component({
},
/** 页面的初始数据 */
data: {
- userInfo: app.userInfo,
- height: app.globalData.safeFragmentHeight,
- tabList: [
- { status: 1, badge: '', name: '待预约', icon: '/assets/image/icon_pricing.png' },
- { status: 2, badge: '', name: '待送货', icon: '/assets/image/icon_checking.png' },
- { status: 3, badge: '', name: '结算中', icon: '/assets/image/icon_payment.png' },
- { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' }
- ]
+ height: app.globalData.fragmentHeight,
+ loading: true,
+ requesting: false,
+ finished: false,
+ orderList: [],
+ form: {
+ enableSalesAgent: 1,
+ pageNum: 1,
+ listType: 1
+ }
},
lifetimes: {
attached: function () {
- var height = app.globalData.safeFragmentHeight - 100
- this.setData({userInfo: app.userInfo, height })
+ this.setData({ height: app.globalData.fragmentHeight })
event.on('EventMessage', this, this.onEvent)
},
detached: function () {
@@ -33,26 +34,53 @@ Component({
},
methods: {
onRestart: function () {
- // this.fetchStatisticsInfo(this.data.vdate)
+ if (!this.data.firstShow) {
+ this.fetchPapersList()
+ }
+ this.data.firstShow = true
},
onEvent: function (message) {
- if (message.what == 888) {
+ if (message.what == 110 || message.what == 111) {
+ this.onRefreshList()
+ }
+ },
+ // 下拉刷新...
+ onRefreshList: function () {
+ if (this.data.requesting) {
+ return
}
+ this.setData({ orderList: [], ['form.pageNum']: 1, loading: true, finished: false })
+ this.fetchPapersList()
},
- agentList: function (e) {
- if(app.userInfo.applicationStatus == 0){
- Dialog.alert({ title: '温馨提示', message: '您的申请还在审核中,如有疑问请联系管理员。' }).then(() => {
- })
+ // 获取特价列表
+ fetchPapersList: function () {
+ if (this.data.requesting || this.data.finished) {
return
- }
- if(e.currentTarget.dataset.status){
- wx.navigateTo({ url: '/pages/agent/order-list/index?status=' + e.currentTarget.dataset.status })
+ }
+ if (this.data.loading) {
+ this.data.requesting = true
} else {
- wx.navigateTo({ url: '/pages/agent/order-list/index' })
+ 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
+ this.setData({[nowList]: respList, total: result.data.total, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
+ } else {
+ this.setData({ requesting: false, finished: true, loading: false, })
+ }
+ }).catch(err => {
+ this.setData({ requesting: false, finished: true, loading: false, })
+ }).finally(() => {
+ this.refresh = this.refresh || this.selectComponent('#refresh')
+ this.refresh.setRefresh(false)
+ })
},
- fetchStatisticsInfo: function(vdate){
-
+ attention: function(){
+ wx.navigateTo({ url: '/pages/agent/focus-list/index' })
}
}
})
\ No newline at end of file
diff --git a/pages/agent/focus-fragment/index.json b/pages/agent/focus-fragment/index.json
index eb60529..2fb5425 100644
--- a/pages/agent/focus-fragment/index.json
+++ b/pages/agent/focus-fragment/index.json
@@ -1,12 +1,10 @@
{
"component": true,
"usingComponents": {
- "van-grid": "/components/grid/index",
- "van-grid-item": "/components/grid-item/index",
- "van-cell": "/components/cell/index",
- "van-cell-group": "/components/cell-group/index",
- "van-info": "/components/info/index",
- "van-icon": "/components/icon/index",
- "van-calendar": "/components/calendar/index"
+ "refresh-view": "/components/refresh-view/index",
+ "van-divider": "/components/divider/index",
+ "van-loading": "/components/loading/index",
+ "van-button": "/components/button/index",
+ "agent-item": "/pages/agent/agent-item/index"
}
}
\ No newline at end of file
diff --git a/pages/agent/focus-fragment/index.wxml b/pages/agent/focus-fragment/index.wxml
index 19c7566..6b41a2d 100644
--- a/pages/agent/focus-fragment/index.wxml
+++ b/pages/agent/focus-fragment/index.wxml
@@ -1,66 +1,28 @@
-
- 工作台
-
-
-
-
-
- {{userInfo.factoryName || '未注册工厂'}}
+
+
+
+
+ 正在加载
-
-
-
-
- 收货统计
-
- {{vdateString}}
-
-
-
-
-
-
-
- 收货重量
-
- {{formate.formateWeight(totalInfo.totalWeight)}}吨
- 查看收货详情
-
-
-
-
- 收货金额
-
- {{formate.formateAmount(totalInfo.totalMoney)}}
-
-
-
+
+
+ 暂无关注
+ 可前往纸厂列表添加关注
+ 添加关注
-
-
-
-
- 代卖订单
-
- 查看全部订单
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+ {{finished?'到底啦~':'加载中...'}}
+
+
\ No newline at end of file
diff --git a/pages/agent/focus-list/index.js b/pages/agent/focus-list/index.js
new file mode 100644
index 0000000..77527fc
--- /dev/null
+++ b/pages/agent/focus-list/index.js
@@ -0,0 +1,61 @@
+// pages/message/detail/index.js
+import Scene from '../../index/scene'
+import { getAllFactoryList, userPushFollowMill } from "../../../api/ztb"
+const event = require('../../../utils/event')
+const util = require('../../../utils/util')
+const storage = require('../../../utils/storage')
+const app = getApp()
+
+Scene({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ height: app.globalData.fragmentHeight,
+ safeBottom: app.globalData.safeBottom,
+ factoryList: null,
+ form:{
+ follow: true,
+ paperMillIds: []
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var attString = storage.get('AttentionList' + app.userInfo.userId)
+ if(!util.isEmpty(attString)){
+ this.setData({ safeBottom: app.globalData.safeBottom, height: app.globalData.fragmentHeight, ['form.paperMillIds']: attString.split(',') })
+ } else {
+ this.setData({ safeBottom: app.globalData.safeBottom, height: app.globalData.fragmentHeight })
+ }
+ getAllFactoryList().then(result => {
+ this.setData({ factoryList: result.data })
+ }).catch(err => {
+ })
+ },
+ onChange: function(event) {
+ this.setData({ ['form.paperMillIds']: event.detail });
+ },
+ toggle: function(event) {
+ const { index } = event.currentTarget.dataset
+ const checkbox = this.selectComponent(`.checkboxes-${index}`)
+ checkbox.toggle()
+ },
+ noop: function() {},
+ submitForm: function(){
+ if(this.data.form.paperMillIds.length == 0){
+ util.showToast('请选择关注的纸厂')
+ return
+ }
+ wx.showLoading({ title: '正在获取', mask: true })
+ userPushFollowMill(this.data.form).then(result => {
+ wx.hideLoading()
+ storage.put('AttentionList' + app.userInfo.userId, this.data.form.paperMillIds.toString())
+ event.emit('EventMessage', { what: 110, desc: 'attentionPaperList' })
+ util.showBackToast('设置成功')
+ }).catch(err => {
+ wx.hideLoading()
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/agent/focus-list/index.json b/pages/agent/focus-list/index.json
new file mode 100644
index 0000000..9d6cd32
--- /dev/null
+++ b/pages/agent/focus-list/index.json
@@ -0,0 +1,12 @@
+{
+ "usingComponents": {
+ "van-image": "/components/image/index",
+ "van-cell": "/components/cell/index",
+ "van-button": "/components/button/index",
+ "van-loading": "/components/loading/index",
+ "van-checkbox": "/components/checkbox/index",
+ "van-checkbox-group": "/components/checkbox-group/index",
+ "submit-layout": "/components/submit-layout/index",
+ "notification": "/pages/message/notification/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/agent/focus-list/index.wxml b/pages/agent/focus-list/index.wxml
new file mode 100644
index 0000000..acaefde
--- /dev/null
+++ b/pages/agent/focus-list/index.wxml
@@ -0,0 +1,33 @@
+
+
+ 关注纸厂
+
+
+
+
+ HI,\n欢迎使用纸通宝\n开启一站式废纸交易
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
+
\ No newline at end of file
diff --git a/pages/agent/focus-list/index.wxss b/pages/agent/focus-list/index.wxss
new file mode 100644
index 0000000..fcbc569
--- /dev/null
+++ b/pages/agent/focus-list/index.wxss
@@ -0,0 +1,14 @@
+/* pages/message/detail/index.wxss */
+.topText {
+ width: 440rpx;
+ height: 258rpx;
+ padding-left: 48rpx;
+ padding-top: 36rpx;
+ font-size: 48rpx;
+ color: #000000;
+ font-family: PingFangSC-Medium;
+}
+
+.value-class {
+ flex: none !important;
+}
\ No newline at end of file
diff --git a/pages/agent/index/index.wxml b/pages/agent/index/index.wxml
index d052198..589f5df 100644
--- a/pages/agent/index/index.wxml
+++ b/pages/agent/index/index.wxml
@@ -9,7 +9,7 @@
-
+
diff --git a/pages/home/factory-list/index.js b/pages/home/factory-list/index.js
index f7468bd..08bae7e 100644
--- a/pages/home/factory-list/index.js
+++ b/pages/home/factory-list/index.js
@@ -1,6 +1,7 @@
// pages/home/customer/index.js
import Scene from '../../index/scene'
-import { getChanelList, saveChanel, getAllFactoryList } from "../../../api/saas"
+import { getChanelList, saveChanel } from "../../../api/saas"
+import { getAllFactoryList } from "../../../api/ztb"
const util = require('../../../utils/util')
const app = getApp()
diff --git a/pages/home/index/index.js b/pages/home/index/index.js
index 65a4942..ddc866e 100644
--- a/pages/home/index/index.js
+++ b/pages/home/index/index.js
@@ -66,9 +66,7 @@ Component({
if(!app.userInfo){
return
}
- if(!app.userInfo.isAuth){
- wx.navigateTo({ url: '/pages/setting/authory/index' })
- }
+ wx.navigateTo({ url: '/pages/home/user-info/index' })
},
agentList: function(){
wx.navigateTo({ url: '/pages/process/agent-list/index' })
diff --git a/pages/home/index/index.wxml b/pages/home/index/index.wxml
index 01de25d..a985435 100644
--- a/pages/home/index/index.wxml
+++ b/pages/home/index/index.wxml
@@ -14,7 +14,7 @@
{{userName || ''}}
- ({{userInfo.position != 'ORDINARY' ? '管理员' : '员工'}})
+ ({{ isAdmin ? '管理员' : '员工' }})
{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}
去认证
diff --git a/pages/home/user-info/index.js b/pages/home/user-info/index.js
new file mode 100644
index 0000000..32369da
--- /dev/null
+++ b/pages/home/user-info/index.js
@@ -0,0 +1,73 @@
+// pages/home/setting/index.js
+import Scene from '../../index/scene'
+import Dialog from '../../../components/dialog/dialog'
+import util from '../../../utils/util'
+import { finalizeToken } from "../../../api/user"
+const event = require('../../../utils/event')
+const storage = require('../../../utils/storage')
+const app = getApp()
+
+Scene({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ userInfo: null,
+ avatarUrl: '/assets/image/ygImg.png',
+ version: app.version,
+ agenting: true
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var agenting = storage.get('saas-agenting')
+ if(!util.isEmpty(agenting)){
+ app.globalData.agenting = agenting
+ }
+ this.setUserInfo()
+ },
+ setUserInfo: function(){
+ if(!app.userInfo){
+ return
+ }
+ var nickname = ''
+ if(app.userInfo.isAuth) {
+ nickname = app.userInfo.realName.substring(0, 14)
+ } else if(!util.isEmpty(app.userInfo.nickname)){
+ nickname = app.userInfo.nickname.substring(0, 14)
+ } else if(!util.isEmpty(app.userInfo.realName)){
+ nickname = app.userInfo.realName.substring(0, 14)
+ }
+ this.setData({
+ avatarUrl: util.isEmpty(app.userInfo.avatarUrl) ? '/assets/image/ygImg.png' : app.userInfo.avatarUrl,
+ userInfo: app.userInfo,
+ userName: nickname,
+ version: app.version,
+ agenting: app.globalData.agenting ? true : false
+ })
+ },
+ authrise: function(){
+ if(!app.userInfo.isAuth){
+ wx.navigateTo({ url: '/pages/settig/authory/index' })
+ }
+ },
+ settingAgent: function(){
+ var agenting = this.data.agenting ? 0 : 1
+ app.globalData.agenting = agenting
+ storage.put('saas-agenting', agenting)
+ this.setData({ agenting: agenting ? true : false })
+ },
+ loginOut: function () {
+ Dialog.confirm({ title: '温馨提示', message: '确定退出纸通宝账号?' }).then(() => {
+ storage.remove('Authorization')
+ app.globalData.token = null
+ app.userInfo = null
+ finalizeToken()
+ wx.redirectTo({ url: '/pages/login/index' })
+ event.emit('EventMessage', { what: 888, desc: 'Logout' })
+ }).catch(error => {
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/home/user-info/index.json b/pages/home/user-info/index.json
new file mode 100644
index 0000000..43f5c09
--- /dev/null
+++ b/pages/home/user-info/index.json
@@ -0,0 +1,14 @@
+{
+ "usingComponents": {
+ "van-cell": "/components/cell/index",
+ "van-cell-group": "/components/cell-group/index",
+ "van-info": "/components/info/index",
+ "van-icon": "/components/icon/index",
+ "van-switch": "/components/switch/index",
+ "van-image": "/components/image/index",
+ "van-divider": "/components/divider/index",
+ "van-button": "/components/button/index",
+ "van-dialog": "/components/dialog/index",
+ "notification": "/pages/message/notification/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/home/user-info/index.wxml b/pages/home/user-info/index.wxml
new file mode 100644
index 0000000..1e4f4d3
--- /dev/null
+++ b/pages/home/user-info/index.wxml
@@ -0,0 +1,63 @@
+
+
+ 个人资料
+
+
+
+
+
+ 头像
+
+
+
+
+
+
+
+ 实名制认证
+
+ {{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}
+ 去认证
+
+
+
+
+
+ 关注纸厂
+
+
+
+
+ 默认使用千鸟代付
+
+
+
+
+
+
+
+
+
+
+
+ 修改密码
+
+
+
+
+
+ 修改手机号码
+
+
+
+
+
+ 退出当前账号
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/home/user-info/index.wxss b/pages/home/user-info/index.wxss
new file mode 100644
index 0000000..ebceea0
--- /dev/null
+++ b/pages/home/user-info/index.wxss
@@ -0,0 +1 @@
+/* pages/home/setting/index.wxss */
\ No newline at end of file
diff --git a/pages/login/index.js b/pages/login/index.js
index 621b82a..e91efb5 100644
--- a/pages/login/index.js
+++ b/pages/login/index.js
@@ -1,9 +1,10 @@
//获取应用实例
import Dialog from '../../components/dialog/dialog'
-import { config, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode, applyEmplyee } from "../../api/user"
+import { config, headerFactoryId, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode, applyEmplyee } from "../../api/user"
import { sconfig, loginToken, getUserInfo, bindingAdmin, bindCustomer } from "../../api/saas"
import { pconfig } from "../../api/payment"
import { zconfig } from "../../api/ztb"
+import { mconfig } from "../../api/moment"
const util = require('../../utils/util')
const storage = require('../../utils/storage')
const app = getApp()
@@ -100,6 +101,7 @@ Page({
sconfig.header = { 'Authorization': 'QNT ' + result.data }
pconfig.header = { 'Authorization': 'QNT ' + result.data }
zconfig.header = { 'Authorization': 'QNT ' + result.data }
+ mconfig.header = { 'Authorization': 'QNT ' + result.data }
getUserInfo().then(result => {
wx.hideLoading()
app.userInfo = result.data
@@ -107,6 +109,7 @@ Page({
storage.put('Authorization', app.globalData.token)
if(app.userInfo.factoryId && this.data.metaData){
Dialog.alert({ title: '温馨提示', message: '您已经绑定过工厂了,现在就进入?' }).then(() => {
+ headerFactoryId(app.userInfo.factoryId)
wx.redirectTo({ url: '/pages/index/index' })
})
} else if(this.data.metaData){
@@ -125,6 +128,7 @@ Page({
})
return
}
+ headerFactoryId(app.userInfo.factoryId)
wx.redirectTo({ url: '/pages/index/index' })
} else {
wx.redirectTo({ url: '/pages/client/index/index' })