Commit c3d7da9c authored by 李俊赕's avatar 李俊赕

edit-gitignore

parents 8f91adc3 7079ba13
......@@ -28,7 +28,8 @@
icon_noData:'https://qn-static.banshouhui.com/empty.png',
//抢单 图标
icon_rob:'https://qn-static.banshouhui.com/take_order/icon/rob.png',
//右箭头 图标
icon_arrow_right:'https://qn-static.banshouhui.com/arrow_right.png',
//登录注册页--
//通过code获取用户信息(登录)
......
......@@ -13,6 +13,14 @@
}
},
{
"path": "pages/take/finish",
"style": {
"navigationBarTitleText": "完工信息"
}
},
{
"path": "pages/take/detail",
"style": {
......@@ -20,8 +28,6 @@
}
},
{
"path": "pages/index/index",
"style": {
......@@ -62,15 +68,7 @@
"navigationBarTitleText": "授权登录"
}
},
{
"path": "pages/take/finish",
"style": {
"navigationBarTitleText": "完工信息"
}
}
}
],
......
......@@ -82,7 +82,7 @@
<text class="contentText u-m-l-20" v-if="orderInfo.guaranteeExplain">{{orderInfo.guaranteeExplain}}</text>
</view>
</view>
<view class="bottomView" v-if="orderInfo.status != '已完工'">
<view class="bottomView" v-if="orderInfo.statusText != '已完工'">
<view class="bottomLeftView" @click="cancelClick()">
<text class="u-font-28 gray66">退单</text>
</view>
......@@ -97,6 +97,7 @@
export default {
data() {
return {
orderId:'',
orderInfo:{},
photoList:[
{image:''},{image:''},{image:''},{image:''},
......@@ -110,6 +111,7 @@
if(e && e.orderId){
this.orderId = e.orderId
}
this.domain_name = getApp().globalData.domain_Name
//this.orderId = '10704466'
//getApp().globalData.token = 'RTOKENc9496ce49b2dc61bbae67968979af4f19e0dfad0'
......@@ -176,11 +178,62 @@
cancelClick: function () {
console.log('退单点击')
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/'
+getApp().globalData.token
+'/order/'+this.orderId+'/workerReject',
method: 'POST',
data: {
rejectReason:'不想接单了',
remark:'不想接单了'
},
header:{
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
console.log('退单 成功')
console.log(res)
if(res.data.code==200){
uni.showToast({
title:'退单成功',
})
uni.navigateBack({
})
}else{
uni.showToast({
title:res.data.message
})
}
},
fail: (e) => {
console.log('退单 失败')
console.log(e)
uni.showToast({
title:'退单失败',
})
}
})
},
finishClick: function () {
uni.navigateTo({
url: '/pages/take/finish'
+'?orderId='+this.orderId
+'&inGuaranteePeriod='+this.orderInfo.inGuaranteePeriod
+'&contactName='+this.orderInfo.contactName
+'&contactMobilephone='+this.orderInfo.contactMobilephone
+'&contactAddress='+this.orderInfo.contactAddress
+'&inGuaranteePeriodText='+this.orderInfo.inGuaranteePeriodText
+'&orderServiceType='+this.orderInfo.orderServiceType,
})
},
......
<template>
<view class="">
<view class="topView">
<view class="nameView">
<text class="u-font-24 u-m-l-24">联系人:{{orderInfo.name}}</text>
<text class="u-font-24 u-m-l-24 underLine" @click="phoneCallClick(orderInfo.phone)">{{orderInfo.phone}}</text>
<view class="backView">
<view class="topView u-p-b-30">
<view class="itemView u-m-t-30">
<text class="titleText u-m-l-30">联系人:</text>
<text class="contentText u-m-l-20" v-if="contactName">{{contactName}}</text>
<text class="contentText u-m-l-20 underLine" v-if="contactMobilephone">{{contactMobilephone}}</text>
</view>
<text class="u-font-24 u-m-l-24 u-m-t-24">地址:{{orderInfo.address}}</text>
<view class="typeView">
<text class="u-font-24 u-m-l-24">类型:({{orderInfo.guard}}) {{orderInfo.type}}</text>
<text class="u-font-24 u-m-r-24">产品:{{orderInfo.product}}</text>
<view class="itemView u-m-t-30">
<text class="titleText u-m-l-30">地址:</text>
<text class="contentText u-m-l-20" v-if="contactAddress">{{contactAddress}}</text>
</view>
</view>
<template v-for="(item,ikey) in orderInfo.typeList">
<view class="clickTypeView" v-if="item.type=='click' || item.type=='scan'" @click="clickTypeClick(item)">
<text class="u-font-24 u-m-l-24">{{item.title}}</text>
<image class="arrowIcon u-m-r-24" src="" mode=""></image>
</view>
<view class="inputTypeView" v-if="item.type=='photo'">
<text class="u-font-24 u-m-l-24">{{item.title}}</text>
<input class="input u-m-r-24" type="text" value="" placeholder="请输入内容" />
<view class="itemView u-m-t-30">
<text class="titleText u-m-l-30">类型:</text>
<text class="contentText u-m-l-20" v-if="inGuaranteePeriodText">({{inGuaranteePeriodText}}) {{orderServiceType}}</text>
</view>
<view class="photoTypeView" v-if="item.type=='photo'">
<text class="u-font-24 u-m-l-24 u-m-t-24">{{item.title}}</text>
<view class="photoBackView u-p-b-24" v-if="item.images.length>0">
<view class="photoItemView" @click="photoClick(item)" v-for="(item,ikey) in item.images":key="ikey">
<image class="photoImage" :src="item.image" mode="aspectFill"></image>
</view>
<view class="padding_bottom_180">
<template v-for="(item,ikey) in orderInfo.fieldsItems">
<view class="clickTypeView"
v-if="
item.fieldsType=='SPECIFICATIONS' ||
item.fieldsType=='PRODUCT_NUMBER' ||
item.fieldsType=='MACHINE_CODE' ||
item.fieldsType=='DATE' ||
item.fieldsType=='SERVICE_MEASURES' ||
item.fieldsType=='WEBPAGE' ||
item.fieldsType=='RADIO' ||
item.fieldsType=='CHECKBOX' ||
item.fieldsType=='RADIO_BIG' ||
item.fieldsType=='CHECKBOX_BIG'
" @click="clickTypeClick(item)">
<view class="itemTitleView borderBottom">
<text class="itemTitle bold">{{item.fieldsTitle}}</text>
<text class="itemRedStar" v-if="item.required">*</text>
</view>
<view class="clickRightView">
<image class="arrowIcon u-m-r-30" :src="icon_arrow_right" mode=""></image>
<text class="clickContent" v-if="item.fieldsValue">{{item.fieldsValue}}</text>
</view>
</view>
</view>
<view class="textAreaTypeView bottomPadding" v-if="item.type=='textArea'">
<text class="u-font-24 u-m-l-24 u-m-t-24">{{item.title}}</text>
<view class="textAreaView">
<textarea class="textArea u-m-l-24 u-m-r-24 u-m-t-24 u-m-b-24" value="" placeholder="请输入备注" />
<view class="inputTypeView"
v-if="
item.fieldsType=='INTEGER' ||
item.fieldsType=='DECIMAL' ||
item.fieldsType=='DOUBLE' ||
item.fieldsType=='STRING' ||
item.fieldsType=='FILE' ||
item.fieldsType=='ICN'
">
<view class="itemTitleView borderBottom">
<text class="itemTitle bold">{{item.fieldsTitle}}</text>
<text class="itemRedStar" v-if="item.required">*</text>
</view>
<input class="input u-m-r-30" type="text" value="" :placeholder="'请输入'+item.fieldsTitle" />
</view>
</view>
</template>
<view class="photoTypeView"
v-if="item.fieldsType=='PHOTOS'
">
<view class="itemTitleView borderBottom">
<text class="itemTitle bold">{{item.fieldsTitle}}</text>
<text class="itemRedStar" v-if="item.required">*</text>
</view>
<view class="photoBackView u-p-b-30" v-if="item.fieldsValue">
<view class="photoItemView" @click="photoClick(item)" v-for="(item,ikey) in item.fieldsValue":key="ikey">
<image class="photoImage" :src="item.image" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="textAreaTypeView"
v-if="
item.fieldsType=='TEXT'
">
<view class="itemTitleView borderBottom">
<text class="itemTitle bold">{{item.fieldsTitle}}</text>
<text class="itemRedStar" v-if="item.required">*</text>
</view>
<view class="textAreaView">
<view class="textAreaBoxView">
<textarea class="textArea" v-model="demandContent" value="" placeholder="请输入服务需求或故障说明,如:空调不冷、洗衣机漏水、安装晾衣架、安装洗衣机等" placeholder-style='color:#CCCCCC;font-size:28rpx;' />
</view>
</view>
</view>
</template>
</view>
<view class="bottomView" @click="confirmClick()">
<text class="bottomTitle">确认完工</text>
</view>
......@@ -46,41 +95,78 @@
export default {
data() {
return {
icon_arrow_right:'',
orderId:'',
inGuaranteePeriod:false,
orderInfo:{
name:'梵护博',
phone:'15811112222',
address:'广东省深圳市宝安区新安街道庭威产业园10C',
guard:'保内',
type:'维修-调试',
product:'小米 新风机',
typeList:[
{title:'产品规格',type:'click'},
{title:'购买日期',type:'click'},
{title:'机身条码',type:'scan'},
{title:'照片',type:'photo',images:[{image:'111'},{image:'222'},{image:'333'},{image:'444'}]},
{title:'备注',type:'textArea'},
{title:'长度',type:'textField'},
]
},
contactName:'',
contactMobilephone:'',
contactAddress:'',
inGuaranteePeriodText:'',
orderServiceType:'',
orderInfo:{},
}
},
onLoad(e) {
this.orderId = '10704466'
this.inGuaranteePeriod = false
this.getTopInfo(e)
this.getConfig()
this.getCompletionConfigInfo()
},
methods: {
getTopInfo: function (e) {
this.icon_arrow_right = getApp().globalData.icon_arrow_right
if(e && e.orderId){
this.orderId = e.orderId
}
if(e && e.inGuaranteePeriod){
this.inGuaranteePeriod = e.inGuaranteePeriod
}
if(e && e.contactName){
this.contactName = e.contactName
}
if(e && e.contactMobilephone){
this.contactMobilephone = e.contactMobilephone
}
if(e && e.contactAddress){
this.contactAddress = e.contactAddress
}
if(e && e.inGuaranteePeriodText){
this.inGuaranteePeriodText = e.inGuaranteePeriodText
}
if(e && e.orderServiceType){
this.orderServiceType = e.orderServiceType
}
//测试
/*
getApp().globalData.token = 'RTOKEN9336b56cffb3c2bafec54b3687f86c38bfaa364a'
this.orderId = '10704464'
this.inGuaranteePeriod = true
this.contactName = '小青一号'
this.contactMobilephone = '123123123123'
this.contactAddress = '广东省深圳市宝安区创业一路'
this.inGuaranteePeriodText = '保内'
this.orderServiceType = '维修'
*/
},
getConfig: function () {
console.log('获取 完工配置项')
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/config/'
+'RTOKEN52e603131ae93ac83ac0b3628064822690ee4de0'
+getApp().globalData.token
+'/completion/'+this.orderId
+'?inGuaranteePeriod='+this.inGuaranteePeriod,
method: 'GET',
......@@ -116,11 +202,13 @@
//获取完工页详情
getCompletionConfigInfo: function () {
//http://system.banshouhui.com/wxh-sts-rest/rest/worker/RTOKEN222bdab78b0d2a74f159b640df53180772813250/order/11885887?withMaintainDetailInfo=true&completionConfigInfo=true
uni.showLoading({
title:'加载中'
})
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/config/'
+'RTOKEN52e603131ae93ac83ac0b3628064822690ee4de0'
+getApp().globalData.token
+'/completion/'+this.orderId
+'?inGuaranteePeriod='+this.inGuaranteePeriod,
method: 'GET',
......@@ -131,11 +219,13 @@
'Content-Type': 'application/x-www-form-urlencoded',
},
success: (res) => {
uni.hideLoading()
console.log('获取完工页详情 成功')
console.log(res)
if(res.data.code==200){
this.adjustData(res)
}else{
uni.showToast({
title:res.errMsg
......@@ -147,12 +237,35 @@
},
fail: (e) => {
uni.hideLoading()
console.log('获取完工页详情 失败')
console.log(e)
}
})
},
//数据处理
adjustData: function (res) {
res.data.data.fieldsItems.forEach(item => {
//照片
if(item.fieldsType == 'PHOTOS'){
console.log('处理前 的 照片数组:')
console.log(item.fieldsValue)
var photoList = [{image:'111'},{image:'222'},{image:'333'},{image:'444'}]
item.fieldsValue = photoList
console.log('处理后 的 照片数组:')
console.log(item.fieldsValue)
}
})
this.orderInfo = res.data.data
},
clickTypeClick: function (item) {
console.log('点击类 点击')
console.log(item.title)
......@@ -213,7 +326,7 @@
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/'
+'RTOKEN52e603131ae93ac83ac0b3628064822690ee4de0'
+getApp().globalData.token
+'/order/'+this.orderId
+'/maintain',
method: 'POST',
......@@ -269,7 +382,7 @@
uni.request({
url: getApp().globalData.domain_Name
+'/wxh-worker-rest/rest/'
+'RTOKEN52e603131ae93ac83ac0b3628064822690ee4de0'
+getApp().globalData.token
+'/order/'+this.orderId
+'/finishedAndConfirm',
method: 'POST',
......@@ -315,71 +428,111 @@
</script>
<style>
.topView{
background-color: #FFFFFF;
.backView{
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border-bottom: 2rpx solid #999999;
}
.nameView{
.topView{
background-color: #FFFFFF;
width: 100%;
margin-top: 24rpx;
display: flex;
flex-direction: row;
align-items: center;
flex-direction: column;
}
.titleText{
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
.underLine{
text-decoration:underline;
.contentText{
color: #333333;
font-size: 28rpx;
}
.bottomPadding{
padding-bottom: 144rpx;
.underLine{
text-decoration:underline;
}
.typeView{
.clickTypeView{
background-color: #FFFFFF;
width: 100%;
height: 80rpx;
height: 88rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border: 2rpx solid #FAFAFA;
}
.bottomView{
.itemTitleView{
background-color: #FFFFFF;
width: 100%;
height: 110rpx;
width: 30%;
height: 88rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-top: 2rpx solid #999999;
position: fixed;
bottom: 0;
}
.bottomTitle{
font-size: 32rpx;
.itemTitle {
background-color: #FFFFFF;
margin-left: 30rpx;
font-size: 28rpx;
color: #333333;
}
.bold {
font-weight: bold;
}
.itemRedStar {
font-size: 28rpx;
color: #D02B2B;
}
.clickRightView{
background-color: #FFFFFF;
width: 40%;
height: 88rpx;
display: flex;
flex-direction: row-reverse;
align-items: center;
}
.arrowIcon{
background-color: #999999;
width: 20rpx;
height: 50rpx;
background-color: #FFFFFF;
width: 16rpx;
height: 28rpx;
}
.clickTypeView{
.clickContent{
margin-right: 20rpx;
font-size: 28rpx;
color: #333333;
}
.inputTypeView{
background-color: #FFFFFF;
width: 100%;
height: 80rpx;
height: 88rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border: 2rpx solid #999999;
border: 2rpx solid #FAFAFA;
}
.input{
background-color: #FFFFFF;
width: 50%;
height: 60rpx;
text-align: right;
}
.photoTypeView{
......@@ -422,34 +575,86 @@
.textAreaView{
background-color: #FFFFFF;
width: 100%;
height: 400rpx;
display: flex;
height: 196rpx;
}
.textAreaBoxView{
background-color: #FFFFFF;
margin-left: 30rpx;
margin-right: 30rpx;
width: 690rpx;
height: 156rpx;
border: 2rpx solid #CCCCCC;
}
.textArea{
background-color: #FFFFFF;
margin-top: 24rpx;
margin-left: 25rpx;
width: 640rpx;
height: 108rpx;
}
.padding_bottom_180{
padding-bottom: 180rpx;
}
.nameView{
width: 100%;
height: 90%;
border: 2rpx solid #999999;
margin-top: 24rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.inputTypeView{
background-color: #FFFFFF;
.underLine{
text-decoration:underline;
}
.bottomPadding{
padding-bottom: 144rpx;
}
.typeView{
width: 100%;
height: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border: 2rpx solid #999999;
}
.input{
.bottomView{
background-color: #FFFFFF;
width: 50%;
height: 60rpx;
text-align: right;
width: 100%;
height: 110rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-top: 2rpx solid #999999;
position: fixed;
bottom: 0;
}
.bottomTitle{
font-size: 32rpx;
}
</style>
......@@ -143,7 +143,7 @@
onShow() {
//this.getData();
/*
uni.getStorage({
key: 'token',
success: function (res) {
......@@ -156,28 +156,30 @@
})
this.getData()
*/
this.getToken()
},
async getToken () {
await uni.getStorage({
key: 'token',
success: function (res) {
console.log('本地获取token成功')
console.log(res.data);
getApp().globalData.token = res.data
}
})
await this.getData()
},
methods: {
async getToken () {
await uni.getStorage({
key: 'token',
success: function (res) {
console.log('本地获取token成功')
console.log(res.data);
getApp().globalData.token = res.data
}
})
await this.getData()
},
//获取数据
getData: function () {
......@@ -325,20 +327,23 @@
})
}else{
uni.navigateTo({
url: '/pages/take/detail'+'?orderId='+item.orderId
url: '/pages/take/detail'
+'?orderId='+item.orderId,
})
}
}
if(this.activeTop==1){
uni.navigateTo({
url: '/pages/take/detail'+'?orderId='+item.orderId
url: '/pages/take/detail'
+'?orderId='+item.orderId,
})
}
if(this.activeTop==2){
uni.navigateTo({
url: '/pages/take/detail'+'?orderId='+item.orderId
url: '/pages/take/detail'
+'?orderId='+item.orderId,
})
}
......
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