Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
5bb4c3a4d4
5 changed files with 28 additions and 17 deletions
  1. 4
      api/saas.js
  2. 2
      api/user.js
  3. 21
      pages/login/index.js
  4. 10
      pages/message/card-list/index.js
  5. 8
      pages/message/notification/index.js

4
api/saas.js

@ -16,7 +16,7 @@ const getRoleList = (params) => mGet(`/recycle-user-center/get/self-department-r
const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig) const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig)
const getBankList = () => mGet(`/ztb-factory/get/bank-list`, null, sconfig) const getBankList = () => mGet(`/ztb-factory/get/bank-list`, null, sconfig)
const getStatisticsInfo = (params) => mGet(`/ztb-factory/get/my-workbench-statistics-info`, params, 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)
const bindingFactory = (params) => mPost(`/recycle-user-center/bind/factory-admin`, params, sconfig)
const getOrderList = (params) => mGet(`/ztb-factory/factory-customer/get/order-list`, params, sconfig) const getOrderList = (params) => mGet(`/ztb-factory/factory-customer/get/order-list`, params, sconfig)
const getReceiptList = (params) => mGet(`/ztb-factory/factory/get/order-receipt-proof-audit-list`, params, sconfig) const getReceiptList = (params) => mGet(`/ztb-factory/factory/get/order-receipt-proof-audit-list`, params, sconfig)
const getPeymentList = (params) => mGet(`/ztb-factory/get/order-pay-list`, params, sconfig) const getPeymentList = (params) => mGet(`/ztb-factory/get/order-pay-list`, params, sconfig)
@ -81,7 +81,7 @@ export {
getBaseInfo, getBaseInfo,
getBankList, getBankList,
getUserInfo, getUserInfo,
bindingAdmin,
bindingFactory,
getFactoryOrderList, getFactoryOrderList,
getFactoryOrderInfo, getFactoryOrderInfo,
getOrderList, getOrderList,

2
api/user.js

@ -27,6 +27,7 @@ const certificateIdentity = (params) => mPost('/uec/identify/identity', params,
const generateCode = (params) => mPost('/uec/generate/qrcode', params, config) const generateCode = (params) => mPost('/uec/generate/qrcode', params, config)
const createQrcode = (params) => mPost('/uec/create/qrcode-record', params, config) const createQrcode = (params) => mPost('/uec/create/qrcode-record', params, config)
const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config) const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config)
const bindAccount = (params) => mPost(`/uec/bind/primary-account`, params, config)
const applyEmplyee = (params) => mPost(`/uec/save/join/of/enterprise-department`, params, config) const applyEmplyee = (params) => mPost(`/uec/save/join/of/enterprise-department`, params, config)
const getCheckList = (params) => mGet(`/uec/get/employee-joining-department-application-list`, params, config) const getCheckList = (params) => mGet(`/uec/get/employee-joining-department-application-list`, params, config)
const auditEmploye = (params) => mPost(`/uec/modify/join/of/enterprise-department`, params, config) const auditEmploye = (params) => mPost(`/uec/modify/join/of/enterprise-department`, params, config)
@ -244,6 +245,7 @@ export {
verifyCode, verifyCode,
generateCode, generateCode,
createQrcode, createQrcode,
bindAccount,
applyEmplyee, applyEmplyee,
getCheckList, getCheckList,
auditEmploye, auditEmploye,

21
pages/login/index.js

@ -1,7 +1,7 @@
//获取应用实例 //获取应用实例
import Dialog from '../../components/dialog/dialog' import Dialog from '../../components/dialog/dialog'
import { config, headerFactoryId, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode, applyEmplyee } from "../../api/user"
import { sconfig, loginToken, getUserInfo, bindingAdmin, bindCustomer } from "../../api/saas"
import { config, headerFactoryId, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode, bindAccount, applyEmplyee } from "../../api/user"
import { sconfig, loginToken, getUserInfo, bindingFactory, bindCustomer } from "../../api/saas"
import { pconfig } from "../../api/payment" import { pconfig } from "../../api/payment"
import { zconfig } from "../../api/ztb" import { zconfig } from "../../api/ztb"
import { mconfig } from "../../api/moment" import { mconfig } from "../../api/moment"
@ -382,14 +382,27 @@ Page({
return return
} }
this.setData({loging: true}) this.setData({loging: true})
if(this.data.metaData.qrPage == '/page/index/yaoqing'){
bindingAdmin(this.data.metaData).then(result => {
if(this.data.metaData.qrPage == '/page/inde/ztbsaas/yaoqing'){
// 绑定企业主账号
var param = {joiningEnterprisePublicInvitationId: this.data.enterpriseId, userName: this.data.metaData.userName}
bindAccount(param).then(result => {
this.data.metaData = null
this.fetchUserInfo(app.globalData.token)
}).catch(error => {
this.setData({loging: false})
util.showToast(error)
})
} else if(this.data.metaData.qrPage == '/page/index/yaoqing'){
// 绑定工厂主账号
bindingFactory(this.data.metaData).then(result => {
this.data.metaData = null
this.fetchUserInfo(app.globalData.token) this.fetchUserInfo(app.globalData.token)
}).catch(error => { }).catch(error => {
this.setData({loging: false}) this.setData({loging: false})
util.showToast(error) util.showToast(error)
}) })
} else if(this.data.metaData.qrPage == '/page/index/shenqing'){ } else if(this.data.metaData.qrPage == '/page/index/shenqing'){
// 绑定申请成为员工
applyEmplyee(this.data.metaData).then(result => { applyEmplyee(this.data.metaData).then(result => {
this.data.metaData = null this.data.metaData = null
this.setData({loging: false}) this.setData({loging: false})

10
pages/message/card-list/index.js

@ -20,17 +20,17 @@ Scene({
pageSize: 15 pageSize: 15
}, },
show: false, show: false,
actions: [
{ id: 2, name: '绑定员工' },
{ id: 1, name: '绑定客户' }
],
actions: [ { id: 1, name: '绑定客户' } ],
nowItem: null nowItem: null
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight })
if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){
this.data.actions = [{ id: 2, name: '绑定员工' }, { id: 1, name: '绑定客户' }]
}
this.setData({ height: app.globalData.fragmentHeight, actions: this.data.actions })
this.fetchList() this.fetchList()
}, },
onRefreshList: function () { onRefreshList: function () {

8
pages/message/notification/index.js

@ -17,11 +17,7 @@ Component({
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {
this.setData({
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
isAdmin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0
})
this.setData({ StatusBar: app.globalData.StatusBar, CustomBar: app.globalData.CustomBar })
} }
}, },
methods: { methods: {
@ -29,7 +25,7 @@ Component({
if(!app.userInfo.factoryId || this.data.notice){ if(!app.userInfo.factoryId || this.data.notice){
return return
} }
this.setData({ notice: true, message })
this.setData({ notice: true, message, isAdmin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0 })
}, },
submit: function(e){ submit: function(e){
if(!this.data.message.redirectInfo || !this.data.message.redirectInfo.targetView){ if(!this.data.message.redirectInfo || !this.data.message.redirectInfo.targetView){

Loading…
Cancel
Save