33 changed files with 389 additions and 189 deletions
Split View
Diff Options
-
12api/saas.js
-
2api/user.js
-
4app.json
-
42pages/home/customer-info/index.js
-
3pages/home/customer-info/index.json
-
62pages/home/customer-info/index.wxml
-
44pages/home/customer-list/index.js
-
2pages/home/customer-list/index.wxml
-
3pages/home/employee/index.js
-
24pages/home/index/index.wxml
-
33pages/home/mobile/index.js
-
11pages/home/mobile/index.wxml
-
5pages/home/mobile/index.wxss
-
2pages/home/password/index.js
-
2pages/home/setting/index.js
-
2pages/home/setting/index.wxml
-
5pages/login/index.js
-
66pages/manager/index/index.js
-
2pages/manager/index/index.wxml
-
1pages/manager/index/index.wxss
-
2pages/process/payment/index.wxml
-
44pages/setting/index/index.js
-
10pages/setting/index/index.json
-
28pages/setting/index/index.wxml
-
1pages/setting/index/index.wxss
-
20pages/setting/paper-detial/index.js
-
0pages/setting/paper-detial/index.json
-
4pages/setting/paper-detial/index.wxml
-
1pages/setting/paper-detial/index.wxss
-
77pages/setting/paper/index.js
-
9pages/setting/paper/index.json
-
33pages/setting/paper/index.wxml
-
22pages/setting/paper/index.wxss
@ -1,61 +1,23 @@ |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">客户资料</view> |
|||
</cu-custom> |
|||
<view wx:if="{{form}}"> |
|||
<!-- <van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="点击可以修改用户信息" /> --> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">客户姓名</view> |
|||
<view class="text-gray">{{form.name}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">手机号码</view> |
|||
<view class="text-gray">{{form.mobile}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">付款方式</view> |
|||
<view class="text-gray">{{form.defaultPaymentMethod == 2 ? '转账' : '现金'}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell wx:if="{{form.bankName}}"> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">银行名称</view> |
|||
<view class="text-gray">{{form.bankName}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell wx:if="{{form.bankCardNo}}"> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">银行卡号</view> |
|||
<view class="text-gray">{{form.bankCardNo}}</view> |
|||
</view> |
|||
</van-cell> |
|||
|
|||
<view wx:if="{{form}}"> |
|||
<van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="点击可以修改用户信息" /> |
|||
<van-field id="name" value="{{ form.name }}" label="客户姓名:" placeholder="请输入客户姓名" bind:input="bindInput"/> |
|||
<van-field id="mobile" value="{{ form.mobile }}" type="number" label="手机号码:" placeholder="请输入手机号码" bind:input="bindInput"/> |
|||
<van-field value="{{form.defaultPaymentMethod == 2 ? '转账' : '现金'}}" readonly label="付款方式:" is-link bindtap="chooseMethod" /> |
|||
<van-field id="bankName" value="{{ form.bankName }}" label="银行名称:" placeholder="请输入银行名称" bind:input="bindInput" wx:if="{{form.defaultPaymentMethod == 2}}"/> |
|||
<van-field id="bankBranchName" value="{{ form.bankBranchName }}" label="开户行:" placeholder="请输入开户行" bind:input="bindInput" wx:if="{{form.defaultPaymentMethod == 2}}"/> |
|||
<van-field id="bankCardNo" value="{{ form.bankCardNo }}" label="银行卡号:" placeholder="请输入银行卡号" bind:input="bindInput" wx:if="{{form.defaultPaymentMethod == 2}}"/> |
|||
|
|||
<view style="height:32rpx"></view> |
|||
<view style="margin-top:20rpx;padding:48rpx 32rpx"> |
|||
<van-button block type="primary" bind:click="registCustomer" wx:if="{{!form.userId}}">邀请注册纸通宝</van-button> |
|||
<!-- <view style="height:32rpx" wx:if="{{!form.userId}}"></view> |
|||
<van-button block type="info" bind:click="submitForm">保存</van-button> --> |
|||
<view style="height:36rpx" wx:if="{{!form.userId}}"></view> |
|||
<van-button block type="info" bind:click="submitForm">保存</van-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> |
|||
<text class="text-df text-white" style="margin-top:36rpx;text-align:center"> |
|||
<text>邀请</text> |
|||
<text class="text-blue">{{customerName}}</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" /> |
|||
</view> |
|||
</van-overlay> |
|||
<van-action-sheet show="{{ show }}" actions="{{ actions }}" bind:cancel="onClose" bind:close="onClose" bind:select="onSelect" cancel-text="取消" z-index="22"/> |
|||
@ -1,4 +1 @@ |
|||
/* pages/home/mobile/index.wxss */ |
|||
page { |
|||
background-color: #fff; |
|||
} |
|||
/* pages/home/mobile/index.wxss */ |
|||
@ -1,66 +0,0 @@ |
|||
// pages/manager/index/index.js
|
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -1,2 +0,0 @@ |
|||
<!--pages/manager/index/index.wxml--> |
|||
<text>pages/manager/index/index.wxml</text> |
|||
@ -1 +0,0 @@ |
|||
/* pages/manager/index/index.wxss */ |
|||
@ -0,0 +1,44 @@ |
|||
// pages/home/setting/index.js
|
|||
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() |
|||
|
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
agenting: true |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
var agenting = storage.get('saas-agenting') |
|||
if(!util.isEmpty(agenting)){ |
|||
app.globalData.agenting = agenting |
|||
} |
|||
this.setData({ agenting: app.globalData.agenting ? true : false }) |
|||
}, |
|||
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 => { |
|||
}) |
|||
} |
|||
}) |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"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-dialog": "/components/dialog/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
<!--pages/home/setting/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content" style="color:black;font-size:18px">设置</view> |
|||
</cu-custom> |
|||
|
|||
<view style="height:24rpx"></view> |
|||
<van-cell-group> |
|||
<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/home/password/index"> |
|||
<view class="flex" slot="title" style="align-items: center"> |
|||
<text class="text-sg">修改密码</text> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell is-link clickable bind:click="loginOut"> |
|||
<view class="flex" slot="title" style="align-items: center"> |
|||
<text class="text-sg">退出当前账号</text> |
|||
</view> |
|||
</van-cell> |
|||
</van-cell-group> |
|||
|
|||
<van-dialog id="van-dialog" /> |
|||
@ -0,0 +1 @@ |
|||
/* pages/home/setting/index.wxss */ |
|||
@ -0,0 +1,20 @@ |
|||
// pages/setting/paper-detial/index.js
|
|||
import { getPaperInfo, savePaperPrice, editPaperPrice, delePaperPrice } from "../../../api/saas" |
|||
const event = require('../../../utils/event') |
|||
const util = require('../../../utils/util') |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,4 @@ |
|||
<!--pages/setting/paper-detial/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content" style="color:black;font-size:18px">纸品详情</view> |
|||
</cu-custom> |
|||
@ -0,0 +1 @@ |
|||
/* pages/setting/paper-detial/index.wxss */ |
|||
@ -0,0 +1,77 @@ |
|||
// pages/process/order-list/index.js
|
|||
import { getPaperPrice } from "../../../api/saas" |
|||
const event = require('../../../utils/event') |
|||
const util = require('../../../utils/util') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
// * 页面的初始数据
|
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
top: 0, |
|||
orderList: [], |
|||
form: { |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
} |
|||
}, |
|||
// * 生命周期函数--监听页面加载
|
|||
onLoad: function (options) { |
|||
event.on('OrderMessage', this, this.onEvent) |
|||
this.setData({ height: app.globalData.fragmentHeight }) |
|||
this.fetchOrderList() |
|||
}, |
|||
onEvent: function(message){ |
|||
if (message.what == 12) { |
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ orderList: [], ['form.pageNum']: 1, loading: true, finished: false }) |
|||
this.data.lastTime = null |
|||
this.fetchOrderList() |
|||
}, |
|||
//1:待定价,2:待过皮重,3:待过磅审核,4:待付款,5:已完成
|
|||
fetchOrderList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getPaperPrice(this.data.form).then(result => { |
|||
if (result.data && result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total |
|||
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false }) |
|||
} else { |
|||
this.setData({ finished: true, requesting: false, loading: false }) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ requesting: false, loading: false }) |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem: function (e) { |
|||
if(e.currentTarget.dataset.page >= 0){ |
|||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|||
wx.navigateTo({ url: `/pages/setting/paper-detial/index?id=${item.id}` }) |
|||
} else { |
|||
wx.navigateTo({ url: `/pages/setting/paper-detial/index` }) |
|||
} |
|||
}, |
|||
onUnload: function(){ |
|||
event.remove('OrderMessage', this) |
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,9 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"refresh-view": "/components/refresher/index", |
|||
"van-button": "/components/button/index", |
|||
"van-cell": "/components/cell/index", |
|||
"van-divider": "/components/divider/index", |
|||
"van-loading": "/components/loading/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
<!--pages/setting/paper/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content" style="color:black;font-size:18px">纸品管理</view> |
|||
</cu-custom> |
|||
|
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" bind:scrolltolower="fetchOrderList"> |
|||
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> |
|||
<view style="margin-bottom:24px" wx:if="{{loading}}"> |
|||
<van-loading type="spinner" size="32" /> |
|||
</view> |
|||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<van-cell center clickable is-link wx:for="{{pageItem}}" wx:key="index"> |
|||
<view slot="title" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|||
<view class="text-sg text-bold">{{item.productName || ''}}</view> |
|||
<view class="text-sm text-gray" style="line-height: 24rpx">单价范围(元/公斤):{{item.defaultUnitPrice}} - {{item.highestUnitPrice}}</view> |
|||
</view> |
|||
</van-cell> |
|||
</view> |
|||
<!--加载更多的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> |
|||
|
|||
<view class="booking-tool" style="bottom:200rpx" bindtap="lookItem"> |
|||
<view class="roder-add flex flex-center"> |
|||
<text class="cuIcon-add text-white" style="font-size:32px"></text> |
|||
</view> |
|||
</view> |
|||
@ -0,0 +1,22 @@ |
|||
/* pages/setting/paper/index.wxss */ |
|||
.booking-tool { |
|||
width: calc(100% - 20px); |
|||
background-color: #008AFF; |
|||
position: fixed; |
|||
bottom: 150px; |
|||
left: 25px; |
|||
} |
|||
|
|||
.roder-add { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
background-color: #008AFF; |
|||
border-radius: 50rpx; |
|||
position: absolute; |
|||
top: 24px; |
|||
right: 24px; |
|||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save