Browse Source

no message

feature/v1.1
xpz2018 5 years ago
parent
commit
1c8ab144b8
12 changed files with 37 additions and 107 deletions
  1. 2
      app.js
  2. 2
      components/cell/index.wxml
  3. 47
      components/pdf-image/index.js
  4. 6
      components/pdf-image/index.json
  5. 19
      components/pdf-image/index.wxml
  6. 0
      components/pdf-image/index.wxss
  7. 2
      components/tabs/index.wxss
  8. 8
      pages/client/order-list/index.wxml
  9. 1
      pages/home/customer-list/index.wxml
  10. 21
      pages/home/employee/index.js
  11. 28
      pages/home/index/index.wxml
  12. 8
      pages/process/order-list/index.wxml

2
app.js

@ -1,6 +1,6 @@
//app.js //app.js
App({ App({
evn: 2, // 0: 开发版本;1:测试版本;2:生产版本
evn: 0, // 0: 开发版本;1:测试版本;2:生产版本
tmplIds: [''], tmplIds: [''],
version: 152, version: 152,
xAppId: '503258978847953926', xAppId: '503258978847953926',

2
components/cell/index.wxml

@ -1,7 +1,7 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view <view
class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: clickable }]) }}"
hover-class="van-cell--hover hover-class" hover-stay-time="70" style="{{ customStyle }}" bind:tap="onClick"> hover-class="van-cell--hover hover-class" hover-stay-time="70" style="{{ customStyle }}" bind:tap="onClick">
<van-icon wx:if="{{ icon }}" name="{{ icon }}" class="van-cell__left-icon-wrap" custom-class="van-cell__left-icon" /> <van-icon wx:if="{{ icon }}" name="{{ icon }}" class="van-cell__left-icon-wrap" custom-class="van-cell__left-icon" />
<slot wx:else name="icon" /> <slot wx:else name="icon" />

47
components/pdf-image/index.js

@ -1,47 +0,0 @@
const util = require('../../utils/util') //导入模块
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
src: {
type: String,
value: ''
},
width: {
type: Number,
value: 80
},
height: {
type: Number,
value: 80
},
imageList: {
type: Array,
value: []
}
},
observers: {
'imageList': function () {
for (let index = 0; index < this.data.imageList.length; index++) {
if(!this.isPdfUrl(this.data.imageList[index])){
this.setData({ src: this.data.imageList[index] })
break
}
}
if(util.isEmpty(this.data.src)){
this.setData({ src: this.data.imageList[0] })
}
}
},
methods: {
isPdfUrl: function (url) {
if (url && (url.indexOf('.pdf') >= 0 || url.indexOf('.PDF') >= 0)) {
return true
}
return false
}
}
})

6
components/pdf-image/index.json

@ -1,6 +0,0 @@
{
"component": true,
"usingComponents": {
"van-image": "/components/image/index"
}
}

19
components/pdf-image/index.wxml

@ -1,19 +0,0 @@
<van-image width="{{width}}" height="{{height}}" src="{{src}}" fit="cover" lazy-load radius="6" wx:if="{{checkImage(src)}}"></van-image>
<van-image width="{{width}}" height="{{height}}" src="/assets/image/icon_pdf.svg" lazy-load radius="6" fit="cover" wx:else></van-image>
<wxs module="checkImage">
function checkImage(url) {
if(typeof url === 'undefined' || url === '' || url === null){
return true
}
if (url.indexOf('.png') >= 0 || url.indexOf('.PNG') >= 0) {
return true
} else if (url.indexOf('.jpg') >= 0 || url.indexOf('.JPG') >= 0) {
return true
} else if (url.indexOf('.jpeg') >= 0 || url.indexOf('.JPEG') >= 0) {
return true
}
return false
}
module.exports = checkImage
</wxs>

0
components/pdf-image/index.wxss

2
components/tabs/index.wxss

@ -1 +1 @@
@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{display:-webkit-flex;display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll{background-color:#fff;background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{margin:0 16px;margin:0 var(--padding-md,16px)}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:30px;height:var(--tabs-card-height,30px);border:1px solid #ee0a24;border:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24);border-radius:2px;border-radius:var(--border-radius-sm,2px)}.van-tabs__nav--card .van-tab{color:#ee0a24;color:var(--tabs-default-color,#ee0a24);line-height:28px;line-height:calc(var(--tabs-card-height, 30px) - 2*var(--border-width-base, 1px));border-right:1px solid #ee0a24;border-right:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;color:var(--white,#fff);background-color:#ee0a24;background-color:var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;height:var(--tabs-bottom-bar-height,3px);border-radius:3px;border-radius:var(--tabs-bottom-bar-height,3px);background-color:#ee0a24;background-color:var(--tabs-bottom-bar-color,#ee0a24)}.van-tabs__track{position:relative;width:100%;height:100%}.van-tabs__track--animated{display:-webkit-flex;display:flex;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:88rpx;height:var(--tabs-line-height,88rpx)}.van-tabs--card .van-tabs__wrap{height:30px;height:var(--tabs-card-height,30px)}.van-tab{position:relative;-webkit-flex:1;flex:1;box-sizing:border-box;min-width:0;padding:0 5px;text-align:center;cursor:pointer;color:#646566;color:var(--tab-text-color,#646566);font-size:14px;font-size:var(--tab-font-size,14px);line-height:88rpx;line-height:var(--tabs-line-height,88rpx)}.van-tab--active{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--tab-active-text-color,#323233)}.van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab--complete{-webkit-flex:1 0 auto!important;flex:1 0 auto!important}.van-tab__title__info{top:8px!important;right:10px;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important}
@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{display:-webkit-flex;display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll{background-color:#fff;background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{margin:0 16px;margin:0 var(--padding-md,16px)}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:30px;height:var(--tabs-card-height,30px);border:1px solid #ee0a24;border:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24);border-radius:2px;border-radius:var(--border-radius-sm,2px)}.van-tabs__nav--card .van-tab{color:#ee0a24;color:var(--tabs-default-color,#ee0a24);line-height:28px;line-height:calc(var(--tabs-card-height, 30px) - 2*var(--border-width-base, 1px));border-right:1px solid #ee0a24;border-right:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;color:var(--white,#fff);background-color:#ee0a24;background-color:var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;height:var(--tabs-bottom-bar-height,3px);border-radius:3px;border-radius:var(--tabs-bottom-bar-height,3px);background-color:#ee0a24;background-color:var(--tabs-bottom-bar-color,#ee0a24)}.van-tabs__track{position:relative;width:100%;height:100%}.van-tabs__track--animated{display:-webkit-flex;display:flex;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:90rpx;height:var(--tabs-line-height,90rpx)}.van-tabs--card .van-tabs__wrap{height:30px;height:var(--tabs-card-height,30px)}.van-tab{position:relative;-webkit-flex:1;flex:1;box-sizing:border-box;min-width:0;padding:0 5px;text-align:center;cursor:pointer;color:#646566;color:var(--tab-text-color,#646566);font-size:14px;font-size:var(--tab-font-size,14px);line-height:90rpx;line-height:var(--tabs-line-height,90rpx)}.van-tab--active{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--tab-active-text-color,#323233)}.van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab--complete{-webkit-flex:1 0 auto!important;flex:1 0 auto!important}.van-tab__title__info{top:8px!important;right:10px;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important}

8
pages/client/order-list/index.wxml

@ -3,11 +3,9 @@
<view slot="content">订单列表</view> <view slot="content">订单列表</view>
</cu-custom> </cu-custom>
<view class="bg-white" style="height:90rpx;" wx:if="{{tabList.length}}">
<van-tabs sticky active="{{tabIndex}}" color="#008AFF" bind:change="onTabChange" line-height="2px" swipe-threshold="6">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.name}}" title-style="color:{{tabIndex==index?'#008AFF':'#333333'}}"></van-tab>
</van-tabs>
</view>
<van-tabs sticky active="{{tabIndex}}" color="#008AFF" bind:change="onTabChange" line-height="2px" swipe-threshold="5">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.name}}" title-style="color:{{tabIndex==index?'#008AFF':'#333333'}}"></van-tab>
</van-tabs>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> <view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">

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

@ -47,6 +47,7 @@
<text class="text-blue">{{customerName}}</text> <text class="text-blue">{{customerName}}</text>
<text>邀请注册纸通宝</text> <text>邀请注册纸通宝</text>
</text> </text>
<text class="text-df text-white" style="text-align:center">请让客户使用微信进行扫码</text>
<van-icon name="close" color="white" size="36px" custom-style="margin-top:48px" catch:tap="onClickHideEmbedded" /> <van-icon name="close" color="white" size="36px" custom-style="margin-top:48px" catch:tap="onClickHideEmbedded" />
</view> </view>
</van-overlay> </van-overlay>

21
pages/home/employee/index.js

@ -52,20 +52,27 @@ Page({
}) })
}, },
lookItem: function(e){ lookItem: function(e){
this.data.nowIndex = e.currentTarget.dataset.index
this.setData({ show: true })
},
showSheet: function(){
this.setData({ show: true })
this.data.nowIndex = e.currentTarget.dataset.index
var item = this.data.memberList[this.data.nowIndex]
if(item.position == 'ADMINISTRATOR'){
this.setData({ actions: [ { id: 1, name: '删除该员工' } ], show: true })
} else [
this.setData({ actions: [ { id: 2, name: '设为管理员' }, { id: 1, name: '删除该员工' } ], show: true })
]
}, },
onClose() { onClose() {
this.setData({ show: false }) this.setData({ show: false })
this.data.nowIndex = -1
}, },
onSelect({detail}) { onSelect({detail}) {
if(detail.id === 1){ if(detail.id === 1){
var item = this.data.memberList[this.data.nowIndex]
var item = this.data.memberList[this.data.nowIndex]
this.deleteItem(this.data.nowIndex, item) this.deleteItem(this.data.nowIndex, item)
this.data.nowIndex = -1 this.data.nowIndex = -1
} else if(detail.id === 2){
var item = this.data.memberList[this.data.nowIndex]
this.setAdmin(this.data.nowIndex, item)
this.data.nowIndex = -1
} }
}, },
setAdmin: function(index, item){ setAdmin: function(index, item){
@ -94,7 +101,7 @@ Page({
}, },
deleteItem: function(index, item){ deleteItem: function(index, item){
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
deleteEmploye({idList: [item.id] }).then(result => {
deleteEmploye({idList: [item.enterpriseMemberId] }).then(result => {
this.fetchMemberList() this.fetchMemberList()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()

28
pages/home/index/index.wxml

@ -5,29 +5,27 @@
<scroll-view scroll-y style="height:{{height}}rpx;"> <scroll-view scroll-y style="height:{{height}}rpx;">
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="bg-white flex flex-justify" style="padding:32rpx" wx:if="{{userInfo}}" bindtap="toUserInfo">
<view class="flex">
<view style="position: relative">
<van-image use-loading-slot width="60" height="60" lazy-load round src="{{avatarUrl}}">
<image class="image-load" slot="loading" src="/assets/image/ygImg.png"></image>
</van-image>
<view class="cu-tag badge cuIcon-vip bg-blue" style="font-size:24rpx" wx:if="{{userInfo.isVIP}}"></view>
</view>
<van-cell center is-link clickable="{{false}}" border="{{false}}" wx:if="{{userInfo}}" bind:click="toUserInfo">
<view class="flex" slot="title" style="align-items: center">
<van-image use-loading-slot width="60" height="60" lazy-load round src="{{avatarUrl}}">
<image class="image-load" slot="loading" src="/assets/image/ygImg.png"></image>
</van-image>
<!-- <image class="image-load" slot="loading" src="/assets/image/ygImg.png"></image> -->
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start"> <view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start">
<view class="flex flex-center"> <view class="flex flex-center">
<text class="text-lg" style="white-space: nowrap">{{userName || ''}}</text> <text class="text-lg" style="white-space: nowrap">{{userName || ''}}</text>
<text class="text-lg" style="white-space: nowrap">({{userInfo.position != 'ORDINARY' ? '管理员' : '员工'}})</text>
<view class="flex flex-center" style="font-size:12px;margin-left:18rpx"> <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="{{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> <text class="text-yellow" style="font-size:14px;padding:4px;" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text>
</view> </view>
</view> </view>
<view class="flex flex-center" style="font-size:12px;margin-top:12rpx">
<view class="flex flex-center" style="font-size:12px">
<text class="text-black" style="font-size:14px">{{userInfo.mobile || ''}}</text> <text class="text-black" style="font-size:14px">{{userInfo.mobile || ''}}</text>
</view> </view>
</view> </view>
</view> </view>
<text class="cuIcon-right text-gray" style="font-size:18px"></text>
</view>
</van-cell>
<!-- 授信信息 --> <!-- 授信信息 -->
<view class="bg-white" style="margin-top: 16rpx"> <view class="bg-white" style="margin-top: 16rpx">
<view class="flex" style="padding: 20rpx 32rpx"> <view class="flex" style="padding: 20rpx 32rpx">
@ -51,13 +49,13 @@
<!-- 企业信息 --> <!-- 企业信息 -->
<view style="height:16rpx"></view> <view style="height:16rpx"></view>
<van-cell-group> <van-cell-group>
<van-cell is-link link-type="navigateTo" url="/pages/home/employee/index" wx:if="{{userInfo.enterpriseId && userInfo.position != 'ORDINARY'}}">
<van-cell is-link clickable url="/pages/home/employee/index" wx:if="{{userInfo.enterpriseId && userInfo.position != 'ORDINARY'}}">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<van-icon name="manager-o" size="18"/> <van-icon name="manager-o" size="18"/>
<text class="text-sg" style="margin-left:12rpx">员工管理</text> <text class="text-sg" style="margin-left:12rpx">员工管理</text>
</view> </view>
</van-cell> </van-cell>
<van-cell is-link link-type="navigateTo" url="/pages/home/customer-list/index">
<van-cell is-link clickable url="/pages/home/customer-list/index">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<van-icon name="user-circle-o" size="20"/> <van-icon name="user-circle-o" size="20"/>
<text class="text-sg" style="margin-left:12rpx">客户管理</text> <text class="text-sg" style="margin-left:12rpx">客户管理</text>
@ -72,13 +70,13 @@
</van-cell-group> </van-cell-group>
<view style="height:16rpx"></view> <view style="height:16rpx"></view>
<van-cell-group> <van-cell-group>
<van-cell is-link link-type="navigateTo" url="/pages/home/password/index">
<van-cell is-link clickable url="/pages/home/password/index">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<text class="cuIcon-lock text-black" style="font-size:36rpx"></text> <text class="cuIcon-lock text-black" style="font-size:36rpx"></text>
<text class="text-sg" style="margin-left:12rpx">修改密码</text> <text class="text-sg" style="margin-left:12rpx">修改密码</text>
</view> </view>
</van-cell> </van-cell>
<van-cell is-link bind:click="loginOut">
<van-cell is-link clickable bind:click="loginOut">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<van-icon name="setting-o" size="18" /> <van-icon name="setting-o" size="18" />
<text class="text-sg" style="margin-left:12rpx">退出当前账号</text> <text class="text-sg" style="margin-left:12rpx">退出当前账号</text>

8
pages/process/order-list/index.wxml

@ -3,11 +3,9 @@
<view slot="content">{{title}}</view> <view slot="content">{{title}}</view>
</cu-custom> </cu-custom>
<view class="bg-white" style="height:90rpx;" wx:if="{{tabList.length}}">
<van-tabs sticky active="{{tabIndex}}" color="#008AFF" bind:change="onTabChange" line-height="2px" swipe-threshold="4">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.name}}" title-style="color:{{tabIndex==index?'#008AFF':'#333333'}}"></van-tab>
</van-tabs>
</view>
<van-tabs sticky active="{{tabIndex}}" color="#008AFF" bind:change="onTabChange" line-height="2px" swipe-threshold="4">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.name}}" title-style="color:{{tabIndex==index?'#008AFF':'#333333'}}"></van-tab>
</van-tabs>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> <view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">

Loading…
Cancel
Save