Browse Source

no message

feature/v1.4
xpz2018 4 years ago
parent
commit
bde5eb09f3
7 changed files with 53 additions and 19 deletions
  1. 4
      pages/home/user-info/index.js
  2. 1
      pages/login/index.js
  3. 44
      pages/process/index/index.js
  4. 1
      pages/process/index/index.json
  5. 14
      pages/process/index/index.wxml
  6. 4
      pages/process/index/index.wxss
  7. 4
      pages/setting/index/index.js

4
pages/home/user-info/index.js

@ -22,7 +22,7 @@ Scene({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var agenting = storage.get('saas-agenting')
var agenting = storage.get('saas-agenting' + app.userInfo.userId)
if(!util.isEmpty(agenting)){ if(!util.isEmpty(agenting)){
app.globalData.agenting = agenting app.globalData.agenting = agenting
} }
@ -56,7 +56,7 @@ Scene({
settingAgent: function(){ settingAgent: function(){
var agenting = this.data.agenting ? 0 : 1 var agenting = this.data.agenting ? 0 : 1
app.globalData.agenting = agenting app.globalData.agenting = agenting
storage.put('saas-agenting', agenting)
storage.put('saas-agenting' + app.userInfo.userId, agenting)
this.setData({ agenting: agenting ? true : false }) this.setData({ agenting: agenting ? true : false })
}, },
makeCall: function() { makeCall: function() {

1
pages/login/index.js

@ -129,7 +129,6 @@ Page({
return return
} }
headerFactoryId(app.userInfo.factoryId) headerFactoryId(app.userInfo.factoryId)
// wx.redirectTo({ url: '/pages/agent/select-list/index' })
wx.redirectTo({ url: '/pages/index/index' }) wx.redirectTo({ url: '/pages/index/index' })
} else { } else {
wx.redirectTo({ url: '/pages/client/index/index' }) wx.redirectTo({ url: '/pages/client/index/index' })

44
pages/process/index/index.js

@ -15,7 +15,7 @@ Component({
data: { data: {
userInfo: app.userInfo, userInfo: app.userInfo,
height: app.globalData.safeFragmentHeight, height: app.globalData.safeFragmentHeight,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
tabList: [ tabList: [
{ status: 1, badge: '', name: '定价', icon: '/assets/image/icon_pricing.png' }, { status: 1, badge: '', name: '定价', icon: '/assets/image/icon_pricing.png' },
{ status: 2, badge: '', name: '过磅审核', icon: '/assets/image/icon_checking.png' }, { status: 2, badge: '', name: '过磅审核', icon: '/assets/image/icon_checking.png' },
@ -37,7 +37,18 @@ Component({
}, },
vdate: [], vdate: [],
vdateString: '', vdateString: '',
visiable: false
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
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {
@ -53,6 +64,7 @@ Component({
var vdate = [today.getTime(), maxDate] var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
var height = app.globalData.safeFragmentHeight - 100 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){ if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){
var tabList2 = [ var tabList2 = [
{ status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' }, { status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' },
@ -60,14 +72,14 @@ Component({
{ status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' }, { status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' } { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' }
] ]
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2 })
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2, customBar})
} else { } else {
var tabList2 = [ var tabList2 = [
{ status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' }, { status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' },
{ status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' }, { status: 3, badge: '', name: '待收款', icon: '/assets/image/icon_payback.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' } { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_complete.png' }
] ]
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2 })
this.setData({userInfo: app.userInfo, height, minDate, maxDate, vdate, vdateString, tabList2, customBar })
} }
event.on('EventMessage', this, this.onEvent) event.on('EventMessage', this, this.onEvent)
}, },
@ -176,7 +188,7 @@ Component({
}, },
onClose: function() { onClose: function() {
this.setData({ show: false }) this.setData({ show: false })
this.triggerEvent("zIndex", 9)
this.trigEvent(9)
}, },
onSelect: function({detail}) { onSelect: function({detail}) {
const [start, end] = detail const [start, end] = detail
@ -187,12 +199,24 @@ Component({
wx.navigateTo({ url: '/pages/htmls/auths/index' }) wx.navigateTo({ url: '/pages/htmls/auths/index' })
}, },
showFactoryList: function(){ showFactoryList: function(){
this.setData({ visiable: true })
// this.$emit("zIndex", -1)
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]
headerFactoryId(item.id)
event.emit('EventMessage', { what: 999, desc: 'changeFactory' })
this.setData({ visible: false, factoryId: item.id })
this.trigEvent(9)
}, },
onClickHide: function(){
this.setData({ visiable: false })
// this.$emit("zIndex", 9)
trigEvent: function(zIndex){
setTimeout(() => {
this.triggerEvent('zIndex', zIndex)
}, 100);
} }
} }
}) })

1
pages/process/index/index.json

@ -7,6 +7,7 @@
"van-cell-group": "/components/cell-group/index", "van-cell-group": "/components/cell-group/index",
"van-info": "/components/info/index", "van-info": "/components/info/index",
"van-icon": "/components/icon/index", "van-icon": "/components/icon/index",
"van-popup": "/components/popup/index",
"van-calendar": "/components/calendar/index" "van-calendar": "/components/calendar/index"
} }
} }

14
pages/process/index/index.wxml

@ -138,9 +138,15 @@
</scroll-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"/> <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-overlay show="{{ visiable }}" z-index="22" bind:click="onClickHide">
<view class="bg-white" catch:tap="noop" style="margin-top:{{CustomBar}}px;width: 100%;height:120px" />
</van-overlay>
<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>

4
pages/process/index/index.wxss

@ -9,4 +9,8 @@
white-space: nowrap; white-space: nowrap;
color:white; color:white;
margin-left:32rpx; margin-left:32rpx;
}
.fcell{
height: 96rpx;
} }

4
pages/setting/index/index.js

@ -18,7 +18,7 @@ Scene({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var agenting = storage.get('saas-agenting')
var agenting = storage.get('saas-agenting' + app.userInfo.userId)
if(!util.isEmpty(agenting)){ if(!util.isEmpty(agenting)){
app.globalData.agenting = agenting app.globalData.agenting = agenting
} }
@ -27,7 +27,7 @@ Scene({
settingAgent: function(){ settingAgent: function(){
var agenting = this.data.agenting ? 0 : 1 var agenting = this.data.agenting ? 0 : 1
app.globalData.agenting = agenting app.globalData.agenting = agenting
storage.put('saas-agenting', agenting)
storage.put('saas-agenting' + app.userInfo.userId, agenting)
this.setData({ agenting: agenting ? true : false }) this.setData({ agenting: agenting ? true : false })
}, },
loginOut: function () { loginOut: function () {

Loading…
Cancel
Save