Commit 3adcf201 authored by 和慭琛's avatar 和慭琛

完工页面 接口对接

parent 2b061b66
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
globalData: { globalData: {
//https://system.banshouhui.com //https://system.banshouhui.com
//https://system.dev.banshouhui.com //https://system.dev.banshouhui.com
domain_Name: 'https://system.dev.banshouhui.com',
//http://192.168.0.208:8192 //http://192.168.0.208:8192
domain_Name: 'http://192.168.0.208:37080', //domain_Name: 'http://192.168.0.208:37080',
token:'', token:'',
//RTOKEN45f41a3053238cb72b3b72fe14df8d7040c9f502 //RTOKEN45f41a3053238cb72b3b72fe14df8d7040c9f502
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
icon_rob:'https://qn-static.banshouhui.com/take_order/icon/rob.png', icon_rob:'https://qn-static.banshouhui.com/take_order/icon/rob.png',
//右箭头 图标 //右箭头 图标
icon_arrow_right:'https://qn-static.banshouhui.com/arrow_right.png', icon_arrow_right:'https://qn-static.banshouhui.com/arrow_right.png',
//照片添加 图标
icon_photo_add:'https://qn-static.banshouhui.com/take_order/icon/photo_add.png',
//登录注册页-- //登录注册页--
//通过code获取用户信息(登录) //通过code获取用户信息(登录)
......
...@@ -7,36 +7,52 @@ ...@@ -7,36 +7,52 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/take/finish", "path": "pages/take/index",
"style": { "style": {
"navigationBarTitleText": "完工信息" "navigationBarTitleText": "接单"
} }
}, },
{ {
"path": "pages/take/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "接单" "navigationBarTitleText": "下单"
} }
}, },
{ {
"path": "pages/take/detail", "path": "pages/take/finish",
"style": { "style": {
"navigationBarTitleText": "接单详情" "navigationBarTitleText": "完工信息"
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/take/measure",
"style": { "style": {
"navigationBarTitleText": "下单" "navigationBarTitleText": "服务措施"
} }
},
{
"path": "pages/take/detail",
"style": {
"navigationBarTitleText": "接单详情"
}
}, },
{ {
"path": "pages/take/rob", "path": "pages/take/rob",
"style": { "style": {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</view> </view>
</view> </view>
<view class="listView"> <view class="listView">
<view class="itemView" v-if="activeTop == 0" v-for="(item,ikey) in unfinishList":key="ikey"> <view class="itemView" @click="itemClick(item)" v-if="activeTop == 0" v-for="(item,ikey) in unfinishList":key="ikey">
<view class="nameView"> <view class="nameView">
<view class="nameLeftView"> <view class="nameLeftView">
<text class="nameText" v-if="item.contactName">{{item.contactName}}</text> <text class="nameText" v-if="item.contactName">{{item.contactName}}</text>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<image class="noDataIcon" :src="icon_noData" mode=""></image> <image class="noDataIcon" :src="icon_noData" mode=""></image>
<text class="noDataText">暂无数据</text> <text class="noDataText">暂无数据</text>
</view> </view>
<view class="itemView" v-if="activeTop == 1" v-for="(item,ikey) in finishList":key="ikey"> <view class="itemView" @click="itemClick(item)" v-if="activeTop == 1" v-for="(item,ikey) in finishList":key="ikey">
<view class="nameView"> <view class="nameView">
<view class="nameLeftView"> <view class="nameLeftView">
<text class="nameText" v-if="item.contactName">{{item.contactName}}</text> <text class="nameText" v-if="item.contactName">{{item.contactName}}</text>
...@@ -91,12 +91,17 @@ ...@@ -91,12 +91,17 @@
methods: { methods: {
//'/wxh-worker-rest/rest/order/revision/applets/'
//+this.globalData.token+'/order/customer'
//getApp().globalData.createOrderList
//获取下单列表 //获取下单列表
createOrderList: function () { createOrderList: function () {
let that = this let that = this
uni.request({ uni.request({
url: getApp().globalData.domain_Name url: getApp().globalData.domain_Name
+getApp().globalData.createOrderList, +'/wxh-worker-rest/rest/order/revision/applets/'
+getApp().globalData.token+'/order/customer',
method: 'GET', method: 'GET',
data: { data: {
type:this.activeTop, type:this.activeTop,
...@@ -137,6 +142,7 @@ ...@@ -137,6 +142,7 @@
}) })
}, },
//顶部点击
topClick: function (active) { topClick: function (active) {
if(this.activeTop!=active){ if(this.activeTop!=active){
this.activeTop = active this.activeTop = active
...@@ -144,6 +150,7 @@ ...@@ -144,6 +150,7 @@
} }
}, },
//拨打电话
callClick: function (phone) { callClick: function (phone) {
console.log(phone) console.log(phone)
uni.makePhoneCall({ uni.makePhoneCall({
...@@ -151,6 +158,14 @@ ...@@ -151,6 +158,14 @@
}); });
}, },
//详情点击
itemClick: function (item) {
uni.navigateTo({
url: '/pages/take/detail'
+'?orderId='+item.orderId,
})
},
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
export default { export default {
data() { data() {
return { return {
domain_name:'http://192.168.0.208:8192', //domain_name:'http://192.168.0.208:8192',
isNewUser:false, isNewUser:false,
unionID:'', unionID:'',
openID:'', openID:'',
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
title:'加载中' title:'加载中'
}) })
uni.request({ uni.request({
url: this.domain_name url: getApp().globalData.domain_Name
+getApp().globalData.getUsersByCode, +getApp().globalData.getUsersByCode,
method: 'GET', method: 'GET',
data: { data: {
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
title:'加载中' title:'加载中'
}) })
uni.request({ uni.request({
url: this.domain_name url: getApp().globalData.domain_Name
+getApp().globalData.findByMobile, +getApp().globalData.findByMobile,
method: 'POST', method: 'POST',
data: { data: {
......
...@@ -144,9 +144,7 @@ ...@@ -144,9 +144,7 @@
this.orderInfo = res.data.data this.orderInfo = res.data.data
if(res.data.data.images){ if(res.data.data.images){
this.photoList = res.data.data.images.split(','); this.adjustPhotoList(res.data.data.images)
console.log('照片数组:')
console.log(this.photoList)
} }
}else{ }else{
...@@ -166,6 +164,20 @@ ...@@ -166,6 +164,20 @@
}) })
}, },
//https://system.banshouhui.com/wxh-sts-rest/rest/file/image/order/13767/1442887919988.jpg
adjustPhotoList: function (images) {
var photoArray = images.split(',')
var newPhotoArray = []
photoArray.forEach(item => {
var imageURL = getApp().globalData.domain_Name + '/wxh-sts-rest' + item
newPhotoArray.push(imageURL)
})
this.photoList = newPhotoArray
console.log('照片数组:')
console.log(this.photoList)
},
phoneCallClick: function (phone) { phoneCallClick: function (phone) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
......
This diff is collapsed.
...@@ -173,11 +173,11 @@ ...@@ -173,11 +173,11 @@
console.log(res.data); console.log(res.data);
getApp().globalData.token = res.data getApp().globalData.token = res.data
this.getData()
} }
}) })
await this.getData() //await this.getData()
}, },
//获取数据 //获取数据
......
<template>
<view class="backView">
<view class="listView border_right_2">
<view class="itemView" @click="itemClick(0,item)" v-for="(item,ikey) in leftList":key="ikey">
<text :class="current_symptomsId == item.symptomsId ? 'selectedTitle' : 'itemTitle' ">{{item.symptomsName}}</text>
<image class="arrowIcon" :src="icon_arrow_right" mode=""></image>
</view>
</view>
<view class="listView border_right_2" v-if="is_mid_show">
<view class="itemView" @click="itemClick(1,item)" v-for="(item,ikey) in midList":key="ikey">
<text :class="current_causeId == item.causeId ? 'selectedTitle' : 'itemTitle' ">{{item.symptomsName}}</text>
<image class="arrowIcon" :src="icon_arrow_right" mode=""></image>
</view>
</view>
<view class="listView" v-if="is_right_show">
<view class="itemView" @click="itemClick(2,item)" v-for="(item,ikey) in rightList":key="ikey">
<text :class="current_measureId == item.measureId ? 'selectedTitle' : 'itemTitle' ">{{item.measureName}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
orderId:'',
serviceType:'',
specificationId:'',
icon_arrow_right:'',
current_symptomsId:'',
current_causeId:'',
current_measureId:'',
current_measureName:'',
is_mid_show:false,
is_right_show:false,
leftList:[{title:'左左左1'},{title:'左左左很长很长怎么办呢很长很长怎么办呢2'},{title:'左左左3'}],
midList:[{title:'中中中1'},{title:'中中中2'},{title:'中中中很长很长怎么办呢很长很长怎么办呢3'}],
rightList:[{title:'右右右很长很长怎么办呢很长很长怎么办呢1'},{title:'右右右2'},{title:'右右右3'}],
}
},
onLoad(e) {
if(e && e.orderId){
this.orderId = e.orderId
}
if(e && e.serviceType){
this.serviceType = e.serviceType
}
if(e && e.specificationId){
this.specificationId = e.specificationId
}
this.icon_arrow_right = getApp().globalData.icon_arrow_right
},
onShow() {
this.getConfig()
this.getLeftData()
},
methods: {
getConfig: function (){
//测试
/*
getApp().globalData.token = 'RTOKEN9336b56cffb3c2bafec54b3687f86c38bfaa364a'
this.orderId = '10704464'
this.serviceType = '维修'
this.specificationId = '10005'
*/
},
//选项点击
itemClick: function (side,item) {
console.log('item 点击')
console.log(side)
console.log(item)
//左边 现象
if(side == 0){
this.current_symptomsId = item.symptomsId
this.getMidData()
this.is_right_show = false
this.current_causeId = ''
this.current_measureId = ''
}
//中间 原因
if(side == 1){
this.current_causeId = item.causeId
this.getRightData()
this.current_measureId = ''
}
//右边 措施
if(side == 2){
this.current_measureId = item.measureId
this.current_measureName = item.measureName
this.getFinalData()
}
},
// http://system.banshouhui.com/wxh-worker-rest/rest/order/RTOKENa8f4a27fef05fbcc27d473f32694e51a68101242/price/newsymptoms/V2/11885888
//左边 获取 故障现象 数据
getLeftData: function () {
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/order/'
+getApp().globalData.token
+'/price/newsymptoms/V2/'+this.orderId,
method: 'GET',
data: {
serviceType:this.serviceType
},
header:{
//'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
uni.hideLoading()
console.log('获取 故障现象 成功')
console.log(res)
if(res.statusCode==200){
this.leftList = res.data
}else{
uni.showToast({
title:res.errMsg
})
}
},
fail: (e) => {
uni.hideLoading()
console.log('获取 故障现象 失败')
console.log(e)
}
})
},
// http://system.banshouhui.com/wxh-worker-rest/rest/order/RTOKEN1b8789e3a69982704a7c493a3877d55ab8f15c7d/price/cause/V2/11885888/10000
//中间 获取 查询故障现象 关联的 故障原因 数据
getMidData: function (){
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/order/'
+getApp().globalData.token
+'/price/cause/V2/'+this.orderId
+'/'+this.current_symptomsId,
method: 'GET',
data: {
//serviceType:this.serviceType
},
header:{
//'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
uni.hideLoading()
console.log('获取 查询故障现象 关联的 故障原因 成功')
console.log(res)
if(res.statusCode==200){
this.midList = res.data
this.is_mid_show = true
}else{
uni.showToast({
title:res.errMsg
})
}
},
fail: (e) => {
uni.hideLoading()
console.log('获取 查询故障现象 关联的 故障原因 失败')
console.log(e)
}
})
},
// http://system.banshouhui.com/wxh-worker-rest/rest/order/RTOKEN1b8789e3a69982704a7c493a3877d55ab8f15c7d/price/measure/V2/11885888/10001
//右边 获取 查询故障原因 关联的 服务措施详情以及价格 数据
getRightData: function(){
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/order/'
+getApp().globalData.token
+'/price/measure/V2/'+this.orderId
+'/'+this.current_causeId,
method: 'GET',
data: {
//serviceType:this.serviceType
},
header:{
//'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
uni.hideLoading()
console.log('获取 查询故障原因 关联的 服务措施详情以及价格 成功')
console.log(res)
if(res.statusCode==200){
this.rightList = res.data
this.is_right_show = true
}else{
uni.showToast({
title:res.errMsg
})
}
},
fail: (e) => {
uni.hideLoading()
console.log('获取 查询故障原因 关联的 服务措施详情以及价格 失败')
console.log(e)
}
})
},
//getToken,_specificationId,measuresId,_orderId
//http://system.banshouhui.com/wxh-worker-rest/rest/order/RTOKEN6c30a6be9e59f428455abd2fdb38fbaf360b4ae0/price/11634/charge/10001/measure/11885888
//最终请求
getFinalData: function () {
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/order/'
+getApp().globalData.token
+'/price/'+this.specificationId
+'/charge/'+this.current_measureId
+'/measure/'+this.orderId,
method: 'GET',
data: {
//serviceType:this.serviceType
},
header:{
//'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
uni.hideLoading()
console.log('最终请求 成功')
console.log(res)
if(res.statusCode==200){
uni.showToast({
title:'请求成功'
})
this.passValueAndBack(res)
}else{
uni.showToast({
title:res.errMsg
})
}
},
fail: (e) => {
uni.hideLoading()
console.log('最终请求 失败')
console.log(e)
}
})
},
//传值返回
passValueAndBack: function (res) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.measure_measureTypeName = res.data.measureTypeName,
prevPage.$vm.measure_measureTypeId = res.data.measureTypeId,
prevPage.$vm.measure_inGuaranteeCommission = res.data.inGuaranteeCommission,
prevPage.$vm.measure_outGuaranteeCharge = res.data.outGuaranteeCharge,
prevPage.$vm.measure_showContent = this.current_measureName
uni.navigateBack({
})
},
}
}
</script>
<style>
.backView{
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
}
.listView{
background-color: #FFFFFF;
width: 33%;
height: 100%;
display: flex;
flex-direction: column;
}
.border_right_2{
border-right: 2rpx solid #F3F3F3;
}
.itemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #F3F3F3;
}
.itemTitle{
margin-left: 30rpx;
font-size: 28rpx;
color: #333333;
padding-top: 30rpx;
padding-bottom: 30rpx;
}
.selectedTitle{
margin-left: 30rpx;
font-size: 28rpx;
color: #2272FF;
padding-top: 30rpx;
padding-bottom: 30rpx;
}
.arrowIcon{
background-color: #FFFFFF;
width: 16rpx;
height: 28rpx;
margin-right: 30rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment