Browse Source

2021年4月27日 15:27:54

feature/v1.4
xpz2018 5 years ago
parent
commit
cea6844709
45 changed files with 856 additions and 122 deletions
  1. 56
      api/moment.js
  2. 3
      api/saas.js
  3. 18
      api/user.js
  4. 4
      app.js
  5. 4
      app.json
  6. BIN
      assets/image/icon-none.png
  7. 2
      colorui/main.wxss
  8. 6
      components/refresh-view/index.wxml
  9. 2
      components/refresh-view/index.wxss
  10. 2
      components/search/index.wxml
  11. 101
      components/stickys/index.js
  12. 4
      components/stickys/index.json
  13. 10
      components/stickys/index.wxml
  14. 5
      components/stickys/index.wxss
  15. 8
      components/tab/index.wxml
  16. 112
      components/tabi/index.js
  17. 3
      components/tabi/index.json
  18. 10
      components/tabi/index.wxml
  19. 56
      components/tabi/index.wxss
  20. 3
      components/tabs/index.wxml
  21. 2
      pages/agent/agent-item/index.js
  22. 0
      pages/agent/agent-list/index.js
  23. 0
      pages/agent/agent-list/index.json
  24. 0
      pages/agent/agent-list/index.wxml
  25. 0
      pages/agent/agent-list/index.wxss
  26. 49
      pages/agent/factory-detail/index.js
  27. 7
      pages/agent/factory-detail/index.json
  28. 55
      pages/agent/factory-detail/index.wxml
  29. 4
      pages/agent/factory-fragment/index.js
  30. 74
      pages/agent/focus-fragment/index.js
  31. 12
      pages/agent/focus-fragment/index.json
  32. 78
      pages/agent/focus-fragment/index.wxml
  33. 61
      pages/agent/focus-list/index.js
  34. 12
      pages/agent/focus-list/index.json
  35. 33
      pages/agent/focus-list/index.wxml
  36. 14
      pages/agent/focus-list/index.wxss
  37. 2
      pages/agent/index/index.wxml
  38. 3
      pages/home/factory-list/index.js
  39. 4
      pages/home/index/index.js
  40. 2
      pages/home/index/index.wxml
  41. 73
      pages/home/user-info/index.js
  42. 14
      pages/home/user-info/index.json
  43. 63
      pages/home/user-info/index.wxml
  44. 1
      pages/home/user-info/index.wxss
  45. 6
      pages/login/index.js

56
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
}

3
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,

18
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,

4
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--------------------------------------

4
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",

BIN
assets/image/icon-none.png

Before After
Width: 320  |  Height: 249  |  Size: 12 KiB

2
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;

6
components/refresh-view/index.wxml

@ -11,10 +11,8 @@
<text class="iconfont icon-shuaxin" style="font-size:50rpx;color:{{color}};" />
</view>
<!-- 刷新中圆圈 -->
<view class="circle-progress-bar" style="background-color:{{backgroundColor}};margin-top:40rpx;"
hidden="{{!triggered}}">
<view class="loading"
style="border-top:5rpx solid {{color}};border-left:5rpx solid {{color}};border-right:5rpx solid {{color}};" />
<view class="circle-progress-bar" style="background-color:{{backgroundColor}};margin-top:40rpx;" hidden="{{!triggered}}">
<view class="loading" style="border-top:5rpx solid {{color}};border-left:5rpx solid {{color}};border-right:5rpx solid {{color}};" />
</view>
<!-- 刷新内容 -->
<slot></slot>

2
components/refresh-view/index.wxss

@ -14,7 +14,7 @@
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
z-index: 8;
}
.circle-progress-bar {

2
components/search/index.wxml

@ -1,7 +1,7 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="{{ utils.bem('search', { withaction: showAction || useActionSlot }) }} custom-class"
style="background: {{ background }};z-index:60">
style="background: {{ background }};z-index:12">
<view class="{{ utils.bem('search__content', [shape]) }}">
<view class="van-search__label" wx:if="{{ label }}">{{ label }}</view>
<slot wx:else name="label" />

101
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
})
}
}
});

4
components/stickys/index.json

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

10
components/stickys/index.wxml

@ -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>

5
components/stickys/index.wxss

@ -0,0 +1,5 @@
.tui-sticky-fixed {
width: 100%;
position: fixed;
z-index: 99999;
}

8
components/tab/index.wxml

@ -1,8 +1,6 @@
<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 }}" />
</view>
</view>

112
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()
}
}
})

3
components/tabi/index.json

@ -0,0 +1,3 @@
{
"component": true
}

10
components/tabi/index.wxml

@ -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>

56
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;
}

3
components/tabs/index.wxml

@ -1,12 +1,11 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="getters" />
<view class="custom-class {{ utils.bem('tabs', [type]) }}" style="z-index: 66">
<view class="custom-class {{ utils.bem('tabs', [type]) }}" style="z-index: 12">
<van-sticky disabled="{{ !sticky }}" z-index="{{ zIndex }}" offset-top="{{ offsetTop }}" container="{{ container }}"
bind:scroll="onTouchScroll">
<view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
<slot name="nav-left" />
<scroll-view scroll-x="{{ scrollable }}" scroll-with-animation scroll-left="{{ scrollLeft }}"
class="{{ utils.bem('tabs__scroll', [type]) }}" style="{{ color ? 'border-color: ' + color : '' }}">
<view class="{{ utils.bem('tabs__nav', [type]) }} nav-class"

2
pages/agent/agent-item/index.js

@ -15,7 +15,7 @@ Component({
},
methods: {
lookItem: function (e) {
util.navigateTo('/pages/agent/factory/index?id=' + this.data.item.paperMillId)
wx.navigateTo({ url: `/pages/agent/factory-detail/index?id=${this.data.item.paperMillId}`})
},
unflodItem: function(){
this.setData({ ['item.fold']: !this.data.item.fold })

pages/agent/factory-list/index.js → pages/agent/agent-list/index.js

pages/agent/factory-list/index.json → pages/agent/agent-list/index.json

pages/agent/factory-list/index.wxml → pages/agent/agent-list/index.wxml

pages/agent/factory-list/index.wxss → pages/agent/agent-list/index.wxss

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

@ -1,17 +1,62 @@
// pages/message/detail/index.js
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({
/**
* 页面的初始数据
*/
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) {
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
})
}
})

7
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"
}
}

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

@ -1,6 +1,55 @@
<!--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"/>

4
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')

74
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' })
}
}
})

12
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"
}
}

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

@ -1,66 +1,28 @@
<!--pages/process/index.wxml-->
<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 class="text-empty">正在加载</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 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 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>

61
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()
})
}
})

12
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"
}
}

33
pages/agent/focus-list/index.wxml

@ -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" />

14
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;
}

2
pages/agent/index/index.wxml

@ -9,7 +9,7 @@
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx">
<van-grid column-num="4" border="{{fasle}}">
<van-grid-item url="/pages/agent/factory-list/index" text="千鸟代卖">
<van-grid-item url="/pages/agent/agent-list/index" text="千鸟代卖">
<van-icon slot="icon" name="/assets/image/icon_pricing.png" size="68rpx" />
</van-grid-item>
<van-grid-item url="/pages/dashboard/index" text="纸厂情报">

3
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()

4
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' })

2
pages/home/index/index.wxml

@ -14,7 +14,7 @@
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start">
<view class="flex flex-center">
<text class="text-lg" style="white-space: nowrap">{{userName || ''}}</text>
<text class="text-lg" style="white-space: nowrap">({{userInfo.position != 'ORDINARY' ? '管理员' : '员工'}})</text>
<text class="text-lg" style="white-space: nowrap">({{ isAdmin ? '管理员' : '员工' }})</text>
<view class="flex flex-center" style="font-size:12px;margin-left:18rpx">
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}</text>
<text class="text-yellow" style="font-size:14px;padding:4px;" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text>

73
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 => {
})
}
})

14
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"
}
}

63
pages/home/user-info/index.wxml

@ -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" />

1
pages/home/user-info/index.wxss

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

6
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' })

Loading…
Cancel
Save