Commit 37caa8cc authored by 李超鹏's avatar 李超鹏

update:add、update

scope:self-support
body:完工页面交互调试
parent 02d04def
......@@ -73,6 +73,21 @@ let orderApiFun = function(vm){
*/
let getWatermark= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/'+ vm.vuex_token+'/photo/watermark', params);
/**
* 获取订单的完工项目(配置+数据)
*/
let getCompleteConfigAndData= async (orderId) => await vm.$u.get('wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 查询措施
*/
let getMeasure= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/service/'+ vm.vuex_token+'/measure/queryMeasureItems', params);
/**
* 保存售后记录
*/
let saveCompleteData = async (params = {},orderId) => await vm.$u.post('wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+ orderId +'/maintain/saveMaintainInfoV2', params);
const orderApi = {
listByRecommendOrder,
listOrderCount,
......@@ -84,13 +99,15 @@ let orderApiFun = function(vm){
listOrderRecord,
orderAccept,
orderGan,
maintainWorkerCheckin,
feedbackConfig,
traceAndAppointment,
rejectOrder,
orderStandard,
saveImage,
getWatermark
getWatermark,
getCompleteConfigAndData,
getMeasure,
saveCompleteData
}
return orderApi
}
......
......@@ -2,7 +2,7 @@
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index"
:class="{'txt':true,'active':checkStatus(item)}" @click="setValue(item)">{{item}}
:class="{'txt':true,'active':checkStatus(item.key)}" @click="setValue(item.key)">{{item.label}}
</view>
</view>
</template>
......@@ -20,7 +20,7 @@
},
computed: {
settings() {
return this.item.settings || []
return this.item.fieldsOptions || []
}
},
watch: {},
......@@ -51,22 +51,22 @@
</script>
<style lang="scss" scoped>
.list {
display: flex;
display: flex;
flex-wrap: wrap;
.txt{
color:#666;
padding:10rpx 30rpx;
margin: 5rpx;
background: #F4F5F7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
max-width: 48%;
&.active{
background-color: #2272FF;
color:#fff;
}
.txt{
color:#666;
padding:10rpx 30rpx;
margin: 5rpx;
background: #F4F5F7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
max-width: 48%;
&.active{
background-color: #2272FF;
color:#fff;
}
}
}
</style>
......@@ -5,48 +5,48 @@
<view class="txt u-flex-1">{{item.fieldsTitle}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> -->
<view class="pics u-flex u-flex-wrap">
<view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="170" height="170" :src="item.path" @click.stop="prviewImage(item.path,index)"></u-image>
<view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view>
<view class="icon-del rotate"></view>
</view>
</view>
<view class="img-list" @click="choose">
<u-image class="pic" width="170rpx" height="170" @click="selectUpload" src="https://gitee.com/xuqu/uView/blob/master/static/uview/example/min_button.png"></u-image>
<u-image class="pic" width="170" height="170" :src="item.path" @click.stop="prviewImage(item.path,index)"></u-image>
<view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view>
<view class="icon-del rotate"></view>
</view>
</view>
<view class="img-list">
<u-image class="pic" width="170rpx" height="170" @click="selectUpload" src="https://gitee.com/xuqu/uView/blob/master/static/uview/example/min_button.png"></u-image>
</view>
<!-- <u-image class="pic" v-for="item in 6" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image> -->
</view>
</view>
<u-action-sheet :list="list" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet>
</view>
</template>
<script>
import objMixin from './objMixin'
import arrMixin from './arrMixin'
import baseFile from '@/components/upload/index';
export default {
name: 'XhFiles',
components: {},
mixins: [objMixin,baseFile],
props: {
files: {
type: Array,
}
mixins: [arrMixin,baseFile],
props: {
files: {
type: Array,
}
},
filters:{},
data() {
return {
maskShow:false,
list: [
{
text: '相册'
},
{
text: '拍照'
}
],
takeStatus: false,
maskShow:false,
list: [
{
text: '相册'
},
{
text: '拍照'
}
],
takeStatus: false,
}
},
computed: {
......@@ -54,34 +54,54 @@
return this.item.settings || []
}
},
watch: {
'takeStatus': function(val, oldVal){
this.$emit('getTakeStatus', {status: val, index: this.itemIndex})
},
'files': { // 处理相机拍照返回的图片
handler (val) {
this.imgList = val.map(v => {
v.path = v.src
return v
})
this.setValue()
},
deep:true,
immediate: true,
}
watch: {
'takeStatus': function(val, oldVal){
this.$emit('getTakeStatus', {status: val, index: this.itemIndex})
},
'files': { // 处理相机拍照返回的图片
handler (val) {
if(val && val.length > 0){
val.forEach((item,index,array)=>{
item.path = item.src
this.imgList.push(item)
})
// this.imgList = val.map(v => {
// v.path = v.src
// return v
// })
this.setValue()
}
},
deep:true,
immediate: true,
},
// 'value'(val, oldVal){
// if(val){
// this.imgList = val.map(img =>{
// return {path:img}
// })
// }
// }
},
mounted() {
if(this.value){
this.imgList = this.value.map(img =>{
return {path: img}
})
}
this.setValue()
},
mounted() {},
methods: {
selectUpload(){
// 弹窗展示
this.maskShow = true
},
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo')
} else {
this.uploadFile()
}
},
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo')
} else {
this.uploadFile()
}
},
async uploadFile(type){
const self = this
......@@ -89,8 +109,8 @@
// 直接打开相册
let config = {
options:{
sourceType:['album'],//['album', 'camera']
count: 5,
sourceType:['album'],//['album', 'camera']
count: 10,
sizeType: ['compressed']
}
}
......@@ -104,67 +124,67 @@
setValue() {
const dataValue = []
this.imgList.map(item=>{
dataValue.push(item.key)
})
console.log(this.imgList)
dataValue.push(item.src)
})
this.valueChange(dataValue)
},
prviewImage(url, index) {
uni.previewImage({
urls: [url],
current: index
});
},
delFile(index) {
this.imgList.splice(index, 1)
},
prviewImage(url, index) {
uni.previewImage({
urls: [url],
current: index
});
},
delFile(index) {
this.imgList.splice(index, 1)
this.setValue()
}
}
}
</script>
<style lang="scss" scoped>
.pic{
margin-right: 15rpx;
margin-bottom: 15rpx;
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&:nth-child(3n){
margin-right: 0;
}
}
.img-list {
position: relative;
margin: 8rpx;
border: 1px solid #eee;
width: 170rpx;
height: 170rpx;
.icon-del-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
position: absolute;
top: 10rpx;
right: 10rpx;
height: 40rpx;
width: 40rpx;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2;
transform: rotate(-45deg);
}
.icon-del {
width: 30rpx;
height: 4rpx;
background-color: #fff;
border-radius: 2px;
}
.rotate {
position: absolute;
transform: rotate(90deg);
}
}
}
.img-list {
position: relative;
margin: 8rpx;
border: 1px solid #eee;
width: 170rpx;
height: 170rpx;
.icon-del-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
position: absolute;
top: 10rpx;
right: 10rpx;
height: 40rpx;
width: 40rpx;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2;
transform: rotate(-45deg);
}
.icon-del {
width: 30rpx;
height: 4rpx;
background-color: #fff;
border-radius: 2px;
}
.rotate {
position: absolute;
transform: rotate(90deg);
}
}
// .list {
// display: flex;
......
......@@ -16,8 +16,7 @@
return {}
},
computed: {
type() {
console.log(this.item)
type() {
if (this.item && this.item.fieldsType == 'password' || this.item.fieldsType == 'textarea') {
return this.item.fieldsType
} else {
......@@ -32,7 +31,7 @@
</script>
<style scoped>
.input-item{
background: #F4F5F7;
.input-item{
background: #F4F5F7;
}
</style>
<!-- ******************* 定位 ******************* -->
<template>
<template>
<view>
<view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view>
<!-- <u-button type="primary" size="mini" @click="$u.debounce(getLocation,1000)">自动定位</u-button> -->
<view class="u-flex-1 location-name">
<u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位
</view>
</view>
<view class="u-flex-1 location">{{valueTxt || '正在获取中...'}}</view>
<view class="u-flex-1 location-name">
<u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位
</view>
</view>
<view class="u-flex-1 location">{{valueTxt || '正在获取中...'}}</view>
</view>
</template>
<script>
import objMixin from './objMixin'
import arrMixin from './arrMixin'
export default {
name: 'XhLocation',
components: {},
mixins: [objMixin],
mixins: [arrMixin],
props: {},
filters:{},
data() {
......@@ -28,18 +27,18 @@
valueTxt() {
let str = ''
const dataValue = this.dataValue
if(dataValue && dataValue.length>1){
if(dataValue && dataValue.length>1){
str = '经度:'+dataValue[0].toFixed(4)+','+'纬度:'+dataValue[1].toFixed(4)
}
return str
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
}
},
watch: {},
created() {
this.getLocation()
created() {
this.getLocation()
},
methods: {
getLocation() {
......@@ -69,18 +68,18 @@
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.location-name {
color: #2272FF;
text-align: right;
}
.location {
background: #F4F5F7;
padding: 10rpx;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.location-name {
color: #2272FF;
text-align: right;
}
.location {
background: #F4F5F7;
padding: 10rpx;
}
</style>
<!-- ******************* 单级/多级 选择 ******************* -->
<!-- ******************* 服务措施 ******************* -->
<template>
<view class="picker-box">
<view class="u-flex u-row-between" @click="openPicker">
......
<!-- ******************* 单选框 ******************* -->
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index" :class="{'txt':true,'active':item===dataValue}"
@click="setValue(item)">{{item}}</view>
<view v-for="(item,index) in settings" :key="index" :class="{'txt':true,'active':item.key===dataValue}"
@click="setValue(item.key)">{{item.label}}</view>
</view>
</template>
......@@ -17,8 +17,8 @@
return {}
},
computed: {
settings(){
return this.item.settings || []
settings(){
return this.item.fieldsOptions || []
}
},
watch: {},
......@@ -33,23 +33,23 @@
</script>
<style lang="scss" scoped>
.list{
display: flex;
display: flex;
flex-wrap: wrap;
.txt{
color:#666;
padding:10rpx 30rpx;
margin: 5rpx;
background: #F4F5F7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
text-align: center;
max-width: 48%;
&.active{
background-color: #2272FF;
color:#fff;
}
.txt{
color:#666;
padding:10rpx 30rpx;
margin: 5rpx;
background: #F4F5F7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
text-align: center;
max-width: 48%;
&.active{
background-color: #2272FF;
color:#fff;
}
}
}
</style>
<!-- ******************* 单个下拉选择 ******************* -->
<template>
<view>
<u-input v-model="dataValue" readOnly @click="show=true" type="select" />
<u-input :value="text" readOnly @click="show=true" type="select" />
<u-action-sheet :list="settings" v-model="show" @click="actionSheetCallback"></u-action-sheet>
</view>
</template>
......@@ -28,22 +28,27 @@
},
settings() {
let result = []
let settings = this.item.settings || []
let settings = this.item.fieldsOptions || []
result = settings.map(item => {
return {
text: item
text: item.label,
id: item.key
}
})
return result
},
text(){
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue})
return option?option.label:''
}
},
watch: {},
mounted() {},
methods: {
actionSheetCallback(index) {
let txt = this.settings[index].text;
this.dataValue = txt
this.valueChange(txt)
let id = this.settings[index].id;
this.dataValue = id
this.valueChange(id)
}
}
}
......
......@@ -2,8 +2,8 @@
<template>
<view class="picker-box">
<view class="u-flex u-row-between" @click="openPicker">
<view class="txt">{{item.fieldsTitle}}</view>
<view class="txt u-flex-1">{{dataValue}}</view>
<!-- <view class="txt">{{item.fieldsTitle}}</view> -->
<view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker>
......@@ -25,10 +25,9 @@
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
// 选择时间的时间戳
hour: false,
minute: false,
second: false,
timestamp: true,
}
}
......@@ -49,11 +48,8 @@
this.showPicker = true
},
pickerConfirm(data) {
console.log(data, 'DATA')
let result = []
let dataValue = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute +
':' + data.second
console.log(dataValue, 'dataValue')
let dataValue = data.year + '-' + data.month + '-' + data.day
this.dataValue = dataValue
this.valueChange(dataValue)
},
......
This diff is collapsed.
......@@ -377,7 +377,9 @@
filish(){
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+this.order.orderId
url: 'pages/order/complete?orderId='+this.order.orderId
+ "&categoryId=" + this.order.categoryId
+ "&orderServiceType=" + this.order.orderServiceType
})
},
/**
......
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