提交 71f0e77a 编写于 作者: guangjun.yang's avatar guangjun.yang

申请逻辑修改

上级 86acc5e7
......@@ -8,11 +8,16 @@ import '@/utils/rem' // 引入自适应
import '@/utils/yqy-bridge' // 移动端服务
// import FastClick from 'fastclick'
import vueFilters from '@/utils/filter'
// import VConsole from 'vconsole/dist/vconsole.min.js'
// if(!(process.env.BUILD_ENV === 'uat' || process.env.BUILD_ENV === 'pro')) {
import VConsole from 'vconsole/dist/vconsole.min.js'
import BuriedPoint,{ sendBuriedData} from 'web-buried-point';
import Vant from 'vant';
import 'vant/lib/index.css';
if(!(process.env.BUILD_ENV === 'uat' || process.env.BUILD_ENV === 'pro')) {
// if(!(process.env.BUILD_ENV === 'pro')) {
// let vConsole = new VConsole() // 初始化
// }
let vConsole = new VConsole() // 初始化
}
// 可调试
// Vue.config.devtools = true;
......@@ -53,7 +58,6 @@ Vue.mixin({
})
// import './plugins';
import BuriedPoint,{ sendBuriedData} from 'web-buried-point';
// import { buriedURL } from './apiConfig';
let domain = '';
if (process.env.BUILD_ENV === 'prod') {
......@@ -74,8 +78,6 @@ Vue.use(BuriedPoint, {
});
Vue.prototype.$sendBuriedData = sendBuriedData;
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
new Vue({
......
......@@ -17,8 +17,9 @@ service.interceptors.request.use(config => {
if(config.data.token){
config.headers['token'] = config.data.token || '0F32D60C3D7042158BCF1FB574E482BE'
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
config.headers['token'] = 'A92C95FD752C413FA3244767177344B7' || 'F5CE3BAEC4934864B1022C1C4D39EB40';
config.headers['token'] = 'C85C482D4E854364815C85485C6277F1' || 'F5CE3BAEC4934864B1022C1C4D39EB40';
}
delete config.data.token;
}
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
......
......@@ -25,8 +25,8 @@ function getConfigByEnvType(urlType) {
// 日期与时间解析函数
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
if (arguments.length === 0 || !time) {
return ''
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
......@@ -117,4 +117,23 @@ export function deepCopy(obj) {
export function mergeObjs(...ojbs){
}
export function gotoPage(context, pageUrl) {
if(__isWeb) {
context.$router.push(pageUrl)
} else {
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(pageUrl),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ module.exports = {
if(this.$route !== undefined) {
query = this.$route.query
}
this.token = this.getUrlKey('token') || (query && query.token) || 'A92C95FD752C413FA3244767177344B7'
this.token = this.getUrlKey('token') || (query && query.token) || 'C85C482D4E854364815C85485C6277F1'
},
mounted() {
......
......@@ -4,38 +4,9 @@
e.rocNative = {
// 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法
__nativeCall: function (e, t, n) {
// if(t == '__refresh'){
// console.log('!__refresh: ',t,n);
// __refresh(n);
// // return;
// }
if( window[t] ){
if (window[t]) {
window[t](n)
}
// if(t == '__getUserInfo64Comp') {
// __getUserInfo64Comp(n);
// }
// if(t == '__getUserInfo'){
// __getUserInfo(n);
// // return;
// }
// if(t == '__getUserInfo4Comp'){
// __getUserInfo4Comp(n);
// // return;
// }
// if(t == '__getUserInfo4Coop'){
// __getUserInfo4Coop(n);
// // return;
// }
// if (t == '__sendBuriedPoint') {
// __sendBuriedPoint(n);
// // return
// }
// if (t == '__openErrorDebug') {
// __openErrorDebug(n);
// // return
// }
},
__callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o);
......@@ -82,7 +53,7 @@
})
}
})
}("gotoLogin", "dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight", "setTabMiniIcon", "getUserInfo", "pauseAudioView", "sendBuriedPoint", "openErrorDebug", "upGradeVersion","getLocalData");
}("gotoLogin", "dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight", "setTabMiniIcon", "getUserInfo", "pauseAudioView", "sendBuriedPoint", "openErrorDebug", "upGradeVersion", "getLocalData");
if (e.__rocAndroid) {
e.__isAndroid = true
e.__isIOS = false
......@@ -96,7 +67,7 @@
e.__isIOS = false
e.__isWeb = true
}
if(window.__isIOS){
if (window.__isIOS) {
rocNative.appInit()
}
}(window);
此差异已折叠。
......@@ -38,14 +38,14 @@ export default {
formData: {
creditId: "",
id: "",
name: "测试",
name: "",
idCardNumber: "",
icCardNumber: "",
},
projectId: "",
token: "A92C95FD752C413FA3244767177344B7",
// projectId: "",
token: "C85C482D4E854364815C85485C6277F1",
buttonStyleType: 'disabled',
from: "outer",
from: "native",
isBlack: true,
bgColor: "#fff",
navTitle: "申请学分",
......@@ -72,32 +72,64 @@ export default {
}
},
created() {
// 前一页面传projectId,token
this.projectId = this.$route && this.$route.query && this.$route.query.projectId || 393;
this.formData.id = this.projectId;
let _this = this;
window.__getUserInfoInCEdit = function(param) {
_this.token = param.userToken;
_this.getUserInfoByToken();
_this.getLatestApplyRecord();
};
window.__refresh = function() {
_this.getUserInfo();
};
// 前一页面传creditId
// this.projectId = this.$route && this.$route.query && this.$route.query.projectId || '';
this.from = this.$route && this.$route.query && this.$route.query.from || this.from;
this.creditId = this.$route && this.$route.query && this.$route.query.creditId || 393;
// this.formData.id = this.projectId;
this.formData.creditId = this.creditId;
this.token = this.$route && this.$route.query && this.$route.query.token || this.token || ''
this.getUserInfoByToken();
if (__isWeb) {
this.getUserInfoByToken();
this.getLatestApplyRecord();
} else {
this.getUserInfo()
}
},
methods: {
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfoInCEdit"
});
},
// 提交申请
applyCredit() {
let _this = this;
let param = {
...this.formData,
token: this.token,
setEntry: true
};
// this.GET("cme/credit/certificate/list", param).then(res => {
this.POST("cme/credit/apply", param).then(res => {
this.isShowDialog = true
if(res.code == '000000') {
this.isShowDialog = true
}
})
},
// 最后一次提交信息:获取用户的idCardNumber
getLatestApplyRecord() {
let param = {
token: this.token,
setEntry: true
};
this.POST("cme/credit/latestApplyRecord/" + this.creditId, param).then(res => {
this.formData.icCardNumber = res.data.icCardNumber;
})
},
// 根据token获取用户信息
getUserInfoByToken() {
let _this = this;
let param = {
token: this.token,
setEntry: true
......@@ -105,7 +137,6 @@ export default {
this.GET("cme/credit/doctor/info", param).then(res => {
this.formData.name = res.data.name;
this.formData.idCardNumber = res.data.card;
this.formData.icCardNumber = res.data.icCardNumber;
this.isShowDialog = true
})
},
......@@ -113,13 +144,19 @@ export default {
// 显示提交成功的提示信息
handlerDialogAction(type) {
this.isShowDialog = false;
// 跳转到前一页面
if (window.__isWeb) {
this.$router.back(-1);
} else {
rocNative.goBack();
}
},
},
};
</script>
<style lang="scss" scoped>
<style lang="scss">
@import "../style/mixin";
.credit-edit-wrapper {
.group {
......@@ -132,6 +169,14 @@ export default {
line-height: px2rem(21px);
color: #979899;
}
.van-cell {
padding: px2rem(20px) 0 !important;
font-size: px2rem(15px) !important;
color: #373839 !important;
}
.van-cell__title span {
font-weight: 400 !important;
}
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册