From 70e51bee8831b0482f5d3d594dc6c765c89cab4c Mon Sep 17 00:00:00 2001
From: xjs <1294405880@qq.com>
Date: Mon, 24 Jan 2022 11:58:18 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=89=8D=E7=AB=AF=E5=B7=A5=E5=85=B7?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=9E=83=E5=9C=BE=E5=88=86=E7=B1=BB=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ruoyi-ui/src/api/business/openapi/apitools.js | 28 +++++
.../views/business/tools/apitools/index.vue | 114 +++++++++++++++---
.../main/java/com/xjs/consts/ApiConst.java | 2 +-
.../apitools/domain/ApiGarbageSorting.java | 3 +-
.../impl/RollForecastWeatherFactory.java | 3 +-
.../impl/RollGarbageSortingFactory.java | 3 +-
.../factory/impl/RollNowWeatherFactory.java | 3 +-
7 files changed, 136 insertions(+), 20 deletions(-)
diff --git a/ruoyi-ui/src/api/business/openapi/apitools.js b/ruoyi-ui/src/api/business/openapi/apitools.js
index 8f2da1f1..b36d53b9 100644
--- a/ruoyi-ui/src/api/business/openapi/apitools.js
+++ b/ruoyi-ui/src/api/business/openapi/apitools.js
@@ -62,5 +62,33 @@ export function getForecastWeather(city) {
})
}
+//获取垃圾分类信息
+export function getGarbageSorting(name) {
+ return request({
+ url: '/openapi/apitools/garbagesorting/'+name,
+ method: 'get',
+ })
+}
+
+//获取简繁转换信息
+export function getSimpleComplex(content) {
+ return request({
+ url: '/openapi/apitools/simplecomplex/'+content,
+ method: 'get',
+ })
+}
+
+//获取汉语字典信息
+export function getChineseDict(content) {
+ return request({
+ url: '/openapi/apitools/chinesedict/'+content,
+ method: 'get',
+ })
+}
+
+
+
+
+
diff --git a/ruoyi-ui/src/views/business/tools/apitools/index.vue b/ruoyi-ui/src/views/business/tools/apitools/index.vue
index b23fddde..aca3c342 100644
--- a/ruoyi-ui/src/views/business/tools/apitools/index.vue
+++ b/ruoyi-ui/src/views/business/tools/apitools/index.vue
@@ -15,7 +15,6 @@
- 搜索
@@ -74,7 +74,6 @@
- 搜索
@@ -132,7 +132,9 @@
- 搜索
+
+ 搜索
+
@@ -200,7 +202,9 @@
- 搜索
+ 搜索
+
@@ -252,7 +256,7 @@
- 搜索
@@ -261,12 +265,35 @@
-
-
-
+
+
+
- 搜索
+
+
+
+ 名称:{{ aim.goodsName }}
+
+ 类型:{{ aim.goodsType }}
+
+ 推荐
+
+ 名称:{{ data.goodsName }}
+
+ 类型:{{ data.goodsType }}
+
+
+
+ 搜索
+
+
@@ -310,6 +337,9 @@ import {
getMobileBelong,
getNowWeather,
getForecastWeather,
+ getGarbageSorting,
+ getSimpleComplex,
+ getChineseDict
} from "@/api/business/openapi/apitools";
import weather from "@/assets/icons/weather/天气.png"
@@ -328,6 +358,18 @@ export default {
mobileBelongData: {},
nowWeatherData: {},
forecastWeatherData: {},
+ aim: {
+ goodsName: '-',
+ goodsType: '-',
+ },
+ recommendList: [{
+ goodsName: '-',
+ goodsType: '-',
+ }],
+
+
+ simpleComplexData: {},
+ chineseDictData: {},
//-------------input框数据-------------------
@@ -343,6 +385,15 @@ export default {
forecastWeatherForm: {
city: ''
},
+ garbageSortingForm: {
+ name: ''
+ },
+ simpleComplexForm: {
+ content: ''
+ },
+ chineseDictForm: {
+ content: ''
+ },
//------------控制弹出显示隐藏-----------------
@@ -353,6 +404,9 @@ export default {
mobileBelongVisible: false,
nowWeatherVisible: false,
forecastWeatherVisible: false,
+ garbageSortingVisible: false,
+ simpleComplexVisible: false,
+ chineseDictVisible: false,
//----------------遮罩层-------------------
@@ -380,7 +434,10 @@ export default {
],
city: [
{required: true, message: '请输入地名!!!', trigger: 'blur'},
- ]
+ ],
+ name: [
+ {required: true, message: '请输入垃圾名称!!!', trigger: 'blur'},
+ ],
},
@@ -396,6 +453,32 @@ export default {
,
methods: {
+ //获取垃圾分类信息
+ getGarbageSorting(garbageSortingForm) {
+ this.$refs[garbageSortingForm].validate((valid) => {
+ this.aim = {}
+ this.recommendList = []
+ if (valid) {
+ this.loading8 = true
+ getGarbageSorting(this.garbageSortingForm.name).then(res => {
+ this.loading8 = false
+ this.garbageSortingVisible = true
+ if (res.data.aim !== null) {
+ this.aim = res.data.aim;
+ }
+ if (res.data.recommendList !== null) {
+ this.recommendList = res.data.recommendList;
+ }
+ }).catch(err => {
+ this.loading8 = false
+ })
+ } else {
+ return false
+ }
+ })
+ },
+
+
//获取预报天气信息
getForecastWeather(forecastWeatherForm) {
this.$refs[forecastWeatherForm].validate((valid) => {
@@ -413,8 +496,6 @@ export default {
return false
}
})
-
-
},
//获取实时天气信息
@@ -468,6 +549,9 @@ export default {
this.holidayVisible = false;
this.nowWeatherVisible = false;
this.forecastWeatherVisible = false;
+ this.garbageSortingVisible = false;
+ this.simpleComplexVisible = false;
+ this.chineseDictVisible = false;
},
//获取手机归属地信息
diff --git a/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/ApiConst.java b/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/ApiConst.java
index b0925432..571b30dc 100644
--- a/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/ApiConst.java
+++ b/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/ApiConst.java
@@ -130,7 +130,7 @@ public class ApiConst {
/**
* 接口文档:https://www.mxnzp.com/doc/detail?id=14
*/
- public static final String ROLL_GARBAGE_SORTING_URL = "http://www.mxnzp.com/api/rubbish/type";
+ public static final String ROLL_GARBAGE_SORTING_URL = "https://www.mxnzp.com/api/rubbish/type";
/**
* 接口文档:https://www.mxnzp.com/doc/detail?id=15
diff --git a/xjs-business/xjs-business-openapi/src/main/java/com/xjs/apitools/domain/ApiGarbageSorting.java b/xjs-business/xjs-business-openapi/src/main/java/com/xjs/apitools/domain/ApiGarbageSorting.java
index 0e9148dc..6075320d 100644
--- a/xjs-business/xjs-business-openapi/src/main/java/com/xjs/apitools/domain/ApiGarbageSorting.java
+++ b/xjs-business/xjs-business-openapi/src/main/java/com/xjs/apitools/domain/ApiGarbageSorting.java
@@ -3,6 +3,7 @@ package com.xjs.apitools.domain;
import lombok.Data;
import java.io.Serializable;
+import java.util.List;
import java.util.Map;
/**
@@ -25,7 +26,7 @@ public class ApiGarbageSorting implements Serializable {
/**
* 物品垃圾分类类型
*/
- private Map recommendList;
+ private List