main
guanxiaohan 2 years ago
commit e98e8f4383
  1. 887
      common/globalJs/request.js
  2. 3
      components/mp-html/parser.js
  3. 4
      components/no-data.vue
  4. 12
      components/top-title.vue
  5. 49
      components/zeroMarkdownView/zeroMarkdownView.vue
  6. 4
      manifest.json
  7. 2
      pages/index/detail.vue
  8. 6
      pages/index/index.vue
  9. 7
      pages/investigation/complete.vue
  10. 69
      pages/investigation/index.vue
  11. 5
      pages/investigation/task.vue
  12. 148
      pages/knowledge/index.vue
  13. 578
      pages/logIn/logIn.vue
  14. 2171
      pages/map/index.vue
  15. 30
      pages/mine/index.vue
  16. 295
      pages/mine/password.vue
  17. 115
      uni_modules/uni-easyinput/changelog.md
  18. 54
      uni_modules/uni-easyinput/components/uni-easyinput/common.js
  19. 676
      uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
  20. 88
      uni_modules/uni-easyinput/package.json
  21. 11
      uni_modules/uni-easyinput/readme.md
  22. 4
      uni_modules/uview-ui/components/u-checkbox/props.js
  23. 5
      uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue

@ -6,454 +6,459 @@ const tokenKey = "token";
const tokenKeyValue = "";
class Request {
constructor(config = {}) {
this.config = {};
this.config.baseUrl = config.baseUrl ? config.baseUrl : "";
this.config.dataType = config.dataType ? config.dataType : "json";
this.config.responseType = config.responseType
? config.responseType
: "text";
this.config.header = config.header ? config.header : {};
this.reqInterceptors = null;
this.resInterceptors = null;
this.interceptors = {
request: (fn) => {
this.reqInterceptors = fn;
},
response: (fn) => {
this.resInterceptors = fn;
},
};
}
setConfig(config = {}) {
this.config = this._deepCopy(this._merge(this.config, config));
}
// 请求封装
globalRequest(url, config, method, isForm = "") {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, config));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let header = {};
let tokenData = $.getData("token");
if (tokenData) {
header[tokenKey] = tokenKeyValue + tokenData;
}
if (isForm) {
header["content-type"] = "application/x-www-form-urlencoded";
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, url);
if (url.indexOf("http") != -1) {
fullUrl = url;
}
return new Promise((resolve, reject) => {
uni.request({
url: fullUrl,
method: method,
data: config,
header: header,
async complete(response) {
let res = response;
if (response.statusCode == 404) {
$.toast("请求地址不存在");
} else if (response.statusCode == 500) {
$.toast("服务器内部错误");
} else {
console.log("response", response.statusCode);
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors-----------------',resInterceptors)
if (
resInterceptors.statusCode == 401 ||
resInterceptors.data.code == 403
) {
$.toast("登录信息已过期,请重新登录");
$.removeData("token");
setTimeout(() => {
$.openNew("/pages/logIn/logIn");
}, 1500);
return;
} else if (resInterceptors.statusCode != 200) {
$.toast(resInterceptors.data.message);
}
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
}
resolve(res.data);
},
});
});
}
constructor(config = {}) {
this.config = {};
this.config.baseUrl = config.baseUrl ? config.baseUrl : "";
this.config.dataType = config.dataType ? config.dataType : "json";
this.config.responseType = config.responseType ?
config.responseType :
"text";
this.config.header = config.header ? config.header : {};
this.reqInterceptors = null;
this.resInterceptors = null;
this.interceptors = {
request: (fn) => {
this.reqInterceptors = fn;
},
response: (fn) => {
this.resInterceptors = fn;
},
};
}
setConfig(config = {}) {
this.config = this._deepCopy(this._merge(this.config, config));
}
// 请求封装
globalRequest(url, config, method, isForm = "") {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, config));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let header = {};
let tokenData = $.getData("token");
if (tokenData) {
header[tokenKey] = tokenKeyValue + tokenData;
}
if (isForm) {
header["content-type"] = "application/x-www-form-urlencoded";
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, url);
if (url.indexOf("http") != -1) {
fullUrl = url;
}
return new Promise((resolve, reject) => {
uni.request({
url: fullUrl,
method: method,
data: config,
header: header,
async complete(response) {
let res = response;
if ((response.errMsg == 'request:ok')) {
addFile(file, success, progress) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
let header = {
// 'content-Type':'multipart/form-data'
};
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: file[0].path,
header: header,
name: $.fileImgKey,
formData: {},
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
}
if (response.statusCode == 404) {
$.toast("请求地址不存在");
} else if (response.statusCode == 500) {
$.toast("服务器内部错误");
} else {
// console.log("response", response.statusCode);
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors-----------------',resInterceptors)
if (
resInterceptors.statusCode == 401 ||
resInterceptors.data.code == 403
) {
$.toast("登录信息已过期,请重新登录");
$.removeData("token");
setTimeout(() => {
$.openNew("/pages/logIn/logIn");
}, 1500);
return;
} else if (resInterceptors.statusCode != 200) {
$.toast(resInterceptors.data.message);
}
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
}
resolve(res.data);
}else{
reject()
}
// 上传图片
addImg(length = 1, success, progress, type = 1) {
// 获取本地图片的路径
uni.chooseImage({
count: length,
// original原图compressed压缩图
sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
// camera相机album相册
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success: (res) => {
// 显示上传动画
$.showLoading("图片上传中...");
var imgs;
imgs = res.tempFilePaths;
// #ifdef H5
// 调用上传图片的函数
// 处理多选
// if (imgs.length > length) {
// imgs = imgs.slice(0, length);
// }
this.fileImg(imgs, 0, success, progress, type);
// #endif
// #ifdef APP
console.log("imgs", imgs);
// 将新添加的图片添加到imgs_arr中
uni.compressImage({
src: imgs[0],
quality: 60, // 仅对jpg有效
success: (ress) => {
this.fileImg([ress.tempFilePath], 0, success, progress, type);
},
fail: (err) => {
$.hideLoading("图片上传中...");
},
complete: (msg) => {},
});
// #endif
},
complete: (err) => {},
});
}
fileImg(imgs, index, success, progress, type) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
if (type == 2) {
fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl);
}
let header = {
token: $.getData("token"),
};
// 如果数组长度大于下标,说明没有上传完
if (imgs.length > index) {
var src = imgs[index];
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: src,
header: header,
name: $.fileImgKey,
formData: {},
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors)
let datasJSON = JSON.parse(resInterceptors.data);
if (datasJSON.code == 1101) {
}
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
_this.fileImg(imgs, index + 1, progress);
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
// #ifdef H5
// 压缩
// lrz(src, {
// quality: 0.7,
// }).then((rst) => { // fieldName 为 formData 中多媒体的字段名
},
});
});
}
// })
// #endif
// #ifdef APP-PLUS
// #endif
} else {
$.hideLoading();
}
}
addFile(file, success, progress) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
let header = {
// 'content-Type':'multipart/form-data'
};
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: file[0].path,
header: header,
name: $.fileImgKey,
formData: {},
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
}
// 上传视频
addVideo(url, success, progress) {
// 获取本地视频的路径
uni.chooseVideo({
sourceType: ["album", "camera"], // 选择方式
success: (res) => {
if (res.size > $.videoSize) {
let size = parseInt($.videoSize / 1024000);
$.toast("上传视频过大,大小请不要超过" + size + "M");
} else {
// 显示上传动画
$.showLoading("视频上传中...");
// 调用上传视频的函数
this.fileVideo(res.tempFilePath, url, success, progress);
}
},
fail: (res) => {
console.log(JSON.stringify(res));
},
});
}
fileVideo(src, url, success, progress) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
//上传视频
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: src,
name: $.fileVideoKey,
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors)
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
$.hideLoading();
},
success: (res) => {
success(JSON.parse(res.data));
// 关闭上传动画
},
fail: (e) => {
// 关闭上传动画
$.hideLoading();
$.toast("上传超时!");
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
}
// 上传图片
addImg(length = 1, success, progress, type = 1) {
// 获取本地图片的路径
uni.chooseImage({
count: length,
// original原图compressed压缩图
sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
// camera相机album相册
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success: (res) => {
// 显示上传动画
$.showLoading("图片上传中...");
var imgs;
imgs = res.tempFilePaths;
// #ifdef H5
// 调用上传图片的函数
// 处理多选
// if (imgs.length > length) {
// imgs = imgs.slice(0, length);
// }
this.fileImg(imgs, 0, success, progress, type);
// #endif
// #ifdef APP
console.log("imgs", imgs);
// 将新添加的图片添加到imgs_arr中
uni.compressImage({
src: imgs[0],
quality: 60, // 仅对jpg有效
success: (ress) => {
this.fileImg([ress.tempFilePath], 0, success, progress, type);
},
fail: (err) => {
$.hideLoading("图片上传中...");
},
complete: (msg) => {},
});
// #endif
},
complete: (err) => {},
});
}
fileImg(imgs, index, success, progress, type) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
if (type == 2) {
fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl);
}
let header = {
token: $.getData("token"),
};
// 如果数组长度大于下标,说明没有上传完
if (imgs.length > index) {
var src = imgs[index];
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: src,
header: header,
name: $.fileImgKey,
formData: {},
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors)
let datasJSON = JSON.parse(resInterceptors.data);
if (datasJSON.code == 1101) {}
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
_this.fileImg(imgs, index + 1, progress);
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
// #ifdef H5
// 压缩
// lrz(src, {
// quality: 0.7,
// }).then((rst) => { // fieldName 为 formData 中多媒体的字段名
_formatUrl(baseUrl, url) {
if (!baseUrl) return url;
let formatUrl = "";
const baseUrlEndsWithSlash = baseUrl.endsWith("/");
const urlStartsWithSlash = url.startsWith("/");
if (baseUrlEndsWithSlash && urlStartsWithSlash) {
formatUrl = baseUrl + url.substring(1);
} else if (baseUrlEndsWithSlash || urlStartsWithSlash) {
formatUrl = baseUrl + url;
} else {
formatUrl = baseUrl + "/" + url;
}
return formatUrl;
}
_merge(oldConfig, newConfig) {
let mergeConfig = this._deepCopy(oldConfig);
if (!newConfig || !Object.keys(newConfig).length) return mergeConfig;
for (let key in newConfig) {
if (key !== "header") {
mergeConfig[key] = newConfig[key];
} else {
if (
Object.prototype.toString.call(newConfig[key]) === "[object Object]"
) {
for (let headerKey in newConfig[key]) {
mergeConfig[key][headerKey] = newConfig[key][headerKey];
}
}
}
}
return mergeConfig;
}
_deepCopy(obj) {
let result = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === "object") {
result[key] = this._deepCopy(obj[key]);
} else {
result[key] = obj[key];
}
}
}
return result;
}
// })
// #endif
// #ifdef APP-PLUS
// #endif
} else {
$.hideLoading();
}
}
// 上传视频
addVideo(url, success, progress) {
// 获取本地视频的路径
uni.chooseVideo({
sourceType: ["album", "camera"], // 选择方式
success: (res) => {
if (res.size > $.videoSize) {
let size = parseInt($.videoSize / 1024000);
$.toast("上传视频过大,大小请不要超过" + size + "M");
} else {
// 显示上传动画
$.showLoading("视频上传中...");
// 调用上传视频的函数
this.fileVideo(res.tempFilePath, url, success, progress);
}
},
fail: (res) => {
console.log(JSON.stringify(res));
},
});
}
fileVideo(src, url, success, progress) {
const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log("请求被拦截,此消息仅在开发环境显示。");
return false;
} else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors;
}
lastConfig = this._deepCopy(reqInterceptors);
} else {
lastConfig = this._deepCopy(newConfig);
}
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
//上传视频
return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({
url: fullUrl,
filePath: src,
name: $.fileVideoKey,
async complete(response) {
let res = response;
if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors)
if (!resInterceptors && resInterceptors != "") {
reject("返回值已被您拦截!");
return;
} else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try {
let promiseRes = await resInterceptors;
resolve(promiseRes);
} catch (error) {
reject(error);
}
} else {
res = resInterceptors;
}
}
success(JSON.parse(res.data));
$.hideLoading();
},
success: (res) => {
success(JSON.parse(res.data));
// 关闭上传动画
},
fail: (e) => {
// 关闭上传动画
$.hideLoading();
$.toast("上传超时!");
},
});
// 监听上传进度
if (progress) {
UploadTask.onProgressUpdate((res) => {
progress(res.progress);
});
}
});
}
_formatUrl(baseUrl, url) {
if (!baseUrl) return url;
let formatUrl = "";
const baseUrlEndsWithSlash = baseUrl.endsWith("/");
const urlStartsWithSlash = url.startsWith("/");
if (baseUrlEndsWithSlash && urlStartsWithSlash) {
formatUrl = baseUrl + url.substring(1);
} else if (baseUrlEndsWithSlash || urlStartsWithSlash) {
formatUrl = baseUrl + url;
} else {
formatUrl = baseUrl + "/" + url;
}
return formatUrl;
}
_merge(oldConfig, newConfig) {
let mergeConfig = this._deepCopy(oldConfig);
if (!newConfig || !Object.keys(newConfig).length) return mergeConfig;
for (let key in newConfig) {
if (key !== "header") {
mergeConfig[key] = newConfig[key];
} else {
if (
Object.prototype.toString.call(newConfig[key]) === "[object Object]"
) {
for (let headerKey in newConfig[key]) {
mergeConfig[key][headerKey] = newConfig[key][headerKey];
}
}
}
}
return mergeConfig;
}
_deepCopy(obj) {
let result = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === "object") {
result[key] = this._deepCopy(obj[key]);
} else {
result[key] = obj[key];
}
}
}
return result;
}
}
if (!global.$request) {
global.$request = new Request();
global.$request = new Request();
}
export default global.$request;
export default global.$request;

@ -979,7 +979,8 @@ Parser.prototype.popNode = function () {
const table = Object.assign({}, node)
node.name = 'div'
node.attrs = {
style: 'overflow:auto'
style: 'overflow:auto',
class: 'scrollbar-container'
}
node.children = [table]
attrs = table.attrs

@ -51,8 +51,8 @@ export default {
<style scoped lang="scss">
.Img{
width: 360rpx;
height: 300rpx;
width: 320rpx;
height: 280rpx;
margin: 0 auto;
margin-bottom: 30rpx;
}

@ -37,6 +37,11 @@ export default {
type: Boolean,
default: true,
},
//
isCuMethod: {
type: Boolean,
default: false,
},
//
title: {
type: String,
@ -86,8 +91,13 @@ export default {
},
//
backPage(){
if(this.isCuMethod){
this.$emit('skipPage')
}else{
this.$.back()
}
// this.$emit('backPage')
this.$.back()
},
//
skipPage(item) {

@ -110,11 +110,15 @@
//
ul: `
margin: 10px 0;
color: #555;
font-size: 15px;
line-height:1.75;
word-spacing:0.1em;
`,
li: `
margin: 5px 0;
color: #555;
font-size: 15px;
line-height:1.75;
word-spacing:0.1em;
`,
//
a: `
@ -149,12 +153,12 @@
`,
th: `
border: 1px solid #202121;
color: #555;
// color: #555;
font-size: 14px;
font-weight: 500;
`,
td: `
color:#555;
// color:#555;
border: 1px solid #555555;
font-size: 14px;
`,
@ -175,7 +179,42 @@
<style lang="scss">
.zero-markdown-view {
padding: 15rpx;
padding-bottom: 9rpx;
position: relative;
}
// /deep/ .scrollbar-container{
// display: none;
// }
/* 设置滚动条的宽度和背景色 */
/deep/ .scrollbar-container::-webkit-scrollbar {
display: block!important;
width: 3px!important; /* 滚动条宽度 */
height: 3px!important; /* 对于垂直滚动条,设置高度 */
background-color: #ffffff!important; /* 滚动条背景色 */
}
/* 设置滚动条滑块的样式 */
/deep/ .scrollbar-container::-webkit-scrollbar-thumb {
border-radius: 10px; /* 滑块圆角 */
background-color: #cccccc; /* 滑块颜色 */
}
/* 设置滚动条轨道的样式 */
/deep/ .scrollbar-container::-webkit-scrollbar-track {
border-radius: 10px; /* 轨道圆角 */
box-shadow: inset 0 0 0px grey; /* 轨道阴影 */
background-color: rgba(255,255,255,0); /* 轨道颜色 */
}
/deep/ .md-table {
margin-bottom: 10rpx!important;
}
/deep/ .md-td {
white-space: nowrap;
text-align: center;
}
/deep/ .md-th {
white-space: nowrap;
text-align: center;
}
</style>

@ -135,8 +135,8 @@
"https" : false,
"proxy" : {
"/HiatmpPro" : {
// "target" : "http://49.235.207.167:8800",
"target" : "http://219.147.31.25:30001/tht-app-api",
"target" : "http://49.235.207.167:8800",
// "target" : "http://219.147.31.25:30001/tht-app-api",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {

@ -601,7 +601,7 @@ console.log({
uni.chooseImage({
count: 6, //9
sizeType: ["original", "compressed"], //
sourceType: ["album"], //
sourceType: ["album",'camera'], //
success: async (res) => {
console.log(res);
if (res.tempFilePaths && res.tempFilePaths.length) {

@ -60,11 +60,11 @@
<view v-else class="List Width100 BorderBox">
<view class="Unit FontBold BorderBox Width100 MarginT_30rpx BG_FFFFFF" v-for="item in list"
:key='item.id' @click='handleClick(item)'>
<image class="imgleft" :src="item.imgurl || '/static/logo.png'" mode="widthFix"></image>
<!-- <image class="imgleft" :src="item.imgurl || '/static/logo.png'" mode="widthFix"></image> -->
<view class="right">
<view class="title">{{ item.name }}</view>
<view class="type">
<text>排查</text>
<text>{{ item.enumname || '--' }}</text>
<text>{{ item.deadlineStatus || '--' }}</text>
</view>
</view>
@ -410,7 +410,7 @@
}
.Unit {
padding: 12rpx;
padding: 24rpx 12rpx;
display: flex;
justify-content: space-between;
align-items: center;

@ -2,7 +2,7 @@
<view id="page">
<view class="Width100 Box BorderBox">
<view class="Content BorderBox Width100">
<top-title :is-show-left="true" :title="'排查'" :rightWidth='120' class="custom_bg">
<top-title :isCuMethod="true" @skipPage="skipPage" :is-show-left="true" :title="'排查'" :rightWidth='120' class="custom_bg">
</top-title>
</view>
@ -310,6 +310,11 @@
// this.getList()
},
skipPage(){
this.$.setData('pageStatus', 3)
this.$.setData('pageType', '3')
this.$.openTab('/pages/investigation/index')
},
initTroubleshootingData(id, index) {
this.troubleshootingData[index].extraConfigs = []
this.$request

@ -26,23 +26,23 @@
<text>正在办理</text>
<text class="number">{{ totalData.InGovernance }}</text>
</view> -->
<view class="tab-item" :class="tab === 3 ? 'active' : ''" @click='handleTabClick(3)'>
<view class="tab-item" :class="tab === 3 ? 'active' : ''" @click='handleTabClick(3,true)'>
<text>已完成</text>
<text class="number">{{ totalData.InGovernance }}</text>
</view>
</view>
<view class="type-box" v-show="tab==3">
<view class="type-item" :class="queryType == 1 ? 'type-active' : ''" @click="queryType=1">
<view class="type-item" :class="queryType == 1 ? 'type-active' : ''" @click="queryTypeChange('1')">
全部
</view>
<view class="type-item" :class="queryType == 2 ? 'type-active' : ''" @click="queryType=2">
<view class="type-item" :class="queryType == 2 ? 'type-active' : ''" @click="queryTypeChange('2')">
人工上报
</view>
<view class="type-item" :class="queryType == 3 ? 'type-active' : ''" @click="queryType=3">
<view class="type-item" :class="queryType == 3 ? 'type-active' : ''" @click="queryTypeChange('3')">
系统下发
</view>
</view>
@ -53,12 +53,13 @@
<view v-else class="List Width100 BorderBox">
<view class="Unit FontBold BorderBox Width100 MarginT_30rpx BG_FFFFFF" v-for="(item,index) in list"
:key='item.businessId+index' @click='handleClick(item)'>
<image class="imgleft" :src="item.imgurl || '/static/logo.png'" mode="widthFix"></image>
<!-- <image class="imgleft" :src="item.imgurl || '/static/logo.png'" mode="widthFix"></image> -->
<view class="right">
<view class="title">{{ item.name }}</view>
<view class="type">
<text v-if="tab === 1">排查</text>
<text v-if="tab === 3">治理</text>
<!-- <text v-if="tab === 1">排查</text>
<text v-if="tab === 3">治理</text> -->
<text>{{ item.enumname || '--' }}</text>
<text>{{ item.deadlineStatus || '--' }}</text>
</view>
</view>
@ -107,7 +108,7 @@
Finished: 0,
Unconfirmed: 0,
},
status: '10',
status: '1',
search: '',
tabbarShow: true,
queryType: '1',
@ -124,8 +125,10 @@
// tabFun.tabbar()
this.getData()
let pageStatus = this.$.getData('pageStatus')
this.pageStatus = pageStatus
this.queryType = this.$.getData('pageType')
this.pageStatus = pageStatus
console.log(this.$.getData('pageType'))
if (pageStatus == 1) {
this.handleTabClick(1)
this.$.setData('pageStatus', '0')
@ -149,20 +152,33 @@
},
//
methods: {
handleTabClick(tab) {
queryTypeChange(e) {
this.queryType = e
this.page = 1;
this.$.setData('pageType', e)
this.list = [];
this.isMore = true
this.getList()
},
handleTabClick(tab, falg = false) {
this.tab = tab;
this.page = 1;
this.list = [];
this.isMore = true
switch (tab) {
case 1:
this.status = '10';
this.status = '1';
this.queryType = null
break;
// case 2:
// this.status = '20';
// break;
case 3:
this.status = '20';
if (falg) {
this.queryType = '1'
}
this.status = '2';
break;
}
this.getList()
@ -190,12 +206,13 @@
getList() {
let datas = {
nuserid: this.$.getData('token'),
status: this.status,
status: '10',
}
this.loadmorestatus = 'loading'
let query=this.status==2?`pageNum=${this.page}&pageSize=${10}&search=${this.search}&approve=${this.status}&classification=${this.queryType}`:`pageNum=${this.page}&pageSize=${10}&search=${this.search}&approve=${this.status}`
this.$request.globalRequest(
`/hiddenDanger/highDanger/getHigDangerDealt?pageNum=${this.page}&pageSize=${10}&search=${this.search}`,
`/hiddenDanger/highDanger/getHigDangerDealt?${query}`,
datas, 'POST')
.then(res => {
this.loadmorestatus = 'loadmore'
@ -214,6 +231,12 @@
} else {
this.$.toast(res.message)
}
if (this.status == 1) {
this.$set(this.totalData, 'UnderInvestigation', res.result.total)
}
if (this.status == 2) {
this.$set(this.totalData, 'InGovernance', res.result.total)
}
}).catch((err) => {
this.loadmorestatus = 'nomore'
uni.stopPullDownRefresh();
@ -234,7 +257,7 @@
'&deptId=' + row.handleDept +
'&pcType=' + row.pcType +
'&type=' + (this.tab == 1 ? 'edit' : 'view') + '&sectionName=' + row.sectionName +
'&sectionCode=' + row.sectionCode)
'&sectionCode=' + row.sectionCode + '&taskName=' + row.name)
// this.$.open('/pages/map/index?businessId=' + row.businessId)
}
@ -394,7 +417,8 @@
width: calc(100% - 100rpx);
padding: 0 50rpx;
height: 108rpx;
.type-item{
.type-item {
width: 28%;
border-radius: 200rpx;
height: 50rpx;
@ -404,9 +428,10 @@
border: #999999 solid 1rpx;
margin-top: 15rpx;
}
.type-active{
.type-active {
border: #3c6dc3 solid 1rpx;
color:#3c6dc3;
color: #3c6dc3;
}
}
}
@ -420,7 +445,7 @@
}
.Unit {
padding: 12rpx;
padding: 20rpx 12rpx;
display: flex;
justify-content: space-between;
align-items: center;
@ -448,7 +473,7 @@
.title {
font-size: 16px;
width: 380rpx;
min-height: 80rpx;
min-height: 60rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;

@ -270,7 +270,7 @@
<view v-for="(itemData,indexData) in reversedTroubleshootingData" :key="indexData">
{{ indexData + 1 }}.
{{ itemData.length > 0 ? itemData[0].nname : '' }}
<u-checkbox v-for="(item,index) in itemData" :key="index" :label="item.itemname"
<u-checkbox :isSel="false" v-for="(item,index) in itemData" :key="index" :label="item.itemname"
activeColor="#2663BF" :name="item.id" @click="showInvestigationTag2(item)"
style="padding: 8px 12px;"></u-checkbox>
</view>
@ -324,7 +324,7 @@
</view>
<view class="detail-item" v-else-if="item.type === 'check'">
<uni-forms-item label="平峰流量" label-width="100px" style="display: flex; align-items: center">
<u-checkbox v-model="formData.roadMet"
<u-checkbox v-model="formData.roadMet"
:customStyle="{ justifyContent: 'space-between' }" :name="'sdfs'" />
</uni-forms-item>
</view>
@ -500,7 +500,6 @@
this.sectionCode = e.sectionCode
this.name = e.taskName
this.sectionName = e.sectionName
console.log(e)
this.type = e.type;
this.getBaseData(e.id);

@ -1,6 +1,6 @@
<template>
<view class="detail">
<scroll-view scroll-y="true" :scroll-top="scrollTop" :style="{
<scroll-view @scroll="handleScroll" scroll-y="true" :scroll-top="scrollTop" :style="{
height: isExpanded ? 'calc(100% - 1rpx)' : 'calc(100% - 1rpx)',
}" class="chatlist" :class="{ 'chatlist-wrapper-expanded': isExpanded }" id="scrollView" ref="scrollView"
@click="clickContent">
@ -29,18 +29,13 @@
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="item in msgList" :key="item.id">
<!--<image :src="item.answerId == '0' ? $.imgSrc + '/self.png' : $.imgSrc + '/left_user.png'" class="img" />-->
<image :src="
item.answerId == '0'
? 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9v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AAAAASUVORK5CYII='
: $.imgSrc + '/left_user.png'
" class="img" />
<view class="content">
<zeroMarkdownView :markdown="item.data" />
<!-- <ua-markdown :source="mdvalue" /> -->
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess">
<uni-icons :type="iconsType == '' ? 'hand-up' : (iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" :color="iconsType == 'handUp' ? '#FFD131' : ''" size="22" @click="clickIcon('handUp')"></uni-icons>
<uni-icons :type="iconsType == '' ? 'hand-down' : (iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" size="22" @click="clickIcon('handDown')"></uni-icons>
</view>
</view>
</view>
<view class="loading-animation" v-if="loading">
@ -55,7 +50,7 @@
<input class="uni-input" placeholder="请输入内容" :value="inputValue" @confirm="handleSend"
@input="onKeyInput" />
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus"></uni-icons>
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus" color='#cccccc'></uni-icons>
</view>
<view v-if="isExpanded" class="expanded">
<view @click="chooseImage" class="expandedItem">
@ -69,6 +64,9 @@
</view>
</view>
<!-- <view class="downward" v-if="isToBottom" @click="toBottom">
<u-icon name="arrow-downward"></u-icon>
</view> -->
</view>
</template>
@ -120,7 +118,13 @@
},
],
timer: null,
iconsType: ''
isHandleScroll: true,
startX: 0, // X
startY: 0, // Y
isScrolling: false, //
isToBottom: false,
lastScrollTop: 0, //
temp: 0,
};
},
onLoad() {
@ -148,35 +152,68 @@
}
},
methods: {
clickIcon(type) {
if(this.iconsType == '') {
this.iconsType = type
} else {
if(this.iconsType == 'handUp') {
if(type == 'handUp') {
this.iconsType = ''
} else {
this.iconsType = 'handDown'
}
} else {
if(type == 'handUp') {
this.iconsType = 'handUp'
} else {
this.iconsType = ''
}
handleTouchStart(e) {
//
this.startX = e.touches[0].clientX;
this.startY = e.touches[0].clientY;
// this.isScrolling = false; //
},
handleTouchMove(e) {
//
let moveX = e.touches[0].clientX;
let moveY = e.touches[0].clientY;
//
let deltaX = moveX - this.startX;
let deltaY = moveY - this.startY;
// 5px
if (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5) {
// this.isScrolling = true; //
this.isHandleScroll = false
// deltaY
if (deltaY > 0) {
console.log('用户正在向下滑动');
} else if (deltaY < 0) {
console.log('用户正在向上滑动');
}
// startXstartYmoveXmoveY
//
}
const params = {
qaId: '',
feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2),
feedbackInfo: ''
// startXstartY
},
handleTouchEnd(e) {
//
// startXstartY
//
},
handleScroll(event) {
// event.detail
const scrollTop = event.detail.scrollTop;
if (scrollTop > this.lastScrollTop) {
console.log('向下滑动');
} else {
this.temp++
if (this.temp == 2) {
this.isHandleScroll = false
}
console.log('向上滑动');
}
// this.$request.globalRequest('/hitapChat/hitap/feadBack', params, 'POST').then(res => {})
this.lastScrollTop = scrollTop;
},
toBottom() {
this.isToBottom = false
this.scrollTop = Number(this.scrollTop) + 100;
this.isHandleScroll = true
},
async queryChat(voiceText) {
// console.log(voiceText,"voiceText");
clearInterval(this.timer)
this.answerIsOver = false
this.loading = true;
const [err, res] = await uni.request({
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat',
@ -246,6 +283,8 @@
duration: 2000,
});
}
this.temp = 0
this.isHandleScroll = true
this.changeMsgList("0", this.inputValue || text);
this.queryChat(this.inputValue || text);
this.inputValue = "";
@ -271,7 +310,6 @@
id,
answerId,
data: newdata,
isSuccess: true
},
];
} else {
@ -285,11 +323,13 @@
// this.$refs.scrollView.$refs.content
// ? this.$refs.scrollView.$refs.content.scrollHeight
// : 0;
this.scrollTop = this.scrollTop + 100;
if (this.isHandleScroll) {
this.scrollTop = Number(this.scrollTop) + 100;
}
});
if (newdata == data) {
clearInterval(this.timer);
this.msgList[this.msgList.length - 1].isOver = true
}
}, 50);
} else {
@ -308,13 +348,17 @@
// this.$refs.scrollView.$refs.content
// ? this.$refs.scrollView.$refs.content.scrollHeight
// : 0;
this.scrollTop = this.scrollTop + 100;
if (this.isHandleScroll) {
this.scrollTop = Number(this.scrollTop) + 100;
}
});
}
},
handlePlus() {
this.isExpanded = !this.isExpanded;
this.$.toast("此功能暂不开放");
// this.isExpanded = !this.isExpanded;
},
clickContent() {
if (this.isExpanded) {
@ -733,7 +777,7 @@
}
.text {
font-size: 28rpx;
font-size: 32rpx;
}
}
@ -975,12 +1019,24 @@
transform: scale(1);
}
}
.icon{
.downward {
position: fixed;
z-index: 100rpx;
right: 20rpx;
bottom: 150rpx;
background: #ffffff;
border: #cccccc solid 1px;
width: 60rpx;
height: 60rpx;
border-radius: 50%;
display: flex;
justify-content: flex-end;
margin: 0 15rpx 15rpx 12rpx;
.uni-icons{
margin-left: 15rpx;
justify-content: center;
align-items: center;
/deep/ .u-icon__icon {
font-size: 30rpx !important;
color: #999999 !important;
}
}
</style>

@ -1,17 +1,18 @@
<template>
<view id="page">
<view class="Width100 Box" :style="bgUrl1">
<view class="Content MarginAuto">
<image :src="$.imgSrc + '/scimg/logo1.png'" mode="aspectFit" class="Block Logo"></image>
<view class="NavBox Width100 MarginT_60rpx">
<view class="Unit FloatL PositionR" v-for="(item,index) in navList" @click="chooseNav(item.type)">
<text class="Block" :class="currNav == item.type ? 'FontS_46rpx Color_1A1F39 FontBold':'FontS_42rpx Color_B4BAC9'">
{{ item.label }}</text>
<view class="Line BG_0064FF PositionA" v-show="currNav == item.type"></view>
</view>
<view class="ClearB"></view>
</view>
<!-- <view class="TypeBox MarginT_60rpx" v-if="currNav == 1">
<view id="page">
<view class="Width100 Box" :style="bgUrl1">
<view class="Content MarginAuto">
<image :src="$.imgSrc + '/scimg/logo1.png'" mode="aspectFit" class="Block Logo"></image>
<view class="NavBox Width100 MarginT_60rpx">
<view class="Unit FloatL PositionR" v-for="(item,index) in navList" @click="chooseNav(item.type)">
<text class="Block"
:class="currNav == item.type ? 'FontS_46rpx Color_1A1F39 FontBold':'FontS_42rpx Color_B4BAC9'">
{{ item.label }}</text>
<view class="Line BG_0064FF PositionA" v-show="currNav == item.type"></view>
</view>
<view class="ClearB"></view>
</view>
<!-- <view class="TypeBox MarginT_60rpx" v-if="currNav == 1">
<view class="Unit FloatL" v-for="(item,index) in typeList" @click="chooseType(item.type)">
<view class="Point FloatL" v-show="currType == item.type">
<image :src="$.imgSrc + '/scimg/choose_y1.png'" mode="aspectFit" class="Block Width100 Height100"></image>
@ -22,27 +23,31 @@
</view>
<view class="ClearB"></view>
</view> -->
<view class="InputBox" :class="currNav == 1 ? 'MarginT_40rpx' : 'MarginT_80rpx'">
<view class="Input MarginT_40rpx BG_F6F7FB">
<!-- <view class="Num FloatL TextLeft MarginL_60rpx">-->
<!-- <text class="InlineBlock FontS_34rpx Color_1A1F39 FontBold">+86</text>-->
<!-- </view>-->
<input type="text" placeholder="请输入用户名" v-model="logInData.phone" class="Height100 Input1 FloatL MarginL_60rpx FontS_32rpx">
<view class="ClearB"></view>
</view>
<view class="Input MarginT_40rpx BG_F6F7FB" v-if="currNav == 1">
<input type="text" v-model="logInData.validateCode" placeholder="请输入验证码" class="Height100 Input1 FloatL MarginL_60rpx FontS_32rpx">
<view class="CodeBox FloatR MarginR_60rpx" @click="getCode">
<text class="Block FontS_28rpx" :class="isCodeDisabled ? 'Color_B4BAC9':'Color_0064FF'">{{ btnText }}</text>
</view>
<view class="ClearB"></view>
</view>
<view class="Input MarginT_40rpx BG_F6F7FB">
<input type="password" v-model="logInData.password" placeholder="请输入您的密码" class="Height100 Input2 FloatL MarginL_60rpx FontS_32rpx">
<view class="ClearB"></view>
</view>
</view>
<!-- <view class="Agree Width100 MarginT_60rpx" @click="chooseAgree">
<view class="InputBox" :class="currNav == 1 ? 'MarginT_40rpx' : 'MarginT_80rpx'">
<view class="Input MarginT_40rpx BG_F6F7FB">
<!-- <view class="Num FloatL TextLeft MarginL_60rpx">-->
<!-- <text class="InlineBlock FontS_34rpx Color_1A1F39 FontBold">+86</text>-->
<!-- </view>-->
<input type="text" placeholder="请输入用户名" v-model="logInData.phone"
class="Height100 Input1 FloatL MarginL_60rpx FontS_32rpx">
<view class="ClearB"></view>
</view>
<view class="Input MarginT_40rpx BG_F6F7FB" v-if="currNav == 1">
<input type="text" v-model="logInData.validateCode" placeholder="请输入验证码"
class="Height100 Input1 FloatL MarginL_60rpx FontS_32rpx">
<view class="CodeBox FloatR MarginR_60rpx" @click="getCode">
<text class="Block FontS_28rpx"
:class="isCodeDisabled ? 'Color_B4BAC9':'Color_0064FF'">{{ btnText }}</text>
</view>
<view class="ClearB"></view>
</view>
<view class="Input MarginT_40rpx BG_F6F7FB">
<input type="password" v-model="logInData.password" placeholder="请输入您的密码"
class="Height100 Input2 FloatL MarginL_60rpx FontS_32rpx">
<view class="ClearB"></view>
</view>
</view>
<!-- <view class="Agree Width100 MarginT_60rpx" @click="chooseAgree">
<view class="Point FloatL" v-if="isAgree">
<image :src="$.imgSrc + '/scimg/choose_y1.png'" mode="aspectFit" class="Block Width100 Height100"></image>
</view>
@ -53,255 +58,280 @@
<text class="Block FloatL Color_0064FF FontS_26rpx" @click.stop="checkAgree(3)">隐私协议</text>
<view class="ClearB"></view>
</view> -->
<button type="button" :disabled="isDisabled" class="Btn Block Width100 Color_FFFFFF FontS_36rpx FontBold" @click="confirmSub">{{ currNav == 1 ? '注册':'登录' }}</button>
<text @click="findPsw" class="Block MarginT_40rpx TextCenter FontS_26rpx Color_0064FF" v-if="currNav == 2">找回密码</text>
</view>
</view>
</view>
<button type="button" :disabled="isDisabled"
class="Btn Block Width100 Color_FFFFFF FontS_36rpx FontBold"
@click="confirmSub">{{ currNav == 1 ? '注册':'登录' }}</button>
<text @click="findPsw" class="Block MarginT_40rpx TextCenter FontS_26rpx Color_0064FF"
v-if="currNav == 2">找回密码</text>
</view>
</view>
</view>
</template>
<script>
export default {
//
components: {},
data() {
return {
// js
$: this.$,
bgUrl1:'', //
isAgree:false,
navList:[
// {type:1,label:''},
{type:2,label:'登录'},
],
currNav:2,
currType:1,
isDisabled:false,
logInData:{
phone:'', //
validateCode:'', //
password:'', //
}, //
btnText:'获取验证码',
times:null,
seconds:60,
isCodeDisabled:false,
}
},
//
onLoad(e) {
if(typeof(e.type) != 'undefined'){
this.currNav = e.type
}
},
//
onShow() {
//
this.bgUrl1 = "background-image:url('" + this.$.imgSrc + "/scimg/bg1.png');background-repeat: no-repeat;background-position: center top;background-size:100% 472rpx;"
},
//
computed: {},
//
methods: {
checkAgree(type){
let urlKey = 'portalTextType'
this.$.open('/pages/logIn/agree?type=' + type)
},
getCode(){
if(!this.$.isEmpty(this.logInData.phone)){
this.$.toast('请输入手机号')
return
}
let datas = {
phone:this.logInData.phone,
type:2
}
this.isCodeDisabled = true
this.$request.globalRequest('/hyjg-admin/mapi/account/sendSmsCode', datas, 'POST').then(res => {
if(res.code == 0){
this.timeDown()
}else{
this.$.toast(res.msg)
this.isCodeDisabled = false
}
})
},
timeDown(){
this.times = setInterval(() => {
if(this.seconds > 0){
this.seconds --
this.btnText = this.seconds + 'S'
}else {
this.seconds = 60
this.isCodeDisabled = false
this.btnText = '获取验证码'
clearInterval(this.times)
}
},1000)
},
//
confirmSub(){
// this.$.setData('token','1')
// this.$.openTab('/pages/index/index')
// return
// this.$.open('/pages/logIn/userInfo')
let url = '/hyjg-admin/mapi/account/register'
if(!this.$.isEmpty(this.logInData.phone)){
this.$.toast('请填写用户名')
return
}
if(!this.$.isEmpty(this.logInData.password)){
this.$.toast('请填写密码')
return
}
// if(!this.isAgree){
// this.$.toast('')
// return
// }
let datas = {
nuserid: this.logInData.phone,
cuserpwd: this.logInData.password,
}
url = '/hiddenDanger/auth/login'
this.$.showLoading('登录中...')
this.isDisabled = true
this.$request.globalRequest(url, datas, 'POST').then(res => {
if(res.code === 200){
this.$.toast('登录成功')
this.$.setData('token',res.result.nuserid)
this.$.setData('userInfo', { username: res.result.nuserid,role:res.result.role })
setTimeout(() => {
this.$.hideLoading('登录中...')
this.isDisabled = false
this.$.openTab('/pages/index/index')
},1500)
}else{
this.$.toast(res.message)
this.isDisabled = false
}
})
},
//
findPsw(){
this.$.open('/pages/logIn/findPsw')
},
chooseAgree(){
this.isAgree = !this.isAgree
},
chooseNav(type){
this.currNav = type
},
chooseType(type){
this.currType = type
},
//
skipPage(even){
this.$.open(even)
},
},
onReady() {
},
//
onUnload() {
export default {
//
components: {},
data() {
return {
// js
$: this.$,
bgUrl1: '', //
isAgree: false,
navList: [
// {type:1,label:''},
{
type: 2,
label: '登录'
},
],
currNav: 2,
currType: 1,
isDisabled: false,
logInData: {
phone: '', //
validateCode: '', //
password: '', //
}, //
btnText: '获取验证码',
times: null,
seconds: 60,
isCodeDisabled: false,
}
},
//
onLoad(e) {
if (typeof(e.type) != 'undefined') {
this.currNav = e.type
}
},
//
onShow() {
//
this.bgUrl1 = "background-image:url('" + this.$.imgSrc +
"/scimg/bg1.png');background-repeat: no-repeat;background-position: center top;background-size:100% 472rpx;"
},
//
computed: {},
//
methods: {
checkAgree(type) {
let urlKey = 'portalTextType'
this.$.open('/pages/logIn/agree?type=' + type)
},
getCode() {
if (!this.$.isEmpty(this.logInData.phone)) {
this.$.toast('请输入手机号')
return
}
let datas = {
phone: this.logInData.phone,
type: 2
}
this.isCodeDisabled = true
this.$request.globalRequest('/hyjg-admin/mapi/account/sendSmsCode', datas, 'POST').then(res => {
if (res.code == 0) {
this.timeDown()
} else {
this.$.toast(res.msg)
this.isCodeDisabled = false
}
})
},
timeDown() {
this.times = setInterval(() => {
if (this.seconds > 0) {
this.seconds--
this.btnText = this.seconds + 'S'
} else {
this.seconds = 60
this.isCodeDisabled = false
this.btnText = '获取验证码'
clearInterval(this.times)
}
}, 1000)
},
//
confirmSub() {
// this.$.setData('token','1')
// this.$.openTab('/pages/index/index')
// return
// this.$.open('/pages/logIn/userInfo')
let url = '/hyjg-admin/mapi/account/register'
if (!this.$.isEmpty(this.logInData.phone)) {
this.$.toast('请填写用户名')
return
}
if (!this.$.isEmpty(this.logInData.password)) {
this.$.toast('请填写密码')
return
}
// if(!this.isAgree){
// this.$.toast('')
// return
// }
let datas = {
nuserid: this.logInData.phone,
cuserpwd: this.logInData.password,
}
url = '/hiddenDanger/auth/login'
this.$.showLoading('登录中...')
this.isDisabled = true
this.$request.globalRequest(url, datas, 'POST').then(res => {
if (res.code === 200) {
this.$.toast('登录成功')
this.$.setData('token', res.result.nuserid)
this.$.setData('userInfo', {
username: res.result.nuserid,
role: res.result.role
})
setTimeout(() => {
this.$.hideLoading('登录中...')
this.isDisabled = false
this.$.openTab('/pages/index/index')
}, 1500)
} else {
this.$.toast(res.message)
this.isDisabled = false
}
}).catch(() => {
this.isDisabled = false
this.$.toast('连接服务器失败')
})
},
//
findPsw() {
this.$.open('/pages/logIn/findPsw')
},
chooseAgree() {
this.isAgree = !this.isAgree
},
chooseNav(type) {
this.currNav = type
},
chooseType(type) {
this.currType = type
},
//
skipPage(even) {
this.$.open(even)
},
},
onReady() {},
//
onUnload() {
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {
},
}
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {},
}
</script>
<style>
page {
background:#FFFFFF;
background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.Box {
padding-top: var(--status-bar-height);
.Box{
padding-top:var(--status-bar-height);
.Content{
width: calc(100% - 176rpx);
padding: 132rpx 0rpx 180rpx 0rpx;
.Logo{
width: 150rpx;
height: 150rpx;
}
.NavBox{
.Unit{
margin-right: 110rpx;
.Line{
left: 50%;
transform: translateX(-50%);
bottom: -26rpx;
width: 74rpx;
height: 10rpx;
border-radius: 6rpx;
}
}
}
.TypeBox{
.Unit{
margin-right: 108rpx;
.Point{
width: 46rpx;
height: 46rpx;
}
.Border{
width: 46rpx;
height: 46rpx;
border: 4rpx solid #B3BACB;
}
}
}
.InputBox{
.Input{
height: 110rpx;
border-radius: 56rpx;
.CodeBox{
text{
line-height: 110rpx;
}
}
.Num{
width: 110rpx;
border-right: 4rpx solid #DADADA;
margin-top: 34rpx;
}
.Input1{
width: calc(100% - 260rpx);
}
.Input2{
width: calc(100% - 120rpx);
}
}
}
.Agree{
.Point{
width: 34rpx;
height: 34rpx;
}
.Border{
width: 34rpx;
height: 34rpx;
border: 2rpx solid #B3BACB;
}
}
.Btn{
margin-top: 196rpx;
height: 108rpx;
background: linear-gradient(90deg, #0064FF 0%, #2D99FD 100%);
box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(194,218,255,1);
border-radius: 54rpx;
line-height: 108rpx;
}
}
}
</style>
.Content {
width: calc(100% - 176rpx);
padding: 132rpx 0rpx 180rpx 0rpx;
.Logo {
width: 150rpx;
height: 150rpx;
}
.NavBox {
.Unit {
margin-right: 110rpx;
.Line {
left: 50%;
transform: translateX(-50%);
bottom: -26rpx;
width: 74rpx;
height: 10rpx;
border-radius: 6rpx;
}
}
}
.TypeBox {
.Unit {
margin-right: 108rpx;
.Point {
width: 46rpx;
height: 46rpx;
}
.Border {
width: 46rpx;
height: 46rpx;
border: 4rpx solid #B3BACB;
}
}
}
.InputBox {
.Input {
height: 110rpx;
border-radius: 56rpx;
.CodeBox {
text {
line-height: 110rpx;
}
}
.Num {
width: 110rpx;
border-right: 4rpx solid #DADADA;
margin-top: 34rpx;
}
.Input1 {
width: calc(100% - 260rpx);
}
.Input2 {
width: calc(100% - 120rpx);
}
}
}
.Agree {
.Point {
width: 34rpx;
height: 34rpx;
}
.Border {
width: 34rpx;
height: 34rpx;
border: 2rpx solid #B3BACB;
}
}
.Btn {
margin-top: 196rpx;
height: 108rpx;
background: linear-gradient(90deg, #0064FF 0%, #2D99FD 100%);
box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(194, 218, 255, 1);
border-radius: 54rpx;
line-height: 108rpx;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -6,7 +6,7 @@
<view class="name FontS_50rpx FontBold MarginL_15rpx"
@click="checkObjEmpty(userInfo) ? $.open('/pages/logIn/userInfo'):$.open('/pages/logIn/logIn')">
{{ userInfo.realName || userInfo.username || '请登录'}}
{{ dataInfo.cusername || userInfo.username || '请登录'}}
</view>
<!-- <u-row justify="space-between" gutter="12" class="static-box">
@ -43,9 +43,10 @@
</u-row> -->
</view>
<u-cell-group class="margin-top">
<u-cell icon="order" title="警号" :value="dataInfo.policeid" isLink></u-cell>
<u-cell icon="account" title="身份证号" :value="dataInfo.cdescription" isLink> </u-cell>
<u-cell icon="phone" title="联系方式" :value="dataInfo.phone" isLink></u-cell>
<u-cell icon="order" title="警号" :value="dataInfo.policeid"></u-cell>
<u-cell icon="account" title="身份证号" :value="dataInfo.cdescription"> </u-cell>
<u-cell icon="phone" title="联系方式" :value="dataInfo.phone"></u-cell>
<u-cell icon="coupon" title="所属部门" :value="dataInfo.cdepartmentname"></u-cell>
</u-cell-group>
<u-cell-group style="margin-top:20rpx;padding:10rpx 20rpx">
<u-cell icon="lock" title="修改密码" isLink @click='possword'></u-cell>
@ -59,9 +60,9 @@
<script>
import tabFun from '@/libs/function/tabbar.js'
const base64Avatar =
"data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLm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UgOAtxO1ofg07l4BqFIkhPzUF+lo3N2WGwKeYVudfOuEUbbVeRTlAOnuwSZrDlMRtpNyc/hfAQYAFFwdv9Iba+4AAAAASUVORK5CYII='
import TopTitle from "../../components/top-title";
import Tabbar from "../../components/tabbar.vue";
export default {
@ -79,7 +80,7 @@
timer: null,
num: 0,
dataInfo: {},
tabbarShow: true
tabbarShow: true,
// funcList: [
// { id:1,name:'',url:'/pages/logIn/userInfo',icon:'/mine/userinfo.png' },
// { id:2,name:'',url:'/pages/mine/insurance',icon:'/mine/insurance.png' },
@ -88,6 +89,7 @@
// { id:5,name:'',url:'/pages/mine/jobfind',icon:'/mine/jobfind.png' },
// { id:6,name:'',url:'/pages/mine/worker',icon:'/mine/jobfind.png' },
// ]
}
},
computed: {
@ -130,7 +132,8 @@
onHide() {
// this.timer && clearInterval(this.timer)
},
onLoad() {
onLoad(e) {
},
methods: {
@ -146,11 +149,20 @@
.then((res) => {
if (res.code === 200) {
this.dataInfo = res.result;
this.$set(this.dataInfo,'cdescription',this.processIDCard(res.result.cdescription))
} else {
this.$.toast(res.message)
}
});
},
processIDCard(idCard) {
if (idCard.length !== 18) {
return idCard
}
// 使'********'144
return '********' + idCard.slice(-4);
},
//
possword() {
// this.$.openNew('/pages/mine/password')

@ -1,21 +1,34 @@
<template>
<view id="page" class="password-box">
<view class="Width100 Box BorderBox">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" class="form" labelWidth="100">
<!-- <u-form-item label="原密码" prop="password" borderBottom>
<view id="page" class="password-box">
<view class="Width100 Box BorderBox">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" class="form" labelWidth="80">
<!-- <u-form-item label="原密码" prop="password" borderBottom>
<u--input v-model="form.password" border="none"></u--input>
</u-form-item> -->
<u-form-item label="新密码" prop="password" borderBottom>
<u--input v-model="form.password" border="none"></u--input>
</u-form-item>
<u-form-item label="确认密码" prop="confirmPassword" borderBottom>
<u--input v-model="form.confirmPassword" border="none"></u--input>
</u-form-item>
</u--form>
<view @click="submit" class="Unit FontBold BorderBox TextCenter Width100 MarginT_30rpx BorderR_30rpx submit">
提交
</view>
<!-- <uni-forms :modelValue="formData" border>
<u-form-item label="新密码" prop="password" borderBottom style="position: relative;">
<uni-easyinput type="password" v-model="form.password" :clearable="false"></uni-easyinput>
<!-- <u--input v-model="form.password" border="none" :password="isPassword">
</u--input> -->
<!-- <u-icon size="20" name="eye-off" v-if="isPassword" @click.native="isPassword=!isPassword" style="position: absolute;right: 30rpx;"></u-icon>
<u-icon size="20" name="eye-fill" v-else @click.native="isPassword=!isPassword" style="position: absolute;right: 30rpx;"></u-icon> -->
</u-form-item>
<u-form-item label="确认密码" prop="confirmPassword" borderBottom style="position: relative;">
<uni-easyinput type="password" v-model="form.confirmPassword" :clearable="false"></uni-easyinput>
<!-- <u--input v-model="form.confirmPassword" border="none" :password="isPassword">
</u--input> -->
<!-- <u-icon size="20" name="eye-off" v-if="isPassword" @click.native="isPassword=!isPassword" style="position: absolute;right: 30rpx;"></u-icon>
<u-icon size="20" name="eye-fill" v-else @click.native="isPassword=!isPassword" style="position: absolute;right: 30rpx;"></u-icon> -->
</u-form-item>
<text class="tip"> 密码需要包含数字大小写字母特殊符号中3种以上组合</text>
</u--form>
<view @click="submit"
class="Unit FontBold BorderBox TextCenter Width100 MarginT_30rpx BorderR_30rpx submit">
提交
</view>
<!-- <uni-forms :modelValue="formData" border>
<uni-forms-item label="道路类型">
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadType"
placeholder="请输入道路类型" />
@ -24,138 +37,160 @@
}}</text>
</uni-forms-item>
</uni-forms > -->
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// js
$: this.$,
rules: {
// 'password': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
export default {
data() {
return {
// js
$: this.$,
rules: {
// 'password': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
},
form: {
confirmPassword: "",
password: ""
},
isPassword: true
}
},
//
onLoad(e) {
},
//
onShow() {},
//
computed: {},
//
methods: {
// sexSelect(e) {
// this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex')
// },
},
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
//
onUnload() {
},
form: {
confirmPassword: "",
password: ""
},
}
},
//
onLoad(e) {
},
methods: {
isValidPassword(password) {
//
const hasDigit = /\d/.test(password);
const hasUpper = /[A-Z]/.test(password);
const hasLower = /[a-z]/.test(password);
const hasSpecial = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password); //
},
//
onShow() {
},
//
computed: {},
//
methods: {
// sexSelect(e) {
// this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex')
// },
},
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
//
onUnload() {
//
let count = 0;
if (hasDigit) count++;
if (hasUpper) count++;
if (hasLower) count++;
if (hasSpecial) count++;
},
methods: {
//
submit() {
if (!this.form.password) {
this.$.toast('请输入密码')
}
else if (this.form.password != this.form.confirmPassword) {
this.$.toast('两次密码不一致')
} else {
this.$request
.globalRequest(
"/hiddenDanger/auth/updatePwd",
{
cusername: this.$.getData('userInfo').username,
nuserid: this.$.getData("token"),
nuserpwd: this.form.password,
},
"POST",
true
)
.then((res) => {
// 3
return count >= 3;
},
//
submit() {
if (!this.form.password) {
this.$.toast('请输入密码')
} else if(!this.isValidPassword(this.form.password)){
this.$.toast('密码格式不正确')
} else if (this.form.password != this.form.confirmPassword) {
this.$.toast('两次密码不一致')
} else {
this.$request
.globalRequest(
"/hiddenDanger/auth/updatePwd", {
cusername: this.$.getData('userInfo').username,
nuserid: this.$.getData("token"),
nuserpwd: this.form.password,
},
"POST",
true
)
.then((res) => {
if (res.code === 200) {
this.$.toast('密码修改成功~')
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 2000);
} else {
this.$.toast(res.message)
}
if (res.code === 200) {
this.$.toast('密码修改成功~')
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 2000);
} else {
this.$.toast(res.message)
}
});
}
});
}
},
},
//
onPullDownRefresh() {
},
},
//
onPullDownRefresh() {
},
//
onReachBottom() {
},
}
},
//
onReachBottom() {},
}
</script>
<style>
</style>
<style lang="scss" scoped>
page {
background: #F6F8FA;
}
page {
background: #F6F8FA;
}
.password-box {
position: fixed;
width: 100%;
height: 100%;
background-color: #F6F8FA;
padding: 10rpx 30rpx;
.password-box {
position: fixed;
width: 100%;
height: 100%;
background-color: #F6F8FA;
padding: 10rpx 30rpx;
.form {
width: 690rpx;
}
.form {
width: 690rpx;
}
.tip{
font-size:24rpx;
top:10rpx;
position:relative;
color:#e01515;
}
/deep/ .u-form-item__body {
padding: 30rpx 10rpx;
}
/deep/ .u-form-item__body {
padding: 30rpx 10rpx;
}
.submit {
/* background: #E1EDFF; */
background: linear-gradient(90deg, #0064FF 0%, #2D99FD 100%);
color: #ffffff;
width: 690rpx !important;
height: 94rpx;
line-height: 94rpx;
border-radius: 13rpx;
margin-top: 70rpx;
font-weight: 500;
margin-left: 0;
font-size: 32rpx;
letter-spacing: 4rpx;
}
}
.submit {
/* background: #E1EDFF; */
background: linear-gradient(90deg, #0064FF 0%, #2D99FD 100%);
color: #ffffff;
width: 690rpx !important;
height: 94rpx;
line-height: 94rpx;
border-radius: 13rpx;
margin-top: 70rpx;
font-weight: 500;
margin-left: 0;
font-size: 32rpx;
letter-spacing: 4rpx;
}
}
</style>

@ -0,0 +1,115 @@
## 1.1.19(2024-07-18)
- 修复 初始值传入 null 导致input报错的bug
## 1.1.18(2024-04-11)
- 修复 easyinput组件双向绑定问题
## 1.1.17(2024-03-28)
- 修复 在头条小程序下丢失事件绑定的问题
## 1.1.16(2024-03-20)
- 修复 在密码输入情况下 清除和小眼睛覆盖bug 在edge浏览器下显示双眼睛bug
## 1.1.15(2024-02-21)
- 新增 左侧插槽:left
## 1.1.14(2024-02-19)
- 修复 onBlur的emit传值错误
## 1.1.12(2024-01-29)
- 补充 adjust-position文档属性补充
## 1.1.11(2024-01-29)
- 补充 adjust-position属性传递值:(Boolean)当键盘弹起时,是否自动上推页面
## 1.1.10(2024-01-22)
- 去除 移除无用的log输出
## 1.1.9(2023-04-11)
- 修复 vue3 下 keyboardheightchange 事件报错的bug
## 1.1.8(2023-03-29)
- 优化 trim 属性默认值
## 1.1.7(2023-03-29)
- 新增 cursor-spacing 属性
## 1.1.6(2023-01-28)
- 新增 keyboardheightchange 事件,可监听键盘高度变化
## 1.1.5(2022-11-29)
- 优化 主题样式
## 1.1.4(2022-10-27)
- 修复 props 中背景颜色无默认值的bug
## 1.1.0(2022-06-30)
- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- 新增 clear 事件,点击右侧叉号图标触发
- 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
- 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
## 1.0.5(2022-06-07)
- 优化 clearable 显示策略
## 1.0.4(2022-06-07)
- 优化 clearable 显示策略
## 1.0.3(2022-05-20)
- 修复 关闭图标某些情况下无法取消的 bug
## 1.0.2(2022-04-12)
- 修复 默认值不生效的 bug
## 1.0.1(2022-04-02)
- 修复 value 不能为 0 的 bug
## 1.0.0(2021-11-19)
- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
## 0.1.4(2021-08-20)
- 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug
## 0.1.3(2021-08-11)
- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
## 0.1.2(2021-07-30)
- 优化 vue3 下事件警告的问题
## 0.1.1
- 优化 errorMessage 属性支持 Boolean 类型
## 0.1.0(2021-07-13)
- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.0.16(2021-06-29)
- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
## 0.0.15(2021-06-21)
- 修复 passwordIcon 属性拼写错误的 bug
## 0.0.14(2021-06-18)
- 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标
- 修复 confirmType 属性不生效的问题
## 0.0.13(2021-06-04)
- 修复 disabled 状态可清出内容的 bug
## 0.0.12(2021-05-12)
- 新增 组件示例地址
## 0.0.11(2021-05-07)
- 修复 input-border 属性不生效的问题
## 0.0.10(2021-04-30)
- 修复 ios 遮挡文字、显示一半的问题
## 0.0.9(2021-02-05)
- 调整为 uni_modules 目录规范
- 优化 兼容 nvue 页面

@ -0,0 +1,54 @@
/**
* @desc 函数防抖
* @param func 目标函数
* @param wait 延迟执行毫秒数
* @param immediate true - 立即执行 false - 延迟执行
*/
export const debounce = function(func, wait = 1000, immediate = true) {
let timer;
return function() {
let context = this,
args = arguments;
if (timer) clearTimeout(timer);
if (immediate) {
let callNow = !timer;
timer = setTimeout(() => {
timer = null;
}, wait);
if (callNow) func.apply(context, args);
} else {
timer = setTimeout(() => {
func.apply(context, args);
}, wait)
}
}
}
/**
* @desc 函数节流
* @param func 函数
* @param wait 延迟执行毫秒数
* @param type 1 使用表时间戳在时间段开始的时候触发 2 使用表定时器在时间段结束的时候触发
*/
export const throttle = (func, wait = 1000, type = 1) => {
let previous = 0;
let timeout;
return function() {
let context = this;
let args = arguments;
if (type === 1) {
let now = Date.now();
if (now - previous > wait) {
func.apply(context, args);
previous = now;
}
} else if (type === 2) {
if (!timeout) {
timeout = setTimeout(() => {
timeout = null;
func.apply(context, args)
}, wait)
}
}
}
}

@ -0,0 +1,676 @@
<template>
<view class="uni-easyinput" :class="{ 'uni-easyinput-error': msg }" :style="boxStyle">
<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="22"></uni-icons>
<slot name="left">
</slot>
<!-- #ifdef MP-ALIPAY -->
<textarea :enableNative="enableNative" v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{ 'input-padding': inputBorder }" :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" placeholder-class="uni-easyinput__placeholder-class" :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" @input="onInput" @blur="_Blur" @focus="_Focus" @confirm="onConfirm" @keyboardheightchange="onkeyboardheightchange"></textarea>
<input :enableNative="enableNative" v-else :type="type === 'password' ? 'text' : type" class="uni-easyinput__content-input" :style="inputStyle" :name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" @focus="_Focus" @blur="_Blur" @input="onInput" @confirm="onConfirm" @keyboardheightchange="onkeyboardheightchange" />
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{ 'input-padding': inputBorder }" :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" placeholder-class="uni-easyinput__placeholder-class" :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" @input="onInput" @blur="_Blur" @focus="_Focus" @confirm="onConfirm" @keyboardheightchange="onkeyboardheightchange"></textarea>
<input v-else :type="type === 'password' ? 'text' : type" class="uni-easyinput__content-input" :style="inputStyle" :name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" @focus="_Focus" @blur="_Blur" @input="onInput" @confirm="onConfirm" @keyboardheightchange="onkeyboardheightchange" />
<!-- #endif -->
<template v-if="type === 'password' && passwordIcon">
<!-- 开启密码时显示小眼睛 -->
<uni-icons v-if="isVal" class="content-clear-icon" :class="{ 'is-textarea-icon': type === 'textarea' }" :type="showPassword ? 'eye-slash-filled' : 'eye-filled'" :size="22" :color="focusShow ? primaryColor : '#c0c4cc'" @click="onEyes"></uni-icons>
</template>
<template v-if="suffixIcon">
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')" size="22"></uni-icons>
</template>
<template v-else>
<uni-icons v-if="clearable && isVal && !disabled && type !== 'textarea'" class="content-clear-icon" :class="{ 'is-textarea-icon': type === 'textarea' }" type="clear" :size="clearSize" :color="msg ? '#dd524d' : focusShow ? primaryColor : '#c0c4cc'" @click="onClear"></uni-icons>
</template>
<slot name="right"></slot>
</view>
</view>
</template>
<script>
/**
* Easyinput 输入框
* @description 此组件可以实现表单的输入与校验包括 "text" "textarea" 类型
* @tutorial https://ext.dcloud.net.cn/plugin?id=3455
* @property {String} value 输入内容
* @property {String } type 输入框的类型默认text password/text/textarea/..
* @value text 文本输入键盘
* @value textarea 多行文本输入键盘
* @value password 密码输入键盘
* @value number 数字输入键盘注意iOS上app-vue弹出的数字键盘并非9宫格方式
* @value idcard 身份证输入键盘支付宝百度QQ小程序
* @value digit 带小数点的数字键盘 App的nvue页面微信支付宝百度头条QQ小程序支持
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件点击可清空输入框内容默认true
* @property {Boolean} autoHeight 是否自动增高输入区域type为textarea时有效默认true
* @property {String } placeholder 输入框的提示文字
* @property {String } placeholderStyle placeholder的样式(内联样式字符串)"color: #ddd"
* @property {Boolean} focus 是否自动获得焦点默认false
* @property {Boolean} disabled 是否禁用默认false
* @property {Number } maxlength 最大输入长度设置为 -1 的时候不限制最大长度默认140
* @property {String } confirmType 设置键盘右下角按钮的文字仅在type="text"时生效默认done
* @property {Number } clearSize 清除图标的大小单位px默认15
* @property {String} prefixIcon 输入框头部图标
* @property {String} suffixIcon 输入框尾部图标
* @property {String} primaryColor 设置主题色默认#2979ff
* @property {Boolean} trim 是否自动去除两端的空格
* @property {Boolean} cursorSpacing 指定光标与键盘的距离单位 px
* @property {Boolean} ajust-position 当键盘弹起时是否上推内容默认值true
* @value both 去除两端空格
* @value left 去除左侧空格
* @value right 去除右侧空格
* @value start 去除左侧空格
* @value end 去除右侧空格
* @value all 去除全部空格
* @value none 不去除空格
* @property {Boolean} inputBorder 是否显示input输入框的边框默认true
* @property {Boolean} passwordIcon type=password时是否显示小眼睛图标
* @property {Object} styles 自定义颜色
* @event {Function} input 输入框内容发生变化时触发
* @event {Function} focus 输入框获得焦点时触发
* @event {Function} blur 输入框失去焦点时触发
* @event {Function} confirm 点击完成按钮时触发
* @event {Function} iconClick 点击图标时触发
* @example <uni-easyinput v-model="mobile"></uni-easyinput>
*/
function obj2strClass(obj) {
let classess = '';
for (let key in obj) {
const val = obj[key];
if (val) {
classess += `${key} `;
}
}
return classess;
}
function obj2strStyle(obj) {
let style = '';
for (let key in obj) {
const val = obj[key];
style += `${key}:${val};`;
}
return style;
}
export default {
name: 'uni-easyinput',
emits: [
'click',
'iconClick',
'update:modelValue',
'input',
'focus',
'blur',
'confirm',
'clear',
'eyes',
'change',
'keyboardheightchange'
],
model: {
prop: 'modelValue',
event: 'update:modelValue'
},
options: {
// #ifdef MP-TOUTIAO
virtualHost: false,
// #endif
// #ifndef MP-TOUTIAO
virtualHost: true
// #endif
},
inject: {
form: {
from: 'uniForm',
default: null
},
formItem: {
from: 'uniFormItem',
default: null
}
},
props: {
name: String,
value: [Number, String],
modelValue: [Number, String],
type: {
type: String,
default: 'text'
},
clearable: {
type: Boolean,
default: true
},
autoHeight: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: ' '
},
placeholderStyle: String,
focus: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
maxlength: {
type: [Number, String],
default: 140
},
confirmType: {
type: String,
default: 'done'
},
clearSize: {
type: [Number, String],
default: 24
},
inputBorder: {
type: Boolean,
default: true
},
prefixIcon: {
type: String,
default: ''
},
suffixIcon: {
type: String,
default: ''
},
trim: {
type: [Boolean, String],
default: false
},
cursorSpacing: {
type: Number,
default: 0
},
passwordIcon: {
type: Boolean,
default: true
},
adjustPosition: {
type: Boolean,
default: true
},
primaryColor: {
type: String,
default: '#2979ff'
},
styles: {
type: Object,
default () {
return {
color: '#333',
backgroundColor: 'rgba(0,0,0,0)',
disableColor: 'rgba(0,0,0,0)',
borderColor: 'rgba(0,0,0,0)'
};
}
},
errorMessage: {
type: [String, Boolean],
default: ''
},
// #ifdef MP-ALIPAY
enableNative: {
type: Boolean,
default: false
}
// #endif
},
data() {
return {
focused: false,
val: '',
showMsg: '',
border: false,
isFirstBorder: false,
showClearIcon: false,
showPassword: false,
focusShow: false,
localMsg: '',
isEnter: false // 使
};
},
computed: {
//
isVal() {
const val = this.val;
// fixed by mehaotian 00
if (val || val === 0) {
return true;
}
return false;
},
msg() {
// console.log('computed', this.form, this.formItem);
// if (this.form) {
// return this.errorMessage || this.formItem.errMsg;
// }
// TODO formItem errMsg
return this.localMsg || this.errorMessage;
},
// uniappinputmaxlength
inputMaxlength() {
return Number(this.maxlength);
},
// style
boxStyle() {
return `color:${
this.inputBorder && this.msg ? '#e43d33' : this.styles.color
};`;
},
// input
inputContentClass() {
return obj2strClass({
// 'is-input-border': this.inputBorder,
'is-input-error-border': this.inputBorder && this.msg,
'is-textarea': this.type === 'textarea',
'is-disabled': this.disabled,
'is-focused': this.focusShow
});
},
inputContentStyle() {
const focusColor = this.focusShow ?
this.primaryColor :
this.styles.borderColor;
const borderColor =
this.inputBorder && this.msg ? '#dd524d' : focusColor;
return obj2strStyle({
'border-color': borderColor || '#e5e5e5',
'background-color': this.disabled ?
this.styles.disableColor : this.styles.backgroundColor
});
},
// input
inputStyle() {
const paddingRight =
this.type === 'password' || this.clearable || this.prefixIcon ?
'' :
'10px';
return obj2strStyle({
'padding-right': paddingRight,
'padding-left': this.prefixIcon ? '' : '10px'
});
}
},
watch: {
value(newVal) {
// fix by mehaotian nullinputbug
if (newVal === null) {
this.val = '';
return
}
this.val = newVal;
},
modelValue(newVal) {
if (newVal === null) {
this.val = '';
return
}
this.val = newVal;
},
focus(newVal) {
this.$nextTick(() => {
this.focused = this.focus;
this.focusShow = this.focus;
});
}
},
created() {
this.init();
// TODO vue3 computed inject formItem.errMsg
if (this.form && this.formItem) {
this.$watch('formItem.errMsg', newVal => {
this.localMsg = newVal;
});
}
},
mounted() {
this.$nextTick(() => {
this.focused = this.focus;
this.focusShow = this.focus;
});
},
methods: {
/**
* 初始化变量值
*/
init() {
if (this.value || this.value === 0) {
this.val = this.value;
} else if (
this.modelValue ||
this.modelValue === 0 ||
this.modelValue === ''
) {
this.val = this.modelValue;
} else {
// fix by ht nullinput
this.val = '';
}
},
/**
* 点击图标时触发
* @param {Object} type
*/
onClickIcon(type) {
this.$emit('iconClick', type);
},
/**
* 显示隐藏内容密码框时生效
*/
onEyes() {
this.showPassword = !this.showPassword;
this.$emit('eyes', this.showPassword);
},
/**
* 输入时触发
* @param {Object} event
*/
onInput(event) {
let value = event.detail.value;
//
if (this.trim) {
if (typeof this.trim === 'boolean' && this.trim) {
value = this.trimStr(value);
}
if (typeof this.trim === 'string') {
value = this.trimStr(value, this.trim);
}
}
if (this.errMsg) this.errMsg = '';
this.val = value;
// TODO vue2
this.$emit('input', value);
// TODO  vue3
this.$emit('update:modelValue', value);
},
/**
* 外部调用方法
* 获取焦点时触发
* @param {Object} event
*/
onFocus() {
this.$nextTick(() => {
this.focused = true;
});
this.$emit('focus', null);
},
_Focus(event) {
this.focusShow = true;
this.$emit('focus', event);
},
/**
* 外部调用方法
* 失去焦点时触发
* @param {Object} event
*/
onBlur() {
this.focused = false;
this.$emit('blur', null);
},
_Blur(event) {
let value = event.detail.value;
this.focusShow = false;
this.$emit('blur', event);
// eventstring
if (this.isEnter === false) {
this.$emit('change', this.val);
}
//
if (this.form && this.formItem) {
const { validateTrigger } = this.form;
if (validateTrigger === 'blur') {
this.formItem.onFieldChange();
}
}
},
/**
* 按下键盘的发送键
* @param {Object} e
*/
onConfirm(e) {
this.$emit('confirm', this.val);
this.isEnter = true;
this.$emit('change', this.val);
this.$nextTick(() => {
this.isEnter = false;
});
},
/**
* 清理内容
* @param {Object} event
*/
onClear(event) {
this.val = '';
// TODO vue2
this.$emit('input', '');
// TODO vue2
// TODO  vue3
this.$emit('update:modelValue', '');
//
this.$emit('clear');
},
/**
* 键盘高度发生变化的时候触发此事件
* 兼容性微信小程序2.7.0+App 3.1.0+
* @param {Object} event
*/
onkeyboardheightchange(event) {
this.$emit('keyboardheightchange', event);
},
/**
* 去除空格
*/
trimStr(str, pos = 'both') {
if (pos === 'both') {
return str.trim();
} else if (pos === 'left') {
return str.trimLeft();
} else if (pos === 'right') {
return str.trimRight();
} else if (pos === 'start') {
return str.trimStart();
} else if (pos === 'end') {
return str.trimEnd();
} else if (pos === 'all') {
return str.replace(/\s+/g, '');
} else if (pos === 'none') {
return str;
}
return str;
}
}
};
</script>
<style lang="scss">
$uni-error: #e43d33;
$uni-border-1: #dcdfe6 !default;
.uni-easyinput {
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
flex: 1;
position: relative;
text-align: left;
color: #333;
font-size: 14px;
}
.uni-easyinput__content {
flex: 1;
/* #ifndef APP-NVUE */
width: 100%;
display: flex;
box-sizing: border-box;
// min-height: 36px;
/* #endif */
flex-direction: row;
align-items: center;
// border
border-color: #fff;
transition-property: border-color;
transition-duration: 0.3s;
}
.uni-easyinput__content-input {
/* #ifndef APP-NVUE */
width: auto;
/* #endif */
position: relative;
overflow: hidden;
flex: 1;
line-height: 1;
font-size: 14px;
height: 35px;
// min-height: 36px;
/*ifdef H5*/
& ::-ms-reveal {
display: none;
}
& ::-ms-clear {
display: none;
}
& ::-o-clear {
display: none;
}
/*endif*/
}
.uni-easyinput__placeholder-class {
color: #999;
font-size: 12px;
// font-weight: 200;
}
.is-textarea {
align-items: flex-start;
}
.is-textarea-icon {
margin-top: 5px;
}
.uni-easyinput__content-textarea {
position: relative;
overflow: hidden;
flex: 1;
line-height: 1.5;
font-size: 14px;
margin: 6px;
margin-left: 0;
height: 80px;
min-height: 80px;
/* #ifndef APP-NVUE */
min-height: 80px;
width: auto;
/* #endif */
}
.input-padding {
padding-left: 10px;
}
.content-clear-icon {
padding: 0 5px;
}
.label-icon {
margin-right: 5px;
margin-top: -1px;
}
//
.is-input-border {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
flex-direction: row;
align-items: center;
border: 1px solid $uni-border-1;
border-radius: 4px;
/* #ifdef MP-ALIPAY */
overflow: hidden;
/* #endif */
}
.uni-error-message {
position: absolute;
bottom: -17px;
left: 0;
line-height: 12px;
color: $uni-error;
font-size: 12px;
text-align: left;
}
.uni-error-msg--boeder {
position: relative;
bottom: 0;
line-height: 22px;
}
.is-input-error-border {
border-color: $uni-error;
.uni-easyinput__placeholder-class {
color: mix(#fff, $uni-error, 50%);
}
}
.uni-easyinput--border {
margin-bottom: 0;
padding: 10px 15px;
// padding-bottom: 0;
border-top: 1px #eee solid;
}
.uni-easyinput-error {
padding-bottom: 0;
}
.is-first-border {
/* #ifndef APP-NVUE */
border: none;
/* #endif */
/* #ifdef APP-NVUE */
border-width: 0;
/* #endif */
}
.is-disabled {
background-color: #f7f6f6;
color: #d5d5d5;
.uni-easyinput__placeholder-class {
color: #d5d5d5;
font-size: 12px;
}
}
</style>

@ -0,0 +1,88 @@
{
"id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框",
"version": "1.1.19",
"description": "Easyinput 组件是对原生input组件的增强",
"keywords": [
"uni-ui",
"uniui",
"input",
"uni-easyinput",
"输入框"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

@ -0,0 +1,11 @@
### Easyinput 增强输入框
> **组件名:uni-easyinput**
> 代码块: `uEasyinput`
easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

@ -4,6 +4,10 @@ export default {
name: {
type: [String, Number, Boolean],
default: uni.$u.props.checkbox.name,
},
isSel: {
type: [Boolean],
default:true,
},
// item
obj: {

@ -214,7 +214,10 @@
this.preventEvent(e)
// label
if (!this.elLabelDisabled && !this.elDisabled) {
this.setRadioCheckedStatus()
if(this.isSel){
this.setRadioCheckedStatus()
}
this.$emit('click', this.obj)
}
},

Loading…
Cancel
Save