master
tangyi 2022-03-31 17:58:34 +08:00
parent d2d47f5355
commit 4e2c174df4
10 changed files with 447 additions and 380 deletions

View File

@ -70,20 +70,20 @@ const request = (method, url, options) => {
methods = 'POST' methods = 'POST'
headers = { headers = {
'Content-Type': 'application/json; charset=UTF-8', 'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || '' 'token':uni.getStorageSync('token') || ''
} }
break; break;
case 'postForm': case 'postForm':
methods = 'POST' methods = 'POST'
headers = { headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || '' 'token':uni.getStorageSync('token') || ''
} }
break; break;
} }
let params = {}; let params = {};
if(options!=undefined) params = options; if(options!=undefined) params = options;
params.token = uni.getStorageSync('token'); // params.token = uni.getStorageSync('token');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: `${hostapi}${url}`, url: `${hostapi}${url}`,
@ -124,7 +124,7 @@ const uploadFile = (url, options) => {
formData: tempData, formData: tempData,
header: { header: {
'Content-Type': 'multipart/form-data;charset=UTF-8', 'Content-Type': 'multipart/form-data;charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || '' 'token':uni.getStorageSync('token') || ''
}, },
success: res => { success: res => {
if (res.statusCode == 200) { if (res.statusCode == 200) {

View File

@ -98,6 +98,19 @@
}, },
data() { data() {
return { return {
data:{
type_id:1,
title:"",
brand:"",
model:"型号",
width:"",
height:"",
contact_name:"",
contact_phone:"",
appointment_time:'',
addres:"",
pictures:"",
},
typeIndex: 0, typeIndex: 0,
typeData: [{ typeData: [{
title: '巡检', title: '巡检',
@ -124,6 +137,7 @@
methods: { methods: {
typeIndexFun(index) { typeIndexFun(index) {
this.typeIndex = index this.typeIndex = index
this.data.type_id=this.typeData
} }
} }
} }

View File

@ -242,6 +242,7 @@
autoplay: true, autoplay: true,
interval: 3000, interval: 3000,
index: 1, index: 1,
projectId:"",
recordState: [{ recordState: [{
title: '维修记录', title: '维修记录',
state: true state: true
@ -257,11 +258,27 @@
] ]
} }
}, },
onLoad(option) {
this.projectId=option.id
this.getData()
},
methods: { methods: {
changeAutoplay(data) { changeAutoplay(data) {
console.log() console.log()
this.index = data.detail.current - 0 + 1 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) { recordNav(index) {
for (var i = 0; i < this.recordState.length; i++) { for (var i = 0; i < this.recordState.length; i++) {
this.recordState[i].state = false this.recordState[i].state = false

View File

@ -32,16 +32,16 @@
</view> </view>
</view> </view>
<view class="project-list"> <view class="project-list">
<view class="li" @click="projectDetailsFun()" v-for="(item,index) in dataList.data" :key="index"> <view class="li" @click="projectDetailsFun(item.id)" v-for="(item,index) in dataList.data" :key="index">
<view class="message"> <view class="message">
<image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image> <image class="img" src="../../static/del/img001.png" mode="aspectFill" lazy-load></image>
<view class="text disjb fc" style="height: 180rpx;"> <view class="text disjb fc" style="height: 180rpx;">
<view class="clips1 fon24 bold">{{item.title}}</view> <view class="clips1 fon24 bold">{{item.project_name}}</view>
<view class="disjb fc" style="margin-left: -20rpx;height: 80%;"> <view class="disjb fc" style="margin-left: -20rpx;height: 80%;">
<view class="serial-number scal09">项目编号{{item.projectCode}}</view> <view class="serial-number scal09">项目编号{{item.projectCode}}</view>
<view class="specification scal09">规格型号{{item.model}}</view> <view class="specification scal09">规格型号{{item.project_number}}</view>
<view class="specification scal09">产品尺寸{{item.size}}</view> <view class="specification scal09">产品尺寸{{item.size}}</view>
<view class="installation-site scal09">安装位置{{item.installationSite}} <view class="installation-site scal09">安装位置{{item.installation_location}}
</view> </view>
</view> </view>
</view> </view>
@ -55,7 +55,7 @@
</view> </view>
<view class="date scal09">{{item.date}}</view> <view class="date scal09">{{item.date}}</view>
</view> </view>
<view v-if="item.state==1" class="icon iconBera"></view> <view v-if="item.warranty_time==1" class="icon iconBera"></view>
<view v-else class="icon iconBer">质保到期</view> <view v-else class="icon iconBer">质保到期</view>
</view> </view>
</view> </view>
@ -101,98 +101,7 @@
dataList: { dataList: {
list_rows: 10, list_rows: 10,
page: 1, page: 1,
data: [{ data: [
title: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
projectCode: "20220108-1001",
model: "DS-CK25FI/H",
installationSite: "xxx综合楼2楼会议室",
address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
date: "2022/01/08",
size: "3.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
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.94*2.02",
state: 1
},
] ]
} }
} }
@ -204,21 +113,23 @@
methods: { methods: {
getData() { getData() {
this.$requst.post('/universal/api.project/project_list', { this.$requst.get('/universal/api.project/project_list', {
list_rows: this.dataList.list_rows, list_rows: this.dataList.list_rows,
page: this.dataList.page, page: this.dataList.page,
}).then(res => { }).then(res => {
// this.$toolAll.tools.showToast(res.msg); // this.$toolAll.tools.showToast(res.msg);
if (res.code == 0) { console.log(res.data.data)
this.dataList = res.data.data if (res.code == 1) {
this.dataList.data = res.data.data
} else { } else {
} }
}) })
}, },
projectDetailsFun() { projectDetailsFun(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/project/details" url: `/pages/project/details?id=${id}`
}) })
}, },
// //

View File

@ -17,9 +17,9 @@
</view> </view>
<view class="fault-type-title padding">故障类型</view> <view class="fault-type-title padding">故障类型</view>
<view class="padding fault-type-content"> <view class="padding fault-type-content">
<view class="li" @click="repairsTypeFun(index)" :class="item.state?'on':''" <view class="li" @click="repairsTypeFun(index)" :class="index==indexType?'on':''"
v-for="(item,index) in faultTypeData"> v-for="(item,index) in faultTypeData">
{{item.title}} {{item.name}}
</view> </view>
</view> </view>
@ -30,7 +30,7 @@
</view> </view>
<image class="sm" src="../../static/iocn/sm.png" mode=""></image> <image class="sm" src="../../static/iocn/sm.png" mode=""></image>
</view> </view>
<input v-model="data.model" class="devicename" placeholder="请填写设备名称和型号" v-else /> <input v-model="data.device_name" class="devicename" placeholder="请填写设备名称和型号" v-else />
@ -41,25 +41,27 @@
</view> </view>
</view> </view>
<textarea value="" v-model="data.condition" class="fault-description" placeholder="故障情况描述" <textarea value="" v-model="data.condition" class="fault-description" placeholder="故障情况描述"
placeholder-class="fault-description-text" /> placeholder-class="fault-description-text" />
<view class="detailed-address inputCss"> <view class="detailed-address inputCss">
<input type="text" v-model="data.address" value="" placeholder="请输入详细的上门服务地址" placeholder-class="inputCss-input" /> <input type="text" v-model="data.address" value="" placeholder="请输入详细的上门服务地址"
placeholder-class="inputCss-input" />
<image @click="mapFun()" src="../../static/iocn/map.png" class="map" mode="aspectFill"></image> <image @click="mapFun()" src="../../static/iocn/map.png" class="map" mode="aspectFill"></image>
</view> </view>
<input type="text" class="inputCss" v-model="data.name" placeholder="请填写您的姓名" placeholder-class="inputCss-input" <input type="text" class="inputCss" v-model="data.username" placeholder="请填写您的姓名"
value="" /> placeholder-class="inputCss-input" value="" />
<input type="text" class="inputCss" v-model="data.tel" placeholder="请填写联系电话" placeholder-class="inputCss-input" <input type="text" class="inputCss" v-model="data.phone" placeholder="请填写联系电话"
value="" /> placeholder-class="inputCss-input" value="" />
<picker mode="date"> <picker mode="date" @change="dateFun()">
<input type="text" class="inputCss" v-model="data.date" placeholder="请选择上门时间" placeholder-class="inputCss-input" <picker mode="time" @change="timeFun()">
value="" /> <input type="text" class="inputCss" v-model="data.date" placeholder="请选择上门时间"
placeholder-class="inputCss-input" value="" />
</picker> </picker>
</picker>
<button class="submit-button" @click="submitButton()" type="default">提交故障申报</button> <button class="submit-button" @click="submitButton()" type="default">提交故障申报</button>
</view> </view>
@ -74,70 +76,46 @@
data() { data() {
return { return {
single: "2021-04-3", single: "2021-04-3",
data: {
data:{ is_device: 0,
model:"", fault_type: "",
condition:"", device_name: "",
address:"", condition: "",
name:"", project_number:"",
tel:"", address: "",
date:"" username: "",
phone: "",
date: ""
}, },
indexType: 0,
navDataState: [{ navDataState: [{
title: "有设备", title: "有设备",
state: false state: false,
is_device: 1
}, },
{ {
title: "无设备", title: "无设备",
state: true state: true,
}, is_device: 0
}
], ],
faultTypeData: [{ 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
},
]
} }
}, },
onLoad(){ onLoad() {
this.getType() this.getType()
}, },
methods: { methods: {
getType(){ //
getType() {
// /universal/api.order/fault_type // /universal/api.order/fault_type
this.$requst.post('/universal/api.work_order/fault_type').then(res => { this.$requst.post('/universal/api.work_order/fault_type').then(res => {
// this.$toolAll.tools.showToast(res.msg); // this.$toolAll.tools.showToast(res.msg);
if (res.code == 0) { if (res.code == 1) {
console.log(res)
this.faultTypeData = [...res.data]
} else { } else {
} }
@ -147,6 +125,13 @@
this.single = e; this.single = e;
console.log("-change事件:", e); console.log("-change事件:", e);
}, },
//
dateFun(data){
},
timeFun(){
},
scanCodeFun() { scanCodeFun() {
uni.scanCode({ uni.scanCode({
success: function(res) { success: function(res) {
@ -155,47 +140,84 @@
} }
}); });
}, },
submitButton(){ submitButton() {
// if() 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() { mapFun() {
uni.getLocation({ uni.getLocation({
type: 'gcj02', //uni.openLocation type: 'gcj02', //uni.openLocation
success: function (res) { success: function(res) {
const latitude = res.latitude; const latitude = res.latitude;
const longitude = res.longitude; const longitude = res.longitude;
console.log(latitude,longitude,78); console.log(latitude, longitude, 78);
uni.chooseLocation({ uni.chooseLocation({
success: function (res) { success: function(res) {
console.log(res,81); console.log(res, 81);
console.log('位置名称:' + res.name); console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address); console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude); console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude); console.log('经度:' + res.longitude);
} }
}); });
// uni.openLocation({ // uni.openLocation({
// latitude: latitude, // latitude: latitude,
// longitude: longitude, // longitude: longitude,
// success: function () { // success: function () {
// console.log('success'); // console.log('success');
// } // }
// }); // });
} }
}); });
}, },
repairsNavFun(index) { repairsNavFun(index) {
for (var i = 0; i < this.navDataState.length; i++) { for (var i = 0; i < this.navDataState.length; i++) {
this.navDataState[i].state = false this.navDataState[i].state = false
} }
this.navDataState[index].state = true this.navDataState[index].state = true
console.log(this.navDataState[index].is_device)
this.data.is_device = this.navDataState[index].is_device
}, },
repairsTypeFun(index) { repairsTypeFun(index) {
for (var i = 0; i < this.faultTypeData.length; i++) { this.indexType = index
this.faultTypeData[i].state = false
}
this.faultTypeData[index].state = true
}, },
} }

View File

@ -1,181 +1,254 @@
<template> <template>
<view class="pad-x180"> <view class="pad-x180">
<status-nav-slot :backgroudColor="backgroudColor"> <status-nav-slot :backgroudColor="backgroudColor">
<!-- <view slot="leftContent"><i class="icon icon-return fon40" :style="{color:newColor}"></i></view> --> <!-- <view slot="leftContent"><i class="icon icon-return fon40" :style="{color:newColor}"></i></view> -->
<view slot="leftContent" style="width: 30rpx;"></view> <view slot="leftContent" style="width: 30rpx;"></view>
<view slot="centerContent"><view :style="{color:newColor}">个人中心</view></view> <view slot="centerContent">
<!-- #ifdef APP-PLUS --> <view :style="{color:newColor}">个人中心</view>
<view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i></view> </view>
<!-- #endif --> <!-- #ifdef APP-PLUS -->
<!-- #ifdef H5 --> <view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i>
<view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i></view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef H5 -->
<view slot="rightContent" style="width: 30rpx;"></view> <view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i>
<!-- #endif --> </view>
</status-nav-slot> <!-- #endif -->
<view class="posir" style="background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;" :style="{paddingTop: newHeight + 'px'}"> <!-- #ifdef MP-WEIXIN -->
<!-- <image src="/static/public/icon-my-logo.png" class="width100" mode="widthFix" lazy-load></image> --> <view slot="rightContent" style="width: 30rpx;"></view>
<view class="mar-zy40"> <!-- #endif -->
<view style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;"> </status-nav-slot>
<view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;"> <view class="posir"
<view class="disac"> style="background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;"
<image class="flexs mar-y10" src="/static/public/icon-my-headimg.png" mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image> :style="{paddingTop: newHeight + 'px'}">
<view class="disjb fc" style="height: 91rpx;"> <!-- <image src="/static/public/icon-my-logo.png" class="width100" mode="widthFix" lazy-load></image> -->
<view class="fon34 bold">156****0510</view> <view class="mar-zy40">
<view class="fon22" style="color: #717171;">未实名认证</view> <view
</view> style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;">
</view> <view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;">
<image src="/static/public/icon-my-level.png" mode="aspectFill" style="width: 49rpx;height: 76rpx;" lazy-load></image> <view class="disac">
</view> <image class="flexs mar-y10" v-if="!userInfo.avatar"
<!-- 信用分项目数量未评价 --> src="/static/public/icon-my-headimg.png" mode="aspectFill"
<view class="disja pad-zy40"> style="width: 91rpx;height: 91rpx;" lazy-load></image>
<view v-for="(item,index) in headList" :key="index" class="disjcac fc"> <image class="flexs mar-y10" v-else src="/static/public/icon-my-headimg.png"
<view style="height: 50rpx;" class="disjcac"> mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image>
<image :src="item.imgsrc" :style="{width: [49,49,46][index] + 'rpx',height: [50,50,42][index] + 'rpx'}" mode="widthFix" lazy-load></image>
</view> <view class="disjb fc" style="height: 91rpx;">
<view class="fon24 col9 mar-sx10">{{item.title}}</view> <view class="fon34 bold">{{tel(userInfo.username)}}</view>
<view class="fon36 bold">{{item.num}}</view> <view class="fon22" style="color: #717171;">未实名认证</view>
</view> </view>
</view> </view>
</view> <image src="/static/public/icon-my-level.png" mode="aspectFill"
<!-- 预约及时率上门准时率项目报修率 --> style="width: 49rpx;height: 76rpx;" lazy-load></image>
<view class="disja mar-s20"> </view>
<view v-for="(item,index) in percentageList" :key="index" class="disjcac fc col3"> <!-- 信用分项目数量未评价 -->
<!-- <cmd-progress type="circle" :percent="item.num" :width="60" :stroke-color="['#00a2e9','#e87c00','#0b56ec'][index]" :circleStrokeColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" :strokeShape="'square'"></cmd-progress> --> <view class="disja pad-zy40">
<arprogress :percent="item.num" <view v-for="(item,index) in headList" :key="index" class="disjcac fc">
:inactiveColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" <view style="height: 50rpx;" class="disjcac">
:activeColor="['#00a2e9','#e87c00','#0b56ec'][index]" <image :src="item.imgsrc"
:borderWidth="7.8" :style="{width: [49,49,46][index] + 'rpx',height: [50,50,42][index] + 'rpx'}"
:width="120" mode="widthFix" lazy-load></image>
:duration="500" </view>
bgColor="transparent"><text :style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text></arprogress> <view class="fon24 col9 mar-sx10">{{item.title}}</view>
<view class="fon24 mar-s20">{{item.title}}</view> <view class="fon36 bold">{{item.num}}</view>
</view> </view>
</view> </view>
<!-- 六宫格 --> </view>
<view class="disjbac fw bacf" style="margin: 30rpx -20rpx 0rpx -20rpx;"> <!-- 预约及时率上门准时率项目报修率 -->
<view @tap="chooseGridEv(index)" class="disjcac fc width50 pad-sx40" v-for="(item,index) in gridList" :key="index" :class="[`${(index%2!=0) ? 'bleft' : ''} ${(index < gridList.length-2) ? 'bbot' : ''}`]" style="box-sizing: border-box;"> <view class="disja mar-s20">
<image :src="item.imgsrc" mode="widthFix" lazy-load :style="{width: [52,52,46,50,46,52][index] + 'rpx',height: [48,45,52,52,53,52][index] + 'rpx'}"></image> <view v-for="(item,index) in percentageList" :key="index" class="disjcac fc col3">
<view class="fon26 col3 mar-s20">{{item.title}}</view> <!-- <cmd-progress type="circle" :percent="item.num" :width="60" :stroke-color="['#00a2e9','#e87c00','#0b56ec'][index]" :circleStrokeColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" :strokeShape="'square'"></cmd-progress> -->
</view> <arprogress :percent="item.num" :inactiveColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]"
</view> :activeColor="['#00a2e9','#e87c00','#0b56ec'][index]" :borderWidth="7.8" :width="120"
<!-- 退出登录 --> :duration="500" bgColor="transparent"><text
<view class="my-exit-btn" @tap="logOutEv">退</view> :style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text>
</view> </arprogress>
</view> <view class="fon24 mar-s20">{{item.title}}</view>
<!-- 底部tab --> </view>
<foot-tab :current='4'></foot-tab> </view>
</view> <!-- 六宫格 -->
<view class="disjbac fw bacf" style="margin: 30rpx -20rpx 0rpx -20rpx;">
<view @tap="chooseGridEv(index)" class="disjcac fc width50 pad-sx40"
v-for="(item,index) in gridList" :key="index"
:class="[`${(index%2!=0) ? 'bleft' : ''} ${(index < gridList.length-2) ? 'bbot' : ''}`]"
style="box-sizing: border-box;">
<image :src="item.imgsrc" mode="widthFix" lazy-load
:style="{width: [52,52,46,50,46,52][index] + 'rpx',height: [48,45,52,52,53,52][index] + 'rpx'}">
</image>
<view class="fon26 col3 mar-s20">{{item.title}}</view>
</view>
</view>
<!-- 退出登录 -->
<view class="my-exit-btn" @tap="logOutEv">退</view>
</view>
</view>
<!-- 底部tab -->
<foot-tab :current='4'></foot-tab>
</view>
</template> </template>
<script> <script>
import statusNavSlot from '@/components/status-navs/status-nav-slot.vue'; import statusNavSlot from '@/components/status-navs/status-nav-slot.vue';
// //
import cmdProgress from '@/components/cmd-progress/cmd-progress.vue'; import cmdProgress from '@/components/cmd-progress/cmd-progress.vue';
// //
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue'; import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
import arprogress from '@/components/ar-circle-progress/index.vue' import arprogress from '@/components/ar-circle-progress/index.vue'
export default { export default {
components:{statusNavSlot,cmdProgress,'foot-tab' :footTabOne,arprogress}, components: {
data() { statusNavSlot,
return { cmdProgress,
newHeight: uni.getSystemInfoSync().statusBarHeight + 50, 'foot-tab': footTabOne,
backgroudColor:'rgba(255,255,255,0)', arprogress
newColor:'rgba(255,255,255,1)', },
headList:[ data() {
{imgsrc:'/static/public/icon-my-creditScore.png',title:'信用分',num:0}, return {
{imgsrc:'/static/public/icon-my-projectNum.png',title:'项目数量',num:0}, newHeight: uni.getSystemInfoSync().statusBarHeight + 50,
{imgsrc:'/static/public/icon-my-notEvaluated.png',title:'未评价',num:0}, backgroudColor: 'rgba(255,255,255,0)',
], newColor: 'rgba(255,255,255,1)',
percentageList:[ headList: [{
{title:'预约及时率',num:100}, imgsrc: '/static/public/icon-my-creditScore.png',
{title:'上门准时率',num:60}, title: '信用分',
{title:'项目报修率',num:40}, num: 0
], },
gridList:[ {
{imgsrc:'/static/public/icon-my-information.png',title:'个人信息'}, imgsrc: '/static/public/icon-my-projectNum.png',
{imgsrc:'/static/public/icon-my-certificates.png',title:'电子证件'}, title: '项目数量',
{imgsrc:'/static/public/icon-my-service.png',title:'服务范围'}, num: 0
{imgsrc:'/static/public/icon-my-evaluate.png',title:'我要评价'}, },
{imgsrc:'/static/public/icon-my-account.png',title:'我的账户'}, {
{imgsrc:'/static/public/icon-my-set.png',title:'设置'}, imgsrc: '/static/public/icon-my-notEvaluated.png',
], title: '未评价',
userInfo:{} num: 0
} },
}, ],
onShow() { percentageList: [{
// title: '预约及时率',
this.checkInfo(); num: 100
}, },
onPageScroll(e) { {
let navHeight = uni.getSystemInfoSync().statusBarHeight + 50; title: '上门准时率',
this.backgroudColor = `rgba(255,255,255,${e.scrollTop/navHeight})`; num: 60
if(e.scrollTop/navHeight < 0.5) { },
this.newColor = `#FFFFFF`; {
} else { title: '项目报修率',
this.newColor = `#000000`; num: 40
} },
}, ],
onLoad() { gridList: [{
// imgsrc: '/static/public/icon-my-information.png',
this.$toolAll.tools.disableShareEv(); title: '个人信息'
}, },
methods: { {
// 退 imgsrc: '/static/public/icon-my-certificates.png',
logOutEv(){ title: '电子证件'
this.$requst.post('/universal/api.login/signout').then(res=>{ },
if(res.code==1) { {
this.$toolAll.tools.showToast('退出成功'); imgsrc: '/static/public/icon-my-service.png',
// title: '服务范围'
uni.clearStorageSync(); },
// {
// #ifdef APP-PLUS imgsrc: '/static/public/icon-my-evaluate.png',
uni.setStorageSync('hostapi','http://maintain.7and5.cn'); title: '我要评价'
// #endif },
// #ifdef H5 {
uni.setStorageSync('hostapi','/web'); imgsrc: '/static/public/icon-my-account.png',
// #endif title: '我的账户'
setTimeout(()=>{ },
uni.reLaunch({ {
url:'/pages/login/login' imgsrc: '/static/public/icon-my-set.png',
}) title: '设置'
},1000) },
} ],
}) userInfo: {}
}, }
checkInfo(){ },
this.$requst.get('/universal/api.user/user_center').then(res=>{ onShow() {
if(res.code==1 && res.data.length!=1) { //
this.userInfo = res.data; this.checkInfo();
},
} onPageScroll(e) {
}) let navHeight = uni.getSystemInfoSync().statusBarHeight + 50;
}, this.backgroudColor = `rgba(255,255,255,${e.scrollTop/navHeight})`;
// if (e.scrollTop / navHeight < 0.5) {
chooseGridEv(index){ this.newColor = `#FFFFFF`;
let urls = [ } else {
'/pagesB/personal-information/personal-information', this.newColor = `#000000`;
'/pagesB/electronic-certificate/electronic-certificate', }
'/pagesB/service-range/service-range', },
'/pages/workOrder/workOrderLlsit?status=已完成', onLoad() {
'/pagesB/my-account/my-account?index=0', //
'/pagesB/set-up/set-up', this.$toolAll.tools.disableShareEv();
]; },
uni.navigateTo({ methods: {
url:urls[index] // 退
}) logOutEv() {
}, this.$requst.post('/universal/api.login/signout').then(res => {
// if (res.code == 1) {
goSetUp(){ this.$toolAll.tools.showToast('退出成功');
uni.navigateTo({ //
url:'/pagesB/set-up/set-up' uni.clearStorageSync();
}) //
} // #ifdef APP-PLUS
} uni.setStorageSync('hostapi', 'http://maintain.7and5.cn');
} // #endif
// #ifdef H5
uni.setStorageSync('hostapi', '/web');
// #endif
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
})
}, 1000)
}
})
},
//
tel(tel) {
const telNum = tel.toString();
const reg = /^(\d{3})\d{4}(\d{4})$/;
return telNum.replace(reg, '$1****$2')
},
//
checkInfo() {
this.$requst.get('/universal/api.user/user_center').then(res => {
if (res.code == 1 && res.data.length != 1) {
this.userInfo = res.data;
this.headList[0].num = this.userInfo.credit
this.headList[1].num = this.userInfo.project_number
this.headList[2].num = this.userInfo.evaluate
this.percentageList[0].num= this.userInfo.reserve_rate-0
this.percentageList[1].num= this.userInfo.visit_rate-0
this.percentageList[2].num= this.userInfo.repair_rate-0
}
})
},
//
chooseGridEv(index) {
let urls = [
'/pagesB/personal-information/personal-information',
'/pagesB/electronic-certificate/electronic-certificate',
'/pagesB/service-range/service-range',
'/pages/workOrder/workOrderLlsit?status=已完成',
'/pagesB/my-account/my-account?index=0',
'/pagesB/set-up/set-up',
];
uni.navigateTo({
url: urls[index]
})
},
//
goSetUp() {
uni.navigateTo({
url: '/pagesB/set-up/set-up'
})
}
}
}
</script> </script>
<style> <style>
page {background-color: #f7f7f7;} page {
background-color: #f7f7f7;
}
</style> </style>

View File

@ -241,7 +241,7 @@
}, },
data() { data() {
return { return {
role: 4, // 1 2: 3: 4 role: 1, // 1 2: 3: 4
statusHeight: uni.getSystemInfoSync().statusBarHeight + 50, statusHeight: uni.getSystemInfoSync().statusBarHeight + 50,
messageNumber: 16 ,// messageNumber: 16 ,//
noticeList:['2021年11月06日公司团建维修服务暂停一天服务暂停一天服务暂停一天。','51akslfj;dkpiojasdjf;j1ij'],// noticeList:['2021年11月06日公司团建维修服务暂停一天服务暂停一天服务暂停一天。','51akslfj;dkpiojasdjf;j1ij'],//
@ -345,9 +345,10 @@
url:url url:url
}) })
}, },
// //
getIncrementServiceType(){ getIncrementServiceType(){
this.$requst.post('/universal/api.vas/vas_type').then(res=>{ this.$requst.get('/universal/api.vas/vas_type').then(res=>{
if(res.code) { if(res.code) {
} }

View File

@ -47,8 +47,11 @@
this.$requst.get('/universal/api.user/electronic_badge').then(res=>{ this.$requst.get('/universal/api.user/electronic_badge').then(res=>{
if(res.code==1){ if(res.code==1){
this.userId=res.data.id
// uni.navigateBack({delta:1}) this.userName=res.data.name
this.userPhone=res.data.phone
this.userEmail=res.data.email
this.website=res.data.website
} }
}) })

View File

@ -33,7 +33,7 @@
methods: { methods: {
// //
getMessageList(){ getMessageList(){
this.$requst.post('/universal/api.message/message_list').then(res=>{ this.$requst.get('/universal/api.message/message_list').then(res=>{
}) })
} }

View File

@ -101,7 +101,32 @@
flag:true flag:true
} }
}, },
onLoad() {
this.getData()
},
methods: { 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(){ sumbmitData(){
if(this.checkEmpty()){ if(this.checkEmpty()){
@ -132,6 +157,7 @@
} }
} }
}, },
// //
checkEmpty(){ checkEmpty(){
let result = false; let result = false;