解决reust.js冲突(都在headers中添加了token)

master
chen 2022-03-31 18:37:25 +08:00
commit f4f2042106
12 changed files with 482 additions and 539 deletions

View File

@ -86,7 +86,7 @@ const request = (method, url, options) => {
} }
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}`,

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

@ -135,21 +135,23 @@
}, },
// //
chooseImg() { chooseImg() {
console.log( uni.getStorageSync('token')) console.log( uni.getStorageSync("token"))
uni.chooseImage({ uni.chooseImage({
success: (chooseImageRes) => { success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths; const tempFilePaths = chooseImageRes.tempFilePaths;
this.imgSrc = chooseImageRes.tempFilePaths[0] this.imgSrc = chooseImageRes.tempFilePaths[0]
uni.uploadFile({ uni.uploadFile({
url: getApp().globalData.hostapi + url: getApp().globalData.hostapi+'/universal/api.upload/upload', //
'/universal/api.upload/upload', //
filePath: tempFilePaths[0], filePath: tempFilePaths[0],
name: 'image', name: 'image',
header:{
token: uni.getStorageSync("token")
},
formData: { formData: {
token: uni.getStorageInfoSync("token") dir:"images"
}, },
success: (uploadFileRes) => { success: (uploadFileRes) => {
console.log(uploadFileRes)
} }
}); });

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 />
@ -46,20 +46,22 @@
<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,20 +140,58 @@
} }
}); });
}, },
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);
@ -190,12 +213,11 @@
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

@ -3,36 +3,51 @@
<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">
<view :style="{color:newColor}">个人中心</view>
</view>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i></view> <view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i>
</view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i></view> <view slot="rightContent" @tap="goSetUp"><i class="icon icon-sandian fon40" :style="{color:newColor}"></i>
</view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view slot="rightContent" style="width: 30rpx;"></view> <view slot="rightContent" style="width: 30rpx;"></view>
<!-- #endif --> <!-- #endif -->
</status-nav-slot> </status-nav-slot>
<view class="posir" style="background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;" :style="{paddingTop: newHeight + 'px'}"> <view class="posir"
style="background: url(/static/public/icon-my-logo.png) no-repeat;background-size: 100% auto;"
:style="{paddingTop: newHeight + 'px'}">
<!-- <image src="/static/public/icon-my-logo.png" class="width100" mode="widthFix" lazy-load></image> --> <!-- <image src="/static/public/icon-my-logo.png" class="width100" mode="widthFix" lazy-load></image> -->
<view class="mar-zy40"> <view class="mar-zy40">
<view style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;"> <view
style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;">
<view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;"> <view class="disjbac" style="padding: 60rpx 80rpx 60rpx 60rpx;">
<view class="disac"> <view class="disac">
<image class="flexs mar-y10" src="/static/public/icon-my-headimg.png" mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image> <image class="flexs mar-y10" v-if="!userInfo.avatar"
src="/static/public/icon-my-headimg.png" mode="aspectFill"
style="width: 91rpx;height: 91rpx;" lazy-load></image>
<image class="flexs mar-y10" v-else src="/static/public/icon-my-headimg.png"
mode="aspectFill" style="width: 91rpx;height: 91rpx;" lazy-load></image>
<view class="disjb fc" style="height: 91rpx;"> <view class="disjb fc" style="height: 91rpx;">
<view class="fon34 bold">156****0510</view> <view class="fon34 bold">{{tel(userInfo.username)}}</view>
<view class="fon22" style="color: #717171;">未实名认证</view> <view class="fon22" style="color: #717171;">未实名认证</view>
</view> </view>
</view> </view>
<image src="/static/public/icon-my-level.png" mode="aspectFill" style="width: 49rpx;height: 76rpx;" lazy-load></image> <image src="/static/public/icon-my-level.png" mode="aspectFill"
style="width: 49rpx;height: 76rpx;" lazy-load></image>
</view> </view>
<!-- 信用分项目数量未评价 --> <!-- 信用分项目数量未评价 -->
<view class="disja pad-zy40"> <view class="disja pad-zy40">
<view v-for="(item,index) in headList" :key="index" class="disjcac fc"> <view v-for="(item,index) in headList" :key="index" class="disjcac fc">
<view style="height: 50rpx;" class="disjcac"> <view style="height: 50rpx;" class="disjcac">
<image :src="item.imgsrc" :style="{width: [49,49,46][index] + 'rpx',height: [50,50,42][index] + 'rpx'}" mode="widthFix" 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>
<view class="fon24 col9 mar-sx10">{{item.title}}</view> <view class="fon24 col9 mar-sx10">{{item.title}}</view>
<view class="fon36 bold">{{item.num}}</view> <view class="fon36 bold">{{item.num}}</view>
@ -43,20 +58,23 @@
<view class="disja mar-s20"> <view class="disja mar-s20">
<view v-for="(item,index) in percentageList" :key="index" class="disjcac fc col3"> <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> --> <!-- <cmd-progress type="circle" :percent="item.num" :width="60" :stroke-color="['#00a2e9','#e87c00','#0b56ec'][index]" :circleStrokeColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" :strokeShape="'square'"></cmd-progress> -->
<arprogress :percent="item.num" <arprogress :percent="item.num" :inactiveColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]"
:inactiveColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" :activeColor="['#00a2e9','#e87c00','#0b56ec'][index]" :borderWidth="7.8" :width="120"
:activeColor="['#00a2e9','#e87c00','#0b56ec'][index]" :duration="500" bgColor="transparent"><text
:borderWidth="7.8" :style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text>
:width="120" </arprogress>
:duration="500"
bgColor="transparent"><text :style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text></arprogress>
<view class="fon24 mar-s20">{{item.title}}</view> <view class="fon24 mar-s20">{{item.title}}</view>
</view> </view>
</view> </view>
<!-- 六宫格 --> <!-- 六宫格 -->
<view class="disjbac fw bacf" style="margin: 30rpx -20rpx 0rpx -20rpx;"> <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 @tap="chooseGridEv(index)" class="disjcac fc width50 pad-sx40"
<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> 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 class="fon26 col3 mar-s20">{{item.title}}</view>
</view> </view>
</view> </view>
@ -77,31 +95,72 @@
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: {
statusNavSlot,
cmdProgress,
'foot-tab': footTabOne,
arprogress
},
data() { data() {
return { return {
newHeight: uni.getSystemInfoSync().statusBarHeight + 50, newHeight: uni.getSystemInfoSync().statusBarHeight + 50,
backgroudColor:'rgba(255,255,255,0)', backgroudColor: 'rgba(255,255,255,0)',
newColor:'rgba(255,255,255,1)', newColor: 'rgba(255,255,255,1)',
headList:[ headList: [{
{imgsrc:'/static/public/icon-my-creditScore.png',title:'信用分',num:0}, imgsrc: '/static/public/icon-my-creditScore.png',
{imgsrc:'/static/public/icon-my-projectNum.png',title:'项目数量',num:0}, title: '信用分',
{imgsrc:'/static/public/icon-my-notEvaluated.png',title:'未评价',num:0}, num: 0
},
{
imgsrc: '/static/public/icon-my-projectNum.png',
title: '项目数量',
num: 0
},
{
imgsrc: '/static/public/icon-my-notEvaluated.png',
title: '未评价',
num: 0
},
], ],
percentageList:[ percentageList: [{
{title:'预约及时率',num:100}, title: '预约及时率',
{title:'上门准时率',num:60}, num: 100
{title:'项目报修率',num:40}, },
{
title: '上门准时率',
num: 60
},
{
title: '项目报修率',
num: 40
},
], ],
gridList:[ gridList: [{
{imgsrc:'/static/public/icon-my-information.png',title:'个人信息'}, imgsrc: '/static/public/icon-my-information.png',
{imgsrc:'/static/public/icon-my-certificates.png',title:'电子证件'}, title: '个人信息'
{imgsrc:'/static/public/icon-my-service.png',title:'服务范围'}, },
{imgsrc:'/static/public/icon-my-evaluate.png',title:'我要评价'}, {
{imgsrc:'/static/public/icon-my-account.png',title:'我的账户'}, imgsrc: '/static/public/icon-my-certificates.png',
{imgsrc:'/static/public/icon-my-set.png',title:'设置'}, title: '电子证件'
},
{
imgsrc: '/static/public/icon-my-service.png',
title: '服务范围'
},
{
imgsrc: '/static/public/icon-my-evaluate.png',
title: '我要评价'
},
{
imgsrc: '/static/public/icon-my-account.png',
title: '我的账户'
},
{
imgsrc: '/static/public/icon-my-set.png',
title: '设置'
},
], ],
userInfo:{} userInfo: {}
} }
}, },
onShow() { onShow() {
@ -111,7 +170,7 @@
onPageScroll(e) { onPageScroll(e) {
let navHeight = uni.getSystemInfoSync().statusBarHeight + 50; let navHeight = uni.getSystemInfoSync().statusBarHeight + 50;
this.backgroudColor = `rgba(255,255,255,${e.scrollTop/navHeight})`; this.backgroudColor = `rgba(255,255,255,${e.scrollTop/navHeight})`;
if(e.scrollTop/navHeight < 0.5) { if (e.scrollTop / navHeight < 0.5) {
this.newColor = `#FFFFFF`; this.newColor = `#FFFFFF`;
} else { } else {
this.newColor = `#000000`; this.newColor = `#000000`;
@ -123,37 +182,49 @@
}, },
methods: { methods: {
// 退 // 退
logOutEv(){ logOutEv() {
this.$requst.post('/universal/api.login/signout').then(res=>{ this.$requst.post('/universal/api.login/signout').then(res => {
if(res.code==1) { if (res.code == 1) {
this.$toolAll.tools.showToast('退出成功'); this.$toolAll.tools.showToast('退出成功');
// //
uni.clearStorageSync(); uni.clearStorageSync();
// //
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.setStorageSync('hostapi','http://maintain.7and5.cn'); uni.setStorageSync('hostapi', 'http://maintain.7and5.cn');
// #endif // #endif
// #ifdef H5 // #ifdef H5
uni.setStorageSync('hostapi','/web'); uni.setStorageSync('hostapi', '/web');
// #endif // #endif
setTimeout(()=>{ setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url:'/pages/login/login' url: '/pages/login/login'
}) })
},1000) }, 1000)
} }
}) })
}, },
checkInfo(){ //
this.$requst.get('/universal/api.user/user_center').then(res=>{ tel(tel) {
if(res.code==1 && res.data.length!=1) { 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.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){ chooseGridEv(index) {
let urls = [ let urls = [
'/pagesB/personal-information/personal-information', '/pagesB/personal-information/personal-information',
'/pagesB/electronic-certificate/electronic-certificate', '/pagesB/electronic-certificate/electronic-certificate',
@ -163,13 +234,13 @@
'/pagesB/set-up/set-up', '/pagesB/set-up/set-up',
]; ];
uni.navigateTo({ uni.navigateTo({
url:urls[index] url: urls[index]
}) })
}, },
// //
goSetUp(){ goSetUp() {
uni.navigateTo({ uni.navigateTo({
url:'/pagesB/set-up/set-up' url: '/pagesB/set-up/set-up'
}) })
} }
} }
@ -177,5 +248,7 @@
</script> </script>
<style> <style>
page {background-color: #f7f7f7;} page {
background-color: #f7f7f7;
}
</style> </style>

View File

@ -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

@ -5,16 +5,16 @@
<container-subgroup-two> <container-subgroup-two>
<view slot="content" style="margin: -25rpx -25rpx -0rpx;"> <view slot="content" style="margin: -25rpx -25rpx -0rpx;">
<view class="project-list-input" :style="{top:statusBarHeight + 'px'}"> <view class="project-list-input" :style="{top:statusBarHeight + 'px'}">
<input type="text" class="int" value="" placeholder="请输入关键字" /> <input type="text" @keydown.enter="getDatalist()" class="int" v-model="dataPage.keyword" value="" placeholder="请输入关键字" />
<image class="search" src="../../static/iocn/ss.png" mode=""></image> <image @click="getDatalist()" class="search" src="../../static/iocn/ss.png" mode=""></image>
<view class="xian"></view> <view class="xian"></view>
</view> </view>
<view class="screen"> <view class="screen">
<!-- 筛选状态查询日期查询 --> <!-- 筛选状态查询日期查询 -->
<picker @change="bindPickerChange" :value="workeOrderStatusIndex" :range="array" :range-key="'title'"> <picker @change="bindPickerChange" :value="workeOrderStatusIndex" :range="array" :range-key="'name'">
<view class="li"> <view class="li">
<view class="text" v-if="workeOrderStatus!=''">{{workeOrderStatus}}</view> <view class="text" v-if="workeOrderStatus!=''">{{workeOrderStatus}}</view>
<view class="text" v-else>{{array[workeOrderStatusIndex].title}}</view> <view class="text" v-else>{{array[workeOrderStatusIndex].name}}</view>
<image class="img" src="../../static/iocn/xla.png" mode="aspectFill"></image> <image class="img" src="../../static/iocn/xla.png" mode="aspectFill"></image>
</view> </view>
</picker> </picker>
@ -32,24 +32,25 @@
<view class="project-list"> <view class="project-list">
<!-- 列表循环体 --> <!-- 列表循环体 -->
<view class="li" @click="projectDetailsFun(item.status,item.id,item.statusText,item.backgroundColor)" v-for="(item,index) in dataList" :key="index"> <view class="li" @click="projectDetailsFun(item.status,item.id,item.statusText,item.backgroundColor)" v-for="(item,index) in dataList" :key="index">
<view class="work-order-code">工单编号{{item.orderNum}}</view> <view class="work-order-code">工单编号{{item.order_number}}</view>
<view class="message"> <view class="message">
<image class="img" src="../../static/del/img001.png" mode="aspectFill"></image> <image class="img" src="../../static/del/img001.png" mode="aspectFill"></image>
<view class="text"> <view class="text">
<view class="title"> <view class="title">
<view class="text clips1">{{item.title}}</view> <view class="text clips1">{{item.project_name}}</view>
<view class="icon" :style="{backgroundColor: item.backgroundColor}">{{['','待受理','等待派工','待接单','待维修','维修中','待收款','待审批','已完成','待回访','异常单','逾期单','超时单'][item.status]}}</view> <view class="icon" :style="{backgroundColor: item.attributes.color}">{{item.attributes.text
}}</view>
</view> </view>
<view class="disjb fc" style="margin-left: -20rpx;height: 70%;"> <view class="disjb fc" style="margin-left: -20rpx;height: 70%;">
<view class="serial-number scal09"> <view class="serial-number scal09">
<view class="type">{{item.faultType}}</view> <view class="type">#{{item.fault_type}}#</view>
<view class="date">已故障{{item.faultTime}}</view> <view class="date">{{item.failure_time}}</view>
</view> </view>
<view class="specification scal09"> <view class="specification scal09">
紧急程度<view class="text"> {{item.urgentText}}</view> 紧急程度<view class="text"> {{item.principal}}</view>
</view> </view>
<view class="specification scal09">主负责人{{item.name}}</view> <view class="specification scal09">主负责人{{item.name}}</view>
<view class="installation-site scal09">故障描述{{item.describe}}</view> <view class="installation-site scal09">故障描述{{item.failure_description}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -91,151 +92,18 @@
date: currentDate, date: currentDate,
workeOrderStatus:'工单状态', workeOrderStatus:'工单状态',
array: [ array: [
{id:1,title:'待受理'},
{id:2,title:'待指派'},
{id:3,title:'待接单'},
{id:4,title:'待维修'},
{id:5,title:'维修中'},
{id:6,title:'待收款'},
{id:7,title:'待审批'},
{id:8,title:'已收款'},
{id:9,title:'待回访'},
{id:10,title:'异常单'},
{id:11,title:'逾期单'},
{id:12,title:'超时单'}
], ],
workeOrderStatusIndex: 0, workeOrderStatusIndex: 0,
dataPage:{ dataPage:{
list_rows:10, list_rows:10,
page:1, page:1,
order_status:"",
order_times:"",
keyword:""
}, },
dataList:[ dataList:[
{
id:1,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:1,
statusText:'待受理',
backgroundColor:'#ff0000',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:2,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:2,
statusText:'待指派',
backgroundColor:'#112233',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:3,
statusText:'待接单',
backgroundColor:'#ff00ff',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:4,
statusText:'待维修',
backgroundColor:'#303545',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:5,
statusText:'维修中',
backgroundColor:'#006677',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:6,
statusText:'待收款',
backgroundColor:'#669955',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:7,
statusText:'待审批',
backgroundColor:'#558899',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:8,
statusText:'已完成',
backgroundColor:'#336655',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
{
id:3,
orderNum:'222226666558',
title:'长沙市望城区xxxxxx项目名称',
status:9,
statusText:'待回访',
backgroundColor:'#224455',
faultType:'#网络故障#',
faultTime:'2小时37分',
urgentText:'加急',
name:'陈志远',
describe:'LED显示屏开机后闪屏不显示内容。主控电脑提示网络不通',
address:'湖南省长沙市高新开发区谷园路109号像素大厦1205'
},
] ]
} }
@ -243,7 +111,6 @@
onLoad(op) { onLoad(op) {
this.workeOrderStatusIndex = this.array.findIndex(item=>item.title==op.status); this.workeOrderStatusIndex = this.array.findIndex(item=>item.title==op.status);
if(this.workeOrderStatusIndex!=-1) this.workeOrderStatus = ''; if(this.workeOrderStatusIndex!=-1) this.workeOrderStatus = '';
this.getDatalist() this.getDatalist()
this.getType() this.getType()
}, },
@ -256,7 +123,9 @@
}).then(res => { }).then(res => {
// this.$toolAll.tools.showToast(res.msg); // this.$toolAll.tools.showToast(res.msg);
if (res.code == 1) { if (res.code == 1) {
this.dataList = res.data.data console.log(res.data,"---aa")
this.array=[...res.data]
console.log( this.array)
} else { } else {
} }
@ -264,15 +133,12 @@
}, },
getDatalist(){ getDatalist(){
this.$requst.get('/universal/api.order/order_list', { this.$requst.get('/universal/api.order/order_list',this.dataPage).then(res => {
list_rows: this.dataPage.list_rows,
page: this.dataPage.page,
}).then(res => {
// this.$toolAll.tools.showToast(res.msg); // this.$toolAll.tools.showToast(res.msg);
if (res.code == 1) { if (res.code == 1) {
this.dataList = res.data.data this.dataList = res.data.data
} else { } else if(res.code == 0){
this.dataList = res.data.data
} }
}) })
}, },
@ -310,9 +176,17 @@
this.workeOrderStatus = ''; this.workeOrderStatus = '';
this.workeOrderStatusIndex = data.detail.value; this.workeOrderStatusIndex = data.detail.value;
console.log( data.detail.value)
this.dataPage.order_status=this.array[data.detail.value].id-0
this.getDatalist()
}, },
bindDateChange(date) { bindDateChange(date) {
console.log(date) this.dataPage.order_times=date.detail.value
this.getDatalist()
}, },
getDate(type) { getDate(type) {
const date = new Date(); const date = new Date();

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;