Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
750c77127b
37 changed files with 237 additions and 27 deletions
  1. 19
      app.json
  2. 4
      client/factory-list/index.js
  3. 0
      client/factory-list/index.json
  4. 0
      client/factory-list/index.wxml
  5. 0
      client/factory-list/index.wxss
  6. 14
      client/home/index.js
  7. 0
      client/home/index.json
  8. 0
      client/home/index.wxml
  9. 0
      client/home/index.wxss
  10. 2
      client/index/index.js
  11. 6
      client/index/index.json
  12. 0
      client/index/index.wxml
  13. 0
      client/index/index.wxss
  14. 66
      client/message/detail/index.js
  15. 3
      client/message/detail/index.json
  16. 2
      client/message/detail/index.wxml
  17. 1
      client/message/detail/index.wxss
  18. 86
      client/message/index/index.js
  19. 14
      client/message/index/index.json
  20. 27
      client/message/index/index.wxml
  21. 4
      client/message/index/index.wxss
  22. 4
      client/order-list/index.js
  23. 0
      client/order-list/index.json
  24. 0
      client/order-list/index.wxml
  25. 0
      client/order-list/index.wxss
  26. 4
      client/workbench/index.js
  27. 0
      client/workbench/index.json
  28. 0
      client/workbench/index.wxml
  29. 0
      client/workbench/index.wxss
  30. 2
      pages/home/customer-info/index.js
  31. 2
      pages/home/customer-list/index.js
  32. 0
      pages/home/registe/index.js
  33. 0
      pages/home/registe/index.json
  34. 0
      pages/home/registe/index.wxml
  35. 0
      pages/home/registe/index.wxss
  36. 2
      pages/login/index.js
  37. 2
      pages/process/payment/index.js

19
app.json

@ -9,6 +9,7 @@
"pages/home/factory-list/index",
"pages/home/customer-info/index",
"pages/home/qrcode/index",
"pages/home/registe/index",
"pages/process/agent-list/index",
"pages/process/check-list/index",
"pages/process/order-list/index",
@ -53,12 +54,18 @@
"pages/setting/password/index",
"pages/setting/mobile/index",
"pages/setting/paper-list/index",
"pages/setting/paper-detial/index",
"pages/client/index/index",
"pages/client/registe/index",
"pages/client/home/index",
"pages/client/order-list/index",
"pages/client/factory-list/index"
"pages/setting/paper-detial/index"
],
"subpackages": [
{
"root": "client/",
"pages": [
"index/index",
"message/detail/index",
"order-list/index",
"factory-list/index"
]
}
],
"window":{
"backgroundTextStyle":"light",

pages/client/factory-list/index.js → client/factory-list/index.js

@ -1,6 +1,6 @@
// pages/client/order-list/index.js
import { getFactoryOrderList } from "../../../api/saas"
const util = require('../../../utils/util')
import { getFactoryOrderList } from "../../api/saas"
const util = require('../../utils/util')
const app = getApp()
Page({

pages/client/factory-list/index.json → client/factory-list/index.json

pages/client/factory-list/index.wxml → client/factory-list/index.wxml

pages/client/factory-list/index.wxss → client/factory-list/index.wxss

pages/client/home/index.js → client/home/index.js

@ -1,11 +1,11 @@
// pages/stock/index.js
import Dialog from '../../../components/dialog/dialog'
import { finalizeToken } from "../../../api/user"
import { getBalanceInfo } from '../../../api/payment'
const util = require('../../../utils/util')
const event = require('../../../utils/event')
const math = require('../../../utils/math')
const storage = require('../../../utils/storage')
import Dialog from '../../components/dialog/dialog'
import { finalizeToken } from "../../api/user"
import { getBalanceInfo } from '../../api/payment'
const util = require('../../utils/util')
const event = require('../../utils/event')
const math = require('../../utils/math')
const storage = require('../../utils/storage')
const app = getApp()
Component({

pages/client/home/index.json → client/home/index.json

pages/client/home/index.wxml → client/home/index.wxml

pages/client/home/index.wxss → client/home/index.wxss

pages/client/index/index.js → client/index/index.js

@ -1,5 +1,5 @@
// pages/administ/index.js
const event = require('../../../utils/event')
const event = require('../../utils/event')
const app = getApp()
Page({

pages/client/index/index.json → client/index/index.json

@ -3,9 +3,9 @@
"van-icon": "/components/icon/index",
"van-tabbar": "/components/tabbar/index",
"van-tabbar-item": "/components/tabbar-item/index",
"message": "/pages/message/index/index",
"workbench": "/pages/client/workbench/index",
"home": "/pages/client/home/index",
"message": "/client/message/index/index",
"workbench": "/client/workbench/index",
"home": "/client/home/index",
"van-dialog": "/components/dialog/index"
}
}

pages/client/index/index.wxml → client/index/index.wxml

pages/client/index/index.wxss → client/index/index.wxss

66
client/message/detail/index.js

@ -0,0 +1,66 @@
// client//message/detail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
client/message/detail/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
client/message/detail/index.wxml

@ -0,0 +1,2 @@
<!--client//message/detail/index.wxml-->
<text>client//message/detail/index.wxml</text>

1
client/message/detail/index.wxss

@ -0,0 +1 @@
/* client//message/detail/index.wxss */

86
client/message/index/index.js

@ -0,0 +1,86 @@
import { getMessageList } from "../../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.safeFragmentHeight - 100,
userInfo: null,
firstShow: false,
loading: false,
requesting: false,
finished: false,
top: 0,
orderList: [],
form: { productType: 'ZTB_FACTORY', pageNum: 1, pageSize: 10 }
},
lifetimes: {
attached: function () {
this.setData({ height: app.globalData.safeFragmentHeight - 100 })
event.on('EventMessage', this, this.onEvent)
},
detached: function () {
event.remove('EventMessage', this)
}
},
methods: {
onRestart: function () {
if (this.data.firstShow) {
return
}
// this.fetchList()
this.data.firstShow = true
},
onEvent: function (message) {
if (message.what == 888) {
this.setData({ userInfo: app.userInfo })
}
},
onRefreshList: function () {
this.setData({ orderList: [], ['form.pageNum']: 1, loading: true, finished: false })
// this.fetchList()
},
fetchList: function () {
if (this.data.requesting || this.data.finished) {
return
}
this.data.requesting = true
getMessageList(this.data.form).then(result => {
if (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
if(this.data.form.pageNum == 1){
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 })
}
} else {
this.setData({ finished: true, requesting: false, loading: false })
}
}).catch(err => {
this.setData({ requesting: false, loading: false })
util.showToast(err)
}).then(() => {
this.refresh = this.refresh || this.selectComponent('#refresh')
this.refresh.setRefresh(false)
})
},
lookItem: function (e) {
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
wx.navigateTo({ url: '/pages/message/detail/index?id=' + item.id })
},
searchList: function(){
// wx.navigateTo({ url: '/pages/message/search-list/index' })
}
}
})

14
client/message/index/index.json

@ -0,0 +1,14 @@
{
"component": true,
"usingComponents": {
"van-search": "/components/search/index",
"refresh-view": "/components/refresh-view/index",
"van-tabs": "/components/tabs/index",
"van-tab": "/components/tab/index",
"van-divider": "/components/divider/index",
"van-loading": "/components/loading/index",
"skeleton": "/components/skeleton/index",
"skeleton-avatar": "/components/skeleton-avatar/index",
"skeleton-paragraph": "/components/skeleton-paragraph/index"
}
}

27
client/message/index/index.wxml

@ -0,0 +1,27 @@
<!--pages/mall/index/index.wxml-->
<cu-custom bgColor="bg-white">
<view slot="content" style="color:black;font-size:36rpx">消息</view>
</cu-custom>
<refresh-view id="refresh" bind:refresh="onRefreshList" height="{{height}}" bind:loadmore="fetchList">
<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:else>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<view class="bg-white" style="padding:0rpx 32rpx" wx:if="{{pageIndex>0}}">
<view style="height:2rpx;background-color:#f3f3f3"></view>
</view>
<!-- <good-item dataList="{{pageItem}}"></good-item> -->
</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>
</view>
</refresh-view>

4
client/message/index/index.wxss

@ -0,0 +1,4 @@
/* pages/mall/index/index.wxss */
.margin-l{
margin-left: 32rpx;
}

pages/client/order-list/index.js → client/order-list/index.js

@ -1,6 +1,6 @@
// pages/client/order-list/index.js
import { getCustomerOrderList } from "../../../api/saas"
const util = require('../../../utils/util')
import { getCustomerOrderList } from "../../api/saas"
const util = require('../../utils/util')
const app = getApp()
Page({

pages/client/order-list/index.json → client/order-list/index.json

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

pages/client/order-list/index.wxss → client/order-list/index.wxss

pages/client/workbench/index.js → client/workbench/index.js

@ -1,6 +1,6 @@
// pages/index/index.js
import { getStatisticsInfo } from "../../../api/saas"
const event = require('../../../utils/event')
import { getStatisticsInfo } from "../../api/saas"
const event = require('../../utils/event')
const app = getApp()
Component({

pages/client/workbench/index.json → client/workbench/index.json

pages/client/workbench/index.wxml → client/workbench/index.wxml

pages/client/workbench/index.wxss → client/workbench/index.wxss

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

@ -68,7 +68,7 @@ Scene({
this.setData({ ['form.defaultPaymentMethod']: detail.id })
},
registCustomer: function(){
wx.navigateTo({ url: `/pages/client/registe/index?id=${this.data.form.id}` })
wx.navigateTo({ url: `/pages/home/registe/index?id=${this.data.form.id}` })
},
onHide: function() {
this.setData({ visible: false })

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

@ -102,7 +102,7 @@ Scene({
},
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}` })
wx.navigateTo({ url: `/pages/home/registe/index?id=${item.id}` })
},
onUnload: function(){
event.remove('EventMessage', this)

pages/client/registe/index.js → pages/home/registe/index.js

pages/client/registe/index.json → pages/home/registe/index.json

pages/client/registe/index.wxml → pages/home/registe/index.wxml

pages/client/registe/index.wxss → pages/home/registe/index.wxss

2
pages/login/index.js

@ -421,7 +421,7 @@ Page({
bindCustomer(this.data.metaData).then(result => {
this.data.metaData = null
this.setData({loging: false})
wx.redirectTo({ url: '/pages/client/index/index' })
wx.redirectTo({ url: '/client/index/index' })
}).catch(error => {
this.setData({loging: false})
util.showToast(error)

2
pages/process/payment/index.js

@ -183,7 +183,7 @@ Scene({
} else if(err.indexOf('客户未注册') >= 0){
Dialog.confirm({ title: '温馨提示', message: '该客户注册成为纸通宝用户,才可以使用千鸟代付,现在去注册?' }).then(() => {
var cid = this.data.orderList[0].factoryCustomerId
wx.navigateTo({ url: '/pages/client/registe/index?id=' + cid })
wx.navigateTo({ url: '/pages/home/registe/index?id=' + cid })
}).catch(err => {
})
} else if(err.indexOf('没有开通代付') >= 0){

Loading…
Cancel
Save