limingtao 11 months ago
parent 21d60ea748
commit 63fcdd2a69
  1. 885
      common/globalJs/request.js
  2. 4
      components/no-data.vue
  3. 2
      pages/index/detail.vue
  4. 6
      pages/index/index.vue
  5. 17
      pages/investigation/index.vue
  6. 576
      pages/logIn/logIn.vue
  7. 24
      pages/mine/index.vue
  8. 317
      pages/mine/password.vue

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

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

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

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

@ -53,12 +53,13 @@
<view v-else class="List Width100 BorderBox"> <view v-else class="List Width100 BorderBox">
<view class="Unit FontBold BorderBox Width100 MarginT_30rpx BG_FFFFFF" v-for="(item,index) in list" <view class="Unit FontBold BorderBox Width100 MarginT_30rpx BG_FFFFFF" v-for="(item,index) in list"
:key='item.businessId+index' @click='handleClick(item)'> :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="right">
<view class="title">{{ item.name }}</view> <view class="title">{{ item.name }}</view>
<view class="type"> <view class="type">
<text v-if="tab === 1">排查</text> <!-- <text v-if="tab === 1">排查</text>
<text v-if="tab === 3">治理</text> <text v-if="tab === 3">治理</text> -->
<text>{{ item.enumname || '--' }}</text>
<text>{{ item.deadlineStatus || '--' }}</text> <text>{{ item.deadlineStatus || '--' }}</text>
</view> </view>
</view> </view>
@ -223,6 +224,12 @@
} else { } else {
this.$.toast(res.message) this.$.toast(res.message)
} }
if(this.status==10){
this.$set(this.totalData,'UnderInvestigation',res.result.total)
}
if(this.status==20){
this.$set(this.totalData,'InGovernance',res.result.total)
}
}).catch((err) => { }).catch((err) => {
this.loadmorestatus = 'nomore' this.loadmorestatus = 'nomore'
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@ -431,7 +438,7 @@
} }
.Unit { .Unit {
padding: 12rpx; padding:20rpx 12rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -459,7 +466,7 @@
.title { .title {
font-size: 16px; font-size: 16px;
width: 380rpx; width: 380rpx;
min-height: 80rpx; min-height: 60rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;

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

@ -6,7 +6,7 @@
<view class="name FontS_50rpx FontBold MarginL_15rpx" <view class="name FontS_50rpx FontBold MarginL_15rpx"
@click="checkObjEmpty(userInfo) ? $.open('/pages/logIn/userInfo'):$.open('/pages/logIn/logIn')"> @click="checkObjEmpty(userInfo) ? $.open('/pages/logIn/userInfo'):$.open('/pages/logIn/logIn')">
{{ userInfo.realName || userInfo.username || '请登录'}} {{ dataInfo.cusername || userInfo.username || '请登录'}}
</view> </view>
<!-- <u-row justify="space-between" gutter="12" class="static-box"> <!-- <u-row justify="space-between" gutter="12" class="static-box">
@ -43,9 +43,10 @@
</u-row> --> </u-row> -->
</view> </view>
<u-cell-group class="margin-top"> <u-cell-group class="margin-top">
<u-cell icon="order" title="警号" :value="dataInfo.policeid" isLink></u-cell> <u-cell icon="order" title="警号" :value="dataInfo.policeid"></u-cell>
<u-cell icon="account" title="身份证号" :value="dataInfo.cdescription" isLink> </u-cell> <u-cell icon="account" title="身份证号" :value="dataInfo.cdescription"> </u-cell>
<u-cell icon="phone" title="联系方式" :value="dataInfo.phone" isLink></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>
<u-cell-group style="margin-top:20rpx;padding:10rpx 20rpx"> <u-cell-group style="margin-top:20rpx;padding:10rpx 20rpx">
<u-cell icon="lock" title="修改密码" isLink @click='possword'></u-cell> <u-cell icon="lock" title="修改密码" isLink @click='possword'></u-cell>
@ -59,9 +60,9 @@
<script> <script>
import tabFun from '@/libs/function/tabbar.js' import tabFun from '@/libs/function/tabbar.js'
const base64Avatar = // const base64Avatar =
"data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3h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z5HSUGt0nr8+pRyemM34/eKYZvfWKgsKUSvsEYJ+84HO4nN9k4oE2x2PzMeOsMVoTIHrM9BMfGM+9tdwloJ1tih9bj1zM5uJM3+RZjDIaA1xVLlYLsvEkC9ribexFDLTRCd69opZq5CTS8SMOSr/L50juoR1Q/wXezDsV4mIn4fYenJF3v/l3i2DR/4Y0rZfMmkGTDMZ4UIj8hR6+i1KJUUuznkWCMuMVxqtA9JtBrJf7+Yag7Px0fJYjvcmy0F4+TZl90igyCCnoSKanvGSyLgpmYSGrJVBX5PFJSMIPAS5WDBHSwUgEwkYdMoA2J2g8u1/VfDG2hxN2McuuBuk9kWTStS7+BXwZioBnkugBrzF7iWoDbUfUJFmUgOAtxO1ofg07l4BqFIkhPzUF+lo3N2WGwKeYVudfOuEUbbVeRTlAOnuwSZrDlMRtpNyc/hfAQYAFFwdv9Iba+4AAAAASUVORK5CYII='
import TopTitle from "../../components/top-title"; import TopTitle from "../../components/top-title";
import Tabbar from "../../components/tabbar.vue"; import Tabbar from "../../components/tabbar.vue";
export default { export default {
@ -146,11 +147,20 @@
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.dataInfo = res.result; this.dataInfo = res.result;
this.$set(this.dataInfo,'cdescription',this.processIDCard(res.result.cdescription))
} else { } else {
this.$.toast(res.message) this.$.toast(res.message)
} }
}); });
}, },
processIDCard(idCard) {
if (idCard.length !== 18) {
return idCard
}
// 使'********'144
return '********' + idCard.slice(-4);
},
// //
possword() { possword() {
// this.$.openNew('/pages/mine/password') // this.$.openNew('/pages/mine/password')

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