Commit 851dbac8 by 李伟康

Merge branch 'SAAS+V5.0.0-1014' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.0.0-1014

2 parents 4bf15c61 76b266a5
No preview for this file type
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
.icon-change-account { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-change-account { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.44714407502131287) calc(100vmin * (1173 / 768) * -0.4113384484228474);} background-position: calc(100vmin * (1173 / 768) * -0.44714407502131287) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-clone { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-clone { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.5473145780051151) calc(100vmin * (1173 / 768) * -0.4113384484228474);} background-position: calc(100vmin * (1173 / 768) * -0.5341005967604433) calc(100vmin * (1173 / 768) * -0.6717817561807332);}
.icon-coupon-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-coupon-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.46717817561807334) calc(100vmin * (1173 / 768) * -0.4113384484228474);} background-position: calc(100vmin * (1173 / 768) * -0.46717817561807334) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-coupon { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-coupon { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
...@@ -109,6 +109,8 @@ ...@@ -109,6 +109,8 @@
background-position: calc(100vmin * (1173 / 768) * -0.578005115089514) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.578005115089514) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-feedback { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-feedback { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.526001705029838);} background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.526001705029838);}
.icon-feedbackIcon { width: calc(100vmin * (1173 / 768) * 0.011082693947144074); height: calc(100vmin * (1173 / 768) * 0.011082693947144074);
background-position: calc(100vmin * (1173 / 768) * -0.5473145780051151) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-ffdyj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-ffdyj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.6952259164535379) calc(100vmin * (1173 / 768) * -0.3034953111679454);} background-position: calc(100vmin * (1173 / 768) * -0.6952259164535379) calc(100vmin * (1173 / 768) * -0.3034953111679454);}
.icon-filter { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-filter { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
......

2.79 MB | W: | H:

2.79 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<view class="date-list"> <view class="date-list">
<picker-view <picker-view class="picker picker_max" :value="dateValues" indicator-class="indicator" @change="changeDate">
class="picker picker_max"
:value="dateValues"
indicator-class="indicator"
@change="changeDate"
>
<picker-view-column> <picker-view-column>
<template v-for="(item,index) in days"> <template v-for="(item, index) in days">
<view <view class="view" :key="index">{{ item }}</view>
class="view"
:key="index"
>{{item}}</view>
</template> </template>
</picker-view-column> </picker-view-column>
</picker-view> </picker-view>
<picker-view <picker-view class="picker" :value="hourValues" indicator-class="indicator" @change="changeHour">
class="picker"
:value="hourValues"
indicator-class="indicator"
@change="changeHour"
>
<picker-view-column> <picker-view-column>
<template v-for="(item,index) in hours"> <template v-for="(item, index) in hours">
<view <view class="view" :key="index">{{ item }}</view>
class="view"
:key="index"
>{{item}}</view>
</template> </template>
</picker-view-column> </picker-view-column>
</picker-view> </picker-view>
<picker-view <picker-view class="picker" :value="minuteValues" indicator-class="indicator" @change="changeMinutes">
class="picker"
:value="minuteValues"
indicator-class="indicator"
@change="changeMinutes"
>
<picker-view-column> <picker-view-column>
<template v-for="(item,index) in minutes"> <template v-for="(item, index) in minutes">
<view <view class="view" :key="index">{{ item }}</view>
class="view"
:key="index"
>{{item}}</view>
</template> </template>
</picker-view-column> </picker-view-column>
</picker-view> </picker-view>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
name: 'DateTime', name: 'DateTime',
...@@ -208,7 +184,7 @@ export default { ...@@ -208,7 +184,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.date-list { .date-list {
height: 100%; height: 100%;
display: grid; display: grid;
...@@ -224,7 +200,7 @@ export default { ...@@ -224,7 +200,7 @@ export default {
height: toRpx(72); height: toRpx(72);
} }
} }
/deep/.indicator{ /deep/.indicator {
height: toRpx(72); height: toRpx(72);
} }
} }
......
<template>
<view class="date-list">
<picker-view class="picker picker_max" :value="dateValues" indicator-class="indicator" @change="changeDate">
<picker-view-column>
<template v-for="(item, index) in days">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view class="picker" :value="hourValues" indicator-class="indicator" @change="changeHour">
<picker-view-column>
<template v-for="(item, index) in hours">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view class="picker" :value="minuteValues" indicator-class="indicator" @change="changeMinutes">
<picker-view-column>
<template v-for="(item, index) in minutes">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
export default {
name: 'DateTimeChange',
inject: ['userInfo'],
data () {
return {
hours: [],
days: [],
minutes: [],
dateValues: [],
hourValues: [],
minuteValues: [],
loading: true
}
},
props: {
},
mounted () {
this.initDate()
},
methods: {
initDate () {
console.log('initDate')
this.dateValues = []
this.hourValues = []
this.minuteValues = []
const today = new Date()
this.getDateList('2019/01/01','2029/01/01')
},
getDateList (starDay, endDay) {
const arr = [];
const dates = [];
// 设置两个日期UTC时间
const db = new Date(starDay);
const de = new Date(endDay);
// 获取两个日期GTM时间
const s = db.getTime() - 24 * 60 * 60 * 1000;
const d = de.getTime() - 24 * 60 * 60 * 1000;
console.log(db,de)
// 获取到两个日期之间的每一天的毫秒数
for (let i = s; i <= d;) {
i = i + 24 * 60 * 60 * 1000;
arr.push(parseInt(String(i)));
}
// 获取每一天的时间 YY-MM-DD
for (const j in arr) {
const time = new Date(arr[j]);
const year = time.getFullYear();
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
const YYMMDD = year + '/' + mouth + '/' + day;
dates.push(YYMMDD);
}
this.getHourList(dates)
},
getHourList (days) {
const hours = [], today = new Date();
for (let hour = 0; hour < today.getHours() + 1; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
this.getMinuteList(days, hours)
},
getMinuteList (days, hours) {
const minutes = [];
const today = new Date()
for (let minute = 0; minute < today.getMinutes() + 1; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
// 设置默认时间
let { dateValues, hourValues, minuteValues } = this
const HOUR_STR = today.getHours().toString().padStart(2, '0')
const MUNTUE_STR = today.getMinutes().toString().padStart(2, '0')
// const defalutHIndex = hours.indexOf(HOUR_STR)
// const defalutMIndex = minutes.indexOf(MUNTUE_STR)
dateValues.push(days.length + 1)
hourValues.push(hours.length + 1)
minuteValues.push(minutes.length + 1)
this.currentDate = dayjs().format('YYYY/MM/DD')
this.currentHour = HOUR_STR
this.currentMinute = MUNTUE_STR
this.hours = hours
this.days = days
this.minutes = minutes
this.dateValues = dateValues
this.hourValues = hourValues
this.minuteValues = minuteValues
this.loading = false
setTimeout(() => {
this.minuteValues = minuteValues
this.loading = false
}, 100)
this.$emit('onComplete')
},
changeDate (e) {
const { days } = this
const { value } = e.detail
const index = value[0]
this.currentDate = days[index]
// 选择过去时间需要重新初始化时分
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType)
},
changeHour (e) {
const { hours, days, dateValues } = this
const { value } = e.detail
const index = value[0]
this.currentHour = hours[index]
// 处理当前天切换别的小时,别的分不能选后面分到60的问题
// const dayIndex = dateValues[0]
// this.currentDate = days[dayIndex]
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTimeMinute(timeType)
},
changeMinutes (e) {
const { minutes } = this
const { value } = e.detail
const index = value[0]
this.currentMinute = minutes[index]
},
getAllTimeOrPartTime (type) {
const today = new Date()
const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1;
for (let hour = 0; hour < hour_len; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.hours = hours
this.minutes = minutes
},
getAllTimeOrPartTimeMinute (type) {
const today = new Date()
const currentHour = today.getHours()
const timeType = this.currentHour != currentHour ? 1 : 0
const minutes = [], minute_len = type == 1 || timeType == 1 ? 60 : today.getMinutes() + 1;
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.minutes = minutes
},
getResult () {
let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00"
const result = dayjs(str).format('YYYY/MM/DD HH:mm:ss')
return result
}
}
}
</script>
<style scoped lang="scss">
.date-list {
height: 100%;
display: grid;
grid-template-columns: repeat(3, 1fr);
.picker {
height: 100%;
text-align: center;
.view {
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(32);
height: toRpx(72);
}
}
/deep/.indicator {
height: toRpx(72);
}
}
</style>
...@@ -173,6 +173,12 @@ const componentConfig = { ...@@ -173,6 +173,12 @@ const componentConfig = {
loadComplete: false, loadComplete: false,
hideSearch: true, hideSearch: true,
noData: false noData: false
},
15: {
name: 'DateTimeChange',
title: '选择时间',
hideSearch: true,
loadComplete: false
} }
} }
export default { componentConfig } export default { componentConfig }
...@@ -41,6 +41,7 @@ import PackageList from './components/PackageList.vue' ...@@ -41,6 +41,7 @@ import PackageList from './components/PackageList.vue'
import SkuGoodsList from './components/SkuGoodsList.vue' import SkuGoodsList from './components/SkuGoodsList.vue'
import SkuPopup from './components/SkuPopup.vue' import SkuPopup from './components/SkuPopup.vue'
import DateTime from './components/DateTime.vue' import DateTime from './components/DateTime.vue'
import DateTimeChange from './components/DateTimeChange.vue'
import AgreementList from './components/AgreementList.vue' import AgreementList from './components/AgreementList.vue'
export default { export default {
components: { components: {
...@@ -54,7 +55,8 @@ export default { ...@@ -54,7 +55,8 @@ export default {
SkuGoodsList, SkuGoodsList,
SkuPopup, SkuPopup,
DateTime, DateTime,
AgreementList AgreementList,
DateTimeChange
}, },
name: '', name: '',
props: { props: {
...@@ -167,7 +169,7 @@ export default { ...@@ -167,7 +169,7 @@ export default {
confirm () { confirm () {
try { try {
let { chooseContent, popupType, componentObject } = this let { chooseContent, popupType, componentObject } = this
if (popupType == 13) { if (popupType == 13 || popupType == 15) {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if (chooseContent) { if (chooseContent) {
......
...@@ -164,17 +164,17 @@ function requestAndroidPermission(permissionID) { ...@@ -164,17 +164,17 @@ function requestAndroidPermission(permissionID) {
var result = 0; var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) { for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i]; var grantedPermission = resultObj.granted[i];
uni.$logger.local.info('已获取的权限:' + grantedPermission); console.log('已获取的权限:' + grantedPermission);
result = 1 result = 1
} }
for (var i = 0; i < resultObj.deniedPresent.length; i++) { for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i]; var deniedPresentPermission = resultObj.deniedPresent[i];
uni.$logger.local.info('拒绝本次申请的权限:' + deniedPresentPermission); console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0 result = 0
} }
for (var i = 0; i < resultObj.deniedAlways.length; i++) { for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i]; var deniedAlwaysPermission = resultObj.deniedAlways[i];
uni.$logger.local.info('永久拒绝申请的权限:' + deniedAlwaysPermission); console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1 result = -1
} }
resolve(result); resolve(result);
...@@ -184,7 +184,7 @@ function requestAndroidPermission(permissionID) { ...@@ -184,7 +184,7 @@ function requestAndroidPermission(permissionID) {
// } // }
}, },
function(error) { function(error) {
uni.$logger.error('申请权限错误:' + error.code + " = " + error.message); console.log('申请权限错误:' + error.code + " = " + error.message);
resolve({ resolve({
code: error.code, code: error.code,
message: error.message message: error.message
......
<template> <template>
<div class="button-module flex"> <div class="button-module flex">
<view class="common-btn" @click.stop="handleClick('details')">详情</view> <view class="common-btn" @click.stop="handleClick('details')">详情</view>
<view v-if="!subStatus && status != 100" class="common-btn ml-24" @click.stop="handleClick('edit')">编辑</view> <view v-if="!subStatus && status != 100 && status != '-1'" class="common-btn ml-24" @click.stop="handleClick('edit')">编辑</view>
<view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote','app_evaluate_requote')">重新报价</view> <view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote', 'app_evaluate_requote')">重新报价</view>
<view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign','app_evaluate_sign')">客户签约</view> <view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign', 'app_evaluate_sign')">客户签约</view>
<view v-if="status == 20 && subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view> <view v-if="status == 20 && subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view>
<view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign','app_evaluate_cancel_sign')">取消签约</view> <view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign', 'app_evaluate_cancel_sign')">取消签约</view>
<view v-if="status == 30 && !subStatus && paymentType == 1" class="common-btn blue-btn ml-24" @click.stop="handleClick('payDeposit','app_evaluate_pay_deposit')">支付定金</view> <view v-if="status == 30 && !subStatus && paymentType == 1" class="common-btn blue-btn ml-24" @click.stop="handleClick('payDeposit', 'app_evaluate_pay_deposit')">支付定金</view>
<view v-if="status == 30 && !subStatus && paymentType == 2" class="common-btn blue-btn ml-24" @click.stop="handleClick('payFull','app_evaluate_pay_full')">支付全款</view> <view v-if="status == 30 && !subStatus && paymentType == 2" class="common-btn blue-btn ml-24" @click.stop="handleClick('payFull', 'app_evaluate_pay_full')">支付全款</view>
<view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view> <view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view>
<view v-if="status == 40 && !subStatus && paymentType == 1" class="common-btn blue-btn ml-24" @click.stop="handleClick('payFull','app_evaluate_pay_final')">支付尾款</view> <view v-if="status == 40 && !subStatus && paymentType == 1" class="common-btn blue-btn ml-24" @click.stop="handleClick('payFull', 'app_evaluate_pay_final')">支付尾款</view>
<view v-if="status == 50 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('confirmDelivery','app_evaluate_confirm_delivery')">确认交车</view> <view v-if="status == 50 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('confirmDelivery', 'app_evaluate_confirm_delivery')">确认交车</view>
<view v-if="status == '-1'" class="common-btn blue-btn ml-24" @click.stop="handleClick('reSubmit','app_evaluate_re_submit')">重新提交</view> <view v-if="status == '-1'" class="common-btn blue-btn ml-24" @click.stop="handleClick('reSubmit', 'app_evaluate_re_submit')">重新提交</view>
</div> </div>
</template> </template>
...@@ -38,11 +38,12 @@ export default { ...@@ -38,11 +38,12 @@ export default {
} }
}, },
methods: { methods: {
handleClick(buttonType ,eventCode) { handleClick(buttonType, eventCode) {
this.$emit('button-click', { this.$emit('button-click', {
type: buttonType type: buttonType
}) })
if(eventCode) uni.$track.add({ if (eventCode)
uni.$track.add({
eventCode eventCode
}) //点击埋点 }) //点击埋点
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')"> <view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')">
<view class="sprite-icon icon-scanIconX"></view> <view class="sprite-icon icon-scanIconX"></view>
</view> </view>
<text v-if="field.isCell" class="ml-12 cellLabel">{{ field.cell }}</text> <text v-if="field.isCell" class="ml-12 cellLabel" :class="{ disabled: field.disabled }">{{ field.cell }}</text>
</template> </template>
<template v-if="field.type === 'select'"> <template v-if="field.type === 'select'">
<view class="flex align-center from-value"> <view class="flex align-center from-value">
...@@ -53,14 +53,13 @@ ...@@ -53,14 +53,13 @@
<template v-if="field.type === 'radio'"> <template v-if="field.type === 'radio'">
<radio-group class="radio-group flex align-center" @change="e => radioChange(e, field)"> <radio-group class="radio-group flex align-center" @change="e => radioChange(e, field)">
<label class="uni-list-cell uni-list-cell-pd align-center flex ml-48" v-for="(item, index) in field.radioList" :key="item.value"> <label class="uni-list-cell uni-list-cell-pd align-center flex ml-48" v-for="(item, index) in field.radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="index === current" /> <radio style="transform: scale(0.7)" :value="item.value" :checked="getRadioChecked(item.value, field)" />
<view class="radio-name">{{ item.name }}</view> <view class="radio-name">{{ item.name }}</view>
</label> </label>
</radio-group> </radio-group>
</template> </template>
<template v-if="field.type === 'pricek'"> <template v-if="field.type === 'pricek'">
<picker @change="e => bindPickerChange(e, field)" range-key="name" :value="field.value" :range="field.fieldPickerArray"> <picker @change="e => bindPickerChange(e, field)" range-key="name" :value="getPickerValue(field)" :range="field.fieldPickerArray">
<view class="flex align-center from-value"> <view class="flex align-center from-value">
<template v-if="field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetKey]"> <template v-if="field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetKey]">
{{ field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetNameKey] }} {{ field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetNameKey] }}
...@@ -93,7 +92,7 @@ ...@@ -93,7 +92,7 @@
<view class="pdf-box flex align-center justify-between" v-if="field.isShowPreview"> <view class="pdf-box flex align-center justify-between" v-if="field.isShowPreview">
<view class="flex align-center"> <view class="flex align-center">
<view class="sprite-icon icon-pdf"></view> <view class="sprite-icon icon-pdf"></view>
<text>二手车买卖补充协议</text> <text>二手车补充协议</text>
</view> </view>
<view class="flex align-center"> <view class="flex align-center">
<view class="btn" @click.stop="previewPdf(field)">预览</view> <view class="btn" @click.stop="previewPdf(field)">预览</view>
...@@ -172,6 +171,14 @@ export default { ...@@ -172,6 +171,14 @@ export default {
// 验证通过,触发输入事件 // 验证通过,触发输入事件
this.$emit('inputChange', e, field) this.$emit('inputChange', e, field)
}, },
getRadioChecked(value, field) {
if (field.targetObj && this.formData[field.targetObj] && this.formData[field.targetObj][field.targetKey] !== undefined) {
return this.formData[field.targetObj][field.targetKey] === value
} else if (this.formData[field.targetKey] !== undefined) {
return this.formData[field.targetKey] === value
}
return false
},
handleBlur(e, field) { handleBlur(e, field) {
console.log('handleBlur', e, field) console.log('handleBlur', e, field)
let value = e.target?._value?.trim() || e.target?.value?.trim() let value = e.target?._value?.trim() || e.target?.value?.trim()
...@@ -185,6 +192,20 @@ export default { ...@@ -185,6 +192,20 @@ export default {
this.$emit('blurChange', value, field) this.$emit('blurChange', value, field)
} }
}, },
getPickerValue(field) {
if (field.index !== undefined) {
return field.index
}
if (field.fieldPickerArray && field.fieldPickerArray.length > 0) {
const currentValue = field.targetObj ? this.formData[field.targetObj][field.targetKey] : this.formData[field.targetKey]
if (currentValue) {
const index = field.fieldPickerArray.findIndex(item => item.value === currentValue || item.name === currentValue)
return index >= 0 ? index : 0
}
}
return 0
},
scan(type) { scan(type) {
this.$emit('scan', type) this.$emit('scan', type)
}, },
...@@ -272,10 +293,18 @@ export default { ...@@ -272,10 +293,18 @@ export default {
text-align: right; text-align: right;
outline: none; outline: none;
} }
.formInput:disabled {
color: #999999;
}
.cellLabel { .cellLabel {
color: #333333; color: #333333;
font-size: toRpx(28); font-size: toRpx(28);
} }
.cellLabel.disabled {
color: #999999;
font-size: toRpx(28);
font-weight: 400;
}
.form-item-textarea { .form-item-textarea {
flex-direction: column; flex-direction: column;
align-items: start; align-items: start;
......
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
methods: { methods: {
open() { open() {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.$refs) console.log(this.$refs.publishPopup)
if (this.$refs.publishPopup) { if (this.$refs.publishPopup) {
this.$refs.publishPopup.open() this.$refs.publishPopup.open()
} }
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
this.$emit('close') this.$emit('close')
}, },
confirm() { confirm() {
console.log('confirm', this.autoClose)
if (this.resolve) { if (this.resolve) {
if (this.autoClose) { if (this.autoClose) {
this.$refs.publishPopup.close() this.$refs.publishPopup.close()
...@@ -148,6 +149,9 @@ export default { ...@@ -148,6 +149,9 @@ export default {
width: 100%; width: 100%;
height: toRpx(164); height: toRpx(164);
background-color: #fff; background-color: #fff;
.btn {
width: toRpx(720);
}
} }
} }
//小弹窗 //小弹窗
...@@ -220,7 +224,7 @@ export default { ...@@ -220,7 +224,7 @@ export default {
width: 100%; width: 100%;
} }
.btn { .btn {
flex: 1; width: toRpx(720);
height: toRpx(76); height: toRpx(76);
border-radius: toRpx(48); border-radius: toRpx(48);
opacity: 1; opacity: 1;
......
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
</view> </view>
<!-- 右侧名称和内容区域 --> <!-- 右侧名称和内容区域 -->
<view class="step-right-area"> <view class="step-right-area">
<view class="step-name" :class="{ active: currentStep >= index + 1 }"> <view class="step-name flex align-center justify-between" :class="{ active: currentStep >= index + 1 }">
{{ step.roundNo ? `第${step.roundNo}轮报价` : '编辑记录' }} <view>{{ step.roundNo ? `第${step.roundNo}轮报价` : index == steps.length - 1 ? '首次提交' : '编辑记录' }}</view>
<view class="step-time">{{ step.quoteTime || step.operateTime }}</view>
</view> </view>
<!-- 可自定义添加其他内容 --> <!-- 可自定义添加其他内容 -->
<slot :step="step" :indexContent="index"></slot> <slot :step="step" :indexContent="index"></slot>
...@@ -171,6 +172,11 @@ export default { ...@@ -171,6 +172,11 @@ export default {
white-space: normal; white-space: normal;
margin-bottom: toRpx(20); margin-bottom: toRpx(20);
} }
.step-time {
color: #999999;
font-size: toRpx(28);
font-weight: 400;
}
/* 连接线容器 */ /* 连接线容器 */
.dash-line-wrapper { .dash-line-wrapper {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
<view class="info-item flex align-center"> <view class="info-item flex align-center">
<text class="common-label flex-shrink-0">工单时间</text> <text class="common-label flex-shrink-0">工单时间</text>
<view class="common-value text-ellipsis ml-16">{{ carInfo.createdDate }}</view> <view class="common-value text-ellipsis ml-16">{{ carInfo.evalOrderTime }}</view>
</view> </view>
<view class="info-item flex align-center" v-if="carInfo.status != 10 && carInfo.status != 20"> <view class="info-item flex align-center" v-if="carInfo.status != 10 && carInfo.status != 20">
<text class="common-label flex-shrink-0">签约时间</text> <text class="common-label flex-shrink-0">签约时间</text>
...@@ -51,10 +51,17 @@ ...@@ -51,10 +51,17 @@
</view> </view>
<ButtonModule @button-click="$emit('button-click', { ...$event, ...carInfo })" :status="carInfo.status" :subStatus="carInfo.subStatus" :paymentType="carInfo.paymentType"></ButtonModule> <ButtonModule @button-click="$emit('button-click', { ...$event, ...carInfo })" :status="carInfo.status" :subStatus="carInfo.subStatus" :paymentType="carInfo.paymentType"></ButtonModule>
</view> </view>
<view v-if="carInfo.status == -1"> <view v-if="carInfo.status == -1">
<view class="tips px-20"> <view class="text-ellipsis tips px-20 justify-between">
<view class="flex-1 flex align-center">
<view class="sprite-icon icon-study-tips"></view> <view class="sprite-icon icon-study-tips"></view>
<view class="text-ellipsis">驳回原因:{{ carInfo.rejectReason }}</view> 驳回原因:{{ carInfo.rejectReason }}
</view>
<view class="flex-1 flex align-center">
<view class="sprite-icon icon-feedbackIcon"></view>
驳回意见:{{ carInfo.rejectSuggestion }}
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -237,6 +244,9 @@ export default { ...@@ -237,6 +244,9 @@ export default {
.icon-study-tips { .icon-study-tips {
margin-right: toRpx(8); margin-right: toRpx(8);
} }
.icon-feedbackIcon {
margin-right: toRpx(8);
}
.waitinputorder-btn { .waitinputorder-btn {
width: toRpx(136); width: toRpx(136);
height: toRpx(50); height: toRpx(50);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<template> <template>
<view class="form-btn flex align-center"> <view class="form-btn flex align-center">
<view class="btn search mr-12" @click.stop="search">查询</view> <view class="btn search mr-12" @click.stop="search">查询</view>
<view class="btn" @click.stop="$emit('reset')">重置</view> <view class="btn" @click.stop="resetForm">重置</view>
</view> </view>
</template> </template>
</view> </view>
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
<script> <script>
export default { export default {
name: 'searchBox', name: 'searchBox',
watch: {
searchValue: {
handler(newVal) {
this.customerInfo = { ...newVal }
},
immediate: true
}
},
data() { data() {
return { return {
focusIndex: -1, focusIndex: -1,
...@@ -51,7 +59,7 @@ export default { ...@@ -51,7 +59,7 @@ export default {
popKey: 'licensePlate' popKey: 'licensePlate'
}, },
{ {
placeholder: '评估单号', placeholder: '工单编号',
key: 'carModel', key: 'carModel',
type: 'input', type: 'input',
popKey: 'evalOrderNo' popKey: 'evalOrderNo'
...@@ -81,6 +89,16 @@ export default { ...@@ -81,6 +89,16 @@ export default {
resetFocusIndex() { resetFocusIndex() {
this.focusIndex = -1 this.focusIndex = -1
this.errorTip = false this.errorTip = false
},
resetForm() {
this.customerInfo = {
previousOwnerName: '',
previousOwnerPhone: '',
licensePlate: '',
evalOrderNo: ''
}
this.$emit('update:searchValue', this.customerInfo)
this.$emit('reset')
} }
} }
} }
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
</view> </view>
</template> </template>
<script> <script>
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js' // import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import { uploadFile } from '@/utils/ossUpload.js'
import permision from '@/js_sdk/wa-permission/permission.js'
export default { export default {
name: 'UploadMedia', name: 'UploadMedia',
...@@ -72,7 +74,22 @@ export default { ...@@ -72,7 +74,22 @@ export default {
}, },
methods: { methods: {
// 处理媒体上传 // 处理媒体上传
handleMediaUpload(field) { async handleMediaUpload(field) {
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) {
uni.showToast({ title: '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限', icon: 'none' })
return
}
if (camera != 1) {
uni.showToast({ title: '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限', icon: 'none' })
return
}
if (!isOnline) {
uni.showToast({ title: '当前无网络连接,请连接网络后重试', icon: 'none' })
return
}
// 根据字段类型显示不同的操作菜单 // 根据字段类型显示不同的操作菜单
const itemList = [] const itemList = []
if (field.accept === 'image' || !field.accept) { if (field.accept === 'image' || !field.accept) {
...@@ -117,6 +134,13 @@ export default { ...@@ -117,6 +134,13 @@ export default {
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) {
if (file.size > MAX_IMAGE_SIZE) {
uni.showToast({ title: '图片上传最大10MB', icon: 'none' })
return
}
}
uni.showLoading({ title: '上传中...' }) uni.showLoading({ title: '上传中...' })
// 上传所有选择的图片 // 上传所有选择的图片
for (const tempFilePath of res.tempFilePaths) { for (const tempFilePath of res.tempFilePaths) {
...@@ -129,7 +153,7 @@ export default { ...@@ -129,7 +153,7 @@ export default {
} }
} catch (error) { } catch (error) {
console.log('上传图片失败', error) console.log('上传图片失败', error)
uni.showToast({ title: '上传图片失败', icon: 'none' }) uni.showToast({ title: '图片上传失败,请重试', icon: 'none' })
} }
}, },
fail: err => { fail: err => {
...@@ -149,12 +173,19 @@ export default { ...@@ -149,12 +173,19 @@ export default {
sizeType: ['compressed'], sizeType: ['compressed'],
sourceType: ['album'], sourceType: ['album'],
success: async res => { success: async res => {
console.log(res, '选择图片')
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) {
if (file.size > MAX_IMAGE_SIZE) {
uni.showToast({ title: '图片上传最大10MB', icon: 'none' })
return
}
}
uni.showLoading({ title: '上传中...' }) uni.showLoading({ title: '上传中...' })
// 上传所有选择的图片 // 上传所有选择的图片
for (const tempFilePath of res.tempFilePaths) { for (let i = 0; i < res.tempFilePaths.length; i++) {
console.log(res, '上传所有选择的图片') const url = await uploadFile(res.tempFiles[i], res.tempFilePaths[i])
const url = await uploadFile(tempFilePath)
console.log('上传图片成功', url) console.log('上传图片成功', url)
uni.hideLoading() uni.hideLoading()
// const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase() // const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase()
...@@ -162,7 +193,7 @@ export default { ...@@ -162,7 +193,7 @@ export default {
} }
} catch (error) { } catch (error) {
console.log('上传图片失败', error) console.log('上传图片失败', error)
uni.showToast({ title: '上传图片失败', icon: 'none' }) uni.showToast({ title: '图片上传失败,请重试', icon: 'none' })
} }
}, },
fail: err => { fail: err => {
...@@ -184,8 +215,18 @@ export default { ...@@ -184,8 +215,18 @@ export default {
success: async res => { success: async res => {
console.log('拍摄视频成功', res) console.log('拍摄视频成功', res)
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) {
uni.showToast({ title: '视频上传最大100MB', icon: 'none' })
return
}
uni.showLoading({ title: '上传中...' }) uni.showLoading({ title: '上传中...' })
const url = await uploadFile(res.tempFilePath) // #ifdef H5
const url = await uploadFile(res.tempFile, res.tempFilePath)
// #endif
// #ifdef APP-PLUS
const url = await uploadFile(null, res.tempFilePath)
// #endif
console.log('上传视频成功', url) console.log('上传视频成功', url)
// const fileExtension = res.name ? res.name.split('.').pop().toLowerCase() : res.tempFilePath.split('.').pop().toLowerCase() // const fileExtension = res.name ? res.name.split('.').pop().toLowerCase() : res.tempFilePath.split('.').pop().toLowerCase()
this.addMedia(field, { this.addMedia(field, {
...@@ -200,7 +241,7 @@ export default { ...@@ -200,7 +241,7 @@ export default {
} catch (error) { } catch (error) {
console.log('上传视频失败', error) console.log('上传视频失败', error)
uni.hideLoading() uni.hideLoading()
uni.showToast({ title: '上传视频失败', icon: 'none' }) uni.showToast({ title: '视频上传失败,请重试', icon: 'none' })
} }
}, },
fail: err => { fail: err => {
...@@ -221,8 +262,19 @@ export default { ...@@ -221,8 +262,19 @@ export default {
success: async res => { success: async res => {
console.log('选择视频成功', res) console.log('选择视频成功', res)
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) {
uni.showToast({ title: '视频上传最大100MB', icon: 'none' })
return
}
uni.showLoading({ title: '上传中...' }) uni.showLoading({ title: '上传中...' })
const url = await uploadFile(res.tempFilePath) // #ifdef H5
const url = await uploadFile(res.tempFile, res.tempFilePath)
// #endif
// #ifdef APP-PLUS
const url = await uploadFile(null, res.tempFilePath)
// #endif
console.log('上传视频成功', url) console.log('上传视频成功', url)
// const fileExtension = res.name ? res.name.split('.').pop().toLowerCase() : res.tempFilePath.split('.').pop().toLowerCase() // const fileExtension = res.name ? res.name.split('.').pop().toLowerCase() : res.tempFilePath.split('.').pop().toLowerCase()
this.addMedia(field, { this.addMedia(field, {
...@@ -237,7 +289,7 @@ export default { ...@@ -237,7 +289,7 @@ export default {
} catch (error) { } catch (error) {
console.log('上传视频失败', error) console.log('上传视频失败', error)
uni.hideLoading() uni.hideLoading()
uni.showToast({ title: '上传视频失败', icon: 'none' }) uni.showToast({ title: '视频上传失败,请重试', icon: 'none' })
} }
}, },
fail: err => { fail: err => {
......
...@@ -114,6 +114,7 @@ import OrderPopup from '@/components/OrderPopup/index.vue' ...@@ -114,6 +114,7 @@ import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue' import NoticePopup from '@/components/NoticePopup.vue'
import { debounce } from 'lodash' import { debounce } from 'lodash'
import permision from '@/js_sdk/wa-permission/permission.js'
export default { export default {
components: { components: {
FormCell, FormCell,
...@@ -220,6 +221,16 @@ export default { ...@@ -220,6 +221,16 @@ export default {
onLoad(options) { onLoad(options) {
this.init(options) this.init(options)
}, },
onBackPress(options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.backPage()
return true
}
// 其他情况允许正常返回
return false
},
methods: { methods: {
init(options) { init(options) {
this.query = options this.query = options
...@@ -364,7 +375,22 @@ export default { ...@@ -364,7 +375,22 @@ export default {
}) })
} }
}, },
handleImageUpload(field) { async handleImageUpload(field) {
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) {
uni.showToast({ title: '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限', icon: 'none' })
return
}
if (camera != 1) {
uni.showToast({ title: '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限', icon: 'none' })
return
}
if (!isOnline) {
uni.showToast({ title: '当前无网络连接,请连接网络后重试', icon: 'none' })
return
}
// 显示操作菜单,让用户选择拍照或从相册选择 // 显示操作菜单,让用户选择拍照或从相册选择
uni.showActionSheet({ uni.showActionSheet({
itemList: ['拍照', '从相册选择'], itemList: ['拍照', '从相册选择'],
...@@ -489,7 +515,7 @@ export default { ...@@ -489,7 +515,7 @@ export default {
}, },
// 预览PDF // 预览PDF
previewPdf(field) { previewPdf(field) {
const url = `/pages/evaluationForm/components/pdfPreView?fileUrl=${this.pdfUrl}&title=pdf&fileUrltype=pdf` const url = `/pages/evaluationForm/components/pdfPreView?fileUrl=${this.pdfUrl}&title=pdf&fileUrltype=pdf&Signature=true`
uni.navigateTo({ uni.navigateTo({
url: `${url}` url: `${url}`
}) })
......
...@@ -129,7 +129,8 @@ export const sunroofMap = { ...@@ -129,7 +129,8 @@ export const sunroofMap = {
export const emissionStandardMap = { export const emissionStandardMap = {
3: '国3', 3: '国3',
4: '国4', 4: '国4',
5: '国5' 5: '国5',
6: '国6'
} }
export const buyNewCarMap = { export const buyNewCarMap = {
0: '是', 0: '是',
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="title">评估单管理</view> <view class="title">评估单管理</view>
</view> </view>
<view class="detail-content"> <view class="detail-content">
<searchBox @search="search" @reset="reset" :searchValue.sync="searchValue" /> <searchBox ref="searchBox" @search="search" @reset="reset" :searchValue.sync="searchValue" />
<view class="box-class mt-32"> <view class="box-class mt-32">
<type-tab-component :typeList="typeList" :isShowCount="true" :tabIndex.sync="tabIndex" @tabClick="search"></type-tab-component> <type-tab-component :typeList="typeList" :isShowCount="true" :tabIndex.sync="tabIndex" @tabClick="search"></type-tab-component>
<z-paging ref="paging" :fixed="false" paging-class="paging-class" :class="tabIndex == 0 ? 'no-br' : ''" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10"> <z-paging ref="paging" :fixed="false" paging-class="paging-class" :class="tabIndex == 0 ? 'no-br' : ''" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class="addBtn" @click.stop="addEvaluationForm({ type: 'add' })"> <view class="addBtn" @click.stop="addEvaluationForm({ type: 'add' })">
<view class="sprite-icon icon-addEvaluationFrom"></view> <view class="sprite-icon icon-addEvaluationFrom"></view>
</view> </view>
<GeneralPopup ref="requotePopup" popupClass="requotePopup" title="重新报价" confirmText="重新报价" type="center" :showClose="true" :isShowCancel="false" :autoClose="false" @confirm="confirmRequote"> <GeneralPopup ref="requotePopup" popupClass="requotePopup" title="重新报价" confirmText="申请重新报价" type="center" :showClose="true" :isShowCancel="false" :autoClose="false" @confirm="confirmRequote">
<template #content> <template #content>
<view class="requote-content"> <view class="requote-content">
<view class="requote-label mb-24"> <view class="requote-label mb-24">
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
<text class="requiredLabel">*</text> <text class="requiredLabel">*</text>
</view> </view>
<view class="flex align-center intention-input-cell mb-48"> <view class="flex align-center intention-input-cell mb-48">
<input class="flex-1" type="number" maxlength="6" placeholder="请输入" v-model="requoteObj.customerTargetPrice" /> <input class="flex-1" type="number" maxlength="6" placeholder="请输入" :value="requoteObj.customerTargetPrice" @input="handlePriceInput" />
<text>元</text> <text>元</text>
</view> </view>
<view class="requote-label mb-24"> <view class="requote-label mb-24">
客户意向报价 客户报价反馈
<text class="requiredLabel">*</text> <text class="requiredLabel">*</text>
</view> </view>
<textarea class="feedback-textarea" placeholder-style="color:#999999" placeholder="请输入 (200字以内)" maxlength="200" v-model="requoteObj.customerTargetPriceFeedback" /> <textarea class="feedback-textarea" placeholder-style="color:#999999" placeholder="请输入 (200字以内)" maxlength="200" v-model="requoteObj.customerTargetPriceFeedback" />
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</view> </view>
</template> </template>
</GeneralPopup> </GeneralPopup>
<GeneralPopup ref="addSignAgreementPopup" popupClass="requotePopup" title="新增保管人" confirmText="新增" type="center" :showClose="true"> <GeneralPopup ref="addSignAgreementPopup" popupClass="requotePopup" title="新增保管人" confirmText="新增" type="center" :showClose="true" @confirm="confirmAddSignAgreement" :autoClose="false">
<template #content> <template #content>
<view class="requote-content"> <view class="requote-content">
<view class="requote-label mb-24"> <view class="requote-label mb-24">
...@@ -89,17 +89,17 @@ ...@@ -89,17 +89,17 @@
身份证号 身份证号
<text class="requiredLabel">*</text> <text class="requiredLabel">*</text>
</view> </view>
<input class="intention-input mb-48" placeholder="请输入" v-model="addSignAgreementObj.custodianIdentityCode" /> <input class="intention-input mb-48" placeholder="请输入18位身份证号" :value="addSignAgreementObj.custodianIdentityCode" maxlength="18" @input="validateIdCard" type="text" />
<view class="requote-label mb-24"> <view class="requote-label mb-24">
手机号 手机号
<text class="requiredLabel">*</text> <text class="requiredLabel">*</text>
</view> </view>
<input class="intention-input mb-48" type="number" placeholder="请输入" v-model="addSignAgreementObj.custodianPhone" /> <input class="intention-input mb-48" type="number" maxlength="11" placeholder="请输入" v-model="addSignAgreementObj.custodianPhone" />
<view class="requote-label mb-24"> <view class="requote-label mb-24">
地址 地址
<text class="requiredLabel">*</text> <text class="requiredLabel">*</text>
</view> </view>
<input class="intention-input mb-48" placeholder="请输入" v-model="addSignAgreementObj.custodianAddress" /> <input class="intention-input mb-48" placeholder="请输入" maxlength="10" v-model="addSignAgreementObj.custodianAddress" />
</view> </view>
</template> </template>
</GeneralPopup> </GeneralPopup>
...@@ -156,6 +156,7 @@ import EvaluationCard from './components/evaluationCard.vue' ...@@ -156,6 +156,7 @@ import EvaluationCard from './components/evaluationCard.vue'
import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin' import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
import GeneralPopup from './components/GeneralPopup.vue' import GeneralPopup from './components/GeneralPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import { set } from 'lodash'
export default { export default {
name: 'EvaluationFormList', name: 'EvaluationFormList',
mixins: [ZPMixin], mixins: [ZPMixin],
...@@ -244,8 +245,9 @@ export default { ...@@ -244,8 +245,9 @@ export default {
}, },
search() { search() {
console.log(this.searchValue, '32323') console.log(this.searchValue, '32323')
this.$refs.paging?.reload() this.$refs.paging?.reload()
this.getStatByStatus() // this.getStatByStatus()
}, },
onShow() { onShow() {
this.search() this.search()
...@@ -254,9 +256,10 @@ export default { ...@@ -254,9 +256,10 @@ export default {
this.searchValue = { this.searchValue = {
previousOwnerName: '', previousOwnerName: '',
previousOwnerPhone: '', previousOwnerPhone: '',
vin: '', licensePlate: '',
evalOrderNo: '' evalOrderNo: ''
} }
this.tabIndex = 0 this.tabIndex = 0
this.search() this.search()
}, },
...@@ -264,8 +267,10 @@ export default { ...@@ -264,8 +267,10 @@ export default {
if (pageNo == 1) { if (pageNo == 1) {
this.getStatByStatus() this.getStatByStatus()
} }
const userInfo = uni.$storage.get('userInfo'),
{ shopMerchantId } = userInfo
const res = await uni.$api.evaluationApi.evalOrderList({ const res = await uni.$api.evaluationApi.evalOrderList({
t: { ...this.searchValue, status: this.typeList[this.tabIndex].key }, t: { ...this.searchValue, status: this.typeList[this.tabIndex].key, sellerMerchantId: shopMerchantId },
currentPage: pageNo, currentPage: pageNo,
pageSize: 10 pageSize: 10
}) })
...@@ -310,6 +315,24 @@ export default { ...@@ -310,6 +315,24 @@ export default {
} }
}) })
}, },
validateIdCard(e) {
// 从事件对象中获取输入值,处理不同环境下的兼容性
let value = e.target ? e.target.value : e.detail ? e.detail.value : ''
// 移除非数字和字母的字符
value = value.replace(/[^a-zA-Z0-9]/g, '')
// 限制长度为18位
if (value.length > 18) {
value = value.slice(0, 18)
}
// 使用this.$set确保响应式更新
this.$set(this.addSignAgreementObj, 'custodianIdentityCode', value)
},
handlePriceInput(e) {
console.log(e)
const value = e.target ? e.target.value.replace(/[^0-9]/g, '') : e.detail.value.replace(/[^0-9]/g, '')
console.log('value:', value)
this.$set(this.requoteObj, 'customerTargetPrice', value)
},
addEvaluationForm(e) { addEvaluationForm(e) {
console.log('addEvaluationForm', e.type) console.log('addEvaluationForm', e.type)
uni.navigateTo({ uni.navigateTo({
...@@ -350,12 +373,14 @@ export default { ...@@ -350,12 +373,14 @@ export default {
if (res.data.code == 0) { if (res.data.code == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: res.data.data || '请求成功', title: '订单已重置回「评估中」',
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}) })
setTimeout(() => {
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
}, 500)
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
...@@ -392,8 +417,10 @@ export default { ...@@ -392,8 +417,10 @@ export default {
title: '定金已申请,请等待付款审批', title: '定金已申请,请等待付款审批',
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
that.currentPage = 1 that.currentPage = 1
that.search() that.search()
}, 500)
} }
} else { } else {
uni.showLoading() uni.showLoading()
...@@ -414,7 +441,7 @@ export default { ...@@ -414,7 +441,7 @@ export default {
if (res.data.code == 0) { if (res.data.code == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '代保管协议已发送', title: '电子签约已发送,请注意查收短信',
icon: 'none' icon: 'none'
}) })
that.currentPage = 1 that.currentPage = 1
...@@ -486,15 +513,18 @@ export default { ...@@ -486,15 +513,18 @@ export default {
return return
} }
const res = await uni.$api.evaluationApi.evalOrderOwnerReQuote(this.requoteObj) const res = await uni.$api.evaluationApi.evalOrderOwnerReQuote(this.requoteObj)
console.log('res:', res)
if (res.data.code == 0) { if (res.data.code == 0) {
uni.showToast({ uni.showToast({
title: '重新报价成功', title: '重新报价已提交,请等待报价更新',
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}) })
this.$refs.requotePopup.closePopup() this.$refs.requotePopup.closePopup()
setTimeout(() => {
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
}, 500)
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
...@@ -544,30 +574,36 @@ export default { ...@@ -544,30 +574,36 @@ export default {
this.$refs.orderPopup.open() this.$refs.orderPopup.open()
}, },
async addSignAgreement() { async addSignAgreement() {
this.$refs.addSignAgreementPopup.open().then(() => { this.$refs.addSignAgreementPopup.open()
},
confirmAddSignAgreement() {
if (!this.addSignAgreementObj.custodianName) { if (!this.addSignAgreementObj.custodianName) {
uni.showToast({ title: '请输入签约保管人', icon: 'none' }) uni.showToast({ title: '请输入签约保管人', icon: 'none' })
return Promise.reject() return
} }
if (!this.addSignAgreementObj.custodianIdentityCode) { if (!this.addSignAgreementObj.custodianIdentityCode) {
uni.showToast({ title: '请输入身份证号', icon: 'none' }) uni.showToast({ title: '请输入身份证号', icon: 'none' })
return Promise.reject() return
} }
if (!this.addSignAgreementObj.custodianPhone) { if (!this.addSignAgreementObj.custodianPhone) {
uni.showToast({ title: '请输入手机号', icon: 'none' }) uni.showToast({ title: '请输入手机号', icon: 'none' })
return Promise.reject() return
}
if (this.addSignAgreementObj.custodianPhone.length != 11) {
uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
return
} }
if (!this.addSignAgreementObj.custodianAddress) { if (!this.addSignAgreementObj.custodianAddress) {
uni.showToast({ title: '请输入地址', icon: 'none' }) uni.showToast({ title: '请输入地址', icon: 'none' })
return Promise.reject() return
} }
uni.showLoading() uni.showLoading()
uni.$api.evaluationApi.addCustodyAgreement(this.addSignAgreementObj).then(res => { uni.$api.evaluationApi.addCustodyAgreement(this.addSignAgreementObj).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
uni.hideLoading() uni.hideLoading()
console.log('res:', res) console.log('res:', res)
this.currentPage = 1 this.$refs.addSignAgreementPopup.closePopup()
this.search()
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
...@@ -576,7 +612,6 @@ export default { ...@@ -576,7 +612,6 @@ export default {
}) })
} }
}) })
})
}, },
onConfirm(e) { onConfirm(e) {
this.signAgreementObj = { custodianName: e.chooseContent.name, custodianIdentityCode: e.chooseContent.idCard, custodianPhone: e.chooseContent.phone, custodianAddress: e.chooseContent.address } this.signAgreementObj = { custodianName: e.chooseContent.name, custodianIdentityCode: e.chooseContent.idCard, custodianPhone: e.chooseContent.phone, custodianAddress: e.chooseContent.address }
...@@ -610,6 +645,7 @@ export default { ...@@ -610,6 +645,7 @@ export default {
font-weight: 400; font-weight: 400;
padding: toRpx(16) toRpx(64); padding: toRpx(16) toRpx(64);
line-height: toRpx(48); line-height: toRpx(48);
text-align: center;
text { text {
color: #347bff; color: #347bff;
} }
...@@ -736,6 +772,9 @@ export default { ...@@ -736,6 +772,9 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.uni-input-placeholder {
margin-left: toRpx(24);
}
} }
} }
.intention-input-cell { .intention-input-cell {
......
import config from './ossUploadFile/config.js'
import base64 from './ossUploadFile/base64.js'
import Hmac from './ossUploadFile/hmac.js'
import Sha1 from './ossUploadFile/sha1.js'
import Crypto from './ossUploadFile/crypto.js'
/**
* 上传文件到阿里云oss
* @param {string} file 图片信息
* @param {string} dir 表示要传到哪个目录下
* @return 完整的图片地址
*/
const uploadFile = function (file, filePath) {
console.log('上传文件到阿里云oss', file, filePath)
return new Promise(async (resolve, reject) => {
// 添加文件大小限制检查
if (file && file.size) {
// 定义文件类型和大小限制
const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
const videoTypes = ['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv']
// 提取文件后缀
const fileExtension = file ? (file.name ? file.name.split('.').pop().toLowerCase() : file.path.split('.').pop().toLowerCase()) : filePath.split('.').pop().toLowerCase()
// 检查文件大小
const fileSizeMB = file.size / (1024 * 1024) // 转换为MB
// 图片文件大小限制10MB
if (imageTypes.includes(fileExtension) && fileSizeMB > 10) {
uni.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
reject(new Error('图片上传最大10MB'))
return
}
// 视频文件大小限制100MB
if (videoTypes.includes(fileExtension) && fileSizeMB > 100) {
uni.showToast({
title: '视频上传最大100MB',
icon: 'none'
})
reject(new Error('视频上传最大100MB'))
return
}
}
// 提取文件后缀
const fileExtension = file ? (file.name ? file.name.split('.').pop().toLowerCase() : file.path.split('.').pop().toLowerCase()) : filePath.split('.').pop().toLowerCase()
// 生成随机数(使用时间戳+随机字符串)
const timestamp = Date.now()
const randomStr = Math.random().toString(36).substring(2, 10)
const randomNum = timestamp + '_' + randomStr
let aliyunFileKey = config.folder + randomNum + '.' + fileExtension
console.log(aliyunFileKey, 'aliyunFileKey')
const aliyunServerURL = config.uploadUrl // OSS地址
const policyBase64 = getPolicyBase64()
const { signature, securityToken, lsaccessKeyId } = await getSignature(policyBase64) // 获取签名
uni.uploadFile({
url: aliyunServerURL, // 开发者服务器url
filePath: filePath, // 要上传文件资源的路径
name: 'file', // 必须填file
formData: {
key: aliyunFileKey,
policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId,
success_action_status: '200', // 让服务端返回200, 不然默认会返回204
signature: signature,
'x-oss-security-token': securityToken // 使用STS签名时必传。
},
success: function (res) {
console.log(res, 444)
if (res.statusCode != 200) {
reject(
new Error(
'上传错误:' +
JSON.stringify({
statusCode: res.statusCode,
file: file,
key: aliyunFileKey,
policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId,
signature: signature,
'x-oss-security-token': securityToken
})
)
)
} else {
uni.removeSavedFile({
file: file,
complete: function (res) {
console.log(res)
}
})
}
resolve(aliyunServerURL + aliyunFileKey)
},
fail: function (err) {
console.log(err, 555)
err.domainName = aliyunServerURL
reject(err)
}
})
})
}
const getPolicyBase64 = function () {
let date = new Date()
date.setHours(date.getHours() + config.timeout)
let srcT = date.toISOString()
const policyText = {
expiration: srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了
conditions: [
['content-length-range', 0, 1024 * 1024 * 1024] // 设置上传文件的大小限制(5m)
]
}
const policyBase64 = base64.encode(JSON.stringify(policyText))
return policyBase64
}
const getOssToken = async function () {
console.log('getOssToken')
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await uni.$api.commonApi.getToken({})
return {
lsaccessKeySecret,
securityToken,
lsaccessKeyId
}
}
// 生成签名
const getSignature = function (policyBase64) {
return new Promise(async reslove => {
const result = uni.$api.commonApi.getToken({}).then(res => {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = res
const bytes = Crypto.HmacSHA1(policyBase64, lsaccessKeySecret)
const signature = Crypto.enc.Base64.stringify(bytes)
reslove({
signature,
securityToken,
lsaccessKeyId
})
})
})
}
module.exports = { uploadFile }
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
// base64,Hmac,Sha1,Crypto 相关算法 // base64,Hmac,Sha1,Crypto 相关算法
import config from "./config.js"; import config from './config.js'
import base64 from "./base64.js"; import base64 from './base64.js'
import Hmac from "./hmac.js"; import Hmac from './hmac.js'
import Sha1 from "./sha1.js"; import Sha1 from './sha1.js'
import Crypto from "./crypto.js"; import Crypto from './crypto.js'
/** /**
* 上传文件到阿里云oss * 上传文件到阿里云oss
* @param {string} filePath 图片的本地资源路径 * @param {string} filePath 图片的本地资源路径
...@@ -19,44 +19,44 @@ import Crypto from "./crypto.js"; ...@@ -19,44 +19,44 @@ import Crypto from "./crypto.js";
* @return 完整的图片地址 * @return 完整的图片地址
*/ */
const uploadFile = function (filePath) { const uploadFile = function (filePath) {
console.log('上传文件到阿里云oss', filePath)
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (!filePath || filePath.length < 9) { if (!filePath || filePath.length < 9) {
uni.showModal({ uni.showModal({
title: "文件错误", title: '文件错误',
content: "请重试", content: '请重试',
showCancel: false, showCancel: false
}); })
reject("文件错误"); reject('文件错误')
} }
// 获取上传的文件类型 // 获取上传的文件类型
let fileTypeIndex = filePath.lastIndexOf("/"); let fileTypeIndex = filePath.lastIndexOf('/')
let fileType = filePath.substring(fileTypeIndex + 1); let fileType = filePath.substring(fileTypeIndex + 1)
let aliyunFileKey = config.folder + fileType; console.log(fileType, '获取上传的文件类型')
const aliyunServerURL = config.uploadUrl; // OSS地址 let aliyunFileKey = config.folder + fileType
const accessid = config.OSSAccessKeyId; const aliyunServerURL = config.uploadUrl // OSS地址
const policyBase64 = getPolicyBase64(); const accessid = config.OSSAccessKeyId
const { signature, securityToken, lsaccessKeyId } = await getSignature( const policyBase64 = getPolicyBase64()
policyBase64 const { signature, securityToken, lsaccessKeyId } = await getSignature(policyBase64) // 获取签名
); // 获取签名
uni.uploadFile({ uni.uploadFile({
url: aliyunServerURL, // 开发者服务器url url: aliyunServerURL, // 开发者服务器url
filePath: filePath, // 要上传文件资源的路径 filePath: filePath, // 要上传文件资源的路径
name: "file", // 必须填file name: 'file', // 必须填file
formData: { formData: {
key: aliyunFileKey, key: aliyunFileKey,
policy: policyBase64, policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId, OSSAccessKeyId: lsaccessKeyId,
success_action_status: "200", // 让服务端返回200, 不然默认会返回204 success_action_status: '200', // 让服务端返回200, 不然默认会返回204
signature: signature, signature: signature,
"x-oss-security-token": securityToken, // 使用STS签名时必传。 'x-oss-security-token': securityToken // 使用STS签名时必传。
}, },
success: function (res) { success: function (res) {
console.log(res, 444); console.log(res, 444)
if (res.statusCode != 200) { if (res.statusCode != 200) {
reject( reject(
new Error( new Error(
"上传错误:" + '上传错误:' +
JSON.stringify({ JSON.stringify({
statusCode: res.statusCode, statusCode: res.statusCode,
filePath, filePath,
...@@ -64,65 +64,64 @@ const uploadFile = function (filePath) { ...@@ -64,65 +64,64 @@ const uploadFile = function (filePath) {
policy: policyBase64, policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId, OSSAccessKeyId: lsaccessKeyId,
signature: signature, signature: signature,
"x-oss-security-token": securityToken, 'x-oss-security-token': securityToken
}) })
) )
); )
} else { } else {
uni.removeSavedFile({ uni.removeSavedFile({
filePath, filePath,
complete: function (res) { complete: function (res) {
console.log(res); console.log(res)
},
});
} }
resolve(aliyunServerURL + aliyunFileKey); })
}
resolve(aliyunServerURL + aliyunFileKey)
}, },
fail: function (err) { fail: function (err) {
err.domainName = aliyunServerURL; err.domainName = aliyunServerURL
reject(err); reject(err)
}, }
}); })
}); })
}; }
const getPolicyBase64 = function () { const getPolicyBase64 = function () {
let date = new Date(); let date = new Date()
date.setHours(date.getHours() + config.timeout); date.setHours(date.getHours() + config.timeout)
let srcT = date.toISOString(); let srcT = date.toISOString()
const policyText = { const policyText = {
expiration: srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了 expiration: srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了
conditions: [ conditions: [
["content-length-range", 0, 1024 * 1024 * 1024], // 设置上传文件的大小限制(5m) ['content-length-range', 0, 1024 * 1024 * 1024] // 设置上传文件的大小限制(5m)
], ]
}; }
const policyBase64 = base64.encode(JSON.stringify(policyText)); const policyBase64 = base64.encode(JSON.stringify(policyText))
return policyBase64; return policyBase64
}; }
const getOssToken = async function () { const getOssToken = async function () {
console.log("getOssToken"); console.log('getOssToken')
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await uni.$api.commonApi.getToken({})
await uni.$api.commonApi.getToken({});
return { return {
lsaccessKeySecret, lsaccessKeySecret,
securityToken, securityToken,
lsaccessKeyId, lsaccessKeyId
}; }
}; }
// 生成签名 // 生成签名
const getSignature = function (policyBase64) { const getSignature = function (policyBase64) {
return new Promise(async (reslove) => { return new Promise(async reslove => {
const result = uni.$api.commonApi.getToken({}).then((res) => { const result = uni.$api.commonApi.getToken({}).then(res => {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = res; const { lsaccessKeySecret, securityToken, lsaccessKeyId } = res
const bytes = Crypto.HmacSHA1(policyBase64, lsaccessKeySecret); const bytes = Crypto.HmacSHA1(policyBase64, lsaccessKeySecret)
const signature = Crypto.enc.Base64.stringify(bytes); const signature = Crypto.enc.Base64.stringify(bytes)
reslove({ reslove({
signature, signature,
securityToken, securityToken,
lsaccessKeyId, lsaccessKeyId
}); })
}); })
// const result = await uni.request({ // const result = await uni.request({
// url: 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router', // url: 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router',
// data: { // data: {
...@@ -150,7 +149,7 @@ const getSignature = function (policyBase64) { ...@@ -150,7 +149,7 @@ const getSignature = function (policyBase64) {
// }) // })
// } // }
// }) // })
}); })
}; }
module.exports = { uploadFile, getOssToken }; module.exports = { uploadFile, getOssToken }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!