Browse Source

no message

feature/v1.2
xpz2018 5 years ago
parent
commit
fe2628fde8
33 changed files with 389 additions and 189 deletions
  1. 12
      api/saas.js
  2. 2
      api/user.js
  3. 4
      app.json
  4. 42
      pages/home/customer-info/index.js
  5. 3
      pages/home/customer-info/index.json
  6. 62
      pages/home/customer-info/index.wxml
  7. 44
      pages/home/customer-list/index.js
  8. 2
      pages/home/customer-list/index.wxml
  9. 3
      pages/home/employee/index.js
  10. 24
      pages/home/index/index.wxml
  11. 33
      pages/home/mobile/index.js
  12. 11
      pages/home/mobile/index.wxml
  13. 5
      pages/home/mobile/index.wxss
  14. 2
      pages/home/password/index.js
  15. 2
      pages/home/setting/index.js
  16. 2
      pages/home/setting/index.wxml
  17. 5
      pages/login/index.js
  18. 66
      pages/manager/index/index.js
  19. 2
      pages/manager/index/index.wxml
  20. 1
      pages/manager/index/index.wxss
  21. 2
      pages/process/payment/index.wxml
  22. 44
      pages/setting/index/index.js
  23. 10
      pages/setting/index/index.json
  24. 28
      pages/setting/index/index.wxml
  25. 1
      pages/setting/index/index.wxss
  26. 20
      pages/setting/paper-detial/index.js
  27. 0
      pages/setting/paper-detial/index.json
  28. 4
      pages/setting/paper-detial/index.wxml
  29. 1
      pages/setting/paper-detial/index.wxss
  30. 77
      pages/setting/paper/index.js
  31. 9
      pages/setting/paper/index.json
  32. 33
      pages/setting/paper/index.wxml
  33. 22
      pages/setting/paper/index.wxss

12
api/saas.js

@ -11,6 +11,7 @@ const sconfig = {
// *****************************************账户业务**********************************************
const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, sconfig)
const getUserInfo = () => mGet(`/recycle-user-center/user/get/user-info`, null, sconfig)
const getEmployeList = (params) => mGet(`/recycle-user-center/get/self-department-member-list`, params, sconfig)
const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig)
const getStatisticsInfo = (params) => mGet(`/ztb-factory/get/my-workbench-statistics-info`, params, sconfig)
const bindingAdmin = (params) => mPost(`/recycle-user-center/bind/factory-admin`, params, sconfig)
@ -29,8 +30,10 @@ const getFactoryOrderList = (params) => mGet(`/ztb-factory/factory/wechat-applet
const getFactoryOrderInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/order-detail/${id}`, null, sconfig)
const getPaperList = (params) => mGet(`/ztb-factory/factory/get/all-product`, params, sconfig)
const getPaperPrice = (params) => mGet(`/ztb-factory/factory/get/product-price-list`, params, sconfig)
const getPaperInfo = (id) => mGet(`/ztb-factory/factory/get/product-price/${id}`, null, sconfig)
const savePaperPrice = (params) => mPost(`/ztb-factory/factory/save/product-price`, params, sconfig)
const updatePaperPrice = (params) => mPost(`/ztb-factory/factory/update/product-price`, params, sconfig)
const editPaperPrice = (params) => mPost(`/ztb-factory/factory/edit/product-price`, params, sconfig)
const delePaperPrice = (id) => mPost(`/ztb-factory/factory/delete/product-price/${id}`, null, sconfig)
const getCustomerList = (params) => mGet(`/ztb-factory/factory/get/customer-list`, params, sconfig)
const editCustomer = (params) => mPost(`/ztb-factory/factory/edit/customer`, params, sconfig)
const deleteCustomer = (id) => mPost(`/ztb-factory/factory/delete/customer/${id}`, null, sconfig)
@ -58,8 +61,10 @@ export {
paymentOrder,
cancelOrder,
getPaperPrice,
getPaperInfo,
savePaperPrice,
updatePaperPrice,
editPaperPrice,
delePaperPrice,
getCustomerList,
editCustomer,
deleteCustomer,
@ -69,5 +74,6 @@ export {
getPaperList,
repeatOrder,
getStatisticsInfo,
getCustomerOrderList
getCustomerOrderList,
getEmployeList
}

2
api/user.js

@ -26,7 +26,6 @@ const generateCode = (params) => mPost('/uec/generate/qrcode', params, config)
const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config)
const applyEmplyee = (params) => mPost(`/uec/apply/to/be/employee/of/enterprise-department`, params, config)
const getCheckList = (params) => mGet(`/uec/get/employee-joining-department-application-list`, params, config)
const getEmployeList = (params) => mGet(`/uec/get/self-department-member-list`, params, config)
const auditEmploye = (params) => mPost(`/uec/audit/employee-joining-department-application`, params, config)
const deleteEmploye = (params) => mPost(`/uec/remove/employees`, params, config)
const adminEmploye = (params) => mPost(`/uec/grant/admin-role/to/employees`, params, config)
@ -203,7 +202,6 @@ export {
generateCode,
applyEmplyee,
getCheckList,
getEmployeList,
auditEmploye,
deleteEmploye,
adminEmploye

4
app.json

@ -21,7 +21,9 @@
"pages/htmls/auths/index",
"pages/message/detail/index",
"pages/storage/index/index",
"pages/manager/index/index",
"pages/setting/index/index",
"pages/setting/paper/index",
"pages/setting/paper-detial/index",
"pages/client/index/index",
"pages/client/registe/index",
"pages/client/home/index",

42
pages/home/customer-info/index.js

@ -1,6 +1,7 @@
// pages/home/customer-info/index.js
import { getCustomerInfo } from "../../../api/saas"
import { getCustomerInfo, editCustomer } from "../../../api/saas"
const util = require('../../../utils/util')
const event = require('../../../utils/event')
Page({
/**
@ -8,9 +9,11 @@ Page({
*/
data: {
form: null,
base64: null,
showEmbedded: false,
customerName: ''
show: false,
actions: [
{ id: 2, name: '转账' },
{ id: 1, name: '现金' }
],
},
/**
* 生命周期函数--监听页面加载
@ -27,10 +30,37 @@ Page({
})
}
},
onClickHideEmbedded: function(){
this.setData({ showEmbedded: false })
bindInput: function(e){
this.data.form[e.currentTarget.id] = e.detail
},
chooseMethod: function(){
this.setData({ show: true })
},
onClose: function() {
this.setData({ show: false })
},
onSelect: function({detail}) {
this.setData({ ['form.defaultPaymentMethod']: detail.id })
},
registCustomer: function(){
wx.navigateTo({ url: `/pages/client/registe/index?id=${this.data.form.id}` })
},
submitForm: function(){
if (util.isEmpty(this.data.form.name)) {
util.showToast('请输入客户姓名')
return
}
if (util.isEmpty(this.data.form.defaultPaymentMethod)) {
this.data.form.defaultPaymentMethod = 1
}
wx.showLoading({ title: '正在获取', mask: true })
editCustomer(this.data.form).then(result => {
wx.hideLoading()
util.showBackToast('修改成功')
event.emit('EventMessage', { what: 102, detail: this.data.form })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
})

3
pages/home/customer-info/index.json

@ -2,10 +2,11 @@
"usingComponents": {
"van-button": "/components/button/index",
"van-cell": "/components/cell/index",
"van-field": "/components/field/index",
"van-loading": "/components/loading/index",
"van-image": "/components/image/index",
"van-icon": "/components/icon/index",
"van-overlay": "/components/overlay/index",
"van-action-sheet": "/components/action-sheet/index",
"van-notice-bar": "/components/notice-bar/index"
}
}

62
pages/home/customer-info/index.wxml

@ -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"/>

44
pages/home/customer-list/index.js

@ -1,6 +1,7 @@
// pages/home/customer/index.js
import { getCustomerList } from "../../../api/saas"
const util = require('../../../utils/util')
const event = require('../../../utils/event')
const app = getApp()
Page({
@ -19,17 +20,22 @@ Page({
pageNum: 1,
pageSize: 10
},
// base64: null,
// showEmbedded: false,
customerName: ''
page: 0,
index: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight - 100 })
event.on('EventMessage', this, this.onEvent)
this.fetchCustomerList()
},
onEvent: function(message){
if (message.what == 102) {
this.setData({ [`orderList[${this.data.page}][${this.data.index}]`]: message.detail })
}
},
onRefreshList: function () {
if (this.data.requesting) {
return
@ -54,22 +60,9 @@ Page({
var num = this.data.form.pageNum
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total
if(this.data.form.pageNum == 1){
this.setData({
[nowList]: respList,
['form.pageNum']: (num + 1),
top: 0,
finished,
requesting: false,
loading: false
})
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), top: 0, finished, requesting: false, loading: false })
} else {
this.setData({
[nowList]: respList,
['form.pageNum']: (num + 1),
finished,
requesting: false,
loading: false
})
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
}
} else {
this.setData({ finished: true, requesting: false, loading: false })
@ -79,20 +72,23 @@ Page({
util.showToast(err)
})
},
onChange({detail}) {
onChange: function({detail}) {
this.data.form.name = detail
},
onSearch:function(){
onSearch: function(){
this.onRefreshList()
},
customerInfo: function(e){
wx.navigateTo({ url: '/pages/home/customer-info/index?id=' + e.currentTarget.dataset.id })
this.data.page = e.currentTarget.dataset.page
this.data.index = e.currentTarget.dataset.index
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
wx.navigateTo({ url: `/pages/home/customer-info/index?id=${item.id}` })
},
// onClickHideEmbedded: function(){
// this.setData({ showEmbedded: false })
// },
bindCustomer: function(e){
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
wx.navigateTo({ url: `/pages/client/registe/index?id=${item.id}` })
},
onUnload: function(){
event.remove('EventMessage', this)
}
})

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

@ -17,7 +17,7 @@
</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<van-cell clickable wx:for="{{pageItem}}" wx:key="index">
<view slot="title" class="flex flex-justify" data-id="{{item.id}}" bindtap="customerInfo">
<view slot="title" class="flex flex-justify" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="customerInfo">
<van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" />
<view style="margin-left:18rpx;width:100%;flex:1">
<view class="text-sg text-bold">{{item.name || ''}}</view>

3
pages/home/employee/index.js

@ -1,5 +1,6 @@
// pages/home/employee/index.js
import { getCheckList, getEmployeList, auditEmploye, adminEmploye, deleteEmploye, generateCode } from "../../../api/user"
import { getCheckList, auditEmploye, adminEmploye, deleteEmploye, generateCode } from "../../../api/user"
import { getEmployeList } from "../../../api/saas"
const util = require('../../../utils/util')
const app = getApp()

24
pages/home/index/index.wxml

@ -61,6 +61,12 @@
<text class="text-sg" style="margin-left:12rpx">客户管理</text>
</view>
</van-cell>
<van-cell is-link clickable url="/pages/setting/paper/index">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="records" size="20"/>
<text class="text-sg" style="margin-left:12rpx">纸品管理</text>
</view>
</van-cell>
<!-- <van-cell is-link link-type="navigateTo" url="/pages/home/qrcode/index">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="qr" size="18"/>
@ -68,20 +74,26 @@
</view>
</van-cell> -->
</van-cell-group>
<view style="height:24rpx"></view>
<view style="height:16rpx"></view>
<van-cell-group>
<van-cell is-link clickable url="/pages/home/setting/index">
<van-cell is-link clickable url="/pages/home/password/index">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="setting-o" size="18" />
<text class="text-sg" style="margin-left:12rpx">设置</text>
<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 bind:click="loginOut">
<van-cell is-link clickable url="/pages/home/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 is-link clickable bind:click="loginOut">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="setting-o" size="18" />
<text class="text-sg" style="margin-left:12rpx">退出当前账号</text>
</view>
</van-cell> -->
</van-cell>
</van-cell-group>
<view style="height:16rpx"></view>

33
pages/home/mobile/index.js

@ -1,4 +1,5 @@
// pages/home/mobile/index.js
import { postCaptcha, modifyMobile } from '../../../api/user'
const util = require('../../../utils/util')
const app = getApp()
@ -53,7 +54,17 @@ Page({
return
}
wx.showLoading({ title: '正在获取', mask: true })
var form = {account: this.data.form.mobile, accountType: 'MOBILE', purpose: 'RECYCLE_CLIENT_UPDATE_MOBILE' }
postCaptcha({ verifiableAccount: this.data.form.mobile, verifiableAccountType: 1, purpose: 3 }).then(result => {
wx.hideLoading()
this.setData({ codeEnable: true })
util.showToast('验证码已经发送')
this.countDown = this.countDown || this.selectComponent('.count-down')
this.countDown.reset()
this.countDown.start()
}).catch(error => {
wx.hideLoading()
util.showToast(error)
})
},
onChange: function(e) {
this.setData({ second: e.detail.seconds + ' 秒 ' })
@ -78,17 +89,15 @@ Page({
return
}
wx.showLoading({ title: '处理中', mask: true })
var data = { mobile: this.data.form.mobile, captcha: this.data.form.captcha }
this.data.requesting = true
// /front/customer/mobile修改手机号码
// request.post('/cloud-print-user-center/user/modify/mobile', data).then(res => {
// wx.hideLoading()
// app.accountInfo.mobile = this.data.form.mobile
// util.showBackToast('修改成功')
// }).catch(error => {
// wx.hideLoading()
// this.data.requesting = false
// util.showToast(error)
// })
modifyMobile({ mobile: this.data.form.mobile, captcha: this.data.form.captcha }).then(res => {
wx.hideLoading()
app.userInfo.mobile = this.data.form.mobile
util.showBackToast('修改手机号码成功')
}).catch(error => {
wx.hideLoading()
this.data.requesting = false
util.showToast(error)
})
}
})

11
pages/home/mobile/index.wxml

@ -1,16 +1,16 @@
<!--pages/home/mobile/index.wxml-->
<cu-custom isBack="{{true}}">
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:18px">修改手机号码</view>
</cu-custom>
<view style="padding: 48rpx 30rpx;font-size:16px;text-align: center">{{mobile ? '当前手机号码:' + mobile : '您还没有绑定手机号码'}}</view>
<view class="bg-white text-xl" style="padding: 48rpx 30rpx;text-align: center">{{mobile ? '当前手机号码:' + mobile : '您还没有绑定手机号码'}}</view>
<view style="padding:0rpx 30rpx;margin-top:10rpx">
<view class="cu-form-group margin-top" style="min-height:120rpx;padding:0rpx;">
<view class="bg-white" style="padding:0rpx 30rpx;margin-top:16rpx">
<view class="cu-form-group margin-top" style="padding:0rpx;">
<text class="label" style="margin-left:12rpx;margin-right:24rpx">手机号:</text>
<input id="mobile" maxlength="11" type="number" placeholder="请输入新手机号码" bindinput="bindInput"></input>
</view>
<view class="cu-form-group" style="min-height:120rpx;padding:0rpx;border-bottom: 1px solid #eee">
<view class="cu-form-group" style="padding:0rpx;">
<text class="label" style="margin-left:12rpx;margin-right:24rpx">验证码:</text>
<input id="captcha" type="number" placeholder-style="color:#aaa" maxlength="6" placeholder="请输入验证码" bindinput="bindInput" />
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{!mobileEnable || !codeEnable}}" bind:click="fetchCode">
@ -20,6 +20,7 @@
</van-button>
</view>
</view>
<view class="flex flex-direction" style="padding:120rpx 32rpx">
<van-button block type="info" bind:click="submitForm" disabled="{{loginEnable}}">提交</van-button>
</view>

5
pages/home/mobile/index.wxss

@ -1,4 +1 @@
/* pages/home/mobile/index.wxss */
page {
background-color: #fff;
}
/* pages/home/mobile/index.wxss */

2
pages/home/password/index.js

@ -85,7 +85,7 @@ Page({
this.data.requesting = true
setPassword(this.data.form).then(res => {
wx.hideLoading()
util.showBackToast('设置成功')
util.showBackToast('修改密码成功')
}).catch(error => {
wx.hideLoading()
this.data.requesting = false

2
pages/home/setting/index.js

@ -36,8 +36,8 @@ Page({
app.globalData.token = null
app.userInfo = null
finalizeToken()
wx.redirectTo({ url: '/pages/login/index' })
event.emit('EventMessage', { what: 888, desc: 'Logout' })
wx.reLaunch({ url: '/pages/login/index' })
}).catch(error => {
})
}

2
pages/home/setting/index.wxml

@ -1,6 +1,6 @@
<!--pages/home/setting/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:18px">置</view>
<view slot="content" style="color:black;font-size:18px">置</view>
</cu-custom>
<view style="height:24rpx"></view>

5
pages/login/index.js

@ -100,6 +100,11 @@ Page({
pconfig.header = { 'Authorization': 'QNT ' + result.data }
getUserInfo().then(result => {
wx.hideLoading()
if(!result.data.isSaasPerssion){
Dialog.alert({ title: '温馨提示', message: '您的打包站还在授权中,请耐心等待,或者联系相关客服人员?' }).then(() => {
})
return
}
app.userInfo = result.data
app.globalData.token = authorization
storage.put('Authorization', app.globalData.token)

66
pages/manager/index/index.js

@ -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 () {
}
})

2
pages/manager/index/index.wxml

@ -1,2 +0,0 @@
<!--pages/manager/index/index.wxml-->
<text>pages/manager/index/index.wxml</text>

1
pages/manager/index/index.wxss

@ -1 +0,0 @@
/* pages/manager/index/index.wxss */

2
pages/process/payment/index.wxml

@ -58,7 +58,7 @@
<view style="flex:1;margin-left:16rpx" data-index="{{index}}" catchtap="lookItem">
<view class="flex flex-justify">
<view class="text-black text-lg">{{item.factoryCustomerName}} {{item.factoryCustomerMobile || ''}}</view>
<view class="text-sm text-gray">{{item.bangTime}}</view>
<view class="text-sm text-gray">{{item.inspectionTime}}</view>
</view>
<view class="text-sm text-gray" style="line-height:54rpx">
<text>品类:{{item.productName}}</text>

44
pages/setting/index/index.js

@ -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 => {
})
}
})

10
pages/setting/index/index.json

@ -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"
}
}

28
pages/setting/index/index.wxml

@ -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" />

1
pages/setting/index/index.wxss

@ -0,0 +1 @@
/* pages/home/setting/index.wxss */

20
pages/setting/paper-detial/index.js

@ -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) {
}
})

pages/manager/index/index.json → pages/setting/paper-detial/index.json

4
pages/setting/paper-detial/index.wxml

@ -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>

1
pages/setting/paper-detial/index.wxss

@ -0,0 +1 @@
/* pages/setting/paper-detial/index.wxss */

77
pages/setting/paper/index.js

@ -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)
}
})

9
pages/setting/paper/index.json

@ -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"
}
}

33
pages/setting/paper/index.wxml

@ -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>

22
pages/setting/paper/index.wxss

@ -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);
}
Loading…
Cancel
Save