45 changed files with 856 additions and 122 deletions
Unified View
Diff Options
-
56api/moment.js
-
3api/saas.js
-
18api/user.js
-
4app.js
-
4app.json
-
BINassets/image/icon-none.png
-
2colorui/main.wxss
-
6components/refresh-view/index.wxml
-
2components/refresh-view/index.wxss
-
2components/search/index.wxml
-
101components/stickys/index.js
-
4components/stickys/index.json
-
10components/stickys/index.wxml
-
5components/stickys/index.wxss
-
8components/tab/index.wxml
-
112components/tabi/index.js
-
3components/tabi/index.json
-
10components/tabi/index.wxml
-
56components/tabi/index.wxss
-
3components/tabs/index.wxml
-
2pages/agent/agent-item/index.js
-
0pages/agent/agent-list/index.js
-
0pages/agent/agent-list/index.json
-
0pages/agent/agent-list/index.wxml
-
0pages/agent/agent-list/index.wxss
-
49pages/agent/factory-detail/index.js
-
7pages/agent/factory-detail/index.json
-
55pages/agent/factory-detail/index.wxml
-
4pages/agent/factory-fragment/index.js
-
74pages/agent/focus-fragment/index.js
-
12pages/agent/focus-fragment/index.json
-
78pages/agent/focus-fragment/index.wxml
-
61pages/agent/focus-list/index.js
-
12pages/agent/focus-list/index.json
-
33pages/agent/focus-list/index.wxml
-
14pages/agent/focus-list/index.wxss
-
2pages/agent/index/index.wxml
-
3pages/home/factory-list/index.js
-
4pages/home/index/index.js
-
2pages/home/index/index.wxml
-
73pages/home/user-info/index.js
-
14pages/home/user-info/index.json
-
63pages/home/user-info/index.wxml
-
1pages/home/user-info/index.wxss
-
6pages/login/index.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 |
||||
|
} |
||||
@ -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 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"component": true, |
||||
|
"usingComponents": {} |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
<view class="tui-sticky-class"> |
||||
|
<!--sticky 容器--> |
||||
|
<view style="height:{{stickyHeight}};background:{{bgColor}}" wx:if="{{isFixed}}"></view> |
||||
|
<view class="{{ isFixed === true ? 'tui-sticky-fixed' : '' }}" style="top:{{isFixed?stickyTop+'px':'auto'}}"> |
||||
|
<slot name="header"></slot> |
||||
|
</view> |
||||
|
<!--sticky 容器--> |
||||
|
<!--内容--> |
||||
|
<slot name="content"></slot> |
||||
|
</view> |
||||
@ -0,0 +1,5 @@ |
|||||
|
.tui-sticky-fixed { |
||||
|
width: 100%; |
||||
|
position: fixed; |
||||
|
z-index: 99999; |
||||
|
} |
||||
@ -1,8 +1,6 @@ |
|||||
<wxs src="../wxs/utils.wxs" module="utils" /> |
<wxs src="../wxs/utils.wxs" module="utils" /> |
||||
|
|
||||
<view |
|
||||
class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}" |
|
||||
style="{{ shouldShow ? '' : 'display: none;' }}" |
|
||||
> |
|
||||
|
<view class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}" |
||||
|
style="{{ shouldShow ? '' : 'display: none;' }}"> |
||||
<slot wx:if="{{ shouldRender }}" /> |
<slot wx:if="{{ shouldRender }}" /> |
||||
</view> |
|
||||
|
</view> |
||||
@ -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() |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
<scroll-view class="scroll-view" style="height: {{size}}rpx;" scroll-x="{{scrolling}}" scroll-with-animation="{{scrolling}}" scroll-left="{{scrollLeft}}"> |
||||
|
<view class="tabs-wrap"> |
||||
|
<view class="tabs {{scroll ? 'tabs--scroll' : ''}}" style="height: {{size}}rpx"> |
||||
|
<view class="tabs__item {{index === tabIndex ? 'tabs__item--cur': ''}}" style="height: {{size}}rpx;line-height: {{size}}rpx" wx:for="{{tabData}}" wx:key="*this" bindtap="toggleTab" data-index="{{index}}"> |
||||
|
<view class="tabs__item-child">{{item}}</view> |
||||
|
</view> |
||||
|
<view class="tabs__line {{needTransition ? 'transition' : ''}}" style="background: {{color}};width: {{lineWidth}}px;transform: translateX({{translateX}}px)"></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
@ -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; |
||||
|
} |
||||
@ -1,17 +1,62 @@ |
|||||
// pages/message/detail/index.js
|
// pages/message/detail/index.js
|
||||
import Scene from '../../index/scene' |
import Scene from '../../index/scene' |
||||
|
import { getFactoryPriceDetail, userPushFollowMill } from "../../../api/ztb" |
||||
|
import { getPreferList} from "../../../api/moment" |
||||
|
const event = require('../../../utils/event') |
||||
|
const util = require('../../../utils/util') |
||||
|
const storage = require('../../../utils/storage') |
||||
|
const app = getApp() |
||||
|
|
||||
Scene({ |
Scene({ |
||||
/** |
/** |
||||
* 页面的初始数据 |
* 页面的初始数据 |
||||
*/ |
*/ |
||||
data: { |
data: { |
||||
|
|
||||
|
fragmentHeight: app.globalData.fragmentHeight - 90, |
||||
|
height: app.globalData.fragmentHeight - 90, |
||||
|
stickyTop: app.globalData.CustomBar, |
||||
|
scrollTop: 0, |
||||
|
toView: null, |
||||
|
id: null, |
||||
|
tabList: ['报价信息', '讨论', '收货标准', '注意事项'], |
||||
|
tabIndex: 0, |
||||
|
factoryDetail: null, |
||||
|
cateIndex: 0, |
||||
|
cateId: '', |
||||
|
daytimes: '', |
||||
|
momentList: [], |
||||
|
requesting: false, |
||||
|
finished: false, |
||||
|
form: { |
||||
|
pageNum: 1 |
||||
|
}, |
||||
|
hasFollowed: false |
||||
}, |
}, |
||||
/** |
/** |
||||
* 生命周期函数--监听页面加载 |
* 生命周期函数--监听页面加载 |
||||
*/ |
*/ |
||||
onLoad: function (options) { |
onLoad: function (options) { |
||||
|
|
||||
|
if (options.id) { |
||||
|
this.data.id = options.id |
||||
|
this.data.form.millPaperId = options.id |
||||
|
getFactoryPriceDetail(options.id).then(result => { |
||||
|
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
|
||||
|
}) |
||||
} |
} |
||||
}) |
}) |
||||
@ -1,5 +1,12 @@ |
|||||
{ |
{ |
||||
"usingComponents": { |
"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" |
"notification": "/pages/message/notification/index" |
||||
} |
} |
||||
} |
} |
||||
@ -1,6 +1,55 @@ |
|||||
<!--pages/message/detail/index.wxml--> |
<!--pages/message/detail/index.wxml--> |
||||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|
||||
<view slot="content">消息情况</view> |
|
||||
</cu-custom> |
|
||||
|
<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;" bindscroll="onScroll" bind:scrolltolower="fetchMomentList" wx:if="{{factoryDetail}}"> |
||||
|
<view class="bg-white flex" style="padding:30rpx"> |
||||
|
<van-image use-loading-slot width="108rpx" height="108rpx" radius="4" lazy-load src="{{factoryDetail.logoImg}}"> |
||||
|
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
||||
|
</van-image> |
||||
|
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start;width: 100%"> |
||||
|
<view class="flex flex-justify" style="white-space: nowrap;width: 100%;"> |
||||
|
<text class="text-sg text-bold">{{factoryDetail.name}}</text> |
||||
|
<van-button round type="{{ hasFollowed ? 'danger' : 'info'}}" size="mini" custom-style="width:160rpx" bind:click="onAttentionChange">{{ hasFollowed ? '取消关注' : '关注'}}</van-button> |
||||
|
</view> |
||||
|
<view class="text-xs text-gray" style="margin-top:4rpx"> |
||||
|
<text>{{factoryDetail.locProvinceName + factoryDetail.locCityName + factoryDetail.locDistrictName}}</text> |
||||
|
<text class="text-gray" style="margin: 0rpx 8rpx" wx:if="{{factoryDetail.cumulativeWeight > 0}}">|</text> |
||||
|
<text wx:if="{{factoryDetail.cumulativeWeight > 0}}">已代卖:{{formate.formateWeight(factoryDetail.cumulativeWeight)}}吨</text> |
||||
|
<text class="text-gray" style="margin: 0rpx 8rpx">|</text> |
||||
|
<text wx:if="{{factoryDetail.yesterdayTotalQuantity &&factoryDetail.yesterdayTotalQuantity >= 0}}">昨日排队:{{factoryDetail.yesterdayTotalQuantity}}辆</text> |
||||
|
<text wx:else>昨日排队:--</text> |
||||
|
</view> |
||||
|
<view class="flex flex-justify text-df" style="margin-top:4rpx;width:100%"> |
||||
|
<view class="flex flex-center" wx:if="{{factoryDetail.proxypaySurcharge}}"> |
||||
|
<text class="text-black">代卖费:</text> |
||||
|
<text class="text-red">{{formate.formatePrice(factoryDetail.proxypaySurcharge)}}元/吨</text> |
||||
|
</view> |
||||
|
<view class="flex" wx:if="{{factoryDetail.foreignPaybackIntever}}"> |
||||
|
<text class="text-black">纸厂账期:</text> |
||||
|
<text class="text-red">{{factoryDetail.foreignPaybackIntever}}天</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<van-tabs color="#008AFF" title-active-color="#008AFF" sticky offset-top="100"> |
||||
|
<van-tab title="报价信息"> |
||||
|
<view style="height:1200px"></view> |
||||
|
</van-tab> |
||||
|
<van-tab title="讨论"> |
||||
|
|
||||
|
</van-tab> |
||||
|
<van-tab title="收货标准"> |
||||
|
|
||||
|
</van-tab> |
||||
|
<van-tab title="注意事项"> |
||||
|
|
||||
|
</van-tab> |
||||
|
</van-tabs> |
||||
|
</scroll-view> |
||||
|
<submit-layout wx:if="{{factoryDetail}}"> |
||||
|
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="submitForm">确认</van-button> |
||||
|
</submit-layout> |
||||
<notification id="qn-notification"/> |
<notification id="qn-notification"/> |
||||
@ -1,12 +1,10 @@ |
|||||
{ |
{ |
||||
"component": true, |
"component": true, |
||||
"usingComponents": { |
"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" |
||||
} |
} |
||||
} |
} |
||||
@ -1,66 +1,28 @@ |
|||||
<!--pages/process/index.wxml--> |
<!--pages/process/index.wxml--> |
||||
<wxs module="formate" src="../../formate.wxs"></wxs> |
<wxs module="formate" src="../../formate.wxs"></wxs> |
||||
<cu-custom bgColor="bg-white"> |
|
||||
<view slot="content" style="color:black;font-size:36rpx">工作台</view> |
|
||||
</cu-custom> |
|
||||
|
|
||||
<scroll-view scroll-y style="height: {{height}}rpx;"> |
|
||||
<view style="height:250rpx;background-color:#008AFF;border-radius: 0rpx 0rpx 12rpx 12rpx;"> |
|
||||
<view class="flex flex-center" style="padding:32rpx 28rpx;justify-content: flex-start"> |
|
||||
<image style="width:100rpx;height:100rpx" src="/assets/image/icon_logo.png"></image> |
|
||||
<view class="text-xxl text-bold name">{{userInfo.factoryName || '未注册工厂'}}</view> |
|
||||
|
<refresh-view id="refresh" bind:refresh="onRefreshList" height="{{height}}" bind:loadmore="fetchPapersList"> |
||||
|
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length && loading}}"> |
||||
|
<view style="margin-bottom:24px"> |
||||
|
<van-loading type="spinner" size="32" /> |
||||
</view> |
</view> |
||||
|
<view class="text-empty">正在加载</view> |
||||
</view> |
</view> |
||||
|
|
||||
<view style="padding: 0rpx 28rpx;margin-top:-90rpx"> |
|
||||
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx 8rpx 0rpx"> |
|
||||
<view class="flex flex-justify" style="padding: 0rpx 28rpx 24rpx 28rpx"> |
|
||||
<view class="text-black text-sg text-bold">收货统计</view> |
|
||||
<view class="flex flex-center" bindtap="showSheet" style="padding: 2rpx 0rpx"> |
|
||||
<view class="text-black text-sm" style="margin-right:8rpx">{{vdateString}}</view> |
|
||||
<!-- <van-icon name="arrow-down" /> --> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="flex" style="padding:0rpx 0rpx 24rpx 0rpx" bindtap="agentList"> |
|
||||
<view style="flex:1;padding:0rpx 32rpx;margin-right:12rpx"> |
|
||||
<view class="flex flex-center" style="justify-content: flex-start"> |
|
||||
<view style="height:24rpx;width:6rpx;background:#007AFF"></view> |
|
||||
<view class="text-black text-sm" style="margin-left: 12rpx">收货重量</view> |
|
||||
</view> |
|
||||
<view class="text-xxl text-bold" style="margin:12rpx 0rpx">{{formate.formateWeight(totalInfo.totalWeight)}}吨</view> |
|
||||
<view class="text-gray text-sm">查看收货详情</view> |
|
||||
</view> |
|
||||
<view style="flex:1;padding:0rpx 32rpx;margin-left:12rpx"> |
|
||||
<view class="flex flex-center" style="justify-content: flex-start"> |
|
||||
<view style="height:24rpx;width:6rpx;background:#FF8413"></view> |
|
||||
<view class="text-black text-sm" style="margin-left: 12rpx">收货金额</view> |
|
||||
</view> |
|
||||
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(totalInfo.totalMoney)}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
<view class="bg-white list-empty" style="height:{{height}}rpx;justify-content:flex-start" wx:elif="{{!orderList.length}}"> |
||||
|
<image style="height: 294rpx;width: 378rpx;margin-top:160rpx" src="/assets/image/icon-none.png"></image> |
||||
|
<text class="text-bold text-black" style="font-size: 48rpx;margin-top:64rpx">暂无关注</text> |
||||
|
<text class="text-sg" style="margin-top:24rpx">可前往纸厂列表添加关注</text> |
||||
|
<van-button type="info" custom-style="width:360rpx;height:80rpx;border-radius:10rpx;margin-top:36rpx" bind:click="attention">添加关注</van-button> |
||||
</view> |
</view> |
||||
|
|
||||
<view style="padding: 0rpx 28rpx;margin-top:24rpx"> |
|
||||
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx"> |
|
||||
<view class="flex flex-justify" style="padding: 0rpx 28rpx 8rpx 28rpx"> |
|
||||
<view class="text-black text-sg text-bold">代卖订单</view> |
|
||||
<view class="flex flex-center" style="padding:4rpx 0rpx 4rpx 4rpx" bindtap="agentList"> |
|
||||
<view class="text-gray text-sm" style="margin-right:8rpx">查看全部订单</view> |
|
||||
<van-icon name="arrow" color="#aaa"/> |
|
||||
</view> |
|
||||
</view> |
|
||||
<van-grid column-num="4" border="{{fasle}}"> |
|
||||
<van-grid-item wx:for="{{ tabList }}" wx:key="index" data-status="{{item.status}}" bind:click="agentList" text="{{item.name}}"> |
|
||||
<van-icon slot="icon" name="{{ item.icon }}" size="68rpx" info="{{item.badge}}" /> |
|
||||
</van-grid-item> |
|
||||
</van-grid> |
|
||||
|
<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> |
||||
</view> |
</view> |
||||
|
|
||||
<view style="height:24rpx;"></view> |
|
||||
|
|
||||
</scroll-view> |
|
||||
|
|
||||
<!-- <van-action-sheet show="{{ show }}" actions="{{ actions }}" bind:close="onClose" bind:select="onSelect" z-index="22"/> --> |
|
||||
<van-calendar show="{{ show }}" type="range" row-height="50" color="#008AFF" z-index="22" min-date="{{ minDate }}" max-date="{{ maxDate }}" default-date="{{ vdate }}" top="{{ 1500 }}" show-subtitle="{{ false }}" show-confirm="{{ false }}" bind:close="onClose" bind:confirm="onSelect"/> |
|
||||
|
<!--加载更多的UI--> |
||||
|
<van-divider content-position="center" wx:if="{{ form.pageNum > 1}}" custom-style="padding:0rpx 120rpx"> |
||||
|
<van-loading type="spinner" size="16" wx:if="{{!finished}}" /> |
||||
|
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
||||
|
</van-divider> |
||||
|
</refresh-view> |
||||
@ -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() |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
@ -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" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
<!--pages/message/detail/index.wxml--> |
||||
|
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
||||
|
<view slot="content">关注纸厂</view> |
||||
|
</cu-custom> |
||||
|
|
||||
|
<view class="bg-white" style="height:{{height - safeBottom}}rpx" wx:if="{{factoryList}}"> |
||||
|
<view class="flex" style="height:258rpx"> |
||||
|
<view class="topText">HI,\n欢迎使用纸通宝\n开启一站式废纸交易</view> |
||||
|
<van-image use-loading-slot width="310rpx" height="258rpx" src="https://img.imgdb.cn/item/60878167d1a9ae528f1a6f9c.png"> |
||||
|
<view class="image-load" slot="loading"> |
||||
|
<van-loading type="spinner" size="32" /> |
||||
|
</view> |
||||
|
</van-image> |
||||
|
</view> |
||||
|
<scroll-view scroll-y style="height:{{height - 258}}rpx;padding: 16rpx 0rpx {{safeBottom + 16}}rpx 0rpx"> |
||||
|
<van-checkbox-group value="{{ form.paperMillIds }}" bind:change="onChange"> |
||||
|
<van-cell-group> |
||||
|
<van-cell wx:for="{{ factoryList }}" wx:key="index" title="{{ item.name }}" value-class="value-class" clickable |
||||
|
data-index="{{ index }}" bind:click="toggle"> |
||||
|
<van-checkbox catch:tap="noop" class="checkboxes-{{ index }}" name="{{ item.paperMillId }}" /> |
||||
|
</van-cell> |
||||
|
</van-cell-group> |
||||
|
</van-checkbox-group> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
<view class="bg-white flex flex-center" style="height:{{height}}rpx" wx:else> |
||||
|
<van-loading type="spinner" size="32" /> |
||||
|
</view> |
||||
|
|
||||
|
<submit-layout wx:if="{{factoryList}}"> |
||||
|
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="submitForm">确认</van-button> |
||||
|
</submit-layout> |
||||
|
<notification id="qn-notification" /> |
||||
@ -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; |
||||
|
} |
||||
@ -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 => { |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
@ -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" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
<!--pages/home/setting/index.wxml--> |
||||
|
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
||||
|
<view slot="content" style="color:black;font-size:18px">个人资料</view> |
||||
|
</cu-custom> |
||||
|
|
||||
|
<van-cell-group> |
||||
|
<van-cell is-link clickable> |
||||
|
<view slot="title" class="flex flex-justify"> |
||||
|
<view class="text-black">头像</view> |
||||
|
<van-image use-loading-slot width="120rpx" height="120rpx" round src="{{avatarUrl}}"> |
||||
|
<image class="image-load" slot="loading" src="/assets/image/ygImg.png"></image> |
||||
|
</van-image> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
<van-cell is-link="{{userInfo.isAuth != 1}}" clickable bind:click="authrise"> |
||||
|
<view slot="title" class="flex flex-justify"> |
||||
|
<view class="text-black">实名制认证</view> |
||||
|
<view class="flex flex-center"> |
||||
|
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}</text> |
||||
|
<text class="text-sg" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
<van-cell is-link clickable url="/pages/agent/focus-list/index"> |
||||
|
<view class="flex" slot="title" style="align-items: center"> |
||||
|
<text class="text-sg">关注纸厂</text> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
<van-cell clickable bind:click="settingAgent"> |
||||
|
<view slot="title" class="flex flex-justify"> |
||||
|
<view class="text-black">默认使用千鸟代付</view> |
||||
|
<view class="flex flex-center"> |
||||
|
<van-switch checked="{{ agenting }}" size="22px" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
</van-cell-group> |
||||
|
<view style="height:24rpx"></view> |
||||
|
<van-cell-group> |
||||
|
<van-cell is-link clickable url="/pages/setting/password/index"> |
||||
|
<view class="flex" slot="title" style="align-items: center"> |
||||
|
<text class="cuIcon-lock text-black" style="font-size:36rpx"></text> |
||||
|
<text class="text-sg" style="margin-left:12rpx">修改密码</text> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
<van-cell is-link clickable url="/pages/setting/mobile/index"> |
||||
|
<view class="flex" slot="title" style="align-items: center"> |
||||
|
<text class="cuIcon-mobile text-black" style="font-size:36rpx"></text> |
||||
|
<text class="text-sg" style="margin-left:12rpx">修改手机号码</text> |
||||
|
</view> |
||||
|
</van-cell> |
||||
|
</van-cell-group> |
||||
|
|
||||
|
<view style="margin-top:48rpx;padding:40rpx 80rpx"> |
||||
|
<van-button block type="danger" bind:click="loginOut">退出当前账号</van-button> |
||||
|
</view> |
||||
|
|
||||
|
<view class="cu-bar foot" style="display:block;width:100%;min-height: 180rpx;padding: 0rpx 120rpx"> |
||||
|
<van-divider content-position="center">当前版本:{{version}}</van-divider> |
||||
|
</view> |
||||
|
|
||||
|
<van-dialog id="van-dialog" /> |
||||
|
<notification id="qn-notification" /> |
||||
@ -0,0 +1 @@ |
|||||
|
/* pages/home/setting/index.wxss */ |
||||
Write
Preview
Loading…
Cancel
Save