Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
3eb1465a58
20 changed files with 219 additions and 233 deletions
  1. 2
      colorui/main.wxss
  2. 2
      components/sidebar-item/index.wxss
  3. 4
      components/tree-select/index.js
  4. 4
      components/tree-select/index.wxml
  5. 2
      components/tree-select/index.wxss
  6. 25
      pages/agent/index/index.js
  7. 4
      pages/agent/index/index.wxml
  8. 60
      pages/home/index/index.wxml
  9. 68
      pages/index/config.js
  10. 74
      pages/index/index.js
  11. 3
      pages/index/index.json
  12. 42
      pages/index/index.wxml
  13. 43
      pages/process/index/index.js
  14. 1
      pages/process/index/index.json
  15. 18
      pages/process/index/index.wxml
  16. 17
      pages/process/index/index.wxss
  17. 48
      pages/storage/index/index.js
  18. 17
      pages/storage/index/index.wxml
  19. 17
      pages/storage/index/index.wxss
  20. 1
      project.config.json

2
colorui/main.wxss

@ -88,7 +88,7 @@ view, scroll-view, swiper, button, input, textarea, label, navigator, image {
}
.bg-blue{
background: linear-gradient(127deg, rgba(0,122,255,0.67) 0%, rgba(13,100,227,0.95) 100%);
background: linear-gradient(127deg, rgba(0,122,255) 0%, rgba(13,100,227) 100%);
}
/* ==================
边框

2
components/sidebar-item/index.wxss

@ -1 +1 @@
@import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;word-wrap:break-word;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:20px 12px 20px 8px;padding:var(--sidebar-padding,20px 12px 20px 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:20px;line-height:var(--sidebar-line-height,20px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#ee0a24;border-color:var(--sidebar-selected-border-color,#ee0a24)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)}
@import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;word-wrap:break-word;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:20px 12px 20px 8px;padding:var(--sidebar-padding,20px 12px 20px 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:20px;line-height:var(--sidebar-line-height,20px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#008AFF;border-color:var(--sidebar-selected-border-color,#008AFF)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)}

4
components/tree-select/index.js

@ -27,6 +27,10 @@ VantComponent({
type: Number,
value: Infinity,
},
flex: {
type: Number,
value: 1,
},
selectedIcon: {
type: String,
value: 'success',

4
components/tree-select/index.wxml

@ -2,7 +2,7 @@
<wxs src="./index.wxs" module="wxs" />
<view class="van-tree-select" style="height: {{ utils.addUnit(height) }}">
<scroll-view scroll-y class="van-tree-select__nav">
<scroll-view scroll-y class="van-tree-select__nav" style="-webkit-flex:{{flex}};flex:{{flex}};">
<van-sidebar active-key="{{ mainActiveIndex }}" bind:change="onClickNav" custom-class="van-tree-select__nav__inner">
<van-sidebar-item wx:for="{{ items }}" wx:key="index" custom-class="main-item-class"
active-class="main-active-class" disabled-class="main-disabled-class" badge="{{ item.badge }}"
@ -15,7 +15,7 @@
class="van-ellipsis content-item-class {{ utils.bem('tree-select__item', { active: wxs.isActive(activeId, item.id), disabled: item.disabled }) }} {{ wxs.isActive(activeId, item.id) ? 'content-active-class' : '' }} {{ item.disabled ? 'content-disabled-class' : '' }}"
data-item="{{ item }}" bind:tap="onSelectItem">
{{ item.text }}
<van-icon wx:if="{{ wxs.isActive(activeId, item.id) }}" name="{{ selectedIcon }}" size="16px"
<van-icon wx:if="{{ wxs.isActive(activeId, item.id) }}" name="{{ selectedIcon }}" size="1.3em"
class="van-tree-select__selected" />
</view>
</scroll-view>

2
components/tree-select/index.wxss

@ -1 +1 @@
@import '../common/index.wxss';.van-tree-select{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;font-size:14px;font-size:var(--tree-select-font-size,14px)}.van-tree-select__nav{-webkit-flex:1;flex:1;background-color:#f7f8fa;background-color:var(--tree-select-nav-background-color,#f7f8fa);--sidebar-padding:12px 8px 12px 12px}.van-tree-select__nav__inner{width:100%!important;height:100%}.van-tree-select__content{-webkit-flex:2;flex:2;background-color:#fff;background-color:var(--tree-select-content-background-color,#fff)}.van-tree-select__item{position:relative;font-weight:700;padding:0 32px 0 16px;padding:0 32px 0 var(--padding-md,16px);line-height:44px;line-height:var(--tree-select-item-height,44px)}.van-tree-select__item--active{color:#ee0a24;color:var(--tree-select-item-active-color,#ee0a24)}.van-tree-select__item--disabled{color:#c8c9cc;color:var(--tree-select-item-disabled-color,#c8c9cc)}.van-tree-select__selected{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:16px;right:var(--padding-md,16px)}
@import '../common/index.wxss';.van-tree-select{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;font-size:14px;font-size:var(--tree-select-font-size,14px)}.van-tree-select__nav{-webkit-flex:1.5;flex:1.5;background-color:#f7f8fa;background-color:var(--tree-select-nav-background-color,#f7f8fa);--sidebar-padding:12px 8px 12px 12px}.van-tree-select__nav__inner{width:100%!important;height:100%}.van-tree-select__content{-webkit-flex:2;flex:2;background-color:#fff;background-color:var(--tree-select-content-background-color,#fff)}.van-tree-select__item{position:relative;font-weight:700;padding:0 32px 0 16px;padding:0 32px 0 var(--padding-md,16px);line-height:44px;line-height:var(--tree-select-item-height,44px)}.van-tree-select__item--active{color:#008AFF;color:var(--tree-select-item-active-color,#008AFF)}.van-tree-select__item--disabled{color:#c8c9cc;color:var(--tree-select-item-disabled-color,#c8c9cc)}.van-tree-select__selected{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:16px;right:var(--padding-md,16px)}

25
pages/agent/index/index.js

@ -1,6 +1,5 @@
// pages/index/index.js
import { getBalanceInfo } from "../../../api/payment"
import util from '../../../utils/util'
const math = require('../../../utils/math')
const event = require('../../../utils/event')
const app = getApp()
@ -36,18 +35,28 @@ Component({
if(!this.data.firstShow) {
this.setData({userInfo: app.userInfo, height: app.globalData.safeFragmentHeight - 100 })
}
getBalanceInfo().then(result => {
if(result.data){
result.data.accountMoney = math.minus(result.data.accountMoney, result.data.frozenMoney)
this.setData({ banlanceInfo: result.data })
}
}).catch(err => { })
this.fetchStatisticsInfo()
this.data.firstShow = true
},
onEvent: function (message) {
if (message.what == 888) {
}
},
fetchStatisticsInfo: function(loading){
getBalanceInfo().then(result => {
if(result.data){
result.data.accountMoney = math.minus(result.data.accountMoney, result.data.frozenMoney)
this.setData({ banlanceInfo: result.data })
}
if(loading){
wx.hideLoading()
}
}).catch(err => {
if(loading){
wx.hideLoading()
}
})
},
agentList: function (e) {
if(e.currentTarget.dataset.status){
wx.navigateTo({ url: `/pages/agent/order-list/index?status=${e.currentTarget.dataset.status}` })
@ -57,6 +66,6 @@ Component({
},
settlementInfo: function(){
wx.navigateTo({ url: `/pages/settlement/index/index` })
},
}
}
})

4
pages/agent/index/index.wxml

@ -1,8 +1,8 @@
<!--pages/process/index.wxml-->
<wxs module="formate" src="../../formate.wxs"></wxs>
<cu-custom bgColor="bg-blue">
<!-- <cu-custom bgColor="bg-blue">
<view slot="right" class="text-white text-xl" style="padding-left:32rpx">{{ userInfo ? (userInfo.factoryName || '未注册工厂') : ''}}</view>
</cu-custom>
</cu-custom> -->
<scroll-view scroll-y style="height: {{height}}rpx;">
<view style="padding: 0rpx 28rpx;margin-top:24rpx">

60
pages/home/index/index.wxml

@ -3,7 +3,7 @@
<view slot="content" style="color:black;font-size:18px">我的</view>
</cu-custom> -->
<view style="height: 337rpx;background-image: linear-gradient(124deg, rgba(0, 122, 255, 0.67) 0%, rgba(13, 100, 227, 0.95) 100%);position: relative;">
<view style="height: 337rpx;background-image: linear-gradient(124deg, rgba(0, 122, 255) 0%, rgba(13, 100, 227) 100%);position: relative;">
<view style="width: 750rpx; height: 128rpx;position: absolute;padding: 32rpx;"></view>
<image style="height: 32rpx;width: 100%;position: absolute;bottom: 0rpx;" src="/assets/image/bg-vip.png"></image>
<view style="position: absolute;top:{{CustomBar - 28}}px;width:750rpx">
@ -73,62 +73,4 @@
</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>
<van-grid column-num="4" border="{{fasle}}">
<van-grid-item text="员工管理" url="/pages/home/employee/index" wx:if="{{isAdmin}}">
<van-icon slot="icon" name="/assets/home/icon-employe.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="客户管理" url="/pages/home/customer-list/index">
<van-icon slot="icon" name="/assets/home/icon-customer.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="品类管理" url="/pages/setting/paper-list/index">
<van-icon slot="icon" name="/assets/home/icon-cate.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="智能绑卡" url="/pages/message/card-list/index">
<van-icon slot="icon" name="/assets/home/icon-card.png" size="76rpx" />
</van-grid-item>
</van-grid>
</view>
</view>
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;">
<view class="flex flex-justify" style="padding: 24rpx 28rpx 8rpx 28rpx">
<view class="text-black text-sg text-bold">企业信息</view>
</view>
<van-cell is-link clickable url="/pages/settlement/bank-list/index">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="/assets/home/icon-bank.png" size="24" />
<text class="text-sg" style="margin-left:12rpx">银行卡</text>
</view>
</van-cell>
<van-cell is-link clickable url="/pages/home/factory-list/index" custom-class="group-bottom">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="/assets/home/icon-qd.png" size="24" />
<text class="text-sg" style="margin-left:12rpx">出货渠道</text>
</view>
</van-cell>
</view>
</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="height:16rpx"></view>

68
pages/index/config.js

@ -0,0 +1,68 @@
export default {
pro1Name: '巫医和尚唐有限公司',
pro1: [
{
text: '济州岛打包站',
id: 11,
},
{
text: '福州道打包站',
id: 12,
},
{
text: '钟落潭打包站',
id: 13,
disabled: true,
},
{
text: '义乌',
id: 14,
},{
text: '杭州',
id: 1,
},
{
text: '温州',
id: 2,
},
{
text: '宁波',
id: 3,
disabled: true,
},
{
text: '义乌',
id: 4,
},
],
pro2Name: '江苏',
pro2: [
{
text: '南京',
id: 5,
},
{
text: '无锡',
id: 6,
},
{
text: '徐州',
id: 7,
},
{
text: '苏州',
id: 8,
},
],
pro3Name: '福建',
pro3: [
{
text: '泉州',
id: 9,
},
{
text: '厦门',
id: 10,
},
],
};

74
pages/index/index.js

@ -1,8 +1,26 @@
// pages/administ/index.js
import Scene from './scene'
import { getMessageList } from "../../api/saas"
import { headerFactoryId } from "../../api/user"
const event = require('../../utils/event')
const app = getApp()
import config from './config';
const items = [
{
text: config.pro1Name,
children: config.pro1,
},
{
text: config.pro2Name,
children: config.pro2,
},
{
text: config.pro3Name,
disabled: true,
children: config.pro3,
},
];
Scene({
/**
@ -11,6 +29,7 @@ Scene({
data: {
safeBottom: app.globalData.safeBottom,
fragment: app.globalData.safeFragmentHeight,
userInfo: null,
tabList: [
{ index: 0, value: 'process', badge: 0, name: '采购', blue: '/assets/tabbar/process-blue.png', gray: '/assets/tabbar/process-gray.png' },
{ index: 1, value: 'storage', badge: 0, name: '库存', blue: '/assets/tabbar/storage-blue.png', gray: '/assets/tabbar/storage-gray.png' },
@ -19,7 +38,23 @@ Scene({
],
tabIndex: 0,
zIndex: 9,
setInter: null
setInter: null,
factoryId: '12313K78978KK',
factoryName: '',
factoryList: [
{id: '12313000KK12K', name: '济州岛打包站'},
{id: '12313K78978KK', name: '福州道打包站'},
{id: '1231345500KKK', name: '钟落潭打包站'},
{id: '12345678978KK', name: '鹤山常服打包站'},
{id: '123sdfsdf00KKK', name: '合剂打包站'},
{id: '1231332K78978K', name: '永宁街打包站'},
{id: '123242K78978KK', name: '河西路打包站'},
{id: '12313378978KK5', name: '成林道打包站'}
],
items,
mainActiveIndex: 0,
activeId: 0,
visible: false
},
/************************************** 初始化流程 ********************************************/
onLoad: function (options) {
@ -29,8 +64,14 @@ Scene({
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
this.setData({
userInfo: app.userInfo,
factoryName: app.userInfo.factoryName,
customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight),
safeBottom: app.globalData.safeBottom
})
event.on('EventMessage', this, this.onEvent)
this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom })
this.data.setInter = setInterval(this.fetchMessage, 10000)
},
/************************************** 生命周期函数--监听页面初次渲染完成 ********************************************/
@ -61,12 +102,39 @@ Scene({
nowPage.onNotice(result.data.records[0])
}
}
}).catch(err => {
})
},
/************************************** changeFactory ********************************************/
onPopupChange: function({detail}){
this.setData({zIndex: detail})
},
showFactoryList: function(){
this.setData({ visible: !this.data.visible })
if (this.data.tabIndex == 0) {
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value)
pageView.onClose()
}
},
changeFactory: function(e){
var item = this.data.factoryList[e.currentTarget.dataset.index]
wx.showLoading({ title: '正在切换', mask: true })
headerFactoryId(item.id)
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value)
if (pageView && this.data.tabIndex != 3) {
pageView.fetchStatisticsInfo(true)
}
event.emit('EventMessage', { what: 999, desc: 'changeFactory' })
this.setData({ visible: false, factoryId: item.id, factoryName: item.name })
},
onHide: function(){
this.setData({ visible: false })
},
onClickNav({ detail }) {
this.setData({ mainActiveIndex: detail.index || 0 });
},
onClickItem({ detail }) {
this.setData({ activeId: detail.id });
},
onUnload: function(){
event.remove('EventMessage', this)
if(this.data.setInter) {

3
pages/index/index.json

@ -8,6 +8,9 @@
"agent": "/pages/agent/index/index",
"home": "/pages/home/index/index",
"van-dialog": "/components/dialog/index",
"van-popup": "/components/popup/index",
"van-cell": "/components/cell/index",
"van-tree-select": "/components/tree-select/index",
"notification": "/pages/message/notification/index"
}
}

42
pages/index/index.wxml

@ -1,28 +1,48 @@
<!--pages/index/index.wxml-->
<cu-custom bgColor="bg-blue" wx:if="{{tabIndex != 3}}">
<view slot="right" class="flex flex-center" style="padding-left:32rpx" bindtap="showFactoryList">
<text class="text-white text-xl" style="margin-right: 12rpx">{{ userInfo ? (factoryName || '未注册工厂') : ''}}</text>
<van-icon name="{{visible ? 'arrow-up' : 'arrow-down'}}" size="36rpx" color="white" />
</view>
</cu-custom>
<swiper current="{{tabIndex}}" duration="0" style="height:{{fragment}}rpx">
<swiper-item catchtouchmove="stopTouchMove">
<process id="{{tabList[0].value}}" bind:zIndex="onPopupChange"/>
<swiper-item catchtouchmove="stopTouchMove">
<process id="{{tabList[0].value}}" bind:zIndex="onPopupChange" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<storage id="{{tabList[1].value}}" bind:zIndex="onPopupChange"/>
<storage id="{{tabList[1].value}}" bind:zIndex="onPopupChange" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<agent id="{{tabList[2].value}}"/>
<swiper-item catchtouchmove="stopTouchMove">
<agent id="{{tabList[2].value}}" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<home id="{{tabList[3].value}}"/>
<swiper-item catchtouchmove="stopTouchMove">
<home id="{{tabList[3].value}}" />
</swiper-item>
</swiper>
<view class="cu-bar foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx;z-index:{{zIndex}}">
<van-tabbar active="{{ tabIndex }}" fixed="{{false}}" bind:change="onChange">
<van-tabbar-item wx:for="{{tabList}}" wx:key="index" >
<van-icon slot="icon" name="{{item.gray}}" size="25"/>
<van-icon slot="icon-active" name="{{item.blue}}" size="25"/>
<van-tabbar-item wx:for="{{tabList}}" wx:key="index">
<van-icon slot="icon" name="{{item.gray}}" size="25" />
<van-icon slot="icon-active" name="{{item.blue}}" size="25" />
<text>{{item.name}}</text>
</van-tabbar-item>
</van-tabbar>
</view>
<van-popup position="top" show="{{ visible }}" bind:close="onHide" z-index="29">
<view class="bg-white" style="margin-top:{{customBar}}px;width: 100%;">
<!-- <scroll-view scroll-y style="height:{{ 88 * (factoryList.length >= 5 ? 5 : factoryList.length)}}rpx;">
<van-cell clickable wx:for="{{factoryList}}" custom-style="min-height:88rpx" wx:key="index" data-index="{{index}}" bind:click="changeFactory">
<view class="text-bold {{ item.id == factoryId ? 'text-blue' : 'text-black'}}" slot="title">{{item.name}}</view>
<van-icon slot="right-icon" name="success" size="1.3em" color="#008AFF" wx:if="{{item.id == factoryId}}" />
</van-cell>
</scroll-view> -->
<van-tree-select items="{{items}}" height="440rpx" flex="{{1.5}}" main-active-index="{{mainActiveIndex}}" active-id="{{activeId}}"
bind:click-item="onClickItem" bind:click-nav="onClickNav"></van-tree-select>
</view>
</van-popup>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/>
<notification id="qn-notification" />

43
pages/process/index/index.js

@ -1,7 +1,6 @@
// pages/index/index.js
import Dialog from '../../../components/dialog/dialog'
import { getStatisticsInfo } from "../../../api/saas"
import { headerFactoryId } from "../../../api/user"
import util from '../../../utils/util'
const event = require('../../../utils/event')
const app = getApp()
@ -15,7 +14,6 @@ Component({
data: {
userInfo: null,
height: app.globalData.safeFragmentHeight,
customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
tabList: [
{ status: 1, badge: '', name: '定价', icon: '/assets/image/icon_pricing.png' },
{ status: 2, badge: '', name: '过磅审核', icon: '/assets/image/icon_checking.png' },
@ -42,18 +40,6 @@ Component({
},
vdate: [],
vdateString: '',
factoryId: '12313K78978KK',
factoryList: [
{id: '12313000KK12K', name: '济州岛打包站'},
{id: '12313K78978KK', name: '福州道打包站'},
{id: '1231345500KKK', name: '钟落潭打包站'},
{id: '12345678978KK', name: '鹤山常服打包站'},
{id: '123sdfsdf00KKK', name: '合剂打包站'},
{id: '1231332K78978K', name: '永宁街打包站'},
{id: '123242K78978KK', name: '河西路打包站'},
{id: '12313378978KK5', name: '成林道打包站'}
],
visible: false,
actions: [
{ id: 1, name: '厂内收货' },
{ id: 2, name: '厂外收货' },
@ -88,11 +74,10 @@ Component({
this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
var height = app.globalData.safeFragmentHeight - 100
var customBar = app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60)
if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, customBar})
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString})
} else {
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, customBar })
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString })
}
wx.hideLoading()
}
@ -132,7 +117,6 @@ Component({
},
fetchStatisticsInfo: function(loading){
getStatisticsInfo(this.data.form).then(result => {
if(Number(result.data.priceOrderNum) > 0){
this.data.tabList[0].badge = Number(result.data.priceOrderNum)
} else {
@ -191,7 +175,7 @@ Component({
this.triggerEvent("zIndex", -1)
},
onClose: function() {
this.setData({ show: false })
this.setData({ show: false, sheet: false })
this.trigEvent(9)
},
onSelect: function({detail}) {
@ -207,23 +191,6 @@ Component({
toAuths: function(){
wx.navigateTo({ url: '/pages/htmls/auths/index' })
},
showFactoryList: function(){
this.setData({ visible: true })
this.triggerEvent("zIndex", -1)
},
onHide: function(){
this.setData({ visible: false })
this.trigEvent(9)
},
changeFactory: function(e){
var item = this.data.factoryList[e.currentTarget.dataset.index]
wx.showLoading({ title: '正在切换', mask: true })
headerFactoryId(item.id)
event.emit('EventMessage', { what: 999, desc: 'changeFactory' })
this.setData({ visible: false, factoryId: item.id })
this.trigEvent(9)
this.fetchStatisticsInfo(true)
},
trigEvent: function(zIndex){
setTimeout(() => {
this.triggerEvent('zIndex', zIndex)
@ -233,10 +200,6 @@ Component({
this.setData({ sheet: true })
this.triggerEvent("zIndex", -1)
},
onCancel: function(){
this.setData({ sheet: false })
this.trigEvent(9)
},
onAction: function({detail}){
this.setData({ sheetStr: detail.name })
this.data.form.type = detail.id

1
pages/process/index/index.json

@ -5,7 +5,6 @@
"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-icon": "/components/icon/index",
"van-popup": "/components/popup/index",
"van-action-sheet": "/components/action-sheet/index",

18
pages/process/index/index.wxml

@ -1,8 +1,5 @@
<!--pages/process/index.wxml-->
<wxs module="formate" src="../../formate.wxs"></wxs>
<cu-custom bgColor="bg-blue">
<view slot="right" class="text-white text-xl" style="padding-left:32rpx">{{ userInfo ? (userInfo.factoryName || '未注册工厂') : ''}}</view>
</cu-custom>
<scroll-view scroll-y style="height: {{height}}rpx;">
@ -113,16 +110,5 @@
<van-calendar show="{{ show }}" type="range" row-height="50" color="#008AFF" z-index="22" min-date="{{ minDate }}" max-date="{{ maxDate }}" default-date="{{ vdate }}" title="日期范围选择" show-subtitle="{{ false }}" show-confirm="{{ false }}" bind:close="onClose" bind:confirm="onSelect"/>
<van-action-sheet show="{{ sheet }}" actions="{{ actions }}" bind:cancel="onCancel" bind:close="onCancel"
bind:select="onAction" cancel-text="取消" z-index="22" />
<van-popup position="top" show="{{ visible }}" bind:close="onHide" z-index="29">
<view class="bg-white" style="margin-top:{{customBar}}px;width: 100%;">
<scroll-view scroll-y style="height:{{ 96 * (factoryList.length >= 5 ? 5 : factoryList.length)}}rpx;">
<van-cell clickable wx:for="{{factoryList}}" custom-class="fcell" wx:key="index" data-index="{{index}}" bind:click="changeFactory">
<view class="text-lg {{ item.id == factoryId ? 'text-blue' : 'text-black'}}" slot="title">{{item.name}}</view>
<van-icon slot="right-icon" name="success" size="1.3em" color="#008AFF" wx:if="{{item.id == factoryId}}"/>
</van-cell>
</scroll-view>
</view>
</van-popup>
<van-action-sheet show="{{ sheet }}" actions="{{ actions }}" bind:cancel="onCancel" bind:close="onClose"
bind:select="onAction" cancel-text="取消" z-index="22" />

17
pages/process/index/index.wxss

@ -1,16 +1 @@
/* pages/index/index.wxss */
.menu:active {
opacity: .5
}
.name{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
color:white;
margin-left:32rpx;
}
.fcell{
height: 96rpx;
}
/* pages/index/index.wxss */

48
pages/storage/index/index.js

@ -1,7 +1,5 @@
// pages/index/index.js
import Dialog from '../../../components/dialog/dialog'
import { getStatisticsInfo } from "../../../api/saas"
import { headerFactoryId } from "../../../api/user"
import util from '../../../utils/util'
const event = require('../../../utils/event')
const app = getApp()
@ -15,28 +13,19 @@ Component({
data: {
userInfo: app.userInfo,
height: app.globalData.safeFragmentHeight,
customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
tabList2: [
{ status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' },
{ status: 2, badge: '', name: '出货审核', icon: '/assets/image/icon_outcheck.png' },
{ status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' }
],
form: {
startTime: '',
endTime: '',
},
show: false,
vdate: [],
vdateString: '',
factoryId: '12313K78978KK',
factoryList: [
{id: '12313000KK12K', name: '济州岛打包站'},
{id: '12313K78978KK', name: '福州道打包站'},
{id: '1231345500KKK', name: '钟落潭打包站'},
{id: '12345678978KK', name: '鹤山常服打包站'},
{id: '123sdfsdf00KKK', name: '合剂打包站'},
{id: '1231332K78978K', name: '永宁街打包站'},
{id: '123242K78978KK', name: '河西路打包站'},
{id: '12313378978KK5', name: '成林道打包站'}
],
visible: false
vdateString: ''
},
lifetimes: {
attached: function () {
@ -61,7 +50,6 @@ Component({
var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
var height = app.globalData.safeFragmentHeight - 100
var customBar = app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60)
if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){
var tabList2 = [
{ status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' },
@ -69,14 +57,14 @@ Component({
{ status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' }
]
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2, customBar})
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2})
} else {
var tabList2 = [
{ status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' },
{ status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' }
]
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2, customBar })
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2 })
}
}
this.fetchStatisticsInfo(this.data.vdate)
@ -99,9 +87,8 @@ Component({
wx.navigateTo({ url: '/pages/storage/order-list/index' })
}
},
fetchStatisticsInfo: function(vdate, loading){
var param = {startTime: util.formatTime(new Date(vdate[0]), 'Y-M-D'), endTime: util.formatTime(new Date(vdate[1]), 'Y-M-D')}
getStatisticsInfo(param).then(result => {
fetchStatisticsInfo: function(loading){
getStatisticsInfo(this.data.form).then(result => {
if(Number(result.data.weightNoteNum) > 0){
this.data.tabList2[0].badge = Number(result.data.weightNoteNum)
} else {
@ -152,23 +139,6 @@ Component({
toAuths: function(){
wx.navigateTo({ url: '/pages/htmls/auths/index' })
},
showFactoryList: function(){
this.setData({ visible: true })
this.triggerEvent("zIndex", -1)
},
onHide: function(){
this.setData({ visible: false })
this.trigEvent(9)
},
changeFactory: function(e){
var item = this.data.factoryList[e.currentTarget.dataset.index]
wx.showLoading({ title: '正在切换', mask: true })
headerFactoryId(item.id)
event.emit('EventMessage', { what: 999, desc: 'changeFactory' })
this.setData({ visible: false, factoryId: item.id })
this.trigEvent(9)
this.fetchStatisticsInfo(this.data.vdate, true)
},
trigEvent: function(zIndex){
setTimeout(() => {
this.triggerEvent('zIndex', zIndex)

17
pages/storage/index/index.wxml

@ -1,9 +1,5 @@
<!--pages/process/index.wxml-->
<wxs module="formate" src="../../formate.wxs"></wxs>
<cu-custom bgColor="bg-blue">
<view slot="right" class="text-white text-xl" style="padding-left:32rpx">{{ userInfo ? (userInfo.factoryName || '未注册工厂') : ''}}</view>
</cu-custom>
<scroll-view scroll-y style="height: {{height}}rpx;">
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
@ -25,15 +21,4 @@
<view style="height:24rpx;"></view>
</scroll-view>
<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"/>
<van-popup position="top" show="{{ visible }}" bind:close="onHide" z-index="29">
<view class="bg-white" style="margin-top:{{customBar}}px;width: 100%;">
<scroll-view scroll-y style="height:{{ 96 * (factoryList.length >= 5 ? 5 : factoryList.length)}}rpx;">
<van-cell clickable wx:for="{{factoryList}}" custom-class="fcell" wx:key="index" data-index="{{index}}" bind:click="changeFactory">
<view class="text-lg {{ item.id == factoryId ? 'text-blue' : 'text-black'}}" slot="title">{{item.name}}</view>
<van-icon slot="right-icon" name="success" size="1.3em" color="#008AFF" wx:if="{{item.id == factoryId}}"/>
</van-cell>
</scroll-view>
</view>
</van-popup>
<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"/>

17
pages/storage/index/index.wxss

@ -1,16 +1 @@
/* pages/index/index.wxss */
.menu:active {
opacity: .5
}
.name{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
color:white;
margin-left:32rpx;
}
.fcell{
height: 96rpx;
}
/* pages/index/index.wxss */

1
project.config.json

@ -30,7 +30,6 @@
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,

Loading…
Cancel
Save