yc-ui2 0.1.2-beta29 → 0.1.3-beta2

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-ui2",
3
- "version": "0.1.2-beta29",
3
+ "version": "0.1.3-beta2",
4
4
  "private": false,
5
5
  "description": "湖南优创UI组件库",
6
6
  "main": "dist/yc-ui2.umd.min.js",
@@ -23,6 +23,7 @@
23
23
  "@vue/cli-plugin-babel": "~5.0.0",
24
24
  "@vue/cli-plugin-eslint": "~5.0.0",
25
25
  "@vue/cli-service": "~5.0.0",
26
+ "axios": "^1.6.2",
26
27
  "element-ui": "^2.15.14",
27
28
  "eslint": "^7.32.0",
28
29
  "eslint-plugin-vue": "^8.0.3",
@@ -30,8 +31,8 @@
30
31
  "node-sass": "^9.0.0",
31
32
  "sass-loader": "^13.3.2",
32
33
  "url-loader": "^4.1.1",
33
- "vue-template-compiler": "^2.6.14",
34
- "vue-router": "3.4.9"
34
+ "vue-router": "3.4.9",
35
+ "vue-template-compiler": "^2.6.14"
35
36
  },
36
37
  "eslintConfig": {
37
38
  "root": true,
package/src/App.vue CHANGED
@@ -1,12 +1,11 @@
1
1
  <template>
2
2
  <div id="yc-ui2">
3
- <YcSlideVerify />
3
+ <yc-slide-verify :isShow.sync="isShow" />
4
4
  <router-view></router-view>
5
5
  <YcCustomerService
6
- title="小优客服【38号为您服务】"
6
+ :id="question.id"
7
+ :title="question.serviceName"
7
8
  jumpPage="/question"
8
- :json="JSON.stringify(require('@/assets/questions.js').default)"
9
- :regular="['发票增值税率', '城市维护建设税', '教育费附加征收率']"
10
9
  >
11
10
  <div><i class="el-icon-mobile"></i></div>
12
11
  <div>
@@ -24,6 +23,7 @@
24
23
  </template>
25
24
 
26
25
  <script>
26
+ import { findServiceFeeAi } from "api/customerService"
27
27
  export default {
28
28
  name: "App",
29
29
  components: {
@@ -35,6 +35,11 @@ export default {
35
35
  return {
36
36
  region: void 0,
37
37
  caUrl: void 0,
38
+ isShow: false,
39
+ question: {
40
+ id: 0,
41
+ serviceName: "",
42
+ },
38
43
  }
39
44
  },
40
45
  created() {
@@ -43,6 +48,10 @@ export default {
43
48
  this.caUrl =
44
49
  "http://120.25.167.9:9000/website/media/ce861516a25d4671ab01e150790b6111.zip"
45
50
  }, 1000)
51
+
52
+ findServiceFeeAi().then(({ data }) => {
53
+ this.question = data
54
+ })
46
55
  },
47
56
  methods: {
48
57
  login(value, back) {
@@ -0,0 +1,56 @@
1
+
2
+ import request from 'utils/request'
3
+
4
+ /**
5
+ * 获取问题类型及问题(父子级)
6
+ * @param {number} aiServiceId
7
+ * @returns {[]}
8
+ */
9
+ export function getProblemTypeAndProblem(aiServiceId) {
10
+ return request({
11
+ url: '/aiService/discourse/getProblemTypeAndProblem/'+aiServiceId,
12
+ method: 'GET',
13
+ // params: query
14
+ })
15
+ }
16
+
17
+ /**
18
+ * 提问并获取回答
19
+ * @param {{
20
+ * problem: string,
21
+ * aiServiceId: number
22
+ * }} query
23
+ * @returns {{}}
24
+ */
25
+ export function findDataByProblem(data) {
26
+ return request({
27
+ url: '/aiService/discourse/findDataByProblem',
28
+ method: 'POST',
29
+ data
30
+ })
31
+ }
32
+
33
+ /**
34
+ * 根据客服ID 查询提问次数最多的问题
35
+ * @param {{
36
+ * aiServiceId: number
37
+ * }} query
38
+ * @returns
39
+ */
40
+ export function findMaxNumData(aiServiceId) {
41
+ return request({
42
+ url: '/aiService/discourse/findMaxNumData/'+aiServiceId,
43
+ method: 'GET',
44
+ })
45
+ }
46
+
47
+ /**
48
+ * 获取交易服务费客服信息
49
+ * @returns
50
+ */
51
+ export function findServiceFeeAi() {
52
+ return request({
53
+ url: '/aiService/service/findServiceFeeAi',
54
+ method: 'GET',
55
+ })
56
+ }
@@ -0,0 +1,45 @@
1
+ import axios from "axios";
2
+ import { Message } from "element-ui";
3
+
4
+ axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
5
+ // 创建axios实例
6
+ const service = axios.create({
7
+ // axios中请求配置有baseURL选项,表示请求URL公共部分
8
+ baseURL: process.env.VUE_APP_CUSTOMER_PATH,
9
+ // 超时
10
+ timeout: 10000,
11
+ });
12
+
13
+ // request拦截器
14
+ service.interceptors.request.use(
15
+ (config) => {
16
+ return config;
17
+ },
18
+ (error) => {
19
+ Promise.reject(error);
20
+ }
21
+ );
22
+
23
+ // 响应拦截器
24
+ service.interceptors.response.use(
25
+ (res) => {
26
+ return res.data;
27
+ },
28
+ (error) => {
29
+ let { message } = error;
30
+ if (message == "Network Error") {
31
+ message = "后端接口连接异常";
32
+ } else if (message.includes("timeout")) {
33
+ message = "系统接口请求超时";
34
+ } else if (message.includes("Request failed with status code")) {
35
+ message = "系统接口" + message.substr(message.length - 3) + "异常";
36
+ }
37
+ Message({
38
+ message: message,
39
+ type: "error",
40
+ duration: 5 * 1000,
41
+ });
42
+ return Promise.reject(error);
43
+ }
44
+ );
45
+ export default service;
@@ -1,21 +1,31 @@
1
1
  <template>
2
2
  <div>
3
3
  <YcQuestion
4
- title="小优客服"
5
- commit="小优为您提供24小时服务"
6
- :json="JSON.stringify(require('@/assets/questions.js').default)"
4
+ :id="question.id"
5
+ :title="question.serviceName"
6
+ :commit="question.serviceName + '为您提供24小时服务'"
7
7
  ></YcQuestion>
8
8
  </div>
9
9
  </template>
10
10
 
11
11
  <script>
12
+ import { findServiceFeeAi } from "api/customerService"
12
13
  export default {
13
14
  name: "QuestionPage",
14
15
  components: {
15
16
  YcQuestion: () => import("comp/YcQuestion"),
16
17
  },
18
+ data() {
19
+ return {
20
+ question: {},
21
+ }
22
+ },
17
23
  created() {
18
24
  console.log("QuestionPage")
25
+ findServiceFeeAi().then(({ data }) => {
26
+ this.question = data
27
+ console.log(data)
28
+ })
19
29
  },
20
30
  }
21
31
  </script>
package/vue.config.js CHANGED
@@ -15,15 +15,23 @@ module.exports = defineConfig({
15
15
  .set("comp", resolve("src/components"))
16
16
  .set("views", resolve("src/views"))
17
17
  .set("utils", resolve("src/utils"))
18
+ .set("api", resolve("src/api"))
18
19
  },
19
20
  // 前端代理服务器
20
21
  devServer: {
21
22
  proxy: {
22
- [process.env.VUE_APP_PATH]: {
23
- target: process.env.VUE_APP_BASE_API+process.env.VUE_APP_PATH,
23
+ [process.env.VUE_APP_CUSTOMER_PATH]: {
24
+ target: `http://${process.env.VUE_APP_CUSTOMER_API}`,
24
25
  changeOrigin: true,
25
26
  pathRewrite: {
26
- ["^"+process.env.VUE_APP_PATH]: "",
27
+ ["^"+process.env.VUE_APP_CUSTOMER_PATH]: "",
28
+ },
29
+ },
30
+ [process.env.VUE_APP_IMG_PATH]: {
31
+ target: `http://${process.env.VUE_APP_IMG_API+process.env.VUE_APP_IMG_PATH}`,
32
+ changeOrigin: true,
33
+ pathRewrite: {
34
+ ["^"+process.env.VUE_APP_IMG_PATH]: "",
27
35
  },
28
36
  },
29
37
  },