提交 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
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 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;
```
此差异已折叠。
export default {
namespaced: true,
state: {
count: 0
},
mutations: {
add (state, val = 1) {
state.count += val;
}
}
};
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册