feat: 校园旧版,东区缴费初始化

This commit is contained in:
张云杰 2025-05-19 20:47:23 +08:00
parent 4ff043228b
commit 67aae16733
105 changed files with 20039 additions and 0 deletions

332
.gitignore vendored Normal file

@ -0,0 +1,332 @@
### Vue template
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
# TODO: where does this rule come from?
docs/_book
# TODO: where does this rule come from?
test/
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
/缴费-东区-MAGAPP/package-lock.json

@ -0,0 +1,14 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

@ -0,0 +1,16 @@
# just a flag
ENV = 'development'
# base api
# VUE_APP_BASE_API = 'http://10.143.138.158:8301'
# VUE_APP_BASE_API = 'http://zbztest.yd-data.com/edu'
VUE_APP_BASE_API = 'https://jyjf.pzhdqrmtzx.com/edu'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = false

@ -0,0 +1,6 @@
# just a flag
ENV = 'production'
# base api ip:http://182.139.182.174:7301
#VUE_APP_BASE_API = 'http://10.143.138.158:8301'
VUE_APP_BASE_API = 'http://132.232.233.7/edu'

21
缴费-东区-MAGAPP/.gitignore vendored Normal file

@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

@ -0,0 +1,9 @@
### 校园旧版缴费页面
此模块对接MAGAPP-多云教研室
node版本14.3.0
可使用js方法地址https://demo.magapp-x.magcloud.cc/mag/wap/v1/wap/magjsdemo?themecolor=ADEBB7
接口地址https://lingyan.yuque.com/fqr3fe/btinr5/ov9lig
app地址https://app.lxh.magcloud.cc/homePage

@ -0,0 +1,13 @@
// module.exports = {
// presets: [
// '@vue/app'
// ],
// plugins: [
// ['import', {
// libraryName: 'vant',
// libraryDirectory: 'es',
// style: true
// }, 'vant']
// ]
// }
//

@ -0,0 +1,38 @@
{
"name": "defaultvue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"element-ui": "^2.15.6",
"moment": "^2.29.1",
"vant": "^2.12.9",
"vconsole": "^3.9.5",
"vue": "^2.5.17",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.2.0",
"@vue/cli-service": "^3.2.0",
"axios": "^0.21.1",
"babel-plugin-import": "^1.13.3",
"node-sass": "^5.0.0",
"sass": "^1.3.0",
"sass-loader": "^10.0.5",
"vue-router": "^3.5.1",
"vue-template-compiler": "^2.5.17"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title>缴费</title>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
</script>
</head>
<body>
<script src="js/jquery.min.js"></script>
<!--<script src="./js/initCommon.js"></script>-->
<script src="./js/magjs-x.js"></script>
<noscript>
<strong>We're sorry but defaultvue doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<script>
/**
* Created by lovo_bdk on 15-12-17.
*/
!(function (win, doc) {
function setFontSize() {
// 获取window 宽度
// zepto实现 $(window).width()就是这么干的
var winWidth = window.innerWidth || window.screen.availWidth || document.body.clientWidth || 540;
if (winWidth > 750) {
winWidth = 750
} else if (winWidth == 980) {
winWidth = 375
}
doc.documentElement.style.fontSize = (winWidth / 750) * 100 + 'px';
}
var evt = 'onorientationchange' in win ? 'orientationchange' : 'resize';
var timer = null;
win.addEventListener(evt, function () {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}, false);
win.addEventListener("pageshow", function (e) {
if (e.persisted) {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}
}, false);
//初始化
setFontSize();
}(window, document));
// function setRootFontSize(){var t,e,o=750,i=0;o&&(t=document.documentElement.clientWidth/o),i&&(e=document.documentElement.clientHeight/i);var d=1.5;if(t||e){var m=Math.min(t||d,e||d);d<m&&(m=d),document.getElementsByTagName("html")[0].style.fontSize=100*m+"px"}}window.addEventListener("resize",setRootFontSize),setRootFontSize()
</script>
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
// 关闭下拉刷新
// $.initCloseUpdate()
// $.initGetAppBasicInfo(fun)
function returnCurrentUrl() {
console.log("进入ios登录回调")
}
</script>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,968 @@
//需要引入jquery
var JKEventHandler = {
callNativeFunction: function (nativeMethodName, params, callBackID, callBack) {
var message;
if (!callBack) {
message = {'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'methodName': nativeMethodName, 'params': params, 'callBackID': callBackID};
if (!JKBridgeEvent._listeners[callBackID]) {
JKBridgeEvent.addEvent(callBackID, function (data) {
callBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
newCallNativeFunction: function (nativeMethodName, params, callBackID, successCallBack, failureCallBack) {
var message;
if (successCallBack && failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (successCallBack && !failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (failureCallBack && !successCallBack) {
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'type': 'NewJSFunction', 'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
callBack: function (callBackID, data) {
JKBridgeEvent.fireEvent(callBackID, data);
},
removeAllCallBacks: function (data) {
JKBridgeEvent._listeners = {};
}
};
var JKBridgeEvent = {
_listeners: {},
addEvent: function (type, fn) {
if (typeof this._listeners[type] === "undefined") {
this._listeners[type] = [];
}
if (typeof fn === "function") {
this._listeners[type].push(fn);
}
return this;
},
fireEvent: function (type, param) {
var arrayEvent = this._listeners[type];
if (arrayEvent instanceof Array) {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (typeof arrayEvent[i] === "function") {
arrayEvent[i](param);
}
}
}
return this;
},
removeEvent: function (type, fn) {
var arrayEvent = this._listeners[type];
if (typeof type === "string" && arrayEvent instanceof Array) {
if (typeof fn === "function") {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (arrayEvent[i] === fn) {
this._listeners[type].splice(i, 1);
break;
}
}
} else {
delete this._listeners[type];
}
}
return this;
}
};
$.extend({
// app公共方法
//获取basicinfo,需传入回调方法
initGetAppBasicInfo: function (fun) {
var sys = $.initGetAppSys();
var basicInfo;
try {
if (sys == 1) {
basicInfo = androidIntent.getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} else if (sys == 2) {
try {
basicInfo = getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} catch (e) {
JKEventHandler.callNativeFunction('getBasicInfo', null, 'getBasicInfoCallback', function (data) {
basicInfo = data;
basicInfo = JSON.parse(basicInfo)
basicInfo.centerId = basicInfo.centerid;
fun(basicInfo)
JKEventHandler.removeAllCallBacks()
});
}
} else {
fun(basicInfo)
}
} catch (e) {
fun(basicInfo)
}
// basicInfo = {
// userId:'',
// nickname:'',
// getIsLogin:1,1表示登录
// longitude:'',
// imei:'',
// latitude:'',
// version:'版本4.2.5',
// loginToken:'',
// userType:3,
// loginType:3,1、手机2、微信3、qq
// }
},
//判断系统类型
initGetAppSys: function () {
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
return 1;
}
if (isIOS) {
return 2;
}
return 3;
},
//调起登录页面
initToAppLogin: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentlogin()
} else if (sys == 2) {
try {
intentlogin()
} catch (e) {
JKEventHandler.callNativeFunction('intentlogin', {}, null, null);
}
}
} catch (e) {
}
},
initAppendRefresh(bgColor, infoBgColor, btnBgColor, btnColor, imgUrl, btnText) {
// bgColor-整个背景,infoBgColor-中间框背景色,btnBgColor-按钮背景色,btnColor-按钮字体颜色,imgUrl-图片路径 btnText-按钮文字
$('body').prepend('<div style="position:fixed;left:0;bottom:0;width:100vw;height:100vh;z-index:999;background: ' + (bgColor || "transparent") +
'"><div style="position:absolute;width:80%;left:50%;top: 50%;padding:20px 10px;border-radius:8px;background:' + (infoBgColor || '#fff') +
';transform: translate(-50%,-50%)">\n' +
' <img src="' + imgUrl +
'" alt="" style="display:block;width:100px;margin:0 auto 20px;">\n' +
' <a href="javascript:location.reload();" style="width:120px;text-align:center;display:block;margin:0 auto;padding: 0 6px;border-radius:4px;line-height:30px;font-size: 14px;background:' + (btnBgColor || 'red') +
';color:' + (btnColor || '#fff') +
'">' + (btnText || '登录成功') +
'</a></div></div>')
},
//调绑定手机号页面
initToBindPhone: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentBindMobilePhone()
} else if (sys == 2) {
try {
intentBindMobilePhone()
} catch (e) {
JKEventHandler.callNativeFunction('intentBindMobilePhone', {}, null, null);
}
}
} catch (e) {
}
},
//是否登录app
initIsLoginApp: function (basicInfo) {
if (basicInfo.getIsLogin && basicInfo.getIsLogin == 1) {
return true
} else {
return false
}
},
//是否在app内
initIsInApp: function (basicInfo) {
if (basicInfo) {
return true
} else {
return false
}
},
//更新app的token
initUploadAppToken: function (token) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.getRefreshLoginTokenFromH5(token)
} else if (sys == 2) {
try {
getRefreshLoginTokenFromH5(token)
} catch (e) {
JKEventHandler.callNativeFunction('getRefreshLoginTokenFromH5', token, null, null);
}
}
} catch (e) {
}
},
//新开APP窗口
initOpenNewWebview: function (url, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentWebViewActivity(url, (title || ''))
} else if (sys == 2) {
try {
intentWebViewActivity(url, title)
} catch (e) {
JKEventHandler.callNativeFunction('intentWebViewActivity', {title: title, url: url}, null, null);
}
}
} catch (e) {
location.href = url
}
},
//重定义app title
initTitleModify: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSetTitle(title);
} else if (sys == 2) {
try {
updateTitle(title);
} catch (e) {
JKEventHandler.callNativeFunction('updateTitle', title, null, null);
}
}
} catch (e) {
$('title').text(title)
}
},
//判断版本
initJudgeVersion: function (basc) {
var sys = $.initGetAppSys();
if (basc) {
var version = basc.version;
if (sys == 1) {
if (parseInt(version.replace(/\./g, '')) < 425) {
$.initAppendVersionMask('4.2.5')
}
} else if (sys == 2) {
if (parseInt(version.replace(/\./g, '')) < 435) {
$.initAppendVersionMask('4.35')
}
}
}
},
initAppendVersionMask: function (ver) {
// $('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p><div style="text-align: center;font-size: 0;margin: .2rem 0;"><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #333;border: 1px solid #333;" onclick="$.initCloseVerisionMask()">以后再说</span><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #fff;border: 1px solid #e44c4c;background-color: #e44c4c">立即升级</span></div></div></div>')
$('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p></div></div>')
},
//关闭更新提示
initCloseVerisionMask: function () {
$('#initVersionMask').remove();
return false
},
//跳转到升级页面
initToUpgradePage: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSystenSetting("1");
} else if (sys == 2) {
try {
intentSystenSetting("1")
} catch (e) {
JKEventHandler.callNativeFunction('intentSystenSetting', '1', null, null);
}
}
} catch (e) {
}
},
//唤起群组聊天界面
initJoinGroupWithChat: function (title, groupId) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
var obj = {
title: title,
groupId: groupId
};
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
initOpenAppActivity: function (json) {
//json {"appInterfaceType":"activity:\/\/newsListPage","mannerId":"3","columnId":"13"} h5需要调用方法openAppActivity将json作为参数传入
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.openAppActivity(json)
} else if (sys == 2) {
try {
openAppActivity(json)
} catch (e) {
JKEventHandler.callNativeFunction('openAppActivity', json, null, null);
}
}
} catch (e) {
}
},
//关闭当前页面
initBackToRoot: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.closeActivity()
} else if (sys == 2) {
try {
backToTop()
} catch (e) {
try {
JKEventHandler.callNativeFunction('backToTop', {}, null, null);
} catch (e) {
}
}
}
} catch (e) {
}
},
//关闭下拉刷新功能
initCloseUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.closeHeaderUpdate()
} else if (sys == 2) {
try {
closeHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('closeHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//开启下拉刷新功能
initOpenUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.openHeaderUpdate()
} else if (sys == 2) {
try {
openHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('openHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initSingleChat: function (userId, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentChat(title || '', userId)
} else if (sys == 2) {
try {
intentSingleChat(userId)
} catch (e) {
JKEventHandler.callNativeFunction('intentSingleChat', userId, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initEvokeChat: function (interviewerId, joberType, positionId) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
var obj = {
interviewerId: interviewerId,
joberType: joberType,
positionId: positionId
};
try {
if (sys == 1) {
androidIntent.intentJobMessage(JSON.stringify(obj))
} else if (sys == 2) {
try {
intentJobMessage(JSON.stringify(obj))
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessage', JSON.stringify(obj), null, null);
}
}
} catch (e) {
}
},
//唤起求职列表
initGetChatList: function (joberType) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
try {
// alert(sys)
if (sys == 1) {
androidIntent.intentJobMessageList(joberType)
} else if (sys == 2) {
try {
intentJobMessageList(joberType)
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessageList', joberType, null, null);
}
}
} catch (e) {
}
},
//发起群聊
intentGroupChat: function (groupId) {
// groupId 两微一端的群id 字符串
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(groupId)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
//调起扫一扫
initToScan: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentScan()
} else if (sys == 2) {
try {
intentScan()
} catch (e) {
JKEventHandler.callNativeFunction('intentScan', {}, null, null);
}
}
} catch (e) {
}
},
// 进入腾讯云课堂
initIntoCloudClassRoom(obj) {
// 房间号 serial
// 密码 password
// 用户昵称 nickname
// 地址 host
// 主机 server
// 端口号 port
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCloudClassRoom(obj)
} else if (sys == 2) {
try {
intentCloudClassRoom(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentCloudClassRoom', obj, null, null);
}
}
} catch (e) {
}
},
// 关闭侧滑返回
initCloseSlideBack: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.swipeBackEnable()
} else if (sys == 2) {
try {
notAllowRightSlideTurnBack()
} catch (e) {
JKEventHandler.callNativeFunction('notAllowRightSlideTurnBack', {}, null, null);
}
}
} catch (e) {
}
},
downloadImageWithUrl: function (urlStr) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.downloadImageWithUrl(urlStr);
} else if (sys == 2) {
try {
downloadImageWithUrl(urlStr);
} catch (e) {
JKEventHandler.callNativeFunction('downloadImageWithUrl', urlStr, null, null);
}
}
} catch (e) {
}
},
initHideTopRightTool: function (type) {
//0 不显示右上角功能(会开启原生左上角的返回按钮)
// 1 不显示分享按钮
//2 不显示关闭按钮 (会开启原生左上角的返回按钮)
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.rightViewChange(type + '')
} else if (sys == 2) {
try {
rightViewChange(type + '')
} catch (e) {
JKEventHandler.callNativeFunction('rightViewChange', type + '', null, null);
}
}
} catch (e) {
}
},
//拨打电话
initAppCallPhone: function (number) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCallPhone(number);
} else if (sys == 2) {
try {
intentCallPhone(number);
} catch (e) {
JKEventHandler.callNativeFunction('intentCallPhone', number, null, null);
}
}
} catch (e) {
}
},
//跳详情页面
initIntoDetailsView: function (id) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentNewsDetail(id);
} else if (sys == 2) {
try {
intentNewsDetail(id);
} catch (e) {
JKEventHandler.callNativeFunction('intentNewsDetail', id, null, null);
}
}
} catch (e) {
}
},
//分享
initOpenAppShare: function (title, icon, des, url) {
var sys = $.initGetAppSys();
if (sys == 1) {
try {
androidShare.shareWebView(JSON.stringify({
title: title,
icon: icon,
descript: des,
shareUrl: url
}));
} catch (e) {
}
} else if (sys == 2) {
try {
littleShare({
title: title,
icon: icon,
descript: des,
shareUrl: url
});
} catch (e) {
JKEventHandler.callNativeFunction('littleShare', {
title: title,
icon: icon,
descript: des,
shareUrl: url
}, 'littleShareCallback', function (data) {
});
}
}
},
//实时获取定位
initGetLocation: function (fun) {
// ios:5.0.3 安卓5.1.0及以后有这个方法 需在全局定义一个方法jsAppLocationCallback接收参数
// 安卓返回对象 IOS为字符串 {longitude:'',latitude:''}
var sys = $.initGetAppSys();
var coordinate;
try {
if (sys == 1) {
androidIntent.getAppLocation();
// JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
// coordinate = data;
// fun(coordinate)
// });
} else if (sys == 2) {
JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
coordinate = data;
fun(coordinate)
});
} else {
fun(coordinate)
}
} catch (e) {
fun(coordinate)
}
},
//禁止返回上一页
initReturnToPreviousPage: function (type) {
// 禁止返回上一页参数传1为禁止0为允许
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.noReturnToPreviousPage(type);
} else if (sys == 2) {
JKEventHandler.callNativeFunction('noReturnToPreviousPage', type, 'noReturnToPreviousPageCallback', function (data) {
});
} else {
}
} catch (e) {
}
},
// IOS允许视频非全屏播放
initIosVideoPlayInline: function (str) {
// str 值为true或者false字符串
var sys = $.initGetAppSys();
if (sys == 2) {
try {
JKEventHandler.callNativeFunction('allowsInlineMediaPlayback', str, 'allowsInlineMediaPlaybackCallback', function (data) {
});
} catch (e) {
}
}
},
//采编APP 自定义右上角按钮 点击回调方法名称publishMessage
initOpinionsToolbar: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.settingTitleBar(title)
} else if (sys == 2) {
try {
settingTitleBar(title)
} catch (e) {
JKEventHandler.callNativeFunction('settingTitleBar', title, null, null);
}
}
} catch (e) {
}
},
//获取两微一端用户信息
initGetUserInfo: function (root, id, async) {
var obj;
$.ajax({
url: root + '/a/userRelation/getStatisticsByUserId',
data: {
userId: id,
},
async: async || false,
success: function (res) {
try {
res = JSON.parse(res)
} catch (e) {
}
obj = res;
}
})
return obj;
},
initGetUrl: function (etcenter) {
// etcenter 1富顺 2宣汉 3仁寿 4古蔺 6荣县 7高坪 8雷波 9南充 12东坡 14南溪 88公司sass环境
var initMedia,//媒资地址
initCdn,//媒资加速地址
initMicro,//两微一端
initDown,//下载APP地址
initLogo;//logo
etcenter = parseInt(etcenter);
switch (etcenter) {
case 1:
initMedia = 'http://fsunifiedrelease-api.yd-data.com:8064';
initCdn = '';
initMicro = 'http://fsmpfc.yd-data.com:8360';
initDown = 'http://fsmpfc.yd-data.com:8090/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/fushun.png';
break;
case 2:
initMedia = 'http://222.215.99.149:8064';
initCdn = '';
initMicro = 'http://cityreception.yd-data.com:8074';
initDown = 'http://country.yd-data.com/xh_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/xuanhan.png';
break;
case 3:
// initMedia = 'http://rscmjrp.yd-data.com:8064';
initMedia = 'https://meizi.scrstv.com';
initCdn = 'http://svod.scrstv.com';
initMicro = 'https://lwyd.scrstv.com';
initDown = 'https://h5.scrstv.com/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/renshou.jpg';
break;
case 4:
initMedia = 'https://glmmp.gulinrongmei.com';
initCdn = '';
initMicro = 'https://lwyd8073.gulinrongmei.com';
initDown = 'https://h5.gulinrongmei.com/gl_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gulin.jpg';
break;
case 6:
initMedia = 'http://rxmmp.rongxianwang.net:8064';
initCdn = '';
initMicro = 'http://www.rongxianwang.net:8073';
initDown = 'http://110.189.172.134:8082/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/rongxian.png';
break;
case 7:
initMedia = 'https://mz.scgpnews.com.cn';
initCdn = '';
initMicro = 'https://lwyd.scgpnews.com.cn';
initDown = 'http://h5.scgpnews.com.cn/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gaoping.jpg';
break;
case 8:
initMedia = 'http://lbiomp.lbxww.gov.cn:8064';
initCdn = '';
initMicro = 'http://lbiomp.lbxww.gov.cn:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/leibo.png';
break;
case 9:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?areaId=9&centerId=9';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanchong.png';
break;
case 29:
initMedia = 'https://mz.baqrm.com';
initCdn = '';
initMicro = 'https://lwyd.baqrm.com';
initDown = 'https://cdnbah5.baqrm.com/html/app/download.html';
initLogo = 'https://cdnbah5.baqrm.com/html/hotnews/code/images/barm.png';
break;
case 9901:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=901';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-shunqing.png';
break;
case 9903:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=903';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-jialing.png';
break;
case 9904:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=904';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/langzhong.png';
break;
case 9905:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=905';
initLogo = '//h5.scrstv.com/html/commonJs/images/mc-yingshan.png';
break;
case 9906:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=906';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-nanbu.png';
break;
case 9907:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=907';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-xichong.png';
break;
case 9908:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=908';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-yilong.png';
break;
case 9909:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//47.108.86.0:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=909';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-pengzhou.png';
break;
case 12:
initMedia = 'http://dprm.info:8064';
initCdn = '';
initMicro = 'http://lwyd.dprm.info:8073';
initDown = 'http://vms.dprm.info/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/dongpo.png';
break;
case 14:
initMedia = 'http://125.64.247.157:8064';
initCdn = '';
initMicro = 'http://125.64.247.157:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanxi.png';
break;
case 888802:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
case 888803:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
default:
break
}
return {
mediaUrl: initMedia,
cdnUrl: initCdn,
microUrl: initMicro,
downloadUrl: initDown,
logoUrl: initLogo
}
},
initAddLog: function (userId, loginToken, areaId, mobile) {
$.ajax({
url: 'https://h5.yd-data.com:8098/log',
data: {
url: decodeURIComponent(location.href),
userId: userId,
loginToken: loginToken,
areaId: areaId,
mobile: mobile
},
success: function (data) {
}
})
},
// 设置支付域名
setReferer: function (url) {
var sys = $.initGetAppSys();
console.log("000")
try {
if (sys == 1) {
console.log(111)
androidShare.intentSetReferer(url)
console.log(222)
} else if (sys == 2) {
}
} catch (e) {
}
}
})

File diff suppressed because one or more lines are too long

@ -0,0 +1,383 @@
function _typeof(e) {
return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
!function () {
function t(e) {
if (-1 === navigator.userAgent.indexOf("MAGAPP")) console.log("当前环境不支持"); else if (!window.MagAndroidClient) {
if (window.WebViewJavascriptBridge) return e(window.WebViewJavascriptBridge);
if (document.addEventListener("WebViewJavascriptBridgeReady", function () {
e(window.WebViewJavascriptBridge)
}, !1), window.WVJBCallbacks) return window.WVJBCallbacks.push(e);
window.WVJBCallbacks = [e];
var c = document.createElement("iframe");
c.style.display = "none", c.src = "https://__bridge_loaded__", document.documentElement.appendChild(c), setTimeout(function () {
document.documentElement.removeChild(c)
}, 0)
}
}
function a(c, e) {
var s = null == e ? "" : "object" === _typeof(e) ? JSON.stringify(e) : e;
window.MagAndroidClient && (window.MagAndroidClient[c] && "function" == typeof window.MagAndroidClient[c] ? window.MagAndroidClient[c](s) : console.warn("Android 不支持 " + c + " 方法")), t(function (e) {
e.callHandler(c, s, function () {
})
})
}
function c(c) {
window.MagAndroidClient && (window.MagAndroidClient[c] && "function" == typeof window.MagAndroidClient[c] ? window.MagAndroidClient[c]() : console.warn("Android 不支持 " + c + " 方法")), t(function (e) {
e.callHandler(c, "", function () {
})
})
}
t(function (e) {
e.init && "function" == typeof e.init && e.init(function () {
}), e.registerHandler("jsCallBack", function (e) {
var e = JSON.parse(e), c = e.id, e = e.val, c = n.callbacks[c];
c && (c.type && "json" == c.type && (e = e && JSON.parse(e)), c.success(e))
})
});
var n = {
VERSION: "1.4.1", ready: function (e) {
t(function () {
e()
}), window.MagAndroidClient && e()
}, callbacks: {}, iosConnect: t, jsCallBack: function (e, c) {
e = n.callbacks[e];
e && (e.type && "json" == e.type && (c = c && JSON.parse(c)), e.success(c))
}, getLocation: function (e) {
e && (n.callbacks.getLocation = {type: "json", success: e}), c("getLocation")
}, showLocation: function (e) {
a("showLocation", e)
}, mapPick: function (e) {
e && (n.callbacks.mapPick = {type: "json", success: e}), c("mapPick")
}, closeWin: function () {
c("closeWin")
}, previewImage: function (e) {
a("previewImage", e)
}, picPick: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.picPickPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.picPickSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.picPickFail = {type: "json", success: e.fail}), a("picPick", e)
}, previewFile: function (e) {
a("previewFile", e)
}, filePick: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.filePickPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.filePickSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.filePickFail = {type: "json", success: e.fail}), a("filePick", e)
}, camera: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.cameraPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.cameraSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.cameraFail = {type: "json", success: e.fail}), a("camera", e)
}, recordIdentifyVideo: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.identifyVideoPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.identifyVideoSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.identifyVideoFail = {type: "json", success: e.fail}), a("recordIdentifyVideo", e)
}, setData: function (e) {
a("setData", e)
}, setShareCallback: function (e) {
e && "object" === _typeof(e) && (e.pageShareSuccess && (n.callbacks.pageShareSuccess = {
type: "",
success: e.pageShareSuccess
}), e.pageShareFailed) && (n.callbacks.pageShareFailed = {type: "", success: e.pageShareFailed})
}, share: function (e, c, s) {
c && (n.callbacks.shareSuccess = {type: "", success: c}), s && (n.callbacks.shareFailed = {
type: "",
success: s
}), a("share", e)
}, shareCard: function (e, c, s) {
c && (n.callbacks.shareSuccess = {type: "", success: c}), s && (n.callbacks.shareFailed = {
type: "",
success: s
}), a("shareCard", e)
}, socialBind: function (e, c, s) {
c && (n.callbacks.bindOnSuccess = {type: "json", success: c}), s && (n.callbacks.bindOnFail = {
type: "json",
success: s
}), a("socialBind", e)
}, report: function (e) {
a("report", e)
}, scanQR: function (e) {
e && (n.callbacks.scanQR = {type: "", success: e}), c("scanQR")
}, actionSheet: function (e, c) {
c && (n.callbacks.actionSheet = {type: "json", success: c}), a("actionSheet", e)
}, toast: function (e) {
a("toast", e)
}, dialog: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.dialogSuccess = {
type: "json",
success: e.success
}), e.cancel) && (n.callbacks.dialogCancel = {type: "json", success: e.cancel}), a("dialog", e)
}, progress: function () {
c("progress")
}, hideProgress: function () {
c("hideProgress")
}, setTitle: function (e) {
a("setTitle", e)
}, showNavigation: function () {
c("showNavigation")
}, hideNavigation: function () {
c("hideNavigation")
}, setNavigationColor: function (e) {
a("setNavigationColor", e)
}, emailBind: function (e) {
e && (n.callbacks.emailBindSuccess = {type: "string", success: e}), c("emailBind")
}, hideMore: function () {
c("hideMore")
}, showMore: function () {
c("showMore")
}, tel: function (e) {
a("tel", e)
}, sms: function (e, c) {
a("sms", {phone: e, content: c})
}, toLogin: function (e) {
e && (n.callbacks.loginSuccess = {type: "json", success: e}), c("toLogin")
}, toUserHome: function (e) {
a("toUserHome", e)
}, addRedPacket: function (e) {
a("addRedPacket", e)
}, setNavigationBarStyle: function (e) {
a("setNavigationBarStyle", e)
}, showApplaud: function (e) {
a("showApplaud", e)
}, toUserHomeByName: function (e) {
e && a("toUserHomeByName", e)
}, commentBar: function (e) {
e && "object" === _typeof(e) && (e.onComment && (n.callbacks.commentBar = {
type: "json",
success: e.onComment
}), e.onCommentShow && (n.callbacks.onCommentShow = {
type: "",
success: e.onCommentShow
}), e.onPageSelect && (n.callbacks.pageSelect = {
type: "json",
success: e.onPageSelect
}), e.onApplaud && (n.callbacks.applaud = {
type: "json",
success: e.onApplaud
}), e.has_reply_red_packet) && (n.callbacks.has_reply_red_packet = {
type: "json",
success: e.has_reply_red_packet
}), a("commentBar", e)
}, toComment: function (e) {
e && "object" === _typeof(e) && e.success && (n.callbacks.comment = {
type: "json",
success: e.success
}), a("toComment", e)
}, newWin: function (e, c) {
for (var s in e.indexOf("?") < 0 && (e += "?"), c) e += "&" + s + "=" + c[s];
a("newWin", e)
}, setPageLife: function (e) {
e && "object" === _typeof(e) && (e.pageAppear && (n.callbacks.pageAppear = {
type: "",
success: e.pageAppear
}), e.pageDisappear) && (n.callbacks.pageDisappear = {type: "", success: e.pageDisappear})
}, followAuthorFromNative: function (e) {
e && "object" === _typeof(e) && (n.callbacks.followAuthorFromNative = {
type: "",
success: e.followAuthorFromNative
})
}, availableSharePlatform: function (e) {
e && "object" === _typeof(e) && e.availableSharePlatform && (n.callbacks.availableSharePlatform = {
type: "json",
success: e.availableSharePlatform
}), c("availableSharePlatform")
}, pay: function (e, c, s) {
c && (n.callbacks.payOnSuccess = {type: "", success: c}), s && (n.callbacks.payOnFail = {
type: "",
success: s
}), a("pay", e)
}, alipay: function (e, c, s) {
e && (c && (n.callbacks.alipayOnSuccess = {type: "", success: c}, n.callbacks.alipaySuccess = {
type: "",
success: c
}), s && (n.callbacks.alipayOnFail = {type: "", success: s}), a("alipay", e))
}, inAppPay: function (e, c, s) {
c && (n.callbacks.inAppPaySuccess = {type: "", success: c}), s && (n.callbacks.inAppPayOnFail = {
type: "",
success: s
}), a("inAppPay", e)
}, deviceLogin: function (e) {
e && (n.callbacks.loginSuccess = {type: "json", success: e}), c("deviceLogin")
}, phoneBind: function (e) {
e && (n.callbacks.phoneBindSuccess = {type: "string", success: e}), c("phoneBind")
}, qqConnectLogin: function (e) {
a("qqConnectLogin", e)
}, bounceEnable: function (e) {
a("bounceEnable", e)
}, showNaviAuthor: function () {
c("showNaviAuthor")
}, hideNaviAuthor: function () {
c("hideNaviAuthor")
}, followAuthorFromWeb: function (e) {
a("followAuthorFromWeb", e)
}, addRefreshComponent: function () {
c("addRefreshComponent")
}, sappHome: function (e) {
a("sappHome", e)
}, chat: function (e) {
a("chat", e)
}, newExternalWin: function (e) {
a("newExternalWin", e)
}, getAppAuthKey: function (e) {
e && (n.callbacks.getAppAuthKey = {type: "json", success: e}), c("getAppAuthKey")
}, sendGift: function (e, c) {
c && (n.callbacks.giftSendSuccess = {type: "json", success: c}), a("sendGift", e)
}, showPhoneSettings: function () {
c("showPhoneSettings")
}, getNotificationStatus: function (e) {
e && (n.callbacks.getNotificationStatus = {type: "string", success: e}), c("getNotificationStatus")
}, downloadAttachment: function (e) {
a("downloadAttachment", e)
}, getNetworkState: function (e) {
e && (n.callbacks.getNetworkState = {type: "string", success: e}), c("getNetworkState")
}, getDeviceId: function (e) {
e && (n.callbacks.getDeviceId = {type: "string", success: e}), c("getDeviceId")
}, getNavigationHeight: function (e) {
e && (n.callbacks.getNavigationHeight = {type: "json", success: e}), c("getNavigationHeight")
}, showTaskVideoAd: function (e, c, s) {
c && (n.callbacks.rewardOnEffective = {type: "", success: c}), s && (n.callbacks.rewardOnFailure = {
type: "json",
success: s
}), a("showTaskVideoAd", e)
}, showNativeVideoAd: function (e, c, s) {
c && (n.callbacks.rewardOnEffective = {type: "", success: c}), s && (n.callbacks.rewardOnFailure = {
type: "json",
success: s
}), a("showNativeVideoAd", e)
}, getOaid: function (e) {
e && (n.callbacks.getOaid = {type: "string", success: e}), c("getOaid")
}, getAndroidVersion: function (e) {
e && (n.callbacks.getAndroidVersion = {type: "string", success: e}), c("getAndroidVersion")
}, getImei1: function (e) {
e && (n.callbacks.getImei1 = {type: "string", success: e}), c("getImei1")
}, rewardToast: function (e) {
a("rewardToast", e)
}, showCommentRewardDetail: function (e) {
a("showCommentRewardDetail", e)
}, addEmotionGroup: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.addEmotionGroupSuccess = {
type: "",
success: e.success
}), e.fail) && (n.callbacks.addEmotionGroupFail = {type: "", success: e.fail}), a("addEmotionGroup", e)
}, getEmotionGroupState: function (e) {
e && "object" === _typeof(e) && e.success && (n.callbacks.getEmotionGroupState = {
type: "",
success: e.success
}), a("getEmotionGroupState", e)
}, recognizeUserFace: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.recognizeUserFaceSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.recognizeUserFaceFail = {type: "json", success: e.fail}), c("recognizeUserFace")
}, verifyPhoneBind: function (e) {
a("verifyPhoneBind", e)
}, omiseCreditCardPayCallback: function (e) {
a("omiseCreditCardPayCallback", e)
}, alibcTradeLogin: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.alibcTradeLoginSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.alibcTradeLoginFail = {type: "json", success: e.fail}), c("alibcTradeLogin")
}, alibcTradeLogout: function () {
c("alibcTradeLogout")
}, alibcTradeAuthorize: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.alibcTradeAuthorizeSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.alibcTradeAuthorizeFail = {type: "json", success: e.fail}), c("alibcTradeAuthorize")
}, setSkymapCallback: function (e) {
e && "object" === _typeof(e) && (e.centerAndZoom && (n.callbacks.centerAndZoom = {
type: "",
success: e.centerAndZoom
}), e.pageDisappear) && (n.callbacks.pageDisappear = {type: "", success: e.pageDisappear})
}, setSkymapLocation: function (e) {
a("setSkymapLocation", e)
}, switchTab: function (e) {
a("switchTab", e = e || {index: 0})
}, impactFeedback: function () {
a("impactFeedback")
}, vibrate: function () {
a("vibrate")
}, startSpeeking: function (e) {
e && "object" === _typeof(e) && (e.onNext && (n.callbacks.startSpeekingOnNext = {
type: "json",
success: e.onNext
}), e.onPlayFinish && (n.callbacks.startSpeekingOnPlayFinish = {
type: "json",
success: e.onPlayFinish
}), e.onStatus) && (n.callbacks.startSpeekingOnStatus = {
type: "json",
success: e.onStatus
}), a("startSpeeking", e)
}, stopSpeeking: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopSpeakingOnSuccess = {
type: "",
success: e.success
}), a("stopSpeeking", e)
}, openChat: function (e) {
e && "object" === _typeof(e) && (e.query && (n.callbacks.openChatOnQuery = {
type: "json",
success: e.query
}), e.stop && (n.callbacks.openChatOnStop = {
type: "json",
success: e.stop
}), e.close && (n.callbacks.openChatOnClose = {
type: "json",
success: e.close
}), e.error) && (n.callbacks.openChatOnError = {type: "json", success: e.error});
var c = {};
a("openChat", c = "object" === _typeof(e.params) ? e.params : c)
}, answerAI: function (e) {
a("answerAI", e)
}, startAsrRecord: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.startAsrRecordOnSuccess = {
type: "json",
success: e.success
}), e.error && (n.callbacks.startAsrRecordOnError = {
type: "json",
success: e.error
}), e.onVolume) && (n.callbacks.startAsrRecordOnVolume = {type: "", success: e.onVolume}), a("startAsrRecord", e)
}, stopAsrRecord: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopAsrRecordOnSuccess = {
type: "",
success: e.success
}), a("stopAsrRecord", e)
}, initChatSpeaking: function (e) {
a("initChatSpeaking", e)
}, startChatSpeaking: function (e) {
e && "object" === _typeof(e) && e.onFinish && (n.callbacks.startChatSpeakingOnFinish = {
type: "",
success: e.onFinish
}), a("startChatSpeaking", e)
}, stopChatSpeaking: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopChatSpeakingOnSuccess = {
type: "",
success: e.success
}), a("stopChatSpeaking", e)
}
};
window.mag = n
}();

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

(image error) Size: 1.6 KiB

@ -0,0 +1,94 @@
<template>
<div id="app">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
export default {
name: 'app'
}
</script>
<style>
html, body, #app {
margin: 0;
padding: 0;
height: 100%;
}
ul, li, p, h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
li {
list-style: none;
}
a {
text-decoration: none;
color: #333;
}
body {
font-size: 0.24rem;
}
input, button {
outline: none;
}
#app {
font-family: PingFangSC-Regular;
color: #2c3e50;
/* margin-top: 60px; */
}
* {
word-break: break-all;
box-sizing: border-box;
}
.display-flex {
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.space-between {
-webkit-justify-content: space-between;
justify-content: space-between;
}
.space-center {
-webkit-justify-content: center;
justify-content: center;
}
.space-around {
-webkit-justify-content: space-around;
justify-content: space-around;
}
.align-items-center {
-webkit-align-items: center;
align-items: center;
}
.flex-direction-column {
-webkit-flex-direction: column;
flex-direction: column;
}
.header .van-dropdown-menu__bar {
background-color: #F8F8F8;
border: 0;
box-shadow: none;
}
</style>

@ -0,0 +1,87 @@
import http from './http.js'
let resquest = process.env.VUE_APP_BASE_API
export default {
// 获取微信token
getAccessToken(param) {
return http.get(`https://api.weixin.qq.com/sns/oauth2/access_token`, param)
},
// 知不知登录
login(param) {
return http.get(`${resquest}/auth/social/qywx/login`, param)
},
// 公众号登录
bindWxOpenId(param) {
return http.get(`${resquest}/user/user/bindWxOpenId`, param)
},
// app登录
appLogin(param) {
return http.get(`${resquest}/auth/social/app/login`, param)
},
// 获取mag-app用户信息
getMagUserInfo(param) {
return http.get(`${resquest}/auth/social/app/getMagUserInfo`, param)
},
// 根据名称和类型查询教育局学校列表
findSchoolPageList(param) {
return http.post(`${resquest}/system/in/dept/listSchoolPage`, param, false)
},
// 根据名称查询教育局缴费学校列表
findPaySchoolList(param) {
return http.get(`${resquest}/system/in/dept/listPaySchool`, param, false)
},
// 判断是否创建过家长信息
checkParent(param) {
return http.get(`${resquest}/user/out/parent/checkParent`, param, false)
},
// 家长查询拥有的学生
listStudentByParent(param) {
return http.get(`${resquest}/user/student/listStudentByParent`, param)
},
// 查询家校部门树
getUserDeptTree(deptId) {
return http.get(`${resquest}/user/eduUserDept/getUserDeptTree`, {deptId: deptId || null})
},
// 绑定学生信息
bindStudent(param) {
return http.post(`${resquest}/user/h5/student/bindStudent`, param)
},
//===========================账单相关接口==============================
// 查询账单列表
listH5Bill(param) {
return http.post(`${resquest}/mall/h5/eduBill/listH5Bill`, param)
},
// 查询账单详情
getH5BillInfo(param) {
return http.post(`${resquest}/mall/h5/eduBill/getH5BillInfo`, param)
},
// 生成订单
createBillOrder(param) {
return http.post(`${resquest}/mall/h5/eduBill/createBillOrder`, param)
},
// 账单订单完成
billOrderSuccess(param) {
return http.get(`${resquest}/mall/h5/eduBill/billOrderSuccess`, param)
},
// 查询账单订单列表数据
listH5BillOrderPage(param) {
return http.post(`${resquest}/mall/h5/eduBill/listH5BillOrderPage`, param)
},
// 查询账单订单详情
getH5BillOrderInfo(param) {
return http.get(`${resquest}/mall/h5/eduBill/getH5BillOrderInfo`, param)
},
// 继续支付
continuePayOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/continuePayOrder`, param)
},
// 取消支付
cancelOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/cancelOrder`, param)
},
// 查看是否存在待支付的订单
checkExistOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/checkExistOrder`, param)
}
}

@ -0,0 +1,142 @@
export default {
// 获取路径参数
getQueryVariable: function (variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
},
idCardValid: function (code) {
var city = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江 ",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北 ",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏 ",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外 "
};
var tip = "";
var pass = true;
if (!code || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code)) {
tip = "身份证号格式错误";
pass = false;
} else if (!city[code.substr(0, 2)]) {
tip = "地址编码错误";
pass = false;
} else {
//18位身份证需要验证最后一位校验位
if (code.length == 18) {
code = code.split('');
//∑(ai×Wi)(mod 11)
//加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
//校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
var sum = 0;
var ai = 0;
var wi = 0;
for (var i = 0; i < 17; i++) {
ai = code[i];
wi = factor[i];
sum += ai * wi;
}
var last = parity[sum % 11];
if (parity[sum % 11] != code[17]) {
tip = "校验位错误";
pass = false;
}
}
}
// if (!pass) alert(tip);
return pass;
},
mobileValid: function (mobile) {
var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
return reg_tel.test(mobile)
},
getUserMsg: function () {
var appId = localStorage.getItem("appId");
var msg = JSON.parse(localStorage.getItem(appId));
return msg.userMsg
},
getIdentityInfo: function () {
var appId = localStorage.getItem("appId");
var msg = JSON.parse(localStorage.getItem(appId));
return msg.identity
},
getToken: function () {
var token = ''
var appId = localStorage.getItem("appId");
if (appId) {
var msg = JSON.parse(localStorage.getItem(appId));
token= msg.tokenInfo.token
}
return token
},
// 获取appId 企业微信为coprIdapp为学校id(schoolId)公众号为appId
getAppId: function() {
return localStorage.getItem("appId");
},
// 获取app登录用户信息
getAppUserInfo: function () {
let appUserInfo = {}
let userInfo = sessionStorage.getItem("userInfo")
if (userInfo) {
appUserInfo = JSON.parse(sessionStorage.getItem("userInfo"))
}
return appUserInfo
},
// 获取登录用户唯一标识
getUniqueCode: function () {
let code = ''
let uniqueCode = localStorage.getItem("uniqueCode" + this.getAppId())
if (uniqueCode) {
code = uniqueCode
}
return code
},
// 获取当前学校选择学生的下标
getStudentIndex: function () {
let studentIndex = 0
let chooseStudentIndex = sessionStorage.getItem("studentIndex" + this.getAppId())
if (chooseStudentIndex) {
studentIndex = parseInt(chooseStudentIndex)
}
return studentIndex
}
}

@ -0,0 +1,50 @@
/**** http.js ****/
// 导入封装好的axios实例
import request from './request'
const http ={
/**
* methods: 请求
* @param url 请求地址
* @param params 请求参数
* @param security 是否鉴权 默认是
*/
get(url,params,security=true){
const config = {
method: 'get',
url:url,
security:security
}
if(params) config.params = params
return request(config)
},
post(url,params,security=true){
const config = {
method: 'post',
url:url,
security:security
}
if(params) config.data = params
return request(config)
},
put(url,params,security=true){
const config = {
method: 'put',
url:url,
security:security
}
if(params) config.params = params
return request(config)
},
delete(url,params,security=true){
const config = {
method: 'delete',
url:url,
security:security
}
if(params) config.params = params
return request(config)
}
}
//导出
export default http

@ -0,0 +1,365 @@
import {
Toast
} from 'vant';
import axios from 'axios'
import common from './common'
import api from "./api";
const InitLogin = {
homeUrl: '',// 登陆后跳转的地址,用于重新登录流程
useOpenId: false, // 是否要绑定openId
succFn: null, // 成功回调方法
wappId: '', // 商户主体id
loginType: null,//登陆类型 0-企业微信,1-微信公众2-app
appId: '', // 登录主体标识企业微信为coprIdapp为学校id(schoolId)公众号为appId
userType: 0, //0-教职工1-家长
state: '', // 自定义参数,企业微信登录为应用标识
appLoginMsg: {},//登录用户信息 {userMsg:系统用户信息,refreshToken:刷新token,token:,token_expire_date:token过期时间戳,identity:身份信息,openId:用户openId}
uniqueCode: '',//当前用户唯一标识(仅适用于app方式)
/**
* 入口方法
* @param succ_fn 登录成功回调方法
* @param useOpenId 使用openId
* @param testMode 是否开发环境
* @param testParam 开发环境登录信息
*/
init({loginSuccess, state, userType, useOpenId, uniqueCode, testMode = false, appId, testParam = {}}) {
// console.log("初始化")
this.useOpenId = useOpenId
this.succFn = loginSuccess
// 从路径获取登录参数
this.state = state || common.getQueryVariable("state")
this.userType = userType || Number(common.getQueryVariable("userType"))
this.appId = appId || common.getQueryVariable("appId")
|| common.getQueryVariable("corpId")
|| common.getQueryVariable("schoolId")
this.loginType = Number(common.getQueryVariable("loginType")) || this.getLoginType()
this.uniqueCode = uniqueCode
if (testMode === true) {
this.appId = 'schoolId2'
this.appLoginMsg = {
"userMsg": {
"userId": testParam.id,
"deptId": 2,
"identityId": testParam.identityId
},
"tokenInfo": {
"token": testParam.token
},
"identity": {
"parentId": testParam.identityId
}
}
localStorage.setItem('appId', this.appId)
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
this.succFn()
return
}
localStorage.setItem('appId', this.appId)
this.appLoginMsg = localStorage.getItem(this.appId);
try {
this.appLoginMsg = JSON.parse(this.appLoginMsg)
} catch (e) {
// 用户信息不存在进行初始化
this.appLoginMsg = {
'userMsg': {}
}
}
// 初始化用户登录信息
if (!this.appLoginMsg) {
this.appLoginMsg = {
'userMsg': {}
}
}
console.log("appLoginMsg", this.appLoginMsg)
console.log("uniqueCode", this.uniqueCode)
// 已登录进入页面
if (this.appLoginMsg.userMsg
&& Object.keys(this.appLoginMsg.userMsg).length > 1
&& this.appLoginMsg.tokenInfo) {
// 获取唯一标识
let getUniqueCode = common.getUniqueCode()
if (getUniqueCode && getUniqueCode === this.uniqueCode) {
this.afterIn()
} else {
// 移除缓存后重新登录
let storageAppId = localStorage.getItem("appId")
localStorage.removeItem("uniqueCode" + storageAppId)
localStorage.removeItem(storageAppId)
this.startLogin()
}
} else { //未登录进入登录流程
if (this.appId == this.wappId && this.useOpenId) {
this.wxLogin(this.appId, 0)
} else {
this.startLogin()
}
}
},
/**
* 开始登录
*/
startLogin() {
console.log("开始登录")
// 第一次登录
switch (this.loginType) {
case 0:
case 1:
this.wxLogin(null, 1);
break;
case 2:
this.appLogin()
break;
default:
console.log("1231231")
return;
}
},
/**
* app登录
*/
appLogin() {
let that = this
try {
let userData = common.getAppUserInfo()
let params = {
areaId: null,
mobile: userData.phone,
userId: userData.user_id,
schoolId: that.appId,
type: that.userType
}
that.apiLogin(params)
} catch (e) {
Toast('错误')
}
},
/**
* 微信oauth2授权登录流程
* @param aid 主体id
* @param type 0-绑定商户openId1-登录
*/
wxLogin: function (aid, type) {
console.log("微信登录")
var appid = aid || this.appId
if (!aid) {
localStorage.setItem('appId', appid)
}
// 微信方的授权码
var code = common.getQueryVariable('code')
// 商户id
let a = localStorage.getItem('wappId')
if (appid != a) {
localStorage.setItem('wappId', appid)
}
if (!code || appid != a) { //用户第一次进入页面,跳转授权
var url = encodeURIComponent(location.href)
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid +
'&redirect_uri=' + url + '&response_type=code&scope=snsapi_base#wechat_redirect';
} else { //授权后跳回页面=》进入登录流程
if (type == 0) {
this.bindWxOpenId(code)
} else {
var params = {
corpId: this.appId,
code: common.getQueryVariable('code'),
state: this.state,
type: this.userType
}
this.apiLogin(params)
}
}
},
/**
* 绑定微信公众号下openId
* @param code 微信授权码
*/
bindWxOpenId(code) {
this.appId = localStorage.getItem('appId')
var appMsg = localStorage.getItem(this.appId)
var userMsg = {}
if (appMsg) {
appMsg = JSON.parse(appMsg)
userMsg = appMsg.userMsg
}
axios.get(process.env.VUE_APP_BASE_API + '/user/user/bindWxOpenId', {
params: {
code: code,
identityId: userMsg.identityId,
type: 0
}
}).then(res => {
if (res.data.data) {
var openId = res.data.data
appMsg.identity.wxPublicOpenId = openId
this.appLoginMsg = appMsg
localStorage.setItem(common.getQueryVariable('corpId'), JSON.stringify(appMsg))
this.succFn(userMsg.identityId)
} else {
Toast('登录失败')
}
})
},
/**
* 调用系统登录
* @param params 登录参数
*/
apiLogin(params) {
console.log("api登录")
var url = process.env.VUE_APP_BASE_API
switch (this.loginType) {
case 0:
url = url + '/auth/social/qywx/login';
break;
case 1:
params.appId = this.appId
url = url + '/auth/social/wxpublic/login';
break;
case 2:
url = url + '/auth/social/app/login';
break;
}
axios.get(url, {params: params}).then(res => {
this.afterLogin(res)
}).catch(err => {
Toast('登录失败,网络错误')
})
},
/**
* 登陆后数据处理
* @param res
* @returns {{this.appLoginMsg: InitLogin.this.appLoginMsg, this.appId: *}}
*/
afterLogin: function (res) {
console.log("登录后数据处理")
if (res) {
var toekn_info = res.data.data.token
var userMsg = res.data.data.user
var identity = res.data.data.identity
// token信息
if (toekn_info) {
var tokenInfo = {}
tokenInfo.refreshToken = toekn_info.refresh_token
tokenInfo.token = toekn_info.token_type + ' ' + toekn_info.access_token
// 计算token有效期限
var token_expire = toekn_info.expires_in
let now = new Date().getTime()
now = parseInt(now / 1000)
let last_date = now - 0 + (token_expire - 0)
tokenInfo.tokenExpireDate = last_date
this.appLoginMsg.tokenInfo = tokenInfo
}
// 用户信息
if (identity) {
this.appLoginMsg.identity = identity
}
// 系统用户信息
if (userMsg) {
this.appLoginMsg.userMsg = userMsg
}
}
// 保存信息
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
localStorage.setItem("uniqueCode" + this.appId, this.uniqueCode)
this.succFn()
},
/**
* 刷新token
*/
refreshToken: function () {
// 刷新token
var tokenInfo = this.appLoginMsg.tokenInfo;
let rtoken = tokenInfo.refreshToken
axios.post(process.env.VUE_APP_BASE_API + '/auth/oauth/token?grant_type=refresh_token&refresh_token=' +
rtoken, {}, {
headers: {
'Authorization': 'Basic YXBwOjEyMzQ1Ng=='
}
}).then(res => {
if (res.data.access_token) {
let login_data = res.data
tokenInfo.refreshToken = login_data.refresh_token
tokenInfo.token = login_data.token_type + ' ' + login_data.access_token
var token_expire = login_data.expires_in //过期时间秒
let now = new Date().getTime()
now = parseInt(now / 1000)
let last_date = now - 0 + (token_expire - 0)
tokenInfo.tokenExpireDate = last_date
this.appLoginMsg.tokenInfo = tokenInfo
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
this.succFn()
} else {
this.retryLogin()
}
}).catch(err => {
console.log("使用refresh_token重新获取token信息失败", err)
this.retryLogin()
});
},
/**
* 进入后的逻辑处理
* token过期等判断
*/
afterIn: function () {
var tokenInfo = this.appLoginMsg.tokenInfo;
let last_date = tokenInfo.tokenExpireDate
let now_date = parseInt(new Date().getTime() / 1000)
if (now_date > last_date) { //已过期调刷新token
this.refreshToken()
} else {
if (this.useOpenId) {
if (this.appLoginMsg.identity.wxPublicOpenId) {
this.succFn()
} else { //没有openid
localStorage.setItem('appId', this.appMsgName)
// 根据学校查询正确的openId
api.getAppIdBySchool({schoolId: this.appLoginMsg.userMsg.deptId}).then(res => {
this.wappId = res.data.data
this.wxLogin(this.wappId)
})
}
} else {
this.succFn()
}
}
},
/**
* 重新登录
*/
retryLogin: function () {
var appId = localStorage.getItem("appId");
if (appId) {
var appMsg = localStorage.getItem(appId);
if (appMsg) {
appMsg = JSON.parse(appMsg)
}
var tokenInfo = appMsg.tokenInfo
let last_date = tokenInfo.tokenExpireDate
let now_date = parseInt(new Date().getTime() / 1000)
if (now_date > last_date) { //已过期调刷新token
this.refreshToken()
}
localStorage.removeItem(appId)
localStorage.removeItem('appId')
localStorage.removeItem('wappId')
localStorage.removeItem("uniqueCode" + appId)
}
window.location.reload()
},
/**
* 微信环境使用微信登录非微信环境使用app登录
* @param param
* @returns {boolean}
*/
getLoginType(param) {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return 0;
} else {
return 2;
}
}
}
export default InitLogin

@ -0,0 +1,70 @@
/**** request.js ****/
// 导入axios
import axios from 'axios'
import qs from 'qs'
import {
Toast
} from 'vant';
import login from './loginConfig'
import common from './common'
const service = axios.create({
// 超时时间 单位是ms这里设置了3s的超时时间
timeout: 300 * 1000
})
// 2.请求拦截器
service.interceptors.request.use(config => {
if (config.security!==false) {
config.headers = {
"Content-Type": "application/json",
"Authorization": common.getToken()
}
} else {
config.headers = {
"Content-Type": "application/json",
}
}
if (config.method === 'get') {
config.paramsSerializer = function (params) {
return qs.stringify(params, {
arrayFormat: 'comma'
})
}
console.log(config.paramsSerializer)
}
return config
}, error => {
Promise.reject(error)
})
// response interceptor
service.interceptors.response.use((config) => {
return config
}, (error) => {
if (error.response) {
const errorMessage = error.response.data === null ? '系统内部异常,请联系网站管理员' : error.response.data.message
switch (error.response.status) {
case 404:
Toast('很抱歉,资源未找到')
break
case 403:
Toast('很抱歉,您暂无该操作权限')
break
case 401:
Toast('很抱歉,认证已失效,请重新登录')
login.retryLogin()
break
default:
if (errorMessage === 'refresh token无效') {
Toast('登录已过期,请重新登录')
login.retryLogin()
} else {
Toast(errorMessage)
}
break
}
}
return Promise.reject(error)
})
export default service

@ -0,0 +1,14 @@
@font-face {
font-family:'notosans';
src: url(./notosans.otf);
}
body{
font-family: 'notosans' !important;
}
.van-progress{
border-radius: 100px;
}
.van-step--vertical .van-step__circle-container{
}

Binary file not shown.

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 7.5 KiB

Binary file not shown.

After

(image error) Size: 351 KiB

Binary file not shown.

After

(image error) Size: 521 B

Binary file not shown.

After

(image error) Size: 435 B

Binary file not shown.

After

(image error) Size: 448 B

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 1.9 KiB

Binary file not shown.

After

(image error) Size: 1.9 KiB

Binary file not shown.

After

(image error) Size: 29 KiB

Binary file not shown.

After

(image error) Size: 31 KiB

Binary file not shown.

After

(image error) Size: 9.0 KiB

Binary file not shown.

After

(image error) Size: 5.9 KiB

Binary file not shown.

After

(image error) Size: 3.8 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

@ -0,0 +1,153 @@
<template>
<div class="change-student" v-show="showChangeStudent">
<div class="box">
<h2>选择学生</h2>
<div class="student-list">
<div class="student-item display-flex space-center flex-direction-column" :class="studentIndex==index?'ac':''"
v-for="(item,index) in studentList" @click="studentIndex=index">
<div>{{ item.stuName }}</div>
<p>{{ item.gradeName }}{{ item.className }}</p>
</div>
<div class="student-item display-flex space-center flex-direction-column">
<van-icon name="plus" size=".3rem" @click="toBindStudent"/>
</div>
</div>
<div class="sure" @click="choose">确定</div>
</div>
</div>
</template>
<script>
import common from "../api/common"
export default {
name: "chooseStudent",
props: {
showChangeStudent: {
type: Boolean,
default: false,
},
studentList: {
type: Array,
default: () => {
return []
}
},
index: {
type: Number,
default: 1
}
},
watch: {
index(newV, oldV) {
this.studentIndex = newV
}
},
data() {
return {
studentIndex: null,
}
},
created() {
this.studentIndex = this.index
},
methods: {
choose() {
this.$emit("choose", this.studentIndex)
sessionStorage.setItem("studentIndex" + common.getAppId(), this.studentIndex)
},
//
toBindStudent() {
this.$router.push({
path: '/bindStudent',
})
}
}
}
</script>
<style scoped lang="scss">
.change-student {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .4);
z-index: 8;
.box {
width: 5.8rem;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #fff;
border-radius: .14rem;
overflow: hidden;
}
h2 {
text-align: center;
font-size: .28rem;
color: #808080;
font-weight: normal;
margin: .45rem 0 .3rem;
}
.student-list {
overflow: hidden;
width: 4.45rem;
margin: 0 auto;
max-height: 8rem;
overflow-y: auto;
}
.student-item {
width: 2.1rem;
height: 1.15rem;
border: 1px solid #e0dfe6;
text-align: center;
font-size: .22rem;
color: #929292;
border-radius: .06rem;
float: left;
margin-bottom: .2rem;
&:nth-child(2n) {
float: right;
}
&.ac {
border-color: #FFB938;
div {
color: #FFB938;
}
p {
color: #FFB938;
}
}
div {
font-size: .28rem;
color: #000000;
font-weight: bold;
margin-top: .1rem;
}
}
.sure {
width: 4.45rem;
line-height: .92rem;
text-align: center;
border-radius: .46rem;
font-size: .32rem;
color: #fff;
margin: .4rem auto;
background: linear-gradient(to right, #FF9A20, #FFB938);
box-shadow: 0 0 .1rem #FFB938;
}
}
</style>

@ -0,0 +1,63 @@
<template>
<div>
<van-dialog :overlay="false" v-model="showFlag" :showConfirmButton="false" style="box-shadow: 0px 0px 6px 0px #afadad;border-radius: 6px;">
<div >
<van-row style="height: 120px;margin-top: 20px;">
<van-col span="4"><span class="icon"></span></van-col>
<van-col span="18"><span class="title">{{ info.title }}</span>
<div class="msg">{{ info.msg }}</div>
</van-col>
</van-row>
</div>
</van-dialog>
</div>
</template>
<script>
import {Dialog} from 'vant';
export default {
name: "myDialog",
data() {
return {
showFlag: false,
info:{
title:'',
msg:''
}
}
},
methods: {
show(info){
this.showFlag=true
this.info=info
setTimeout(()=>{
this.showFlag=false
},2000)
}
}
}
</script>
<style scoped>
.icon {
padding: 20px;
background-size: 25px 25px;
background-repeat: no-repeat;
background-position: center;
background-image: url("../assets/img/success.png");
margin-left: 10px;
}
.title {
font-size: 18px;
font-weight: 700;
margin-left: 10px;
}
.msg {
margin-top: 5px;
margin-left: 10px;
margin: 5px 5px 10px 10px;
}
</style>

@ -0,0 +1,53 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Vant from 'vant';
// import '@/assets/font/font.css'
import 'vant/lib/index.css';
import Moment from 'moment'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import vconsole from "vconsole"
var vConsole = new vconsole();
Vue.use(Vant);
Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.directive('title', {//单个修改标题
inserted: function (el, binding) {
document.title = el.dataset.title
}
})
Vue.filter('formatDate', function (value, format) {
console.log(value)
return value ? Moment(value).format(format ? format : "YYYY-MM-DD HH:mm:ss") : null
})
new Vue({
el: '#app',
render: h => h(App),
router
}).$mount('#app')
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
}

@ -0,0 +1,313 @@
<template>
<div class="container">
<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
<van-skeleton :row="10" :loading="loadingPage">
<div class="bill" v-for="(bill, index) in billList" :key="index" v-if="billList.length > 0"
style="padding-bottom: .5rem">
<div class="time">
<van-row>
<van-col span="2"></van-col>
<van-col span="20" style="font-size:12px;font-weight:500;">{{ bill.lastEnableDate }}</van-col>
</van-row>
</div>
<div @click="toBillDetail(bill)">
<van-row>
<van-col span="1"></van-col>
<van-col span="22">
<div class="content-box">
<div class="title">{{bill.billTitle}}</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<div class="content">
<div v-for="(item, itemIndex) in bill.itemList" :key="itemIndex"
class="item">
<van-row>
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="item.subItemList.length === 0 && item.itemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else-if="item.subItemList.length === 0 && item.itemPayStatus === 0"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
v-else
/>
{{item.itemName}}
<span v-show="item.mustPay === 1" style="color: red">*</span>
</van-col>
<van-col span="12">{{ checkPrice(item) }}</van-col>
</van-row>
<van-row v-for="(subItem, subItemIndex) in item.subItemList" :key="'subItem' + subItemIndex"
class="sub-item"
v-if="item.subItemList && item.subItemList.length > 0">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="subItem.subItemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else
/>
{{ subItem.subItemName }}
</van-col>
<van-col span="12">{{ '¥' + subItem.subItemPrice }}</van-col>
</van-row>
</div>
<van-row class="pay-money">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
/>
已付金额
</van-col>
<van-col span="12">{{ '¥' + bill.payMoney }}</van-col>
</van-row>
</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<van-row class="bottom-box">
<van-col span="20" class="end-date">{{'截止时间:' + bill.billEndDate}}</van-col>
<van-col span="4" class="detail">详情</van-col>
</van-row>
</div>
</van-col>
</van-row>
</div>
</div>
<van-empty description="暂无账单信息" v-if="billList.length === 0"/>
</van-skeleton>
</van-pull-refresh>
</div>
</template>
<script>
import api from "../api/api"
import {Dialog, Toast} from "vant"
export default {
name: "bill",
data() {
return {
currentStudent: null,
billList: [],
refreshLoading: false,
loadingPage: true
}
},
methods: {
//
onRefresh() {
this.refreshLoading = false
//
this.loadingPage = true
this.billList = []
this.listH5Bill()
},
//
selectBillList(currentStudent) {
this.currentStudent = currentStudent
this.listH5Bill()
},
listH5Bill() {
api.listH5Bill({
studentId: this.currentStudent.id,
deptId: this.currentStudent.schoolId,
}).then(res => {
this.billList = res.data.data
this.loadingPage = false
}).catch(err => {
console.error(err)
Toast('查询账单失败')
this.loadingPage = false
})
},
//
checkPrice(item) {
let result
//
if (item.indefiniteStatus === 1) {
result = "自定义金额"
} else {
//
if (item.itemOption === 0) {
result = '¥' + item.itemPrice
} else {
result = ''
}
}
return result
},
//
toBillDetail(bill) {
//
api.checkExistOrder({
studentId: this.currentStudent.id,
billId: bill.billId,
}).then(res => {
let orderNo = res.data.data
console.log("订单号: {}", orderNo)
if (orderNo !== null && orderNo !== "" && orderNo !== undefined) {
Dialog.confirm({
message: '当前还有未支付的订单, 是否跳转支付?',
}).then(() => {
//
this.$router.push({
path: '/orderDetail',
query: {
orderCode: orderNo
}
})
}).catch(() => {
// on cancel
})
} else {
this.$router.push({
path: '/billDetail',
query: {
billId: bill.billId,
studentId: this.currentStudent.id,
studentName: this.currentStudent.stuName,
deptId: this.currentStudent.schoolId
}
})
}
}).catch(err => {
console.error(err)
Toast('查询账单详情失败')
})
}
}
}
</script>
<style lang="scss">
.container {
padding-top: .1rem;
padding-bottom: .3rem;
background: #f8f8f8;
.bill {
.time {
text-align: center;
color: #a2a6b0;
padding: .1rem;
font-weight: bolder;
font-size: .28rem;
}
.content-box {
padding-top: .2rem;
padding-bottom: .2rem;
// box-shadow: 2px 2px 6px 2px #d2d2d2;
background-color: #FFF;
border-radius: .1rem;
margin-top: .2rem;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder;
color: #374d4e;
font-size: 0.28rem;
letter-spacing: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.content {
text-align: center;
margin-top: .1rem;
margin-bottom: .1rem;
font-size: .25rem;
.pay-money {
color: #81838f;
text-align: right;
}
.item, .pay-money {
.van-col {
padding: .2rem;
.van-image {
top: .07rem;
}
}
.van-col:nth-child(1) {
text-align: left;
padding-left: .25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.van-col:nth-child(2) {
text-align: right;
padding-right: .3rem;
}
.sub-item {
.van-col:nth-child(1) {
padding-left: .65rem;
}
}
}
}
.bottom-box {
padding: .1rem 0 .1rem .3rem;
margin-top: .2rem;
font-weight: 400;
font-size: .24rem;
.end-date {
color: #374d4e;
}
.detail {
text-align: right;
padding-right: .3rem;
color: #f6a138;
}
}
}
}
.bill:nth-child(n + 2) {
margin-top: 0.5rem;
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,701 @@
<template>
<div class="detail-container">
<van-form ref="form" @submit="onSubmit">
<van-skeleton :row="10" :loading="loadingBill">
<div class="top">
<div class="title">{{ billData.billTitle }}</div>
<div class="time">{{'截止时间:' + billData.billEndDate}}</div>
</div>
<div class="item-box">
<div class="item-instruction-box">
<van-image
width="14"
height="14"
:src="require('@/assets/img/book.png')"
/>
<div class="item-instruction">缴费项目</div>
</div>
<van-collapse v-model="activeNames" :border="false">
<van-collapse-item name="title" title="费项名称" value="缴费金额"
title-class="item-name font-color"
value-class="item-price font-color"
:is-link="false" disabled>
<template #right-icon>
<div class="icon-class"></div>
</template>
</van-collapse-item>
<van-collapse-item v-for="(item, index) in billData.itemList" :name="'item' + index"
:key="'item' + index"
title-class="item-name"
value-class="item-price indefinite-money"
:is-link="false" disabled>
<template #title>
<div>
<div>
<van-icon name="star" color="#f4ea2a" size="0.3rem"/>
{{ item.itemName }}
<span v-show="item.mustPay === 1" style="color: red">*</span>
</div>
</div>
</template>
<template #value>
<div v-if="item.indefiniteStatus === 1">
<van-field type="text" label-width="0" maxlength="7" v-model="item.itemPrice"/>
</div>
<div v-else-if="item.itemOption === 0">{{ '¥' + item.itemPrice }}</div>
</template>
<template #right-icon>
<div class="icon-class" v-if="item.itemPayStatus === 1">已缴</div>
<div class="icon-class" v-else-if="item.itemOption === 0">
<van-checkbox shape="square" icon-size="0.3rem"
:disabled="item.mustPay === 1"
v-model="item.checked">
</van-checkbox>
</div>
<div class="icon-class" v-else></div>
</template>
<!-- 多选(暂时只判断选一项) -->
<div v-if="item.subItemList.length > 0">
<van-checkbox-group v-model="item.selectSubItemList" :max="1">
<van-collapse-item v-for="(subItem, subIndex) in item.subItemList" :name="'subItem' + subIndex"
:key="'item' + index + 'subItem' + subIndex"
:title="subItem.subItemName"
:value="'¥' + subItem.subItemPrice"
title-class="item-name sub-item-name"
value-class="item-price sub-item-price"
:border="false"
:is-link="false" disabled>
<template #right-icon>
<div class="icon-class sub-icon-class" v-if="item.itemPayStatus === 0">
<van-checkbox shape="square" icon-size="0.3rem"
:name="subItem.subItemId"
@click="changeSubItem">
</van-checkbox>
</div>
<div class="icon-class sub-icon-class" v-else-if="subItem.subItemPayStatus === 1">
已缴
</div>
<div class="icon-class sub-icon-class" v-else></div>
</template>
</van-collapse-item>
</van-checkbox-group>
</div>
</van-collapse-item>
</van-collapse>
</div>
<div class="instruction-box">
<div class="instruction-title">
<van-image
width="14"
height="14"
:src="require('@/assets/img/book.png')"
/>
<div class="bill-instruction">缴费说明</div>
</div>
<div v-html="billData.billInstruction"
:class="[showMore ? 'instruction' : 'hideMore','text','instruction']"></div>
<div class="more" @click="showMore=true" v-show="!showMore">展开更多</div>
<div class="more" @click="showMore=false" v-show="showMore">收起</div>
</div>
<div class="pay-box" v-show="billData.showPay">
<van-submit-bar style="padding-top: 10px" :disabled="!alreadyRead" :loading="submitLoading"
:price="practicalMoney()"
button-color="#f6a138" button-text="确认支付" label="应缴:">
<template #top>
<van-row type="flex" justify="center" style="padding: .2rem .6rem 0 .5rem; color: #f6a138;">
<van-col span="12">
<van-checkbox v-model="alreadyRead" icon-size="0.3rem">
<span style="color: #f6a138;">我已阅读缴费说明</span>
</van-checkbox>
</van-col>
<van-col span="12" style="text-align: right">
<span>已减免: {{ reductionMoney() }}</span>
</van-col>
</van-row>
</template>
</van-submit-bar>
</div>
</van-skeleton>
</van-form>
<WxPay ref="wxPay" @orderSuccess="orderSuccess"></WxPay>
<van-popup v-model="showUnionPayWay"
round safe-area-inset-bottom closeable
position="bottom"
@closed="unionPayWayClose"
:close-on-click-overlay="false"
:style="{ height: '50%' }">
<van-row class="pay-top">
<van-col span="8"></van-col>
<van-col span="8">请选择支付方式</van-col>
<van-col span="8"></van-col>
</van-row>
<van-radio-group v-model="unionSupportType" style="padding-top: 10px">
<van-cell-group>
<van-cell clickable :title="type.name" size="large" style="height: 1rem"
v-for="(type, index) in unionPayType" :key="'type' + index">
<template #icon>
<van-icon :name="require('@/assets/img/' + type.icon + '')" size=".55rem"
style="top: -0.03rem; right: .12rem"/>
</template>
<template #right-icon>
<van-radio :name="type.value"/>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
<div class="pay-bottom">
<van-button round type="danger" :disabled="buttonDisabled" @click="submitUnionPay">确认支付</van-button>
</div>
</van-popup>
</div>
</template>
<script>
import api from '../api/api'
import WxPay from './wxPay'
import {Toast} from "vant"
import {Dialog} from 'vant'
export default {
name: "billDetail",
components: {
WxPay
},
data() {
return {
loadingBill: true,
billId: null,
studentId: null,
studentName: '',
deptId: null,
billData: {},
activeNames: [],
showMore: false,
alreadyRead: false,
submitLoading: false,
orderMessage: {},
showUnionPayWay: false,
unionSupportType: null,
unionPayTypeList: [
{value: 0, name: "微信支付", icon: "微信.png"},
{value: 1, name: "微信支付", icon: "微信.png"},
{value: 2, name: "支付宝", icon: "支付宝.png"},
{value: 3, name: "云闪付", icon: "云闪付.png"},
],
orderParam: {},
buttonDisabled: false
}
},
mounted() {
//
window.addEventListener("pageshow", (event) => {
if (event.persisted || (window.performance && window.performance.navigation.type == 2)) {
this.$router.go(0)
}
}, false);
//
this.loadingBill = true
this.showMore = false
this.alreadyRead = false
this.orderParam = {}
this.orderMessage = {}
//
this.billId = this.$route.query.billId
this.studentId = this.$route.query.studentId
this.studentName = this.$route.query.studentName
this.deptId = this.$route.query.deptId
this.getH5BillInfo()
},
computed: {
unionPayType: function () {
return this.unionPayTypeList.filter(item => {
let payType = this.billData.payType
if (payType !== null && payType !== ""
&& payType !== undefined && payType.supportType.indexOf(item.value) !== -1) {
return item
}
})
}
},
methods: {
//
getH5BillInfo() {
api.getH5BillInfo({
billId: this.billId,
studentId: this.studentId,
deptId: this.deptId,
}).then(res => {
this.billData = res.data.data
this.billData.itemList.forEach((item, index) => {
if (item.subItemList.length > 0) {
//
this.activeNames.push('item' + index)
//
item.selectSubItemList = []
}
})
this.loadingBill = false
}).catch(err => {
console.error(err)
Toast('查询账单详情失败');
})
},
//
changeSubItem() {
//
this.$forceUpdate()
},
//
practicalMoney() {
if (!this.billData.itemList) {
return 0
}
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
//
let totalMoney = 0
chooseItemList.forEach(chooseItem => {
//
let selectSubItemList = chooseItem.selectSubItemList
if (selectSubItemList && selectSubItemList.length > 0) {
selectSubItemList.forEach(selectSubItem => {
let index = chooseItem.subItemList.findIndex(subItem => {
return subItem.subItemId === selectSubItem
})
if (index > -1) {
totalMoney = parseFloat(totalMoney) + parseFloat(chooseItem.subItemList[index].subItemPrice)
}
})
} else {
let itemPrice = chooseItem.itemPrice
if (itemPrice === null || itemPrice === "" || itemPrice === undefined) {
itemPrice = 0
}
//
totalMoney = parseFloat(totalMoney) + parseFloat(itemPrice)
}
})
return (parseFloat(totalMoney) - this.reductionMoney()) * 100
},
//
reductionMoney() {
let studentFamilyType = this.billData.studentFamilyType
//
if (studentFamilyType === null || studentFamilyType === undefined || studentFamilyType === "") {
return 0
} else {
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
let money = 0
let studentFamilyTypeArr = studentFamilyType.split(",")
//
chooseItemList.forEach(chooseItem => {
if (chooseItem.reductionStatus === 1) {
for (var studentFamily of studentFamilyTypeArr) {
if (chooseItem.familyType.indexOf(studentFamily + '') > -1) {
money = parseFloat(money) + parseFloat(chooseItem.reductionPrice)
break
}
}
}
})
return parseFloat(money)
}
},
//
unionPayWayClose() {
this.submitLoading = false
this.unionSupportType = null
},
//
onSubmit() {
Dialog.confirm({
message: '请您确认当前选择的学生是【' + this.studentName + '】',
}).then(() => {
//
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
if (chooseItemList === null || chooseItemList === undefined || chooseItemList.length === 0) {
Toast('请选择对应的缴费项目')
return false;
}
//
let optionOneList = this.billData.itemList.filter(item => {
if (item.itemOption === 1 && item.itemPayStatus === 0) {
//
return item
}
})
let itemFlag = true
if (optionOneList && optionOneList.length > 0) {
for (let i = 0; i < optionOneList.length; i++) {
let optionOneItem = optionOneList[i]
//
if (optionOneItem.mustPay === 1 && optionOneItem.selectSubItemList.length === 0) {
itemFlag = false
Toast('请选择【' + optionOneItem.itemName + '】缴费选项!')
break
}
}
}
if (!itemFlag) {
return false
}
let flag = true
//
let itemList = []
for (let i = 0; i < chooseItemList.length; i++) {
let chooseItem = chooseItemList[i]
let item = {
itemId: chooseItem.itemId
}
//
if (chooseItem.indefiniteStatus === 1) {
let itemPrice = chooseItem.itemPrice
if (itemPrice === null || itemPrice === "" || itemPrice === undefined) {
Toast('请输入自定义金额')
flag = false
break
}
//
let reg = /(^-?[0-9]{1,4}$)|(^-?[0-9]{1,4}[\.]{1}[0-9]{1,2}$)/
if (!reg.test(itemPrice)) {
Toast('请输入合法的金额数字小数点前4位小数点后2位')
flag = false
break
}
//
item.itemPrice = itemPrice
}
//
let chooseSubItemList = chooseItem.selectSubItemList
if (chooseSubItemList && chooseSubItemList.length > 0) {
let subItemList = [];
chooseSubItemList.forEach((subItemId, subIndex) => {
subItemList[subIndex] = {
subItemId: subItemId
}
})
item.subItemList = subItemList
}
itemList[i] = item
}
if (!flag) {
return false
}
this.submitLoading = true
//
let payTypeConfig = this.billData.payType
let payWay = payTypeConfig.payWay
//
let param = {
billId: this.billId,
studentId: this.studentId,
payWay: payWay,
itemList: itemList,
payType: null
}
// (1:,2:, 3:),
//
if (payWay === "3") {
this.orderParam = param
this.showUnionPayWay = true
} else if (payWay === "1") {
//
param.payType = payTypeConfig.supportType
this.createOrder(param)
} else {
Toast("暂不支持此支付方式!")
}
}).catch(() => {
// on cancel
});
},
//
submitUnionPay() {
if (this.unionSupportType === null || this.unionSupportType === "" || this.unionSupportType === undefined) {
Toast("请选择支付方式")
return
}
this.buttonDisabled = true
this.orderParam.payType = this.unionSupportType
this.createOrder(this.orderParam)
},
//
createOrder(param) {
console.log("请求参数", param)
//
api.createBillOrder(param).then(res => {
//
this.orderMessage = res.data.data
//
if (this.orderMessage.needToPay === true) {
//
if (this.orderMessage.payWay === "1") {
//
this.$nextTick(function () {
this.$refs.wxPay.goToPay(res.data.data)
})
} else if (this.orderMessage.payWay === "3") {
//
// $.setReferer(this.orderMessage.payDomain)
// console.log(this.orderMessage.payUrl)
window.location.href = this.orderMessage.payUrl
}
} else {
//
Toast('支付成功')
this.orderSuccess()
}
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.submitLoading = false
this.buttonDisabled = false
})
},
//
orderSuccess() {
api.billOrderSuccess({
orderCode: this.orderMessage.orderCode
})
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
}
}
</script>
<style lang="scss">
.detail-container {
padding-bottom: 1.66rem;
background: #f8f8f8;
height: 100%;
overflow-y: auto;
.top {
padding: .3rem .3rem .2rem .3rem;
background: #ffffff;
margin-bottom: .5rem;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder !important;
color: #374d4e;
font-size: .28rem;
letter-spacing: 0.02rem;
}
.time {
padding: .1rem 0 .2rem .3rem;
font-weight: 400;
color: #81838f;
font-size: 0.26rem;
}
}
.item-box {
background: #ffffff;
width: 90%;
margin: 0 auto;
border-radius: 10px;
.item-instruction-box {
padding: .2rem .3rem 0 .3rem;
display: flex;
.item-instruction {
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: 0.28rem;
}
}
.van-collapse {
width: 90%;
margin: 0 auto;
padding: 0 0 0 0.05rem;
.font-color {
color: #81838f !important;
}
.item-name, .item-price {
color: #374d4e;
font-size: 0.25rem;
}
.item-name {
padding-right: 1.5rem;
}
.item-price {
text-align: left;
}
.indefinite-money {
.van-cell__value {
border-bottom: 1px solid #81838f;
left: -0.28rem;
top: -0.2rem;
font-size: 0.25rem;
}
}
.icon-class {
color: #f6a138;
font-size: .22rem;
width: 0.6rem;
}
.sub-item-name {
color: #666666;
padding-left: 0.1rem;
padding-right: 1rem !important;
}
.sub-item-price {
color: #666666;
}
.sub-icon-class {
margin-right: -.31rem;
}
}
}
.instruction-box {
background: #ffffff;
width: 90%;
border-radius: 10px;
margin: .5rem auto 0;
padding: .2rem 0 .3rem 0;
.instruction-title {
padding: .1rem .3rem 0 .3rem;
display: flex;
.bill-instruction {
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: 0.28rem;
}
}
.instruction {
padding: .1rem .3rem 0 .3rem;
font-size: .25rem;
img {
max-width: 100%;
}
video {
max-width: 100%;
}
}
.hideMore {
max-height: 2rem;
overflow: hidden;
font-size: .25rem;
}
.more {
padding: .2rem .3rem 0 .3rem;
text-align: right;
color: #6c86fc;
font-size: .25rem;
}
}
.pay-box {
span {
font-size: .26rem !important;
}
.van-submit-bar__bar {
font-size: .28rem !important;
}
.van-submit-bar__button {
width: 1.8rem;
height: 0.6rem;
font-weight: 500;
border: none;
margin-right: 0.2rem !important;
}
}
.van-image {
top: 0.165rem;
}
.pay-top {
padding: .3rem 0;
font-size: .32rem;
}
.pay-bottom {
.van-button {
width: 70%;
position: fixed;
bottom: 1rem;
left: 15%;
}
}
}
</style>

@ -0,0 +1,207 @@
<template>
<div class="student-container">
<van-skeleton :row="10" :loading="loadingPage">
<van-form @submit="submit">
<div class="row">
<div class="title">
选择所在班级
</div>
<van-field
is-link
readonly
clickable
v-model="userDeptName"
placeholder="请选择所在班级"
:rules="[{ required: true, message: '请选择所在班级' }]"
@click="showUserDept = true"
/>
<van-popup v-model="showUserDept" round position="bottom">
<van-cascader
v-model="student.classId"
title="请选择所在班级"
:options="userDeptData"
:field-names="fieldNames"
@close="showUserDept = false"
@finish="userDeptFinish"
/>
</van-popup>
</div>
<div class="row">
<div class="title">
学生姓名
</div>
<van-field
v-model="student.stuName"
placeholder="输入学生姓名"
:rules="[{ required: true, message: '请输入学生姓名' }]"
/>
</div>
<div class="row">
<div class="title">
学生身份证号/学生学号
</div>
<van-field
v-model="student.idNumber"
placeholder="请输入身份证号码或学号"
:rules="[{ required: true, message: '请输入身份证号或学号' }]"
/>
</div>
<div class="row">
<div class="title">
您的身份
</div>
<van-field
is-link
readonly
clickable
:value="student.parentType"
placeholder="选择学生对您的称呼"
@click="showParentType = true"
:rules="[{ required: true, message: '请选择学生对您的称呼' }]"
/>
<van-popup v-model="showParentType" position="bottom">
<van-picker
show-toolbar
:columns="parentTypeList"
@confirm="confirmParent"
@cancel="showParentType = false"
/>
</van-popup>
</div>
<div class="bottom">
<van-button color="#f6a138" :disabled="buttonDisabled" style="width: 50%; border-radius: 10px;">完成
</van-button>
</div>
</van-form>
</van-skeleton>
</div>
</template>
<script>
import api from '../api/api'
import common from "../api/common"
import {Toast} from "vant";
export default {
name: "bindStudent",
data() {
return {
loadingPage: true,
identity: null,
student: this.initStudent(),
userDeptName: '',
showUserDept: false,
userDeptData: [],
showParentType: false,
buttonDisabled: false,
fieldNames: {
value: 'id',
text: 'label',
children: 'children',
},
parentTypeList: this.initParentType(),
}
},
created() {
//
this.student.schoolId = common.getAppId()
//
this.identity = common.getIdentityInfo()
//
this.getUserDeptTree()
},
methods: {
//
initStudent() {
return {
schoolId: null,
classId: null,
stuName: '',
idNumber: '',
parentType: ''
}
},
//
initParentType() {
return ['爸爸', '妈妈', '爷爷', '奶奶', '外公', '外婆', '其它']
},
//
getUserDeptTree() {
api.getUserDeptTree(this.student.schoolId).then(res => {
this.userDeptData = res.data.data
this.loadingPage = false
}).catch(err => {
this.buttonDisabled = false
console.error(err)
Toast("查询班级信息错误")
})
},
// cascader finish
userDeptFinish({selectedOptions}) {
this.showUserDept = false;
//
this.userDeptName = selectedOptions.map((option) => option.label).join('/');
},
//
confirmParent(value) {
this.student.parentType = value
this.showParentType = false
},
//
submit() {
this.buttonDisabled = true
//
api.bindStudent({
...this.student,
parentId: this.identity.parentId
}).then(res => {
Toast("添加成功")
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
}).catch(err => {
this.buttonDisabled = false
console.error(err.response.data)
Toast(err.response.data.message)
})
},
}
}
</script>
<style scoped lang="scss">
.student-container {
height: 100%;
padding: .2rem .3rem .3rem .3rem;
background-color: #f7f8fa;
.row {
.title {
font-size: .27rem;
font-weight: bold;
padding: .1rem .3rem .2rem .27rem;
}
.title:nth-child(n + 1) {
padding-top: .3rem;
}
}
.bottom {
text-align: center;
padding-top: 2.3rem;
}
}
</style>

@ -0,0 +1,180 @@
<template>
<div class="all-container">
<van-sticky>
<div class="top-bar">
<van-skeleton title avatar :row="1" :loading="loadingStudent">
<div class="user">
<van-row type="flex" justify="center">
<van-col span="14">
<van-row type="flex" align="center">
<van-col class="avatar">
<van-image round width="1.2rem" height="1.2rem"
:src="currentStudent.avatar||require('@/assets/img/avatar.png')">
</van-image>
</van-col>
<van-col style="margin-left:.2rem;">
<div>
<div class="name">{{ currentStudent.stuName }}</div>
<div class="name">{{ currentStudent.gradeName + '.' + currentStudent.className }}</div>
</div>
</van-col>
</van-row>
</van-col>
<van-col span="8" style="text-align: right">
<div class="change" @click="showChoose=true">
<!-- <van-icon name="sort" size="0.3rem"/>-->
<!-- <span style="font-size: 0.26rem">切换学生</span>-->
<van-button :icon="require('@/assets/img/change.png')"
size="small" color="#f6a138"
style="border-radius: 500px; width: 1.4rem">
切换
</van-button>
</div>
</van-col>
</van-row>
</div>
</van-skeleton>
</div>
</van-sticky>
<van-tabs v-model="activeName" animated swipeable
background="#f8f8f8" title-active-color="#f6a138" color="#f6a138"
@change="selectPageLst" style="margin-top: 20px">
<van-tab title="进行中" name="paying">
<Bill ref="bill"></Bill>
</van-tab>
<van-tab title="缴费记录" name="payRecord">
<OrderRecord ref="record"></OrderRecord>
</van-tab>
</van-tabs>
<ChooseStudent :showChangeStudent="showChoose" :studentList="studentList" :index="studentIndex"
@choose="chooseStudent"></ChooseStudent>
</div>
</template>
<script>
import Bill from "./bill"
import OrderRecord from "./orderRecord"
import ChooseStudent from "../components/chooseStudent"
import api from '../api/api'
import common from "../api/common"
export default {
name: "home",
components: {
ChooseStudent,
Bill,
OrderRecord
},
data() {
return {
identity: null,
showChoose: false,
studentIndex: common.getStudentIndex(),
studentList: [],
currentStudent: {},
loadingStudent: true,
activeName: 'paying'
}
},
created() {
//
this.identity = common.getIdentityInfo()
this.showChoose = false
this.listStudent()
},
watch: {
$route() {
if (this.$route.params.refresh) {
this.showChoose = false
this.listStudent()
}
}
},
methods: {
//
listStudent() {
api.listStudentByParent({parentId: this.identity.parentId}).then(res => {
this.studentList = res.data.data
this.currentStudent = this.studentList[this.studentIndex]
//
this.loadingStudent = false
this.selectPageLst()
})
},
//
chooseStudent(index) {
this.showChoose = false
this.studentIndex = index
this.currentStudent = this.studentList[index]
this.selectPageLst()
},
//
selectPageLst() {
this.$nextTick(() => {
if (this.activeName === "paying") {
this.$refs.bill.selectBillList(this.currentStudent)
} else {
this.$refs.record.initRecordList(this.currentStudent)
}
})
}
}
}
</script>
<style lang="scss">
.all-container {
height: 100%;
background: #f8f8f8;
.top-bar {
padding-top: .3rem;
padding-bottom: .3rem;
background: #ffffff;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.05);
.user {
padding-left: .1rem;
.avatar {
width: 1.2rem;
height: 1.2rem;
line-height: 1.2rem;
margin: auto 0;
text-align: center;
}
.name {
font-size: 0.3rem;
font-weight: 600;
color: #333;
}
.name:nth-child(2) {
margin-top: 0.16rem;
font-size: .24rem;
color: #999;
font-weight: 200;
}
}
.change {
padding-top: .18rem;
}
}
.van-tab span {
font-size: 0.26rem;
}
}
.van-tab--active {
font-size: 0.26rem;
color: rgb(246, 161, 56);
font-weight: 700;
}
</style>

@ -0,0 +1,274 @@
<template>
<div class="all-container">
<van-search class="top" v-model="searchParam.schoolName" @search="getSchoolList" placeholder="请输入学校关键词"/>
<div class="school-item" v-for="school in schoolData" @click="chooseSchoolFun(school)">
{{ school.schoolName }}
</div>
<!-- 此处为学校弹窗信息隐藏代码修改为学校列表 -->
<van-popup v-model="showTest"
round position="bottom"
:safe-area-inset-bottom="true"
:close-on-click-overlay="false"
:style="{ height: '50%' }">
<van-picker
:loading="loading"
show-toolbar
value-key="schoolName"
:columns="schoolData"
@confirm="confirmSchool">
<template slot="cancel">
<span></span>
</template>
</van-picker>
</van-popup>
</div>
</template>
<script>
import myLogin from '../api/loginConfig.js'
import common from "../api/common"
import api from '../api/api'
import {Toast} from "vant"
export default {
name: "index",
data() {
return {
show: false,
showTest: false,
value: '',
loading: false,
schoolData: [],
schoolId: null,
searchParam: this.initSearchPram(),
login_success: false,
}
},
created() {
// maga-app
this.checkAppUserLogin();
},
methods: {
//
checkAppUserLogin() {
console.info("开始app登录")
mag.toLogin(this.commonGetAppCallBack);
},
//
commonGetAppCallBack(userInfo) {
let that = this
console.info("用户登录信息: ", userInfo)
//
if (userInfo === null || userInfo === "" || userInfo === undefined || !userInfo.user_id) {
// app
mag.toLogin(this.commonGetAppCallBack);
} else {
//
api.getMagUserInfo({
appUserToken: userInfo.token,
}).then(res => {
let userData = res.data.data
console.info("获取用户信息: ", userData)
if (!userData) {
Toast('获取app用户信息失败请退出后重试')
return
}
if (userData.phone === null || userData.phone === "" || userData.phone === undefined) {
//
mag.phoneBind(function(phone){
// phone
console.info("绑定的手机号: ", phone);
userData.phone = phone
// app
sessionStorage.userInfo = JSON.stringify(userData);
//
that.getSchoolList()
});
} else {
// app
sessionStorage.userInfo = JSON.stringify(userData);
//
this.getSchoolList()
}
})
}
},
//
initSearchPram() {
return {
schoolName: '',
// id
deptId: common.getQueryVariable('deptId') || this.$route.query.deptId,
//
// onlyPay: 0,
// pageSize: 1000
}
},
//
getSchoolList() {
api.findPaySchoolList(this.searchParam).then(res => {
this.schoolData = res.data.data
this.loading = false
this.show = true
if (!this.searchParam.schoolName) {
//
let historySchool = localStorage.getItem('my_schoolId')
if (historySchool) {
for (let i = 0; i < this.schoolData.length; i++) {
if (this.schoolData[i].schoolId == historySchool) {
this.schoolData.unshift(this.schoolData[i])
this.schoolData.splice(i + 1, 1)
return
}
}
}
}
}).catch(err => {
console.error(err)
Toast('查询学校列表失败!请稍后再试')
this.loading = false
})
},
//
confirmSchool(value) {
if (value !== null && value !== "" && value !== undefined) {
this.schoolId = value.schoolId
this.loading = true
//
this.checkParentInfo()
}
},
//
checkParentInfo() {
api.checkParent({
schoolId: this.schoolId,
mobile: common.getAppUserInfo().phone,
appUserId: common.getAppUserInfo().user_id
}).then(res => {
//
this.toLogin()
}).catch(err => {
console.error(err)
Toast('登录信息异常,网络错误')
this.loading = false
})
},
//
toLogin() {
// 0-,1-2-app
let isLogin = common.getQueryVariable("loginType") || this.$route.query.loginType;
if (isLogin) {
console.log("登录流程")
this.init()
} else {
console.log("不登录页面")
this.loginSuccess()
}
},
//
loginSuccess() {
console.log("登录成功")
//
api.listStudentByParent({
parentId: common.getIdentityInfo().parentId
}).then(res => {
let studentData = res.data.data
//
if (studentData && studentData.length > 0) {
//
this.toBillHome()
} else {
//
this.toAddStudentTip()
}
this.loading = false
Toast.clear()
}).catch(err => {
console.error(err)
Toast('查询学生信息失败')
this.loading = false
})
},
//
init() {
myLogin.init({
loginSuccess: this.loginSuccess, //
state: "bill", // state
userType: 1, // 0-1-
appId: this.schoolId,
uniqueCode: common.getAppUserInfo().phone, //
testMode: false, //,trueparamidtoken
testParam: {
id: 5995, // id
token: 'bearer 9fbbff51-e877-4c21-b1f0-a935a7f1e004', // token
identityId: 23926 // id (id)
}
})
},
//
toBillHome() {
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
//
toAddStudentTip() {
this.$router.push({
path: '/tip',
})
},
//
chooseSchoolFun(school) {
Toast.loading({
message: '加载中...',
forbidClick: true,
duration: 0
})
if (school !== null && school !== "" && school !== undefined) {
//
localStorage.setItem('my_schoolId', school.schoolId)
this.schoolId = school.schoolId
this.loading = true
//
this.checkParentInfo()
}
},
}
}
</script>
<style scoped lang="scss">
.all-container {
background-color: #fff;
// height: 100%;
// background-image: url('../assets/img/bj.png');
// background-size: 100%;
// background-repeat: no-repeat;
padding-bottom: 1rem;
font-size: .28rem;
.top {
position: sticky;
top: 0;
left: 0;
}
.school-item {
border-bottom: 1px solid #f5f5f5;
text-align: center;
padding: .3rem 0;
// border-bottom: 1px solid #f5f5f5;;
}
.school-item:nth-child(2n + 1) {
background-color: #f5f5f5;
}
}
</style>

@ -0,0 +1,331 @@
<template>
<div class="order-detail-container">
<van-skeleton :row="10" :loading="loading">
<div class="title">{{ orderData.billTitle }}</div>
<div class="price">
<label v-if="orderData.orderStatus === '0' && !timeEnd">等待支付</label>
<label v-else>-</label>
<span>{{ orderData.practicalMoney }}</span>
</div>
<div class="time" v-if="orderData.orderStatus === '0' && !timeEnd">
<van-icon name="clock-o" style="top: 0.05rem; left: 0.05rem;" size=".36rem"></van-icon>
<van-count-down :time="restTime" format="mm:ss" @finish="timeFinish"/>
</div>
<van-divider dashed :style="{width: '90%', margin: '0 auto', padding: '0.2rem 0'}"/>
<div class="content-box">
<div class="content-row">
<div class="content-title">学校名称</div>
<div class="content-detail">{{ orderData.deptName }}</div>
</div>
<div class="content-row">
<div class="content-title">学生姓名</div>
<div class="content-detail">{{ orderData.studentName }}</div>
</div>
<div class="content-row" v-for="(item, index) in orderData.itemList" :key="'item' + index">
<div class="content-title" v-if="index === 0">缴费项目</div>
<div class="content-title" v-else></div>
<div class="content-detail" v-if="item.subItemList.length === 0">{{ item.itemName }}</div>
<div class="content-detail" v-else>
<span>{{ item.itemName }}</span>
<span>{{ '' + getSubItem(item) + ''}}</span>
</div>
</div>
<div class="content-row">
<div class="content-title">订单编号</div>
<div class="content-detail">{{ orderData.orderCode }}</div>
</div>
<div class="content-row" v-if="orderData.orderStatus === '2'">
<div class="content-title">交易流水号</div>
<div class="content-detail">{{ orderData.transactionNumber }}</div>
</div>
<div class="content-row">
<div class="content-title">交易状态</div>
<div class="content-detail">{{ orderStatus[orderData.orderStatus] }}</div>
</div>
<div class="content-row">
<div class="content-title">支付方式</div>
<div class="content-detail">{{ payWay[orderData.payWay] }}</div>
</div>
<div class="content-row">
<div class="content-title">下单时间</div>
<div class="content-detail">{{ orderData.createDate }}</div>
</div>
<div class="content-row" v-if="orderData.orderStatus === '2'">
<div class="content-title">支付时间</div>
<div class="content-detail">{{ orderData.payDate }}</div>
</div>
</div>
<van-divider dashed :style="{width: '90%', margin: '0 auto', padding: '0.2rem 0'}"/>
<div class="bottom" v-if="orderData.orderStatus === '0' && !timeEnd">
<van-button plain size="small" color="#a2a6b0" style="margin-right: 0.2rem"
:disabled="buttonDisabled"
@click="cancelOrder">取消订单
</van-button>
<van-button plain size="small" color="#f6a138" style="margin-left: 0.2rem"
:disabled="buttonDisabled"
@click="continuePayOrder">继续支付
</van-button>
</div>
</van-skeleton>
<WxPay ref="wxPay" @orderSuccess="orderSuccess"></WxPay>
</div>
</template>
<script>
import api from '../api/api'
import WxPay from './wxPay'
import {Toast} from "vant";
import {Dialog} from 'vant'
import common from "../api/common";
export default {
name: "orderDetail",
components: {
WxPay
},
data() {
return {
orderId: null,
orderCode: '',
loading: true,
orderData: {},
restTime: 0,
orderMessage: {},
payWay: [' ', '微信', '支付宝', '银联', '其它'],
orderStatus: ['待支付', '付款中', '交易成功', '待退款', '交易关闭'],
timeEnd: false,
buttonDisabled: false
}
},
mounted() {
//
this.loading = true
this.orderData = {}
this.restTime = 0
this.orderMessage = {}
//
let orderId = this.$route.query.orderId || common.getQueryVariable('orderId')
if (orderId === false) {
orderId = ""
}
this.orderId = orderId
let orderCode = this.$route.query.orderCode || common.getQueryVariable('orderCode')
if (orderCode === false) {
orderCode = ""
}
this.orderCode = orderCode
this.getH5BillOrderInfo()
},
methods: {
//
getH5BillOrderInfo() {
api.getH5BillOrderInfo({
billOrderId: this.orderId,
orderCode: this.orderCode,
}).then(res => {
this.orderData = res.data.data
//
if (this.orderData.orderStatus === '0') {
let date = (this.orderData.createDate + "").replace(/-/g, '/')
let createDate = new Date(date).getTime()
let lastTime = createDate + 900000
let now = new Date().getTime()
let rest = lastTime - now
if (rest > 0) {
this.restTime = rest
} else {
this.restTime = 0
}
}
this.loading = false
}).catch(err => {
console.error(err)
Toast('查询订单详情失败');
})
},
//
getSubItem(item) {
let nameArr = item.subItemList.map((subItem) => {
return subItem.subItemName
})
return nameArr.join(",")
},
//
timeFinish() {
this.timeEnd = true
},
//
continuePayOrder() {
this.buttonDisabled = true
api.continuePayOrder({
orderCode: this.orderData.orderCode,
deptId: this.orderData.deptId
}).then(res => {
//
this.orderMessage = res.data.data
//
if (this.orderMessage.payWay === "1") {
//
this.$nextTick(function () {
this.$refs.wxPay.goToPay(res.data.data)
})
} else if (this.orderMessage.payWay === "3") {
//
// $.setReferer(this.orderMessage.payDomain)
window.location.href = this.orderMessage.payUrl
}
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.buttonDisabled = false
})
},
//
cancelOrder() {
this.buttonDisabled = true
Dialog.confirm({
message: '确认取消当前订单?',
}).then(() => {
//
api.cancelOrder({
orderCode: this.orderData.orderCode
}).then(res => {
Toast("取消成功")
this.getH5BillOrderInfo()
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.buttonDisabled = false
})
}).catch(() => {
// on cancel
}).finally(() => {
this.buttonDisabled = false
})
},
//
orderSuccess() {
api.billOrderSuccess({
orderCode: this.orderMessage.orderCode
})
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
}
}
</script>
<style lang="scss">
.order-detail-container {
width: 90%;
margin: 0 auto;
padding-top: .5rem;
padding-bottom: 1.66rem;
background: #ffffff;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder;
color: #374d4e;
font-size: 0.32rem;
text-align: center;
letter-spacing: 0.01rem;
}
.price {
padding: .3rem .3rem .2rem .3rem;
font-size: 0.4rem;
text-align: center;
span {
color: #374d4e;
font-weight: 500;
font-size: 0.6rem;
}
}
.time {
padding: .1rem .3rem .2rem .3rem;
color: #f6a138;
display: flex;
justify-content: center;
.van-count-down {
padding-top: .05rem;
padding-left: .22rem;
font-size: 0.32rem;
color: #f6a138;
}
}
.content-box {
padding: .1rem .3rem .2rem .1rem;
font-size: 0.27rem;
.content-row {
padding: .1rem .3rem .2rem .3rem;
display: flex;
width: 100%;
.content-title {
width: 26%;
color: #999;
text-align-last: justify;
text-align: justify;
text-justify: distribute-all-lines;
}
.content-detail {
width: 72%;
text-align: left;
padding-left: 0.55rem;
}
}
}
.bottom {
padding: .1rem .2rem 0 .3rem;
margin-top: .2rem;
font-weight: 400;
font-size: 0.28rem;
text-align: center;
.van-button--small {
padding: 0.28rem 0.25rem !important;
font-size: 0.26rem !important;
border-radius: 300px;
}
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,307 @@
<template>
<div class="record-container">
<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
<van-list v-model="loading" :finished="finished" finished-text=""
:immediate-check=false
@load="selectRecordList" style="padding-bottom: .5rem">
<div class="bill" v-for="(orderRecord, index) in orderRecordList" :key="index"
v-if="orderRecordList.length > 0">
<div class="time">
<van-row>
<van-col span="2"></van-col>
<van-col span="20" style="font-size:12px;font-weight:500;">{{ orderRecord.createDate }}</van-col>
</van-row>
</div>
<div @click="toOrderDetail(orderRecord)">
<van-row>
<van-col span="1"></van-col>
<van-col span="22">
<div class="content-box">
<div class="title-box">
<div class="title">{{ orderRecord.billTitle }}</div>
<div class="countTime" v-if="orderRecord.orderStatus === '0'">
<van-icon name="clock-o" style="left: 0.05rem;" size=".36rem"></van-icon>
<van-count-down :time="checkCountTime(orderRecord)" format="mm:ss" @finish="timeFinish(index)"/>
</div>
<div class="status" v-else>{{ orderStatus[orderRecord.orderStatus] }}</div>
</div>
<div class="content">
<div class="content-title">订单金额</div>
<div class="content-price">{{ '¥' + orderRecord.practicalMoney }}</div>
</div>
<!-- <div class="student-box">
<span style="color: #a2a6b0; padding-right: 0.1rem">学生</span>
<span class="student">{{ orderRecord.studentName }}</span>
</div> -->
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<div class="bottom-box">
<van-button plain size="mini" color="#a2a6b0"
style="margin-right: 0.2rem"
@click.stop="cancelOrder(orderRecord, index)"
v-if="orderRecord.orderStatus === '0'">取消订单
</van-button>
<van-button size="mini" color="#f6a138" v-if="orderRecord.orderStatus === '0'">继续支付</van-button>
<van-button size="mini" color="#f6a138" class="detail" v-else>查看详情</van-button>
</div>
</div>
</van-col>
</van-row>
</div>
</div>
</van-list>
<van-empty description="暂无缴费记录" v-if="orderRecordList.length === 0"/>
</van-pull-refresh>
</div>
</template>
<script>
import api from "../api/api"
import {Dialog, Toast} from "vant"
export default {
name: "orderRecord",
data() {
return {
currentStudent: null,
orderRecordList: [],
pagination: this.initPage(),
refreshLoading: false,
loading: false,
finished: false,
total: null,
orderStatus: ['待支付', '付款中', '交易成功', '待退款', '交易关闭'],
}
},
methods: {
//
initRecordList(currentStudent) {
this.currentStudent = currentStudent
//
this.orderRecordList = []
this.pagination = this.initPage()
this.loading = true
console.log("进入点击")
this.selectRecordList()
},
//
initPage() {
return {
pageNum: 1,
pageSize: 10
}
},
//
onRefresh() {
console.log("进入刷新")
//
this.orderRecordList = []
this.pagination = this.initPage()
this.selectRecordList()
},
//
selectRecordList() {
api.listH5BillOrderPage({
...this.pagination,
studentId: this.currentStudent.id,
deptId: this.currentStudent.schoolId,
}).then(res => {
let data = res.data.data
this.orderRecordList.push(...data.records)
this.total = data.total
//
this.loading = false
if (this.pagination.pageNum >= Math.ceil(this.total / this.pagination.pageSize)) {
this.finished = true
} else {
this.pagination.pageNum++
}
}).catch(err => {
console.error(err)
Toast('查询缴费记录失败')
}).finally(() => {
this.refreshLoading = false
})
},
//
checkCountTime(orderRecord) {
let date = (orderRecord.createDate + "").replace(/-/g, '/')
let createDate = new Date(date).getTime()
//
let lastTime = createDate + 900000
//
let now = new Date().getTime()
let rest = lastTime - now
if (rest > 0) {
return rest
} else {
return 0
}
},
//
timeFinish(index) {
this.orderRecordList[index].orderStatus = '4'
this.orderRecordList[index].payStatus = '3'
},
//
cancelOrder(orderRecord, index) {
Dialog.confirm({
message: '确认取消当前订单?',
}).then(() => {
//
api.cancelOrder({
orderCode: orderRecord.orderCode
}).then(res => {
Toast("取消成功")
//
this.orderRecordList[index].orderStatus = '4'
this.orderRecordList[index].payStatus = '3'
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
})
}).catch(() => {
// on cancel
})
},
//
toOrderDetail(orderRecord) {
this.$router.push({
path: '/orderDetail',
query: {
orderId: orderRecord.orderId
}
})
}
}
}
</script>
<style lang="scss">
.record-container {
padding-top: .5rem;
padding-bottom: .3rem;
background: #f8f8f8;
.bill {
.time {
text-align: center;
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: .28rem;
}
.content-box {
padding-top: .2rem;
padding-bottom: .2rem;
// box-shadow: 2px 2px 6px 2px #d2d2d2;
background-color: #fff;
border-radius: 0.1rem;
margin-top: 0.2rem;
.title-box {
padding: .1rem .3rem .2rem .3rem;
display: flex;
align-items: center;
justify-content: space-between;
.title {
width: 75%;
font-weight: 500;
color: #374d4e;
font-size: .28rem;
letter-spacing: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.status, .countTime {
width: 25%;
text-align: right;
color: #f6a138;
font-weight: 500;
font-size: .25rem;
}
.countTime {
display: flex;
.van-count-down {
padding-left: .12rem;
font-size: .3rem;
}
}
}
.student-box {
padding: .1rem .3rem .2rem .3rem;
.student {
font-weight: 500;
font-size: .26rem;
}
}
.content {
text-align: center;
margin:.58rem 0 .5rem;
display: flex;
align-items: center;
justify-content: center;
.content-title {
color: #a2a6b0;
font-weight: 500;
font-size: .28rem;
letter-spacing: 1.5px;
}
.content-price {
margin-left: .15rem;
color: #000;
font-weight: 600;
font-size: .36rem;
}
}
.bottom-box {
padding: .2rem .2rem 0 .2rem;
font-weight: 400;
font-size: 0.25rem;
text-align: right;
.van-button--mini {
padding: 0.25rem 0.2rem !important;
font-size: 0.25rem !important;
border-radius: 300px;
}
.detail {
border: none;
}
}
}
}
.bill:nth-child(n + 2) {
margin-top: 0.5rem;
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,44 @@
<template>
<div class="success-box">
<div class="cont">
<img src="../assets/img/success.png" alt="">
<h3>支付成功</h3>
</div>
</div>
</template>
<script>
export default {
name: "paySuccess"
}
</script>
<style scoped="scoped">
.success-box {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 10;
background: white;
}
.cont {
text-align: center;
font-size: 0.28rem;
width: 60%;
padding-top: 2rem;
margin: 0 auto;
}
.cont img {
width: 80%;
}
.cont p {
color: #999;
margin-top: 0.5rem;
text-align: left;
}
</style>

@ -0,0 +1,54 @@
<template>
<div class="tip-container">
<div class="top">
当前手机号未绑定学生您可前往添加
</div>
<div class="image"></div>
<div class="bottom">
<van-button color="#f6a138" style="width: 50%; border-radius: 10px;" @click="toBindStudent">去添加</van-button>
</div>
</div>
</template>
<script>
export default {
name: "tip",
methods: {
//
toBindStudent() {
this.$router.push({
path: '/bindStudent',
})
}
}
}
</script>
<style scoped lang="scss">
.tip-container {
height: 100%;
padding-top: .5rem;
padding-bottom: .3rem;
.top {
padding: 0.1rem 0.1rem 0.1rem 0.7rem;
text-align: left;
font-size: 0.28rem;
font-weight: 600;
}
.image {
height: 70%;
background-image: url('../assets/img/bj.png');
background-size: 100%;
background-repeat: no-repeat;
}
.bottom {
text-align: center;
padding-top: 0.3rem;
}
}
</style>

@ -0,0 +1,72 @@
<template>
<div class="tip-container">
<div class="top" v-if="status === 'TRADE_SUCCESS'">
当前账单支付成功请点击按钮返回账单主页
</div>
<div class="top" v-else>
当前账单未支付请点击按钮返回账单主页
</div>
<div class="image"></div>
<div class="bottom">
<van-button color="#f6a138" style="width: 50%; border-radius: 10px;" @click="toBillHome">返回主页</van-button>
</div>
</div>
</template>
<script>
import common from "../api/common";
export default {
name: "unionPayResult",
data() {
return {
status: ''
}
},
created() {
//
let orderStatus = common.getQueryVariable('status') || this.$route.query.status
console.info("订单状态: {}", orderStatus)
this.status = orderStatus
},
methods: {
//
toBillHome() {
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
}
}
</script>
<style scoped lang="scss">
.tip-container {
height: 100%;
padding-top: .5rem;
padding-bottom: .3rem;
.top {
padding: 0.1rem 0.1rem 0.1rem 0.7rem;
text-align: left;
font-size: 0.28rem;
font-weight: 600;
}
.image {
height: 70%;
background-image: url('../assets/img/bj.png');
background-size: 100%;
background-repeat: no-repeat;
}
.bottom {
text-align: center;
padding-top: 0.3rem;
}
}
</style>

@ -0,0 +1,87 @@
<template>
<div>
<PaySuccess v-if="paySuccessFlag"></PaySuccess>
</div>
</template>
<script>
import PaySuccess from './paySuccess'
export default {
name: "wxPay",
components: {
PaySuccess
},
data() {
return {
signatureData: {
orderCode: '',
wxTimestamp: '',
wxNonceStr: '',
wxAppId: '',
wxPackage: '',
wxSign: '',
wxPayType: null,
payUrl: ''
},
paySuccessFlag: false
}
},
methods: {
//
goToPay(data) {
this.signatureData = data
if (this.wxPayType === 0) {
this.jsWxPay()
} else {
this.h5WxPay()
}
},
// h5
h5WxPay() {
window.location.href = this.payUrl
},
// js api
jsWxPay() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady);
}
} else {
this.onBridgeReady();
}
},
onBridgeReady() {
let that = this
let param = {
"appId": this.signatureData.wxAppId, //ID
"timeStamp": this.signatureData.wxTimestamp, //1970
"nonceStr": this.signatureData.wxNonceStr, //
"package": this.signatureData.wxPackage,
"signType": "RSA", //
"paySign": this.signatureData.wxSign
}
console.log(param)
WeixinJSBridge.invoke('getBrandWCPayRequest', param,
function (res) {
console.log()
console.log('支付结果提示', res)
if (res.err_msg == "get_brand_wcpay_request:ok") {
that.paySuccessFlag = true
that.$emit('orderSuccess')
// 使,
//res.err_msgok
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
that.$toast('支付取消,可在订单页面继续完成支付')
} else {
that.$toast('支付失败')
}
});
},
}
}
</script>

@ -0,0 +1,130 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const router = new VueRouter({
// mode: 'history',
// base: '/html/billApp/',
routes: [
{
path: '/index',
name: 'index',
meta: {
keepAlive: false,
requireAuth: false
},
component: resolve => (require(["@/page/index.vue"], resolve))
},
{
path: '/tip',
name: 'tip',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/tip.vue"], resolve))
},
{
path: '/bindStudent',
name: 'bindStudent',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/bindStudent.vue"], resolve))
},
{
path: '/home',
name: 'home',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/home.vue"], resolve))
},
{
path: '/billDetail',
name: 'billDetail',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/billDetail.vue"], resolve))
},
{
path: '/orderDetail',
name: 'orderDetail',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/orderDetail.vue"], resolve))
},
{
path: '/unionPayResult',
name: 'unionPayResult',
meta: {
keepAlive: false,
requireAuth: true
},
component: resolve => (require(["@/page/unionPayResult.vue"], resolve))
}
]
})
//全局前置守卫
router.beforeEach((to, from, next) => {
let toDepth = to.path.split('/').length
let fromDepth = from.path.split('/').length
if (toDepth < fromDepth) {
from.meta.keepAlive = false
to.meta.keepAlive = true
}
console.info("to: ", to)
console.info("from: ", from)
console.info("next: ", next)
// 判断是否需要登录权限
// if (to.meta.requireAuth) {
// // 获取token信息
// let token = ''
// let appId = localStorage.getItem("appId");
// if (appId) {
// let msg = JSON.parse(localStorage.getItem(appId));
// token = msg.tokenInfo.token
// }
// // 判断token
// if (token == null || token === "" || token === undefined) {
// // 跳转到缴费学校选择页
// next({path: '/index'});
// }
// }
if (sessionStorage.getItem('userInfo') || window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger') {
next();
} else {
new Promise(function (resolve, reject) {
// $.initGetAppBasicInfo(commonGetAppCallBack);
//
// function commonGetAppCallBack(bas) {
// // bas = {
// // "user_id": 111,
// // "head": "111",
// // "name": "111",
// // "sex": "1",
// // "phone": "111",
// // "regist_time": "111",
// // "weixin_openid": "",
// // "weixin_unionid": "",
// // "user_cert_status": -1
// // }
// sessionStorage.userInfo = JSON.stringify(bas);
// resolve(next());
// }
// reject()
resolve(next());
});
}
})
export default router

@ -0,0 +1,7 @@
module.exports = {
assetsDir: 'static',
parallel: false,
publicPath : './',
productionSourceMap: false,//不生成map文件
}

@ -0,0 +1,14 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

@ -0,0 +1,16 @@
# just a flag
ENV = 'development'
# base api
# VUE_APP_BASE_API = 'http://10.143.138.158:8301'
# VUE_APP_BASE_API = 'http://zbztest.yd-data.com/edu'
VUE_APP_BASE_API = 'https://jyjf.pzhdqrmtzx.com/edu'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = false

@ -0,0 +1,6 @@
# just a flag
ENV = 'production'
# base api ip:http://182.139.182.174:7301
#VUE_APP_BASE_API = 'http://10.143.138.158:8301'
VUE_APP_BASE_API = 'https://jyjf.pzhdqrmtzx.com/edu'

21
缴费-东区-yida/.gitignore vendored Normal file

@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

@ -0,0 +1,5 @@
### 校园旧版缴费页面
此模块对接yida的app
node版本14.3.0

@ -0,0 +1,13 @@
// module.exports = {
// presets: [
// '@vue/app'
// ],
// plugins: [
// ['import', {
// libraryName: 'vant',
// libraryDirectory: 'es',
// style: true
// }, 'vant']
// ]
// }
//

@ -0,0 +1,38 @@
{
"name": "defaultvue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"element-ui": "^2.15.6",
"moment": "^2.29.1",
"vant": "^2.12.9",
"vconsole": "^3.9.5",
"vue": "^2.5.17",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.2.0",
"@vue/cli-service": "^3.2.0",
"axios": "^0.21.1",
"babel-plugin-import": "^1.13.3",
"node-sass": "^5.0.0",
"sass": "^1.3.0",
"sass-loader": "^10.0.5",
"vue-router": "^3.5.1",
"vue-template-compiler": "^2.5.17"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title>缴费</title>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
</script>
</head>
<body>
<script src="js/jquery.min.js"></script>
<script src="./js/initCommon.js"></script>
<noscript>
<strong>We're sorry but defaultvue doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<script>
/**
* Created by lovo_bdk on 15-12-17.
*/
!(function (win, doc) {
function setFontSize() {
// 获取window 宽度
// zepto实现 $(window).width()就是这么干的
var winWidth = window.innerWidth || window.screen.availWidth || document.body.clientWidth || 540;
if (winWidth > 750) {
winWidth = 750
} else if (winWidth == 980) {
winWidth = 375
}
doc.documentElement.style.fontSize = (winWidth / 750) * 100 + 'px';
}
var evt = 'onorientationchange' in win ? 'orientationchange' : 'resize';
var timer = null;
win.addEventListener(evt, function () {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}, false);
win.addEventListener("pageshow", function (e) {
if (e.persisted) {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}
}, false);
//初始化
setFontSize();
}(window, document));
// function setRootFontSize(){var t,e,o=750,i=0;o&&(t=document.documentElement.clientWidth/o),i&&(e=document.documentElement.clientHeight/i);var d=1.5;if(t||e){var m=Math.min(t||d,e||d);d<m&&(m=d),document.getElementsByTagName("html")[0].style.fontSize=100*m+"px"}}window.addEventListener("resize",setRootFontSize),setRootFontSize()
</script>
<!--<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script>-->
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
// 关闭下拉刷新
$.initCloseUpdate()
// $.initGetAppBasicInfo(fun)
function returnCurrentUrl() {
console.log("进入ios登录回调")
}
</script>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,968 @@
//需要引入jquery
var JKEventHandler = {
callNativeFunction: function (nativeMethodName, params, callBackID, callBack) {
var message;
if (!callBack) {
message = {'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'methodName': nativeMethodName, 'params': params, 'callBackID': callBackID};
if (!JKBridgeEvent._listeners[callBackID]) {
JKBridgeEvent.addEvent(callBackID, function (data) {
callBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
newCallNativeFunction: function (nativeMethodName, params, callBackID, successCallBack, failureCallBack) {
var message;
if (successCallBack && failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (successCallBack && !failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (failureCallBack && !successCallBack) {
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'type': 'NewJSFunction', 'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
callBack: function (callBackID, data) {
JKBridgeEvent.fireEvent(callBackID, data);
},
removeAllCallBacks: function (data) {
JKBridgeEvent._listeners = {};
}
};
var JKBridgeEvent = {
_listeners: {},
addEvent: function (type, fn) {
if (typeof this._listeners[type] === "undefined") {
this._listeners[type] = [];
}
if (typeof fn === "function") {
this._listeners[type].push(fn);
}
return this;
},
fireEvent: function (type, param) {
var arrayEvent = this._listeners[type];
if (arrayEvent instanceof Array) {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (typeof arrayEvent[i] === "function") {
arrayEvent[i](param);
}
}
}
return this;
},
removeEvent: function (type, fn) {
var arrayEvent = this._listeners[type];
if (typeof type === "string" && arrayEvent instanceof Array) {
if (typeof fn === "function") {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (arrayEvent[i] === fn) {
this._listeners[type].splice(i, 1);
break;
}
}
} else {
delete this._listeners[type];
}
}
return this;
}
};
$.extend({
// app公共方法
//获取basicinfo,需传入回调方法
initGetAppBasicInfo: function (fun) {
var sys = $.initGetAppSys();
var basicInfo;
try {
if (sys == 1) {
basicInfo = androidIntent.getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} else if (sys == 2) {
try {
basicInfo = getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} catch (e) {
JKEventHandler.callNativeFunction('getBasicInfo', null, 'getBasicInfoCallback', function (data) {
basicInfo = data;
basicInfo = JSON.parse(basicInfo)
basicInfo.centerId = basicInfo.centerid;
fun(basicInfo)
JKEventHandler.removeAllCallBacks()
});
}
} else {
fun(basicInfo)
}
} catch (e) {
fun(basicInfo)
}
// basicInfo = {
// userId:'',
// nickname:'',
// getIsLogin:1,1表示登录
// longitude:'',
// imei:'',
// latitude:'',
// version:'版本4.2.5',
// loginToken:'',
// userType:3,
// loginType:3,1、手机2、微信3、qq
// }
},
//判断系统类型
initGetAppSys: function () {
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
return 1;
}
if (isIOS) {
return 2;
}
return 3;
},
//调起登录页面
initToAppLogin: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentlogin()
} else if (sys == 2) {
try {
intentlogin()
} catch (e) {
JKEventHandler.callNativeFunction('intentlogin', {}, null, null);
}
}
} catch (e) {
}
},
initAppendRefresh(bgColor, infoBgColor, btnBgColor, btnColor, imgUrl, btnText) {
// bgColor-整个背景,infoBgColor-中间框背景色,btnBgColor-按钮背景色,btnColor-按钮字体颜色,imgUrl-图片路径 btnText-按钮文字
$('body').prepend('<div style="position:fixed;left:0;bottom:0;width:100vw;height:100vh;z-index:999;background: ' + (bgColor || "transparent") +
'"><div style="position:absolute;width:80%;left:50%;top: 50%;padding:20px 10px;border-radius:8px;background:' + (infoBgColor || '#fff') +
';transform: translate(-50%,-50%)">\n' +
' <img src="' + imgUrl +
'" alt="" style="display:block;width:100px;margin:0 auto 20px;">\n' +
' <a href="javascript:location.reload();" style="width:120px;text-align:center;display:block;margin:0 auto;padding: 0 6px;border-radius:4px;line-height:30px;font-size: 14px;background:' + (btnBgColor || 'red') +
';color:' + (btnColor || '#fff') +
'">' + (btnText || '登录成功') +
'</a></div></div>')
},
//调绑定手机号页面
initToBindPhone: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentBindMobilePhone()
} else if (sys == 2) {
try {
intentBindMobilePhone()
} catch (e) {
JKEventHandler.callNativeFunction('intentBindMobilePhone', {}, null, null);
}
}
} catch (e) {
}
},
//是否登录app
initIsLoginApp: function (basicInfo) {
if (basicInfo.getIsLogin && basicInfo.getIsLogin == 1) {
return true
} else {
return false
}
},
//是否在app内
initIsInApp: function (basicInfo) {
if (basicInfo) {
return true
} else {
return false
}
},
//更新app的token
initUploadAppToken: function (token) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.getRefreshLoginTokenFromH5(token)
} else if (sys == 2) {
try {
getRefreshLoginTokenFromH5(token)
} catch (e) {
JKEventHandler.callNativeFunction('getRefreshLoginTokenFromH5', token, null, null);
}
}
} catch (e) {
}
},
//新开APP窗口
initOpenNewWebview: function (url, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentWebViewActivity(url, (title || ''))
} else if (sys == 2) {
try {
intentWebViewActivity(url, title)
} catch (e) {
JKEventHandler.callNativeFunction('intentWebViewActivity', {title: title, url: url}, null, null);
}
}
} catch (e) {
location.href = url
}
},
//重定义app title
initTitleModify: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSetTitle(title);
} else if (sys == 2) {
try {
updateTitle(title);
} catch (e) {
JKEventHandler.callNativeFunction('updateTitle', title, null, null);
}
}
} catch (e) {
$('title').text(title)
}
},
//判断版本
initJudgeVersion: function (basc) {
var sys = $.initGetAppSys();
if (basc) {
var version = basc.version;
if (sys == 1) {
if (parseInt(version.replace(/\./g, '')) < 425) {
$.initAppendVersionMask('4.2.5')
}
} else if (sys == 2) {
if (parseInt(version.replace(/\./g, '')) < 435) {
$.initAppendVersionMask('4.35')
}
}
}
},
initAppendVersionMask: function (ver) {
// $('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p><div style="text-align: center;font-size: 0;margin: .2rem 0;"><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #333;border: 1px solid #333;" onclick="$.initCloseVerisionMask()">以后再说</span><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #fff;border: 1px solid #e44c4c;background-color: #e44c4c">立即升级</span></div></div></div>')
$('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p></div></div>')
},
//关闭更新提示
initCloseVerisionMask: function () {
$('#initVersionMask').remove();
return false
},
//跳转到升级页面
initToUpgradePage: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSystenSetting("1");
} else if (sys == 2) {
try {
intentSystenSetting("1")
} catch (e) {
JKEventHandler.callNativeFunction('intentSystenSetting', '1', null, null);
}
}
} catch (e) {
}
},
//唤起群组聊天界面
initJoinGroupWithChat: function (title, groupId) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
var obj = {
title: title,
groupId: groupId
};
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
initOpenAppActivity: function (json) {
//json {"appInterfaceType":"activity:\/\/newsListPage","mannerId":"3","columnId":"13"} h5需要调用方法openAppActivity将json作为参数传入
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.openAppActivity(json)
} else if (sys == 2) {
try {
openAppActivity(json)
} catch (e) {
JKEventHandler.callNativeFunction('openAppActivity', json, null, null);
}
}
} catch (e) {
}
},
//关闭当前页面
initBackToRoot: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.closeActivity()
} else if (sys == 2) {
try {
backToTop()
} catch (e) {
try {
JKEventHandler.callNativeFunction('backToTop', {}, null, null);
} catch (e) {
}
}
}
} catch (e) {
}
},
//关闭下拉刷新功能
initCloseUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.closeHeaderUpdate()
} else if (sys == 2) {
try {
closeHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('closeHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//开启下拉刷新功能
initOpenUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.openHeaderUpdate()
} else if (sys == 2) {
try {
openHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('openHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initSingleChat: function (userId, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentChat(title || '', userId)
} else if (sys == 2) {
try {
intentSingleChat(userId)
} catch (e) {
JKEventHandler.callNativeFunction('intentSingleChat', userId, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initEvokeChat: function (interviewerId, joberType, positionId) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
var obj = {
interviewerId: interviewerId,
joberType: joberType,
positionId: positionId
};
try {
if (sys == 1) {
androidIntent.intentJobMessage(JSON.stringify(obj))
} else if (sys == 2) {
try {
intentJobMessage(JSON.stringify(obj))
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessage', JSON.stringify(obj), null, null);
}
}
} catch (e) {
}
},
//唤起求职列表
initGetChatList: function (joberType) {
// 0表示招聘者1表示求职者
var sys = $.initGetAppSys();
try {
// alert(sys)
if (sys == 1) {
androidIntent.intentJobMessageList(joberType)
} else if (sys == 2) {
try {
intentJobMessageList(joberType)
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessageList', joberType, null, null);
}
}
} catch (e) {
}
},
//发起群聊
intentGroupChat: function (groupId) {
// groupId 两微一端的群id 字符串
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(groupId)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
//调起扫一扫
initToScan: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentScan()
} else if (sys == 2) {
try {
intentScan()
} catch (e) {
JKEventHandler.callNativeFunction('intentScan', {}, null, null);
}
}
} catch (e) {
}
},
// 进入腾讯云课堂
initIntoCloudClassRoom(obj) {
// 房间号 serial
// 密码 password
// 用户昵称 nickname
// 地址 host
// 主机 server
// 端口号 port
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCloudClassRoom(obj)
} else if (sys == 2) {
try {
intentCloudClassRoom(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentCloudClassRoom', obj, null, null);
}
}
} catch (e) {
}
},
// 关闭侧滑返回
initCloseSlideBack: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.swipeBackEnable()
} else if (sys == 2) {
try {
notAllowRightSlideTurnBack()
} catch (e) {
JKEventHandler.callNativeFunction('notAllowRightSlideTurnBack', {}, null, null);
}
}
} catch (e) {
}
},
downloadImageWithUrl: function (urlStr) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.downloadImageWithUrl(urlStr);
} else if (sys == 2) {
try {
downloadImageWithUrl(urlStr);
} catch (e) {
JKEventHandler.callNativeFunction('downloadImageWithUrl', urlStr, null, null);
}
}
} catch (e) {
}
},
initHideTopRightTool: function (type) {
//0 不显示右上角功能(会开启原生左上角的返回按钮)
// 1 不显示分享按钮
//2 不显示关闭按钮 (会开启原生左上角的返回按钮)
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.rightViewChange(type + '')
} else if (sys == 2) {
try {
rightViewChange(type + '')
} catch (e) {
JKEventHandler.callNativeFunction('rightViewChange', type + '', null, null);
}
}
} catch (e) {
}
},
//拨打电话
initAppCallPhone: function (number) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCallPhone(number);
} else if (sys == 2) {
try {
intentCallPhone(number);
} catch (e) {
JKEventHandler.callNativeFunction('intentCallPhone', number, null, null);
}
}
} catch (e) {
}
},
//跳详情页面
initIntoDetailsView: function (id) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentNewsDetail(id);
} else if (sys == 2) {
try {
intentNewsDetail(id);
} catch (e) {
JKEventHandler.callNativeFunction('intentNewsDetail', id, null, null);
}
}
} catch (e) {
}
},
//分享
initOpenAppShare: function (title, icon, des, url) {
var sys = $.initGetAppSys();
if (sys == 1) {
try {
androidShare.shareWebView(JSON.stringify({
title: title,
icon: icon,
descript: des,
shareUrl: url
}));
} catch (e) {
}
} else if (sys == 2) {
try {
littleShare({
title: title,
icon: icon,
descript: des,
shareUrl: url
});
} catch (e) {
JKEventHandler.callNativeFunction('littleShare', {
title: title,
icon: icon,
descript: des,
shareUrl: url
}, 'littleShareCallback', function (data) {
});
}
}
},
//实时获取定位
initGetLocation: function (fun) {
// ios:5.0.3 安卓5.1.0及以后有这个方法 需在全局定义一个方法jsAppLocationCallback接收参数
// 安卓返回对象 IOS为字符串 {longitude:'',latitude:''}
var sys = $.initGetAppSys();
var coordinate;
try {
if (sys == 1) {
androidIntent.getAppLocation();
// JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
// coordinate = data;
// fun(coordinate)
// });
} else if (sys == 2) {
JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
coordinate = data;
fun(coordinate)
});
} else {
fun(coordinate)
}
} catch (e) {
fun(coordinate)
}
},
//禁止返回上一页
initReturnToPreviousPage: function (type) {
// 禁止返回上一页参数传1为禁止0为允许
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.noReturnToPreviousPage(type);
} else if (sys == 2) {
JKEventHandler.callNativeFunction('noReturnToPreviousPage', type, 'noReturnToPreviousPageCallback', function (data) {
});
} else {
}
} catch (e) {
}
},
// IOS允许视频非全屏播放
initIosVideoPlayInline: function (str) {
// str 值为true或者false字符串
var sys = $.initGetAppSys();
if (sys == 2) {
try {
JKEventHandler.callNativeFunction('allowsInlineMediaPlayback', str, 'allowsInlineMediaPlaybackCallback', function (data) {
});
} catch (e) {
}
}
},
//采编APP 自定义右上角按钮 点击回调方法名称publishMessage
initOpinionsToolbar: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.settingTitleBar(title)
} else if (sys == 2) {
try {
settingTitleBar(title)
} catch (e) {
JKEventHandler.callNativeFunction('settingTitleBar', title, null, null);
}
}
} catch (e) {
}
},
//获取两微一端用户信息
initGetUserInfo: function (root, id, async) {
var obj;
$.ajax({
url: root + '/a/userRelation/getStatisticsByUserId',
data: {
userId: id,
},
async: async || false,
success: function (res) {
try {
res = JSON.parse(res)
} catch (e) {
}
obj = res;
}
})
return obj;
},
initGetUrl: function (etcenter) {
// etcenter 1富顺 2宣汉 3仁寿 4古蔺 6荣县 7高坪 8雷波 9南充 12东坡 14南溪 88公司sass环境
var initMedia,//媒资地址
initCdn,//媒资加速地址
initMicro,//两微一端
initDown,//下载APP地址
initLogo;//logo
etcenter = parseInt(etcenter);
switch (etcenter) {
case 1:
initMedia = 'http://fsunifiedrelease-api.yd-data.com:8064';
initCdn = '';
initMicro = 'http://fsmpfc.yd-data.com:8360';
initDown = 'http://fsmpfc.yd-data.com:8090/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/fushun.png';
break;
case 2:
initMedia = 'http://222.215.99.149:8064';
initCdn = '';
initMicro = 'http://cityreception.yd-data.com:8074';
initDown = 'http://country.yd-data.com/xh_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/xuanhan.png';
break;
case 3:
// initMedia = 'http://rscmjrp.yd-data.com:8064';
initMedia = 'https://meizi.scrstv.com';
initCdn = 'http://svod.scrstv.com';
initMicro = 'https://lwyd.scrstv.com';
initDown = 'https://h5.scrstv.com/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/renshou.jpg';
break;
case 4:
initMedia = 'https://glmmp.gulinrongmei.com';
initCdn = '';
initMicro = 'https://lwyd8073.gulinrongmei.com';
initDown = 'https://h5.gulinrongmei.com/gl_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gulin.jpg';
break;
case 6:
initMedia = 'http://rxmmp.rongxianwang.net:8064';
initCdn = '';
initMicro = 'http://www.rongxianwang.net:8073';
initDown = 'http://110.189.172.134:8082/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/rongxian.png';
break;
case 7:
initMedia = 'https://mz.scgpnews.com.cn';
initCdn = '';
initMicro = 'https://lwyd.scgpnews.com.cn';
initDown = 'http://h5.scgpnews.com.cn/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gaoping.jpg';
break;
case 8:
initMedia = 'http://lbiomp.lbxww.gov.cn:8064';
initCdn = '';
initMicro = 'http://lbiomp.lbxww.gov.cn:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/leibo.png';
break;
case 9:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?areaId=9&centerId=9';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanchong.png';
break;
case 29:
initMedia = 'https://mz.baqrm.com';
initCdn = '';
initMicro = 'https://lwyd.baqrm.com';
initDown = 'https://cdnbah5.baqrm.com/html/app/download.html';
initLogo = 'https://cdnbah5.baqrm.com/html/hotnews/code/images/barm.png';
break;
case 9901:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=901';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-shunqing.png';
break;
case 9903:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=903';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-jialing.png';
break;
case 9904:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=904';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/langzhong.png';
break;
case 9905:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=905';
initLogo = '//h5.scrstv.com/html/commonJs/images/mc-yingshan.png';
break;
case 9906:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=906';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-nanbu.png';
break;
case 9907:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=907';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-xichong.png';
break;
case 9908:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=908';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-yilong.png';
break;
case 9909:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//47.108.86.0:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=909';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-pengzhou.png';
break;
case 12:
initMedia = 'http://dprm.info:8064';
initCdn = '';
initMicro = 'http://lwyd.dprm.info:8073';
initDown = 'http://vms.dprm.info/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/dongpo.png';
break;
case 14:
initMedia = 'http://125.64.247.157:8064';
initCdn = '';
initMicro = 'http://125.64.247.157:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanxi.png';
break;
case 888802:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
case 888803:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
default:
break
}
return {
mediaUrl: initMedia,
cdnUrl: initCdn,
microUrl: initMicro,
downloadUrl: initDown,
logoUrl: initLogo
}
},
initAddLog: function (userId, loginToken, areaId, mobile) {
$.ajax({
url: 'https://h5.yd-data.com:8098/log',
data: {
url: decodeURIComponent(location.href),
userId: userId,
loginToken: loginToken,
areaId: areaId,
mobile: mobile
},
success: function (data) {
}
})
},
// 设置支付域名
setReferer: function (url) {
var sys = $.initGetAppSys();
console.log("000")
try {
if (sys == 1) {
console.log(111)
androidShare.intentSetReferer(url)
console.log(222)
} else if (sys == 2) {
}
} catch (e) {
}
}
})

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

(image error) Size: 1.6 KiB

@ -0,0 +1,94 @@
<template>
<div id="app">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
export default {
name: 'app'
}
</script>
<style>
html, body, #app {
margin: 0;
padding: 0;
height: 100%;
}
ul, li, p, h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
li {
list-style: none;
}
a {
text-decoration: none;
color: #333;
}
body {
font-size: 0.24rem;
}
input, button {
outline: none;
}
#app {
font-family: PingFangSC-Regular;
color: #2c3e50;
/* margin-top: 60px; */
}
* {
word-break: break-all;
box-sizing: border-box;
}
.display-flex {
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.space-between {
-webkit-justify-content: space-between;
justify-content: space-between;
}
.space-center {
-webkit-justify-content: center;
justify-content: center;
}
.space-around {
-webkit-justify-content: space-around;
justify-content: space-around;
}
.align-items-center {
-webkit-align-items: center;
align-items: center;
}
.flex-direction-column {
-webkit-flex-direction: column;
flex-direction: column;
}
.header .van-dropdown-menu__bar {
background-color: #F8F8F8;
border: 0;
box-shadow: none;
}
</style>

@ -0,0 +1,83 @@
import http from './http.js'
let resquest = process.env.VUE_APP_BASE_API
export default {
// 获取微信token
getAccessToken(param) {
return http.get(`https://api.weixin.qq.com/sns/oauth2/access_token`, param)
},
// 知不知登录
login(param) {
return http.get(`${resquest}/auth/social/qywx/login`, param)
},
// 公众号登录
bindWxOpenId(param) {
return http.get(`${resquest}/user/user/bindWxOpenId`, param)
},
// app登录
appLogin(param) {
return http.get(`${resquest}/auth/social/app/login`, param)
},
// 根据名称和类型查询教育局学校列表
findSchoolPageList(param) {
return http.post(`${resquest}/system/in/dept/listSchoolPage`, param, false)
},
// 根据名称查询教育局缴费学校列表
findPaySchoolList(param) {
return http.get(`${resquest}/system/in/dept/listPaySchool`, param, false)
},
// 判断是否创建过家长信息
checkParent(param) {
return http.get(`${resquest}/user/out/parent/checkParent`, param, false)
},
// 家长查询拥有的学生
listStudentByParent(param) {
return http.get(`${resquest}/user/student/listStudentByParent`, param)
},
// 查询家校部门树
getUserDeptTree(deptId) {
return http.get(`${resquest}/user/eduUserDept/getUserDeptTree`, {deptId: deptId || null})
},
// 绑定学生信息
bindStudent(param) {
return http.post(`${resquest}/user/h5/student/bindStudent`, param)
},
//===========================账单相关接口==============================
// 查询账单列表
listH5Bill(param) {
return http.post(`${resquest}/mall/h5/eduBill/listH5Bill`, param)
},
// 查询账单详情
getH5BillInfo(param) {
return http.post(`${resquest}/mall/h5/eduBill/getH5BillInfo`, param)
},
// 生成订单
createBillOrder(param) {
return http.post(`${resquest}/mall/h5/eduBill/createBillOrder`, param)
},
// 账单订单完成
billOrderSuccess(param) {
return http.get(`${resquest}/mall/h5/eduBill/billOrderSuccess`, param)
},
// 查询账单订单列表数据
listH5BillOrderPage(param) {
return http.post(`${resquest}/mall/h5/eduBill/listH5BillOrderPage`, param)
},
// 查询账单订单详情
getH5BillOrderInfo(param) {
return http.get(`${resquest}/mall/h5/eduBill/getH5BillOrderInfo`, param)
},
// 继续支付
continuePayOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/continuePayOrder`, param)
},
// 取消支付
cancelOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/cancelOrder`, param)
},
// 查看是否存在待支付的订单
checkExistOrder(param) {
return http.get(`${resquest}/mall/h5/eduBill/checkExistOrder`, param)
}
}

@ -0,0 +1,142 @@
export default {
// 获取路径参数
getQueryVariable: function (variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
},
idCardValid: function (code) {
var city = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江 ",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北 ",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏 ",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外 "
};
var tip = "";
var pass = true;
if (!code || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code)) {
tip = "身份证号格式错误";
pass = false;
} else if (!city[code.substr(0, 2)]) {
tip = "地址编码错误";
pass = false;
} else {
//18位身份证需要验证最后一位校验位
if (code.length == 18) {
code = code.split('');
//∑(ai×Wi)(mod 11)
//加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
//校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
var sum = 0;
var ai = 0;
var wi = 0;
for (var i = 0; i < 17; i++) {
ai = code[i];
wi = factor[i];
sum += ai * wi;
}
var last = parity[sum % 11];
if (parity[sum % 11] != code[17]) {
tip = "校验位错误";
pass = false;
}
}
}
// if (!pass) alert(tip);
return pass;
},
mobileValid: function (mobile) {
var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
return reg_tel.test(mobile)
},
getUserMsg: function () {
var appId = localStorage.getItem("appId");
var msg = JSON.parse(localStorage.getItem(appId));
return msg.userMsg
},
getIdentityInfo: function () {
var appId = localStorage.getItem("appId");
var msg = JSON.parse(localStorage.getItem(appId));
return msg.identity
},
getToken: function () {
var token = ''
var appId = localStorage.getItem("appId");
if (appId) {
var msg = JSON.parse(localStorage.getItem(appId));
token= msg.tokenInfo.token
}
return token
},
// 获取appId 企业微信为coprIdapp为学校id(schoolId)公众号为appId
getAppId: function() {
return localStorage.getItem("appId");
},
// 获取app登录用户信息
getAppUserInfo: function () {
let appUserInfo = {}
let userInfo = sessionStorage.getItem("userInfo")
if (userInfo) {
appUserInfo = JSON.parse(sessionStorage.getItem("userInfo"))
}
return appUserInfo
},
// 获取登录用户唯一标识
getUniqueCode: function () {
let code = ''
let uniqueCode = localStorage.getItem("uniqueCode" + this.getAppId())
if (uniqueCode) {
code = uniqueCode
}
return code
},
// 获取当前学校选择学生的下标
getStudentIndex: function () {
let studentIndex = 0
let chooseStudentIndex = sessionStorage.getItem("studentIndex" + this.getAppId())
if (chooseStudentIndex) {
studentIndex = parseInt(chooseStudentIndex)
}
return studentIndex
}
}

@ -0,0 +1,50 @@
/**** http.js ****/
// 导入封装好的axios实例
import request from './request'
const http ={
/**
* methods: 请求
* @param url 请求地址
* @param params 请求参数
* @param security 是否鉴权 默认是
*/
get(url,params,security=true){
const config = {
method: 'get',
url:url,
security:security
}
if(params) config.params = params
return request(config)
},
post(url,params,security=true){
const config = {
method: 'post',
url:url,
security:security
}
if(params) config.data = params
return request(config)
},
put(url,params,security=true){
const config = {
method: 'put',
url:url,
security:security
}
if(params) config.params = params
return request(config)
},
delete(url,params,security=true){
const config = {
method: 'delete',
url:url,
security:security
}
if(params) config.params = params
return request(config)
}
}
//导出
export default http

@ -0,0 +1,366 @@
import {
Toast
} from 'vant';
import axios from 'axios'
import common from './common'
import api from "./api";
const InitLogin = {
homeUrl: '',// 登陆后跳转的地址,用于重新登录流程
useOpenId: false, // 是否要绑定openId
succFn: null, // 成功回调方法
wappId: '', // 商户主体id
loginType: null,//登陆类型 0-企业微信,1-微信公众2-app
appId: '', // 登录主体标识企业微信为coprIdapp为学校id(schoolId)公众号为appId
userType: 0, //0-教职工1-家长
state: '', // 自定义参数,企业微信登录为应用标识
appLoginMsg: {},//登录用户信息 {userMsg:系统用户信息,refreshToken:刷新token,token:,token_expire_date:token过期时间戳,identity:身份信息,openId:用户openId}
uniqueCode: '',//当前用户唯一标识(仅适用于app方式)
/**
* 入口方法
* @param succ_fn 登录成功回调方法
* @param useOpenId 使用openId
* @param testMode 是否开发环境
* @param testParam 开发环境登录信息
*/
init({loginSuccess, state, userType, useOpenId, uniqueCode, testMode = false, appId, testParam = {}}) {
// console.log("初始化")
this.useOpenId = useOpenId
this.succFn = loginSuccess
// 从路径获取登录参数
this.state = state || common.getQueryVariable("state")
this.userType = userType || Number(common.getQueryVariable("userType"))
this.appId = appId || common.getQueryVariable("appId")
|| common.getQueryVariable("corpId")
|| common.getQueryVariable("schoolId")
this.loginType = Number(common.getQueryVariable("loginType")) || this.getLoginType()
this.uniqueCode = uniqueCode
if (testMode === true) {
this.appId = 'schoolId2'
this.appLoginMsg = {
"userMsg": {
"userId": testParam.id,
"deptId": 2,
"identityId": testParam.identityId
},
"tokenInfo": {
"token": testParam.token
},
"identity": {
"parentId": testParam.identityId
}
}
localStorage.setItem('appId', this.appId)
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
this.succFn()
return
}
localStorage.setItem('appId', this.appId)
this.appLoginMsg = localStorage.getItem(this.appId);
try {
this.appLoginMsg = JSON.parse(this.appLoginMsg)
} catch (e) {
// 用户信息不存在进行初始化
this.appLoginMsg = {
'userMsg': {}
}
}
// 初始化用户登录信息
if (!this.appLoginMsg) {
this.appLoginMsg = {
'userMsg': {}
}
}
console.log("appLoginMsg", this.appLoginMsg)
console.log("uniqueCode", this.uniqueCode)
// 已登录进入页面
if (this.appLoginMsg.userMsg
&& Object.keys(this.appLoginMsg.userMsg).length > 1
&& this.appLoginMsg.tokenInfo) {
// 获取唯一标识
let getUniqueCode = common.getUniqueCode()
if (getUniqueCode && getUniqueCode === this.uniqueCode) {
this.afterIn()
} else {
// 移除缓存后重新登录
let storageAppId = localStorage.getItem("appId")
localStorage.removeItem("uniqueCode" + storageAppId)
localStorage.removeItem(storageAppId)
this.startLogin()
}
} else { //未登录进入登录流程
if (this.appId == this.wappId && this.useOpenId) {
this.wxLogin(this.appId, 0)
} else {
this.startLogin()
}
}
},
/**
* 开始登录
*/
startLogin() {
console.log("开始登录")
// 第一次登录
switch (this.loginType) {
case 0:
case 1:
this.wxLogin(null, 1);
break;
case 2:
this.appLogin()
break;
default:
console.log("1231231")
return;
}
},
/**
* app登录
*/
appLogin() {
let that = this
try {
$.initGetAppBasicInfo(function (data) {
var params = {
areaId: data.areaId,
mobile: data.userPhone,
userId: data.userId,
schoolId: that.appId,
type: that.userType
}
that.apiLogin(params)
});
} catch (e) {
Toast('错误')
}
},
/**
* 微信oauth2授权登录流程
* @param aid 主体id
* @param type 0-绑定商户openId1-登录
*/
wxLogin: function (aid, type) {
console.log("微信登录")
var appid = aid || this.appId
if (!aid) {
localStorage.setItem('appId', appid)
}
// 微信方的授权码
var code = common.getQueryVariable('code')
// 商户id
let a = localStorage.getItem('wappId')
if (appid != a) {
localStorage.setItem('wappId', appid)
}
if (!code || appid != a) { //用户第一次进入页面,跳转授权
var url = encodeURIComponent(location.href)
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid +
'&redirect_uri=' + url + '&response_type=code&scope=snsapi_base#wechat_redirect';
} else { //授权后跳回页面=》进入登录流程
if (type == 0) {
this.bindWxOpenId(code)
} else {
var params = {
corpId: this.appId,
code: common.getQueryVariable('code'),
state: this.state,
type: this.userType
}
this.apiLogin(params)
}
}
},
/**
* 绑定微信公众号下openId
* @param code 微信授权码
*/
bindWxOpenId(code) {
this.appId = localStorage.getItem('appId')
var appMsg = localStorage.getItem(this.appId)
var userMsg = {}
if (appMsg) {
appMsg = JSON.parse(appMsg)
userMsg = appMsg.userMsg
}
axios.get(process.env.VUE_APP_BASE_API + '/user/user/bindWxOpenId', {
params: {
code: code,
identityId: userMsg.identityId,
type: 0
}
}).then(res => {
if (res.data.data) {
var openId = res.data.data
appMsg.identity.wxPublicOpenId = openId
this.appLoginMsg = appMsg
localStorage.setItem(common.getQueryVariable('corpId'), JSON.stringify(appMsg))
this.succFn(userMsg.identityId)
} else {
Toast('登录失败')
}
})
},
/**
* 调用系统登录
* @param params 登录参数
*/
apiLogin(params) {
console.log("api登录")
var url = process.env.VUE_APP_BASE_API
switch (this.loginType) {
case 0:
url = url + '/auth/social/qywx/login';
break;
case 1:
params.appId = this.appId
url = url + '/auth/social/wxpublic/login';
break;
case 2:
url = url + '/auth/social/app/login';
break;
}
axios.get(url, {params: params}).then(res => {
this.afterLogin(res)
}).catch(err => {
Toast('登录失败,网络错误')
})
},
/**
* 登陆后数据处理
* @param res
* @returns {{this.appLoginMsg: InitLogin.this.appLoginMsg, this.appId: *}}
*/
afterLogin: function (res) {
console.log("登录后数据处理")
if (res) {
var toekn_info = res.data.data.token
var userMsg = res.data.data.user
var identity = res.data.data.identity
// token信息
if (toekn_info) {
var tokenInfo = {}
tokenInfo.refreshToken = toekn_info.refresh_token
tokenInfo.token = toekn_info.token_type + ' ' + toekn_info.access_token
// 计算token有效期限
var token_expire = toekn_info.expires_in
let now = new Date().getTime()
now = parseInt(now / 1000)
let last_date = now - 0 + (token_expire - 0)
tokenInfo.tokenExpireDate = last_date
this.appLoginMsg.tokenInfo = tokenInfo
}
// 用户信息
if (identity) {
this.appLoginMsg.identity = identity
}
// 系统用户信息
if (userMsg) {
this.appLoginMsg.userMsg = userMsg
}
}
// 保存信息
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
localStorage.setItem("uniqueCode" + this.appId, this.uniqueCode)
this.succFn()
},
/**
* 刷新token
*/
refreshToken: function () {
// 刷新token
var tokenInfo = this.appLoginMsg.tokenInfo;
let rtoken = tokenInfo.refreshToken
axios.post(process.env.VUE_APP_BASE_API + '/auth/oauth/token?grant_type=refresh_token&refresh_token=' +
rtoken, {}, {
headers: {
'Authorization': 'Basic YXBwOjEyMzQ1Ng=='
}
}).then(res => {
if (res.data.access_token) {
let login_data = res.data
tokenInfo.refreshToken = login_data.refresh_token
tokenInfo.token = login_data.token_type + ' ' + login_data.access_token
var token_expire = login_data.expires_in //过期时间秒
let now = new Date().getTime()
now = parseInt(now / 1000)
let last_date = now - 0 + (token_expire - 0)
tokenInfo.tokenExpireDate = last_date
this.appLoginMsg.tokenInfo = tokenInfo
localStorage.setItem(this.appId, JSON.stringify(this.appLoginMsg))
this.succFn()
} else {
this.retryLogin()
}
}).catch(err => {
console.log("使用refresh_token重新获取token信息失败", err)
this.retryLogin()
});
},
/**
* 进入后的逻辑处理
* token过期等判断
*/
afterIn: function () {
var tokenInfo = this.appLoginMsg.tokenInfo;
let last_date = tokenInfo.tokenExpireDate
let now_date = parseInt(new Date().getTime() / 1000)
if (now_date > last_date) { //已过期调刷新token
this.refreshToken()
} else {
if (this.useOpenId) {
if (this.appLoginMsg.identity.wxPublicOpenId) {
this.succFn()
} else { //没有openid
localStorage.setItem('appId', this.appMsgName)
// 根据学校查询正确的openId
api.getAppIdBySchool({schoolId: this.appLoginMsg.userMsg.deptId}).then(res => {
this.wappId = res.data.data
this.wxLogin(this.wappId)
})
}
} else {
this.succFn()
}
}
},
/**
* 重新登录
*/
retryLogin: function () {
var appId = localStorage.getItem("appId");
if (appId) {
var appMsg = localStorage.getItem(appId);
if (appMsg) {
appMsg = JSON.parse(appMsg)
}
var tokenInfo = appMsg.tokenInfo
let last_date = tokenInfo.tokenExpireDate
let now_date = parseInt(new Date().getTime() / 1000)
if (now_date > last_date) { //已过期调刷新token
this.refreshToken()
}
localStorage.removeItem(appId)
localStorage.removeItem('appId')
localStorage.removeItem('wappId')
localStorage.removeItem("uniqueCode" + appId)
}
window.location.reload()
},
/**
* 微信环境使用微信登录非微信环境使用app登录
* @param param
* @returns {boolean}
*/
getLoginType(param) {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return 0;
} else {
return 2;
}
}
}
export default InitLogin

@ -0,0 +1,70 @@
/**** request.js ****/
// 导入axios
import axios from 'axios'
import qs from 'qs'
import {
Toast
} from 'vant';
import login from './loginConfig'
import common from './common'
const service = axios.create({
// 超时时间 单位是ms这里设置了3s的超时时间
timeout: 300 * 1000
})
// 2.请求拦截器
service.interceptors.request.use(config => {
if (config.security!==false) {
config.headers = {
"Content-Type": "application/json",
"Authorization": common.getToken()
}
} else {
config.headers = {
"Content-Type": "application/json",
}
}
if (config.method === 'get') {
config.paramsSerializer = function (params) {
return qs.stringify(params, {
arrayFormat: 'comma'
})
}
console.log(config.paramsSerializer)
}
return config
}, error => {
Promise.reject(error)
})
// response interceptor
service.interceptors.response.use((config) => {
return config
}, (error) => {
if (error.response) {
const errorMessage = error.response.data === null ? '系统内部异常,请联系网站管理员' : error.response.data.message
switch (error.response.status) {
case 404:
Toast('很抱歉,资源未找到')
break
case 403:
Toast('很抱歉,您暂无该操作权限')
break
case 401:
Toast('很抱歉,认证已失效,请重新登录')
login.retryLogin()
break
default:
if (errorMessage === 'refresh token无效') {
Toast('登录已过期,请重新登录')
login.retryLogin()
} else {
Toast(errorMessage)
}
break
}
}
return Promise.reject(error)
})
export default service

@ -0,0 +1,14 @@
@font-face {
font-family:'notosans';
src: url(./notosans.otf);
}
body{
font-family: 'notosans' !important;
}
.van-progress{
border-radius: 100px;
}
.van-step--vertical .van-step__circle-container{
}

Binary file not shown.

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 7.5 KiB

Binary file not shown.

After

(image error) Size: 351 KiB

Binary file not shown.

After

(image error) Size: 521 B

Binary file not shown.

After

(image error) Size: 435 B

Binary file not shown.

After

(image error) Size: 448 B

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 1.9 KiB

Binary file not shown.

After

(image error) Size: 1.9 KiB

Binary file not shown.

After

(image error) Size: 29 KiB

Binary file not shown.

After

(image error) Size: 31 KiB

Binary file not shown.

After

(image error) Size: 9.0 KiB

Binary file not shown.

After

(image error) Size: 5.9 KiB

Binary file not shown.

After

(image error) Size: 3.8 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

@ -0,0 +1,153 @@
<template>
<div class="change-student" v-show="showChangeStudent">
<div class="box">
<h2>选择学生</h2>
<div class="student-list">
<div class="student-item display-flex space-center flex-direction-column" :class="studentIndex==index?'ac':''"
v-for="(item,index) in studentList" @click="studentIndex=index">
<div>{{ item.stuName }}</div>
<p>{{ item.gradeName }}{{ item.className }}</p>
</div>
<div class="student-item display-flex space-center flex-direction-column">
<van-icon name="plus" size=".3rem" @click="toBindStudent"/>
</div>
</div>
<div class="sure" @click="choose">确定</div>
</div>
</div>
</template>
<script>
import common from "../api/common"
export default {
name: "chooseStudent",
props: {
showChangeStudent: {
type: Boolean,
default: false,
},
studentList: {
type: Array,
default: () => {
return []
}
},
index: {
type: Number,
default: 1
}
},
watch: {
index(newV, oldV) {
this.studentIndex = newV
}
},
data() {
return {
studentIndex: null,
}
},
created() {
this.studentIndex = this.index
},
methods: {
choose() {
this.$emit("choose", this.studentIndex)
sessionStorage.setItem("studentIndex" + common.getAppId(), this.studentIndex)
},
//
toBindStudent() {
this.$router.push({
path: '/bindStudent',
})
}
}
}
</script>
<style scoped lang="scss">
.change-student {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .4);
z-index: 8;
.box {
width: 5.8rem;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #fff;
border-radius: .14rem;
overflow: hidden;
}
h2 {
text-align: center;
font-size: .28rem;
color: #808080;
font-weight: normal;
margin: .45rem 0 .3rem;
}
.student-list {
overflow: hidden;
width: 4.45rem;
margin: 0 auto;
max-height: 8rem;
overflow-y: auto;
}
.student-item {
width: 2.1rem;
height: 1.15rem;
border: 1px solid #e0dfe6;
text-align: center;
font-size: .22rem;
color: #929292;
border-radius: .06rem;
float: left;
margin-bottom: .2rem;
&:nth-child(2n) {
float: right;
}
&.ac {
border-color: #FFB938;
div {
color: #FFB938;
}
p {
color: #FFB938;
}
}
div {
font-size: .28rem;
color: #000000;
font-weight: bold;
margin-top: .1rem;
}
}
.sure {
width: 4.45rem;
line-height: .92rem;
text-align: center;
border-radius: .46rem;
font-size: .32rem;
color: #fff;
margin: .4rem auto;
background: linear-gradient(to right, #FF9A20, #FFB938);
box-shadow: 0 0 .1rem #FFB938;
}
}
</style>

@ -0,0 +1,63 @@
<template>
<div>
<van-dialog :overlay="false" v-model="showFlag" :showConfirmButton="false" style="box-shadow: 0px 0px 6px 0px #afadad;border-radius: 6px;">
<div >
<van-row style="height: 120px;margin-top: 20px;">
<van-col span="4"><span class="icon"></span></van-col>
<van-col span="18"><span class="title">{{ info.title }}</span>
<div class="msg">{{ info.msg }}</div>
</van-col>
</van-row>
</div>
</van-dialog>
</div>
</template>
<script>
import {Dialog} from 'vant';
export default {
name: "myDialog",
data() {
return {
showFlag: false,
info:{
title:'',
msg:''
}
}
},
methods: {
show(info){
this.showFlag=true
this.info=info
setTimeout(()=>{
this.showFlag=false
},2000)
}
}
}
</script>
<style scoped>
.icon {
padding: 20px;
background-size: 25px 25px;
background-repeat: no-repeat;
background-position: center;
background-image: url("../assets/img/success.png");
margin-left: 10px;
}
.title {
font-size: 18px;
font-weight: 700;
margin-left: 10px;
}
.msg {
margin-top: 5px;
margin-left: 10px;
margin: 5px 5px 10px 10px;
}
</style>

@ -0,0 +1,53 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Vant from 'vant';
// import '@/assets/font/font.css'
import 'vant/lib/index.css';
import Moment from 'moment'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import vconsole from "vconsole"
// var vConsole = new vconsole();
Vue.use(Vant);
Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.directive('title', {//单个修改标题
inserted: function (el, binding) {
document.title = el.dataset.title
}
})
Vue.filter('formatDate', function (value, format) {
console.log(value)
return value ? Moment(value).format(format ? format : "YYYY-MM-DD HH:mm:ss") : null
})
new Vue({
el: '#app',
render: h => h(App),
router
}).$mount('#app')
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
}

@ -0,0 +1,313 @@
<template>
<div class="container">
<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
<van-skeleton :row="10" :loading="loadingPage">
<div class="bill" v-for="(bill, index) in billList" :key="index" v-if="billList.length > 0"
style="padding-bottom: .5rem">
<div class="time">
<van-row>
<van-col span="2"></van-col>
<van-col span="20" style="font-size:12px;font-weight:500;">{{ bill.lastEnableDate }}</van-col>
</van-row>
</div>
<div @click="toBillDetail(bill)">
<van-row>
<van-col span="1"></van-col>
<van-col span="22">
<div class="content-box">
<div class="title">{{bill.billTitle}}</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<div class="content">
<div v-for="(item, itemIndex) in bill.itemList" :key="itemIndex"
class="item">
<van-row>
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="item.subItemList.length === 0 && item.itemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else-if="item.subItemList.length === 0 && item.itemPayStatus === 0"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
v-else
/>
{{item.itemName}}
<span v-show="item.mustPay === 1" style="color: red">*</span>
</van-col>
<van-col span="12">{{ checkPrice(item) }}</van-col>
</van-row>
<van-row v-for="(subItem, subItemIndex) in item.subItemList" :key="'subItem' + subItemIndex"
class="sub-item"
v-if="item.subItemList && item.subItemList.length > 0">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="subItem.subItemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else
/>
{{ subItem.subItemName }}
</van-col>
<van-col span="12">{{ '¥' + subItem.subItemPrice }}</van-col>
</van-row>
</div>
<van-row class="pay-money">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
/>
已付金额
</van-col>
<van-col span="12">{{ '¥' + bill.payMoney }}</van-col>
</van-row>
</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<van-row class="bottom-box">
<van-col span="20" class="end-date">{{'截止时间:' + bill.billEndDate}}</van-col>
<van-col span="4" class="detail">详情</van-col>
</van-row>
</div>
</van-col>
</van-row>
</div>
</div>
<van-empty description="暂无账单信息" v-if="billList.length === 0"/>
</van-skeleton>
</van-pull-refresh>
</div>
</template>
<script>
import api from "../api/api"
import {Dialog, Toast} from "vant"
export default {
name: "bill",
data() {
return {
currentStudent: null,
billList: [],
refreshLoading: false,
loadingPage: true
}
},
methods: {
//
onRefresh() {
this.refreshLoading = false
//
this.loadingPage = true
this.billList = []
this.listH5Bill()
},
//
selectBillList(currentStudent) {
this.currentStudent = currentStudent
this.listH5Bill()
},
listH5Bill() {
api.listH5Bill({
studentId: this.currentStudent.id,
deptId: this.currentStudent.schoolId,
}).then(res => {
this.billList = res.data.data
this.loadingPage = false
}).catch(err => {
console.error(err)
Toast('查询账单失败')
this.loadingPage = false
})
},
//
checkPrice(item) {
let result
//
if (item.indefiniteStatus === 1) {
result = "自定义金额"
} else {
//
if (item.itemOption === 0) {
result = '¥' + item.itemPrice
} else {
result = ''
}
}
return result
},
//
toBillDetail(bill) {
//
api.checkExistOrder({
studentId: this.currentStudent.id,
billId: bill.billId,
}).then(res => {
let orderNo = res.data.data
console.log("订单号: {}", orderNo)
if (orderNo !== null && orderNo !== "" && orderNo !== undefined) {
Dialog.confirm({
message: '当前还有未支付的订单, 是否跳转支付?',
}).then(() => {
//
this.$router.push({
path: '/orderDetail',
query: {
orderCode: orderNo
}
})
}).catch(() => {
// on cancel
})
} else {
this.$router.push({
path: '/billDetail',
query: {
billId: bill.billId,
studentId: this.currentStudent.id,
studentName: this.currentStudent.stuName,
deptId: this.currentStudent.schoolId
}
})
}
}).catch(err => {
console.error(err)
Toast('查询账单详情失败')
})
}
}
}
</script>
<style lang="scss">
.container {
padding-top: .1rem;
padding-bottom: .3rem;
background: #f8f8f8;
.bill {
.time {
text-align: center;
color: #a2a6b0;
padding: .1rem;
font-weight: bolder;
font-size: .28rem;
}
.content-box {
padding-top: .2rem;
padding-bottom: .2rem;
// box-shadow: 2px 2px 6px 2px #d2d2d2;
background-color: #FFF;
border-radius: .1rem;
margin-top: .2rem;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder;
color: #374d4e;
font-size: 0.28rem;
letter-spacing: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.content {
text-align: center;
margin-top: .1rem;
margin-bottom: .1rem;
font-size: .25rem;
.pay-money {
color: #81838f;
text-align: right;
}
.item, .pay-money {
.van-col {
padding: .2rem;
.van-image {
top: .07rem;
}
}
.van-col:nth-child(1) {
text-align: left;
padding-left: .25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.van-col:nth-child(2) {
text-align: right;
padding-right: .3rem;
}
.sub-item {
.van-col:nth-child(1) {
padding-left: .65rem;
}
}
}
}
.bottom-box {
padding: .1rem 0 .1rem .3rem;
margin-top: .2rem;
font-weight: 400;
font-size: .24rem;
.end-date {
color: #374d4e;
}
.detail {
text-align: right;
padding-right: .3rem;
color: #f6a138;
}
}
}
}
.bill:nth-child(n + 2) {
margin-top: 0.5rem;
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,701 @@
<template>
<div class="detail-container">
<van-form ref="form" @submit="onSubmit">
<van-skeleton :row="10" :loading="loadingBill">
<div class="top">
<div class="title">{{ billData.billTitle }}</div>
<div class="time">{{'截止时间:' + billData.billEndDate}}</div>
</div>
<div class="item-box">
<div class="item-instruction-box">
<van-image
width="14"
height="14"
:src="require('@/assets/img/book.png')"
/>
<div class="item-instruction">缴费项目</div>
</div>
<van-collapse v-model="activeNames" :border="false">
<van-collapse-item name="title" title="费项名称" value="缴费金额"
title-class="item-name font-color"
value-class="item-price font-color"
:is-link="false" disabled>
<template #right-icon>
<div class="icon-class"></div>
</template>
</van-collapse-item>
<van-collapse-item v-for="(item, index) in billData.itemList" :name="'item' + index"
:key="'item' + index"
title-class="item-name"
value-class="item-price indefinite-money"
:is-link="false" disabled>
<template #title>
<div>
<div>
<van-icon name="star" color="#f4ea2a" size="0.3rem"/>
{{ item.itemName }}
<span v-show="item.mustPay === 1" style="color: red">*</span>
</div>
</div>
</template>
<template #value>
<div v-if="item.indefiniteStatus === 1">
<van-field type="text" label-width="0" maxlength="7" v-model="item.itemPrice"/>
</div>
<div v-else-if="item.itemOption === 0">{{ '¥' + item.itemPrice }}</div>
</template>
<template #right-icon>
<div class="icon-class" v-if="item.itemPayStatus === 1">已缴</div>
<div class="icon-class" v-else-if="item.itemOption === 0">
<van-checkbox shape="square" icon-size="0.3rem"
:disabled="item.mustPay === 1"
v-model="item.checked">
</van-checkbox>
</div>
<div class="icon-class" v-else></div>
</template>
<!-- 多选(暂时只判断选一项) -->
<div v-if="item.subItemList.length > 0">
<van-checkbox-group v-model="item.selectSubItemList" :max="1">
<van-collapse-item v-for="(subItem, subIndex) in item.subItemList" :name="'subItem' + subIndex"
:key="'item' + index + 'subItem' + subIndex"
:title="subItem.subItemName"
:value="'¥' + subItem.subItemPrice"
title-class="item-name sub-item-name"
value-class="item-price sub-item-price"
:border="false"
:is-link="false" disabled>
<template #right-icon>
<div class="icon-class sub-icon-class" v-if="item.itemPayStatus === 0">
<van-checkbox shape="square" icon-size="0.3rem"
:name="subItem.subItemId"
@click="changeSubItem">
</van-checkbox>
</div>
<div class="icon-class sub-icon-class" v-else-if="subItem.subItemPayStatus === 1">
已缴
</div>
<div class="icon-class sub-icon-class" v-else></div>
</template>
</van-collapse-item>
</van-checkbox-group>
</div>
</van-collapse-item>
</van-collapse>
</div>
<div class="instruction-box">
<div class="instruction-title">
<van-image
width="14"
height="14"
:src="require('@/assets/img/book.png')"
/>
<div class="bill-instruction">缴费说明</div>
</div>
<div v-html="billData.billInstruction"
:class="[showMore ? 'instruction' : 'hideMore','text','instruction']"></div>
<div class="more" @click="showMore=true" v-show="!showMore">展开更多</div>
<div class="more" @click="showMore=false" v-show="showMore">收起</div>
</div>
<div class="pay-box" v-show="billData.showPay">
<van-submit-bar style="padding-top: 10px" :disabled="!alreadyRead" :loading="submitLoading"
:price="practicalMoney()"
button-color="#f6a138" button-text="确认支付" label="应缴:">
<template #top>
<van-row type="flex" justify="center" style="padding: .2rem .6rem 0 .5rem; color: #f6a138;">
<van-col span="12">
<van-checkbox v-model="alreadyRead" icon-size="0.3rem">
<span style="color: #f6a138;">我已阅读缴费说明</span>
</van-checkbox>
</van-col>
<van-col span="12" style="text-align: right">
<span>已减免: {{ reductionMoney() }}</span>
</van-col>
</van-row>
</template>
</van-submit-bar>
</div>
</van-skeleton>
</van-form>
<WxPay ref="wxPay" @orderSuccess="orderSuccess"></WxPay>
<van-popup v-model="showUnionPayWay"
round safe-area-inset-bottom closeable
position="bottom"
@closed="unionPayWayClose"
:close-on-click-overlay="false"
:style="{ height: '50%' }">
<van-row class="pay-top">
<van-col span="8"></van-col>
<van-col span="8">请选择支付方式</van-col>
<van-col span="8"></van-col>
</van-row>
<van-radio-group v-model="unionSupportType" style="padding-top: 10px">
<van-cell-group>
<van-cell clickable :title="type.name" size="large" style="height: 1rem"
v-for="(type, index) in unionPayType" :key="'type' + index">
<template #icon>
<van-icon :name="require('@/assets/img/' + type.icon + '')" size=".55rem"
style="top: -0.03rem; right: .12rem"/>
</template>
<template #right-icon>
<van-radio :name="type.value"/>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
<div class="pay-bottom">
<van-button round type="danger" :disabled="buttonDisabled" @click="submitUnionPay">确认支付</van-button>
</div>
</van-popup>
</div>
</template>
<script>
import api from '../api/api'
import WxPay from './wxPay'
import {Toast} from "vant"
import {Dialog} from 'vant'
export default {
name: "billDetail",
components: {
WxPay
},
data() {
return {
loadingBill: true,
billId: null,
studentId: null,
studentName: '',
deptId: null,
billData: {},
activeNames: [],
showMore: false,
alreadyRead: false,
submitLoading: false,
orderMessage: {},
showUnionPayWay: false,
unionSupportType: null,
unionPayTypeList: [
{value: 0, name: "微信支付", icon: "微信.png"},
{value: 1, name: "微信支付", icon: "微信.png"},
{value: 2, name: "支付宝", icon: "支付宝.png"},
{value: 3, name: "云闪付", icon: "云闪付.png"},
],
orderParam: {},
buttonDisabled: false
}
},
mounted() {
//
window.addEventListener("pageshow", (event) => {
if (event.persisted || (window.performance && window.performance.navigation.type == 2)) {
this.$router.go(0)
}
}, false);
//
this.loadingBill = true
this.showMore = false
this.alreadyRead = false
this.orderParam = {}
this.orderMessage = {}
//
this.billId = this.$route.query.billId
this.studentId = this.$route.query.studentId
this.studentName = this.$route.query.studentName
this.deptId = this.$route.query.deptId
this.getH5BillInfo()
},
computed: {
unionPayType: function () {
return this.unionPayTypeList.filter(item => {
let payType = this.billData.payType
if (payType !== null && payType !== ""
&& payType !== undefined && payType.supportType.indexOf(item.value) !== -1) {
return item
}
})
}
},
methods: {
//
getH5BillInfo() {
api.getH5BillInfo({
billId: this.billId,
studentId: this.studentId,
deptId: this.deptId,
}).then(res => {
this.billData = res.data.data
this.billData.itemList.forEach((item, index) => {
if (item.subItemList.length > 0) {
//
this.activeNames.push('item' + index)
//
item.selectSubItemList = []
}
})
this.loadingBill = false
}).catch(err => {
console.error(err)
Toast('查询账单详情失败');
})
},
//
changeSubItem() {
//
this.$forceUpdate()
},
//
practicalMoney() {
if (!this.billData.itemList) {
return 0
}
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
//
let totalMoney = 0
chooseItemList.forEach(chooseItem => {
//
let selectSubItemList = chooseItem.selectSubItemList
if (selectSubItemList && selectSubItemList.length > 0) {
selectSubItemList.forEach(selectSubItem => {
let index = chooseItem.subItemList.findIndex(subItem => {
return subItem.subItemId === selectSubItem
})
if (index > -1) {
totalMoney = parseFloat(totalMoney) + parseFloat(chooseItem.subItemList[index].subItemPrice)
}
})
} else {
let itemPrice = chooseItem.itemPrice
if (itemPrice === null || itemPrice === "" || itemPrice === undefined) {
itemPrice = 0
}
//
totalMoney = parseFloat(totalMoney) + parseFloat(itemPrice)
}
})
return (parseFloat(totalMoney) - this.reductionMoney()) * 100
},
//
reductionMoney() {
let studentFamilyType = this.billData.studentFamilyType
//
if (studentFamilyType === null || studentFamilyType === undefined || studentFamilyType === "") {
return 0
} else {
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
let money = 0
let studentFamilyTypeArr = studentFamilyType.split(",")
//
chooseItemList.forEach(chooseItem => {
if (chooseItem.reductionStatus === 1) {
for (var studentFamily of studentFamilyTypeArr) {
if (chooseItem.familyType.indexOf(studentFamily + '') > -1) {
money = parseFloat(money) + parseFloat(chooseItem.reductionPrice)
break
}
}
}
})
return parseFloat(money)
}
},
//
unionPayWayClose() {
this.submitLoading = false
this.unionSupportType = null
},
//
onSubmit() {
Dialog.confirm({
message: '请您确认当前选择的学生是【' + this.studentName + '】',
}).then(() => {
//
//
let chooseItemList = this.billData.itemList.filter(item => {
//
if (item.itemOption === 0 && item.checked === true) {
return item
} else if (item.selectSubItemList && item.selectSubItemList.length > 0) {
//
return item
}
})
if (chooseItemList === null || chooseItemList === undefined || chooseItemList.length === 0) {
Toast('请选择对应的缴费项目')
return false;
}
//
let optionOneList = this.billData.itemList.filter(item => {
if (item.itemOption === 1 && item.itemPayStatus === 0) {
//
return item
}
})
let itemFlag = true
if (optionOneList && optionOneList.length > 0) {
for (let i = 0; i < optionOneList.length; i++) {
let optionOneItem = optionOneList[i]
//
if (optionOneItem.mustPay === 1 && optionOneItem.selectSubItemList.length === 0) {
itemFlag = false
Toast('请选择【' + optionOneItem.itemName + '】缴费选项!')
break
}
}
}
if (!itemFlag) {
return false
}
let flag = true
//
let itemList = []
for (let i = 0; i < chooseItemList.length; i++) {
let chooseItem = chooseItemList[i]
let item = {
itemId: chooseItem.itemId
}
//
if (chooseItem.indefiniteStatus === 1) {
let itemPrice = chooseItem.itemPrice
if (itemPrice === null || itemPrice === "" || itemPrice === undefined) {
Toast('请输入自定义金额')
flag = false
break
}
//
let reg = /(^-?[0-9]{1,4}$)|(^-?[0-9]{1,4}[\.]{1}[0-9]{1,2}$)/
if (!reg.test(itemPrice)) {
Toast('请输入合法的金额数字小数点前4位小数点后2位')
flag = false
break
}
//
item.itemPrice = itemPrice
}
//
let chooseSubItemList = chooseItem.selectSubItemList
if (chooseSubItemList && chooseSubItemList.length > 0) {
let subItemList = [];
chooseSubItemList.forEach((subItemId, subIndex) => {
subItemList[subIndex] = {
subItemId: subItemId
}
})
item.subItemList = subItemList
}
itemList[i] = item
}
if (!flag) {
return false
}
this.submitLoading = true
//
let payTypeConfig = this.billData.payType
let payWay = payTypeConfig.payWay
//
let param = {
billId: this.billId,
studentId: this.studentId,
payWay: payWay,
itemList: itemList,
payType: null
}
// (1:,2:, 3:),
//
if (payWay === "3") {
this.orderParam = param
this.showUnionPayWay = true
} else if (payWay === "1") {
//
param.payType = payTypeConfig.supportType
this.createOrder(param)
} else {
Toast("暂不支持此支付方式!")
}
}).catch(() => {
// on cancel
});
},
//
submitUnionPay() {
if (this.unionSupportType === null || this.unionSupportType === "" || this.unionSupportType === undefined) {
Toast("请选择支付方式")
return
}
this.buttonDisabled = true
this.orderParam.payType = this.unionSupportType
this.createOrder(this.orderParam)
},
//
createOrder(param) {
console.log("请求参数", param)
//
api.createBillOrder(param).then(res => {
//
this.orderMessage = res.data.data
//
if (this.orderMessage.needToPay === true) {
//
if (this.orderMessage.payWay === "1") {
//
this.$nextTick(function () {
this.$refs.wxPay.goToPay(res.data.data)
})
} else if (this.orderMessage.payWay === "3") {
//
// $.setReferer(this.orderMessage.payDomain)
// console.log(this.orderMessage.payUrl)
window.location.href = this.orderMessage.payUrl
}
} else {
//
Toast('支付成功')
this.orderSuccess()
}
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.submitLoading = false
this.buttonDisabled = false
})
},
//
orderSuccess() {
api.billOrderSuccess({
orderCode: this.orderMessage.orderCode
})
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
}
}
</script>
<style lang="scss">
.detail-container {
padding-bottom: 1.66rem;
background: #f8f8f8;
height: 100%;
overflow-y: auto;
.top {
padding: .3rem .3rem .2rem .3rem;
background: #ffffff;
margin-bottom: .5rem;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder !important;
color: #374d4e;
font-size: .28rem;
letter-spacing: 0.02rem;
}
.time {
padding: .1rem 0 .2rem .3rem;
font-weight: 400;
color: #81838f;
font-size: 0.26rem;
}
}
.item-box {
background: #ffffff;
width: 90%;
margin: 0 auto;
border-radius: 10px;
.item-instruction-box {
padding: .2rem .3rem 0 .3rem;
display: flex;
.item-instruction {
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: 0.28rem;
}
}
.van-collapse {
width: 90%;
margin: 0 auto;
padding: 0 0 0 0.05rem;
.font-color {
color: #81838f !important;
}
.item-name, .item-price {
color: #374d4e;
font-size: 0.25rem;
}
.item-name {
padding-right: 1.5rem;
}
.item-price {
text-align: left;
}
.indefinite-money {
.van-cell__value {
border-bottom: 1px solid #81838f;
left: -0.28rem;
top: -0.2rem;
font-size: 0.25rem;
}
}
.icon-class {
color: #f6a138;
font-size: .22rem;
width: 0.6rem;
}
.sub-item-name {
color: #666666;
padding-left: 0.1rem;
padding-right: 1rem !important;
}
.sub-item-price {
color: #666666;
}
.sub-icon-class {
margin-right: -.31rem;
}
}
}
.instruction-box {
background: #ffffff;
width: 90%;
border-radius: 10px;
margin: .5rem auto 0;
padding: .2rem 0 .3rem 0;
.instruction-title {
padding: .1rem .3rem 0 .3rem;
display: flex;
.bill-instruction {
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: 0.28rem;
}
}
.instruction {
padding: .1rem .3rem 0 .3rem;
font-size: .25rem;
img {
max-width: 100%;
}
video {
max-width: 100%;
}
}
.hideMore {
max-height: 2rem;
overflow: hidden;
font-size: .25rem;
}
.more {
padding: .2rem .3rem 0 .3rem;
text-align: right;
color: #6c86fc;
font-size: .25rem;
}
}
.pay-box {
span {
font-size: .26rem !important;
}
.van-submit-bar__bar {
font-size: .28rem !important;
}
.van-submit-bar__button {
width: 1.8rem;
height: 0.6rem;
font-weight: 500;
border: none;
margin-right: 0.2rem !important;
}
}
.van-image {
top: 0.165rem;
}
.pay-top {
padding: .3rem 0;
font-size: .32rem;
}
.pay-bottom {
.van-button {
width: 70%;
position: fixed;
bottom: 1rem;
left: 15%;
}
}
}
</style>

@ -0,0 +1,207 @@
<template>
<div class="student-container">
<van-skeleton :row="10" :loading="loadingPage">
<van-form @submit="submit">
<div class="row">
<div class="title">
选择所在班级
</div>
<van-field
is-link
readonly
clickable
v-model="userDeptName"
placeholder="请选择所在班级"
:rules="[{ required: true, message: '请选择所在班级' }]"
@click="showUserDept = true"
/>
<van-popup v-model="showUserDept" round position="bottom">
<van-cascader
v-model="student.classId"
title="请选择所在班级"
:options="userDeptData"
:field-names="fieldNames"
@close="showUserDept = false"
@finish="userDeptFinish"
/>
</van-popup>
</div>
<div class="row">
<div class="title">
学生姓名
</div>
<van-field
v-model="student.stuName"
placeholder="输入学生姓名"
:rules="[{ required: true, message: '请输入学生姓名' }]"
/>
</div>
<div class="row">
<div class="title">
学生身份证号/学生学号
</div>
<van-field
v-model="student.idNumber"
placeholder="请输入身份证号码或学号"
:rules="[{ required: true, message: '请输入身份证号或学号' }]"
/>
</div>
<div class="row">
<div class="title">
您的身份
</div>
<van-field
is-link
readonly
clickable
:value="student.parentType"
placeholder="选择学生对您的称呼"
@click="showParentType = true"
:rules="[{ required: true, message: '请选择学生对您的称呼' }]"
/>
<van-popup v-model="showParentType" position="bottom">
<van-picker
show-toolbar
:columns="parentTypeList"
@confirm="confirmParent"
@cancel="showParentType = false"
/>
</van-popup>
</div>
<div class="bottom">
<van-button color="#f6a138" :disabled="buttonDisabled" style="width: 50%; border-radius: 10px;">完成
</van-button>
</div>
</van-form>
</van-skeleton>
</div>
</template>
<script>
import api from '../api/api'
import common from "../api/common"
import {Toast} from "vant";
export default {
name: "bindStudent",
data() {
return {
loadingPage: true,
identity: null,
student: this.initStudent(),
userDeptName: '',
showUserDept: false,
userDeptData: [],
showParentType: false,
buttonDisabled: false,
fieldNames: {
value: 'id',
text: 'label',
children: 'children',
},
parentTypeList: this.initParentType(),
}
},
created() {
//
this.student.schoolId = common.getAppId()
//
this.identity = common.getIdentityInfo()
//
this.getUserDeptTree()
},
methods: {
//
initStudent() {
return {
schoolId: null,
classId: null,
stuName: '',
idNumber: '',
parentType: ''
}
},
//
initParentType() {
return ['爸爸', '妈妈', '爷爷', '奶奶', '外公', '外婆', '其它']
},
//
getUserDeptTree() {
api.getUserDeptTree(this.student.schoolId).then(res => {
this.userDeptData = res.data.data
this.loadingPage = false
}).catch(err => {
this.buttonDisabled = false
console.error(err)
Toast("查询班级信息错误")
})
},
// cascader finish
userDeptFinish({selectedOptions}) {
this.showUserDept = false;
//
this.userDeptName = selectedOptions.map((option) => option.label).join('/');
},
//
confirmParent(value) {
this.student.parentType = value
this.showParentType = false
},
//
submit() {
this.buttonDisabled = true
//
api.bindStudent({
...this.student,
parentId: this.identity.parentId
}).then(res => {
Toast("添加成功")
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
}).catch(err => {
this.buttonDisabled = false
console.error(err.response.data)
Toast(err.response.data.message)
})
},
}
}
</script>
<style scoped lang="scss">
.student-container {
height: 100%;
padding: .2rem .3rem .3rem .3rem;
background-color: #f7f8fa;
.row {
.title {
font-size: .27rem;
font-weight: bold;
padding: .1rem .3rem .2rem .27rem;
}
.title:nth-child(n + 1) {
padding-top: .3rem;
}
}
.bottom {
text-align: center;
padding-top: 2.3rem;
}
}
</style>

@ -0,0 +1,180 @@
<template>
<div class="all-container">
<van-sticky>
<div class="top-bar">
<van-skeleton title avatar :row="1" :loading="loadingStudent">
<div class="user">
<van-row type="flex" justify="center">
<van-col span="14">
<van-row type="flex" align="center">
<van-col class="avatar">
<van-image round width="1.2rem" height="1.2rem"
:src="currentStudent.avatar||require('@/assets/img/avatar.png')">
</van-image>
</van-col>
<van-col style="margin-left:.2rem;">
<div>
<div class="name">{{ currentStudent.stuName }}</div>
<div class="name">{{ currentStudent.gradeName + '.' + currentStudent.className }}</div>
</div>
</van-col>
</van-row>
</van-col>
<van-col span="8" style="text-align: right">
<div class="change" @click="showChoose=true">
<!-- <van-icon name="sort" size="0.3rem"/>-->
<!-- <span style="font-size: 0.26rem">切换学生</span>-->
<van-button :icon="require('@/assets/img/change.png')"
size="small" color="#f6a138"
style="border-radius: 500px; width: 1.4rem">
切换
</van-button>
</div>
</van-col>
</van-row>
</div>
</van-skeleton>
</div>
</van-sticky>
<van-tabs v-model="activeName" animated swipeable
background="#f8f8f8" title-active-color="#f6a138" color="#f6a138"
@change="selectPageLst" style="margin-top: 20px">
<van-tab title="进行中" name="paying">
<Bill ref="bill"></Bill>
</van-tab>
<van-tab title="缴费记录" name="payRecord">
<OrderRecord ref="record"></OrderRecord>
</van-tab>
</van-tabs>
<ChooseStudent :showChangeStudent="showChoose" :studentList="studentList" :index="studentIndex"
@choose="chooseStudent"></ChooseStudent>
</div>
</template>
<script>
import Bill from "./bill"
import OrderRecord from "./orderRecord"
import ChooseStudent from "../components/chooseStudent"
import api from '../api/api'
import common from "../api/common"
export default {
name: "home",
components: {
ChooseStudent,
Bill,
OrderRecord
},
data() {
return {
identity: null,
showChoose: false,
studentIndex: common.getStudentIndex(),
studentList: [],
currentStudent: {},
loadingStudent: true,
activeName: 'paying'
}
},
created() {
//
this.identity = common.getIdentityInfo()
this.showChoose = false
this.listStudent()
},
watch: {
$route() {
if (this.$route.params.refresh) {
this.showChoose = false
this.listStudent()
}
}
},
methods: {
//
listStudent() {
api.listStudentByParent({parentId: this.identity.parentId}).then(res => {
this.studentList = res.data.data
this.currentStudent = this.studentList[this.studentIndex]
//
this.loadingStudent = false
this.selectPageLst()
})
},
//
chooseStudent(index) {
this.showChoose = false
this.studentIndex = index
this.currentStudent = this.studentList[index]
this.selectPageLst()
},
//
selectPageLst() {
this.$nextTick(() => {
if (this.activeName === "paying") {
this.$refs.bill.selectBillList(this.currentStudent)
} else {
this.$refs.record.initRecordList(this.currentStudent)
}
})
}
}
}
</script>
<style lang="scss">
.all-container {
height: 100%;
background: #f8f8f8;
.top-bar {
padding-top: .3rem;
padding-bottom: .3rem;
background: #ffffff;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.05);
.user {
padding-left: .1rem;
.avatar {
width: 1.2rem;
height: 1.2rem;
line-height: 1.2rem;
margin: auto 0;
text-align: center;
}
.name {
font-size: 0.3rem;
font-weight: 600;
color: #333;
}
.name:nth-child(2) {
margin-top: 0.16rem;
font-size: .24rem;
color: #999;
font-weight: 200;
}
}
.change {
padding-top: .18rem;
}
}
.van-tab span {
font-size: 0.26rem;
}
}
.van-tab--active {
font-size: 0.26rem;
color: rgb(246, 161, 56);
font-weight: 700;
}
</style>

@ -0,0 +1,192 @@
<template>
<div class="all-container">
<van-popup v-model="show"
round position="bottom"
:close-on-click-overlay="false"
:style="{ height: '50%' }">
<van-search v-model="searchParam.schoolName" @search="getSchoolList" placeholder="请输入学校关键词"/>
<van-picker
:loading="loading"
show-toolbar
value-key="schoolName"
:columns="schoolData"
@confirm="confirmSchool">
<template slot="cancel">
<span></span>
</template>
</van-picker>
</van-popup>
</div>
</template>
<script>
import myLogin from '@/api/loginConfig.js'
import common from "../api/common";
import api from '../api/api'
import {Toast} from "vant";
export default {
name: "index",
data() {
return {
show: true,
value: '',
loading: false,
schoolData: [],
schoolId: null,
searchParam: this.initSearchPram(),
login_success: false,
}
},
created() {
window.jsLoginCallback = this.jsLoginCallback
// app
this.checkAppUserLogin()
},
methods: {
//
checkAppUserLogin() {
$.initGetAppBasicInfo(this.commonGetAppCallBack);
},
//
commonGetAppCallBack(userInfo) {
//
if (userInfo === null || userInfo === "" || userInfo === undefined || userInfo.getIsLogin !== "1") {
// app
$.initToAppLogin()
} else {
//
this.getSchoolList()
}
},
// app
jsLoginCallback(loginFlag) {
// 1, 0
if (loginFlag === 1 || loginFlag === "1") {
//
this.getSchoolList()
} else {
// app
$.initToAppLogin()
}
},
//
initSearchPram() {
return {
schoolName: '',
// id
deptId: common.getQueryVariable('deptId') || this.$route.query.deptId,
pageSize: 1000
}
},
//
getSchoolList() {
api.findSchoolPageList(this.searchParam).then(res => {
this.schoolData = res.data.data.records
this.loading = false
}).catch(err => {
console.error(err)
Toast('查询学校列表失败!请稍后再试')
this.loading = false
})
},
//
confirmSchool(value) {
if (value !== null && value !== "" && value !== undefined) {
this.schoolId = value.schoolId
this.loading = true
//
this.checkParentInfo()
}
},
//
checkParentInfo() {
api.checkParent({
schoolId: this.schoolId,
mobile: common.getAppUserInfo().userPhone,
appUserId: common.getAppUserInfo().userId
}).then(res => {
//
this.toLogin()
}).catch(err => {
console.error(err)
Toast('登录信息异常,网络错误')
this.loading = false
})
},
//
toLogin() {
// 0-,1-2-app
let isLogin = common.getQueryVariable("loginType") || this.$route.query.loginType;
if (isLogin) {
console.log("登录流程")
this.init()
} else {
console.log("不登录页面")
this.loginSuccess()
}
},
//
loginSuccess() {
console.log("登录成功")
//
api.listStudentByParent({
parentId: common.getIdentityInfo().parentId
}).then(res => {
let studentData = res.data.data
//
if (studentData && studentData.length > 0) {
//
this.toBillHome()
} else {
//
this.toAddStudentTip()
}
this.loading = false
}).catch(err => {
console.error(err)
Toast('查询学生信息失败')
this.loading = false
})
},
//
init() {
myLogin.init({
loginSuccess: this.loginSuccess, //
state: "bill", // state
userType: 1, // 0-1-
appId: this.schoolId,
testMode: false, //,trueparamidtoken
testParam: {
id: 5995, // id
token: 'bearer 9fbbff51-e877-4c21-b1f0-a935a7f1e004', // token
identityId: 23926 // id (id)
}
})
},
//
toBillHome() {
this.$router.push({
path: '/home',
})
},
//
toAddStudentTip() {
this.$router.push({
path: '/tip',
})
},
}
}
</script>
<style scoped lang="scss">
.all-container {
height: 100%;
background-image: url('../assets/img/bj.png');
background-size: 100%;
background-repeat: no-repeat;
}
</style>

@ -0,0 +1,263 @@
<template>
<div class="all-container">
<van-search class="top" v-model="searchParam.schoolName" @search="getSchoolList" placeholder="请输入学校关键词"/>
<div class="school-item" v-for="school in schoolData" @click="chooseSchoolFun(school)">
{{ school.schoolName }}
</div>
<!-- 此处为学校弹窗信息隐藏代码修改为学校列表 -->
<van-popup v-model="showTest"
round position="bottom"
:safe-area-inset-bottom="true"
:close-on-click-overlay="false"
:style="{ height: '50%' }">
<van-picker
:loading="loading"
show-toolbar
value-key="schoolName"
:columns="schoolData"
@confirm="confirmSchool">
<template slot="cancel">
<span></span>
</template>
</van-picker>
</van-popup>
</div>
</template>
<script>
import myLogin from '../api/loginConfig.js'
import common from "../api/common"
import api from '../api/api'
import {Toast} from "vant"
export default {
name: "index",
data() {
return {
show: false,
showTest: false,
value: '',
loading: false,
schoolData: [],
schoolId: null,
searchParam: this.initSearchPram(),
login_success: false,
}
},
created() {
window.jsLoginCallback = this.jsLoginCallback
// app
this.checkAppUserLogin();
},
methods: {
//
checkAppUserLogin() {
$.initGetAppBasicInfo(this.commonGetAppCallBack);
},
//
commonGetAppCallBack(userInfo) {
//
if (userInfo === null || userInfo === "" || userInfo === undefined || userInfo.getIsLogin !== "1") {
// app
$.initToAppLogin()
} else {
console.log("用户信息", userInfo)
if (userInfo.userPhone === null || userInfo.userPhone === "" || userInfo.userPhone === undefined) {
Toast('请绑定手机号码后再使用此功能')
} else {
//
this.getSchoolList()
}
}
},
// app
jsLoginCallback(loginFlag) {
// 1, 0
if (loginFlag === 1 || loginFlag === "1") {
//
this.getSchoolList()
} else {
// app
// $.initToAppLogin()
Toast('请登录app后再使用此功能')
}
},
//
initSearchPram() {
return {
schoolName: '',
// id
deptId: common.getQueryVariable('deptId') || this.$route.query.deptId,
//
// onlyPay: 0,
// pageSize: 1000
}
},
//
getSchoolList() {
api.findPaySchoolList(this.searchParam).then(res => {
this.schoolData = res.data.data
this.loading = false
this.show = true
if (!this.searchParam.schoolName) {
//
let historySchool = localStorage.getItem('my_schoolId')
if (historySchool) {
for (let i = 0; i < this.schoolData.length; i++) {
if (this.schoolData[i].schoolId == historySchool) {
this.schoolData.unshift(this.schoolData[i])
this.schoolData.splice(i + 1, 1)
return
}
}
}
}
}).catch(err => {
console.error(err)
Toast('查询学校列表失败!请稍后再试')
this.loading = false
})
},
//
confirmSchool(value) {
if (value !== null && value !== "" && value !== undefined) {
this.schoolId = value.schoolId
this.loading = true
//
this.checkParentInfo()
}
},
//
checkParentInfo() {
api.checkParent({
schoolId: this.schoolId,
mobile: common.getAppUserInfo().userPhone,
appUserId: common.getAppUserInfo().userId
}).then(res => {
//
this.toLogin()
}).catch(err => {
console.error(err)
Toast('登录信息异常,网络错误')
this.loading = false
})
},
//
toLogin() {
// 0-,1-2-app
let isLogin = common.getQueryVariable("loginType") || this.$route.query.loginType;
if (isLogin) {
console.log("登录流程")
this.init()
} else {
console.log("不登录页面")
this.loginSuccess()
}
},
//
loginSuccess() {
console.log("登录成功")
//
api.listStudentByParent({
parentId: common.getIdentityInfo().parentId
}).then(res => {
let studentData = res.data.data
//
if (studentData && studentData.length > 0) {
//
this.toBillHome()
} else {
//
this.toAddStudentTip()
}
this.loading = false
Toast.clear()
}).catch(err => {
console.error(err)
Toast('查询学生信息失败')
this.loading = false
})
},
//
init() {
myLogin.init({
loginSuccess: this.loginSuccess, //
state: "bill", // state
userType: 1, // 0-1-
appId: this.schoolId,
uniqueCode: common.getAppUserInfo().userPhone, //
testMode: false, //,trueparamidtoken
testParam: {
id: 5995, // id
token: 'bearer 9fbbff51-e877-4c21-b1f0-a935a7f1e004', // token
identityId: 23926 // id (id)
}
})
},
//
toBillHome() {
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
//
toAddStudentTip() {
this.$router.push({
path: '/tip',
})
},
//
chooseSchoolFun(school) {
Toast.loading({
message: '加载中...',
forbidClick: true,
duration: 0
})
if (school !== null && school !== "" && school !== undefined) {
//
localStorage.setItem('my_schoolId', school.schoolId)
this.schoolId = school.schoolId
this.loading = true
//
this.checkParentInfo()
}
},
}
}
</script>
<style scoped lang="scss">
.all-container {
background-color: #fff;
// height: 100%;
// background-image: url('../assets/img/bj.png');
// background-size: 100%;
// background-repeat: no-repeat;
padding-bottom: 1rem;
font-size: .28rem;
.top {
position: sticky;
top: 0;
left: 0;
}
.school-item {
border-bottom: 1px solid #f5f5f5;
text-align: center;
padding: .3rem 0;
// border-bottom: 1px solid #f5f5f5;;
}
.school-item:nth-child(2n + 1) {
background-color: #f5f5f5;
}
}
</style>

@ -0,0 +1,331 @@
<template>
<div class="order-detail-container">
<van-skeleton :row="10" :loading="loading">
<div class="title">{{ orderData.billTitle }}</div>
<div class="price">
<label v-if="orderData.orderStatus === '0' && !timeEnd">等待支付</label>
<label v-else>-</label>
<span>{{ orderData.practicalMoney }}</span>
</div>
<div class="time" v-if="orderData.orderStatus === '0' && !timeEnd">
<van-icon name="clock-o" style="top: 0.05rem; left: 0.05rem;" size=".36rem"></van-icon>
<van-count-down :time="restTime" format="mm:ss" @finish="timeFinish"/>
</div>
<van-divider dashed :style="{width: '90%', margin: '0 auto', padding: '0.2rem 0'}"/>
<div class="content-box">
<div class="content-row">
<div class="content-title">学校名称</div>
<div class="content-detail">{{ orderData.deptName }}</div>
</div>
<div class="content-row">
<div class="content-title">学生姓名</div>
<div class="content-detail">{{ orderData.studentName }}</div>
</div>
<div class="content-row" v-for="(item, index) in orderData.itemList" :key="'item' + index">
<div class="content-title" v-if="index === 0">缴费项目</div>
<div class="content-title" v-else></div>
<div class="content-detail" v-if="item.subItemList.length === 0">{{ item.itemName }}</div>
<div class="content-detail" v-else>
<span>{{ item.itemName }}</span>
<span>{{ '' + getSubItem(item) + ''}}</span>
</div>
</div>
<div class="content-row">
<div class="content-title">订单编号</div>
<div class="content-detail">{{ orderData.orderCode }}</div>
</div>
<div class="content-row" v-if="orderData.orderStatus === '2'">
<div class="content-title">交易流水号</div>
<div class="content-detail">{{ orderData.transactionNumber }}</div>
</div>
<div class="content-row">
<div class="content-title">交易状态</div>
<div class="content-detail">{{ orderStatus[orderData.orderStatus] }}</div>
</div>
<div class="content-row">
<div class="content-title">支付方式</div>
<div class="content-detail">{{ payWay[orderData.payWay] }}</div>
</div>
<div class="content-row">
<div class="content-title">下单时间</div>
<div class="content-detail">{{ orderData.createDate }}</div>
</div>
<div class="content-row" v-if="orderData.orderStatus === '2'">
<div class="content-title">支付时间</div>
<div class="content-detail">{{ orderData.payDate }}</div>
</div>
</div>
<van-divider dashed :style="{width: '90%', margin: '0 auto', padding: '0.2rem 0'}"/>
<div class="bottom" v-if="orderData.orderStatus === '0' && !timeEnd">
<van-button plain size="small" color="#a2a6b0" style="margin-right: 0.2rem"
:disabled="buttonDisabled"
@click="cancelOrder">取消订单
</van-button>
<van-button plain size="small" color="#f6a138" style="margin-left: 0.2rem"
:disabled="buttonDisabled"
@click="continuePayOrder">继续支付
</van-button>
</div>
</van-skeleton>
<WxPay ref="wxPay" @orderSuccess="orderSuccess"></WxPay>
</div>
</template>
<script>
import api from '../api/api'
import WxPay from './wxPay'
import {Toast} from "vant";
import {Dialog} from 'vant'
import common from "../api/common";
export default {
name: "orderDetail",
components: {
WxPay
},
data() {
return {
orderId: null,
orderCode: '',
loading: true,
orderData: {},
restTime: 0,
orderMessage: {},
payWay: [' ', '微信', '支付宝', '银联', '其它'],
orderStatus: ['待支付', '付款中', '交易成功', '待退款', '交易关闭'],
timeEnd: false,
buttonDisabled: false
}
},
mounted() {
//
this.loading = true
this.orderData = {}
this.restTime = 0
this.orderMessage = {}
//
let orderId = this.$route.query.orderId || common.getQueryVariable('orderId')
if (orderId === false) {
orderId = ""
}
this.orderId = orderId
let orderCode = this.$route.query.orderCode || common.getQueryVariable('orderCode')
if (orderCode === false) {
orderCode = ""
}
this.orderCode = orderCode
this.getH5BillOrderInfo()
},
methods: {
//
getH5BillOrderInfo() {
api.getH5BillOrderInfo({
billOrderId: this.orderId,
orderCode: this.orderCode,
}).then(res => {
this.orderData = res.data.data
//
if (this.orderData.orderStatus === '0') {
let date = (this.orderData.createDate + "").replace(/-/g, '/')
let createDate = new Date(date).getTime()
let lastTime = createDate + 900000
let now = new Date().getTime()
let rest = lastTime - now
if (rest > 0) {
this.restTime = rest
} else {
this.restTime = 0
}
}
this.loading = false
}).catch(err => {
console.error(err)
Toast('查询订单详情失败');
})
},
//
getSubItem(item) {
let nameArr = item.subItemList.map((subItem) => {
return subItem.subItemName
})
return nameArr.join(",")
},
//
timeFinish() {
this.timeEnd = true
},
//
continuePayOrder() {
this.buttonDisabled = true
api.continuePayOrder({
orderCode: this.orderData.orderCode,
deptId: this.orderData.deptId
}).then(res => {
//
this.orderMessage = res.data.data
//
if (this.orderMessage.payWay === "1") {
//
this.$nextTick(function () {
this.$refs.wxPay.goToPay(res.data.data)
})
} else if (this.orderMessage.payWay === "3") {
//
// $.setReferer(this.orderMessage.payDomain)
window.location.href = this.orderMessage.payUrl
}
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.buttonDisabled = false
})
},
//
cancelOrder() {
this.buttonDisabled = true
Dialog.confirm({
message: '确认取消当前订单?',
}).then(() => {
//
api.cancelOrder({
orderCode: this.orderData.orderCode
}).then(res => {
Toast("取消成功")
this.getH5BillOrderInfo()
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
}).finally(() => {
this.buttonDisabled = false
})
}).catch(() => {
// on cancel
}).finally(() => {
this.buttonDisabled = false
})
},
//
orderSuccess() {
api.billOrderSuccess({
orderCode: this.orderMessage.orderCode
})
//
this.$router.push({
name: 'home',
//
params: {refresh: true}
})
},
}
}
</script>
<style lang="scss">
.order-detail-container {
width: 90%;
margin: 0 auto;
padding-top: .5rem;
padding-bottom: 1.66rem;
background: #ffffff;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder;
color: #374d4e;
font-size: 0.32rem;
text-align: center;
letter-spacing: 0.01rem;
}
.price {
padding: .3rem .3rem .2rem .3rem;
font-size: 0.4rem;
text-align: center;
span {
color: #374d4e;
font-weight: 500;
font-size: 0.6rem;
}
}
.time {
padding: .1rem .3rem .2rem .3rem;
color: #f6a138;
display: flex;
justify-content: center;
.van-count-down {
padding-top: .05rem;
padding-left: .22rem;
font-size: 0.32rem;
color: #f6a138;
}
}
.content-box {
padding: .1rem .3rem .2rem .1rem;
font-size: 0.27rem;
.content-row {
padding: .1rem .3rem .2rem .3rem;
display: flex;
width: 100%;
.content-title {
width: 26%;
color: #999;
text-align-last: justify;
text-align: justify;
text-justify: distribute-all-lines;
}
.content-detail {
width: 72%;
text-align: left;
padding-left: 0.55rem;
}
}
}
.bottom {
padding: .1rem .2rem 0 .3rem;
margin-top: .2rem;
font-weight: 400;
font-size: 0.28rem;
text-align: center;
.van-button--small {
padding: 0.28rem 0.25rem !important;
font-size: 0.26rem !important;
border-radius: 300px;
}
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,307 @@
<template>
<div class="record-container">
<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
<van-list v-model="loading" :finished="finished" finished-text=""
:immediate-check=false
@load="selectRecordList" style="padding-bottom: .5rem">
<div class="bill" v-for="(orderRecord, index) in orderRecordList" :key="index"
v-if="orderRecordList.length > 0">
<div class="time">
<van-row>
<van-col span="2"></van-col>
<van-col span="20" style="font-size:12px;font-weight:500;">{{ orderRecord.createDate }}</van-col>
</van-row>
</div>
<div @click="toOrderDetail(orderRecord)">
<van-row>
<van-col span="1"></van-col>
<van-col span="22">
<div class="content-box">
<div class="title-box">
<div class="title">{{ orderRecord.billTitle }}</div>
<div class="countTime" v-if="orderRecord.orderStatus === '0'">
<van-icon name="clock-o" style="left: 0.05rem;" size=".36rem"></van-icon>
<van-count-down :time="checkCountTime(orderRecord)" format="mm:ss" @finish="timeFinish(index)"/>
</div>
<div class="status" v-else>{{ orderStatus[orderRecord.orderStatus] }}</div>
</div>
<div class="content">
<div class="content-title">订单金额</div>
<div class="content-price">{{ '¥' + orderRecord.practicalMoney }}</div>
</div>
<!-- <div class="student-box">
<span style="color: #a2a6b0; padding-right: 0.1rem">学生</span>
<span class="student">{{ orderRecord.studentName }}</span>
</div> -->
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<div class="bottom-box">
<van-button plain size="mini" color="#a2a6b0"
style="margin-right: 0.2rem"
@click.stop="cancelOrder(orderRecord, index)"
v-if="orderRecord.orderStatus === '0'">取消订单
</van-button>
<van-button size="mini" color="#f6a138" v-if="orderRecord.orderStatus === '0'">继续支付</van-button>
<van-button size="mini" color="#f6a138" class="detail" v-else>查看详情</van-button>
</div>
</div>
</van-col>
</van-row>
</div>
</div>
</van-list>
<van-empty description="暂无缴费记录" v-if="orderRecordList.length === 0"/>
</van-pull-refresh>
</div>
</template>
<script>
import api from "../api/api"
import {Dialog, Toast} from "vant"
export default {
name: "orderRecord",
data() {
return {
currentStudent: null,
orderRecordList: [],
pagination: this.initPage(),
refreshLoading: false,
loading: false,
finished: false,
total: null,
orderStatus: ['待支付', '付款中', '交易成功', '待退款', '交易关闭'],
}
},
methods: {
//
initRecordList(currentStudent) {
this.currentStudent = currentStudent
//
this.orderRecordList = []
this.pagination = this.initPage()
this.loading = true
console.log("进入点击")
this.selectRecordList()
},
//
initPage() {
return {
pageNum: 1,
pageSize: 10
}
},
//
onRefresh() {
console.log("进入刷新")
//
this.orderRecordList = []
this.pagination = this.initPage()
this.selectRecordList()
},
//
selectRecordList() {
api.listH5BillOrderPage({
...this.pagination,
studentId: this.currentStudent.id,
deptId: this.currentStudent.schoolId,
}).then(res => {
let data = res.data.data
this.orderRecordList.push(...data.records)
this.total = data.total
//
this.loading = false
if (this.pagination.pageNum >= Math.ceil(this.total / this.pagination.pageSize)) {
this.finished = true
} else {
this.pagination.pageNum++
}
}).catch(err => {
console.error(err)
Toast('查询缴费记录失败')
}).finally(() => {
this.refreshLoading = false
})
},
//
checkCountTime(orderRecord) {
let date = (orderRecord.createDate + "").replace(/-/g, '/')
let createDate = new Date(date).getTime()
//
let lastTime = createDate + 900000
//
let now = new Date().getTime()
let rest = lastTime - now
if (rest > 0) {
return rest
} else {
return 0
}
},
//
timeFinish(index) {
this.orderRecordList[index].orderStatus = '4'
this.orderRecordList[index].payStatus = '3'
},
//
cancelOrder(orderRecord, index) {
Dialog.confirm({
message: '确认取消当前订单?',
}).then(() => {
//
api.cancelOrder({
orderCode: orderRecord.orderCode
}).then(res => {
Toast("取消成功")
//
this.orderRecordList[index].orderStatus = '4'
this.orderRecordList[index].payStatus = '3'
}).catch(err => {
console.error(err.response.data)
Toast(err.response.data.message)
})
}).catch(() => {
// on cancel
})
},
//
toOrderDetail(orderRecord) {
this.$router.push({
path: '/orderDetail',
query: {
orderId: orderRecord.orderId
}
})
}
}
}
</script>
<style lang="scss">
.record-container {
padding-top: .5rem;
padding-bottom: .3rem;
background: #f8f8f8;
.bill {
.time {
text-align: center;
color: #a2a6b0;
padding: 0.1rem;
font-weight: bolder;
font-size: .28rem;
}
.content-box {
padding-top: .2rem;
padding-bottom: .2rem;
// box-shadow: 2px 2px 6px 2px #d2d2d2;
background-color: #fff;
border-radius: 0.1rem;
margin-top: 0.2rem;
.title-box {
padding: .1rem .3rem .2rem .3rem;
display: flex;
align-items: center;
justify-content: space-between;
.title {
width: 75%;
font-weight: 500;
color: #374d4e;
font-size: .28rem;
letter-spacing: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.status, .countTime {
width: 25%;
text-align: right;
color: #f6a138;
font-weight: 500;
font-size: .25rem;
}
.countTime {
display: flex;
.van-count-down {
padding-left: .12rem;
font-size: .3rem;
}
}
}
.student-box {
padding: .1rem .3rem .2rem .3rem;
.student {
font-weight: 500;
font-size: .26rem;
}
}
.content {
text-align: center;
margin:.58rem 0 .5rem;
display: flex;
align-items: center;
justify-content: center;
.content-title {
color: #a2a6b0;
font-weight: 500;
font-size: .28rem;
letter-spacing: 1.5px;
}
.content-price {
margin-left: .15rem;
color: #000;
font-weight: 600;
font-size: .36rem;
}
}
.bottom-box {
padding: .2rem .2rem 0 .2rem;
font-weight: 400;
font-size: 0.25rem;
text-align: right;
.van-button--mini {
padding: 0.25rem 0.2rem !important;
font-size: 0.25rem !important;
border-radius: 300px;
}
.detail {
border: none;
}
}
}
}
.bill:nth-child(n + 2) {
margin-top: 0.5rem;
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>

@ -0,0 +1,44 @@
<template>
<div class="success-box">
<div class="cont">
<img src="../assets/img/success.png" alt="">
<h3>支付成功</h3>
</div>
</div>
</template>
<script>
export default {
name: "paySuccess"
}
</script>
<style scoped="scoped">
.success-box {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 10;
background: white;
}
.cont {
text-align: center;
font-size: 0.28rem;
width: 60%;
padding-top: 2rem;
margin: 0 auto;
}
.cont img {
width: 80%;
}
.cont p {
color: #999;
margin-top: 0.5rem;
text-align: left;
}
</style>

Some files were not shown because too many files have changed in this diff Show More