From 4e2c174df4d2055b5b46789aaab0087732ad1a8e Mon Sep 17 00:00:00 2001
From: tangyi <275503107@qq.com>
Date: Thu, 31 Mar 2022 17:58:34 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jsFile/requst.js | 8 +-
pages/appreciationServe/appreciationServe.vue | 14 +
pages/project/details.vue | 17 +
pages/project/projectList.vue | 115 +----
pages/repairsPage/repairsPage.vue | 214 +++++----
pages/tabbar/my/my.vue | 419 ++++++++++--------
pages/tabbar/pagehome/pagehome.vue | 5 +-
.../electronic-certificate.vue | 7 +-
pagesB/message-center/message-center.vue | 2 +-
.../personal-information.vue | 26 ++
10 files changed, 447 insertions(+), 380 deletions(-)
diff --git a/jsFile/requst.js b/jsFile/requst.js
index 325795e..49acd9d 100644
--- a/jsFile/requst.js
+++ b/jsFile/requst.js
@@ -70,20 +70,20 @@ const request = (method, url, options) => {
methods = 'POST'
headers = {
'Content-Type': 'application/json; charset=UTF-8',
- 'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
+ 'token':uni.getStorageSync('token') || ''
}
break;
case 'postForm':
methods = 'POST'
headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
- 'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
+ 'token':uni.getStorageSync('token') || ''
}
break;
}
let params = {};
if(options!=undefined) params = options;
- params.token = uni.getStorageSync('token');
+ // params.token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
uni.request({
url: `${hostapi}${url}`,
@@ -124,7 +124,7 @@ const uploadFile = (url, options) => {
formData: tempData,
header: {
'Content-Type': 'multipart/form-data;charset=UTF-8',
- 'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
+ 'token':uni.getStorageSync('token') || ''
},
success: res => {
if (res.statusCode == 200) {
diff --git a/pages/appreciationServe/appreciationServe.vue b/pages/appreciationServe/appreciationServe.vue
index 9ee3b15..0fe1fa9 100644
--- a/pages/appreciationServe/appreciationServe.vue
+++ b/pages/appreciationServe/appreciationServe.vue
@@ -98,6 +98,19 @@
},
data() {
return {
+ data:{
+ type_id:1,
+ title:"",
+ brand:"",
+ model:"型号",
+ width:"",
+ height:"",
+ contact_name:"",
+ contact_phone:"",
+ appointment_time:'',
+ addres:"",
+ pictures:"",
+ },
typeIndex: 0,
typeData: [{
title: '巡检',
@@ -124,6 +137,7 @@
methods: {
typeIndexFun(index) {
this.typeIndex = index
+ this.data.type_id=this.typeData
}
}
}
diff --git a/pages/project/details.vue b/pages/project/details.vue
index a6bf4e3..4a36e42 100644
--- a/pages/project/details.vue
+++ b/pages/project/details.vue
@@ -242,6 +242,7 @@
autoplay: true,
interval: 3000,
index: 1,
+ projectId:"",
recordState: [{
title: '维修记录',
state: true
@@ -257,11 +258,27 @@
]
}
},
+ onLoad(option) {
+ this.projectId=option.id
+ this.getData()
+ },
+
methods: {
changeAutoplay(data) {
console.log()
this.index = data.detail.current - 0 + 1
},
+ getData(){
+ this.$requst.get('/universal/api.project/project_info', {
+ id: this.projectId,
+ }).then(res => {
+ if (res.code == 1) {
+ console.log(res.data.data)
+ } else {
+
+ }
+ })
+ },
recordNav(index) {
for (var i = 0; i < this.recordState.length; i++) {
this.recordState[i].state = false
diff --git a/pages/project/projectList.vue b/pages/project/projectList.vue
index 546eae0..9cc8a5a 100644
--- a/pages/project/projectList.vue
+++ b/pages/project/projectList.vue
@@ -32,16 +32,16 @@
-
+
- {{item.title}}
+ {{item.project_name}}
项目编号:{{item.projectCode}}
- 规格型号:{{item.model}}
+ 规格型号:{{item.project_number}}
产品尺寸:{{item.size}}
- 安装位置:{{item.installationSite}}
+ 安装位置:{{item.installation_location}}
@@ -55,7 +55,7 @@
{{item.date}}
- 质保中
+ 质保中
质保到期
@@ -101,98 +101,7 @@
dataList: {
list_rows: 10,
page: 1,
- data: [{
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 0
- },
- {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 1
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 1
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 1
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 0
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 0
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 1
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 0
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 0
- }, {
- title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
- projectCode: "20220108-1001",
- model: "DS-CK25FI/H",
- installationSite: "xxx综合楼2楼会议室",
- address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
- date: "2022/01/08",
- size: "3.94m*2.02m",
- state: 1
- },
+ data: [
]
}
}
@@ -204,21 +113,23 @@
methods: {
getData() {
- this.$requst.post('/universal/api.project/project_list', {
+ this.$requst.get('/universal/api.project/project_list', {
list_rows: this.dataList.list_rows,
page: this.dataList.page,
}).then(res => {
// this.$toolAll.tools.showToast(res.msg);
- if (res.code == 0) {
- this.dataList = res.data.data
+ console.log(res.data.data)
+ if (res.code == 1) {
+ this.dataList.data = res.data.data
+
} else {
}
})
},
- projectDetailsFun() {
+ projectDetailsFun(id) {
uni.navigateTo({
- url: "/pages/project/details"
+ url: `/pages/project/details?id=${id}`
})
},
// 查询
diff --git a/pages/repairsPage/repairsPage.vue b/pages/repairsPage/repairsPage.vue
index fcf10a1..daa2e3f 100644
--- a/pages/repairsPage/repairsPage.vue
+++ b/pages/repairsPage/repairsPage.vue
@@ -17,9 +17,9 @@
故障类型:
-
- {{item.title}}
+ {{item.name}}
@@ -30,9 +30,9 @@
-
-
-
+
+
+
@@ -41,25 +41,27 @@
-
-
+
-
-
-
-
+
+
+
+
+
-
+
@@ -74,72 +76,48 @@
data() {
return {
single: "2021-04-3",
-
- data:{
- model:"",
- condition:"",
- address:"",
- name:"",
- tel:"",
- date:""
+ data: {
+ is_device: 0,
+ fault_type: "",
+ device_name: "",
+ condition: "",
+ project_number:"",
+ address: "",
+ username: "",
+ phone: "",
+ date: ""
},
-
+ indexType: 0,
navDataState: [{
title: "有设备",
- state: false
+ state: false,
+ is_device: 1
},
{
title: "无设备",
- state: true
- },
+ state: true,
+ is_device: 0
+ }
],
- faultTypeData: [{
- title: "供电不足",
- state: false
- },
- {
- title: "参数错误",
- state: false
- },
- {
- title: "模组故障",
- state: false
- },
- {
- title: "网络故障",
- state: false
- },
- {
- title: "外力损坏",
- state: false
- },
- {
- title: "软件问题",
- state: true
- },
- {
- title: "信号故障",
- state: false
- },
- {
- title: "其他问题",
- state: false
- },
- ]
+ faultTypeData: []
}
},
- onLoad(){
- this.getType()
+ onLoad() {
+ this.getType()
},
methods: {
- getType(){
+ // 获取故障类型
+ getType() {
// /universal/api.order/fault_type
this.$requst.post('/universal/api.work_order/fault_type').then(res => {
// this.$toolAll.tools.showToast(res.msg);
- if (res.code == 0) {
- console.log(res)
+ if (res.code == 1) {
+
+
+ this.faultTypeData = [...res.data]
+
} else {
-
+
}
})
},
@@ -147,6 +125,13 @@
this.single = e;
console.log("-change事件:", e);
},
+ // 获取日期
+ dateFun(data){
+
+ },
+
+ timeFun(){
+ },
scanCodeFun() {
uni.scanCode({
success: function(res) {
@@ -155,47 +140,84 @@
}
});
},
- submitButton(){
- // if()
+ submitButton() {
+ this.data.fault_type = this.faultTypeData[this.indexType].id
+
+ if (this.data.is_device == 0){
+ if (!this.data.device_name) {
+ this.$toolAll.tools.showToast("请填写设备名称或型号");
+ return
+ }
+ }else{
+ if (!this.data.project_number) {
+ this.$toolAll.tools.showToast("请扫描设备二维码");
+ return
+ }
+
+ }
+
+ if(!this.data.username){
+ this.$toolAll.tools.showToast("请填写您的姓名");
+ return
+ }
+ var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
+
+ if(!reg_tel.test(this.data.phone)){
+ this.$toolAll.tools.showToast("请正确填写您的电话");
+ return
+ }
+ return
+ this.$requst.post('/universal/api.work_order/repair').then(res => {
+ // this.$toolAll.tools.showToast(res.msg);
+ if (res.code == 1) {
+
+
+ } else {
+
+ }
+ })
+
+ console.log(this.data)
+
+
},
mapFun() {
- uni.getLocation({
- type: 'gcj02', //返回可以用于uni.openLocation的经纬度
- success: function (res) {
- const latitude = res.latitude;
- const longitude = res.longitude;
- console.log(latitude,longitude,78);
- uni.chooseLocation({
- success: function (res) {
- console.log(res,81);
- console.log('位置名称:' + res.name);
- console.log('详细地址:' + res.address);
- console.log('纬度:' + res.latitude);
- console.log('经度:' + res.longitude);
- }
- });
- // uni.openLocation({
- // latitude: latitude,
- // longitude: longitude,
- // success: function () {
- // console.log('success');
- // }
- // });
- }
- });
+ uni.getLocation({
+ type: 'gcj02', //返回可以用于uni.openLocation的经纬度
+ success: function(res) {
+ const latitude = res.latitude;
+ const longitude = res.longitude;
+ console.log(latitude, longitude, 78);
+ uni.chooseLocation({
+ success: function(res) {
+ console.log(res, 81);
+ console.log('位置名称:' + res.name);
+ console.log('详细地址:' + res.address);
+ console.log('纬度:' + res.latitude);
+ console.log('经度:' + res.longitude);
+ }
+ });
+ // uni.openLocation({
+ // latitude: latitude,
+ // longitude: longitude,
+ // success: function () {
+ // console.log('success');
+ // }
+ // });
+ }
+ });
},
repairsNavFun(index) {
for (var i = 0; i < this.navDataState.length; i++) {
this.navDataState[i].state = false
}
this.navDataState[index].state = true
+ console.log(this.navDataState[index].is_device)
+ this.data.is_device = this.navDataState[index].is_device
},
repairsTypeFun(index) {
- for (var i = 0; i < this.faultTypeData.length; i++) {
- this.faultTypeData[i].state = false
- }
- this.faultTypeData[index].state = true
+ this.indexType = index
},
}
diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue
index 9ad69da..59fc994 100644
--- a/pages/tabbar/my/my.vue
+++ b/pages/tabbar/my/my.vue
@@ -1,181 +1,254 @@
-
-
-
-
- 个人中心
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 156****0510
- 未实名认证
-
-
-
-
-
-
-
-
-
-
- {{item.title}}
- {{item.num}}
-
-
-
-
-
-
-
- {{item.num}}%
- {{item.title}}
-
-
-
-
-
-
- {{item.title}}
-
-
-
- 退出登录
-
-
-
-
-
+
+
+
+
+
+ 个人中心
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{tel(userInfo.username)}}
+ 未实名认证
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+ {{item.num}}
+
+
+
+
+
+
+
+ {{item.num}}%
+
+ {{item.title}}
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+ 退出登录
+
+
+
+
+
diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue
index 2ac54f7..35bc2c9 100644
--- a/pages/tabbar/pagehome/pagehome.vue
+++ b/pages/tabbar/pagehome/pagehome.vue
@@ -241,7 +241,7 @@
},
data() {
return {
- role: 4, // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
+ role: 1, // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
statusHeight: uni.getSystemInfoSync().statusBarHeight + 50,
messageNumber: 16 ,// 消息数量
noticeList:['2021年11月06日公司团建,维修服务暂停一天服务暂停一天服务暂停一天。','51akslfj;dkpiojasdjf;j1ij'],//公告
@@ -345,9 +345,10 @@
url:url
})
},
+
// 查询增值服务类型
getIncrementServiceType(){
- this.$requst.post('/universal/api.vas/vas_type').then(res=>{
+ this.$requst.get('/universal/api.vas/vas_type').then(res=>{
if(res.code) {
}
diff --git a/pagesB/electronic-certificate/electronic-certificate.vue b/pagesB/electronic-certificate/electronic-certificate.vue
index d79b90e..211c629 100644
--- a/pagesB/electronic-certificate/electronic-certificate.vue
+++ b/pagesB/electronic-certificate/electronic-certificate.vue
@@ -47,8 +47,11 @@
this.$requst.get('/universal/api.user/electronic_badge').then(res=>{
if(res.code==1){
-
- // uni.navigateBack({delta:1})
+ this.userId=res.data.id
+ this.userName=res.data.name
+ this.userPhone=res.data.phone
+ this.userEmail=res.data.email
+ this.website=res.data.website
}
})
diff --git a/pagesB/message-center/message-center.vue b/pagesB/message-center/message-center.vue
index 7c657fd..693d138 100644
--- a/pagesB/message-center/message-center.vue
+++ b/pagesB/message-center/message-center.vue
@@ -33,7 +33,7 @@
methods: {
// 查询消息列表
getMessageList(){
- this.$requst.post('/universal/api.message/message_list').then(res=>{
+ this.$requst.get('/universal/api.message/message_list').then(res=>{
})
}
diff --git a/pagesB/personal-information/personal-information.vue b/pagesB/personal-information/personal-information.vue
index ae3f20b..adcfd1d 100644
--- a/pagesB/personal-information/personal-information.vue
+++ b/pagesB/personal-information/personal-information.vue
@@ -101,7 +101,32 @@
flag:true
}
},
+ onLoad() {
+ this.getData()
+ },
methods: {
+ // 获取个人信息
+
+ getData(){
+ this.$requst.get('/universal/api.user/user_info').then(res => {
+ if (res.code == 1 && res.data.length != 1) {
+ console.log(res.data)
+ this.nickname=res.data.nickname
+ this.full_name=res.data.name
+ if(res.data.sex==0){
+ this.genderNum=1
+ }else{
+ this.genderNum=res.data.sex
+ }
+ this.contact_number=res.data.phone
+ this.e_mail=res.data.email
+ this.id_card_no=res.data.idcard
+
+
+ }
+ })
+ },
+
// 提交保存事件
sumbmitData(){
if(this.checkEmpty()){
@@ -132,6 +157,7 @@
}
}
},
+
// 判断是否为空
checkEmpty(){
let result = false;