Browse Source

Merge branch 'featrue/v4.1' into featrue/v4.2

# Conflicts:
#	app.js
#	pages/api/moment.js
#	pages/api/payment.js
#	pages/api/saas.js
#	pages/api/user.js
#	pages/api/ztb.js
#	pages/index/index.js
#	pages/login/index.js
#	project.config.json
featrue/v4.2
xpz2018 5 years ago
parent
commit
f30b9ffb5c
12 changed files with 241 additions and 159 deletions
  1. 2
      pages/api/saas.js
  2. 7
      pages/bank/create/index.js
  3. 2
      pages/bank/create/index.wxml
  4. 59
      pages/home/pindex/index.js
  5. 17
      pages/home/pindex/index.wxml
  6. 67
      pages/index/index.js
  7. 73
      pages/login/index.js
  8. 20
      pages/order/index/index.js
  9. 2
      pages/order/index/index.wxml
  10. 1
      pages/paper/index.json
  11. 2
      pages/withdrawal/checkout/index.js
  12. 148
      project.config.json

2
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)

7
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

2
pages/bank/create/index.wxml

@ -17,7 +17,7 @@
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">银行卡卡号:</view>
<input id="cardNo" maxlength="24" style="width:65%" type="number" value="{{form.cardNo}}" bindblur="inputBlur" placeholder="请输入银行卡卡号" bindinput="bindForm"></input>
<input id="cardNo" maxlength="24" style="width:65%" type="number" value="{{form.cardNo}}" bindinput="bindForm" placeholder="请输入银行卡卡号" bindinput="bindForm"></input>
</view>
<!-- <ocr-navigator bind:onSuccess="blankSuccess" certificateType="bankCard">
<text class="cuIcon-scan text-blue" style="font-size:48rpx"/>

59
pages/home/pindex/index.js

@ -2,6 +2,7 @@
import { getBaseInfo, getBalanceInfo } from "../../api/saas"
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const event = require('../../../utils/event')
const app = getApp()
Component({
@ -9,6 +10,15 @@ Component({
addGlobalClass: true,
multipleSlots: true
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
event.on('EventMessage', this, this.onEvent)
},
detached: function () {
event.remove('EventMessage', this)
}
},
/**
* 页面的初始数据
*/
@ -16,6 +26,7 @@ Component({
firstShow: false,
token: app.globalData.token,
userInfo: null,
userName: null,
avatarUrl: null,
accountMoney: 0
},
@ -25,6 +36,9 @@ Component({
this.data.firstShow = true
},
fetchUserInfo: function () {
if(!app.globalData.userInfo){
return
}
getBaseInfo().then(result => {
app.globalData.userInfo = result.data
this.setData({
@ -39,10 +53,23 @@ Component({
}).catch(err => {
})
},
onEvent: function (message) {
if (message.what == 888) {
this.setData({ userInfo: app.globalData.userInfo, accountMoney: 0, avatarUrl: '/assets/image/ygImg.png', userName: null })
}
},
checkout: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
wx.navigateTo({ url: '/pages/withdrawal/checkout/index' })
},
toUserInfo: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){
wx.navigateTo({ url: '/pages/home/pauthory/index' })
} else {
@ -50,11 +77,43 @@ Component({
}
},
toAuthor: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){
wx.navigateTo({ url: '/pages/home/pauthory/index' })
} else {
wx.navigateTo({ url: '/pages/home/pinfo/index' })
}
},
toBankCard: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
wx.navigateTo({ url: '/pages/bank/index/index' })
},
toWithdrawal: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
wx.navigateTo({ url: '/pages/withdrawal/index/index' })
},
toBalance: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
wx.navigateTo({ url: '/pages/balance/index/index' })
},
toSetting: function () {
if(!app.globalData.userInfo){
wx.navigateTo({ url: '/pages/login/index' })
return
}
wx.navigateTo({ url: '/pages/home/setting/index' })
}
}
})

17
pages/home/pindex/index.wxml

@ -3,14 +3,14 @@
<view slot="content" style="color:black;font-size:18px">我的</view>
</cu-custom>
<view class="header-box flex flex-justify" style="padding:32rpx" wx:if="{{userInfo}}" bindtap="toUserInfo">
<view class="header-box flex flex-justify" style="padding:32rpx" bindtap="toUserInfo">
<view class="flex">
<wux-image width="{{60}}" height="{{60}}" wux-class="image" shape="circle" src="{{avatarUrl}}" />
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start">
<view class="flex flex-center">
<text style="white-space: nowrap">{{userName || ''}}</text>
<text style="white-space: nowrap">{{userName || '您还没有登录,去登录'}}</text>
</view>
<view class="flex flex-center" style="font-size:13px" catchtap="toAuthor">
<view class="flex flex-center" style="font-size:13px" catchtap="toAuthor" wx:if="{{userInfo}}">
<image class="img-auth2" src="{{userInfo.isAuth == 1 ? '/assets/image/icon_author.png' : '/assets/image/icon_unauthor.png'}}"></image>
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}</text>
<text class="text-yellow" style="font-size:14px;padding:4px;" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text>
@ -33,13 +33,13 @@
</view>
<wux-cell-group>
<wux-cell title="银行卡" is-link url="/pages/bank/index/index">
<wux-cell title="银行卡" is-link bind:click="toBankCard">
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_bank.png"></image>
</wux-cell>
<wux-cell title="提现记录" is-link url="/pages/withdrawal/index/index">
<wux-cell title="提现记录" is-link bind:click="toWithdrawal">
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_withdrawal.png"></image>
</wux-cell>
<wux-cell title="收支明细" is-link url="/pages/balance/index/index">
<wux-cell title="收支明细" is-link bind:click="toBalance">
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_balance.png"></image>
</wux-cell>
</wux-cell-group>
@ -48,10 +48,7 @@
<wux-cell title="联系客服" is-link url="/pages/home/service/index">
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_kefu.png"></image>
</wux-cell>
<wux-cell title="设置" is-link url="/pages/home/setting/index">
<wux-cell title="设置" is-link bind:click="toSetting">
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_setting.png"></image>
</wux-cell>
<!-- <wux-cell title="二维码分享" is-link url="/pages/home/share/index">
<view slot="header" class="cuIcon-qr_code text-blue" style="width:32rpx;height:32rpx;margin:8rpx 12rpx 0rpx 0rpx"></view>
</wux-cell> -->
</wux-cell-group>

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

73
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 => {

20
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)
})
},

2
pages/order/index/index.wxml

@ -19,7 +19,7 @@
<view class="list-empty" style="height:{{ stick ? height : (height - 440)}}rpx">
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" />
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
<view class="text-empty">{{loading? '正在加载' : userInfo ? '暂无数据' : '你还没登录'}}</view>
</view>
</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">

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

2
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')

148
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
}
]
}
}
}
Loading…
Cancel
Save