Browse Source

no message

feature/v1.4
xpz2018 4 years ago
parent
commit
c479292fb4
12 changed files with 74 additions and 117 deletions
  1. 6
      api/saas.js
  2. 4
      components/image-cropper/index.js
  3. 1
      pages/home/customer-list/index.json
  4. 47
      pages/home/employee/index.js
  5. 14
      pages/home/employee/index.wxml
  6. 1
      pages/home/user-info/index.json
  7. 58
      pages/home/user-info/index.wxml
  8. 9
      pages/index/index.js
  9. 16
      pages/index/index.wxml
  10. 25
      pages/process/index/index.js
  11. 6
      pages/process/index/index.wxml
  12. 4
      pages/settlement/bank-list/index.js

6
api/saas.js

@ -63,7 +63,8 @@ const auditOutOrder = (params) => mPost(`/ztb-factory/audit/outbount-delivery-or
const receiptOutOrder = (params) => mPost(`/ztb-factory/confirm/outbound-delivery-order-receipt`, params, sconfig) const receiptOutOrder = (params) => mPost(`/ztb-factory/confirm/outbound-delivery-order-receipt`, params, sconfig)
const createOutOrder = (params) => mPost(`/ztb-factory/relevancy/weight-note/and/outbound-delivery-order`, params, sconfig) const createOutOrder = (params) => mPost(`/ztb-factory/relevancy/weight-note/and/outbound-delivery-order`, params, sconfig)
const bindBankCard = (params) => mPost(`/ztb-factory/factory/binding/bank-card`, params, sconfig) const bindBankCard = (params) => mPost(`/ztb-factory/factory/binding/bank-card`, params, sconfig)
const postFeedback = (params) => mPost(`/saas-user/account/feedback`, params, sconfig)
const getBankCardList = () => mGet(`/ztb-factory/get/factory-bank-card-list`, null, sconfig)
const deleteBankcard = (params) => mPost(`/ztb-factory/delete/factory-bank-card`, params, sconfig)
export { export {
sconfig, sconfig,
@ -120,5 +121,6 @@ export {
receiptOutOrder, receiptOutOrder,
createOutOrder, createOutOrder,
bindBankCard, bindBankCard,
postFeedback
getBankCardList,
deleteBankcard
} }

4
components/image-cropper/index.js

@ -294,9 +294,7 @@ Component({
//检查canvas是否在范围内 //检查canvas是否在范围内
this._canvasDetectionPosition(); this._canvasDetectionPosition();
//初始化完成 //初始化完成
this.triggerEvent('load', {
cropper: this
})
this.triggerEvent('load', { cropper: this })
}, },
methods: { methods: {
/** /**

1
pages/home/customer-list/index.json

@ -6,7 +6,6 @@
"van-divider": "/components/divider/index", "van-divider": "/components/divider/index",
"van-loading": "/components/loading/index", "van-loading": "/components/loading/index",
"van-icon": "/components/icon/index", "van-icon": "/components/icon/index",
"van-overlay": "/components/overlay/index",
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }

47
pages/home/employee/index.js

@ -12,15 +12,9 @@ Scene({
data: { data: {
type: 0, type: 0,
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
base64: null,
loading: true, loading: true,
checkList: [], checkList: [],
memberList: [], memberList: [],
showEmbedded: false,
show: false,
actions: [
{ id: 1, name: '删除该员工' }
],
nowIndex: -1, nowIndex: -1,
qrcode: null qrcode: null
}, },
@ -110,50 +104,9 @@ Scene({
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
console.log(err)
util.showToast(err) util.showToast(err)
}) })
}, },
onClickHideEmbedded: function(){
this.setData({ showEmbedded: false })
},
addEmployee: function(event){
wx.showLoading({ title: '加载中', mask: true })
const form = { id: 5 }
form.metaData = { factoryId: app.userInfo.factoryId, factoryName: app.userInfo.factoryName }
generateCode(form).then(result => {
this.setData({ showEmbedded: true, base64: result.data })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
saveQrcode: function(){
var fsm = wx.getFileSystemManager()
var ten = parseInt( Math.random() * 10)
var that = this
var number = Math.random().toString().replace('.', '')
fsm.writeFile({
filePath: wx.env.USER_DATA_PATH + '/qrcode' + (ten + number) + '.png',
data: that.data.base64,
encoding: 'base64',
success: res => {
wx.saveImageToPhotosAlbum({
filePath: wx.env.USER_DATA_PATH + '/qrcode' + (ten + number) + '.png',
success: function (res) {
that.setData({ showEmbedded: false })
util.showToast('保存成功')
},
fail: function (err) {
that.setData({ showEmbedded: false })
}
})
}, fail: err => {
that.setData({ showEmbedded: false })
}
})
},
onShareAppMessage: function () { onShareAppMessage: function () {
return { return {
title: '邀请您加入' + app.userInfo.factoryName, title: '邀请您加入' + app.userInfo.factoryName,

14
pages/home/employee/index.wxml

@ -61,18 +61,4 @@
</button> </button>
</view> </view>
<!-- <van-overlay show="{{ showEmbedded }}" duration="{{0}}" bind:click="onClickHideEmbedded">
<view class="wrapper flex-column" catch:tap="noop">
<view style="position: relative;background-color:white;margin-top:48px">
<van-image use-loading-slot width="525rpx" height="525rpx" src="data:image/png;base64,{{base64}}">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
<van-button block type="info" custom-style="margin-top:36rpx;width:525rpx" bind:click="saveQrcode">保存二维码
</van-button>
<text class="text-df text-white" style="margin-top:36rpx;text-align:center">为保证企业账户安全,二维码仅在3小时内有效,失效后,可重新生成。</text>
<van-icon name="close" color="white" size="36px" custom-style="margin-top:48px" catch:tap="onClickHideEmbedded" />
</view>
</van-overlay> -->
<notification id="qn-notification"/> <notification id="qn-notification"/>

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

@ -1,7 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"van-cell": "/components/cell/index", "van-cell": "/components/cell/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-switch": "/components/switch/index", "van-switch": "/components/switch/index",

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

@ -3,38 +3,36 @@
<view slot="content" style="color:black;font-size:18px">个人资料</view> <view slot="content" style="color:black;font-size:18px">个人资料</view>
</cu-custom> </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>
<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 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 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>
</van-cell> -->
<view style="height:24rpx"></view> <view style="height:24rpx"></view>
<van-cell-group> <van-cell-group>
<van-cell is-link clickable url="/pages/setting/password/index"> <van-cell is-link clickable url="/pages/setting/password/index">

9
pages/index/index.js

@ -18,7 +18,7 @@ Scene({
{ index: 3, value: 'home', badge: 0, name: '我的', blue: '/assets/tabbar/home-blue.png', gray: '/assets/tabbar/home-gray.png' } { index: 3, value: 'home', badge: 0, name: '我的', blue: '/assets/tabbar/home-blue.png', gray: '/assets/tabbar/home-gray.png' }
], ],
tabIndex: 1, tabIndex: 1,
visiable: true,
zIndex: 9,
setInter: null setInter: null
}, },
/************************************** 初始化流程 ********************************************/ /************************************** 初始化流程 ********************************************/
@ -29,7 +29,7 @@ Scene({
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate() updateManager.applyUpdate()
}) })
event.on('TabMessage', this, this.onEvent)
// event.on('TabMessage', this, this.onEvent)
this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom }) this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom })
this.data.setInter = setInterval(this.fetchMessage, 10000) this.data.setInter = setInterval(this.fetchMessage, 10000)
}, },
@ -49,7 +49,6 @@ Scene({
}, },
onEvent: function (message) { onEvent: function (message) {
if (message.what == 99) { if (message.what == 99) {
this.setData({ visiable: message.visiable })
} }
}, },
fetchMessage: function(){ fetchMessage: function(){
@ -64,8 +63,10 @@ Scene({
}).catch(err => { }).catch(err => {
}) })
}, },
onPopupChange: function({detail}){
this.setData({zIndex: detail})
},
onUnload: function(){ onUnload: function(){
event.remove('TabMessage', this)
if(this.data.setInter) { if(this.data.setInter) {
clearInterval(this.data.setInter) clearInterval(this.data.setInter)
this.data.setInter = null this.data.setInter = null

16
pages/index/index.wxml

@ -1,12 +1,18 @@
<!--pages/administ/index.wxml-->
<!--pages/index/index.wxml-->
<swiper current="{{tabIndex}}" duration="0" style="height:{{fragment}}rpx"> <swiper current="{{tabIndex}}" duration="0" style="height:{{fragment}}rpx">
<!-- <swiper-item catchtouchmove="stopTouchMove"><message id="{{tabList[0].value}}"/></swiper-item> --> <!-- <swiper-item catchtouchmove="stopTouchMove"><message id="{{tabList[0].value}}"/></swiper-item> -->
<swiper-item catchtouchmove="stopTouchMove"><agent id="{{tabList[0].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><workbench id="{{tabList[1].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><home id="{{tabList[2].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<agent id="{{tabList[0].value}}"/>
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<workbench id="{{tabList[1].value}}" bind:zIndex="onPopupChange"/>
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<home id="{{tabList[2].value}}"/>
</swiper-item>
</swiper> </swiper>
<view class="cu-bar bg-white foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx;display:{{visiable? 'block' : 'none'}}">
<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 active="{{ tabIndex }}" fixed="{{false}}" bind:change="onChange">
<van-tabbar-item wx:for="{{tabList}}" wx:key="index" > <van-tabbar-item wx:for="{{tabList}}" wx:key="index" >
<van-icon slot="icon" name="{{item.gray}}" size="25"/> <van-icon slot="icon" name="{{item.gray}}" size="25"/>

25
pages/process/index/index.js

@ -1,6 +1,7 @@
// pages/index/index.js // pages/index/index.js
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getStatisticsInfo } from "../../../api/saas" import { getStatisticsInfo } from "../../../api/saas"
import { headerFactoryId } from "../../../api/user"
import util from '../../../utils/util' import util from '../../../utils/util'
const event = require('../../../utils/event') const event = require('../../../utils/event')
const app = getApp() const app = getApp()
@ -14,6 +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),
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' },
@ -34,7 +36,8 @@ Component({
usedCreditLine: 0 usedCreditLine: 0
}, },
vdate: [], vdate: [],
vdateString: ''
vdateString: '',
visiable: false
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {
@ -84,6 +87,7 @@ Component({
wx.navigateTo({ url: '/pages/process/order-list/index' }) wx.navigateTo({ url: '/pages/process/order-list/index' })
}, },
agentList: function (e) { agentList: function (e) {
// this.showFactoryList()
wx.navigateTo({ url: '/pages/process/agent-list/index' }) wx.navigateTo({ url: '/pages/process/agent-list/index' })
}, },
checkList: function (e) { checkList: function (e) {
@ -114,7 +118,8 @@ Component({
} }
}, },
fetchStatisticsInfo: function(vdate){ fetchStatisticsInfo: function(vdate){
getStatisticsInfo({startTime: util.formatTime(new Date(vdate[0]), 'Y-M-D'), endTime: util.formatTime(new Date(vdate[1]), 'Y-M-D')}).then(result => {
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 => {
if(Number(result.data.priceOrderNum) > 0){ if(Number(result.data.priceOrderNum) > 0){
this.data.tabList[0].badge = Number(result.data.priceOrderNum) this.data.tabList[0].badge = Number(result.data.priceOrderNum)
} else { } else {
@ -166,14 +171,12 @@ Component({
}) })
}, },
showSheet: function(){ showSheet: function(){
// this.setData({ show: true })
// event.emit('TabMessage', { what: 99, visiable: false })
this.setData({ show: true })
this.triggerEvent("zIndex", -1)
}, },
onClose: function() { onClose: function() {
this.setData({ show: false }) this.setData({ show: false })
setTimeout(function(){
event.emit('TabMessage', { what: 99, visiable: true })
}, 100)
this.triggerEvent("zIndex", 9)
}, },
onSelect: function({detail}) { onSelect: function({detail}) {
const [start, end] = detail const [start, end] = detail
@ -182,6 +185,14 @@ Component({
}, },
toAuths: function(){ toAuths: function(){
wx.navigateTo({ url: '/pages/htmls/auths/index' }) wx.navigateTo({ url: '/pages/htmls/auths/index' })
},
showFactoryList: function(){
this.setData({ visiable: true })
// this.$emit("zIndex", -1)
},
onClickHide: function(){
this.setData({ visiable: false })
// this.$emit("zIndex", 9)
} }
} }
}) })

6
pages/process/index/index.wxml

@ -139,4 +139,8 @@
</scroll-view> </scroll-view>
<!-- <van-action-sheet show="{{ show }}" actions="{{ actions }}" bind:close="onClose" bind:select="onSelect" z-index="22"/> --> <!-- <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>

4
pages/settlement/bank-list/index.js

@ -1,7 +1,7 @@
// pages/message/detail/index.js // pages/message/detail/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getBankCardList, deleteBankcard } from "../../../api/payment"
import { getBankCardList, deleteBankcard } from "../../../api/saas"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event') const event = require('../../../utils/event')
const app = getApp() const app = getApp()
@ -61,7 +61,7 @@ Scene({
Dialog.confirm({ title: '温馨提示', message: '确定删除该银行卡?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定删除该银行卡?' }).then(() => {
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
var item = this.data.bankList[this.data.nowIndex] var item = this.data.bankList[this.data.nowIndex]
deleteBankcard(item.id).then(res => {
deleteBankcard({id: item.id}).then(res => {
wx.hideLoading() wx.hideLoading()
util.showToast('解除成功') util.showToast('解除成功')
this.data.bankList.splice(this.data.nowIndex, 1); this.data.bankList.splice(this.data.nowIndex, 1);

Loading…
Cancel
Save