diff --git a/pages/api/saas.js b/pages/api/saas.js
index 200c40c..deda94b 100644
--- a/pages/api/saas.js
+++ b/pages/api/saas.js
@@ -29,7 +29,7 @@ const getReceiveInfo = (id) => mGet(`/saas-trade/receive/v150/${id}`, null, scon
const feedbackReceiveInfo = (params) => mPut(`/saas-trade/receive/feedback`, params, sconfig)
const deleteReceive = (id) => mDelete(`/saas-trade/receive/v150/${id}`, null, sconfig)
const getCancelReceive = (id) => mGet(`/saas-trade/receive/v150/cancel/${id}`, null, sconfig)
-const putReceive = (id) => mPut(`/saas-trade/receive/v150/cancel/${id}`, null, sconfig)
+const putReceive = (id) => mPut(`/saas-trade/receive/v150/${id}`, null, sconfig)
const updateUserInfo = (params) => mPut(`/saas-user/user/updateUserInfo`, params, sconfig)
const getTrades = (params) => mGet(`/trades`, params, sconfig)
const personalAuth = (params) => mPost(`/user-centre/front/customer/personalAuth`, params, sconfig)
diff --git a/pages/bank/create/index.js b/pages/bank/create/index.js
index 39fe667..f9ba403 100644
--- a/pages/bank/create/index.js
+++ b/pages/bank/create/index.js
@@ -62,7 +62,7 @@ Page({
}
} else if (e.target.id == 'cardNo' && !util.isEmpty(e.detail.value)) {
if (!util.isEmpty(e.detail.value)) {
- this.checkCardNo(e.detail.value)
+ this.data.form.cardNo = e.detail.value
}
}
},
@@ -95,6 +95,10 @@ Page({
return ''
},
fetchCode: function () {
+ if (util.isEmpty(this.data.bankName) && !util.isEmpty(this.data.form.cardNo)) {
+ this.checkCardNo(this.data.form.cardNo)
+ return
+ }
if (util.isEmpty(this.data.form.name)) {
util.showToast('请输入持卡人姓名')
return
@@ -138,6 +142,7 @@ Page({
})
},
submitForm: function(){
+
if (util.isEmpty(this.data.form.name)) {
util.showToast('请输入持卡人姓名')
return
diff --git a/pages/bank/create/index.wxml b/pages/bank/create/index.wxml
index b2c55df..41a50bb 100644
--- a/pages/bank/create/index.wxml
+++ b/pages/bank/create/index.wxml
@@ -17,7 +17,7 @@
银行卡卡号:
-
+
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
index d47a2e7..5fe860e 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -72,6 +72,7 @@ Page({
this.data.path += '?' + options.key + '=' + options.value
}
}
+ event.on('EventMessage', this, this.onEvent)
},
onReady: function () {
wx.showLoading({
@@ -163,31 +164,17 @@ Page({
this.defaultIndex()
return
}
- loginToken({
- loginToken: app.globalData.token
- }).then(result => {
- zconfig.header = {
- 'Authorization': 'QNT ' + result.data.token
- }
- pconfig.header = {
- 'Authorization': 'QNT ' + result.data.token
- }
- mconfig.header = {
- 'Authorization': 'QNT ' + result.data.token
- }
- this.setData({
- isTokenHaveStatus: true
- })
+ loginToken({loginToken: app.globalData.token}).then(result => {
+ zconfig.header = { 'Authorization': 'QNT ' + result.data.token }
+ pconfig.header = { 'Authorization': 'QNT ' + result.data.token }
+ mconfig.header = { 'Authorization': 'QNT ' + result.data.token }
+ // 登录流程完成;
+ if(!util.isEmpty(result.data.userToken)){
+ this.handleUserToken(result.data.userToken)
+ return
+ }
getBaseInfo().then(result => {
- this.setData({
- hasShowedLoginTag: result.data.hasShowedLoginTag
- })
- app.globalData.userInfo = result.data
- // 登录流程完成;
- if (!util.isEmpty(result.data.userToken)) {
- this.handleUserToken(result.data.userToken)
- return
- }
+ app.globalData.userInfo = result.data
wx.hideLoading()
this.defaultIndex()
}).catch(err => {
@@ -204,12 +191,23 @@ Page({
'user-token': userToken
}
getOrderExists().then(result => {
- wx.hideLoading()
- if (Number(result.data) != 1 || !app.evn) {
- wx.navigateBack()
+ if (Number(result.data) != 1 || !app.release) {
+ getBaseInfo().then(result => {
+ app.globalData.userInfo = result.data
+ wx.hideLoading()
+ this.defaultIndex()
+ }).catch(err => {
+ wx.hideLoading()
+ this.defaultIndex()
+ })
} else {
- wx.reLaunch({
- url: '/pages/paper/index'
+ getBaseInfo().then(result => {
+ app.globalData.userInfo = result.data
+ wx.hideLoading()
+ wx.redirectTo({ url: '/pages/paper/index' })
+ }).catch(err => {
+ wx.hideLoading()
+ wx.redirectTo({ url: '/pages/paper/index' })
})
}
}).catch(err => {
@@ -261,10 +259,10 @@ Page({
updateUserInfo(model).then(result => {})
},
onEvent: function (message) {
- if (message.what == 250) {
- this.setData({
- pageIndex: 0
- })
+ if(message.what == 250){
+ this.setData({ pageIndex: 0 })
+ } else if(message.what == 884){
+ wx.navigateBack()
}
},
stopTouchMove: function (e) {
@@ -299,5 +297,8 @@ Page({
return
}
util.navigateTarget(this.data.landInfo.ruleRedirectInfo)
+ },
+ onUnload: function(){
+ event.remove('EventMessage', this)
}
})
\ No newline at end of file
diff --git a/pages/login/index.js b/pages/login/index.js
index 764e896..c8c2ef0 100644
--- a/pages/login/index.js
+++ b/pages/login/index.js
@@ -97,31 +97,28 @@ Page({
'Authorization': 'QNT ' + result.data.token
}
// 登录流程完成;
- getBaseInfo().then(result => {
- app.globalData.userInfo = result.data
- if (!util.isEmpty(result.data.userToken)) {
- this.handleUserToken(result.data.userToken)
- } else {
- this.setData({
- loging: false
- })
+ if(!util.isEmpty(result.data.userToken)){
+ this.handleUserToken(result.data.userToken)
+ } else {
+ this.setData({ loging: false})
+ wx.hideLoading()
+ wx.navigateBack()
+ event.emit('EventMessage', { what: 888, desc: 'Logined' })
+ getBaseInfo().then(result => {
+ app.globalData.userInfo = result.data
+ this.setData({ loging: false})
wx.hideLoading()
wx.navigateBack()
- event.emit('EventMessage', {
- what: 888,
- desc: 'Logined'
- })
- }
- }).catch(err => {
- wx.hideLoading()
- util.showToast(err)
- app.globalData.token = null
- storage.remove('Authorization')
- config.header = null
- this.setData({
- loging: false
+ event.emit('EventMessage', { what: 888, desc: 'Logined' })
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ app.globalData.token = null
+ storage.remove('Authorization')
+ config.header = null
+ this.setData({ loging: false})
})
- })
+ }
}).catch(err => {
wx.hideLoading()
util.showToast(err)
@@ -140,11 +137,35 @@ Page({
}
getOrderExists().then(result => {
wx.hideLoading()
- if (Number(result.data) != 1 || !app.evn) {
- wx.navigateBack()
+ if (Number(result.data) != 1 || !app.release) {
+ getBaseInfo().then(result => {
+ app.globalData.userInfo = result.data
+ this.setData({ loging: false})
+ wx.hideLoading()
+ wx.navigateBack()
+ event.emit('EventMessage', { what: 888, desc: 'Logined' })
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ app.globalData.token = null
+ storage.remove('Authorization')
+ config.header = null
+ this.setData({ loging: false})
+ })
} else {
- wx.reLaunch({
- url: '/pages/paper/index'
+ getBaseInfo().then(result => {
+ app.globalData.userInfo = result.data
+ this.setData({ loging: false})
+ wx.hideLoading()
+ event.emit('EventMessage', { what: 884, desc: 'Logined' })
+ wx.redirectTo({ url: '/pages/paper/index' })
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ app.globalData.token = null
+ storage.remove('Authorization')
+ config.header = null
+ this.setData({ loging: false})
})
}
}).catch(err => {
diff --git a/pages/order/index/index.js b/pages/order/index/index.js
index 58c9961..ba2a7de 100644
--- a/pages/order/index/index.js
+++ b/pages/order/index/index.js
@@ -42,7 +42,7 @@ Component({
methods: {
onRestart: function () {
if (!this.data.firstShow) {
- this.setData({ height: app.globalData.fragmentHeight - 100 })
+ this.setData({userInfo: app.globalData.userInfo, height: app.globalData.fragmentHeight - 100 })
this.fetchOrderList()
}
this.data.firstShow = true
@@ -50,6 +50,9 @@ Component({
onEvent: function (message) {
if (message.what == 13) {
this.onRefreshList()
+ } else if (message.what == 888) {
+ this.setData({
+ userInfo: app.globalData.userInfo, orderList: [], loading: false })
}
},
onRefreshList: function () {
@@ -63,6 +66,10 @@ Component({
this.fetchOrderList()
},
fetchOrderList: function () {
+ if (!app.globalData.userInfo) {
+ this.setData({ requesting: false, loading: false })
+ return
+ }
if (this.data.requesting || this.data.finished) {
return
}
@@ -86,18 +93,11 @@ Component({
loading: false
})
} else {
- this.setData({
- finished: true,
- requesting: false,
- loading: false
- })
+ this.setData({ finished: true, requesting: false, loading: false })
}
}).catch(err => {
//异常回调
- this.setData({
- requesting: false,
- loading: false
- })
+ this.setData({ requesting: false, loading: false })
util.showToast(err)
})
},
diff --git a/pages/order/index/index.wxml b/pages/order/index/index.wxml
index 9aae9d7..57bf99d 100644
--- a/pages/order/index/index.wxml
+++ b/pages/order/index/index.wxml
@@ -19,7 +19,7 @@
- {{loading? '正在加载' : '暂无数据'}}
+ {{loading? '正在加载' : userInfo ? '暂无数据' : '你还没登录'}}
diff --git a/pages/paper/index.json b/pages/paper/index.json
index 9dbaf14..6c9bcb1 100644
--- a/pages/paper/index.json
+++ b/pages/paper/index.json
@@ -1,7 +1,6 @@
{
"disableScroll": true,
"usingComponents": {
- "message": "/pages/message/index",
"order": "/pages/order/index/index",
"home": "/pages/home/pindex/index"
}
diff --git a/pages/withdrawal/checkout/index.js b/pages/withdrawal/checkout/index.js
index cb12545..ef07fdc 100644
--- a/pages/withdrawal/checkout/index.js
+++ b/pages/withdrawal/checkout/index.js
@@ -1,5 +1,5 @@
// pages/withdrawal/checkout/index.js
-import { checkPayPassword, getBalanceInfo, getBankCardList, postWithdraw } from "../../api/payment"
+import { checkPayPassword, getBalanceInfo, getBankCardList, postWithdraw } from "../../api/saas"
import { $wuxKeyBoard, $wuxDialog } from '../../../components/index'
const util = require('../../../utils/util')
// const md5 = require('../../../utils/md5')
diff --git a/project.config.json b/project.config.json
index d31c6b8..9aab4b0 100644
--- a/project.config.json
+++ b/project.config.json
@@ -1,76 +1,76 @@
{
- "description": "项目配置文件",
- "packOptions": {
- "ignore": []
- },
- "setting": {
- "urlCheck": false,
- "es6": true,
- "enhance": true,
- "postcss": true,
- "preloadBackgroundData": false,
- "minified": true,
- "newFeature": true,
- "coverView": true,
- "nodeModules": false,
- "autoAudits": false,
- "showShadowRootInWxmlPanel": true,
- "scopeDataCheck": false,
- "uglifyFileName": true,
- "checkInvalidKey": true,
- "checkSiteMap": true,
- "uploadWithSourceMap": true,
- "compileHotReLoad": false,
- "useMultiFrameRuntime": true,
- "useApiHook": true,
- "babelSetting": {
- "ignore": [],
- "disablePlugins": [],
- "outputPath": ""
- },
- "enableEngineNative": false,
- "bundle": false,
- "useIsolateContext": true,
- "useCompilerModule": true,
- "userConfirmedUseCompilerModuleSwitch": true,
- "userConfirmedBundleSwitch": false,
- "packNpmManually": false,
- "packNpmRelationList": [],
- "minifyWXSS": true,
- "useApiHostProcess": true
- },
- "compileType": "miniprogram",
- "libVersion": "2.14.4",
- "appid": "wx7a4a8415e6821108",
- "projectname": "zhitongbao-mini",
- "debugOptions": {
- "hidedInDevtools": []
- },
- "isGameTourist": false,
- "simulatorType": "wechat",
- "simulatorPluginLibVersion": {},
- "scripts": {
- "beforeCompile": ""
- },
- "condition": {
- "plugin": {
- "list": []
- },
- "game": {
- "list": []
- },
- "gamePlugin": {
- "list": []
- },
- "miniprogram": {
- "list": [
- {
- "name": "pages/login/index",
- "pathName": "pages/login/index",
- "query": "",
- "scene": 1047
- }
- ]
- }
- }
+ "description": "项目配置文件",
+ "packOptions": {
+ "ignore": []
+ },
+ "setting": {
+ "urlCheck": true,
+ "es6": true,
+ "enhance": true,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": true,
+ "coverView": true,
+ "nodeModules": false,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": true,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": true,
+ "useApiHook": true,
+ "useApiHostProcess": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "bundle": false,
+ "useIsolateContext": true,
+ "useCompilerModule": true,
+ "userConfirmedUseCompilerModuleSwitch": true,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true
+ },
+ "compileType": "miniprogram",
+ "libVersion": "2.14.4",
+ "appid": "wx7a4a8415e6821108",
+ "projectname": "zhitongbao-mini",
+ "debugOptions": {
+ "hidedInDevtools": []
+ },
+ "isGameTourist": false,
+ "simulatorType": "wechat",
+ "simulatorPluginLibVersion": {},
+ "scripts": {
+ "beforeCompile": ""
+ },
+ "condition": {
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "name": "pages/login/index",
+ "pathName": "pages/login/index",
+ "query": "",
+ "scene": 1047
+ }
+ ]
+ }
+ }
}
\ No newline at end of file