提交 a66cacc4 编写于 作者: xiaoping.di's avatar xiaoping.di

教培兼容ios

上级
流水线 #38492 已失败 于阶段
# comment
deploy
node_modules
public
[*.{js,jsx,ts,tsx,vue,scss,css}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
NODE_ENV=development
# baseUrl
BASE_URL=/pica_eagle_new/
# 路由 base
VUE_APP_BASE_ROUTE_URL=/pica_eagle_new
# 默认路由地址
VUE_APP_BASE_ROUTE=/
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-dev.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
# VUE_APP_MOCK_USER_INFO=eyJhdmF0YXIiOm51bGwsIm1vYmlsZSI6IjE4MTE3MDIzOTE2Iiwibmlja05hbWUiOiIxODEqKioqMzkxNiIsImlkZW50aWZ5U3RhdHVzIjpudWxsLCJ1c2VySWQiOiI2OTIzMDczNDM1ODQ2NjE1MDQiLCJsb2dpbkNoYW5uZWwiOiJtYW5pdWprLWNoYW5uZWwtY29uc3VtZXItYXBwIn0=
# 是否加密
VUE_APP_ENCRYPT=
# 是否开启 vConsole
VUE_APP_CONSOLE=true
# appid
VUE_APP_APPID=ab5cb3c1fd834ca1892cd7b3c6e57717
#生成骨架屏扫描地址(可选择本地)
VUE_APP_SKELETON='http://localhost:8083'
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='dev'
VUE_APP_SERVICE_URL=https://dev-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-dev.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=
# 是否开启vConsole
VUE_APP_CONSOLE=true
# 是否开启打印 console.log
VUE_APP_HAS_CONSOLE=true
#OSS上传Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-dev'
# appid
VUE_APP_APPID=wxf4e66242d31c81c2
NODE_ENV=development
VUE_APP_ENV=development
VUE_APP_SERVICE_URL=
# 模拟用户信息
VUE_APP_MOCK_USER_INFO=eyJhdmF0YXIiOm51bGwsIm1vYmlsZSI6IjE4MTE3MDIzOTE2Iiwibmlja05hbWUiOiIxODEqKioqMzkxNiIsImlkZW50aWZ5U3RhdHVzIjpudWxsLCJ1c2VySWQiOiI2OTIzMDczNDM1ODQ2NjE1MDQiLCJsb2dpbkNoYW5uZWwiOiJtYW5pdWprLWNoYW5uZWwtY29uc3VtZXItYXBwIn0=
VUE_APP_ENCRYPT=
VUE_APP_CONSOLE=true
# 本地开发环境
VUE_APP_IS_LOCAL=true
# appid
VUE_APP_APPID=wxf4e66242d31c81c2
# 本地token
VUE_APP_TOKEN=42789F2675384BFAB05EA57BDBED0E73
# mock的基础地址
VUE_APP_BASE_MOCK_URL=http://192.168.120.69:40001/mock/
# mock的工作空间地址
VUE_APP_MOCK_URL=12/
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='production'
VUE_APP_SERVICE_URL=https://sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启 vConsole
VUE_APP_CONSOLE=
# appid
VUE_APP_APPID=wx2c577552a2d28550
# app渠道
VUE_APP_CHANNEL=prod
# OSS 上传 Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-prod'
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='testing'
VUE_APP_SERVICE_URL=https://test1-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-test.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启 vConsole
VUE_APP_CONSOLE=true
# 是否开启打印 console.log
VUE_APP_HAS_CONSOLE=true
# appid
VUE_APP_APPID=wxcaad75b7fff5659c
# APP 渠道
VUE_APP_CHANNEL=_test
# OSS上传Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-test'
NODE_ENV=production
# 自定义 VUE_APP_ENV
VUE_APP_ENV ='uat'
VUE_APP_SERVICE_URL=https://uat-sc.yunqueyi.com
# 阿里云OSS对象存储地址
VUE_APP_OSS_URL=https://pica-h5-uat.yunqueyi.com/
# 模拟用户信息,如果有则发送模拟用户信息,只针对开发模式
VUE_APP_MOCK_USER_INFO=
# 是否加密
VUE_APP_ENCRYPT=false
# 是否开启vConsole
VUE_APP_CONSOLE=
# appid
VUE_APP_APPID=wx342ef0e5afee54a7
# OSS 上传 Bucket_Name
VUE_APP_BUCKET_NAME='pica-app-uat'
/h5-submodules-master
/node_modules
/src
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// 全局变量
globals: {
'gdp': true,
},
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
'no-console': 0,
'comma-spacing': [2, { // 控制逗号前面没有空格,后面必须有空格
'before': false,
'after': true
}],
'arrow-spacing': [2, { // 要求箭头函数前后有空格
'before': true,
'after': true
}],
'no-multi-spaces': 2,// 禁止使用多个空格,
'no-spaced-func': 2,// 禁止 function 标识符和括号之间出现空格,this.getList () 报错
'semi-spacing': [2, {// 强制分号之前不允许有空格
'before': false,
'after': true
}],
'space-infix-ops': 2,// 要求操作符前后必须有空格: 2 + 3 2 === 2 3 > 2
'spaced-comment': [2, 'always'], // 强制在注释中 // 或 /* 使用一致的空格
'array-bracket-spacing': [2, 'never'],// 指定数组的元素之间要以空格隔开(, 后面), never参数:[ 之后和 ] 之前不能带空格,always参数:[ 之后和 ] 之前必须带空格
"space-before-blocks": 2, // if/function等的大括号之前需要有空格
"vue/script-indent": ["error", 2, { // script标签缩进设置
"baseIndent": 1,
"switchCase": 0,
"ignores": []
}],
'no-undef-init': 2,// 禁止将变量初始化为 undefined,保存时会将let a = undefined变成let a
'semi': [2, 'always'],//强制结尾必须有分号;
'prefer-const': 2,// 要求使用 const 声明那些声明后不再被修改的变量
'quotes': [2, 'single'],//js中强制使用单引号
'no-multiple-empty-lines': [2, {// 不允许多个空行,最多一行
'max': 1
}],
'vue/order-in-components': ['error', {
'order': [
'el',
'name',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives', 'filters'],
'extends',
'mixins',
'inheritAttrs',
'model',
['props', 'propsData'],
'data',
'computed',
'watch',
'LIFECYCLE_HOOKS',
'methods',
['template', 'render'],
'renderError'
]
}],
'vue/attributes-order': ['error', {
'order': [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
'UNIQUE',
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT'
]
}],
}
}
.DS_Store
node_modules
/dist
.history/
# local env files
update_*.sh
package-lock.json
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.proxy.js
.version
log/
logs/
# .pica.prompts.js
log
logs
.version
module.exports = {
'autoRouter': false,
'registry': "http://192.168.110.93:4873/",
'type': "h5",
'projectName': "pica_eagle_new",
'autoConfig': true,
'transition': false,
'useHistoryRouter': true,
'rewriteHtml': true,
'renderToBranch': false,
'srcAlias': "mn-template",
};
FROM nginx
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
echo "Asia/shanghai" > /etc/timezone
COPY error.html /usr/share/nginx/html/error.html
COPY nginx.conf /etc/nginx/nginx.conf
COPY dist/ /usr/vue/pica_eagle_new/dist/
RUN chmod -R +rw /usr/share/nginx/html/error.html &&\
chown -R nginx:nginx /usr/share/nginx/html/error.html &&\
chmod -R +rw /usr/vue/pica_eagle_new/dist/ &&\
chown -R nginx:nginx /usr/vue/pica_eagle_new/dist/
# pica_eagle_new
> 请先查看每个目录的 md 文件
## 启动
```shell script
npm run start
```
## 编译打包
```shell script
#开发环境
npm run build:dev
#预发环境
npm run build:pre
#生产环境
npm run build:prod
#测试环境
npm run build:test
```
## 插件配置
```js
module.exports = {
// 插件配置项
pluginOptions: {
// 蛮牛配置
pica: {
// CDN扩展JS资源排序: ['lodash', 'vue', 'vuex']
jsSort: [],
// CDN扩展CSS资源排序: ['vant.css']
cssSort: [],
// 骨架屏渲染的路由(手动配置)
skeletonRoutes: [
{
path: '/demo',
name: 'Demo',
meta: {
skeleton: true
}
},
],
// 启用自动配置骨架屏渲染路由
enableAutoSkeletonRoutes: false,
// 路由模式
routeMode: 'history',
// 骨架屏一次渲染几个路由
dpsLimit: 5,
// dps骨架屏渲染本地服务配置
dpsServer: {}
},
// 图片压缩
tinypng: {
key: ''
},
// 自动路由配置
autoRouting: {
chunkNamePrefix: 'page-'
}
}
};
```
## dpsServer
### port
服务监听端口,默认从8000开始查找可用端口
### proxy
反向代理中间件配置 @See [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
如果需要自定义返回:
```js
{
proxy: {
'^/app-gateway': (req, res, next) => {
res.json({ code: 200, data: {} });
res.end();
}
}
}
```
## 图片压缩
> 需要在`vue.config.js`中配置`pluginOptions.tinypng.key`的值。
```shell script
npm run tinypng
```
## 调用生成器
```shell script
vue invoke pica
```
## 根据 pica.prompts 生成封闭式模板
```shell script
npm run core
```
## 使用骨架屏
> 框架默认已开启骨架屏渲染。请查看`vue.config.js`
### 自动根据路由配置
需要在路由页面文件配置`route`
```json
{
"meta": {
"skeleton": true
}
}
```
如需自定义骨架
```json
{
"meta": {
"skeleton": {
"name": "必须和路由定义的name一致",
"path": "匹配当前路由的正则",
"pathname": "访问路由的path地址,例如: /mn/demo",
"skeletonId": "骨架屏路由ID,唯一即可"
}
}
}
```
## Jenkinsfile 构建
在 Jenkinsfile 文件中 `versionType = 'Patch';`,versionType 默认为 Patch,为小版本更新,1.2.3 对应 Major.Minor.Patch。
```bash
npm run build:test versionType:Patch
```
## 后台API接口反向代理
### 本地
如果`VUE_APP_MOCK_USER_INFO`不为空则走代理到本地。并且会在接口地址前加上`/proxy`.
默认会把`/proxy`的接口代理到`http://localhost:8081。
如需修改,请查看项目根目录的`.proxy.js`文件
### 走网关
如果`VUE_APP_MOCK_USER_INFO`为空则走代理到网关。并且会在接口地址前加上`/proxy/app-gateway`.
会把`/proxy`的接口代理到`VUE_APP_SERVICE_URL`环境变量,如该变量为空则默认为``
const path = require('path');
function resolve (dir) {
return path.join(__dirname, dir);
}
module.exports = {
resolve: {
alias: {
'@': resolve('src'),
'mn-template': resolve('node_modules/@pica-cli/vue-cli-plugin-pica-cli-plugin/core/src')
}
}
};
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
'@babel/plugin-proposal-object-rest-spread'
]
};
let dpsConfig = require('@pica-core/dps-config');
const externalsDpsConfig = {};
dpsConfig = {
...dpsConfig,
...externalsDpsConfig
};
module.exports = dpsConfig;
module.exports = [
/* {
name: 'payOrder',
url: 'payOrder'
}*/
];
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Error</title>
</head>
<body>
An error occurred on the server when processing the URL. Please contact the system administrator!
</body>
</html>
worker_processes auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#隐藏版本号
server_tokens off;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
client_max_body_size 20m;
server {
listen 80;
server_name_in_redirect off;
server_name *.picahealth.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/vue/pica_eagle_new/dist/;
# if (-d $request_filename) {
# rewrite ^/(.*)([^/])$ https://$host/pica_eagle_new/$1$2/ permanent;
# }
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 404 405 500 502 503 504 /error.html;
location = /error.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
const path = require('path');
const axios = require('axios');
const fs = require('fs');
const projectName = require('./package.json').name;
const filePath = path.join(__dirname, 'src');
// 先删除文件
function deleOldJson() {
const json_path = path.join(__dirname, 'src/menu_code.json');
try{
fs.unlinkSync(json_path);
}catch(err) {
console.log('没有json 文件');
}
}
deleOldJson();
// 文件夹是不是存在
function isFileExisted(filePath) {
return new Promise((resolve, reject) => {
fs.access(filePath, (err) => {
if (err) {
return reject(false);
} else {
return resolve(true);
}
});
});
}
// 请求接口获取menucode
function getMenuCode() {
const url = 'https://sc.yunqueyi.com/basic-data/menuCode/fetch';
// let url="https://dev-sc.yunqueyi.com/basic-data/menuCode/fetch";
console.log(projectName);
axios.get(url, {params:{'projectName':projectName}})
.then(res => {
const resData = res.data;
if(resData.code == '000000') {
if(!resData.data) {
console.log('接口data 数据为空');
return;
}
console.log(resData.data.menuCodeDtoList);
return writerJsonFile(JSON.stringify(resData.data.menuCodeDtoList));
}else{
console.log('获取接口失败');
}
}).catch(error => {
console.error('请求menu接口失败error', error);
});
}
// 写入json 文件
function writerJsonFile(data) {
const wpath = filePath + '/menu_code.json';
fs.writeFileSync(wpath, data);
console.log('写入文件成功');
}
// 创建目录
function createFiles(filePath) {
fs.mkdir(filePath, function(err) {
if(!err) {
getMenuCode();
}else{
console.log('创建目录失败');
}
});
}
isFileExisted(filePath).then(() => {
return getMenuCode();
}).catch(() => {
// 没有文件创建文件
createFiles(filePath);
});
/* eslint-disable */
const fs = require('fs');
const path = require('path');
const program = require('commander');
const pathError = path.resolve(process.cwd(), './.error-log')
const ResetPathFile = require('@pica-core/reset-pathfile-plugin');
program
.command('mode <mode>')
.description('备份log日志')
.action(function (mode) {
// 判断.error-log文件是否存在
fs.stat(pathError, (err, stats) => {
// 如果不存在,就正常执行
if (err) {
console.log('正常执行!');
} else {
new ResetPathFile(mode, 1);
}
});
});
program
.command('check <value>')
.description('检查.error-log是否已删除')
.action(function (mode) {
// 判断.error-log文件是否存在
fs.stat(pathError, (err, stats) => {
// 如果不存在,就正常执行
if (err) {
console.log('正常执行!');
} else {
// 如果存在,执行下面的脚本
fs.unlink(pathError, (err) => {
if (err) throw err;
console.log('.error-log文件已被删除');
throw new Error('请联系运维同学去oss服务器手动copy版本控制相关文件');
});
}
});
});
program.parse(process.argv);
{
"name": "pica_eagle_new",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "pica-cli-service serve",
"build": "pica-cli-service build",
"lint": "pica-cli-service lint",
"add-all": "pica-cli-service add-all",
"build-skeleton": "pica-cli-service build-skeleton",
"build:dev": "pica-cli-service build --mode dev",
"build:prod": "pica-cli-service build --mode production",
"build:report": "pica-cli-service build --report",
"build:test": "pica-cli-service build --mode testing",
"build:uat": "pica-cli-service build --mode uat",
"core": "pica-cli-service core",
"img-md5": "pica-cli-service img-md5",
"page": "vue-cli-service page",
"skeleton": "pica-cli-service skeleton",
"tinypng": "pica-cli-service tinypng"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"dayjs": "^1.8.30",
"dsbridge": "^3.1.4",
"lodash": "^4.17.15",
"md5": "^2.3.0",
"pre-commit": "^1.2.2",
"vant": "^2.8.4",
"vconsole": "^3.3.4",
"vue": "^2.6.11",
"vue-fragment": "^1.5.1",
"vue-router": "^3.3.1",
"vuescroll": "^4.15.1",
"vuex": "^3.1.1"
},
"devDependencies": {
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@pica-cli/pica-cli-framework": "^1.0.11",
"@pica-cli/vue-cli-plugin-pica-cli-plugin": "~1.1.38",
"@pica-core/multiple-versions-plugin": "^1.0.4",
"@pica-core/reset-pathfile-plugin": "^1.0.4",
"@pica-core/web-buried-point": "^1.0.15",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"colors-console": "^1.0.3",
"dotenv": "^8.2.0",
"draw-page-structure": "^1.0.8",
"eslint": "^6.7.2",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^6.2.2",
"fast-install-puppeteer": "^1.0.5",
"husky": "^3.0.9",
"lint-staged": "^9.4.2",
"node-sass": "^4.13.1",
"postcss-px-to-viewport": "^1.1.1",
"prettier": "^2.3.2",
"prettier-eslint-cli": "^5.0.1",
"puppeteer": "^10.1.0",
"sass": "^1.26.3",
"sass-loader": "^8.0.2",
"vue-skeleton-webpack-plugin": "^1.2.2",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^4.4.2"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
],
"husky": {
"hooks": {
"pre-commit": "pica-cli-service img-md5 && lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
],
"src/**/*.{js,vue,html,css,scss,sass}": [
"prettier-eslint --write",
"git add"
]
},
"pica-cli-service": {}
}
module.exports = {
plugins: {
autoprefixer: {},
'postcss-px-to-viewport': {
viewportWidth: 375, // 视口的宽度,对应的时设计稿的宽度/2,一般为750
viewportHeight: 667, // 视口的高度,对应的是设计稿的高度(也可以不配置)
unitPrecision: 5, // 指定‘px’转换为视口单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视口单位,建议使用vw
selectorBlankList: ['ignore', 'tab-bar'],
minPixelValue: 1,
mediaQuery: false,
exclude:[/Tabbar/]
}
}
};
## 增加骨架屏占位 Dom #skeleton
```html
<div id="skeleton"></div>
<div id="app"></div>
```
## 初始化时间记录
```js
(function (window) {
var dsBridge = window.dsBridge;
function logToLocaleString(method) {
var date = new Date();
console.log(date.toLocaleString() + ':' + date.getMilliseconds(), method);
}
window.onNativeLCEvent = logToLocaleString;
window.onload = function () {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'onload');
logToLocaleString('onload');
}
document.addEventListener('DOMContentLoaded', function () {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'DOMContentLoaded');
logToLocaleString('DOMContentLoaded');
});
document.addEventListener('readystatechange', function () {
if (document.readyState == 'interactive') {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'interactive');
logToLocaleString('interactive');
}
if (document.readyState == 'complete') {
dsBridge && dsBridge.call && dsBridge.call('onLCEvent', 'complete');
dsBridge && dsBridge.call && dsBridge.call('forceHideLoading');
logToLocaleString('complete');
}
})
}(window));
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0,viewport-fit=cover">
<!-- 打开和关闭DNS预读取 -->
<meta http-equiv="x-dns-prefetch-control" content="on">
<!-- 强制查询特定主机名 -->
<link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>">
<link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png">
<title>云鹊医-赋能基层医生</title>
<style>
._ {
position: fixed;
z-index: 999;
background: #eee;
border-radius: 4px;
animation: mn-skeleton-blink 1.2s ease-in-out infinite;
}
.__ {
top: 0%;
left: 0%;
width: 100%;
}
.skeleton-component {
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100vw;
height: 100vh;
background: #fff;
}
@keyframes mn-skeleton-blink {
50% {
opacity: 0.6;
}
}
</style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="skeleton"></div>
<div id="app"></div>
<script>
function setSkeletonByName() {
var pathNameSplitList = location.pathname.split('/');
var lastName = pathNameSplitList[pathNameSplitList.length - 1];
var el = document.querySelector('.skeleton-component-' + lastName);
if(el){
el.style.dispaly = 'block';
}
};
setSkeletonByName();
(function (window) {
function logToLocaleString(method) {
var date = new Date();
console.log(date.toLocaleString() + ':' + date.getMilliseconds(), method);
}
window.onNativeLCEvent = logToLocaleString;
window.onload = function () {
logToLocaleString('onload');
}
document.addEventListener('DOMContentLoaded', function () {
logToLocaleString('DOMContentLoaded');
setSkeletonByName();
});
document.addEventListener('readystatechange', function () {
if (document.readyState == 'interactive') {
logToLocaleString('interactive');
}
if (document.readyState == 'complete') {
logToLocaleString('complete');
}
})
}(window));
</script>
<!-- built files will be auto injected -->
<script src="<%= VUE_APP_OSS_URL %>static/js/vue-2.6.11.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vuex-3.4.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vue-router-3.3.2.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vant.min-2.12.26.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/axios-0.19.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/jsencrypt.min-3.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script>
</body>
</html>
该目录建议放置所有请求资源代码,可根据业务划分与不同子目录。
import request from 'mn-template/plugins/http';
// 获取app问诊页面背景图和下面固定两个广告栏信息
export const getCoopRoleCode = async (param) => {
return request({
url: 'contents/projects/guestRoleCode',
method: 'GET',
params: param,
});
};
\ No newline at end of file
import request from 'mn-template/plugins/http';
// 获取app问诊页面背景图和下面固定两个广告栏信息
export const getCoopExamResult = async (param) => {
return request({
url: 'app/exam/lives/check',
method: 'GET',
params: param,
});
};
export const getCoopExamQuest = async (param) => {
return request({
url: 'app/projectExam/questions',
method: 'GET',
params: param,
});
};
//教培中间模块
export const getCoopExam = async (param) => {
return request({
url: 'app/projectExam/exam',
method: 'GET',
params: param,
});
};
export const getCoopExamResultNew = async (param) => {
return request({
url: 'app/projectExam/result',
method: 'GET',
params: param,
});
};
// 获取亲友列表
export const getCoopExamResultNews = async (param) => {
return request({
url: 'app/projectExam/results',
method: 'GET',
params: param,
});
};
// 当前用户的进行中问诊数据查询
export const getCoopExamWrongRecords = async (param) => {
return request({
url: 'app/projectExam/wrongs',
method: 'GET',
params: param,
});
};
export const getHotCache = async () => {
return request({
url: 'basic-data/constants/hotCache',
method: 'get',
});
};
import $http from 'mn-template/plugins/http';
// 获取亲友列表
export const listRelatives = () => $http({
method: 'get',
url: '/splitter/live/v2/list',
params: {version: '3.2.1'}
});
// 新增亲友
export const list = params => $http.get('/aaa/bbb', params);
import request from 'mn-template/plugins/http';
// 获取app问诊页面背景图和下面固定两个广告栏信息
export const getCoopTop = async (param) => {
return request({
url: 'contents/projects/top',
method: 'GET',
params: param,
});
};
//教培底部模块
export const getCoopBottom = async (param) => {
return request({
url: 'contents/projects/bottom',
method: 'GET',
params: param,
});
};
//教培中间模块
export const getCoopMiddle = async (param) => {
return request({
url: 'contents/projects/middle',
method: 'GET',
params: param,
});
};
//教培考试信息模块
export const getCoopLiveExam = async (param) => {
return request({
url: `contents/projects/live/${param.id}`,
method: 'GET',
params: {token:param.token},
});
};
// 获取亲友列表
export const getCoopOrder = async (param) => {
return request({
url: `contents/projects/${param.id}`,
method: 'GET',
params: {token:param.token}
});
};
// 当前用户的进行中问诊数据查询
export const getImTeamIdUsing = async () => {
return request({
url: 'diagnose/diagnose/index/singleDiagnose',
method: 'post',
});
};
export const getHotCache = async () => {
return request({
url: 'basic-data/constants/hotCache',
method: 'get',
});
};
// 获取医生详情
export const getDocdetails = async (id) => {
return request({
url: `diagnose/superiorDoctor/detail?doctorId=${id}`,
method: 'get',
});
};
// 医生问诊获取参数ID
export const getDocDiagnoseLogId = async (data) => {
return request({
url: '/diagnose/diagnose/unify/normal/create',
method: 'post',
data,
});
};
// 极速问诊
export const getQuickGoods = async () => {
return request({
url: '/diagnose/diagnose/quick/goods/all',
method: 'get',
});
};
// 极速问诊获取参数ID
export const getrapDiagnoseLogId = async (data) => {
return request({
url: '/diagnose/diagnose/unify/quick/create',
method: 'post',
data,
});
};
该目录下请放置需要被编译的图片资源,打包运行时,如在`vue.config.js`中配置了:
`pluginOptions.tinypng.key`则会自动压缩
<template>
<div>
<header-slider
v-if="type =='type_1'"
ref="header"
:slider-lists="datas"
/>
<text-collapse
v-if="type =='type_2'"
ref="text"
:info-msg="datas"
/>
<project-content
v-if="type =='type_3'"
ref="content"
:exam-content="datas"
:key-index="keyIndex"
/>
<about-course
v-if="type =='type_4'"
ref="course"
:courses="datas"
/>
</div>
</template>
<style scoped>
</style>
<script>
import headerSlider from './headerSlider';
import textCollapse from './textCollapse';
import projectContent from './projectContent';
import aboutCourse from './aboutCourse';
// import livesExam from './livesExam'
const globalEvent = weex.requireModule('globalEvent');
export default {
components: {
headerSlider,
textCollapse,
projectContent,
aboutCourse
// livesExam
},
props: ['type', 'datas', 'keyIndex'],
data() {
return {
};
},
mounted() {
if(this.type == 'type_3') {
console.log(this.datas, '<======>', this.type);
}
},
methods: {
setExamData() {
setTimeout( () => {
this.$refs['content'].addLogicForExam();
});
},
},
};
</script>
\ No newline at end of file
<template>
<div
class="nav-title"
:style="
'background:' +
bgColor +
';' +
'padding-top:' +
paddingTop
"
>
<span
class="nav-back"
@click="goBack"
>
<img
v-show="isBlack"
src="./images/left-array-black.png"
alt=""
>
<img
v-show="!isBlack"
src="./images/left-array-whiter.png"
alt=""
>
</span>
<span
v-show="bgColor !== 'none'"
class="nav-title-title"
>
{{ title }}</span>
<span
v-if="isShowRight"
class="nav-share"
@click="rightAction"
>
<span class="active-text">客服</span>
</span>
<span
v-if="!isShowRight"
class="nav-share"
@click="rightAction"
>
<span
class="active-text"
@click="share"
>
<img
v-if="isShowShare"
src="./images/share-icon-black.png"
alt=""
>
<img
v-else-if="isShowShareWhite"
src="./images/share-icon-white.png"
alt=""
>
<span
v-else-if="isCancel"
class="nav-share"
@click="cancelGoSearch"
>
<span class="active-text">取消</span>
</span>
</span>
</span>
<slot name="externals" />
<!-- <span class="nav-share">
<slot></slot>
</span>-->
</div>
<!-- <section
v-if="!isWeb"
:class="isFixheader ? 'nav-top fixed' : 'nav-top'"
:style="'height:' + navHeight"
>
<div
class="nav-part"
:style="
'background:' +
bgColor +
';' +
'padding-top:' +
paddingTop +
';border-bottom:' +
borderStyle
"
>
</div>
</section>-->
</template>
<script>
export default {
name: 'CommonHeader',
props: {
isWeb: {
type: Boolean,
default: false,
},
bgColor: {
type: String,
default: '',
},
title: {
type: String,
default: '暂无数据',
},
// 是否fix定位
isFixheader: {
type: Boolean,
default: true,
},
backMethod: {
type: String,
default: '', // inner native
},
isShowRight: {
type: Boolean,
default: false,
},
borderStyle: {
type: String,
default: '1px solid #e7e7e7',
},
isBlack: {
type: Boolean,
default: true,
},
goPage: {
type: String,
default: '',
},
isCustomBack: {
type: Boolean,
default: false,
},
isShowShare: {
type: Boolean,
default: false,
},
isCancel: {
type: Boolean,
default: false,
},
isShowShareWhite: {
type: Boolean,
default: false,
},
isHanderBack: {
type: Boolean,
default: false,
}
},
data() {
return {
headerHeight: 16,
contentHeight: 38,
fontSize: 37.5,
};
},
computed: {
navHeight() {
if (this.isFixheader) {
return 0;
} else {
return (this.headerHeight + this.contentHeight + 10) + 'px';
}
},
paddingTop() {
return this.headerHeight + 'px';
},
},
created() {
this.getStatusHeight();
},
mounted() {
// const htmlDom = document.getElementsByTagName('html')[0].style.fontSize;
// this.fontSize = htmlDom;
},
methods: {
getStatusHeight() {
const _this = this;
window.getPhoneParameters = function(res) {
_this.headerHeight = res.data.statusBarHeight;
console.log('res' + JSON.stringify(res));
};
try{
this.$rocNative.getAppVersionCode().then(res => {
if (res.versionCode < '3.7.8') {
console.log('低版本');
} else {
window.prompt(JSON.stringify({
functionName: 'getPhoneParameters',
paramJson: JSON.stringify({}),
callBackName: 'getPhoneParameters'
}));
}
});
}catch(error){
console.log(122);
}
},
// 返回
goBack() {
// 如果是自定义返回,则在父组件中处理事件
if (this.isCustomBack) {
this.$emit('selfGoBack');
return;
}
// 返回之前数据处理
if(this.isHanderBack) {
try{
this.$parent.isHanderBack();
}catch(err) {console.log(err);}
}
if (this.isWeb) {
window.isBack = true;
this.$router.go(-1);
} else {
if (this.backMethod === 'native') {
this.$rocNative.goBack();
} else {
if (this.goPage) {
return this.$router.push(this.goPage);
}
window.isBack = true;
this.$router.go(-1);
}
}
},
// 右侧文案或图标事件
rightAction() {
this.$emit('rightAction');
},
share() {
this.$emit('share');
console.log('分享触发');
},
cancelGoSearch() {
this.$emit('cancelGoSearch');
},
},
};
</script>
<style lang="scss" scoped>
.nav-top {
background: #fff;
color: #333;
position: fixed;
top: 0;
left: 0;
z-index: 1300;
.nav-part {
width: 100%;
position: fixed;
top: 0;
left: 0;
font-size: 18px;
text-align: center;
padding: 0 0 10px 0;
}
}
.nav-title {
width: 100%;
height: 40px;
position: fixed;
top:0;
left: 0;
z-index:2;
.nav-back {
display: inline-block;
height: 25px;
width: 55px;
padding-left: 15px;
padding-right: 15px;
}
.nav-title-title {
position: absolute;
left: 50%;
transform: translate(-50%, 0%);
height: auto;
}
img {
display: block;
// width: 100%;
width: 25px;
height: 25px;
}
.nav-share {
margin-right: 16px;
top: 0;
height: 25px;
// width: 25px;
.active-text {
font-size: 15px;
color: #373839;
}
}
&-title {
height: 18px;
font-size: 18px;
// font-weight: 700;
color: rgba(51, 51, 51, 1);
line-height: 26px;
display: inline-block;
max-width: 230px;
height: 36px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
</style>
.loading-wrapper {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: 100%;
width: 100%;
.loading-content {
width: 30px;
height: 30px;
//background-color: #fff;
}
.loading-text {
width: 100%;
text-align: center;
color: #979899;
font-size: 14px;
padding-top: 10px;
}
}
.van-overlay {
//background: #ffffff;
}
<template>
<div>
<van-overlay :show="showOverLay">
<div class="loading-wrapper">
<van-loading
:color="loadingTextColor"
class="loading-content"
/>
<div class="loading-text">
{{ loadingText }}
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import {Loading, Overlay} from 'vant';
import Vue from 'vue';
Vue.use(Loading).use(Overlay);
export default {
props: {
showOverLay: {
type: Boolean,
default: false,
},
loadingTextColor: {
type: String,
default: '#0D9078',
},
loadingText: {
type: String,
default: '加载中...',
},
},
data() {
return {};
},
};
</script>
<style scoped lang="scss">
@import "index";
</style>
<!-- CopyRight (C) 2017-2022 Alibaba Group Holding Limited. -->
<!-- Created by Tw93 on 17/09/25. -->
<!--A Cell -->
<template>
<div :class="['wxc-cell', hasTopBorder && 'cell-top-border', hasBottomBorder && 'cell-bottom-border', hasMargin && 'cell-margin', hasVerticalIndent && 'cell-indent', desc && 'has-desc']"
:style="cellStyle"
:accessible="autoAccessible"
:aria-label="`${label},${title},${desc}`"
@click="cellClicked">
<slot name="label">
<div v-if="label">
<div class="cell-label-text">{{label}}</div>
</div>
</slot>
<div class="cell-title">
<slot name="title">
<div class="cell-content">{{title}}</div>
<div class="cell-desc-text" v-if="desc">{{desc}}</div>
</slot>
</div>
<slot name="value"></slot>
<slot></slot>
<img :src="arrowIcon"
class="cell-arrow-icon"
:aria-hidden="true"
v-if="hasArrow"/>
</div>
</template>
<style scoped>
.wxc-cell {
/*height: 100px;*/
flex-direction: row;
/*padding-left: 24px;*/
/*padding-right: 24px;*/
background-color: #ffffff;
}
.cell-margin {
margin-bottom: 24px;
}
.cell-title {
flex: 1;
}
.cell-indent {
padding-bottom: 15px;
padding-top: 15px;
}
.has-desc {
padding-bottom: 18px;
padding-top: 18px;
}
.cell-top-border {
border-top-color: #e2e2e2;
border-top-width: 1px;
}
.cell-bottom-border {
border-bottom-color: #e2e2e2;
border-bottom-width: 1px;
}
.cell-label-text {
font-size: 30px;
color: #666666;
width: 188px;
margin-right: 10px;
}
.cell-arrow-icon {
width: 22px;
height: 22px;
}
.cell-content {
color: rgb(102, 102, 102);
font-size: 30px;
line-height: 40px;
}
.cell-desc-text {
color: rgb(102, 102, 102);
font-size: 24px;
line-height: 30px;
margin-top: 4px;
}
</style>
<script>
//import {Utils} from 'weex-ui';
export default {
props: {
label: {
type: String,
default: ''
},
title: {
type: String,
default: ''
},
desc: {
type: String,
default: ''
},
link: {
type: String,
default: ''
},
hasTopBorder: {
type: Boolean,
default: false
},
hasMargin: {
type: Boolean,
default: false
},
hasBottomBorder: {
type: Boolean,
default: true
},
hasArrow: {
type: Boolean,
default: false
},
arrowIcon: {
type: String,
default: 'https://gw.alicdn.com/tfs/TB11zBUpwMPMeJjy1XbXXcwxVXa-22-22.png'
},
hasVerticalIndent: {
type: Boolean,
default: true
},
cellStyle: {
type: Object,
default: () => ({})
},
autoAccessible: {
type: Boolean,
default: true
}
},
methods: {
cellClicked (e) {
const link = this.link;
this.$emit('wxcCellClicked', { e });
//link && Utils.goToH5Page(link, true);
}
}
};
</script>
export { default } from './index.vue';
<!-- CopyRight (C) 2017-2022 Alibaba Group Holding Limited. -->
<!-- Created by Tw93 on 16/10/28. -->
<!-- Updated by Tw93 on 17/01/06. -->
<template>
<div>
<wxc-radio v-for="(item,i) in updateList"
:config="config"
v-bind="item"
@wxcRadioItemChecked="wxcRadioItemChecked(i,$event)"
:key="i"></wxc-radio>
</div>
</template>
<style scoped>
</style>
<script>
import wxcRadio from './item.vue';
export default {
components: { wxcRadio },
props: {
list: {
type: Array,
default: () => ([])
},
config: {
type: Object,
default: () => ({})
}
},
data: () => ({
checkedIndex: -1
}),
computed: {
updateList () {
const { checkedIndex, list } = this;
const updateList = [];
list && list.forEach((item, i) => {
item.checked = i === checkedIndex;
updateList.push(item);
});
return updateList;
}
},
watch: {
list (newList) {
this.setListChecked(newList);
}
},
created () {
this.setListChecked(this.list);
},
methods: {
setListChecked(list){
if (list && list.length > 0) {
list.forEach((item, i) => {
item.checked && (this.checkedIndex = i);
});
}
},
wxcRadioItemChecked (i, e) {
const oldIndex = this.checkedIndex;
const { value, title } = this.list[i];
this.checkedIndex = i;
this.$emit('wxcRadioListChecked', { value, title, oldIndex, index: i,item: this.list[i] })
}
}
}
</script>
<!-- CopyRight (C) 2017-2022 Alibaba Group Holding Limited. -->
<!-- Created by Tw93 on 17/07/28. -->
<template>
<!-- <van-cell title="单元格" value="内容" />
<van-cell title="单元格" value="内容" label="描述信息" /> -->
<div :has-bottom-border="false"
@wxcCellClicked="wxcCellClicked"
:accessible="true"
:aria-label="`${title},状态为${checked?'已选中':'未选中'},${disabled?'不可更改':''}`">
<img :src="radioIcon"
slot="label"
class="radio"/>
<div :style="{color:color}"
class="title-text"
slot="title">{{title}}</div>
</div>
</template>
<style scoped>
.radio {
width: 36px;
height: 36px;
margin-right: 20px;
margin-top: 5px;
}
.title-text {
font-size: 32px;
color: rgb(102, 102, 102);
overflow: visible;
line-height: 45px;
}
</style>
<script>
import WxcCell from './cell.vue'
const CHECKED = 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/radio_checked.png';
const UNCHECKED = 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/radio_unchecked.png';
export default {
components: { WxcCell },
props: {
hasTopBorder: {
type: Boolean,
default: false
},
title: {
type: String,
require: true
},
value: {
type: [String, Number, Object],
require: true
},
disabled: {
type: Boolean,
default: false
},
checked: {
type: Boolean,
default: false
},
config: {
type: Object,
default: () => ({})
}
},
data: () => ({
icon: [CHECKED, UNCHECKED]
}),
computed: {
radioIcon () {
const { icon, disabled, checked, config } = this;
const mergeIcon = icon;
config.checkedIcon && (mergeIcon[0] = config.checkedIcon);
config.disabledIcon && (mergeIcon[1] = config.disabledIcon);
// return checked ? mergeIcon[disabled ? 1 : 0] : '';
return checked ? CHECKED : UNCHECKED;
},
backgroundColor () {
const { disabled } = this;
return disabled ? '#F2F3F4' : '#FFFFFF';
},
color () {
const { disabled, checked, config } = this;
// let checkedColor = '#EE9900';
// let checkedColor = '#35cbca';
let checkedColor = 'rgb(42, 185, 165)';
config.checkedColor && (checkedColor = config.checkedColor);
return checked && !disabled ? checkedColor : '#3D3D3D';
}
},
methods: {
wxcCellClicked () {
const { disabled, value } = this;
if (!disabled) {
this.$emit('wxcRadioItemChecked', { value, disabled })
}
}
}
}
</script>
<template>
<div>
<div
v-if="courses"
class="container"
>
<div class="course_title">
<div class="course_pane_name">
{{ courses.module_name }}
</div>
<div
class="course_see_more"
@click="clickSeeMore"
>
<div class="see_more">
更多
</div>
<img
class="see_more_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
</div>
</div>
<div
v-if="courses && courses.courseModuleList"
class="scroll_item"
>
<van-swipe
:loop="false"
:width="190"
class="course_scroller"
:show-indicators="false"
>
<van-swipe-item
v-for="(value,key) in courses.courseModuleList"
:key="key"
class="course_card"
@click="enterCourse(value)"
>
<!-- <img class="course_card_img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/rectangle17%403x.png"/> -->
<div class="course_card_content">
<img
class="course_img"
:src="value.app_course_url"
/>
<div class="course_info">
{{ messages(value.course_name, 18) }}
</div>
<div class="course_footer">
<div class="course_footer_left">
<img
class="play_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/play_gray%403x.png"
/>
<div class="play_count">
{{ value.join_num }}
</div>
</div>
<div class="to_play">
去看看
</div>
</div>
</div>
</van-swipe-item>
</van-swipe>
</div>
</div>
</div>
</template>
<script>
// text collapse
//const configurationModule = weex.requireModule('configurationModule');
export default {
components: {},
props:['courses'],
data() {
return{
// courseList:[],
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
messages(str, number) {
return str.length > number ? str.substr(0, number - 1) + '...' : str;
},
// 点击查看更多
clickSeeMore() {
var obj = {
points_id: this.courses.points_id
};
// configurationModule.getMoreCourses(obj);
},
// 进入相关课程
enterCourse(obj) {
// configurationModule.intoCourse(obj);
},
},
};
</script>
<style scoped>
.container{
justify-content:start;
align-items:flex-start;
background-color:#ffffff;
margin-top:10px;
}
.course_title{
display:flex;
justify-content:space-between;
align-items:flex-start;
padding:15px 15px 0 15px
}
.course_pane_name{
font-size:18px;
font-weight:600;
color:#333333;
}
.course_see_more{
display:flex;
flex-direction:row;
justify-content: center;
align-items: center;
}
.see_more{
font-size:14px;
color:#999999;
padding-right: 6px;
}
.see_more_img{
width:15px;
height:15px;
}
.course_scroller{
padding-top:14px;
padding-right: 15px;
}
.course_card{
display:flex;
height:auto;
align-items:center;
justify-content: space-between;
border-radius:6px;
margin-right:5px;
position: relative;
}
.course_card_img{
height:auto;
width:100%;
position:absolute;
top:0;left:0;margin:auto;
z-index:-1;
}
.course_card_content{
height:auto;
align-items:center;
justify-content: space-between;
/* padding:0 12px; */
margin-right:5px;
padding:5px;
border-radius:6px;
border:1px solid #f0f0f0;
}
.course_card_content:first-of-type{
}
.course_img{
width:100%;
height:auto;
border-radius:3px;
}
.course_footer{
display:flex;
justify-content:space-between;
align-items: center;
padding:5px 0;
}
.course_info{
width:100%;
height:32px;
overflow: hidden;
text-align:left;
font-size:16px;
line-height:20px;
padding:6px 0;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
display: -moz-box;
-moz-line-clamp: 2;
-moz-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
white-space: normal;
}
.course_footer_left{
display:flex;
height: 20px;
line-height: 20px;
justify-content: center;
align-items: center;
}
.play_img{
width:10px;
height:10px;
}
.play_count{
font-size:12px;
color:#666666;
padding-left:4px;
}
.to_play{
font-size:12px;
color:rgba(106 ,159 ,233, 1);
height:20px;
line-height:20px;
padding:0 8px;
border-radius:4px;
background-color: rgba(106 ,159 ,233, 0.1)
}
.scroll_item{
padding:0 10px 20px 10px;
}
</style>
<template>
<div>
<header-slider
v-if="type =='type_1'"
ref="header"
:slider-lists="datas"
/>
<text-collapse
v-if="type =='type_2'"
ref="text"
:info-msg="datas"
/>
<project-content
v-if="type =='type_3'"
ref="content"
:exam-content="datas"
:key-index="keyIndex"
/>
<about-course
v-if="type =='type_4'"
ref="course"
:courses="datas"
/>
</div>
</template>
<style scoped>
</style>
<script>
import headerSlider from './headerSlider';
import textCollapse from './textCollapse';
import projectContent from './projectContent';
import aboutCourse from './aboutCourse';
//const globalEvent = weex.requireModule('globalEvent');
export default {
components: {
headerSlider,
textCollapse,
projectContent,
aboutCourse
// livesExam
},
props: ['type', 'datas', 'keyIndex'],
data() {
return {
};
},
mounted() {
console.log(this.datas, '<=====333=>', this.type);
if(this.type == 'type_3') {
console.log(this.datas, '<======>', this.type);
}
},
methods: {
setExamData() {
setTimeout( () => {
this.$refs['content'].addLogicForExam();
});
},
},
};
</script>
\ No newline at end of file
<template>
<div class="wrapper">
<!--考试码输入框-->
<wxc-mask
height="642"
width="750"
border-radius="0"
duration="200"
mask-bg-color="transparent"
:has-animation="true"
:has-overlay="true"
:show-close="false"
:show="showCodeInputDialog"
@wxcMaskSetHidden="wxcMaskSetHidden"
>
<div class="code-content">
<div class="code-title-wrap">
<image
class="code-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png"
@click="showCodeInputDialog=false"
/>
<text class="code-title">
&nbsp;{{ contentTitle }}
</text>
</div>
<input
id="code"
ref="input"
v-model="value"
type="text"
name="code"
class="real-input"
:maxlength="number"
autofocus="true"
autocorrect="off"
autocomplete="off" autocapitalize="off" @keyup="handleInput($event)"
>
<label for="code">
<div class="code-input-wrap">
<text
v-for="(item, index) in number"
:key="index"
class="code-input"
:class="[value.length > index ? 'code-active': '']"
>{{ value[index] }}</text>
</div>
</label>
</div>
</wxc-mask>
</div>
</template>
<script>
import { WxcMask } from 'weex-ui';
export default {
components: { WxcMask },
props: {
number:{
type: Number,
default: 6
},
contentTitle:{
type: String,
default: '请输入考试码'
},
showCodeInputDialog:{
type: Boolean,
default: false
}
},
data() {
return{
value: ''
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
// 考试码逻辑
wxcMaskSetHidden () {
// 此处必须设置,组件为无状态组件,自己管理
this.showCodeInputDialog = false;
},
hideKeyboard() {
// 输入完成隐藏键盘
document.activeElement.blur(); // ios隐藏键盘
this.$refs.input.blur(); // android隐藏键盘
},
handleSubmit() {
this.$emit('inputEnd', this.value);
},
handleInput(e) {
console.log(this.value);
this.$refs.input.value = this.value;
if (this.value.length >= this.number) {
this.hideKeyboard();
// this.handleSubmit()
this.showCodeInputDialog = false;
}
}
}
};
</script>
<style scoped>
.wrapper{
/*padding-top:150px;*/
/*background-color: #ffffff;*/
}
/*考试码相关样式*/
.code-title-wrap {
padding: 20px 20px 30px 20px;
flex-direction: row;
justify-content: center;
align-items: center;
border-bottom-width:1px;
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
background-color: white;
}
.code-img {
width: 50px;
height: 50px;
position: absolute;
left: 20px;
}
.code-title {
font-size:35px;
color:rgba(51,51,51,1);
/*line-height:30px;*/
}
.code-input-wrap {
flex-direction: row;
justify-content: center;
align-items: center;
height: 244px;
background-color: white;
}
.real-input{
width: 0px;
height:0px;
color: transparent;
position: absolute;
left: -9999px;
top: -9999px;
opacity: 0;
overflow: visible;
}
.code-input {
width:90px;
height:90px;
line-height:90px;
background:rgba(255,255,255,1);
border-radius:4px;
border-width:1px;
border-style:solid;
border-color:rgba(204,204,204,1);
margin-right: 10px;
font-size: 50px;
color:rgba(51,51,51,1);
text-align: center;
}
.code-active {
border-color:rgba(65,183,167,1);
}
.code-input:focus {
border-color:rgba(58,172,156,1);
}
</style>
\ No newline at end of file
<template>
<div class="container">
<div
v-if="showHeaderH"
class="history_title"
>
<div class="history_title_text">
考试记录
</div>
<div
v-if="historyList.length > 2"
class="history_title_right"
@click="historyMore"
>
<div class="history_title_total">
全部
</div>
<img
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
</div>
</div>
<div
v-for="(value,key) in historyList"
:key="key"
class="history_items"
>
<div class="history_item_time">
{{ value.createdTime }}
</div>
<div class="history_item_divider">
<img
v-if="value.passFlag == 5"
class="history_item_radio"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/eee%403x.png"
/>
<img
v-if="value.passFlag != 5"
class="history_item_radio"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/ee%403x.png"
/>
<div
v-if="key+1<historyList.length"
class="history_item_radio_bottom"
/>
</div>
<div
v-if="value.resultType != 0"
class="history_item_result"
:class="[value.passFlag == 5 ? 'color-success': 'color-failure']"
>
{{ value.resultValue }}
</div>
<div
v-if="value.resultType == 0"
class="history_item_info flex-8"
>
{{ value.wrongNo == 0 ? value.correctNo+ "题全对" : "对"+ value.correctNo+"题 错"+value.wrongNo+"题" }}
</div>
<div
v-if="value.resultType != 0 && value.wrongNo > 0"
class="history_item_info"
>
{{ value.wrongNo }}
</div>
<div
v-if="value.resultType != 0 && value.wrongNo == 0"
class="history_item_info"
>
{{ value.correctNo+value.wrongNo }}题全对
</div>
<div
class="history_item_right"
@click="goExamError(value)"
>
<div class="history_item_seemore">
{{ value.wrongNo > 0 ? "查看错题" : "" }}
</div>
<img
v-if="value.wrongNo > 0"
class="history_item_right_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
</div>
</div>
</div>
</template>
<script>
// text collapse
// import {click_all_history, click_check_wrong_collection, click_check_wrong_collection_history, click_all_history_result, click_down_wrong_collection} from '../../util/buryingPoint';
export default {
components: {},
props:['historyList', 'showHeaderH', 'examId', 'exam', 'options', 'examType'],
data() {
return{
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
historyMore() {
if(this.$route.name === 'exam_start') {
// this.appBuryingPointEntrust({
// ...click_all_history,
// createdTime: new Date().getTime()
// });
}else if(this.$route.name === 'exam_result') {
// this.appBuryingPointEntrust({
// ...click_all_history_result,
// createdTime: new Date().getTime()
// });
}
this.$emit('watchHistory', 'options');
// this.$router.push({
// path:'/exam_history',
// query:{
// examId: this.examId,
// examType: this.$route.jquery.examType
// }
// })
},
goExamError(obj) {
if (obj.wrongNo > 0) {
if(this.$route.name === 'exam_start') {
// this.appBuryingPointEntrust({
// ...click_check_wrong_collection,
// createdTime: new Date().getTime(),
// labelvalue:this.exam.name
// });
}else if(this.$route.name === 'exam_history') {
// this.appBuryingPointEntrust({
// ...click_check_wrong_collection_history,
// createdTime: new Date().getTime(),
// labelvalue:obj.name
// });
}else if(this.$route.name === 'exam_result') {
// this.appBuryingPointEntrust({
// ...click_down_wrong_collection,
// createdTime: new Date().getTime(),
// labelvalue:this.exam.name
// });
}
this.$router.push({
path: '/exam-wrong',
query: {
answerResultId: obj.answerResultId,
examType: this.$route.query.examType
}
});
}
},
},
};
</script>
<style scoped>
.container{
justify-content:center;
align-items:center;
background-color:#ffffff;
padding-top:20px;
}
.history_title{
flex-direction:row;
padding-left:30px;
padding-right:30px;
padding-top:22px;
padding-bottom:30px;
justify-content:space-between;
}
.history_title_text{
font-size:32px;
/*font-weight:600;*/
}
.history_title_right{
flex-direction:row;
align-items: center;
}
.history_title_total{
font-size:28px;
color:rgba(153,153,153,1);
}
.history_title_img{
height:30px;
width:30px;
}
.history_items{
flex-direction:row;
justify-content:space-between;
padding-left:30px;
padding-right:30px;
height:75px;
}
.history_item_time{
font-size:28px;
color:rgba(153,153,153,1);
flex:5;
}
.history_item_result{
font-size: 28px;
flex:4;
}
.color-success{
color: rgba(42,185,165,1);
}
.color-failure{
color: rgba(255,114,114,1);
}
.history_item_info{
font-size:28px;
color:rgba(153,153,153,1);
flex:4;
padding-left: 10px;
}
.flex-8{
flex: 8;
}
.history_item_right{
flex-direction:row;
flex:5;
justify-content:center;
align-items: center;
height: 30px;
line-height: 30px;
}
.history_item_seemore{
font-size:28px;
color:rgba(153,153,153,1);
padding-right: 4px;
padding-left: 22px;
}
.history_item_right_img{
width: 30px;
height: 30px;
}
.history_item_radio{
width:16px;
height:16px;
margin-top: 10px;
}
.history_item_radio_bottom{
margin-top:8px;
width:2px;
height:45px;
background-color:rgba(222,222,222,1)
}
.history_item_divider{
align-items:center;
justify-content:space-between;
flex:2;
}
</style>
<template>
<div class="container">
<div class="result_content">
<img
v-if="type == 0"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/yh%403x.png"
/>
<img
v-if="type == 1"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/tg%403x.png"
/>
<img
v-if="type == 2"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/ks%403x.png"
/>
<div class="exam_name">
<div
v-if="type == 2"
class="exam_name_text"
>
欢迎参加“{{ exam.name }}
</div>
<div
v-if="type != 2 && exam.standardType == 1"
class="exam_name_text"
>
{{ exam.wrongNo == 0 ? exam.correctNo + "题全对" : "对" + exam.correctNo +"题,错" +exam.wrongNo + "题" }}
</div>
<div
v-if="type == 1 && exam.standardType != 1"
class="exam_name_text"
>
您已通过“{{ exam.name }}{{ exam.standardType == 5 ? "!" :",成绩为:" + exam.resultValue }}
</div>
<div
v-if="type == 0 && exam.standardType != 1"
class="exam_name_text"
>
非常遗憾,您未能通过“{{ exam.name }}”!
</div>
</div>
<div class="exam_time">
<div
v-if="type == 2"
class="exam_time_text"
>
考试时间:{{ exam.time/60 }}分钟 共{{ exam.questionNo }}{{ exam.standardType != 1 ? "(答对"+exam.leastPassNum+"题即通过)" : "" }}
</div>
<div
v-if="type != 2 && exam.standardType != 1"
class="exam_time_text"
>
{{ exam.wrongNo == 0 ? exam.correctNo + "题全对" : "对" + exam.correctNo +"题 错" + exam.wrongNo + "题" }}
</div>
<div
v-if="type != 2 && exam.wrongNo != 0"
class="exam_time_status"
@click="examWrongPage(exam)"
>
<div class="exam_time_wrang">
查看错题
</div>
<img
class="exam_time_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
</div>
<div
class="exam_button"
:style="hasWrong?{'background-color':'#b5b5b5'}:''"
@click="goExam(exam, type, hasWrong)"
>
<div class="exam_button_text">
{{ type==2?' 开始答题 ':' 完成 ' }}
</div>
</div>
<div
v-if="type !=2 && exam.restCount > 0 && exam.wrongNo > 0"
class="retry"
>
<div class="retry_text">
成绩不满意?
</div>
<div
class="go_retry"
@click="goExamStart(exam)"
>
我要重考
</div>
</div>
</div>
<!-- <wxc-dialog
confirm-text="我知道了"
:show="showExamFinishedTip"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="finishedConfirm"
>
<text
slot="content"
class="content-subtext"
>
考试已结束
</text>
</wxc-dialog> 11-->
</div>
</template>
<script>
// text collapse
//const modal = weex.requireModule('modal');
// import {click_start_test, click_test_completed, click_retest, click_mid_wrong_collection} from '../../util/buryingPoint';
//import WxcDialog from '../../components/wxc-dialog';
export default {
//components: {WxcDialog},
props:['type', 'exam', 'startNum', 'endNum', 'examType', 'options', 'hasWrong'],
data() {
return{
showExamFinishedTip: false,
ishasWrong:false
};
},
computed: {
},
watch:{
hasWrong(val) {
this.ishasWrong = val;
}
},
created () {
},
mounted() {
},
methods: {
finishedConfirm() {
this.showExamFinishedTip = false;
this.$router.back();
},
examWrongPage(obj) { // 查看错题
// this.appBuryingPointEntrust({
// ...click_mid_wrong_collection,
// createdTime: new Date().getTime()
// });
this.$router.push({
path: '/exam_wrong',
query: {
answerResultId: obj.answerResultId,
examType: this.$route.query.examType
}
});
},
goExam(obj, type, hasWrong) {// 开始考试
if(hasWrong) {
return;
}
if (type == 2) {
if(this.options != null && this.options.examType == 'local') {
const endDate = new Date(this.options.endDate);
const date = new Date();
if(date > endDate) {
this.showExamFinishedTip = true;
this.$dialog.alert({
title: '',
message: "考试已结束",
confirmButtonText:"我知道了"
})
return;
}
}
// this.appBuryingPointEntrust({
// ...click_start_test,
// createdTime: new Date().getTime()
// });
const query = {
examId: obj.examId,
// examType: this.options.examType,
examType: this.$route.query.examType,
endDate: this.$route.query.endDate
};
if (this.startNum > 0) {
Vue.set(query, 'startNum', this.startNum);
}
this.$router.push({
path: '/exam',
query: query
});
}else {// 考试结束页面,点击“完成”
// this.appBuryingPointEntrust({
// ...click_test_completed,
// createdTime: new Date().getTime()
// });
if(this.examType == 'common') {
weex.requireModule('CourseModule').goBack(2);
} else {
this.$router.push({
path: '/'
});
}
}
},
goExamStart(obj) { // 我要重考
if (!this.endNum) {
this.$toast('您尚未完成相关培训课程的学习')
}else {
this.$emit('reExamStart');
}
// this.appBuryingPointEntrust({
// ...click_retest,
// createdTime: new Date().getTime()
// });
},
},
};
</script>
<style scoped>
.container{
justify-content:center;
align-items:center;
margin-bottom:20px;
background-color:#ffffff;
height: 798px;
width: 750px;
}
.result_content{
justify-content:center;
align-items:center;
background-color: #ffffff;
padding-top: 100px;
padding-left: 30px;
padding-right: 30px;
}
.result_image{
width: 240px;
height: 240px;
}
.exam_name{
margin-top:40px;
margin-bottom:30px;
}
.exam_name_text{
font-size:34px;
color:rgba(51,51,51,1);
font-weight:700;
}
.exam_time{
flex-direction:row;
}
.exam_time_text{
font-size:28px;
color:rgba(153,153,153,1);
margin-right:20px;
}
.exam_time_status{
flex-direction:row;
align-items:center;
}
.exam_time_wrang{
font-size:28px;
color:rgba(51,51,51,1);
}
.exam_time_img{
width:28px;
height:28px;
}
.exam_button{
height:76px;
background-color:rgba(88, 181, 168,1);
justify-content:center;
align-items:center;
border-radius:44px;
padding-left:65px;
padding-right:65px;
margin-top:40px;
margin-bottom:40px;
width: 380px;
}
.exam_button_text{
font-size:32px;
color:#ffffff;
border-radius:44px;
}
.retry{
flex-direction:row;
align-items:center;
}
.retry_text{
font-size:28px;
color:rgba(153,153,153,1);
margin-right:10px;
}
.go_retry{
font-size:28px;
color:rgba(42 ,185 ,165,1);
border-bottom-style:solid;
border-bottom-width:2px;
border-bottom-color:rgba(42 ,185 ,165,1);
}
</style>
<template>
<div>
<!-- slider -->
<van-swipe
class="slider"
interval="3000"
auto-play="true"
:index="sliderIndex"
@change="sliderChange"
>
<van-swipe-item
v-for="(img, key) in sliderLists.carouselModuleList"
:key="key"
class="frame_div"
>
<img
v-lazy="img.image_url"
class="image"
resize="stretch"
/>
</van-swipe-item>
</van-swipe>
</div>
</template>
<script>
// const configurationModule = weex.requireModule('configurationModule');
export default {
components: {},
props: ['sliderLists'],
data() {
return {
sliderIndex:0,
shareImage: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/rectangle4%403x.png',
imageList: [
{ image_url: 'https://gd2.alicdn.com/bao/uploaded/i2/T14H1LFwBcXXXXXXXX_!!0-item_pic.jpg'},
{ image_url: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1PXJCJFXXXXciXFXXXXXXXXXX_!!0-item_pic.jpg'},
{ image_url: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1x6hYLXXXXXazXVXXXXXXXXXX_!!0-item_pic.jpg'}
]
};
},
computed: {},
created() {
},
mounted() {
},
methods: {
sliderChange(event) {
this.sliderIndex = event.index;
},
},
};
</script>
<style scoped>
.slider {
width: 100%;
height:210px;
}
.frame_div{
width: 100%;
height: auto;
position: relative;
}
.image {
width:100%;
height:auto;
}
</style>
\ No newline at end of file
<template>
<div class="container">
<div class="stroke_container">
<div class="local-exam">
<text class="project_title">现场考试</text>
<div class="code-btn-wrap">
<wxc-button :btnStyle="codeBtn" :textStyle="codeTextStyle" text="输入考试码" @wxcButtonClicked="codeBtnClicked"></wxc-button>
</div>
</div>
<div class="history-wrap">
<div class="history-header">
<text class="project_title his_label">考试记录</text>
<div class="course_see_more" @click="seeMoreHistory" v-if="livesExamContent.localHistoryList.length > 5">
<text class="see_more">更多</text>
<image class="see_more_img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"></image>
</div>
</div>
<local-exam-history :showHeaderH="false" :localHistoryList="livesExamContent.localHistoryList" :examId="11"></local-exam-history>
</div>
</div>
<wxc-loading :show="isShow"></wxc-loading>
<wxc-dialog confirm-text="重新输入"
cancel-text="取消"
:show="showReInputTip"
@wxcDialogCancelBtnClicked="hideReInput"
@wxcDialogConfirmBtnClicked="reInputConfirm">
<text slot="content" class="content-subtext">考试码不正确</text>
</wxc-dialog>
<wxc-dialog confirm-text="我知道了"
:show="showExamNotStartTip"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="notStartConfirm">
<text slot="content" class="content-subtext">考试未开始</text>
</wxc-dialog>
<wxc-dialog confirm-text="我知道了"
:show="showExamFinishedTip"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="finishedConfirm">
<text slot="content" class="content-subtext">考试已结束</text>
</wxc-dialog>
<!--height="342"-->
<wxc-mask height="642"
width="750"
border-radius="0"
duration="200"
mask-bg-color="transparent"
:has-animation="true"
:has-overlay="true"
:show-close="false"
:show="showCodeInputDialog">
<div class="code-content">
<div class="code-title-wrap">
<image class="code-img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png" @click="showCodeInputDialog=false"></image>
<text class="code-title">请输入考试码</text>
</div>
<div class="code-input-wrap">
<input type="text" class="code-input" :class="[code1.length > 0 ? 'code-active': '']" v-model="code1" maxlength="1" @input="codeChange(code1, 'code2')" ref="code1"/>
<input type="text" class="code-input" :class="[code2.length > 0 ? 'code-active': '']" v-model="code2" maxlength="1" @input="codeChange(code2, 'code3')" ref="code2"/>
<input type="text" class="code-input" :class="[code3.length > 0 ? 'code-active': '']" v-model="code3" maxlength="1" @input="codeChange(code3, 'code4')" ref="code3"/>
<input type="text" class="code-input" :class="[code4.length > 0 ? 'code-active': '']" v-model="code4" maxlength="1" @input="codeChange(code4, 'code5')" ref="code4"/>
<input type="text" class="code-input" :class="[code5.length > 0 ? 'code-active': '']" v-model="code5" maxlength="1" @input="codeChange(code5, 'code6')" ref="code5"/>
<input type="text" class="code-input" :class="[code6.length > 0 ? 'code-active': '']" v-model="code6" maxlength="1" @input="codeChange(code6, '')" ref="code6"/>
</div>
</div>
</wxc-mask>
</div>
</template>
<script>
import { Utils, WxcButton, WxcMask } from 'weex-ui'
import WxcDialog from '../components/wxc-dialog'
import picaCommon from '../util/picaCommon'
import WxcLoading from '../components/wxc-loading'
import localExamHistory from '../components/stroke/localExamHistory'
let modal = weex.requireModule('modal')
let configurationModule = weex.requireModule('configurationModule')
let globalEvent = weex.requireModule('globalEvent')
export default {
components: {WxcDialog, Utils, WxcLoading, WxcButton, WxcMask, localExamHistory},
props:['livesExamContent'],
data(){
return{
showExamFinishedTip: false,
showReInputTip: false,
showExamNotStartTip: false,
code1: '',
code2: '',
code3: '',
code4: '',
code5: '',
code6: '',
showCodeInputDialog: false,
showHeaderH: true,
showHeader:false,
y:0,
projectName: '', //项目名称
isShow: false,
isIOS: true,
codeBtn: {
height: '90px',
backgroundColor: 'rgba(106, 159, 233, 0.1)',
borderRadius: '100px',
width: '600px'
},
codeTextStyle: {
color: 'rgb(106, 159, 233)',
fontSize: '32px'
}
}
},
created () {
this.projectId = this.getUrlSearch(weex.config.bundleUrl, 'id') || 1
this.isIOS = Utils.env.isIOS()
// this.init()
},
mounted(){
},
computed: {
},
methods: {
finishedConfirm() {
this.showExamFinishedTip = false
},
hideReInput() {
this.showReInputTip = false
},
reInputConfirm() {
this.hideReInput()
this.showCodeInputDialog = true
this.$nextTick(()=> {
this.$refs['code1'].focus()
})
},
notStartConfirm() {
this.showExamNotStartTip = false
},
clearCode() {
this.code1 = ''
this.code2 = ''
this.code3 = ''
this.code4 = ''
this.code5 = ''
this.code6 = ''
},
checkCodeInputFinished() {
var code
if(this.code1 && this.code2 && this.code3 && this.code4 && this.code5 && this.code6) {
code = '' + this.code1 + this.code2 + this.code3 + this.code4 + this.code5 + this.code6
this.clearCode()
this.showCodeInputDialog = false
this.isShow = true
//考试id
// private Integer examId;
//考试结果标志1表示考试进行中5表示考试未开始10表示考试了已经结束15表示查询不到考试(考试码不正确)20考试被管理员删除(隐藏)
// private Integer resultFlag;
//考试开始时间
// protected Date startDate;
//考试结束时间
// protected Date endDate;
this.GET('app/exam/lives/check',{examCode: code}, (res) => {
this.isShow = false
var result = res.data.checkResult,
flag = result.resultFlag
if(flag == 1) {
this.$router.push({
path:'/exam_result',query:{examId: result.examId, origin: 'start', examType: 'local', endDate: result.endDate}
})
} else if(flag == 5) {
this.showExamNotStartTip = true
} else if(flag == 10 || flag == 20) {
this.showExamFinishedTip = true
} else if(flag == 15) {
this.showReInputTip = true
}
})
}
},
codeChange(val, nextInput) {
if(val && nextInput) {
this.$refs[nextInput].focus()
}
this.checkCodeInputFinished()
},
seeMoreHistory() {
this.$router.push({
path:'/local_exam_history',query:{examId: this.examId}
})
},
codeBtnClicked() {
this.showCodeInputDialog = true
this.$nextTick(()=> {
this.$refs['code1'].focus()
})
},
/* getLength(str, num){
if (str.length > num){
str = str.substr(0, num) + "..."
}
return str
},*/
/* init(){
this.getTop()
},*/
/*getTop(){
this.isShow = true
let _self = this
this.GET('contents/projects/top',{id:this.projectId},function (res) {
console.log('top',res)
// modal.alert({
// message: "top:" + JSON.stringify(res)
// })
if (res && res.data){
// _self.infoMsg = res.data.intro
// _self.info.message = _self.infoMsg
_self.infoLists = res.data.texts //简介(文案)组件
_self.sliderLists = res.data.carousels //轮播图组件
_self.projectName = res.data.projectName //项目名称
_self.projectName = _self.getLength(_self.projectName, 8);
}else{
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
})
}
_self.getBottom()
})
},
getBottom(){
let _self = this
this.GET('contents/projects/bottom',{id:this.projectId},function (res) {
console.log('bottom',res)
// modal.alert({
// message: "bottom:" + JSON.stringify(res)
// })
if (res && res.data){
_self.courseLists = res.data.courses //[0].courseModuleList
if (_self.courseLists && _self.courseLists.length){
_self.courseLists.sort(function(a,b){
return a.seq_no - b.seq_no
})
}
_self.courseLists = _self.courseLists.concat([])
}else {
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
})
}
_self.getMiddle()
})
},
getMiddle(){
let _self = this
this.GET('contents/projects/middle',{id: this.projectId},function (res) {
console.log("middle",res)
// modal.alert({
// message: "middle:" + JSON.stringify(res)
// })
_self.isShow = false
if (res && res.data){
_self.examLists = res.data.moduleTypeExams
if (_self.examLists && _self.examLists.length){
_self.examLists.sort(function(a,b){
return a.seq_no - b.seq_no
})
_self.examLists.forEach(function (item) {
item.allLists = item.examModuleList
if (item.courseList){
let arr = item.courseList
arr.forEach(function (course) {
let exam_id = course.exam_id
for (let k =0; k < item.allLists.length; k++){
if (exam_id == item.allLists[k].exam_id){
item.allLists.splice(k, 0, course);
break;
}
}
})
}
})
_self.examLists = _self.examLists.concat([])
}else {
_self.examLists = []
}
_self.getOrder()
}else{
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
})
}
})
},
getOrder(){
let _self = this
this.GET('contents/projects/'+ this.projectId,{},function (res) {
console.log('order',res)
// modal.alert({
// message: "order:" + JSON.stringify(res)
// })
if (res && res.data){
//组件type
// module_type:1、轮播图组件 5、文案组件 10、考试组件 15、关联课程组件 20、链接组件 25、现场考试组件
_self.orderList = res.data.projectList
if (res.data.respCode != 200){
modal.toast({
message: res.data.respMsg,
duration: 1.0
})
return
}
let arr = [{slot:'type_1'},{slot:'type_2'},{slot:'type_3'},{slot:'type_4'},{slot:'type_5'}]
// arr.map(function (item) {
// _self.slots.push(item)
// })
_self.slots.length = _self.orderList.length
// debugger
for(let i = 0; i < _self.orderList.length; i++){
let number = _self.orderList[i].module_type
switch (number){
case 1:
_self.slots[i] = arr[0];
break;
case 5:
_self.slots[i] = arr[1];
break;
case 10:
_self.slots[i] = arr[2];
break;
case 15:
_self.slots[i] = arr[3];
break;
case 25:
_self.slots[i] = arr[4];
break;
}
}
// debugger
_self.slots = _self.slots.concat([])
_self.infoLists.forEach(function (item) {
_self.allComponentLists.push(item)
})
_self.sliderLists.forEach(function (item) {
_self.allComponentLists.push(item)
})
_self.courseLists.forEach(function (item) {
_self.allComponentLists.push(item)
})
_self.examLists.forEach(function (item) {
_self.allComponentLists.push(item)
})
_self.allComponentLists.sort(function (a,b) {
return a.seq_no - b.seq_no
})
_self.allComponentLists = _self.allComponentLists.concat([])//Object.assign([],)
}else{
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
})
}
})
},*/
taggleSlot(){
if(this.slot =='title'){
this.slot ='content'
}else{
this.slot =='title'
}
},
scroll(event){
let y = parseInt(event.contentOffset.y)
if(y < -50){//去认证被遮住
this.showHeader = true
}else{
this.showHeader = false
}
},
openDialog () {
this.show = true;
},
goBack(){
configurationModule.goBack()
},
wxcDialogCancelBtnClicked () {
//此处必须设置,组件为无状态组件,自己管理
// this.show = false;
this.taggleSlot()
},
wxcDialogConfirmBtnClicked () {
//此处必须设置,组件为无状态组件,自己管理
//this.show = false;
},
wxcDialogNoPromptClicked (e) {
//此处必须设置,组件为无状态组件,自己管理
this.isChecked = e.isChecked;
}
/*getLocalExamResults(){
let para = {
examId: this.$route.query.examId,
pageNo: 1,
pageSize: 5
}
/!* if(this.$route.query.examType === 'local') {
url = 'app/exam/lives/results'
}*!/
this.GET('app/exam/lives/results', para, res => {
// this.showLoading = false
let data = res.data
console.log(data)
/!*if(data.respCode === 200) {
// this.isInitFinished = true
this.localHistoryList = this.format(data.examRecordList)
} else {
this.toast({
message: data.respMsg
})
}*!/
})
}*/
// clickJ(){
// this.$refs["mainCp"].map( function (item) {
// if (item.$el.attrs.type == "type_3"){
// console.log("cc:",item)
// }
// })
// console.log("cc:",this.$refs["mainCp"])
// },
// clickShareImage(){
// configurationModule.shareProject()
// },
},
}
</script>
<style scoped>
.content-subtext {
font-size:34px;
color:rgba(102,102,102,1);
line-height:50px;
text-align: center;
}
.code-input-wrap {
flex-direction: row;
justify-content: center;
align-items: center;
height: 244px;
background-color: white;
}
.code-input {
width:90px;
height:90px;
background:rgba(255,255,255,1);
border-radius:4px;
border-width:1px;
border-style:solid;
border-color:rgba(204,204,204,1);
margin-right: 10px;
font-size: 50px;
color:rgba(51,51,51,1);
line-height:50px;
text-align: center;
}
.code-active {
border-color:rgba(65,183,167,1);
}
.code-input:focus {
border-color:rgba(58,172,156,1);
}
.code-title-wrap {
padding: 20px 20px 30px 20px;
flex-direction: row;
justify-content: center;
align-items: center;
border-bottom-width:1px;
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
background-color: white;
}
.code-img {
width: 50px;
height: 50px;
position: absolute;
left: 20px;
}
.code-title {
font-size:35px;
color:rgba(51,51,51,1);
/*line-height:30px;*/
}
.history-header {
flex-direction:row;
width:750px;
justify-content:space-between;
padding-top:30px;
padding-left:30px;
padding-right:30px;
}
.course_see_more{
flex-direction:row;
height: 48px;
line-height: 48px;
justify-content: center;
align-items: center;
}
.see_more{
font-size:28px;
color:#999999;
padding-right: 6px;
}
.see_more_img{
width:30px;
height:30px;
}
.history-wrap {
background-color: rgb(255, 255, 255);
/*padding: 30px 0 30px 30px;*/
/*margin-top: 20px;*/
border-top-width: 1px;
border-top-style: solid;
border-top-color: rgb(240, 240, 240);
padding-bottom: 40px;
}
.local-exam {
background-color: rgb(255, 255, 255);
padding: 30px;
margin-top: 20px;
}
.code-btn-wrap {
padding-top: 40px;
/*padding-left: 10px;*/
/*padding-right: 40px;*/
justify-content: center;
align-items: center;
}
.project_title{
font-size:36px;
color:#333333;
font-weight:700;
}
.his_label {
color:#999999;
font-weight: 500;
}
.stroke_container{
background-color:#f5f5f5;
}
.stroke_header_statusBar{
position: fixed;
left: 0;
top: 0;
width: 750px;
height: 44px;
align-items: flex-end;
padding-left:0px;
padding-right:0px;
padding-bottom:0px;
flex-direction:row;
justify-content: space-between;
}
.background-fff{
background-color: #ffffff;
}
.background-999{
background-color: #999999;
}
.stroke_header{
position:fixed;
left:0px;
top: 44px;
width:750px;
height: 106px;
align-items: flex-end;
padding-left:30px;
padding-right:30px;
padding-bottom:30px;
flex-direction:row;
justify-content: space-between;
}
.stroke_header_white{
background-color:#ffffff;
}
.stroke_header_left{
flex-direction:row;
align-items: center;
}
.stroke_header_title{
position:absolute;
left:0;
bottom:30px;
width:750px;
text-align:center;
height: 50px;
font-size:36px;
color:#333333;
}
.go_back{
width:50px;
height:50px;
}
.home_page{
font-size:32px;
color:#333333;
}
/*.share_image{*/
/*position: absolute;*/
/*width: 50px;*/
/*height: 50px;*/
/*right: 16px;*/
/*bottom:35px;*/
/*}*/
</style>
<template>
<div class="container">
<div
v-if="showHeaderH"
class="history_title"
>
<div class="history_title_text">
考试记录
</div>
<div
v-if="localHistoryList.length >= 5"
class="history_title_right"
@click="historyMore"
>
<text class="history_title_total">
全部
</text>
<img
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
</div>
</div>
<div
v-for="(value,key) in localHistoryList"
:key="key"
class="history-item"
>
<div class="his-left">
<div class="his-title">
{{ value.name }}
</div>
<div class="his-detail">
{{ value.passFlag == 5 ? '通过' : '未通过' }}{{ value.correctNo + value.wrongNo }}题 对{{ value.correctNo }}题 错{{ value.wrongNo }}
</div>
</div>
<div
v-if="(value.restTimes <= 0 && value.restTimes != -1) || value.wrongNo == 0"
class="his-right"
@click="goExamResult(value)"
>
<div class="set_text_see">
查看
</div>
<img
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
<div
v-if="value.restTimes > 0 || value.restTimes == -1"
class="his-right"
@click="goExamStart(value)"
>
<div class="re-exam">
重考
</div>
</div>
</div>
<div
v-if="localHistoryList == 0"
class="history-empty"
>
<img
class="empty-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/wu%402x.png"
/>
<div class="empty-text">
暂无现场考试记录
</div>
</div>
</div>
</template>
<script>
// text collapse
export default {
components: {},
props:['localHistoryList', 'showHeaderH'],
data() {
return{
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
// 查看结果
goExamResult(obj) {
this.$emit('watchResult', obj);
},
goExamStart(obj) { // 我要重考
this.$emit('goExamStart', obj);
}
},
};
</script>
<style scoped>
.history-empty {
align-items: center;
}
.empty-img {
width: 100px;
height: 100px;
display:block;
margin:0 auto;
}
.empty-text {
font-size:15px;
color:rgba(153,153,153,1);
line-height:21px;
text-align:center;
}
.re-exam {
font-size:13px;
padding:0 10px;
border-radius:12px;
border-style:solid;
border-width:1px;
border-color: rgb(148, 220, 210);
width: 60px;
height: 25px;
line-height: 25px;
color: rgb(42, 185, 165);
text-align: center;
}
.set_text_see{
font-size:14px;
color:rgba(102,102,102,1);
padding-right: 5px;
}
.item3_right_arrow{
width: 10px;
height: 10px;
}
.history-item {
flex-direction: row;
padding: 40px 10px 40px 0px;
margin-left: 30px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: rgb(240, 240, 240);
justify-content: space-between;
}
.his-left {
width: 80%;
}
.his-right {
flex-direction:row;
align-items:center;
width: 75px;
justify-content: center;
}
.his-title {
max-height: 45px;
overflow: hidden;
margin-bottom: 10px;
font-size: 16px;
color: rgb(51, 51, 51);
}
.his-detail {
font-size: 13px;
color: rgb(153, 153, 153);
}
.container{
justify-content:center;
align-items:center;
background-color:#ffffff;
padding-top:10px;
}
.history_title{
flex-direction:row;
padding:0 15px;
justify-content:space-between;
}
.history_title_text{
font-size:16px;
/*font-weight:600;*/
}
.history_title_right{
flex-direction:row;
align-items: center;
}
.history_title_total{
font-size:14px;
color:rgba(153,153,153,1);
}
.history_title_img{
height:15px;
width:15px;
}
.history_items{
flex-direction:row;
justify-content:space-between;
padding:0 15px;
height:37px;
}
.history_item_time{
font-size:14px;
color:rgba(153,153,153,1);
flex:5;
}
.history_item_result{
font-size: 14px;
flex:4;
}
.color-success{
color: rgba(42,185,165,1);
}
.color-failure{
color: rgba(255,114,114,1);
}
.history_item_info{
font-size:14px;
color:rgba(153,153,153,1);
flex:4;
padding-left: 10px;
}
.flex-8{
flex: 8;
}
.history_item_right{
flex-direction:row;
flex:5;
justify-content:center;
align-items: center;
height: 30px;
line-height: 30px;
}
.history_item_seemore{
font-size:14px;
color:rgba(153,153,153,1);
padding-right: 2px;
padding-left: 11px;
}
.history_item_right_img{
width: 15px;
height: 15px;
}
.history_item_radio{
width:8px;
height:8px;
margin-top: 5px;
}
.history_item_radio_bottom{
margin-top:4px;
width:2px;
height:23px;
background-color:rgba(222,222,222,1)
}
.history_item_divider{
align-items:center;
justify-content:space-between;
flex:2;
}
</style>
<template>
<div class="container">
<div
v-if="showHeaderH"
class="history_title"
>
<text class="history_title_text">
考试记录
</text>
<div
v-if="historyList.length > 2"
class="history_title_right"
@click="historyMore"
>
<text class="history_title_total">
全部
</text>
<image
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
</div>
</div>
<div
v-for="(value,key) in localHistoryList"
:key="key"
class="history-item"
>
<div class="his-left">
<text class="his-title">
{{ value.name }}
</text>
<text class="his-detail">
{{ value.passFlag == 5 ? '通过' : '未通过' }}{{ value.correctNo + value.wrongNo }}题 对{{ value.correctNo }}题 错{{ value.wrongNo }}
</text>
</div>
<div
v-if="value.restTimes < 0 && value.restTimes != -1"
class="his-right"
@click="goExamError(value)"
>
<text class="set_text_see">
查看
</text>
<image
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
<div
v-if="value.restTimes > 0 || value.restTimes == -1"
class="his-right"
@click="goExamStart"
>
<text class="re-exam">
重考
</text>
</div>
</div>
<!--<div class="history-item">
<div class="his-left">
<text class="his-title">高血压中老年考试考试题,目高血压中老年考试考试题目高,血压中老年考试考试题目高血压中老年考试考试题目</text>
<text class="his-detail">成绩:优秀 共30题 对18题 错12题</text>
</div>
<div class="his-right">
<text class="re-exam">重考</text>
</div>
</div>-->
<div
v-if="localHistoryList == 0"
class="history-empty"
>
<image
class="empty-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/wu%402x.png"
/>
<text class="empty-text">
暂无现场考试记录
</text>
</div>
</div>
</template>
<script>
// text collapse
import {click_retest} from '../../util/buryingPoint';
export default {
components: {},
props:['localHistoryList', 'showHeaderH', 'examId'],
data() {
return{
};
},
computed: {
// historyListBak:function(){//备份
// return this.historyList.concat([])
// },
// historys:function(){
// var newList = this.limit?this.historyList.splice(0,this.limit):this.historyList
// return newList
// }
},
created () {
// this.historys = this.historyList
// this.historyListBak = this.historyList.concat([])//拷贝一份
// console.log(this.$props['historyList'])
// this.historys = this.$props.historyListBak.splice(0,3)
},
mounted() {
},
methods: {
historyMore() {
this.$router.push({
path:'/exam_history', query:{examId: this.examId}
});
},
// 查看
goExamError(obj) {
if (obj.wrongNo > 0) {
this.$router.push({
path: '/exam_wrong',
query: {
answerResultId: obj.answerResultId
}
});
}
},
examWrongPage(obj) { // 查看错题
this.appBuryingPointEntrust({
...click_mid_wrong_collection,
createdTime: new Date().getTime()
});
this.$router.push({
path: '/exam_wrong',
query: {
answerResultId: obj.answerResultId
}
});
},
// 重考
goExamStart(obj) { // 我要重考
/* if (this.endNum != undefined && this.endNum != null && this.endNum == 0){
modal.toast({
message: "您尚未完成相关培训课程的学习",
duration: 1.0
})
}else {
this.$emit("reExamStart")
}*/
this.$emit('reExamStart');
this.appBuryingPointEntrust({
...click_retest,
createdTime: new Date().getTime()
});
}
},
};
</script>
<style scoped>
.history-empty {
align-items: center;
}
.empty-img {
width: 200px;
height: 200px;
}
.empty-text {
font-size:30px;
color:rgba(153,153,153,1);
line-height:42px;
}
.re-exam {
font-size:26px;
padding-left:20px;
padding-right:20px;
border-radius:25px;
border-style:solid;
border-width:1px;
border-color: rgb(148, 220, 210);
width: 120px;
height: 50px;
line-height: 50px;
color: rgb(42, 185, 165);
text-align: center;
}
.set_text_see{
font-size:28px;
color:rgba(102,102,102,1);
padding-right: 10px;
}
.item3_right_arrow{
width: 20px;
height: 20px;
}
.history-item {
flex-direction: row;
padding: 40px 10px 40px 0px;
margin-left: 30px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: rgb(240, 240, 240);
justify-content: space-between;
}
.his-left {
width: 540px;
}
.his-right {
flex-direction:row;
align-items:center;
width: 150px;
justify-content: center;
}
.his-title {
max-height: 90px;
overflow: hidden;
margin-bottom: 20px;
font-size: 32px;
color: rgb(51, 51, 51);
}
.his-detail {
font-size: 26px;
color: rgb(153, 153, 153);
}
.container{
justify-content:center;
align-items:center;
background-color:#ffffff;
padding-top:20px;
}
.history_title{
flex-direction:row;
padding-left:30px;
padding-right:30px;
padding-top:22px;
padding-bottom:30px;
width: 750px;
justify-content:space-between;
}
.history_title_text{
font-size:32px;
/*font-weight:600;*/
}
.history_title_right{
flex-direction:row;
align-items: center;
}
.history_title_total{
font-size:28px;
color:rgba(153,153,153,1);
}
.history_title_img{
height:30px;
width:30px;
}
.history_items{
flex-direction:row;
justify-content:space-between;
padding-left:30px;
padding-right:30px;
width:750px;
height:75px;
}
.history_item_time{
font-size:28px;
color:rgba(153,153,153,1);
flex:5;
}
.history_item_result{
font-size: 28px;
flex:4;
}
.color-success{
color: rgba(42,185,165,1);
}
.color-failure{
color: rgba(255,114,114,1);
}
.history_item_info{
font-size:28px;
color:rgba(153,153,153,1);
flex:4;
padding-left: 10px;
}
.flex-8{
flex: 8;
}
.history_item_right{
flex-direction:row;
flex:5;
justify-content:center;
align-items: center;
height: 30px;
line-height: 30px;
}
.history_item_seemore{
font-size:28px;
color:rgba(153,153,153,1);
padding-right: 4px;
padding-left: 22px;
}
.history_item_right_img{
width: 30px;
height: 30px;
}
.history_item_radio{
width:16px;
height:16px;
margin-top: 10px;
}
.history_item_radio_bottom{
margin-top:8px;
width:2px;
height:45px;
background-color:rgba(222,222,222,1)
}
.history_item_divider{
align-items:center;
justify-content:space-between;
flex:2;
}
</style>
<template>
<div>
<div class="head-fixed">
<div
class="head-bg"
:style="{backgroundColor: headBg, height: headHeight + 'px'}"
/>
<div
class="head wrap"
:style="{paddingTop: (70 - headHeight) + 'px'}"
>
<img
v-if="type != 2"
src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png"
style="width: 50px; height: 50px;"
@click="goBack"
/>
<div
v-if="!showHeader"
style="width:50px;height: 50px;"
>&nbsp;
</div>
<img
v-if="type == 2"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png"
style="width: 50px; height: 50px;"
@click="goBack"
/>
<div class="title">
{{ title }}
</div>
<div class="empty" />
</div>
</div>
</div>
</template>
<script>
// text collapse
// import {click_cancel_test} from '../../util/buryingPoint';
export default {
components: {},
props:['title', 'type', 'showHeader'],
data() {
return{
headBg: '#ffffff',
headHeight: 0
};
},
computed: {
},
created () {
if(this.isAndroid) {
this.headBg = '#999999';
// weex.requireModule('eventModule').getStatusBarSize(res => {
// this.headHeight = parseInt(res.height) / 1.5;
// });
}
},
mounted() {
},
methods: {
goBack() {
if(this.type == 2) {
// this.appBuryingPointEntrust({
// ...click_cancel_test,
// createdTime: new Date().getTime()
// });
}
this.$emit('goBack');
},
},
};
</script>
<style scoped>
.head-fixed {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
background-color: #ffffff;
z-index: 999;
}
.head {
flex-direction: row;
justify-content: space-between;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #e7e7e7;
}
.wrap {
padding: 70px 30px 20px 30px;
}
.empty {
width: 50px;
height: 3px;
}
.title {
font-size: 38px;
/*font-weight: 600;*/
color: #333333;
}
/*.result_header{*/
/*position:fixed;*/
/*top:0;*/
/*left:0;*/
/*height:140px;*/
/*width:750px;*/
/*background-color:#ffffff;*/
/*padding-left:20px;*/
/*flex-direction: row;*/
/*align-items:center;*/
/*justify-content: space-between;*/
/*border-bottom-style: solid;*/
/*border-bottom-width: 1px;*/
/*border-bottom-color: #e7e7e7;*/
/*}*/
/*.back_wrap{*/
/*flex-direction: row;*/
/*}*/
/*.back_image{*/
/*width: 50px;*/
/*height: 50px;*/
/*margin-top:35px;*/
/*}*/
/*.title{*/
/*font-size:36px;*/
/*color:rgba(51,51,51,1);*/
/*width:750px;*/
/*position:absolute;*/
/*top:0;*/
/*left:0;*/
/*height:140px;*/
/*text-align:center;*/
/*margin-top:70px;*/
/*}*/
</style>
<template>
<div>
<div class="container">
<text class="project_title">
{{ examContent.module_name }}
</text>
<div
v-if="examContent.allowFlag == 0"
class="project_advice"
@click="clickJoin(examContent)"
>
<text class="project_advice_text">
{{ examContent.show_text }}
</text>
<text class="project_join_text">
{{ examContent.interactive_text }}
</text>
<image
class="project_see_more"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_red%403x.png"
/>
</div>
<div
v-if="examContent.passFlag == 5"
class="project_advice_auth"
@click="getCertify"
>
<image
class="advice_auth_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/cup%403x.png"
/>
<div class="advice_auth_text">
<text class="advice_auth_text_content">
{{ examContent.all_exam_writing }}
</text>
</div>
<!--<image class="advice_auth_right_img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/whiteLeft%403x.png"></image>-->
</div>
<div
v-for="(value,key) in examContent.allLists"
:key="key"
:class="[examContent.allLists.length>key+1?'test_list':'test_list1']"
>
<!--左边序号/圆圈-->
<div class="test_item1">
<image
v-if="examContent.exam_order == 5"
class="circle_gray"
:src="examContent.allowFlag==1 ? circleYellow: circleGray"
/>
<text
v-if="examContent.exam_order == 1"
class="order_number"
:class="[(examContent.allowFlag==1 && setOpen(key,examContent.allLists))? ((value.testNumFlag > 0 || value.progress == 100)? 'color-666': 'color-42a'): 'color-ccc']"
>
0{{ key+1 }}.
</text>
<div
v-if="examContent.exam_order == 1 && key < (examContent.allLists.length - 1)"
class="set_line_item"
:class="[(examContent.allowFlag==1 && (value.testNumFlag >0 || value.progress == 100 )) ? 'back-666': 'back-f0']"
/>
</div>
<!--中间文案-->
<div
class="test_item2"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
>
<text
v-if="examContent.allowFlag == 0"
class="test_name color-666"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="examContent.allowFlag == 1"
class="test_name"
:class="[ examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? (value.testNumFlag > 0 || value.progress == 100) ? 'color-333': 'color-42a': 'color-666': 'color-333']"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="!value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.testNumFlag > 0 ? ((value.standard_type == 10 ? "成绩:"+ value.answerResultModel.custom_value : value.standard_type == 5 ? value.answerResultModel.custom_value : "已完成") + " 共"+value.question_no+"题 对"+value.answerResultModel.correct_no+"题 错"+value.answerResultModel.wrong_no+"题"): messages(value.exam_writing, 16) }}
</text>
<text
v-if="value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.progress > 0 ? (value.progress == 100) ? "已完成学习" : "进行中 完成" + value.progress + "%": messages(value.study_writing, 16) }}
</text>
</div>
<!--右边文案-->
<div
class="test_item3"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
@click="goExam(key,value)"
>
<text
v-if="value.testNumFlag == 0 || value.progress < 100"
class="go_examination"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'border-color-94': 'border-color-e5' : 'border-color-94' : 'border-color-e5',
examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'color-42a' : 'color-999': 'color-42a' : 'color-999']"
>
{{ value.course_id ? '去学习':'去考试' }}
</text>
<div
v-if="value.testNumFlag > 0 || value.progress == 100"
class="go_result"
>
<text class="set_text_see">
{{ value.course_id ? "再学一遍": getBoolForExam(value) ? "重考" : "查看" }}
</text>
<image
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
</div>
</div>
</div>
<wxc-dialog
title=""
:content="setContent"
:show="isQuery"
cancel-text="取消"
confirm-text="去考试"
main-btn-color="#35cbca"
@wxcDialogCancelBtnClicked="wxcDialogCancelBtnClicked"
@wxcDialogConfirmBtnClicked="wxcDialogConfirmBtnClicked"
/>
</div>
</template>
<script>
// text collapse
import Vue from 'vue';
const modal = weex.requireModule('modal');
const configurationModule = weex.requireModule('configurationModule');
const globalEvent = weex.requireModule('globalEvent');
import wxcDialog from '../wxc-dialog';
const storage = weex.requireModule('storage');
export default {
components: {wxcDialog},
props:['examContent', 'hasAuth', 'keyIndex'],
data() {
return{
projectId: 1,
hasCertify: false,
circleGray: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_gray%403x.png',
circleYellow: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_red%403x.png',
isQuery: false,
setContent: '学习课程后再参加考试,成绩肯能会更优秀哦!',
currentId: 0,
currentIndex: 0, // 当前选中的考试下标
currentObj: {}, // 当前选中的考试内容
beforeLearningExamNumber: 0,
examNotStartLable: '',
query: {
examId: null,
origin: ''
}
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
messages (str, num) {
return str.length > num ? str.substr(0, num - 1) + '...' : str;
},
setOpen(index, arr) {
if (index == 0) {
return true;
}else if (index > 0 && ((arr[index - 1].progress == 100 || arr[index - 1].testNumFlag > 0 ) || (arr[index].progress == 100 || arr[index].testNumFlag > 0))) {
return true;
}
return false;
},
clickJoin(obj) {
if (obj.transfer_flag == 1) { // 有跳转路径
const url = obj.url ? obj.url : 'https://vuejs.org';
this.$router.push({
path: '/web_url',
query: {
url: url
}
});
}
},
getCertify() {
},
dateToString(t_date) {
const start_date_y = t_date.getFullYear();
const start_date_m = t_date.getMonth() + 1;
const start_date_d = t_date.getDate();
const start_date_h = t_date.getHours();
const start_date_mm = t_date.getMinutes();
return start_date_m + '月' + start_date_d + '日 ' + start_date_h + ':' + start_date_mm;
},
checkExamBegin(obj) {
if (!obj.course_id && obj.date_type == 5) {// 定时开放
const now_date = new Date();
const start_date = new Date(obj.start_date);
const end_date = new Date(obj.end_date);
const min_time = now_date - start_date;
const max_time = end_date - now_date;
if (min_time > 0 && max_time > 0) {
return true;
}else {
this.examNotStartLable = '考试开放时间 ' + this.dateToString(start_date) + '至' + this.dateToString(end_date);
return false;
}
}else {// 始终开放
return true;
}
},
goIDCardAndEdu(obj) {
const sendObj = {
field_requirement: 0,
roleCode: 'R001',
user_role_list: ''
};
this.GET('contents/projects/guestRoleCode', {}, (res) => {
const configurationModule = weex.requireModule('configurationModule');
if(res.data && res.data.respCode == 200) {
sendObj.roleCode = res.data.roleCode;
const mess = obj.field_requirement ? obj.field_requirement : -1;
sendObj.field_requirement = mess;
sendObj.user_role_list = obj.user_role_list;
configurationModule.checkIDCardAndEducation(sendObj);
}else {
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
});
}
});
},
goExam(index, obj) {
// modal.alert({message:'keyIndex ' + this.keyIndex})
storage.setItem('keyIndex', this.keyIndex, (e) => {
// modal.alert({message:e.result})
});
if (this.examContent.allowFlag == 1) {// 加入项目(项目考试组件有权限)
this.currentIndex = index;
this.currentObj = obj;
if (this.checkExamBegin(obj)) {
this.beginLogicForExam(index, obj);
}else {
modal.toast({
message: this.examNotStartLable,
duration: 1.0
});
}
}else {// 未加入项目
modal.toast({
message: this.examContent.show_text,
duration: 1.0
});
}
},
getBoolForExam(obj) { // 在考试至少完成一次情况下
// console.log(obj)
// obj.answerResultModel={
// pass_flag:5
// }
if (obj.answerResultModel.pass_flag == 5) {// 考试通过,不重考
return false;
}else {// 考试不通过
if (obj.again_times == -1 || (obj.again_times - obj.exam_num > 0)) {// 考试无限次,或者考试次数小于允许考试次数
return true;
}else {
return false;
}
}
},
addLogicForExam() {
// modal.alert({
// message:'跳转考试页面前的数据===>'+JSON.stringify(this.query)
// })
this.$router.push({
path:'/exam_result',
query: this.query
});
},
beginLogicForExam(index, obj) {
if (!obj.course_id) {// 考试项
if (obj.testNumFlag > 0) {// 完成考试
const isGoExam = this.getBoolForExam(obj);
if (isGoExam) {// 去重考
if ((index == 0 || index == 1) || (index > 0 && !this.examContent.allLists[index - 1].course_id)) {//
// modal.alert({message:'111'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress == 100) {
// modal.alert({message:'222'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
// modal.alert({message:'333'})
const course_name = lastItem.course_name;
if (obj.times == -1 || (obj.times - obj.exam_num > 0)) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 不去重考
// modal.alert({message:'444'})
this.query = {
answerResultId: obj.answerResultModel.id,
examId: obj.exam_id,
origin: 'end'
};
if (index > 0 && this.examContent.allLists[index - 1].course_id) {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress < 100) {
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
}
}
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}
}else{// 没有考试
if (index > 0) {// 大于第一项
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.course_id) {
if (lastItem.progress == 100) {// 课程已完成
// modal.alert({message:'555'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}else {
// modal.alert({message:'666'})
let flag = false;
if (this.examContent.exam_order == 1) {// 考试顺序--序贯
for (let i = 0; i < index; i++) {
if (!this.examContent.allLists[i].course_id) {
if (this.examContent.allLists[i].testNumFlag > 0 && this.examContent.allLists[i].answerResultModel.pass_flag == 5) {
// 之前考试全部通过
}else {
flag = true; // 有一门考试未考,或者未通过
break;
}
}
}
}
if (flag) {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}else {
const course_name = this.examContent.allLists[index - 1].course_name;
if (obj.times > 0 || obj.times == -1) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : obj.times;
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 考试上一项是考试 modal.alert({message:'777'})
const c1 = this.examContent.exam_order == 5; // 考试为并列
const c3 = (this.examContent.exam_order == 1 && lastItem.testNumFlag > 0) && (lastItem.standard_type == 1 || (lastItem.standard_type > 1 && lastItem.answerResultModel.pass_flag == 5)); // 考试为序贯且考试完成,上次考试无结果,或者结果为通过
if (c1 || c3) {
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}else { // 第一项
// modal.alert({message:'888'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}
}
}else {// 课程项
if (this.examContent.exam_order == 5 || index == 0) { // 顺序并列, 或者顺序贯序但为第一项
// modal.alert({message:'999'})
configurationModule.intoCourse(obj);
}else {
// modal.alert({message:'xxxxxx'})
const lastItem = this.examContent.allLists[index - 1];
if ((lastItem.testNumFlag > 0 && lastItem.answerResultModel.pass_flag == 5) || lastItem.progress >= 0) {
configurationModule.intoCourse(obj);
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
},
wxcDialogConfirmBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
this.query = {
examId: this.currentId,
origin: 'start'
};
if (this.beforeLearningExamNumber > 0) {
Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
}
this.goIDCardAndEdu(this.currentObj);
}
},
};
</script>
<style scoped>
.container{
justify-content:start;
align-items:flex-start;
background-color:#ffffff;
padding-top:30px;
padding-left: 30px;
padding-right: 0px;
padding-bottom: 0;
margin-top:20px;
}
.project_title{
font-size:36px;
color:#333333;
font-weight:700;
}
.project_advice{
flex-direction:row;
width:690px;
height:90px;
/*padding-top: 24px;*/
padding-left:30px;
padding-right: 30px;
/*padding-bottom: 30px;*/
margin-top:40px;
margin-bottom:40px;
background-color:#FDFBF5;
justify-content: space-between;
border-radius: 10px;
}
.project_advice_auth{
margin-top:30px;
}
.advice_auth_img{
width:690px;
height:140px;
}
.advice_auth_right_img{
width:40px;
height:40px;
position:absolute;
top:70px;
right:30px;
transform: rotate(180deg);
}
.advice_auth_text{
position:absolute;
left:0;
top:0;
height:140px;
width:690px;
justify-content: center;
align-items: center;
flex-direction:row;
}
.advice_auth_text_content{
font-size:34px;
color:#ffffff;
font-weight:600;
}
.circle_gray{
width:16px;
height:16px;
}
.project_advice_text{
color:#947e2c;
font-size:30px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_join_text{
color:#d86161;
font-size:30px;
padding-right: 20px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_see_more{
width:20px;
height:20px;
position:absolute;
top: 37px;
right: 20px;
transform: rotate(0deg);
}
.test_list{
flex-direction:row;
width:720px;
justify-content:space-between;
}
.test_list1{
flex-direction:row;
width:720px;
justify-content:space-between;
/*padding-bottom:30px;*/
}
.order_number{
font-size: 26px;
width: 45px;
height: 26px;
top: -7px;
font-weight: 600;
}
.test_item1{
flex:3;
padding-top:45px;
height:166px;
/*justify-content:center;*/
}
.test_item2{
flex:29;
padding-top:30px;
padding-bottom: 30px;
height:166px;
justify-content:center;
}
.test_item3{
flex:10;
align-items: flex-end;
height:166px;
padding-bottom: 30px;
padding-top: 30px;
padding-right: 30px;
justify-content:center;
}
.border-bottom{
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
border-bottom-width:1px;
}
.color-333{
color: #333333;
}
.color-666{
color: #666666;
}
.color-999{
color: #999999;
}
.color-ccc{
color: #cccccc;
}
.color-42a{
color: #2ab9a5;
}
.border-color-e5{
border-color: #e5e5e5;
}
.border-color-94{
border-color: #94dcd2;
}
.test_name{
font-size:32px;
margin-bottom:30px;
font-weight: 600;
}
.test_info{
font-size:26px;
}
.go_examination{
font-size:26px;
/*padding-top:10px;*/
padding-left:20px;
padding-right:20px;
border-radius:25px;
border-style:solid;
border-width:1px;
width: 120px;
height: 50px;
line-height: 50px;
}
.go_result{
flex-direction:row;
align-items:center;
}
.set_text_see{
font-size:28px;
color:rgba(102,102,102,1);
padding-right: 10px;
/*font-weight: 600;*/
}
.item3_right_arrow{
width: 20px;
height: 20px;
}
.set_line_item{
width: 2px;
height: 118px;
left: 10px;
top: 5px;
background-color: #f0f0f0;
}
.back-f0{
}
.back-666{
background-color: #666666;
}
</style>
<template>
<div>
<div class="container">
<text class="project_title">
{{ examContent.module_name }}
</text>
<div
v-if="examContent.allowFlag == 0"
class="project_advice"
@click="clickJoin(examContent)"
>
<text class="project_advice_text">
{{ examContent.show_text }}
</text>
<text class="project_join_text">
{{ examContent.interactive_text }}
</text>
<image
class="project_see_more"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_red%403x.png"
/>
</div>
<div
v-if="examContent.passFlag == 5"
class="project_advice_auth"
@click="getCertify"
>
<image
class="advice_auth_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/cup%403x.png"
/>
<div class="advice_auth_text">
<text class="advice_auth_text_content">
{{ examContent.all_exam_writing }}
</text>
</div>
<!--<image class="advice_auth_right_img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/whiteLeft%403x.png"></image>-->
</div>
<div
v-for="(value,key) in examContent.allLists"
:key="key"
:class="[examContent.allLists.length>key+1?'test_list':'test_list1']"
>
<!--左边序号/圆圈-->
<div class="test_item1">
<image
v-if="examContent.exam_order == 5"
class="circle_gray"
:src="examContent.allowFlag==1 ? circleYellow: circleGray"
/>
<text
v-if="examContent.exam_order == 1"
class="order_number"
:class="[(examContent.allowFlag==1 && setOpen(key,examContent.allLists))? ((value.testNumFlag > 0 || value.progress == 100)? 'color-666': 'color-42a'): 'color-ccc']"
>
0{{ key+1 }}.
</text>
<div
v-if="examContent.exam_order == 1 && key < (examContent.allLists.length - 1)"
class="set_line_item"
:class="[(examContent.allowFlag==1 && (value.testNumFlag >0 || value.progress == 100 )) ? 'back-666': 'back-f0']"
/>
</div>
<!--中间文案-->
<div
class="test_item2"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
>
<text
v-if="examContent.allowFlag == 0"
class="test_name color-666"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="examContent.allowFlag == 1"
class="test_name"
:class="[ examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? (value.testNumFlag > 0 || value.progress == 100) ? 'color-333': 'color-42a': 'color-666': 'color-333']"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="!value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.testNumFlag > 0 ? ((value.standard_type == 10 ? "成绩:"+ value.answerResultModel.custom_value : value.standard_type == 5 ? value.answerResultModel.custom_value : "已完成") + " 共"+value.question_no+"题 对"+value.answerResultModel.correct_no+"题 错"+value.answerResultModel.wrong_no+"题"): messages(value.exam_writing, 16) }}
</text>
<text
v-if="value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.progress > 0 ? (value.progress == 100) ? "已完成学习" : "进行中 完成" + value.progress + "%": messages(value.study_writing, 16) }}
</text>
</div>
<!--右边文案-->
<div
class="test_item3"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
@click="goExam(key,value)"
>
<text
v-if="value.testNumFlag == 0 || value.progress < 100"
class="go_examination"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'border-color-94': 'border-color-e5' : 'border-color-94' : 'border-color-e5',
examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'color-42a' : 'color-999': 'color-42a' : 'color-999']"
>
{{ value.course_id ? '去学习':'去考试' }}
</text>
<div
v-if="value.testNumFlag > 0 || value.progress == 100"
class="go_result"
>
<text class="set_text_see">
{{ value.course_id ? "再学一遍": getBoolForExam(value) ? "重考" : "查看" }}
</text>
<image
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
</div>
</div>
</div>
<wxc-dialog
title=""
:content="setContent"
:show="isQuery"
cancel-text="取消"
confirm-text="去考试"
main-btn-color="#35cbca"
@wxcDialogCancelBtnClicked="wxcDialogCancelBtnClicked"
@wxcDialogConfirmBtnClicked="wxcDialogConfirmBtnClicked"
/>
</div>
</template>
<script>
// text collapse
import Vue from 'vue';
const modal = weex.requireModule('modal');
const configurationModule = weex.requireModule('configurationModule');
const globalEvent = weex.requireModule('globalEvent');
import wxcDialog from '../wxc-dialog';
const storage = weex.requireModule('storage');
export default {
components: {wxcDialog},
props:['examContent', 'hasAuth', 'keyIndex'],
data() {
return{
projectId: 1,
hasCertify: false,
circleGray: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_gray%403x.png',
circleYellow: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_red%403x.png',
isQuery: false,
setContent: '学习课程后再参加考试,成绩肯能会更优秀哦!',
currentId: 0,
currentIndex: 0, // 当前选中的考试下标
currentObj: {}, // 当前选中的考试内容
beforeLearningExamNumber: 0,
examNotStartLable: '',
query: {
examId: null,
origin: ''
}
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
messages (str, num) {
return str.length > num ? str.substr(0, num - 1) + '...' : str;
},
setOpen(index, arr) {
if (index == 0) {
return true;
}else if (index > 0 && ((arr[index - 1].progress == 100 || arr[index - 1].testNumFlag > 0 ) || (arr[index].progress == 100 || arr[index].testNumFlag > 0))) {
return true;
}
return false;
},
clickJoin(obj) {
if (obj.transfer_flag == 1) { // 有跳转路径
const url = obj.url ? obj.url : 'https://vuejs.org';
this.$router.push({
path: '/web_url',
query: {
url: url
}
});
}
},
getCertify() {
},
dateToString(t_date) {
const start_date_y = t_date.getFullYear();
const start_date_m = t_date.getMonth() + 1;
const start_date_d = t_date.getDate();
const start_date_h = t_date.getHours();
const start_date_mm = t_date.getMinutes();
return start_date_m + '月' + start_date_d + '日 ' + start_date_h + ':' + start_date_mm;
},
checkExamBegin(obj) {
if (!obj.course_id && obj.date_type == 5) {// 定时开放
const now_date = new Date();
const start_date = new Date(obj.start_date);
const end_date = new Date(obj.end_date);
const min_time = now_date - start_date;
const max_time = end_date - now_date;
if (min_time > 0 && max_time > 0) {
return true;
}else {
this.examNotStartLable = '考试开放时间 ' + this.dateToString(start_date) + '至' + this.dateToString(end_date);
return false;
}
}else {// 始终开放
return true;
}
},
goIDCardAndEdu(obj) {
// modal.alert({message:'goIDCardAndEdu ' + obj})
const sendObj = {
field_requirement: 0,
roleCode: 'R001',
user_role_list: ''
};
this.GET('contents/projects/guestRoleCode', {}, (res) => {
// modal.alert({message:'goIDCardAndEdu ' + res})
const configurationModule = weex.requireModule('configurationModule');
if(res.data && res.data.respCode == 200) {
sendObj.roleCode = res.data.roleCode;
const mess = obj.field_requirement ? obj.field_requirement : -1;
sendObj.field_requirement = mess;
// sendObj.field_requirement = -1
sendObj.user_role_list = obj.user_role_list;
// modal.alert({message:'goIDCardAndEdu 200' + JSON.stringify(sendObj)})
configurationModule.checkIDCardAndEducation(sendObj);
}else {
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
});
}
});
},
goExam(index, obj) {
// modal.alert({message:'keyIndex ' + this.keyIndex})
storage.setItem('keyIndex', this.keyIndex, (e) => {
// modal.alert({message:e.result})
});
if (this.examContent.allowFlag == 1) {// 加入项目(项目考试组件有权限)
this.currentIndex = index;
this.currentObj = obj;
if (this.checkExamBegin(obj)) {
this.beginLogicForExam(index, obj);
}else {
modal.toast({
message: this.examNotStartLable,
duration: 1.0
});
}
}else {// 未加入项目
modal.toast({
message: this.examContent.show_text,
duration: 1.0
});
}
},
getBoolForExam(obj) { // 在考试至少完成一次情况下
// console.log(obj)
// obj.answerResultModel={
// pass_flag:5
// }
if (obj.answerResultModel.pass_flag == 5) {// 考试通过,不重考
return false;
}else {// 考试不通过
if (obj.again_times == -1 || (obj.again_times - obj.exam_num > 0)) {// 考试无限次,或者考试次数小于允许考试次数
return true;
}else {
return false;
}
}
},
addLogicForExam() {
// modal.alert({
// message:'跳转考试页面前的数据===>'+JSON.stringify(this.query)
// })
this.$router.push({
path:'/exam_result',
query: this.query
});
},
beginLogicForExam(index, obj) {
if (!obj.course_id) {// 考试项
if (obj.testNumFlag > 0) {// 完成考试
const isGoExam = this.getBoolForExam(obj);
if (isGoExam) {// 去重考
if ((index == 0 || index == 1) || (index > 0 && !this.examContent.allLists[index - 1].course_id)) {//
// modal.alert({message:'111'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress == 100) {
// modal.alert({message:'222'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
// modal.alert({message:'333'})
const course_name = lastItem.course_name;
if (obj.times == -1 || (obj.times - obj.exam_num > 0)) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 不去重考
// modal.alert({message:'444'})
this.query = {
answerResultId: obj.answerResultModel.id,
examId: obj.exam_id,
origin: 'end'
};
if (index > 0 && this.examContent.allLists[index - 1].course_id) {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress < 100) {
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
}
}
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}
}else{// 没有考试
if (index > 0) {// 大于第一项
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.course_id) {
if (lastItem.progress == 100) {// 课程已完成
// modal.alert({message:'555'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}else {
// modal.alert({message:'666'})
let flag = false;
if (this.examContent.exam_order == 1) {// 考试顺序--序贯
for (let i = 0; i < index; i++) {
if (!this.examContent.allLists[i].course_id) {
if (this.examContent.allLists[i].testNumFlag > 0 && this.examContent.allLists[i].answerResultModel.pass_flag == 5) {
// 之前考试全部通过
}else {
flag = true; // 有一门考试未考,或者未通过
break;
}
}
}
}
if (flag) {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}else {
const course_name = this.examContent.allLists[index - 1].course_name;
if (obj.times > 0 || obj.times == -1) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : obj.times;
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 考试上一项是考试 modal.alert({message:'777'})
const c1 = this.examContent.exam_order == 5; // 考试为并列
const c3 = (this.examContent.exam_order == 1 && lastItem.testNumFlag > 0) && (lastItem.standard_type == 1 || (lastItem.standard_type > 1 && lastItem.answerResultModel.pass_flag == 5)); // 考试为序贯且考试完成,上次考试无结果,或者结果为通过
if (c1 || c3) {
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}else { // 第一项
// modal.alert({message:'888'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}
}
}else {// 课程项
if (this.examContent.exam_order == 5 || index == 0) { // 顺序并列, 或者顺序贯序但为第一项
// modal.alert({message:'999'})
configurationModule.intoCourse(obj);
}else {
// modal.alert({message:'xxxxxx'})
const lastItem = this.examContent.allLists[index - 1];
if ((lastItem.testNumFlag > 0 && lastItem.answerResultModel.pass_flag == 5) || lastItem.progress >= 0) {
configurationModule.intoCourse(obj);
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
},
wxcDialogConfirmBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
this.query = {
examId: this.currentId,
origin: 'start'
};
if (this.beforeLearningExamNumber > 0) {
Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
}
this.goIDCardAndEdu(this.currentObj);
}
},
};
</script>
<style scoped>
.container{
justify-content:start;
align-items:flex-start;
background-color:#ffffff;
padding-top:30px;
padding-left: 30px;
padding-right: 0px;
padding-bottom: 0;
margin-top:20px;
}
.project_title{
font-size:36px;
color:#333333;
font-weight:700;
}
.project_advice{
flex-direction:row;
width:690px;
height:90px;
/*padding-top: 24px;*/
padding-left:30px;
padding-right: 30px;
/*padding-bottom: 30px;*/
margin-top:40px;
margin-bottom:40px;
background-color:#FDFBF5;
justify-content: space-between;
border-radius: 10px;
}
.project_advice_auth{
margin-top:30px;
}
.advice_auth_img{
width:690px;
height:140px;
}
.advice_auth_right_img{
width:40px;
height:40px;
position:absolute;
top:70px;
right:30px;
transform: rotate(180deg);
}
.advice_auth_text{
position:absolute;
left:0;
top:0;
height:140px;
width:690px;
justify-content: center;
align-items: center;
flex-direction:row;
}
.advice_auth_text_content{
font-size:34px;
color:#ffffff;
font-weight:600;
}
.circle_gray{
width:16px;
height:16px;
}
.project_advice_text{
color:#947e2c;
font-size:30px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_join_text{
color:#d86161;
font-size:30px;
padding-right: 20px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_see_more{
width:20px;
height:20px;
position:absolute;
top: 37px;
right: 20px;
transform: rotate(0deg);
}
.test_list{
flex-direction:row;
width:720px;
justify-content:space-between;
}
.test_list1{
flex-direction:row;
width:720px;
justify-content:space-between;
/*padding-bottom:30px;*/
}
.order_number{
font-size: 26px;
width: 45px;
height: 26px;
top: -7px;
font-weight: 600;
}
.test_item1{
flex:3;
padding-top:45px;
height:166px;
/*justify-content:center;*/
}
.test_item2{
flex:29;
padding-top:30px;
padding-bottom: 30px;
height:166px;
justify-content:center;
}
.test_item3{
flex:10;
align-items: flex-end;
height:166px;
padding-bottom: 30px;
padding-top: 30px;
padding-right: 30px;
justify-content:center;
}
.border-bottom{
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
border-bottom-width:1px;
}
.color-333{
color: #333333;
}
.color-666{
color: #666666;
}
.color-999{
color: #999999;
}
.color-ccc{
color: #cccccc;
}
.color-42a{
color: #2ab9a5;
}
.border-color-e5{
border-color: #e5e5e5;
}
.border-color-94{
border-color: #94dcd2;
}
.test_name{
font-size:32px;
margin-bottom:30px;
font-weight: 600;
}
.test_info{
font-size:26px;
}
.go_examination{
font-size:26px;
/*padding-top:10px;*/
padding-left:20px;
padding-right:20px;
border-radius:25px;
border-style:solid;
border-width:1px;
width: 120px;
height: 50px;
line-height: 50px;
}
.go_result{
flex-direction:row;
align-items:center;
}
.set_text_see{
font-size:28px;
color:rgba(102,102,102,1);
padding-right: 10px;
/*font-weight: 600;*/
}
.item3_right_arrow{
width: 20px;
height: 20px;
}
.set_line_item{
width: 2px;
height: 118px;
left: 10px;
top: 5px;
background-color: #f0f0f0;
}
.back-f0{
}
.back-666{
background-color: #666666;
}
</style>
<template>
<div>
<div class="container">
<text class="project_title">
{{ examContent.module_name }}
</text>
<div
v-if="examContent.allowFlag == 0"
class="project_advice"
@click="clickJoin(examContent)"
>
<text class="project_advice_text">
{{ examContent.show_text }}
</text>
<text class="project_join_text">
{{ examContent.interactive_text }}
</text>
<image
class="project_see_more"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_red%403x.png"
/>
</div>
<div
v-if="examContent.passFlag == 5"
class="project_advice_auth"
@click="getCertify"
>
<image
class="advice_auth_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/cup%403x.png"
/>
<div class="advice_auth_text">
<text class="advice_auth_text_content">
{{ examContent.all_exam_writing }}
</text>
</div>
<!--<image class="advice_auth_right_img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/whiteLeft%403x.png"></image>-->
</div>
<div
v-for="(value,key) in examContent.allLists"
:key="key"
:class="[examContent.allLists.length>key+1?'test_list':'test_list1']"
>
<!--左边序号/圆圈-->
<div class="test_item1">
<image
v-if="examContent.exam_order == 5"
class="circle_gray"
:src="examContent.allowFlag==1 ? circleYellow: circleGray"
/>
<text
v-if="examContent.exam_order == 1"
class="order_number"
:class="[(examContent.allowFlag==1 && setOpen(key,examContent.allLists))? ((value.testNumFlag > 0 || value.progress == 100)? 'color-666': 'color-42a'): 'color-ccc']"
>
0{{ key+1 }}.
</text>
<div
v-if="examContent.exam_order == 1 && key < (examContent.allLists.length - 1)"
class="set_line_item"
:class="[(examContent.allowFlag==1 && (value.testNumFlag >0 || value.progress == 100 )) ? 'back-666': 'back-f0']"
/>
</div>
<!--中间文案-->
<div
class="test_item2"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
>
<text
v-if="examContent.allowFlag == 0"
class="test_name color-666"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="examContent.allowFlag == 1"
class="test_name"
:class="[ examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? (value.testNumFlag > 0 || value.progress == 100) ? 'color-333': 'color-42a': 'color-666': 'color-333']"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</text>
<text
v-if="!value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.testNumFlag > 0 ? ((value.standard_type == 10 ? "成绩:"+ value.answerResultModel.custom_value : value.standard_type == 5 ? value.answerResultModel.custom_value : "已完成") + " 共"+value.question_no+"题 对"+value.answerResultModel.correct_no+"题 错"+value.answerResultModel.wrong_no+"题"): messages(value.exam_writing, 16) }}
</text>
<text
v-if="value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.progress > 0 ? (value.progress == 100) ? "已完成学习" : "进行中 完成" + value.progress + "%": messages(value.study_writing, 16) }}
</text>
</div>
<!--右边文案-->
<div
class="test_item3"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
@click="goExam(key,value)"
>
<text
v-if="value.testNumFlag == 0 || value.progress < 100"
class="go_examination"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'border-color-94': 'border-color-e5' : 'border-color-94' : 'border-color-e5',
examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'color-42a' : 'color-999': 'color-42a' : 'color-999']"
>
{{ value.course_id ? '去学习':'去考试' }}
</text>
<div
v-if="value.testNumFlag > 0 || value.progress == 100"
class="go_result"
>
<text class="set_text_see">
{{ value.course_id ? "再学一遍": getBoolForExam(value) ? "重考" : "查看" }}
</text>
<image
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
</div>
</div>
</div>
<wxc-dialog
title=""
:content="setContent"
:show="isQuery"
cancel-text="取消"
confirm-text="去考试"
main-btn-color="#35cbca"
@wxcDialogCancelBtnClicked="wxcDialogCancelBtnClicked"
@wxcDialogConfirmBtnClicked="wxcDialogConfirmBtnClicked"
/>
</div>
</template>
<script>
// text collapse
import Vue from 'vue';
const modal = weex.requireModule('modal');
const configurationModule = weex.requireModule('configurationModule');
const globalEvent = weex.requireModule('globalEvent');
import wxcDialog from '../wxc-dialog';
const storage = weex.requireModule('storage');
export default {
components: {wxcDialog},
props:['examContent', 'hasAuth', 'keyIndex'],
data() {
return{
projectId: 1,
hasCertify: false,
circleGray: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_gray%403x.png',
circleYellow: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_red%403x.png',
isQuery: false,
setContent: '学习课程后再参加考试,成绩肯能会更优秀哦!',
currentId: 0,
currentIndex: 0, // 当前选中的考试下标
currentObj: {}, // 当前选中的考试内容
beforeLearningExamNumber: 0,
examNotStartLable: '',
query: {
examId: null,
origin: ''
}
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
messages (str, num) {
return str.length > num ? str.substr(0, num - 1) + '...' : str;
},
setOpen(index, arr) {
if (index == 0) {
return true;
}else if (index > 0 && ((arr[index - 1].progress == 100 || arr[index - 1].testNumFlag > 0 ) || (arr[index].progress == 100 || arr[index].testNumFlag > 0))) {
return true;
}
return false;
},
clickJoin(obj) {
if (obj.transfer_flag == 1) { // 有跳转路径
const url = obj.url ? obj.url : 'https://vuejs.org';
this.$router.push({
path: '/web_url',
query: {
url: url
}
});
}
},
getCertify() {
},
dateToString(t_date) {
const start_date_y = t_date.getFullYear();
const start_date_m = t_date.getMonth() + 1;
const start_date_d = t_date.getDate();
const start_date_h = t_date.getHours();
const start_date_mm = t_date.getMinutes();
return start_date_m + '月' + start_date_d + '日 ' + start_date_h + ':' + start_date_mm;
},
checkExamBegin(obj) {
if (!obj.course_id && obj.date_type == 5) {// 定时开放
const now_date = new Date();
const start_date = new Date(obj.start_date);
const end_date = new Date(obj.end_date);
const min_time = now_date - start_date;
const max_time = end_date - now_date;
if (min_time > 0 && max_time > 0) {
return true;
}else {
this.examNotStartLable = '考试开放时间 ' + this.dateToString(start_date) + '至' + this.dateToString(end_date);
return false;
}
}else {// 始终开放
return true;
}
},
goIDCardAndEdu(obj) {
const sendObj = {
field_requirement: 0,
roleCode: 'R001',
user_role_list: ''
};
this.GET('contents/projects/guestRoleCode', {}, (res) => {
const configurationModule = weex.requireModule('configurationModule');
if(res.data && res.data.respCode == 200) {
sendObj.roleCode = res.data.roleCode;
const mess = obj.field_requirement ? obj.field_requirement : -1;
sendObj.field_requirement = mess;
// sendObj.field_requirement = -1
sendObj.user_role_list = obj.user_role_list;
configurationModule.checkIDCardAndEducation(sendObj);
}else {
modal.toast({
message: '网络异常,请稍后再试',
duration: 1.0
});
}
});
},
goExam(index, obj) {
// modal.alert({message:'keyIndex ' +this.keyIndex})
storage.setItem('keyIndex', this.keyIndex, (e) => {
// modal.alert({message:e.result})
});
if (this.examContent.allowFlag == 1) {// 加入项目(项目考试组件有权限)
this.currentIndex = index;
this.currentObj = obj;
if (this.checkExamBegin(obj)) {
this.beginLogicForExam(index, obj);
}else {
modal.toast({
message: this.examNotStartLable,
duration: 1.0
});
}
}else {// 未加入项目
modal.toast({
message: this.examContent.show_text,
duration: 1.0
});
}
},
getBoolForExam(obj) { // 在考试至少完成一次情况下
// console.log(obj)
// obj.answerResultModel={
// pass_flag:5
// }
if (obj.answerResultModel.pass_flag == 5) {// 考试通过,不重考
return false;
}else {// 考试不通过
if (obj.again_times == -1 || (obj.again_times - obj.exam_num > 0)) {// 考试无限次,或者考试次数小于允许考试次数
return true;
}else {
return false;
}
}
},
addLogicForExam() {
// modal.alert({
// message:'跳转考试页面前的数据===>'+JSON.stringify(this.query)
// })
this.$router.push({
path:'/exam_result',
query: this.query
});
},
beginLogicForExam(index, obj) {
if (!obj.course_id) {// 考试项
if (obj.testNumFlag > 0) {// 完成考试
const isGoExam = this.getBoolForExam(obj);
if (isGoExam) {// 去重考
if ((index == 0 || index == 1) || (index > 0 && !this.examContent.allLists[index - 1].course_id)) {//
// modal.alert({message:'111'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress == 100) {
// modal.alert({message:'222'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
// modal.alert({message:'333'})
const course_name = lastItem.course_name;
if (obj.times == -1 || (obj.times - obj.exam_num > 0)) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 不去重考
// modal.alert({message:'444'})
this.query = {
answerResultId: obj.answerResultModel.id,
examId: obj.exam_id,
origin: 'end'
};
if (index > 0 && this.examContent.allLists[index - 1].course_id) {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress < 100) {
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
}
}
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}
}else{// 没有考试
if (index > 0) {// 大于第一项
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.course_id) {
if (lastItem.progress == 100) {// 课程已完成
// modal.alert({message:'555'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}else {
// modal.alert({message:'666'})
let flag = false;
if (this.examContent.exam_order == 1) {// 考试顺序--序贯
for (let i = 0; i < index; i++) {
if (!this.examContent.allLists[i].course_id) {
if (this.examContent.allLists[i].testNumFlag > 0 && this.examContent.allLists[i].answerResultModel.pass_flag == 5) {
// 之前考试全部通过
}else {
flag = true; // 有一门考试未考,或者未通过
break;
}
}
}
}
if (flag) {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}else {
const course_name = this.examContent.allLists[index - 1].course_name;
if (obj.times > 0 || obj.times == -1) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : obj.times;
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
}else{
modal.toast({
message: '您尚未完成“' + course_name + '”培训课程的学习。',
duration: 1.0
});
}
}
}
}else {// 考试上一项是考试
// modal.alert({message:'777'})
const c1 = this.examContent.exam_order == 5; // 考试为并列
const c3 = (this.examContent.exam_order == 1 && lastItem.testNumFlag > 0) && (lastItem.standard_type == 1 || (lastItem.standard_type > 1 && lastItem.answerResultModel.pass_flag == 5)); // 考试为序贯且考试完成,上次考试无结果,或者结果为通过
if (c1 || c3) {
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}else { // 第一项
// modal.alert({message:'888'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query:{
// examId: obj.exam_id,
// origin: 'start'
// }
// })
}
}
}else {// 课程项
if (this.examContent.exam_order == 5 || index == 0) { // 顺序并列, 或者顺序贯序但为第一项
// modal.alert({message:'999'})
configurationModule.intoCourse(obj);
}else {
// modal.alert({message:'xxxxxx'})
const lastItem = this.examContent.allLists[index - 1];
if ((lastItem.testNumFlag > 0 && lastItem.answerResultModel.pass_flag == 5) || lastItem.progress >= 0) {
configurationModule.intoCourse(obj);
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
},
wxcDialogConfirmBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
this.query = {
examId: this.currentId,
origin: 'start'
};
if (this.beforeLearningExamNumber > 0) {
Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
}
this.goIDCardAndEdu(this.currentObj);
}
},
};
</script>
<style scoped>
.container{
justify-content:start;
align-items:flex-start;
background-color:#ffffff;
padding-top:30px;
padding-left: 30px;
padding-right: 0px;
padding-bottom: 0;
margin-top:20px;
}
.project_title{
font-size:36px;
color:#333333;
font-weight:700;
}
.project_advice{
flex-direction:row;
width:690px;
height:90px;
/*padding-top: 24px;*/
padding-left:30px;
padding-right: 30px;
/*padding-bottom: 30px;*/
margin-top:40px;
margin-bottom:40px;
background-color:#FDFBF5;
justify-content: space-between;
border-radius: 10px;
}
.project_advice_auth{
margin-top:30px;
}
.advice_auth_img{
width:690px;
height:140px;
}
.advice_auth_right_img{
width:40px;
height:40px;
position:absolute;
top:70px;
right:30px;
transform: rotate(180deg);
}
.advice_auth_text{
position:absolute;
left:0;
top:0;
height:140px;
width:690px;
justify-content: center;
align-items: center;
flex-direction:row;
}
.advice_auth_text_content{
font-size:34px;
color:#ffffff;
font-weight:600;
}
.circle_gray{
width:16px;
height:16px;
}
.project_advice_text{
color:#947e2c;
font-size:30px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_join_text{
color:#d86161;
font-size:30px;
padding-right: 20px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_see_more{
width:20px;
height:20px;
position:absolute;
top: 37px;
right: 20px;
transform: rotate(0deg);
}
.test_list{
flex-direction:row;
width:720px;
justify-content:space-between;
}
.test_list1{
flex-direction:row;
width:720px;
justify-content:space-between;
/*padding-bottom:30px;*/
}
.order_number{
font-size: 26px;
width: 45px;
height: 26px;
top: -7px;
font-weight: 600;
}
.test_item1{
flex:3;
padding-top:45px;
height:166px;
/*justify-content:center;*/
}
.test_item2{
flex:29;
padding-top:30px;
padding-bottom: 30px;
height:166px;
justify-content:center;
}
.test_item3{
flex:10;
align-items: flex-end;
height:166px;
padding-bottom: 30px;
padding-top: 30px;
padding-right: 30px;
justify-content:center;
}
.border-bottom{
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
border-bottom-width:1px;
}
.color-333{
color: #333333;
}
.color-666{
color: #666666;
}
.color-999{
color: #999999;
}
.color-ccc{
color: #cccccc;
}
.color-42a{
color: #2ab9a5;
}
.border-color-e5{
border-color: #e5e5e5;
}
.border-color-94{
border-color: #94dcd2;
}
.test_name{
font-size:32px;
margin-bottom:30px;
font-weight: 600;
}
.test_info{
font-size:26px;
}
.go_examination{
font-size:26px;
/*padding-top:10px;*/
padding-left:20px;
padding-right:20px;
border-radius:25px;
border-style:solid;
border-width:1px;
width: 120px;
height: 50px;
line-height: 50px;
}
.go_result{
flex-direction:row;
align-items:center;
}
.set_text_see{
font-size:28px;
color:rgba(102,102,102,1);
padding-right: 10px;
/*font-weight: 600;*/
}
.item3_right_arrow{
width: 20px;
height: 20px;
}
.set_line_item{
width: 2px;
height: 118px;
left: 10px;
top: 5px;
background-color: #f0f0f0;
}
.back-f0{
}
.back-666{
background-color: #666666;
}
</style>
<template>
<div>
<div class="container">
<div
v-if="examContent.allowFlag == 0"
class="project_advice_new"
>
<div class="project_advice_text_new">
您暂不属于该项目,若想获得学习权限,请拨打电话 400-920-8877 联系云鹊医工作人员。
</div>
</div>
<div class="project_title">
{{ examContent.module_name }}
</div>
<div
v-if="examContent.passFlag == 5"
class="project_advice_auth"
@click="getCertify"
>
<img
class="advice_auth_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/cup%403x.png"
/>
<div class="advice_auth_text">
<div class="advice_auth_text_content">
{{ examContent.all_exam_writing }}
</div>
</div>
</div>
<div
v-for="(value,key) in examContent.allLists"
:key="key"
class="test_list"
>
<div class="test_item1">
<img
v-if="examContent.exam_order == 5"
class="circle_gray"
:src="examContent.allowFlag==1 ? circleYellow: circleGray"
/>
<div
v-if="examContent.exam_order == 1"
class="order_number"
:class="[(examContent.allowFlag==1 && setOpen(key,examContent.allLists))? ((value.testNumFlag > 0 || value.progress == 100)? 'color-666': 'color-42a'): 'color-ccc']"
>
0{{ key+1 }}.
</div>
<div
v-if="examContent.exam_order == 1 && key < (examContent.allLists.length - 1)"
class="set_line_item"
:class="[(examContent.allowFlag==1 && (value.testNumFlag >0 || value.progress == 100 )) ? 'back-666': 'back-f0']"
/>
</div>
<!--中间文案-->
<div
class="test_item2"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
>
<div
v-if="examContent.allowFlag == 0"
class="test_name color-666"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</div>
<div
v-if="examContent.allowFlag == 1"
class="test_name"
:class="[ examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? (value.testNumFlag > 0 || value.progress == 100) ? 'color-333': 'color-42a': 'color-666': 'color-333']"
>
{{ value.course_id ? messages(value.course_name,14) : messages(value.name, 14) }}
</div>
<div
v-if="!value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.testNumFlag > 0 ? ((value.standard_type == 10 ? "成绩:"+ value.answerResultModel.custom_value : value.standard_type == 5 ? value.answerResultModel.custom_value : "已完成") + " 共"+value.question_no+"题 对"+value.answerResultModel.correct_no+"题 错"+value.answerResultModel.wrong_no+"题"): messages(value.exam_writing, 16) }}
</div>
<div
v-if="value.course_id"
class="test_info"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.allLists) ? 'color-999': 'color-ccc' : 'color-999':'color-ccc']"
>
{{ value.progress > 0 ? (value.progress == 100) ? "已完成学习" : "进行中 完成" + value.progress + "%": messages(value.study_writing, 16) }}
</div>
</div>
<!--右边文案-->
<!--没有权限-->
<div
v-if="examContent.allowFlag == 0"
class="test_item3"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
>
<div
v-if="value.testNumFlag == 0 || value.progress < 100"
class="go_examination border-color-e5 color-999"
>
无权限
</div>
</div>
<!--其它情况-->
<div
v-else
class="test_item3"
:class="[key < examContent.allLists.length - 1? 'border-bottom': '']"
@click="goExam(key,value)"
>
<div
v-if="value.testNumFlag == 0 || value.progress < 100"
class="go_examination"
:class="[examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'border-color-94': 'border-color-e5' : 'border-color-94' : 'border-color-e5',
examContent.allowFlag==1 ? examContent.exam_order == 1 ? setOpen(key,examContent.examModuleList) ? 'color-42a' : 'color-999': 'color-42a' : 'color-999']"
>
{{ value.course_id ? '去学习':'去考试' }}
</div>
<div
v-if="value.testNumFlag > 0 || value.progress == 100"
class="go_result"
>
<div class="set_text_see">
{{ value.course_id ? "再学一遍": getBoolForExam(value) ? "重考" : "查看" }}
</div>
<img
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
</div>
</div>
</div>
</div>
<!-- <wxc-dialog
title=""
:content="setContent"
:show="isQuery"
cancel-text="取消"
confirm-text="去考试"
main-btn-color="#35cbca"
@wxcDialogCancelBtnClicked="wxcDialogCancelBtnClicked"
@wxcDialogConfirmBtnClicked="wxcDialogConfirmBtnClicked"
/> 1111-->
</div>
</template>
<script>
// text collapse
import Vue from 'vue';
// const modal = weex.requireModule('modal');
// const configurationModule = weex.requireModule('configurationModule');
// import wxcDialog from '../wxc-dialog';
// const storage = weex.requireModule('storage');
import {getCoopRoleCode} from '@/api/content.js';
export default {
//components: {wxcDialog},
props:['examContent', 'hasAuth', 'keyIndex'],
data() {
return{
projectId: 1,
hasCertify: false,
circleGray: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_gray%403x.png',
circleYellow: 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/circle_red%403x.png',
isQuery: false,
setContent: '学习课程后再参加考试,成绩肯能会更优秀哦!',
currentId: 0,
currentIndex: 0, // 当前选中的考试下标
currentObj: {}, // 当前选中的考试内容
beforeLearningExamNumber: 0,
examNotStartLable: '',
query: {
examId: null,
origin: ''
}
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
messages (str, num) {
return str.length > num ? str.substr(0, num - 1) + '...' : str;
},
setOpen(index, arr) {
if (index == 0) {
return true;
}else if (index > 0 && ((arr[index - 1].progress == 100 || arr[index - 1].testNumFlag > 0 ) || (arr[index].progress == 100 || arr[index].testNumFlag > 0))) {
return true;
}
return false;
},
clickJoin(obj) {
if (obj.transfer_flag == 1) { // 有跳转路径
const url = obj.url ? obj.url : 'https://vuejs.org';
this.$router.push({
path: '/web_url',
query: {
url: url
}
});
}
},
getCertify() {
},
dateToString(t_date) {
const start_date_m = t_date.getMonth() + 1;
const start_date_d = t_date.getDate();
const start_date_h = t_date.getHours();
const start_date_mm = t_date.getMinutes();
return start_date_m + '月' + start_date_d + '日 ' + start_date_h + ':' + start_date_mm;
},
checkExamBegin(obj) {
if (!obj.course_id && obj.date_type == 5) {// 定时开放
const now_date = new Date();
const start_date = new Date(obj.start_date);
const end_date = new Date(obj.end_date);
const min_time = now_date - start_date;
const max_time = end_date - now_date;
if (min_time > 0 && max_time > 0) {
return true;
}else {
this.examNotStartLable = '考试开放时间 ' + this.dateToString(start_date) + '至' + this.dateToString(end_date);
return false;
}
}else {// 始终开放
return true;
}
},
goIDCardAndEdu(obj) {
// modal.alert({message:'goIDCardAndEdu ' + obj})
const sendObj = {
field_requirement: 0,
roleCode: 'R001',
user_role_list: ''
};
getCoopRoleCode().catch(res=>{
if(res.data && res.data.respCode == 200) {
sendObj.roleCode = res.data.roleCode;
const mess = obj.field_requirement ? obj.field_requirement : -1;
sendObj.field_requirement = mess;
sendObj.user_role_list = obj.user_role_list;
console.log(sendObj,"sendObjsendObj")
if(sendObj.user_role_list=="R004"){
this.dataOkForExam();
}
//configurationModule.checkIDCardAndEducation(sendObj); 111
}else {
this.$toast("网络异常,请稍后再试");
}
});
// this.GET('contents/projects/guestRoleCode', {}, (res) => {
// // modal.alert({message:'goIDCardAndEdu ' + res})
// const configurationModule = weex.requireModule('configurationModule');
// if(res.data && res.data.respCode == 200) {
// sendObj.roleCode = res.data.roleCode;
// const mess = obj.field_requirement ? obj.field_requirement : -1;
// sendObj.field_requirement = mess;
// sendObj.user_role_list = obj.user_role_list;
// // modal.alert({message:'goIDCardAndEdu 200' + JSON.stringify(sendObj)})
// configurationModule.checkIDCardAndEducation(sendObj);
// }else {
// modal.toast({
// message: '网络异常,请稍后再试',
// duration: 1.0
// });
// }
// });
},
dataOkForExam() {
this.addLogicForExam();
},
goExam(index, obj) {
localStorage.setItem('keyIndex', this.keyIndex)
if (this.examContent.allowFlag == 1) {// 加入项目(项目考试组件有权限)
this.currentIndex = index;
this.currentObj = obj;
if (this.checkExamBegin(obj)) {
this.beginLogicForExam(index, obj);
}else {
this.$toast(this.examNotStartLabl);
}
}else {// 未加入项目
this.$toast(this.examContent.show_text);
}
},
getBoolForExam(obj) { // 在考试至少完成一次情况下
if (obj.answerResultModel.pass_flag == 5) {// 考试通过,不重考
return false;
}else {// 考试不通过
if (obj.again_times == -1 || (obj.again_times - obj.exam_num > 0)) {// 考试无限次,或者考试次数小于允许考试次数
return true;
}else {
return false;
}
}
},
addLogicForExam() {
this.$router.push({
path:'/exam-result',
query: this.query
});
},
beginLogicForExam(index, obj) {
if (!obj.course_id) {// 考试项
if (obj.testNumFlag > 0) {// 完成考试
const isGoExam = this.getBoolForExam(obj);
if (isGoExam) {// 去重考
if ((index == 0 || index == 1) || (index > 0 && !this.examContent.allLists[index - 1].course_id)) {//
// modal.alert({message:'111'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
}else {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress == 100) {
// modal.alert({message:'222'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
}else {
const course_name = lastItem.course_name;
if (obj.times == -1 || (obj.times - obj.exam_num > 0)) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
this.diaLogConfirm();
}else{
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。')
// modal.toast({
// message: ,
// duration: 1.0
// });
}
}
}
}else {// 不去重考
// modal.alert({message:'444'})
this.query = {
answerResultId: obj.answerResultModel.id,
examId: obj.exam_id,
origin: 'end'
};
if (index > 0 && this.examContent.allLists[index - 1].course_id) {
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress < 100) {
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
}
}
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}
}else{// 没有考试
if (index > 0) {// 大于第一项
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.course_id) {
if (lastItem.progress == 100) {// 课程已完成
// modal.alert({message:'555'})
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}else {
// modal.alert({message:'666'})
let flag = false;
if (this.examContent.exam_order == 1) {// 考试顺序--序贯
for (let i = 0; i < index; i++) {
if (!this.examContent.allLists[i].course_id) {
if (this.examContent.allLists[i].testNumFlag > 0 && this.examContent.allLists[i].answerResultModel.pass_flag == 5) {
// 之前考试全部通过
}else {
flag = true; // 有一门考试未考,或者未通过
break;
}
}
}
}
if (flag) {
this.$toast('请按顺序完成学习及考试');
// modal.toast({
// message: '请按顺序完成学习及考试',
// duration: 1.0
// });
}else {
const course_name = this.examContent.allLists[index - 1].course_name;
if (obj.times > 0 || obj.times == -1) {// 学习课程前的考试次数
this.setContent = '您尚未完成“' + course_name + '”课程的学习,是否直接考试?';
this.currentId = obj.exam_id;
this.beforeLearningExamNumber = obj.times == -1 ? 100 : obj.times;
this.currentIndex = index;
this.currentObj = obj;
this.isQuery = true;
this.diaLogConfirm();
}else{
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。')
}
}
}
}else {// 考试上一项是考试
const c1 = this.examContent.exam_order == 5; // 考试为并列
const c3 = (this.examContent.exam_order == 1 && lastItem.testNumFlag > 0) && (lastItem.standard_type == 1 || (lastItem.standard_type > 1 && lastItem.answerResultModel.pass_flag == 5)); // 考试为序贯且考试完成,上次考试无结果,或者结果为通过
if (c1 || c3) {
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
}else {
// modal.toast({
// message: '请按顺序完成学习及考试',
// duration: 1.0
// });
}
}
}else { // 第一项
this.query = {
examId: obj.exam_id,
origin: 'start'
};
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
}
}
}else {// 课程项
if (this.examContent.exam_order == 5 || index == 0) { // 顺序并列, 或者顺序贯序但为第一项
// modal.alert({message:'999'})
configurationModule.intoCourse(obj);
}else {
// modal.alert({message:'xxxxxx'})
const lastItem = this.examContent.allLists[index - 1];
if ((lastItem.testNumFlag > 0 && lastItem.answerResultModel.pass_flag == 5) || lastItem.progress >= 0) {
configurationModule.intoCourse(obj);
}else {
modal.toast({
message: '请按顺序完成学习及考试',
duration: 1.0
});
}
}
}
},
diaLogConfirm(){
this.$dialog
.confirm({
title: '提醒',
message: this.setContent,
cancelButtonText: '取消',
confirmButtonText: '去考试',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.wxcDialogConfirmBtnClicked();
})
.catch(() => {
this.wxcDialogCancelBtnClicked();
});
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
},
wxcDialogConfirmBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
this.isQuery = false;
this.query = {
examId: this.currentId,
origin: 'start'
};
if (this.beforeLearningExamNumber > 0) {
Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
}
this.goIDCardAndEdu(this.currentObj);
}
},
};
</script>
<style scoped>
.info_text_new {
padding:30px;
/*margin-bottom:30px;*/
width:100%;
height:94px;
overflow: hidden;
/*background-color: #00B4FF;*/
}
.synopsis_new {
font-size:30px;
color:#333333;
font-weight:600;
/* position:absolute;
left:30px;
top:30px; */
}
.text_content_new {
font-size:30px;
color:#666666;
/*background-color: #008000;*/
padding-bottom: 30px;
}
.container{
justify-content:start;
align-items:flex-start;
background-color:#ffffff;
margin-top:10px;
padding:15px 15px 0 15px;
}
.project_title{
font-size:18px;
color:#333333;
padding-top:5px;
font-weight:600;
}
.project_advice{
flex-direction:row;
width: 96%;
height: 90px;
/*padding-top: 24px;*/
padding-left: 30px;
padding-right: 30px;
/*padding-bottom: 30px;*/
margin-top: 40px;
margin-bottom: 40px;
background-color:#FDFBF5;
justify-content: space-between;
border-radius: 10px;
}
.project_advice_new {
/* flex-direction: row; */
height:auto;
margin:0 auto;
/* justify-content: space-between; */
border-radius: 10px;
}
.project_advice_auth{
margin-top:15px;
}
.advice_auth_img{
width:96%;
height:70px;
}
.advice_auth_right_img{
width:40px;
height:40px;
position:absolute;
top:70px;
right:30px;
transform: rotate(180deg);
}
.advice_auth_text{
position:absolute;
left:0;
top:0;
height:140px;
width:96%;
justify-content: center;
align-items: center;
flex-direction:row;
}
.advice_auth_text_content{
font-size:34px;
color:#ffffff;
font-weight:600;
}
.circle_gray{
width:8px;
height:8px;
}
.project_advice_text{
color:#947e2c;
font-size:30px;
font-weight: 600;
height: 90px;
line-height: 90px;
}
.project_advice_text_new {
overflow: hidden;
display: inline-block;
color: #E6A23C;
font-size:15px;
padding:15px;
font-weight: 400;
background-color:#FDFBF5;
/* height: 135px; */
/* line-height: 45px; */
}
.project_join_text{
color:#d86161;
font-size:15px;
padding-right:10px;
font-weight: 600;
height:45px;
line-height:45px;
}
.project_see_more{
width:20px;
height:20px;
position:absolute;
top: 37px;
right: 20px;
transform: rotate(0deg);
}
.test_list{
display:flex;
justify-content:flex-start;
align-items: center;
border-bottom:1px solid #f0f0f0;
/* width:100%; */
}
.test_list:last-of-type{
border-bottom:none
}
.test_list1{
flex-direction:row;
width:100%;
}
.order_number{
font-size: 26px;
width: 45px;
height: 26px;
top: -7px;
font-weight: 600;
}
.test_item1{
/* padding-top:45px;
height:166px; */
height:auto;
}
.test_item2{
flex:3;
padding:15px 0 15px 15px;
height:auto;
}
.test_item3{
flex:1;
}
.color-333{
color: #333333;
}
.color-666{
color: #666666;
}
.color-999{
color: #999999;
}
.color-ccc{
color: #cccccc;
}
.color-42a{
color: #2ab9a5;
}
.border-color-e5{
border-color: #e5e5e5;
}
.test_name{
font-size:16px;
padding-bottom:10px;
font-weight: 600;
}
.test_info{
font-size:13px;
}
.go_examination{
font-size:13px;
padding:0 5px;
border-radius:15px;
border:1px solid #ccc;
width:60px;
text-align:center;
height:25px;
line-height:25px;
}
.border-color-94{
border-color:#94dcd2;
}
.go_result{
display:flex;
align-items:center;
}
.set_text_see{
font-size:14px;
color:rgba(102,102,102,1);
padding-right: 5px;
/*font-weight: 600;*/
}
.item3_right_arrow{
width: 15px;
height: 15px;
}
.set_line_item{
width: 2px;
height: 118px;
left: 10px;
top: 5px;
background-color: #f0f0f0;
}
.back-f0{
}
.back-666{
background-color: #666666;
}
</style>
<template>
<div class="container">
<div class="type_1">
<slot name="type_1" />
</div>
<div class="type_2">
<slot name="type_2" />
</div>
<div class="type_3">
<slot name="type_3" />
</div>
<div class="type_4">
<slot name="type_4" />
</div>
<div class="type_5">
<slot name="type_5" />
</div>
</div>
</template>
<script>
/** **脑卒中卡槽 */
import { WxcDialog } from 'weex-ui';
export default {
components: { WxcDialog },
data() {
return{
};
},
computed: {
},
created () {
},
mounted() {
},
methods: {
},
};
</script>
<style scoped>
.container{
width:750px;
}
.type_1{
width:750px;
}
.type_2{
width:750px;
}
.type_3{
width:750px;
}
.type_4{
width:750px;
}
.type_5{
width:750px;
}
</style>
<template>
<div class="container">
<div
ref="textRef"
>
<div class="ele-content" :class="{'ele-contentOther':status}">
<span>简介:</span>
{{ message }}
</div>
<div @click="seeMore" class="ele-content-btn"> {{ status ? '显示全部' : '收起' }}</div>
</div>
<div
class="see_more"
@click="seeMore"
>
<text class="see_more_text">
{{ status? '收起' : '显示全部' }}
</text>
</div>
</div>
</template>
<script>
// text collapse
// const dom = weex.requireModule('dom');
export default {
components: {},
props:['infoMsg'],
data() {
return{
status: true, // false 查看更多 true 收起
height: ''
};
},
computed: {
message: function() {
return this.infoMsg.textModuleList[0].content
}
},
created () {
},
mounted() {
this.init();
},
methods: {
getShortBrief(str) {
},
init() {
console.log(this.infoMsg.textModuleList[0])
},
seeMore() {
this.status=!this.status;
}
},
};
</script>
<style scoped>
.message-backups {
position: fixed;
padding: 0 30px;
z-index: -1;
top: 200px;
background-color: darkslategray;
visibility: hidden;
font-size:30px;
color:#666666;
}
.container{
padding:15px 15px 0 15px;
justify-content:center;
align-items:center;
background-color:#ffffff;
}
.info_text{
width:100%;
height:94px;
overflow: hidden;
/*background-color: #00B4FF;*/
}
.info_text_open{
width:100%;
height:500px;
}
.text_content{
font-size:15px;
color:#666666;
/*background-color: #008000;*/
padding-bottom: 30px;
}
.synopsis{
font-size:15px;
color:#333333;
font-weight:600;
/* position:absolute;
left:30px;
top:30px; */
}
.ele-content{
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
font-size:15px;
color:#666;
}
.ele-content span{
color:#333;
font-weight:600;
font-size:16px;
}
.ele-contentOther{
-webkit-line-clamp: 3;
}
.ele-content-btn{
border-top: 1px solid #f0f0f0;
width:100%;
height:40px;
line-height:40px;
color:#666;
text-align:center;
justify-content:center;
margin-top:15px
}
.see_more_text{
font-size:30px;
color:#999999;
}
</style>
import { router, store, vueApp } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
import '@/router';
console.log('router, store, vueApp: ', router, store, vueApp);
该目录放置Vue第三方插件初始化的文件。该目录会被自动加载。
例如:
```js
import Vue from 'vue';
import { Plugin } from 'vue-fragment';
Vue.use(Plugin);
Vue.property.$test = 'pica';
```
/**
* @name: appHooks
* @author: alan
* @date: 2021-09-13 17:05
* @description:appHooks
* @update: 2021-09-13 17:05
*/
export default {
data() {
return {
};
},
created() {
},
mounted() {
}
};
import $http from 'mn-template/plugins/http';
// 设置axios默认属性
$http.setDefaults({
headers: {}
});
// 设置http配置信息 loading、error、clear、encrypt、mockUserInfo
$http.setOptions({
loading () {
console.log('我重写了默认的loading');
}
});
// 新增前置钩子
$http.addBeforeHook(config => console.log('我是新增的前置钩子', config), 0);
// 新增后置钩子
$http.addAfterHook(response => console.log('我是新增的后置钩子', response), 0);
import Vue from 'vue';
import {
Toast,
List,
Swipe,
SwipeItem,
Popup,
Icon,
Empty,
Loading,
Dialog,
Tab,
Tabs,
Lazyload,
Button,
Badge,
Tag,
Picker,
Form,
Field,
RadioGroup,
Radio,
Uploader,
Checkbox,
CheckboxGroup,
ActionSheet,
Cascader,
Calendar,
Cell,
CellGroup,
Switch,
Overlay,
Search,
DatetimePicker,
Sticky,
Collapse,
CollapseItem,
CountDown
} from 'vant';
Vue.use(List)
.use(Toast)
.use(Swipe)
.use(SwipeItem)
.use(Popup)
.use(Icon)
.use(Empty)
.use(Loading)
.use(Dialog)
.use(Tab)
.use(Tabs)
.use(Lazyload)
.use(Button)
.use(Badge)
.use(Tag)
.use(Picker)
.use(Form)
.use(Field)
.use(RadioGroup)
.use(Radio)
.use(Uploader)
.use(CheckboxGroup)
.use(Checkbox)
.use(ActionSheet)
.use(Cascader)
.use(Calendar)
.use(Cell)
.use(Switch)
.use(CellGroup)
.use(Overlay)
.use(Search)
.use(DatetimePicker)
.use(Sticky)
.use(Collapse)
.use(CollapseItem)
.use(CountDown);
import axios from 'axios';
import { name } from '../package.json';
// 整理路由
const routerObj = {};
const titleObj = {};
let baseUrl = process.env.VUE_APP_BASE_ROUTE_URL || process.env.BASE_URL || '';
let fullHost = location.host || '';
if (fullHost.indexOf('uat-') != -1) {
fullHost = fullHost.replace('uat-', '');
}
if (fullHost.indexOf('http') == -1) {
fullHost = (window.location.protocol || 'https:') + '//' + fullHost;
}
let rMode = 'history';
if (window.location.hash) {
rMode = 'hash';
baseUrl = baseUrl || location.pathname;
}
let projectName = name;
// 处理路由children
function allRouter(ele, spath) {
for (var i = 0; i < ele.length; i++) {
if (ele[i].path) {
let key = '';
if (spath && spath != '/') {
key = spath + '/' + ele[i].path;
} else {
key = ele[i].path;
}
routerObj[key] = key;
titleObj[key] = ele[i].meta && ele[i].meta.title;
if (ele[i].children) {
allRouter(ele[i].children, ele[i].path);
}
}
}
}
// 处理路由
function handleAllRouter(parmsObj) {
parmsObj.mode = parmsObj.mode || rMode;
projectName = parmsObj.projectName || projectName;
baseUrl = parmsObj.baseUrl || baseUrl || '';
const fhost = parmsObj.fullHost || fullHost;
if (baseUrl.substr(baseUrl.length - 1, 1) == '/') {
baseUrl = baseUrl.substr(0, baseUrl.length - 1);
}
if (parmsObj.mode == 'hash') {
baseUrl = baseUrl + '/#';
}
allRouter(parmsObj.routerConfig, '');
const arr = [];
for (var key in routerObj) {
const optionObj = {};
optionObj.url = routerObj[key];
optionObj.fullPath = fhost + baseUrl + routerObj[key];
optionObj.host = fhost;
optionObj.title = titleObj[key];
arr.push(optionObj);
}
sendAllRouterInfo(arr);
}
// 发送请求
function sendAllRouterInfo(data) {
let url = '';
if (process.env.NODE_ENV == 'development') {
url = 'https://dev-sc.yunqueyi.com/basic-data/menuCode/upload';
} else if (process.env.VUE_APP_ENV == 'uat') {
url = 'https://sc.yunqueyi.com/basic-data/menuCode/upload';
}
if (!url) {
return;
}
const obj = {
projectName: projectName,
menuCodeDtoList: data,
};
console.log(obj);
axios({
method: 'post',
url: url,
data: obj,
})
.then((res) => {
console.log('请求接口成功了', res.data);
return;
})
.catch((err) => {
console.log('errerrerr', err);
return;
});
}
export default handleAllRouter;
```js
import { router } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
import Index from '@/views/home.vue';
const routerConfig = [
{
path: '/',
name: 'Index',
component: Index
},
{
path: '*',
redirect: process.env.VUE_APP_BASE_ROUTE
}
];
router.addRoutes(routerConfig);
```
```js
// vue.config.js
module.exports = {
transpileDependencies: [
'@pica-cli/vue-cli-plugin-pica-cli-plugin'
],
pluginOptions: {
pica: {
jsSort: [],
cssSort: [],
// 配置骨架屏路由
skeletonRoutes: [
{
path: '',
name: 'Index',
meta: {
skeleton: true
}
}
],
enableAutoSkeletonRoutes: false,
routeMode: 'history',
dpsLimit: 5
},
tinypng: {
key: ''
}
}
};
module.exports.publicPath = process.env.VUE_APP_OSS_URL + '/static' + process.env.BASE_URL;
```
该目录放置需要自定义路由过滤器(守卫)的文件。该目录会被自动加载。
默认加载:
* `BudpParamsFilter` 中台参数过滤器
* `ToRootFilter` 清空路由栈并跳转到指定路由为当前首页
例如:
```js
import {AbstractRouterFilter} from '@pica-cli/pica-cli-framework';
export default class Demo extends AbstractRouterFilter {
onBefore (to, from) {
console.log(`from ${from.path} to ${to.path}`);
}
}
```
如需要排除默认加载过滤器:
```js
import {BudpParamsFilter} from '@pica-cli/pica-cli-framework';
// 禁用中台过滤器
BudpParamsFilter.property.matches = () => false;
```
import { router } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
import Index from '@/views/Home.vue';
import {toggleSkeletonRouter} from 'mn-template/plugins/toggleSkeleton.js';
import handleAllRouter from '../public_uat';
const routerConfig = [
{
path: '/',
name: 'Index',
component: Index
},
{
path: '/stroke',
name: 'stroke',
component: () => import('@/views/stroke/index.vue'),
},
{
path: '/exam',
name: 'exam',
component: () => import('@/views/exam/index.vue')
},
{
path: '/exam-result',
name: 'exam-result',
component: () => import('@/views/examResult/index.vue')
},
{
path: '/exam-wrong',
name: 'exam-wrong',
component: () => import('@/views/exam/exam_wrong.vue')
},
{
path: '*',
redirect: process.env.VUE_APP_BASE_ROUTE
}
];
router.beforeEach(async (to, from, next) => {
toggleSkeletonRouter(to, from);
next();
});
router.addRoutes(routerConfig);
if (process.env.VUE_APP_ENV == 'uat') {
const routerInfo = {
routerConfig: routerConfig,
};
handleAllRouter(routerInfo);
}
export default {
namespaced: true,
state: {
count: 0
},
mutations: {
add (state, val = 1) {
state.count += val;
}
}
};
@charset "utf-8";
*{
margin: 0;
padding: 0;
}
body{
background-color: $colorBackground;
// color: $color4;
}
a, a:hover, a:active, a:focus{
text-decoration: none;
color: $color4;
}
input{
border: 0;
outline: none;
}
img{
display: block;
border: 0;
width: 100%;
height: 100%;
}
.clear:before,
.clear:after{
content: '';
display: block;
clear: both;
height: 0;
}
input::-webkit-input-placeholder{
color: $color10 !important;
}
input::-moz-placeholder{
color: $color10 !important;
}
input::-ms-input-placeholder{
color: $color10 !important;
}
input[type=search]::-webkit-search-cancel-button{
-webkit-appearance: none;
}
.van-picker__toolbar {
height:45px;
background:rgba(255,255,255,1);
box-shadow:0px -4px 15px 0px rgba(0,0,0,0.05);
}
.van-picker__columns {
background:rgba(255,255,255,1);
box-shadow:0px -4px 15px 0px rgba(0,0,0,0.05);
}
.van-picker__confirm {
color: #15A4AC;
}
.van-picker__title {
font-size:13px;
font-weight:400;
color:rgba(131,139,152,1);
}
.fixed-bottom-20 {
position: fixed;
bottom: 20px;
}
.van-toast__icon {
font-size: 25px;
}
.page-right-content {
position: absolute;
left: -40px;
}
.flex-column {
display: flex;
flex-direction: column;
}
.flex-row {
display: flex;
flex-direction: row;
}
.flex-between {
justify-content: space-between;
}
.flex-around {
justify-content: space-around;
}
.flex-center {
align-items: center;
justify-content: center;
}
.flex-expanded {
flex: 1;
}
.van-action-sheet__item {
&:not(:first-child) {
border-top: 1px solid rgba(216, 216, 216, 0.8);
}
}
.van-cell__left-icon, .van-cell__right-icon {
line-height: 24px !important;
}
#app {
.__vuescroll .__refresh svg.start .active-path, .__vuescroll .__load svg.start .active-path {
stroke: #c8c9cc;
}
.__vuescroll .__refresh svg path, .__vuescroll .__refresh svg rect, .__vuescroll .__load svg path, .__vuescroll .__load svg rect {
fill: #c8c9cc;
}
.__vuescroll .__refresh, .__vuescroll .__load {
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
color: rgba(0,0,0, 0.5);
}
.__vuescroll .__refresh svg, .__vuescroll .__load svg {
height: 16px;
width: 16px;
}
}
.symbol-icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
.echarts-tip {
&-warp {
position: relative;
}
&-background {
background: #FBBD52;
padding: 1px 7px;
border-radius: 2px;
font-size: 13px;
}
&-triangle-down {
width: 0;
height: 0;
position: relative;
left: calc(50% - 4px);
top: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 3px solid #FBBD52;
}
}
html {
color: #000;
background: #fff;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
html * {
outline: 0;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}
html,body {
font-family: PingFangSC-Regular, -apple-system-font, Source Han Sans, Helvetica Neue, sans-serif;
}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
margin: 0;
padding: 0;
}
/*
input, select, textarea {
font-size: 100%;
}
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img {
border: 0;
}
abbr, acronym {
border: 0;
font-variant: normal;
}
del {
text-decoration: line-through;
}
address, caption, cite, code, dfn, em, th, var {
font-style: normal;
font-weight: 500;
}
ol, ul {
list-style: none;
}
caption, th {
text-align: left;
}
/*
h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: 500;
}
*/
q:before, q:after {
content: '';
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -.5em;
}
sub {
bottom: -.25em;
}
a:hover {
text-decoration: underline;
}
ins, a {
text-decoration: none;
}
$color1: rgba(15,28,52,1);
$color2: #58FFD2;
$color3: #FFBF38;
$color4: #15A4AC;
$color5: #83FFB5;
$color6: #EB4343;
$color7: #EB7C43;
$color8: linear-gradient(360deg,rgba(21,164,172,1) 0%,rgba(40,210,200,1) 100%);
$color9: #58FFD2;
$color10: #A4AAB3;
$color11: #969DBA;
$color12: #BBBBBB;
$color13: #FFAB00;
$color14: #0000FF;
$color15: linear-gradient(180deg,rgba(255,217,125,1) 0%,rgba(255,167,17,1) 100%);
$color16: #D2D2D2;
$color17: #333333;
$color18: #999999;
$color19: linear-gradient(90deg,rgba(40,210,200,1) 0%,rgba(21,164,172,1) 100%);
$color20: #FF6E00;
$colorA: #4A90E2;
$colorB: #5ACE6D;
$colorBackground: #F5F5F5;
$colorWhite: #fff;
$colorAqi1: #68CB00;
$colorAqi2: #FFC000;
$colorAqi3: #DF2D00;
$colorAqi4: #6F0574;
.top-error-message {
top: 12%;
width: 80%;
}
export const setCookie = (
cname,
cvalue,
exdays = 7,
domain = '.yunqueyi.com',
validMsec
) => {
// yunqueyi.com
const d = new Date();
let expires = '';
if (validMsec) {
d.setTime(d.getTime() + validMsec);
} else {
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
}
expires = `expires=${d.toUTCString()}`;
// document.cookie = `${cname}=${cvalue};path=/;${expires}`;
document.cookie = `${cname}=${cvalue};path=/;${expires};domain=${domain}`;
};
export const getCookie = (cname) => {
const reg = new RegExp('(^| )' + cname + '=([^;]*)(;|$)');
const arr = document.cookie.match(reg);
return arr ? unescape(arr[2]) : null;
};
export const delCookie = (name) => {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval !== null) {
// document.cookie = name + "="+cval+";expires="+exp.toGMTString();
document.cookie = name + '=; path=/; expires=' + new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=.yunqueyi.com; expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=dev-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=test1-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=uat-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=.dev-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=.test1-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=.uat-phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
document.cookie =
name +
'=; path=/; domain=.phome.yunqueyi.com;expires=' +
new Date(0).toUTCString();
}
};
export const formatDate = (datetime) => {
var date = new Date(datetime); // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
var year = date.getFullYear(),
month = ('0' + (date.getMonth() + 1)).slice(-2),
sdate = ('0' + date.getDate()).slice(-2),
hour = ('0' + date.getHours()).slice(-2),
minute = ('0' + date.getMinutes()).slice(-2),
second = ('0' + date.getSeconds()).slice(-2);
// 拼接
var result =
year + '-' + month + '-' + sdate + ' ' + hour + ':' + minute + ':' + second;
// 返回
return result;
};
export const formatDay = (datetime) => {
var date = new Date(datetime);
var year = date.getFullYear(),
month = ('0' + (date.getMonth() + 1)).slice(-2),
day = ('0' + date.getDate()).slice(-2);
// 拼接
var result = year + '-' + month + '-' + day;
// 返回
return result;
};
// 判断是否是微信
export function isWeixin() {
const ua = navigator.userAgent.toLowerCase();
return ua.match(/MicroMessenger/i) === 'micromessenger';
}
// 时间戳 格式化为 时分秒(00: 00: 00)
export const formatDuring = (time) => {
const s = Math.floor(time / 1000);
if (!s) {
return '';
}
let t = '';
if (s > -1) {
const hour = Math.floor(s / 3600);
const min = Math.floor(s / 60) % 60;
const sec = s % 60;
if (hour) {
if (hour < 10) {
t = '0' + hour + ':';
} else {
t = hour + ':';
}
}
if (min < 10) {
t += '0';
}
t += min + ':';
if (sec < 10) {
t += '0';
}
t += sec.toFixed(0);
}
return t;
};
export function toDecimal2(x) {
if (isNaN(x)) {
return '';
}
const f = x / 100;
let s = f.toString();
let rs = s.indexOf('.');
if (rs < 0) {
rs = s.length;
s += '.';
}
while (s.length <= rs + 2) {
s += '0';
}
return s;
}
/**
* 通过身份证获取出生日期及性别
* @param idCard 15/18位身份证号码
* @return JSON对象
* sex:0-女、1-男;
* birthDay:yyyy-MM-dd
*/
export function getBirthdayAndSex(idCard) {
const info = {};
const birth = (idCard.length === 18) ? idCard.slice(6, 14) : idCard.slice(6, 12);
// 18位:提取第17位数字;15位:提取最后一位数字
const order = (idCard.length === 18) ? idCard.slice(-2, -1) : idCard.slice(-1);
info.birthDay = (idCard.length === 18) ? ([birth.slice(0, 4),
birth.slice(4, 6), birth.slice(-2)
]).join('-') : ([
'19' + birth.slice(0, 2), birth.slice(2, 4),
birth.slice(-2)
]).join('-');
// 余数为0代表女性,不为0代表男性
info.sex = (order % 2 === 0 ? 0 : 1);
return info;
}
<template>
<fragment>
<H1 class="flex-row flex-center">
This is Demo Page
</H1>
<div class="flex-row flex-center">
store.count: {{ count }}
</div>
<div class="flex-column flex-center">
<button @click="add()">
新增count
</button>
<button @click="listRelatives()">
调用post请求
</button>
<button @click="list()">
调用get请求
</button>
<button @click="request()">
实例调用请求
</button>
<button @click="getStatusBarHeight()">
获取原生头高度
</button>
<button @click="startRecord()">
开始录音
</button>
<button @click="stopRecord()">
结束录音
</button>
</div>
</fragment>
</template>
<script>
import { getCoopTop } from '@/api/storke.js';
import { mapMutations } from 'vuex';
import { listRelatives, list } from '@/api/home';
export default {
name: 'Home',
computed: {
count () {
return this.$store.state.home.count;
}
},
data(){
return {
token:"F65FDAEE03F34EA78490050B8A83BF95"
}
},
mounted () {
getCoopTop({id:4,token:this.token}).then((res)=>{
console.log(res);
if(res && res.data){
this.infoLists = res.data.texts; // 简介(文案)组件
this.sliderLists = res.data.carousels; // 轮播图组件
this.projectName = res.data.projectName; // 项目名称
this.projectName = this.getLength(this.projectName, 8);
}else{
this.$toast(res.message);
}
});
console.log(this.$route.meta); // {requiresAuth: true}
},
methods: {
...mapMutations('home', ['add']),
listRelatives,
list,
async request () {
await this.$get('/demo', { q: 1 });
},
getStatusBarHeight() {
console.log(this.$appInterface.getStatusBarHeight());
},
startRecord () {
this.$appInterface.chooseRecorder({
type: 'start'
});
console.log('开始录音');
},
async stopRecord () {
const result = await this.$appInterface.chooseRecorder({
type: 'end'
});
console.log(result.file, result.duration);
}
}
};
</script>
<style>
/* .van-toast {display:none;} */
</style>
该目录下放置需要路由的页面
> 如开启自动创建路由配置,则会自动把该目录的vue文件自动配置到routers。
#### 以__(两个下划线,例如__foo __.vue)开头和结尾的目录和文件将被忽略。
例如:
```
views/
├── __partial__.vue
├── index.vue
├── users.vue
└── users/
└── _id.vue
```
自动生成路由:
```js
export default [
{
name: 'index',
path: '/',
component: () => import('@/views/index.vue')
},
{
name: 'users',
path: '/users',
component: () => import('@/views/users.vue'),
children: [
{
name: 'users-id',
path: ':id?',
component: () => import('@/views/users/_id.vue')
}
]
}
]
```
如果路由页面采用分文件方式:template 为.vue文件,scss为样式等:
```
views/
└── users/
└── index.vue
```
自动生成路由:
```js
export default [
{
name: 'users',
path: '/users',
component: () => import('@/views/users/index.vue')
}
]
```
如果要使路由参数为必须,则创建一个该参数的目录,然后在该目录中添加`index.vue`。 在上面的示例中,如果将`users/_id.vue`替换为`users/_id/index.vue`,则需要:`id`参数。
### <route> 自定义标签块
如果页面组件有<route>自定义标签块,则该标签内的内容json将与route config合并。
例如,如果index.vue具有以下<route>块:
```vue
<route>
{
"name": "home",
"meta": {
"requiresAuth": true
}
}
</route>
<template>
<h1>Hello</h1>
</template>
```
生成的路由配置如下:
```js
module.exports = [
{
name: 'home',
path: '/',
component: () => import('@/views/index.vue'),
meta: {
requiresAuth: true
}
}
]
```
<template>
<list>
<cell>
<div class="head-fixed">
<div class="head-bg" :style="{backgroundColor: headBg, height: headHeight + 'px'}"></div>
<div class="head wrap" :style="{paddingTop: (70 - headHeight) + 'px'}">
<img @click="back" src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png" style="width: 50px; height: 50px;"/>
<text class="title">错题集</text>
<text class="empty"></text>
</div>
</div>
<div class="img-wrap">
<img src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/icon_report_grey.png" style="width: 106px; height: 130px;"/>
</div>
<div class="result-wrap">
<div style="font-size: 32px;">正确题目数 :{{rightNum}}</div>
<div style="padding-left: 30px;font-size: 32px;">错误题目数 :</div>
<div style="color: #d84a38;font-size: 32px;">{{wrongNum}}</div>
</div>
<div style="padding: 0 30px">
<div class="separator"></div>
</div>
<div class="info">
<div style="font-size: 40px; padding-bottom: 40px; padding-top: 20px;">试题分析</div>
<div class="detail" v-for="(wrong,index) in wrongList" :key="index">
<div class="question-index">{{wrong.seqNo}}题:</div>
<div class="question-title">{{wrong.question}}</div>
<div class="answer" style="color: #d84a38;">您的答案:{{wrong.answer}}</div>
<div class="answer" style="color: #35CBCA;">正确答案:{{wrong.correctAnswer}}</div>
</div>
</div>
<!-- <wxc-loading :show="showLoading"></wxc-loading> -->
</cell>
</list>
</template>
<style scoped>
.info {
padding: 20px 30px;
}
.detail {
position: relative;
/*padding-left: 30px;*/
padding-bottom: 15px;
}
.question-index {
position: absolute;
top: 0px;
left: 20px;
font-weight: 600;
font-size: 32px;
}
.answer {
font-size: 32px;
line-height: 50px;
font-weight: 600;
padding-left: 150px;
}
.question-title {
font-size: 32px;
font-weight: 600;
padding-bottom: 10px;
padding-left: 150px;
/*text-indent: -150px;*/
}
.result-wrap {
flex-direction: row;
justify-content: center;
padding: 60px 0 100px;
}
.separator {
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #dddddd;
}
.empty {
width: 50px;
height: 3px;
}
.img-wrap {
flex-direction: row;
justify-content: center;
padding-top: 220px;
}
.head-fixed {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
background-color: white;
z-index: 999;
}
.head {
flex-direction: row;
justify-content: space-between;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #e7e7e7;
}
.wrap {
padding: 70px 30px 20px 20px;
}
.title {
font-size: 38px;
/*font-weight: 600;*/
color: #333333;
}
</style>
<script>
// import { WxcLoading } from 'weex-ui'
// import WxcLoading from '../../components/wxc-loading'
//let modal = weex.requireModule('modal')
//import WxcLoading from '../../components/wxc-loading'
import { getCoopExamWrongRecords} from '@/api/exam.js';
export default {
//components: { WxcLoading },
data: () => ({
showLoading: false,
wrongList: [],
rightNum: '',
wrongNum: '',
headBg: '#ffffff',
headHeight: 0,
token:"E47F468E0BB34ED9ABD38DC16A95CAC2"
}),
computed: {
},
created () {
if(this.isAndroid) {
this.headBg = '#999999'
}
this.init()
},
methods: {
init() {
this.showLoading = true;
let para = {
answerResultId: this.$route.query.answerResultId,
type: 5,
token:this.token
};
getCoopExamWrongRecords(para).catch(res=>{
this.showLoading = false
let data = res.data;
if(data.respCode == 200) {
this.wrongList = data.wrongList
this.rightNum = data.correctNo
this.wrongNum = data.wrongNo
} else {
this.$toast(data.respMsg);
}
})
// this.GET('app/projectExam/wrongs', para, res => {
// this.showLoading = false
// let data = res.data;
// if(data.respCode == 200) {
// this.wrongList = data.wrongList
// this.rightNum = data.correctNo
// this.wrongNum = data.wrongNo
// } else {
// this.$toast(data.respMsg);
// }
// })
},
back() {
this.$router.go(-1)
}
}
}
</script>
\ No newline at end of file
<template>
<list>
<cell>
<div class="head-fixed">
<div class="head-bg" :style="{backgroundColor: headBg, height: headHeight + 'px'}"></div>
<div class="head wrap" :style="{paddingTop: (70 - headHeight) + 'px'}">
<div @click="giveUp" class="back-wrap">
<img src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png" style="width: 50px; height: 50px;"/>
<div class="back-txt">放弃考试</div>
</div>
<text class="empty"></text>
<div class="time-left">
<div class="time-label">剩余时间 </div>
<van-count-down :time="TIME" format="mm:ss">
<template #default="timeData">
<!-- <span class="block">{{ timeData.hours }}</span>
<span class="colon">:</span> -->
<span class="block">{{ timeData.minutes }}</span>
<span class="colon">:</span>
<span class="block">{{ timeData.seconds }}</span>
</template>
</van-count-down>
<!-- <wxc-countdown v-if="isInitFinished" tpl="{m}:{s}" :time="TIME" class="time" @wxcOnComplete="timeout"
:timeBoxStyle="{backgroundColor: '#ffffff', width: '50px', height: '50px', paddingBottom: '10px'}"
:timeTextStyle="{fontSize: '38px', color: 'rgb(51,51,51)'}"
:dotTextStyle="{color: 'rgb(51,51,51)', fontSize: '38px', fontWeight: '400'}"
:dotBoxStyle="{width: '35px', paddingBottom: '10px'}">
</wxc-countdown> 111-->
</div>
</div>
</div>
<div class="questions-wrap">
<div class="question" v-for="(item, index) in questions" :ref="'question_' + index" :key="index">
<div class="description">{{index + 1}}:{{item.name}}</div>
<pica-radio :list="item.answerList" @wxcRadioListChecked="select"></pica-radio>
</div>
</div>
<div class="submit-wrap">
<div class="select-status">
<div class="status-label">已答题:</div>
<div class="status-value">{{selectedCount}}/{{questions.length}}</div>
</div>
<!-- <wxc-button :btnStyle="submitBtnStyle" :text="isSubmitting ? '提交中' : '提交'"
@wxcButtonClicked="submitQuery"></wxc-button> 111-->
</div>
<!-- <wxc-dialog confirm-text="提交考卷"
cancel-text="再想一下"
:show="showSubmitConfirm"
main-btn-color="#2ab9a5"
@wxcDialogCancelBtnClicked="hideSubmitConfirm"
@wxcDialogConfirmBtnClicked="submitConfirm">
<text slot="title" class="content-title">确定提交考卷</text>
<text slot="content" class="content-subtext">一旦提交后,将无法修改答题内容</text>
</wxc-dialog>
<wxc-dialog confirm-text="确定"
:show="showTimeoutConfirm"
main-btn-color="#2ab9a5"
:single="true"
@wxcDialogConfirmBtnClicked="timeoutConfirm">
<text slot="title" class="content-title">提醒</text>
<text slot="content" class="content-subtext">您已超过限定答题时间,已帮您自动交卷</text>
</wxc-dialog>
<wxc-dialog confirm-text="继续考试"
cancel-text="放弃"
:show="showGiveUpConfirm"
main-btn-color="#2ab9a5"
@wxcDialogCancelBtnClicked="hideGiveUpConfirm"
@wxcDialogConfirmBtnClicked="giveUpConfirm">
<text slot="title" class="content-title">提醒</text>
<text slot="content" class="content-subtext cont-center">确认要放弃本次考试吗?</text>
</wxc-dialog>
<wxc-dialog confirm-text="确定"
:show="showUnFinishedTip"
main-btn-color="#2ab9a5"
:single="true"
@wxcDialogConfirmBtnClicked="unFinishedConfirm">
<text slot="title" class="content-title">提醒</text>
<text slot="content" class="content-subtext">第{{firstUnselectedIndex}}题尚未做答,请回答所有题目后再提交</text>
</wxc-dialog>
<wxc-loading :show="showLoading"></wxc-loading> -->
</cell>
</list>
</template>
<style scoped>
.status-label {
font-size: 32px;
color: rgb(102, 102, 102);
line-height: 88px;
}
.status-value {
font-size: 32px;
color: rgb(42, 185, 165);
line-height: 88px;
}
.select-status {
flex-direction: row;
padding-right: 80px;
}
.back-wrap {
flex-direction: row;
}
.question {
padding: 0 30px 30px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: rgb(240, 240, 240);
}
.description {
font-weight: 600;
font-size: 32px;
color: #333333;
line-height: 50px;
padding: 40px 0 15px 0;
}
.questions-wrap {
padding: 140px 0px 87px;
background-color: white;
}
.time-label{
font-size: 38px;
color: rgb(51,51,51);
line-height: 44px;
}
.back-txt {
font-size: 34px;
color: rgb(102,102,102);
height: 50px;
line-height: 50px;
}
.time {
color: #666666;
}
.time-left {
flex-direction: row;
}
.empty {
width: 50px;
height: 3px;
}
.content-title {
color: #333333;
font-size: 36px;
text-align: center;
margin-bottom: 35px;
font-weight: 600;
}
.content-subtext {
color: #666666;
font-size: 34px;
line-height: 50px;
text-align: left;
}
.cont-center {
text-align: center;
}
.head-fixed {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
background-color: #ffffff;
z-index: 999;
}
.submit-wrap {
flex-direction: row;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
background-color: white;
z-index: 999;
justify-content: flex-end;
border-top-style: solid;
border-top-width: 1px;
border-top-color: rgba(240, 240, 240, 1);
}
.head {
flex-direction: row;
justify-content: space-between;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #e7e7e7;
}
.wrap {
padding: 70px 30px 20px 30px;
}
</style>
<script>
//import { WxcButton, WxcMinibar, WxcCountdown } from 'weex-ui'
// import WxcLoading from '../../components/wxc-loading'
import PicaRadio from '@/components/pica-radio'
// import WxcDialog from '../../components/wxc-dialog'
// import {click_submit_test,click_cancel_test} from '../../util/buryingPoint'
// let modal = weex.requireModule('modal')
//let navigator = weex.requireModule('navigator')
// const storage = weex.requireModule('storage')
// const dom = weex.requireModule('dom')
import { getCoopExamQuest} from '@/api/exam.js';
export default {
components: {
PicaRadio
// WxcButton, WxcDialog, WxcLoading, WxcMinibar,
// PicaRadio, WxcCountdown
},
data() {
return{
selected: {},
selectedCount: 0,
showLoading: true,
showSubmitConfirm: false,
questions: [],
TIME: '',
showTimeoutConfirm: false,
showUnFinishedTip: false,
showGiveUpConfirm: false,
firstUnselectedIndex: '',
isInitFinished: false,
examTime: 0,
headBg: '#ffffff',
headHeight: 0,
startNum: -1,
isSubmitting: false,
submitBtnStyle: {
width: '230px',
fontSize: '40px',
borderRadius: 0,
backgroundColor: '#58b5a8',
},
token:"E47F468E0BB34ED9ABD38DC16A95CAC2"
}
},
computed: {
},
created () {
// if(this.isAndroid) {
// this.headBg = '#999999'
// weex.requireModule('eventModule').getStatusBarSize(res => {
// this.headHeight = parseInt(res.height)/1.5
// })
// }
this.startNum = this.$route.query.startNum || -1
this.init()
// weex.requireModule('globalEvent').addEventListener("goPreviousPage", e=> {//监听物理返回上一页
// this.back()
// });
},
methods: {
isAllSelected() {
return this.selectedCount && this.questions.length == this.selectedCount
},
getCorrectId(list) {
for(var i = 0, len = list.length; i < len; i++) {
if(list[i].type == 1) {
return list[i].id
}
}
},
format(questions) {
questions.forEach( (question, i) => {
let choices = ['a', 'b', 'c', 'd']
let correctId = this.getCorrectId(question.answerList)
question.answerList.forEach( (answer, j) => {
answer.title = choices[j].toUpperCase() + '. ' + answer.answer
answer.value = choices[j].toUpperCase()
answer.index = i
answer.seqNo = i + 1
answer.correctId = correctId
answer.questionType = question.type
answer.answerId = answer.id
})
})
return questions
},
init() {
let para = {
'examId': this.$route.query.examId,
'type': 5,
'token':this.token
};
getCoopExamQuest(para).catch(res=>{
this.showLoading = false
let data = res.data;
if(data.respCode == 200) {
this.isInitFinished = true
this.questions = this.format(data.questionList)
this.examTime = data.examTime*1000
this.TIME = new Date().getTime() + this.examTime
console.log(this.TIME,"----000-----");
} else {
this.$toast(data.respMsg);
}
})
// this.GET('app/projectExam/questions', para, res => {
// this.showLoading = false
// let data = res.data
// if(data.respCode == 200) {
// this.isInitFinished = true
// this.questions = this.format(data.questionList)
// this.examTime = data.examTime*1000
// this.TIME = new Date().getTime() + this.examTime
// } else {
// this.toast({
// message: data.respMsg
// })
// }
// })
},
back() {
weex.requireModule('eventModule').backPreviousPage({})
},
getUnselected() {
let result = []
let selected = this.selected
this.questions.forEach( (question, i) => {
if(!selected[i]) {
result.push({
questionId: question.id,
correctId: question.answerList[0].correctId,
answerId: 0,
questionType: question.type,
seqNo: question.answerList[0].seqNo,
type: 2
})
}
})
return result
},
getAnswerTime() {
let surplusTime = this.TIME - new Date().getTime()
return surplusTime > 0 ? Math.floor((this.examTime - surplusTime)/1000) : this.examTime/1000
},
submit() {
let para = {
answerTime: this.getAnswerTime(),
examId: this.$route.query.examId,
type: 5
//examId: this.getUrlSearch(weex.config.bundleUrl, 'examId') || 1
}
let resultList = []
Object.keys(this.selected).forEach( attr => {
resultList.push(this.selected[attr])
})
if(this.selected.length != this.questions.length) {
resultList = resultList.concat(this.getUnselected())
}
para.resultList = resultList
this.showLoading = true
this.isSubmitting = true
this.POST('app/projectExam/apply', para, res => {
this.showLoading = false
this.isSubmitting = false
let data = res.data
if(data.respCode == 200) {
let query = {
examId: this.$route.query.examId,
answerResultId: data.answerResultId,
// origin: 'end',
from: 'exam'
}
if (this.startNum >0){
Vue.set(query, "endNum", this.startNum - 1)
}
this.$router.push({
path:'/exam_result',
query: query
})
} else {
modal.alert({
message: data.respMsg
})
}
})
},
submitQuery() {
if(this.isSubmitting) {
return
}
if(this.isAllSelected()) {
this.showSubmitConfirm = true
} else {
this.showUnFinishedTip = true
this.firstUnselectedIndex = this.getFirstUnselected()
}
},
getFirstUnselected() {
let count = this.questions.length
let selectedIndexs = Object.keys(this.selected)
for(var i = 0; i < count; i++) {
if(selectedIndexs.indexOf(i + '') == -1) {
return i + 1
}
}
},
unFinishedConfirm() {
this.showUnFinishedTip = false
const el = this.$refs['question_' + (this.firstUnselectedIndex - 1)][0]
//dom.scrollToElement(el, { offset: -140, animated: false })
},
submitConfirm() {
// this.appBuryingPointEntrust({
// ...click_submit_test,
// createdTime: new Date().getTime()
// })
this.showSubmitConfirm = false
this.submit()
},
hideSubmitConfirm() {
// this.appBuryingPointEntrust({
// ...click_cancel_test,
// createdTime: new Date().getTime()
// })
this.showSubmitConfirm = false
},
select(obj) {
let item = obj.item
this.selected[item.index] = item
this.selectedCount = Object.keys(this.selected).length
},
timeout() {
if(!this.showSubmitConfirm) {
this.showTimeoutConfirm = true
}
},
timeoutConfirm() {
this.showTimeoutConfirm = false
this.submit()
},
giveUp() {
if(this.isSubmitting) {
return
}
this.showGiveUpConfirm = true
},
hideGiveUpConfirm() {
this.showGiveUpConfirm = false
this.back()
},
giveUpConfirm() {
this.showGiveUpConfirm = false
}
},
destoryed: function() {
}
}
</script>
\ No newline at end of file
<template>
<!-- <scroller show-scrollbar="false" style="background-color: white;"> -->
<div>
<div class="body_background">
<pica-header @goBack="goBack" :type="type" :showHeader="showHeader"></pica-header>
<exam-info :exam="exam" :type="type" @reExamStart="reExamStart" :startNum="startNum" :endNum="endNum" :examType="examType" v-bind:hasWrong="hasWrong"></exam-info>
<exam-history :showHeaderH="showHeaderH" :historyList="historyList" :examId="examId" :exam="exam"></exam-history>
</div>
</div>
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- </scroller> -->
</template>
<style scoped>
.body_background{
background-color: #f5f5f5;
padding-top:120px;
}
</style>
<script>
import examInfo from '@/components/stroke/examInfo'
import examHistory from '@/components/stroke/examHistory'
import picaHeader from '@/components/stroke/picaHeader'
import { getCoopExam ,getCoopExamResultNew,getCoopExamResultNews} from '@/api/exam.js';
//import WxcLoading from '../../components/wxc-loading'
//let configurationModule = weex.requireModule('configurationModule')
//let modal = weex.requireModule('modal')
export default {
data: () => ({
answerResultId: '',
id: '',
examId: '',
isPassExam: false,
showHeader: true,
showHeaderH: true, //历史记录的header
exam:{},//考试基本信息
historyList:[],
type: 2, //2 考试开始, 0 考试失败, 1 考试成功
source: '',
startNum: -1,
endNum: -1,
isShow: false,
from: '',
testMsg: '',
examType: 'common',
hasWrong:false,
token:"E47F468E0BB34ED9ABD38DC16A95CAC2"
}),
computed: {},
components:{
examInfo,
examHistory,picaHeader,
//WxcLoading
},
created () {
this.examId = this.$route.query.examId
this.from = this.$route.query.from
this.showHeader = this.from != 'exam'
this.answerResultId = this.$route.query.answerResultId || 0
let startNum = this.$route.query.startNum
let endNum = this.$route.query.endNum
this.startNum = startNum >= 0 ? startNum : -1
this.endNum = endNum >= 0 ? endNum : -1
},
mounted(){
this.init()
},
methods: {
init(){
this.isShow = true
this.hasWrong = false;
if (this.from !== "exam" && !(this.answerResultId > 0)){//开始页面
this.type = 2
getCoopExam({"examId":this.examId, "type": 5,token:this.token}).catch(res=>{
if (res.data && res.data.respCode == 200){
this.exam = res.data.examBaseInfo
}else {
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
})
}else{//结果页面
this.hasWrong = false;
getCoopExamResultNew({answerResultId:this.answerResultId, type: 5,token:this.token}).catch(res=>{
if (res.data && res.data.respCode == 200){
// weex.requireModule('CourseModule').finishTest(res.data)
this.exam = res.data.answerResult
this.type = this.exam.passFlag == 5 ? 1 : 0
}else {
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
});
// this.GET('app/projectExam/result',{answerResultId:this.answerResultId, type: 5},res=>{
// if (res.data && res.data.respCode == 200){
// weex.requireModule('CourseModule').finishTest(res.data)
// this.exam = res.data.answerResult
// this.type = this.exam.passFlag == 5 ? 1 : 0
// }else {
// this.hasWrong = true;
// modal.toast({
// message: res.data.respMsg,
// duration: 1.0
// })
// }
// })
}
this.hasWrong = false;
getCoopExamResultNews({examId:this.examId,pageNo:1,pageSize:3, type: 5,token:this.token}).catch(res=>{
this.isShow = false
if (res.data && res.data.respCode == 200){
this.historyList = res.data.examRecordList
this.historyList.map(res=>{
res.createdTime = res.createdTime.substring(0,10)
})
}else {
this.hasWrong = true;
modal.toast({
message: res.data.respMsg,
duration: 1.0
})
}
})
// this.GET('app/projectExam/results',{examId:this.examId,pageNo:1,pageSize:3, type: 5},res=>{
// this.isShow = false
// if (res.data && res.data.respCode == 200){
// this.historyList = res.data.examRecordList
// this.historyList.map(res=>{
// res.createdTime = res.createdTime.substring(0,10)
// })
// }else {
// this.hasWrong = true;
// modal.toast({
// message: res.data.respMsg,
// duration: 1.0
// })
// }
// })
},
goBack(){
this.$router.go(-1);
},
reExamStart(){
this.from = "start"
this.type = 2
this.showHeader = true
if (this.endNum > 0){
this.startNum = this.endNum
}
this.answerResultId = -1
this.init()
}
}
}
</script>
\ No newline at end of file
// import WxcDialog from '../components/wxc-dialog'
// import strokeSlot from '../components/business/strokeSlot'
//import examHistory from '../components/stroke/examHistory';
//import main from '../components/stroke/main';
// import picaCommon from '../util/picaCommon'
// import WxcLoading from '../components/wxc-loading'
// import livesExamHistory from "../components/stroke/livesExamHistory";
//import WxcDialog from '../components/wxc-dialog';
// let modal = weex.requireModule('modal')
// let configurationModule = weex.requireModule('configurationModule')
// let globalEvent = weex.requireModule('globalEvent')
// let storage = weex.requireModule('storage')
//import WxcDialog from '../components/wxc-dialog'
import componentMain from '@/components/stroke/componentMain';
import CommonHeader from '@/components/common/header';
import livesExamHistory from "@/components/stroke/livesExamHistory";
import { getCoopTop, getCoopBottom, getCoopMiddle, getCoopLiveExam, getCoopOrder } from '@/api/storke.js';
import { getCoopExamResult } from '@/api/exam.js';
export default {
components: {
componentMain,
CommonHeader,
livesExamHistory
},
data() {
return{
keyIndex:0,
showExamFinishedTip: false,
showReInputTip: false,
showExamNotStartTip: false,
code1: '',
code2: '',
code3: '',
code4: '',
code5: '',
code6: '',
showCodeInputDialog: false,
showHeaderH: true,
showHeader:false,
y:0,
slots:[],
projectId: 2, // 项目id
infoMsg: '', // 项目介绍
infoLists: [], // 文案组件
info: {
message: '',
seq_no: 2,
module_type: 5
},
sliderLists: [], // 项目轮播图
courseLists: [], // 相关课程列表
projectName: '', // 项目名称
orderList: [], // 组件顺序
examLists: [], // 考试组件数组
livesExamLists: [], // 现场考试
hasAuth: false, // 是否有权限操作考试组件
allComponentLists:[], // 所有组件列表
pLiveMapping:{}, // 现场考试组件内容
isShow: false,
isIOS: true,
codeBtn: {
height: '45px',
backgroundColor: 'rgba(106, 159, 233, 0.1)',
borderRadius: '30px',
margin:"0 auto",
width: '200px'
},
codeTextStyle: {
color: 'rgb(106, 159, 233)',
fontSize: '32px'
},
codeTextStyleNo: {
color: '#999999',
fontSize: '32px'
},
localHistoryList: [],
livesList:{
examId: '',
examResultId: '',
endDate: ''
},
timesFull: false,
refreshing: false,
needMarginBottom: false,
marginBottom: '0px',
parms:{
id: 4, token: "5CAB7524887647E983660A0F61EE219D"
},
flagLoading:0,
title:"",
bgColor: 'rgba(255,255,255,0)',
isFixHeader: true,
orderListFlag:false
};
},
watch:{
keyIndex(newval) {
this.keyIndex = newval;
},
},
created () {
// modal.alert({message: 22})
// uat下id用18、test用21!!!!!!!
this.allowFlag = this.$route.query.allowFlag || 1;
this.projectId = this.$route.query.projectId || 2;
this.parms.id = this.projectId;
this.init();
},
mounted() {
// globalEvent.addEventListener("dataOkForExam",() => {
// // modal.alert({message: 'dataOkForExam'})
// storage.getItem("keyIndex",(e)=>{
// if (this.$refs["mainCp"] && this.$refs["mainCp"][Number(e.data)]){
// this.$refs["mainCp"][Number(e.data)].setExamData()
// }
// });
// }) ///
window.addEventListener('scroll', this.scrollToTop)
},
beforeDestroy() {
// modal.alert({message: 'i am in destroyed'})
},
methods: {
scrollToTop() {
var scrollTop = window.pageYOffset || document.documentElement. scrollTop || document.body.scrollTop;
if (scrollTop > 83) {
this.bgColor = "#fff";
this.title = this.projectName;
} else if(scrollTop<83){
this.bgColor = "rgba(255,255,255,0)";
this.title=""
}
},
getCurrentIndex(key) {
this.keyIndex = key;
},
finishedConfirm() {
this.showExamFinishedTip = false;
},
hideReInput() {
this.showReInputTip = false;
},
reInputConfirm() {
this.hideReInput();
this.showCodeInputDialog = true;
this.$nextTick(() => {
this.$refs['code1'].focus();
});
},
notStartConfirm() {
this.showExamNotStartTip = false;
},
timesFullConfirm() {
this.timesFull = false;
},
clearCode() {
this.code1 = '';
this.code2 = '';
this.code3 = '';
this.code4 = '';
this.code5 = '';
this.code6 = '';
},
checkCodeInputFinished() {
var code;
if(this.code1 && this.code2 && this.code3 && this.code4 && this.code5 && this.code6) {
code = '' + this.code1 + this.code2 + this.code3 + this.code4 + this.code5 + this.code6;
this.clearCode();
this.showCodeInputDialog = false;
this.isShow = true;
getCoopExamResult({ 'examCode': code }).catch(res => {
if (res.data) {
if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}
this.isShow = false;
var result = res.data.checkResult;
let flag = result.resultFlag;
if(flag == 1) {
this.$router.push({
path:'/exam_result', query:{'examId': result.examId, 'origin': 'start', 'examType': 'local', 'endDate': result.endDate}
});
} else if(flag == 5) {
this.showExamNotStartTip = true;
this.noExamStart("考试未开始");
} else if(flag == 10 || flag == 20) {
this.showExamFinishedTip = true;
this.noExamStart("考试已结束");
} else if(flag == 15) {
this.showReInputTip = true;
this.resetExamCodeEnter()
}else if(flag == 30) {
this.timesFull = true;
this.noExamStart("考试次数已用完");
}
}
})
// this.GET('app/exam/lives/check', {examCode: code}, (res) => {
// this.isShow = false;
// var result = res.data.checkResult,
// flag = result.resultFlag;
// if(flag == 1) {
// this.$router.push({
// path:'/exam_result', query:{examId: result.examId, origin: 'start', examType: 'local', endDate: result.endDate}
// });
// } else if(flag == 5) {
// this.showExamNotStartTip = true;
// } else if(flag == 10 || flag == 20) {
// this.showExamFinishedTip = true;
// } else if(flag == 15) {
// this.showReInputTip = true;
// }else if(flag == 30) {
// this.timesFull = true;
// }
// });
}
},
noExamStart(message) {
this.$dialog.alert({
title: '',
message: message,
confirmButtonText:"我知道了"
}).then(() => {
// on close
});
},
resetExamCodeEnter() {
this.$dialog
.confirm({
title: '提醒',
message: this.setContent,
cancelButtonText: '取消',
confirmButtonText: '重新输入',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.reInputConfirm();
})
.catch(() => {
this.wxcDialogCancelBtnClicked();
});
},
codeChange(val, nextInput) {
if(val && nextInput) {
this.$refs[nextInput].focus();
}
this.checkCodeInputFinished();
},
seeMoreHistory() {
this.$router.push({
path:'/local_exam_history', query:{projectId: this.projectId}
});
},
codeBtnClicked() {
if(this.allowFlag == 0) {
return;
}
this.showCodeInputDialog = true;
this.$nextTick(() => {
this.$refs['code1'].focus();
});
},
getLength(str, num) {
if (str != null && str.length > num) {
str = str.substr(0, num) + '...';
}
return str;
},
init() {
// modal.alert({message: this.projectId})
// modal.alert({message: this.allComponentLists})
this.getTop();
this.getBottom();
this.getMiddle();
this.getLiveExam();
// this.getOrder();
},
getTop() {
this.isShow = true;
const _self = this;
//得到顶部的方法
getCoopTop(this.parms).catch((res) => {
if (res && res.data) {
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
this.infoLists = res.data.texts; // 简介(文案)组件
this.sliderLists = res.data.carousels; // 轮播图组件
this.projectName = res.data.projectName; // 项目名称
//this.projectName = this.getLength(this.projectName, 8);
}else{
this.$toast("网络异常,请稍后再试");
}
})
},
getBottom() {
getCoopBottom(this.parms).catch((res) => {
if (res && res.data) {
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
this.courseLists = res.data.courses;
if (this.courseLists && this.courseLists.length) {
this.courseLists.sort(function(a, b) {
return a.seq_no - b.seq_no;
});
}
this.courseLists = this.courseLists.concat([]);
} else {
this.$toast("网络异常,请稍后再试");
}
})
},
getMiddle() {
getCoopMiddle(this.parms).catch((res) => {
this.isShow = false;
if (res && res.data) {
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
this.examLists = res.data.moduleTypeExams;
if (this.examLists && this.examLists.length) {
this.examLists.sort(function(a, b) {
return a.seq_no - b.seq_no;
});
this.examLists.forEach(function (item) {
item.allLists = item.examModuleList;
if (item.courseList) {
const arr = item.courseList;
arr.forEach(function (course) {
const exam_id = course.exam_id;
for (let k = 0; k < item.allLists.length; k++) {
if (exam_id == item.allLists[k].exam_id) {
item.allLists.splice(k, 0, course);
break;
}
}
});
}
});
this.examLists = this.examLists.concat([]);
}else {
this.examLists = [];
}
} else {
this.$toast("网络异常,请稍后再试")
}
})
// const _self = this;
// this.GET('contents/projects/middle', {id: this.projectId}, function (res) {
// _self.isShow = false;
// if (res && res.data) {
// _self.examLists = res.data.moduleTypeExams;
// if (_self.examLists && _self.examLists.length) {
// _self.examLists.sort(function(a, b) {
// return a.seq_no - b.seq_no;
// });
// _self.examLists.forEach(function (item) {
// item.allLists = item.examModuleList;
// if (item.courseList) {
// const arr = item.courseList;
// arr.forEach(function (course) {
// const exam_id = course.exam_id;
// for (let k = 0; k < item.allLists.length; k++) {
// if (exam_id == item.allLists[k].exam_id) {
// item.allLists.splice(k, 0, course);
// break;
// }
// }
// });
// }
// });
// _self.examLists = _self.examLists.concat([]);
// }else {
// _self.examLists = [];
// }
// }else{
// modal.toast({
// message: '网络异常,请稍后再试',
// duration: 1.0
// });
// }
// _self.getLiveExam();
// });
},
getLiveExam() {
const _self = this;
getCoopLiveExam(this.parms).catch((res) => {
if (res && res.data) {
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
console.log(111,res.data.pLiveMapping)
this.pLiveMapping = res.data.pLiveMapping;
if (res.data.pLiveExamList && res.data.pLiveExamList.length) {
this.localHistoryList = res.data.pLiveExamList;
//_self.localHistoryList = _self.localHistoryList.concat([]);
}
} else {
this.$toast("网络异常,请稍后再试");
}
this.getOrder();
});
// this.GET('contents/projects/live/' + this.projectId, {}, function (res) {
// // _self.isShow = false
// if (res && res.data) {
// _self.pLiveMapping = res.data.pLiveMapping;
// if (res.data.pLiveExamList && res.data.pLiveExamList.length) {
// _self.localHistoryList = res.data.pLiveExamList;
// _self.localHistoryList.forEach(function (item) {
// });
// _self.localHistoryList = _self.localHistoryList.concat([]);
// }else {
// _self.localHistoryList = [];
// }
// }else{
// modal.toast({
// message: '网络异常,请稍后再试',
// duration: 1.0
// });
// }
// _self.getOrder();
// });
},
getOrder() {
//const _self = this;
getCoopOrder(this.parms).catch((res) => {
if (res && res.data) {
// 组件type
// module_type:1、轮播图组件 5、文案组件 10、考试组件 15、关联课程组件 20、链接组件 25、现场考试组件
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
this.orderList = res.data.projectList;
this.orderListFlag = this.orderList.some(item => {
return item.module_type == 25
})
if (res.data.respCode != 200) {
return this.$toast(res.data.respMsg);
}
const arr = [{ slot: 'type_1' }, { slot: 'type_2' }, { slot: 'type_3' }, { slot: 'type_4' }, { slot: 'type_5' }];
this.slots.length = this.orderList.length;
for(let i = 0; i < this.orderList.length; i++) {
const number = this.orderList[i].module_type;
switch (number) {
case 1:
this.slots[i] = arr[0];
break;
case 5:
this.slots[i] = arr[1];
break;
case 10:
this.slots[i] = arr[2];
break;
case 15:
this.slots[i] = arr[3];
break;
case 25:
this.slots[i] = arr[4];
break;
}
}
this.slots = this.slots.concat([]);
this.allComponentLists = [];
this.sliderLists.forEach( (item)=> {
this.allComponentLists.push(item);
});
this.infoLists.forEach((item)=> {
this.allComponentLists.push(item);
});
this.courseLists.forEach((item)=> {
this.allComponentLists.push(item);
});
this.examLists.forEach((item)=> {
this.allComponentLists.push(item);
});
this.livesExamLists.forEach((item)=> {
this.allComponentLists.push(item);
});
this.allComponentLists.sort((a,b)=> {
return a.seq_no - b.seq_no;
});
this.allComponentLists = this.allComponentLists.concat([]);// Object.assign([],)
} else {
this.$toast("网络异常,请稍后再试");
}
});
// this.GET('contents/projects/' + this.projectId, {}, function (res) {
// if (res && res.data) {
// // 组件type
// // module_type:1、轮播图组件 5、文案组件 10、考试组件 15、关联课程组件 20、链接组件 25、现场考试组件
// _self.orderList = res.data.projectList;
// if (res.data.respCode != 200) {
// modal.toast({
// message: res.data.respMsg,
// duration: 1.0
// });
// return;
// }
// const arr = [{slot:'type_1'}, {slot:'type_2'}, {slot:'type_3'}, {slot:'type_4'}, {slot:'type_5'}];
// _self.slots.length = _self.orderList.length;
// for(let i = 0; i < _self.orderList.length; i++) {
// const number = _self.orderList[i].module_type;
// switch (number) {
// case 1:
// _self.slots[i] = arr[0];
// break;
// case 5:
// _self.slots[i] = arr[1];
// break;
// case 10:
// _self.slots[i] = arr[2];
// break;
// case 15:
// _self.slots[i] = arr[3];
// break;
// case 25:
// _self.slots[i] = arr[4];
// break;
// }
// }
// _self.slots = _self.slots.concat([]);
// _self.allComponentLists = [];
// console.log('===>', _self.slots);
// _self.sliderLists.forEach(function (item) {
// _self.allComponentLists.push(item);
// });
// _self.infoLists.forEach(function (item) {
// _self.allComponentLists.push(item);
// });
// _self.courseLists.forEach(function (item) {
// _self.allComponentLists.push(item);
// });
// _self.examLists.forEach(function (item) {
// _self.allComponentLists.push(item);
// });
// _self.livesExamLists.forEach(function (item) {
// _self.allComponentLists.push(item);
// });
// _self.allComponentLists.sort(function (a, b) {
// return a.seq_no - b.seq_no;
// });
// _self.allComponentLists = _self.allComponentLists.concat([]);// Object.assign([],)
// console.log('allComponentLists', _self.allComponentLists);
// if(_self.orderList.length == 5) {
// }
// }else{
// modal.toast({
// message: '网络异常,请稍后再试',
// duration: 1.0
// });
// }
// });
},
taggleSlot() {
if(this.slot == 'title') {
this.slot = 'content';
}else{
this.slot == 'title';
}
},
scroll(event) {
const y = parseInt(event.contentOffset.y);
if(y < -50) {// 去认证被遮住
this.showHeader = true;
}else{
this.showHeader = false;
}
},
openDialog () {
this.show = true;
},
goBack() {
// storage.setItem('needFlash', 'true');
//configurationModule.goBack(); 11
},
// 重考
goExamStart(obj) {
this.$router.push({
path: '/exam_result',
query:{
examId: obj.id,
origin: 'start',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
});
},
// 查看
watchResult(obj) {
this.$router.push({
path: '/exam_result',
query:{
examId: obj.id,
origin: '',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
});
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
// this.show = false;
this.taggleSlot();
},
wxcDialogConfirmBtnClicked () {
// this.show = false;
},
wxcDialogNoPromptClicked (e) {
// 此处必须设置,组件为无状态组件,自己管理
this.isChecked = e.isChecked;
},
wxcMaskSetHidden () {
// 此处必须设置,组件为无状态组件,自己管理
this.showCodeInputDialog = false;
}
},
};
<template>
<div>
<div class="stroke_container" v-if="this.flagLoading==5">
<common-header
:bg-color="bgColor"
:title="title"
:is-fix-header="isFixHeader"
:is-custom-back="true"
@selfGoBack="consulOrder"
/>
<template v-if="allComponentLists.length">
<div
v-for="(value, key) in slots"
ref="scrollerDom"
:key="'a'+key"
>
<component-main
ref="mainCp"
:type="value.slot"
:datas="allComponentLists[key]"
:keyIndex="key"
@click.native="getCurrentIndex(key)"
/>
</div>
</template>
<!--</stroke-slot>-->
<div v-if="orderListFlag">
<div class="local-exam">
<div
v-if="allowFlag == 0"
class="project_advice_new"
>
<div class="project_advice_text_new">
您暂不属于该项目,若想获得学习权限,请拨打电话 400-920-8877 联系云鹊医工作人员。
</div>
</div>
<div class="project_title">
{{ pLiveMapping.examName }}
</div>
<div class="code-btn-wrap">
<div :class="{'code-btn': (allowFlag == 0),'code-active-btn': (allowFlag != 0)}"
:style="codeBtn"
@click="codeBtnClicked"
>
<!-- :textStyle="allowFlag == 0 ? codeTextStyleNo : codeTextStyle" -->
{{pLiveMapping.buttonName}}
</div>
</div>
</div>
<div class="history-wrap">
<div class="history-header">
<div class="project_title his_label">
考试记录
</div>
<div
v-if="localHistoryList.length >= 5"
class="course_see_more"
@click="seeMoreHistory"
>
<div class="see_more">
更多
</div>
<img
class="see_more_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
>
</div>
</div>
<lives-exam-history
:show-header-h="false"
:local-history-list="localHistoryList.slice(0,5)"
@goExamStart="goExamStart"
@watchResult="watchResult"
/>
</div>
</div>
</div>
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- <wxc-dialog confirm-text="重新输入"
cancel-text="取消"
:show="showReInputTip"
@wxcDialogCancelBtnClicked="hideReInput"
@wxcDialogConfirmBtnClicked="reInputConfirm">
<div slot="content" class="content-subtext">考试码不正确</div>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
:show="showExamNotStartTip"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="notStartConfirm">
<text slot="content" class="content-subtext">考试未开始</text>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
:show="showExamFinishedTip"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="finishedConfirm">
<text slot="content" class="content-subtext">考试已结束</text>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
:show="timesFull"
main-btn-color="#35cbca"
:single="true"
@wxcDialogConfirmBtnClicked="timesFullConfirm">
<text slot="content" class="content-subtext">考试次数已用完</text>
</wxc-dialog> 11-->
<!--height="342"-->
<!-- <wxc-mask height="642"
width="750"
border-radius="0"
duration="200"
mask-bg-color="transparent"
:has-animation="true"
:has-overlay="true"
:show-close="false"
:show="showCodeInputDialog"
@wxcMaskSetHidden="wxcMaskSetHidden" >
<div class="code-content">
<div class="code-title-wrap">
<image class="code-img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png" @click="showCodeInputDialog=false"></image>
<text class="code-title">请输入考试码</text>
</div>
<div class="code-input-wrap">
<input type="text" class="code-input" :class="[code1.length > 0 ? 'code-active': '']" v-model="code1" maxlength="1" @input="codeChange(code1, 'code2')" ref="code1" autofocus="true"/>
<input type="text" class="code-input" :class="[code2.length > 0 ? 'code-active': '']" v-model="code2" maxlength="1" @input="codeChange(code2, 'code3')" ref="code2"/>
<input type="text" class="code-input" :class="[code3.length > 0 ? 'code-active': '']" v-model="code3" maxlength="1" @input="codeChange(code3, 'code4')" ref="code3"/>
<input type="text" class="code-input" :class="[code4.length > 0 ? 'code-active': '']" v-model="code4" maxlength="1" @input="codeChange(code4, 'code5')" ref="code4"/>
<input type="text" class="code-input" :class="[code5.length > 0 ? 'code-active': '']" v-model="code5" maxlength="1" @input="codeChange(code5, 'code6')" ref="code5"/>
<input type="text" class="code-input" :class="[code6.length > 0 ? 'code-active': '']" v-model="code6" maxlength="1" @input="codeChange(code6, '')" ref="code6"/>
</div>
</div>
</wxc-mask> 11-->
<van-overlay :show="showCodeInputDialog" @click="showCodeInputDialog = false">
<div class="wrapper" @click.stop>
<div class="code-content">
<div class="code-title-wrap">
<img class="code-img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png" @click="showCodeInputDialog=false"/>
<div class="code-title">请输入考试码</div>
</div>
<div class="code-input-wrap">
<input type="text" class="code-input" :class="[code1.length > 0 ? 'code-active': '']" v-model="code1" maxlength="1" @input="codeChange(code1, 'code2')" ref="code1" autofocus="true"/>
<input type="text" class="code-input" :class="[code2.length > 0 ? 'code-active': '']" v-model="code2" maxlength="1" @input="codeChange(code2, 'code3')" ref="code2"/>
<input type="text" class="code-input" :class="[code3.length > 0 ? 'code-active': '']" v-model="code3" maxlength="1" @input="codeChange(code3, 'code4')" ref="code3"/>
<input type="text" class="code-input" :class="[code4.length > 0 ? 'code-active': '']" v-model="code4" maxlength="1" @input="codeChange(code4, 'code5')" ref="code4"/>
<input type="text" class="code-input" :class="[code5.length > 0 ? 'code-active': '']" v-model="code5" maxlength="1" @input="codeChange(code5, 'code6')" ref="code5"/>
<input type="text" class="code-input" :class="[code6.length > 0 ? 'code-active': '']" v-model="code6" maxlength="1" @input="codeChange(code6, '')" ref="code6"/>
</div>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import stokeJs from './index';
export default stokeJs;
</script>
<style scoped lang="scss">
.project_advice_new {
justify-content:center;
align-items:center;
padding:15px 15px;
height: auto;
background-color: #FDFBF5;
border-radius: 10px;
}
.project_advice_text_new {
overflow: hidden;
display: inline-block;
color: #E6A23C;
font-size: 16px;
font-weight: 400;
/* height: 135px; */
/* line-height: 45px; */
}
.no-auth {
color: #999999 !important;
}
.content-subtext {
font-size:34px;
color:rgba(102,102,102,1);
line-height:50px;
text-align: center;
}
.code-input-wrap {
padding:30px 20px;
display:flex;
justify-content:space-between;
height:auto;
// background-color: white;
}
.code-input {
width:45px;
height:45px;
background:rgba(255,255,255,1);
border-radius:4px;
border-width:1px;
border-style:solid;
border-color:rgba(204,204,204,1);
//margin-right: 10px;
font-size: 26px;
color:rgba(51,51,51,1);
line-height:30px;
text-align: center;
}
.code-active {
border-color:rgba(65,183,167,1);
}
.code-input:focus {
border-color:rgba(58,172,156,1);
}
.code-title-wrap {
padding: 10px 10px 15px 10px;
flex-direction: row;
margin:auto;
justify-content: center;
align-items: center;
border-bottom-width:1px;
border-bottom-style:solid;
border-bottom-color:rgba(240,240,240,1);
background-color: white;
}
.code-img {
width: 25px;
height: 25px;
position: absolute;
right: 10px;
}
.code-title {
font-size:18px;
color:rgba(51,51,51,1);
}
.history-header {
flex-direction:row;
width:100%;
justify-content:space-between;
padding:15px 15px 0 15px;
}
.course_see_more{
flex-direction:row;
height: 48px;
line-height: 48px;
justify-content: center;
align-items: center;
}
.see_more{
font-size:28px;
color:#999999;
padding-right: 6px;
}
.see_more_img{
width:30px;
height:30px;
}
.history-wrap {
background-color: rgb(255, 255, 255);
/*padding: 30px 0 30px 30px;*/
/*margin-top: 20px;*/
border-top-width: 1px;
border-top-style: solid;
border-top-color: rgb(240, 240, 240);
padding-bottom: 40px;
}
.local-exam {
background-color: rgb(255, 255, 255);
padding: 15px;
margin-top: 5px;
}
.code-btn-wrap {
padding-top: 20px;
justify-content: center;
align-items: center;
text-align:center;
line-height:45px;
.code-btn{
color:#999999;
}
.code-active-btn{
color:rgb(106, 159, 233)
}
}
.project_title{
font-size:18px;
color:#333333;
font-weight:600;
}
.wrapper{
position:relative;
width:100%;
height:100%;
.code-content{
background:#fff;
height:auto;
position:absolute;
top:30%;left:0;right:0;
}
}
.his_label {
color:#999999;
font-weight: 500;
}
.stroke_container{
background-color:#f5f5f5;
}
.stroke_header_statusBar{
position: fixed;
left: 0;
top: 0;
width: 750px;
height: 44px;
align-items: flex-end;
padding-left:0px;
padding-right:0px;
padding-bottom:0px;
flex-direction:row;
justify-content: space-between;
}
.background-fff{
background-color: #ffffff;
}
.background-999{
background-color: #999999;
}
.stroke_header{
position:fixed;
left:0px;
top:0;
width:100%;
align-items: flex-end;
flex-direction:row;
justify-content: space-between;
}
.stroke_header_white{
background-color:#ffffff;
}
.stroke_header_left{
flex-direction:row;
align-items: center;
}
.stroke_header_title{
position:absolute;
left:0;
bottom:30px;
width:750px;
text-align:center;
height: 50px;
font-size:36px;
color:#333333;
}
.go_back{
width:50px;
height:50px;
}
.home_page{
font-size:32px;
color:#333333;
}
/*.share_image{*/
/*position: absolute;*/
/*width: 50px;*/
/*height: 50px;*/
/*right: 16px;*/
/*bottom:35px;*/
/*}*/
.refresh {
width: 750;
display: -ms-flex;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-box-align: center;
align-items: center;
}
.indicator-text {
color: #999999;
font-size: 26px;
text-align: center;
/*top: 70px;*/
}
.indicator {
margin-top: 0px;
margin-left: 0px;
height: 40px;
width: 40px;
color: #999999;
}
.panel {
width: 600px;
height: 250px;
margin-left: 75px;
margin-top: 35px;
margin-bottom: 35px;
flex-direction: column;
justify-content: center;
border-width: 2px;
border-style: solid;
border-color: #DDDDDD;
background-color: #F5F5F5;
}
.text {
font-size: 50px;
text-align: center;
color: #41B883;
}
</style>
module.exports = {
transpileDependencies: [],
productionSourceMap: false,
pluginOptions: {
pica: {
jsSort: [],
cssSort: [],
skeletonRoutes: [],
enableAutoSkeletonRoutes: false,
routeMode: 'history',
dpsLimit: 5
},
tinypng: {
key: ''
}
},
chainWebpack: config => {
config.set('externals', {
vue: 'Vue',
vuex: 'Vuex',
'vue-router': 'VueRouter',
'vconsole': 'VConsole',
axios: 'axios',
vant: 'vant',
'crypto-js/crypto-js': 'CryptoJS',
'jsencrypt/bin/jsencrypt': 'JSEncrypt'
});
config.plugins.delete('prefetch');
config.plugins.delete('preload');
},
devServer: {
port: 8083,
proxy: {
'/proxy': {
target: 'https://api.yunqueyi.com/',
ws: false,
changeOrigin: true,
secure: true,
pathRewrite: {
'^/proxy': '/',
},
},
},
}
};
module.exports.publicPath = process.env.VUE_APP_ENV === 'development' && process.env.VUE_APP_IS_LOCAL ? process.env.BASE_URL : `${process.env.VUE_APP_OSS_URL}/static${process.env.BASE_URL}`;
因为 它太大了无法显示 源差异 。您可以改为 查看blob
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册