Przeglądaj źródła

刪除不必要插件

Luolei 6 lat temu
rodzic
commit
5be87ad311

+ 2 - 5
package.json

@@ -4,15 +4,14 @@
   "description": "",
   "main": "index.js",
   "dependencies": {
-    "@babel/polyfill": "^7.4.4",
-    "imports-loader": "^0.8.0",
+    "babel-polyfill": "^6.26.0",
+    "es3ify-loader": "^0.2.0",
     "jquery": "^1.12.4",
     "webpack": "^4.30.0",
     "webpack-cli": "^3.3.1"
   },
   "devDependencies": {
     "@babel/core": "^7.4.4",
-    "@babel/plugin-transform-runtime": "^7.4.4",
     "@babel/preset-env": "^7.4.4",
     "babel-loader": "^8.0.5",
     "clean-webpack-plugin": "^2.0.1",
@@ -20,8 +19,6 @@
     "express": "^4.16.4",
     "file-loader": "^3.0.1",
     "html-webpack-plugin": "^3.2.0",
-    "less": "^3.9.0",
-    "less-loader": "^4.1.0",
     "mini-css-extract-plugin": "^0.6.0",
     "style-loader": "^0.23.1",
     "uglifyjs-webpack-plugin": "^2.1.2",

+ 0 - 0
src/css/common.css


+ 1 - 1
src/css/common.less

@@ -5,4 +5,4 @@
 @colorWaring:#FF545B; //警惕
 @bgcPlan:#E3FEFE; //治疗
 @bgcMay:#FAEBEC; //疑似,警惕,可能
-@bgcModal:#DFEAFE; //弹窗头
+@bgcModal:#DFEAFE; //弹窗头 

+ 311 - 0
src/css/index.css

@@ -0,0 +1,311 @@
+.iframeWrap {
+  margin: 10px auto 50px;
+  padding: 20px;
+}
+.iframeWrap .conditionHintPub {
+  border: 1px solid #F2F2F2;
+  margin-bottom: 15px;
+}
+.iframeWrap .conditionHintPub li {
+  padding-right: 18px;
+  float: left;
+  line-height: 24px;
+}
+.iframeWrap .conditionHintPub .conditionMain {
+  padding: 17px;
+}
+.iframeWrap .conditionHintPub .alertModal {
+  position: relative;
+}
+.iframeWrap .conditionHintPub .alertModal .mayResult {
+  color: #838383;
+  position: relative;
+}
+.iframeWrap .conditionHintPub .alertModal .mayResultSelect {
+  line-height: 28px;
+}
+.iframeWrap .conditionHintPub .alertModal .mayResultSelect .makesureResult {
+  cursor: pointer;
+  color: #267FD7;
+}
+.iframeWrap .conditionHintPub .alertModal .mayResultSelect .sanjiao {
+  width: 18px;
+  height: 18px;
+  display: inline-block;
+  position: relative;
+  top: 3px;
+  background: url('../images/select.png') center center no-repeat;
+}
+.iframeWrap .conditionHintPub .treatPlan {
+  font-weight: bold;
+  padding-bottom: 5px;
+}
+.iframeWrap .conditionHintPub .treatPlanWrap {
+  padding-bottom: 10px;
+  border-bottom: 1px solid #D1D1D1;
+}
+.iframeWrap .conditionHintPub .treatMedicine {
+  padding-top: 10px;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicinePart {
+  margin: 8px 0;
+  position: relative;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicine {
+  border-bottom: 1px solid #D1D1D1;
+  position: relative;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicine:hover {
+  color: #267FD7;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicine:hover a {
+  display: inline-block;
+  right: -20px;
+  background-color: #fff;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicineDis {
+  color: #D1D1D1;
+  border-bottom: 1px solid #D1D1D1;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicineWaring {
+  background-color: #f4c051;
+  color: #000;
+  font-size: 12px;
+  border-radius: 4px;
+  border: 1px solid #fff;
+  line-height: 18px;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicineWaringDis {
+  background-color: #fff;
+  color: #D1D1D1;
+  font-size: 12px;
+  border-radius: 4px;
+  line-height: 18px;
+  border: 1px solid #D1D1D1;
+}
+.iframeWrap .conditionHintPub .treatMedicine .medicineWaringDisMsg {
+  color: #D1D1D1;
+}
+.iframeWrap .conditionHintPub p {
+  line-height: 24px;
+}
+.iframeWrap .conditionHintPub p span {
+  display: inline-block;
+}
+.iframeWrap .conditionHintWz h4 {
+  background-color: #ECF4FC;
+}
+.iframeWrap .conditionHintWz h4 i {
+  background: url("../images/inquire.png") center center no-repeat;
+}
+.iframeWrap .conditionHintTg h4 {
+  background-color: #ECF4FC;
+}
+.iframeWrap .conditionHintTg h4 i {
+  background: url("../images/tgjc.png") center center no-repeat;
+}
+.iframeWrap .conditionHintInspect h4 {
+  background-color: #ECF4FC;
+}
+.iframeWrap .conditionHintInspect h4 i {
+  background: url("../images/inspect.png") center center no-repeat;
+}
+.iframeWrap .conditionHintMay h4 {
+  background-color: #FAEBEC;
+}
+.iframeWrap .conditionHintMay h4 i {
+  background: url("../images/yszd.png") center center no-repeat;
+}
+.iframeWrap .conditionHintWarings {
+  display: none;
+}
+.iframeWrap .conditionHintWarings h4 {
+  color: #FF545B;
+}
+.iframeWrap .conditionHintWarings h4 i {
+  background: url("../images/warings.png") center center no-repeat;
+}
+.iframeWrap .conditionHintWarings li {
+  float: left;
+  line-height: 24px;
+}
+.iframeWrap .conditionHintWarings li:hover {
+  color: #267FD7;
+}
+.iframeWrap .conditionHintKnzd {
+  display: none;
+}
+.iframeWrap .conditionHintKnzd h4 i {
+  background: url("../images/knzd.png") center center no-repeat;
+}
+.iframeWrap .conditionHintKnzd ul li {
+  float: left;
+  line-height: 24px;
+}
+.iframeWrap .conditionHintKnzd ul li:hover {
+  color: #267FD7;
+}
+.iframeWrap .conditionHintZhiliao h4 {
+  background-color: #E3FEFE;
+}
+.iframeWrap .conditionHintZhiliao h4 i {
+  background: url("../images/zhiliao.png") center center no-repeat;
+}
+.iframeWrap .conditionHintTips .mayIllness {
+  padding-bottom: 5px;
+}
+.iframeWrap .conditionHintTips .mayIllness span {
+  position: relative;
+  border-bottom: 1px solid #D1D1D1;
+}
+.iframeWrap .conditionHintTips .mayIllness span .infoMsg {
+  position: relative;
+  border-bottom: 0;
+  float: right;
+}
+.iframeWrap .conditionHintTips .mayIllness span:hover .infoMsg {
+  display: inline-block;
+}
+.iframeWrap .conditionHintTips .mayIllness a {
+  border-bottom: 1px solid #D1D1D1;
+}
+.iframeWrap .conditionHintTips h4 {
+  background-color: #FDF4EE;
+}
+.iframeWrap .conditionHintTips h4 i {
+  background: url("../images/tips.png") center center no-repeat;
+}
+.iframeWrap .illnessTable {
+  color: #267FD7;
+  line-height: 28px;
+}
+.iframeWrap h4 {
+  color: #000;
+  height: 40px;
+  line-height: 40px;
+  background-color: #FAEBEC;
+  font-size: 16px;
+  font-weight: bold;
+}
+.iframeWrap h4 i {
+  content: '';
+  width: 40px;
+  height: 40px;
+  float: left;
+}
+.commonTreat,
+.conditionHintKnzdLis,
+.conditionHintWaringsLis,
+.conditionHintWzLis,
+.conditionHintTgLis,
+.conditionHintInspectLis,
+.conditionHintAssistLis {
+  position: relative;
+}
+.conditionHintInspectNull {
+  border-bottom: 1px solid #D1D1D1;
+  padding-bottom: 5px;
+  margin-bottom: 5px;
+}
+.conditionHintZhiliaoNull {
+  display: none;
+}
+.conditionHintAssistLis,
+.conditionHintInspectLis {
+  padding: 5px 0;
+}
+.conditionHintAssistLis .slideDown,
+.conditionHintInspectLis .slideDown {
+  padding: 5px 0 5px 0px;
+}
+.conditionHintAssistLis li:first-child,
+.conditionHintInspectLis li:first-child {
+  padding-right: 5px;
+}
+.pushEmpty {
+  color: #ADADAD;
+}
+.medicinePartLimitHeight {
+  height: 25px;
+  overflow: hidden;
+  position: relative;
+}
+.medicinePartLimitHeightSpec {
+  height: 75px;
+  overflow: hidden;
+  position: relative;
+}
+.slideDown {
+  background-color: #fff;
+  position: absolute;
+  bottom: 0px;
+  right: 0px;
+  color: #267FD7;
+  height: 25px;
+  line-height: 25px;
+  box-shadow: -2px 0px 15px 0px #fff;
+  cursor: pointer;
+}
+.slideDown i {
+  width: 10px;
+  height: 7px;
+  display: inline-block;
+  position: relative;
+  top: -2px;
+  background: url('../images/down.png') center center no-repeat;
+}
+.slideup {
+  background-color: #fff;
+  position: relative;
+  float: right;
+  bottom: 0px;
+  right: 0px;
+  color: #267FD7;
+  cursor: pointer;
+}
+.slideup i {
+  width: 10px;
+  height: 7px;
+  display: inline-block;
+  position: relative;
+  top: -2px;
+  background: url('../images/up.png') center center no-repeat;
+}
+.disclaimer {
+  height: 40px;
+  width: 100%;
+  line-height: 40px;
+  text-align: center;
+  position: fixed;
+  bottom: 0;
+  background-color: #ececec;
+  left: 0;
+  z-index: 9999;
+}
+.disclaimer a {
+  display: block;
+}
+.infoMsg {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+  top: 2px;
+  right: 0px;
+  display: none;
+  background: url('../images/msg1.png') center center no-repeat;
+}
+.infoMsg:hover {
+  background: url('../images/msg2.png') center center no-repeat;
+}
+.infoMsgParent {
+  position: relative;
+}
+.infoMsgParent:hover .infoMsg {
+  display: block;
+}
+.responsibility {
+  text-align: center;
+  font-size: 12px;
+  color: #979797;
+  padding-top: 15px;
+}

+ 173 - 0
src/css/popup.css

@@ -0,0 +1,173 @@
+.popupModal {
+  position: absolute;
+  top: 24px;
+  margin-bottom: 50px;
+  left: 0;
+  width: 100%;
+  background: #FFFFFF;
+  box-shadow: 0 3px 10px -5px;
+  border: 1px solid #efefef;
+  color: #000;
+  display: none;
+  z-index: 99;
+}
+.popupModal .modalTitle {
+  height: 40px;
+  line-height: 40px;
+  padding: 0 20px;
+  background: #DFEAFE;
+}
+.popupModal .modalTitle i {
+  width: 14px;
+  height: 14px;
+  background: url('../images/close.png') center center no-repeat;
+  float: right;
+  padding: 12px 0 12px 12px;
+  margin-right: -8px;
+  cursor: pointer;
+}
+.popupModal .modalMainOne {
+  padding: 20px 0;
+  height: 30px;
+  line-height: 30px;
+  margin: 0 20px;
+  border-bottom: 1px solid #D1D1D1;
+}
+.popupModal .modalMainOne ul {
+  display: inline-block;
+}
+.popupModal .modalMainOne .modalMaintltle {
+  float: left;
+}
+.popupModal .modalMainOne .radioCheck {
+  float: left;
+}
+.popupModal .modalMainOne .radioCheck i {
+  height: 28px;
+  width: 28px;
+  float: left;
+  background: url('../images/sex1.png') center center no-repeat;
+}
+.popupModal .modalMainOne .radioChecks {
+  float: left;
+  margin: 0 10px;
+  cursor: pointer;
+}
+.popupModal .modalMainOne .radioChecks i {
+  height: 28px;
+  width: 28px;
+  float: left;
+  background: url('../images/sex1.png') center center no-repeat;
+}
+.popupModal .modalMainOne .radioChecks span {
+  display: inline-block;
+  height: 28px;
+  line-height: 28px;
+}
+.popupModal .modalMainOne .radioChecks a {
+  color: #267FD7;
+}
+.popupModal .modalMainOne .radioCheckSec i {
+  background: url('../images/sex2.png') center center no-repeat;
+}
+.popupModal .modalMainTwo {
+  padding: 20px 0;
+  margin: 0 20px;
+  border-bottom: 1px solid #D1D1D1;
+}
+.popupModal .modalMainTwo .radioCheck {
+  height: 30px;
+  line-height: 30px;
+  margin: 10px 0;
+  position: relative;
+  padding-left: 98px;
+  padding-right: 60px;
+  float: none;
+}
+.popupModal .modalMainTwo .radioCheck .uint {
+  position: absolute;
+  right: -10px;
+  top: 0;
+}
+.popupModal .modalMainTwo .radioCheck .caculateLis li {
+  float: left;
+  padding-left: 0;
+  margin: 0;
+}
+.popupModal .modalMainTwo .radioCheck .caculateLis li a {
+  color: #267FD7;
+}
+.popupModal .modalMainTwo .radioCheck .modalMaintltle {
+  float: left;
+  width: 98px;
+  position: absolute;
+  left: 0;
+}
+.popupModal .modalMainTwo .radioCheck input[type=text] {
+  border: 1px solid #E2E3E3;
+  border-radius: 2px;
+  height: 30px;
+  line-height: 30x;
+  padding: 0 10px;
+  width: 100%;
+}
+.popupModal .modalMainTwo .radioCheck input[type=text]:hover {
+  border: 1px solid #3B9ED0;
+}
+.popupModal .modalMainTwo .radioChecks {
+  height: 30px;
+  line-height: 30px;
+  margin: 10px 0;
+  position: relative;
+  padding-left: 98px;
+  padding-right: 20px;
+  cursor: pointer;
+}
+.popupModal .modalMainTwo .radioChecks i {
+  height: 28px;
+  width: 28px;
+  float: left;
+  background: url('../images/sex1.png') center center no-repeat;
+}
+.popupModal .modalMainTwo .radioCheckSec i {
+  background: url('../images/sex2.png') center center no-repeat;
+}
+.popupModal .modalMainTwo .calculate {
+  height: 32px;
+  line-height: 32px;
+  margin-bottom: 20px;
+  text-align: center;
+  background-color: #267FD7;
+  color: #fff;
+  width: 100%;
+  border-radius: 5px;
+}
+.popupModal .modalMainTwo .calculateError {
+  color: red;
+  position: relative;
+  top: -20px;
+  display: none;
+  font-size: 12px;
+}
+.popupModal .modalMainTwo .calculate:hover {
+  background-color: #267FD7;
+}
+.popupModal .modalMainTwo .result span {
+  display: inline-block;
+  width: 98px;
+}
+.popupModal .modalMainTwo .result .calculateResult {
+  width: auto;
+}
+.popupModal .btnWrap {
+  padding: 10px 20px;
+}
+.popupModal .btnWrap .sureScore {
+  border: 1px solid #267FD7;
+  border-radius: 4px;
+  width: 66px;
+  height: 32px;
+  line-height: 30px;
+  float: right;
+  color: #267FD7;
+}

+ 1 - 1
src/css/popup.less

@@ -83,7 +83,7 @@
       margin: 10px 0;
       position: relative;
       padding-left: 98px;
-      padding-right: 60px;
+      padding-right: 60px; 
       float: none;
       .uint {
         position: absolute;

Plik diff jest za duży
+ 2 - 2
src/html/index.html


+ 5 - 2
src/index.js

@@ -1,7 +1,9 @@
-require('./css/index.less');
+require('./css/index.css');
 require('./css/reset.css');
-require('./css/popup.less');
+require('./css/popup.css');
 require('./js/popup');
+const $ = require("jquery")
+
 const { post,config,getUrlArgObject } = require('./js/promise.js');
 const {bqtsFun,ybzlFun,cyywFun,knzdFun,jtFun,tjwzFun,tjtgFun,tjhyFun,tjfjFun,yszdFun} = require('./js/indexDom.js');
 //地址栏参数 ?age=99&lisJson=&diseaseId=&diagJson=糖尿病&pastJson=无心脏病&otherJson=无高血压&pacsJson=腹部B超:无异常, 报告日期:2019-05-07&sex=男&symptomJson=恶心呕吐腰痛&vitalJson=血压左上肢13/12mmHg
@@ -27,6 +29,7 @@ post(config.pushInner,msg).then((res)=>{
   var data = res.data
   if(data.code == 0){
     var result = data.data;
+    console.log(result)
     if(result.medicalIndications && result.medicalIndications.length>0){//病情提示
       window.pushMessage = result.medicalIndications;//计算的需要的相关数据
       bqtsFun(result.medicalIndications)

+ 1 - 0
src/js/disclaimer.js

@@ -1,4 +1,5 @@
 const {post, config} = require('./promise.js');
+const $ = require("jquery")
 
 (function(){
     getDisclaimer();

+ 2 - 0
src/js/indexDom.js

@@ -1,3 +1,5 @@
+const $ = require("jquery")
+
 function bqtsFun(data){//病情提示
   for(var k = 0;k < data.length;k++){
     var tmpBq = data[k]

+ 2 - 4
src/js/information.js

@@ -1,11 +1,9 @@
 const {post, throttle, imageUrlPrefix, config, getUrlArgObject} = require('./promise.js');
+const $ = require("jquery")
 
 (function(){
     getInfomation();
-    function getInfomation(){
-        // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
-        // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
-       
+    function getInfomation(){       
         var param = {
             "type":  getUrlArgObject('type'),
             "questionId":  getUrlArgObject('questionId'),

+ 1 - 0
src/js/popup.js

@@ -1,4 +1,5 @@
 const {post,config} = require('./promise.js');
+const $ = require("jquery")
 
 $(".conditionHintTips").on('click',".radioChecks",function(e){
   e.stopPropagation()

+ 7 - 5
src/js/promise.js

@@ -1,10 +1,12 @@
-require('@babel/polyfill');
+require("babel-polyfill");
 const qs = require('qs');
+const $ = require("jquery");
+
 const config = {
-  pushInner:'http://192.168.2.241:5050/api/icss/push/pushInner',
-  calculate:'http://192.168.2.241:5050/api/icss/calc/calculate',
-  disclaimer: 'http://192.168.2.241:5050/api/icss/disclaimerInformation/getDisclaimerInformations',
-  information: 'http://192.168.2.241:5050/api/icss/introduceInfo/getByQuestionId',
+  pushInner:'/api/icss/push/pushInner',
+  calculate:'/api/icss/calc/calculate',
+  disclaimer: '/api/icss/disclaimerInformation/getDisclaimerInformations',
+  information: '/api/icss/introduceInfo/getByQuestionId',
 }
 const imageUrlPrefix = 'http://192.168.2.241:82';
 const getUrlArgObject = function(parm) {  

+ 1 - 0
src/js/scale.js

@@ -1,4 +1,5 @@
 const {post,config, getUrlArgObject} = require('./promise.js');
+const $ = require("jquery")
 
 $(function(){
     var scaleInfo;

+ 1 - 0
src/page.js

@@ -1,4 +1,5 @@
 require('./css/page.css');
+const $ = require("jquery")
 
 var lis = [
   {

+ 22 - 26
webpack.config.js

@@ -5,7 +5,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
 const proxyHost = "http://192.168.2.241:5050";
-
 module.exports = {
   entry: {
     index: path.resolve(__dirname, 'src', 'index.js'),
@@ -13,7 +12,7 @@ module.exports = {
     information: path.resolve(__dirname, 'src/js', 'information.js'),
     disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
     scale: path.resolve(__dirname, 'src/js', 'scale.js'),
-    vendor: 'lodash', // 多个页面所需的公共库文件,防止重复打包带入
+    vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
     publicPath: '/', //这里要放的是静态资源CDN的地址
@@ -108,7 +107,7 @@ module.exports = {
       // Options similar to the same options in webpackOptions.output
       // both options are optional
       filename: 'css/[name].css',
-      chunkFilename: '[id].css',
+      chunkFilename: '[id].css'
     }),
     new webpack.HotModuleReplacementPlugin(),
     new CleanWebpackPlugin(),
@@ -118,8 +117,16 @@ module.exports = {
       new UglifyJsPlugin({
         uglifyOptions: {
           ie8: true,
-        },
-      }),
+          compress: {
+            properties: false,
+            warnings: false
+          },
+          output: {
+              beautify: true
+          },
+          sourceMap: false
+        }
+      })
     ],
     splitChunks: {
       cacheGroups: {
@@ -136,9 +143,11 @@ module.exports = {
   },
       
   module: {
-    rules: [{// 多个loader是有顺序要求的,从右往左写,因为转换的时候是从右往左转换的
-        test: /\.js$/,
-        use: "imports-loader?$=jquery"
+    rules: [
+      {
+          test: /.js$/,
+          enforce: 'post', 
+          loader: 'es3ify-loader'
       },
       {
         test: /\.m?js$/,
@@ -146,32 +155,19 @@ module.exports = {
         use: {
           loader: 'babel-loader',
           options: {
-            presets: ['@babel/preset-env']
+            presets:['@babel/preset-env',]
           }
         }
       },
       {
         test: /\.css$/,
         use: [{
-            loader: MiniCssExtractPlugin.loader,
-            options: {
-              // you can specify a publicPath here
-              // by default it uses publicPath in webpackOptions.output
-            },
+            loader: MiniCssExtractPlugin.loader
           },
           'css-loader',
-        ],
+        ]
       },
-      // {
-      //   test: /\.less$/,
-      //   loader: 'less-loader' // 将 Less 编译为 CSS
-      // },
-      {
-        test: /\.less$/,
-        use: ['style-loader', 'css-loader', 'less-loader']
-      },
-      { //file-loader 解决css等文件中引入图片路径的问题
-        // url-loader 当图片较小的时候会把图片BASE64编码,大于limit参数的时候还是使用file-loader 进行拷贝
+      { 
         test: /\.(png|jpg|jpeg|gif|svg)$/,
         use: {
           loader: 'file-loader',
@@ -181,7 +177,7 @@ module.exports = {
             name: '[name].[ext]'
           }
         }
-      },
+      }
     ]
   },
   // devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map   //生产环境cheap-module-source-map