houwei 4 yıl önce
işleme
c536ecfac4

+ 23 - 0
.gitignore

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

+ 24 - 0
README.md

@@ -0,0 +1,24 @@
+# matcherweb
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Lints and fixes files
+```
+npm run lint
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
babel.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  presets: [
+    '@vue/cli-plugin-babel/preset'
+  ]
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 15277 - 0
package-lock.json


+ 53 - 0
package.json

@@ -0,0 +1,53 @@
+{
+  "name": "matcherweb",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "axios": "^0.21.0",
+    "core-js": "^3.6.5",
+    "element-ui": "^2.14.1",
+    "html2canvas": "^1.0.0-rc.7",
+    "less": "^4.0.0",
+    "less-loader": "^7.2.0",
+    "npm": "^6.14.10",
+    "vant": "^2.11.3",
+    "vue": "^2.6.11",
+    "vue-router": "^3.2.0",
+    "vuex": "^3.4.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.0",
+    "@vue/cli-plugin-eslint": "~4.5.0",
+    "@vue/cli-plugin-router": "^4.5.9",
+    "@vue/cli-plugin-vuex": "^4.5.9",
+    "@vue/cli-service": "~4.5.0",
+    "babel-eslint": "^10.1.0",
+    "eslint": "^6.7.2",
+    "eslint-plugin-vue": "^6.2.2",
+    "vue-template-compiler": "^2.6.11"
+  },
+  "eslintConfig": {
+    "root": true,
+    "env": {
+      "node": true
+    },
+    "extends": [
+      "plugin:vue/essential",
+      "eslint:recommended"
+    ],
+    "parserOptions": {
+      "parser": "babel-eslint"
+    },
+    "rules": {}
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not dead"
+  ]
+}

BIN
public/favicon.ico


+ 18 - 0
public/index.html

@@ -0,0 +1,18 @@
+<!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,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <!--  <meta name="viewport" content="width=device-width, initial-scale=1.0, " /> -->
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title>长春惠吉宝</title>
+  </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="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>

+ 32 - 0
src/App.vue

@@ -0,0 +1,32 @@
+<template>
+  <div id="app">
+    <!-- <div id="nav">
+      <router-link to="/">Home</router-link> |
+      <router-link to="/about">About</router-link>
+    </div> -->
+    <router-view/>
+  </div>
+</template>
+
+<style>
+#app {
+  font-family: Avenir, Helvetica, Arial, sans-serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  /* text-align: center; */
+  color: #2c3e50;
+}
+
+#nav {
+  padding: 30px;
+}
+
+#nav a {
+  font-weight: bold;
+  color: #2c3e50;
+}
+
+#nav a.router-link-exact-active {
+  color: #42b983;
+}
+</style>

+ 83 - 0
src/api/ajax.js

@@ -0,0 +1,83 @@
+import axios from 'axios';
+import qs from 'qs';
+import { Message } from 'element-ui';
+// import {BASE_URL} from '/wx'
+
+// axios.defaults.baseURL = '/api';
+axios.defaults.baseURL = 'https://mp.cchuijibao.com/'
+axios.defaults.headers.common['Content-Type'] = 'application/json; charset=UTF-8';
+//网络请求
+export default function ajax(url, data = {}, type = 'GET', isupload) {
+  return new Promise(function (resolve, reject) {
+    let promise;
+    if (type === 'GET') {
+      let dataStr = '';
+      Object.keys(data).forEach(key => {
+        dataStr += key + '=' + data[key] + '&';
+      });
+      if (dataStr !== '') {
+        dataStr = dataStr.substring(0, dataStr.lastIndexOf('&'));
+        url = url + '?' + dataStr;
+      }
+      promise = axios.get(url,{
+        headers: {
+          'tenant-id': '1'
+        }
+      });
+    } else if (type === 'DELETE') {
+      let dataString = '';
+      Object.keys(data).forEach(key => {
+        dataString += key + '=' + data[key] + '&';
+      });
+      if (dataString !== '') {
+        dataString = dataString.substring(0, dataString.lastIndexOf('&'));
+        url = url + '?' + dataString;
+      }
+      promise = axios.delete(url);
+    } else {
+      if (isupload) {
+        promise = axios.post(url, data, {
+          headers: {
+            'Content-Type': 'multipart/form-data',
+          },
+          transformRequest: [
+            function (data) {
+              return data;
+            },
+          ],
+        });
+      } else {
+        console.log(data,'收到的数据')
+        promise = axios.post(url, JSON.stringify(data), {
+          headers: {
+            'Content-Type': 'application/json; charset=utf-8'
+          }
+        });
+      }
+    }
+    promise
+      .then(function (response) {
+        if (response.data.msg == '请求成功') {
+          resolve(response.data);
+        } else {
+          if (response.data.msg) {
+            // Message({
+            //   message: response.data.msg,
+            //   type: 'error',
+            //   duration: 5000,
+            // });
+          }
+          resolve(response.data);
+        }
+      })
+      .catch(function (error) {
+        Message({
+          message: '系统异常,请联系管理员',
+          type: 'error',
+          duration: 5000,
+        });
+        // console.error("异常", error);
+        reject(error);
+      });
+  });
+}

+ 1 - 0
src/api/baseUrl.js

@@ -0,0 +1 @@
+export const BASE_URL = 'https://mp.cchuijibao.com/';

+ 9 - 0
src/api/index.js

@@ -0,0 +1,9 @@
+import ajax from './ajax';
+//获取openid
+export const getOpenId = params => ajax(`/api/ma/channel/qrcode/userinfo/${params.code}`, {}, 'GET');
+// 根据openid获取信息
+export const getInfo = params => ajax(`/api/ma/channel/qrcode/channel/${params.openId}`, {}, 'GET');
+// 获取二维码
+export const getQrcode = params => ajax(`/api/ma/channel/qrcode/login/${params.openId}`, params, 'POST');
+// 第二个页的获取参数
+export const getParam = params => ajax(`/api/ma/channel/qrcode/${params.openId}`, {}, 'GET');

BIN
src/assets/test.jpg


+ 21 - 0
src/main.js

@@ -0,0 +1,21 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import store from './store'
+import ElementUI from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
+import Vant from 'vant';
+import 'vant/lib/index.css';
+import { Swipe, SwipeItem } from 'vant';
+
+Vue.use(Swipe);
+Vue.use(SwipeItem);
+Vue.config.productionTip = false;
+Vue.use(ElementUI);
+Vue.use(Vant);
+
+new Vue({
+  router,
+  store,
+  render: h => h(App)
+}).$mount('#app')

+ 121 - 0
src/pages/getParam.vue

@@ -0,0 +1,121 @@
+<template>
+  <div>
+    <!-- <div 
+      style="
+        font-size: 16px;
+        font-weight: 800;
+        text-align: center;
+        margin-top: 20px;
+        margin-bottom: 10px;
+      "
+    >
+      中汇国际保险经纪股份有限公司客户告知书
+    </div>
+
+    <div class="p2" style="text-indent: 0px">尊敬的客户:</div>
+    <div class="p2">
+      感谢您使用本公司提供的保险经纪服务,本保险产品由中汇国际保险经纪股份有限公司作为保险经纪人,
+      由中国平安财产保险股份有限公司吉林分公司联合中国人寿保险股份有限公司吉林省分公司、太平财产保险有限公司吉林分公司共同承保。
+      为了维护投保人和被保险人的合法权益,根据《中华人民共和国保险法》、《互联网保险业务监管办法》和《保险经纪人监管规定》的要求,
+      我司应履行客户告知义务,现将我司的相关情况告知如下,请仔细阅读:
+    </div>
+
+    <div class="p2">
+      公司名称:中汇国际保险经纪股份有限公司(统一社会信用代码:91110000779536414P)
+    </div>
+    <div class="p2">
+      经营保险经纪业务许可证编号:260459000000800 有效期至:2023年09月16日
+    </div>
+    <div class="p2">联系方式:电话:(010)85539319</div>
+    <div class="p2">网址:www.zhonghuiguoji.com</div>
+    <div class="p2">营业场所:北京市朝阳区永安东里16号18层06单元</div>
+    <div class="p2">
+      业务范围:从事保险经纪业务。(企业依法自主选择经营项目,开展经营活动;依法须经批准的项目,
+      经相关部门批准后依批准的内容开展经营活动;不得从事本市产业政策禁止和限制类项目的经营活动。)
+    </div>
+    <div class="p2">经营区域:全国区域内(港、澳、台除外)</div>
+    <div class="p2">
+      业务性质:基于投保人的利益,为投保人与保险公司订立保险合同提供中介服务,并依法向保险公司收取佣金。
+      我公司及高级管理人员与本经纪业务相关的保险公司或其他保险中介机构不存在关联关系。
+    </div>
+
+    <div class="p2">
+      1、请您仔细阅读保险条款,重点关注保险责任、责任免除、被保险人权利义务、免赔额或免赔率的计算等内容。
+    </div>
+    <div class="p2">
+      2、请通过网页说明或向客服人员了解《中华人民共和国保险法》等法律法规对于索赔时效、保险公司理赔时限、
+      合同中止与失效、未成年人投保限额等的相关规定,以及不履行如实告知义务、故意制造保险事故或夸大事故损失、
+      申报年龄不真实等情形导致的法律后果。
+    </div>
+    <div class="p2">
+      3、根据《中华人民共和国保险法》的规定,保险经纪人因过错给投保人、被保险人造成损失的,依法承担赔偿责任。
+    </div>
+    <div class="p2">
+      4、如果您发现本公司人员存在误导行为及其他损害您合法权益的行为,请注意保留书面证据或其他证据,可向本公司投诉,
+      若您与本公司发生纠纷,可向北京仲裁委员会提交申请仲裁裁决。
+    </div>
+
+    <div class="p2">客户投诉渠道:客户投诉热线:(010)85539319</div>
+    <div class="p2">客户投诉受理部门:业务管理与客户服务部</div>
+    <div class="p2">
+      纠纷解决方式:快速响应,及时反馈,积极协商解决客户诉求,维护客户保险权益。
+    </div>
+
+    <div class="p2">以上事项根据我司实际情况提供,敬请随时查询、核实。</div>
+
+    <div class="p2" style="text-align: right">中汇国际保险经纪股份有限公司</div>
+    <el-button class="btn" @click="findArr">我知道了</el-button>-->
+  </div>
+</template>
+<script>
+import openId from "../util/getOpenId";
+// import { Message } from "element-ui";
+import { getParam } from "../api";
+export default {
+  name: "getParam",
+  data() {
+    return {};
+  },
+  methods: {
+    async toUrl(openId) {
+      const result = await getParam({ openId: openId });
+      console.log(result, "我是查询参数的结果");
+      let qrSceneStr = result.data.qrSceneStr;
+      window.location.href = "https://hczlife-static.pingan.com.cn/nci/productDetail/index.html?productId=2020093012154&hzcModule=HSH-XMTT-JGWB-GZHTFX-398$"+qrSceneStr;
+    }
+  },
+  async mounted() {
+     openId.getOpenId(() => {
+        let openId = window.localStorage.getItem("openId");
+        // let openId = "oCmQb5t9OfG9lOR_by2WWidjAgqU";
+        this.toUrl(openId);
+      })
+  }
+};
+</script>
+<style scoped lang="less">
+.p2 {
+  text-indent: 28px;
+  font-size: 14px;
+  line-height: 35px;
+  padding-left: 20px;
+  padding-right: 20px;
+  word-wrap: break-word;
+  word-break: break-all;
+}
+.btn {
+  width: 80%;
+  margin-left: 10%;
+  border-radius: 5px;
+  margin-top: 0px;
+  height: 40px;
+  text-align: center;
+  line-height: 16px;
+  color: #fff;
+  font-size: 15px;
+  font-weight: 600;
+  background: linear-gradient(to right, #ff6203, #fd9f55);
+  margin-top: 20px;
+  margin-bottom: 50px;
+}
+</style>

+ 239 - 0
src/pages/index.vue

@@ -0,0 +1,239 @@
+<template>
+  <div>
+    <div class="hello">您好,</div>
+    <div class="welcom">欢迎来到长春惠吉宝</div>
+    <div style="margin-top: 30px">
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-form-item label="" prop="organId">
+          <el-select
+            :disabled="isOrganid"
+            v-model="form.organId"
+            placeholder="请选择单位"
+          >
+            <el-option
+              v-for="(item, i) in data"
+              :key="i"
+              :label="item.name"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="" prop="channelDeptName" style="display:none">
+          <el-input v-model="form.channelDeptName"></el-input>
+        </el-form-item> -->
+        <el-form-item label="" prop="name">
+          <el-input
+            v-model="form.name"
+            :disabled="isName"
+            placeholder="请输入姓名"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="" prop="phone">
+          <el-input
+            :disabled="isPhone"
+            type="number"
+            v-model="form.phone"
+            placeholder="请输入联系方式"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="" prop="jobNumber">
+          <el-input
+            :disabled="isjobNumber"
+            v-model="form.jobNumber"
+            placeholder="请输入工号(非必填)"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="" v-if="showBtn">
+          <el-button class="btn" @click="submitForm('form')"
+            >生成二维码</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
+    <!-- <div class="btn">生成二维码</div> -->
+    <div class="qrcode">
+      <img :src="src" alt="" style="width: 100%" />
+    </div>
+  </div>
+</template>
+<script>
+import openId from "../util/getOpenId";
+import { Message } from "element-ui";
+import { getInfo, getQrcode } from "../api";
+export default {
+  name: "index",
+  data() {
+    return {
+      showBtn: true,
+      data: [
+        { name: "平安财险", value: "1348991942926540802" },
+        { name: "太平财险", value: "1348992060643876866" },
+        { name: "中国人寿", value: "1348992328710234114" },
+        { name: "其他渠道", value: "1348992428849242114" },
+      ],
+      src: "",
+      form: {
+        organId: "",
+        name: "",
+        phone: "",
+        jobNumber: "",
+        channelDeptName: "",
+        openId: "",
+      },
+      isOrganid: false,
+      isName: false,
+      isPhone: false,
+      isjobNumber: false,
+      rules: {
+        organId: [
+          { required: true, message: "请选择单位名称", trigger: "change" },
+        ],
+        name: [{ required: true, message: "请输入姓名", trigger: "change" }],
+        phone: [
+          { required: true, message: "请输入联系方式", trigger: "change" },
+        ],
+      },
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      // 表单验证
+      this.$refs[formName].validate((valid) => {
+        console.log(valid);
+        if (valid) {
+          for (let i = 0; i < this.data.length; i++) {
+            if (this.form.organId == this.data[i].value) {
+              this.form.channelDeptName = this.data[i].name;
+            }
+          }
+          console.log(this.form);
+          this.submit();
+          // alert('提交成功!')
+        } else {
+          console.log("error submit!");
+          return false;
+        }
+      });
+    },
+    async findArr(openId) {
+      let params = {
+        openId: openId,
+      };
+      const result = await getInfo(params);
+      console.log(result, "我是查询结果");
+      if (result.data) {
+        this.showBtn = false;
+        this.form.phone = result.data.phone;
+        this.form.name = result.data.name;
+        this.form.organId = result.data.channelDeptName;
+        this.form.jobNumber = result.data.jobNumber
+        this.src = result.data.channelQrCode;
+        this.isOrganid = true;
+        this.isName = true;
+        this.isPhone = true;
+        this.isjobNumber = true;
+      } else {
+        this.showBtn = true;
+        
+      }
+    },
+    async submit() {
+      const result = await getQrcode(this.form);
+      console.log(result, "我是提交结果");
+      if (result.data) {
+        this.showBtn = false;
+        this.src = result.data.channelQrCode;
+        this.isOrganid = true;
+        this.isName = true;
+        this.isPhone = true;
+        this.isjobNumber = true;
+      }
+    },
+  },
+  async mounted() {
+    openId.getOpenId(() => {
+    let openId = window.localStorage.getItem("openId");
+    // let openId = "oCmQb5t9OfG9lOR_by2WWidjAgqU";
+    this.form.openId = openId;
+    this.findArr(openId);
+    });
+  },
+};
+</script>
+<style scoped lang="less">
+.hello {
+  font-size: 16px;
+  font-weight: 900;
+  text-indent: 30px;
+  margin-top: 20px;
+}
+.welcom {
+  font-size: 16px;
+  font-weight: 900;
+  text-indent: 30px;
+  margin-top: 5px;
+}
+.el-select,
+.el-input {
+  width: 80%;
+  margin-left: 10%;
+}
+
+.el-select /deep/ .el-input /deep/ .el-input__inner {
+  border: 0px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+}
+.el-form-item
+  /deep/
+  .el-form-item__content
+  /deep/.el-input
+  /deep/
+  .el-input__inner {
+  border: 0px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+}
+.el-input /deep/ .el-input__inner {
+  border: 0px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+}
+.el-form-item /deep/ .el-form-item__content /deep/ .el-form-item__error {
+  left: 12%;
+}
+.el-form-item {
+  margin-bottom: 22px;
+}
+.btn {
+  width: 80%;
+  margin-left: 10%;
+  border-radius: 5px;
+  margin-top: 0px;
+  height: 40px;
+  text-align: center;
+  line-height: 16px;
+  color: #fff;
+  font-size: 15px;
+  font-weight: 600;
+  background: linear-gradient(to right, #ff6203, #fd9f55);
+}
+.qrcode {
+  width: 200px;
+  height: 200px;
+  // border: 1px solid red;
+  margin: 5px auto;
+}
+.el-button:focus,
+.el-button:hover {
+  color: #fff !important;
+}
+.el-form-item /deep/ .el-form-item__content /deep/ .el-form-item__error {
+  left: 12%;
+}
+.el-form-item
+  /deep/
+  .el-form-item__content
+  /deep/
+  .is-disabled
+  .el-input__inner {
+  color: #000;
+}
+</style>

+ 26 - 0
src/router/index.js

@@ -0,0 +1,26 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import index from '../pages/index.vue'
+
+const getComponent = (component, dir) => () => import(`.././pages` + (dir ? `/${dir}` : '') + `/${component}.vue`);
+
+Vue.use(VueRouter)
+
+const routes = [
+  {
+    path: '/',
+    name: 'index',
+    component: index
+  },
+  {
+    path:'/getParam',
+    name: 'getParam',
+    component: getComponent('getParam')
+  }
+]
+const router = new VueRouter({
+  mode: 'hash',
+  routes
+})
+
+export default router

+ 15 - 0
src/store/index.js

@@ -0,0 +1,15 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+  state: {
+  },
+  mutations: {
+  },
+  actions: {
+  },
+  modules: {
+  }
+})

+ 57 - 0
src/util/getOpenId.js

@@ -0,0 +1,57 @@
+import { Loading, Message } from 'element-ui';
+import { getOpenId } from '../api'
+export default {
+    getOpenId(callback) {
+        let loading = Loading.service();
+        if (window.localStorage.getItem('openId')) {
+            loading.close();
+            callback();
+        } else {
+            this.getAppid(loading, callback);
+        }
+    },
+    async getAppid(loading, callback) {
+        this.getCode('wx1c7afdd6a87c0580', loading, callback);
+    },
+    getCode(appid, loading, callback) { // 非静默授权,第一次有弹框
+        // let local = 'https://yuehe.hellevil.com/mp/#/'; 
+        let local = window.location.href; // 获取页面url
+        let code = this.getUrlCode().code;// 截取code
+        if (code && code !== '') { 
+            this.requestNet(code, loading, callback);
+        } else {
+            loading.close();
+            window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
+        }
+    },
+    getUrlCode() { // 截取url中的code方法
+        let url = location.search;
+        let theRequest = {};
+        if (url.indexOf("?") !== -1) {
+            let str = url.substr(1);
+            let strs = str.split("&");
+            for (let i = 0; i < strs.length; i++) {
+                theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
+            }
+        }
+        return theRequest
+    },
+    async requestNet(code, loading, callback) {
+        let result = await getOpenId({ code: code }, "GET");
+        console.log(result)
+        if (result.data.openid && result.data.openid !== 'null') {
+            window.localStorage.setItem("openId", result.data.openid);
+            callback();
+            loading.close();
+        } else {
+            loading.close();
+        }
+    },
+}
+
+
+
+
+
+
+

+ 17 - 0
vue.config.js

@@ -0,0 +1,17 @@
+module.exports = {
+  productionSourceMap: false,
+  publicPath: "./",
+  lintOnSave: false,
+  devServer: {  
+    proxy: {  //配置跨域
+      '/api': {
+        target: 'https://mp.cchuijibao.com/',  //这里后台的地址模拟的;应该填写你们真实的后台接口
+        changOrigin: true,  //允许跨域
+        pathRewrite: {
+          '^/api': '' 
+        }
+      },
+    }
+  },
+};
+