Commit 44e04f8d authored by 郭晓清's avatar 郭晓清

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/pages/order/detail.vue
parents 085246cc 831c6968
......@@ -116,7 +116,7 @@
},
confirm() {
if(this.pass) {
this.$emit('confirm')
this.$emit('change')
} else {
let data = this.listData.find((item, index) => {
return item.pass == false;
......
<!-- ******************* 文件上传 ******************* -->
<template>
<view class="file-box">
<!-- <view class="u-flex">
<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="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path" :border-radius="10" @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="160rpx" height="160rpx" :border-radius="10" @click="selectUpload" :src="uploadImage"></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>
<u-action-sheet :list="list" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet>
<template>
<view>
<view class="file-box" v-if="!takeStatus">
<!-- <view class="u-flex">
<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="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path" :border-radius="10" @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="160rpx" height="160rpx" :border-radius="10" @click="selectUpload" :src="uploadImage"></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>
<u-action-sheet :list="list" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet>
</view>
<take-photo v-else @close="closeTake"></take-photo>
</view>
</template>
<script>
import arrMixin from './arrMixin'
import baseFile from '@/components/upload/index';
import baseFile from '@/components/upload/index';
import takePhoto from '@/components/take/index.vue'
export default {
name: 'XhFiles',
components: {},
components: {
'take-photo': takePhoto
},
mixins: [arrMixin,baseFile],
props: {
files: {
......@@ -57,28 +63,6 @@
return process.uniEnv.qn_base_url + 'upload-file.png'
},
},
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,
},
},
mounted() {
if(this.value){
this.imgList = this.value.map(img =>{
......@@ -106,7 +90,7 @@
let config = {
options:{
sourceType:['album'],//['album', 'camera']
count: 10,
count: 3,
sizeType: ['compressed']
}
}
......@@ -123,6 +107,16 @@
dataValue.push(item.src)
})
this.valueChange(dataValue)
},
closeTake(val) {
if(val && val.length > 0){
val.forEach((item,index,array)=>{
item.path = item.src
this.imgList.push(item)
})
this.setValue()
}
this.takeStatus = false
},
prviewImage(url, index) {
uni.previewImage({
......
<!-- ******************* 单个下拉选择 ******************* -->
<template>
<view class="xh-select">
<view class="xh-select" :style="{'width': fieldsWidth}">
<u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
......@@ -68,7 +68,10 @@
'font-size':'26rpx',
'height': '76rpx'
}
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
},
watch: {},
mounted() {},
......
<!-- ******************* 单级/多级 选择 ******************* -->
<template>
<view class="picker-box">
<view class="picker-box" :style="{'width': fieldsWidth}">
<view class="u-flex u-row-between text-view" @click="openPicker">
<view class="txt u-flex-1 text-title">{{text||''}}</view>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
......@@ -68,7 +68,10 @@
val = data[0].measureTypeName + "-" + data[0].measureName
}
return val
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
},
watch: {
specificationId(val, oldVal){
......
......@@ -99,7 +99,16 @@
return {
timeout: false,
timestamp: 0,
orderType: 0
/** orderType
0 待接单、
1 待预约、
2 待签到、
3 待完工、
4 审核中、
5 异常单、
6 已完工
*/
orderType: 0
};
},
computed: {
......@@ -124,7 +133,7 @@
return this.buttonStyles[2]
}
},
showCountTime() {
showCountTime() { // ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单)) && 有超过时间点
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')) && this.orderData.currentOverTime
},
......
......@@ -39,8 +39,20 @@ uni.hideTabBar()
|事件称名 |说明 | 返回值 |
|:-: |:-: | :-: |
|@close | 关闭相机或完成拍照的时候触发 | 已拍照完成的图片数组|
|@close | 关闭相机或完成拍照的时候触发 | 已拍照完成的图片数组 **格式见下文** |
```json
{
[
{
id: '',
key: 'https: //identity/cert/20210507wefew.png', // 七牛绝对路径地址
progress: 100, // 图片上传进度
src: 'wxfile://tmp_2324.png' // 微信临时文件地址
}
]
}
```
## 组件用法
......
......@@ -58,7 +58,7 @@ export default {
imgList[res.fileIndex]
self.imgList = imgList
// 多文件上传每个文件进度条
console.log(res,'res---onProgressUpdate')
//console.log(res,'res---onProgressUpdate')
},
onEachUpdate(res){
// 多文件上传每个文件上传成功触发
......@@ -67,7 +67,7 @@ export default {
imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url
}
self.imgList = imgList
console.log(res,'res---onEachUpdate')
//console.log(res,'res---onEachUpdate')
},
cardType: category,
...config
......@@ -75,8 +75,8 @@ export default {
// 不需要进度条等可直接获取
let res = await uploader.qnImgUpload(options)
console.log(self.imgList,'self.imgList')
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// console.log(self.imgList,'self.imgList')
// console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// let imgList = res.map(item=>{
// return {
// key:item,
......
......@@ -91,11 +91,11 @@ export default {
}
qiniuUploader.upload(params, (res) => {
console.log(res,'res')
console.log(res,'res111')
let inLen = self.maximum - fileList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
item.key = res.url
self.fileMaps.push(item);
self.keys.push(item.key)
if(submit) {
......
......@@ -6,6 +6,10 @@
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"optimization": {
"subPackages": true
},
"runmode" : "liberate", // 开启分包优化后,必须配置资源释放模式
/* 5+App特有相关 */
"usingComponents" : true,
"splashscreen" : {
......
This diff is collapsed.
This diff is collapsed.
<template>
<view>
<u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
<view v-if="!takeStatus">
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<u-avatar :src="pic" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">uView ui</view>
<view class="u-font-14 u-tips-color">微信号:helang_uView</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item v-for="(item, index) in items" :title="item.title" :value="item.value" :key="index">
<u-icon slot="icon" size="32" name="search"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="setting" title="设置"></u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20" @click="take">
<u-cell-group>
<u-cell-item icon="setting" title="相机组件测试"></u-cell-item>
</u-cell-group>
</view>
</view>
<take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo>
</view>
</template>
<script>
import takePhoto from '@/components/take/index.vue'
export default {
components: {
'take-photo': takePhoto
},
data() {
return {
pic:'https://uviewui.com/common/logo.png',
show:true,
takeStatus: false,
testData: {
_id: '1', // 规格ID
system_id: '2', // 系统ID
brand_id: '3', // 品牌ID
classify_id: '4', // 分类ID
images: [ // 拍照要求示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: [] // 要点
}
}
},
computed: {
items() {
return [
{title: '我的钱包', value: '', icon: ''},
{title: '我的质保金', value: '', icon: ''},
{title: '我的合同', value: '', icon: ''},
{title: '我的证件', value: '', icon: ''},
{title: '我的收货地址', value: '', icon: ''},
{title: '我的仓库', value: '', icon: ''},
{title: '联系客服', value: '6666666', icon: ''}]
}
},
onLoad() {
},
methods: {
take() {
uni.hideTabBar()
this.takeStatus = true
},
closeTake(img) {
console.log(img)
this.takeStatus = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view>
<u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
<view v-if="!takeStatus">
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<u-avatar :src="pic" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">uView ui</view>
<view class="u-font-14 u-tips-color">微信号:helang_uView</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item v-for="(item, index) in items" :title="item.title" :value="item.value" :key="index">
<u-icon slot="icon" size="32" name="search"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="setting" title="设置"></u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20" @click="take">
<u-cell-group>
<u-cell-item icon="setting" title="相机组件测试"></u-cell-item>
</u-cell-group>
</view>
</view>
<take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo>
</view>
</template>
<script>
import takePhoto from '@/components/take/index.vue'
export default {
components: {
'take-photo': takePhoto
},
data() {
return {
pic:'https://uviewui.com/common/logo.png',
show:true,
takeStatus: false,
testData: {
_id: '1', // 规格ID
system_id: '2', // 系统ID
brand_id: '3', // 品牌ID
classify_id: '4', // 分类ID
images: [ // 拍照要求示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: [] // 要点
}
}
},
computed: {
items() {
return [
{title: '我的钱包', value: '', icon: ''},
{title: '我的质保金', value: '', icon: ''},
{title: '我的合同', value: '', icon: ''},
{title: '我的证件', value: '', icon: ''},
{title: '我的收货地址', value: '', icon: ''},
{title: '我的仓库', value: '', icon: ''},
{title: '联系客服', value: '6666666', icon: ''}]
}
},
onLoad() {
},
methods: {
take() {
uni.hideTabBar()
this.takeStatus = true
},
closeTake(img) {
console.log(img)
this.takeStatus = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view class="content">
<view class="">
<view class="" style="padding-left: 94rpx; margin: 36rpx 0">
<text class="dx">单选</text
><text class="all">{{ ExaminationQuestions.progress }}</text>
<view class="answer-box">
<u-navbar
title="考核认证"
:background="background"
:border-bottom="false"
></u-navbar>
<view class="content">
<view class="">
<text class="dx">单选</text>
</view>
<view class="" style="text-align: center">
{{ ExaminationQuestions.question.content }}
<view class="topicView">
<text class="topictext">{{
ExaminationQuestions.question.content
}}</text>
</view>
<view class="" style="margin-top: 130rpx">
<view class="">
<view class="list-box">
<view
v-for="(item, index) in list"
......@@ -21,6 +27,7 @@
</view>
</view>
<button class="btn" @click="getNextClick()">下一题</button>
<text class="all">{{ ExaminationQuestions.progress }}</text>
</view>
</view>
</template>
......@@ -47,6 +54,9 @@ export default {
content: "",
},
],
background: {
backgroundColor: "#F4F5F7",
},
isSelect: false,
selectId: [],
userExamId: null,
......@@ -199,20 +209,57 @@ export default {
</script>
<style lang="scss">
.content {
width: 600rpx;
height: 800rpx;
.answer-box {
width: 750rpx;
height: 100vh;
/* background: #8F8F94; */
margin: 0 auto;
}
.content {
margin: 30rpx 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding: 40rpx 30rpx 40rpx 30rpx;
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.dx {
padding: 0rpx;
background: #2979ff;
border-radius: 8rpx;
background-color: #ff930d;
font-size: 20rpx;
color: #ffffff;
border-radius: 0px;
width: 72rpx;
height: 40rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.topicView {
margin-top: 40rpx;
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
margin-bottom: 40rpx;
}
.topictext {
color: #333333;
font-size: 32rpx;
line-height: 48rpx;
font-weight: bold;
}
.num {
color: #2b85e4;
}
......@@ -263,10 +310,18 @@ export default {
/*未选择*/
.noselde {
background: #e4e7ed;
color: #959595;
border-radius: 20upx;
font-size: 20upx;
padding: 0 10upx;
margin-top: 30rpx;
background-color: #f4f5f7;
width: 100%;
padding: 40rpx 30rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
border-radius: 12rpx;
border: 2rpx solid transparent;
font-size: 28rpx;
}
</style>
<template>
<view class="content">
<view class="title">考试规则说明</view>
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title-color="#fff"
:border-bottom="false"
></u-navbar>
<view class="title">考试规则</view>
<view class="test">
<view class="slogan"
>这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!</view
>
<view class="text">
<text class="left">考试科目:</text
><text style="color: #007aff">服务规范</text>
</view>
<view class="text">
<text class="left">合格条件:</text
><text>随机20题,答对20题</text>
<text class="left">合格条件:</text><text>60分</text>
</view>
<view class="text">
<text class="left">考试时间:</text><text>30分钟</text>
</view>
<view class="text">
<text class="left">题目规则:</text
><text>题库100题,随机抽20题</text>
</view>
<view class="text">
<text class="left">备注说明:</text><text>无</text>
<text class="left">题目来源:</text><text>系统随机20题</text>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
</template>
......@@ -77,32 +81,62 @@ export default {
<style>
.content {
margin: 187rpx 80rpx;
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
}
.title {
font-size: 17px;
text-align: center;
padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
}
.test {
margin: 0 0;
margin: 0 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding-bottom: 60rpx;
background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.slogan {
font-size: 40rpx;
font-weight: bold;
color: #333333;
line-height: 20px;
padding: 50rpx 58rpx 46rpx 30rpx;
}
.left {
margin-right: 8rpx;
margin-left: 68rpx;
margin-left: 30rpx;
color: #666666;
font-size: 28rpx;
}
.text {
margin: 50rpx 0;
margin: 30rpx 0;
}
button {
width: 364rpx;
height: 56rpx;
background: #007aff;
font-size: 24rpx;
width: 600rpx;
height: 104rpx;
background: #2272ff;
font-size: 32rpx;
font-weight: 600;
color: #ffffff;
margin-top: 237rpx;
border-radius: 26px;
line-height: 104rpx;
}
</style>
......@@ -160,13 +160,19 @@ export default {
if(pages.length) {
let index = pages.length - 1;
if(index) {
let prevPage = pages[pages.length - 1]; //上一个页面
if (prevPage && prevPage.$vm) {
prevPage.$vm.isRefresh = true;
let prevPage = pages[index]; //上一个页面
if(prevPage.route == "pages/login/index") {
uni.navigateTo({
url:'pages/index/index'
})
} else {
if (prevPage && prevPage.$vm) {
prevPage.$vm.isRefresh = true;
}
uni.navigateBack({
delta: 1
})
}
uni.navigateBack({
delta: 1
})
} else {
uni.navigateTo({
url:'pages/index/index'
......@@ -174,7 +180,7 @@ export default {
}
} else {
uni.navigateTo({
url: "pages/mine/index"
url: "pages/index/mine"
})
}
......
<template>
<view class="com-content">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check>
<view class="u-wrap" v-if="!takeStatus">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" :pass="pass" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check>
<view class="u-wrap">
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar>
<u-tabs-swiper class="order-tabs" ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs-swiper>
<view class="u-menu-wrap">
......@@ -45,8 +45,7 @@
</xh-select>
<xh-files v-else-if="typeToComponentType(item.fieldsType)==='file'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || []'
:files="files[itemIndex.toString()]"
@value-change="fieldValueChange" @getTakeStatus="getTakeStatus">
@value-change="fieldValueChange">
</xh-files>
<xh-location v-else-if="typeToComponentType(item.fieldsType)==='location'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
......@@ -91,8 +90,7 @@
下一步
</u-button>
</view>
</view>
<take-photo v-else @close="closeTake"></take-photo>
</view>
<u-toast ref="uToast" />
</view>
</template>
......@@ -108,7 +106,6 @@
import XhScan from '@/components/createCom/XhScan.vue'
import XhPicker from '@/components/createCom/XhPicker.vue'
import XhTime from '@/components/createCom/XhTime.vue'
import takePhoto from '@/components/take/index.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export default {
......@@ -160,9 +157,6 @@
}]
},
submitBtnStatus: false,
takeStatus: false,
fileIndex: null,
files: [],
completeCheckStatus: false,
completeCheckResult: [],
waitHandlerPanelIndex: 0,
......@@ -181,8 +175,7 @@
XhScan,
XhPicker,
XhTime,
XhServiceMeasure,
'take-photo': takePhoto
XhServiceMeasure
},
created() {
// console.log(allComponents,'allComponents')
......@@ -319,7 +312,7 @@
},
confirm(){// 检查结果窗口 确认回调
uni.navigateTo({
url: 'pages/order/index'
url: 'pages/index/order'
})
},
closeCheckResult(){// 检查结果窗口取消回调
......@@ -358,11 +351,6 @@
}
}
},
getTakeStatus(event) {
this.takeStatus = event.status
this.fileIndex = event.index.toString()
if(!this.files[event.index] || this.files[event.index].length < 1) this.files[event.index] = []
},
tabsChange(index){
this.tabIndex = index
this.arr = []
......@@ -373,11 +361,6 @@
this.getMenuItemTop()
})
},
closeTake(images) {
this.takeStatus = false
//const newFile = this.files[this.fileIndex].concat(images)
this.$set(this.files, this.fileIndex, images)
},
// 字段的值更新
fieldValueChange(data) {
const groupItem = this.list[this.tabIndex].items[data.groupIndex]
......
......@@ -156,7 +156,7 @@
import appointTime from '@/components/appoint/appoint-time.vue'
import takePhoto from '@/components/take/index.vue'
import PopView from "@/components/popView/index.vue"
let now = Date.now()
let now = new Date(new Date().toLocaleDateString()).getTime();
export default {
components: {
appointTime,
......@@ -345,7 +345,10 @@
if (res.code == 200) {
self.order = res.data
this.getCurrentBtn()
// self.timeOutChange(self.order.currentOverTime)
var nowTime = new Date();
if(nowTime.getTime() > this.order.currentOverTime){
this.btnClass='timeOut-btn'
}
if(self.order.isFirstOrder){
this.visibale = true
}
......@@ -418,6 +421,7 @@
console.log(data,'dateChange')
let self = this
self.appointmentDatetime = data.item.day
self.appointmentDatetimeRange = null
self.timeList.map((item, index) => {
if(data.item.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true
......@@ -505,15 +509,15 @@
data.orderId = this.order.orderId
}else if(this.submitType === 'workerAppointment'){ // 预约
data.appointmentDatetime =this.appointmentDatetime
data.appointmentDatetimeRange = this.appointmentDatetimeRange.pkey
if(!data.appointmentDatetime ){
this.commonToast('请选择预约日期','waring')
return
}
if( !data.appointmentDatetimeRange ){
if( !this.appointmentDatetimeRange || !this.appointmentDatetimeRange.pkey ){
this.commonToast('请选择预约时间段','waring')
return
}
data.appointmentDatetimeRange = this.appointmentDatetimeRange.pkey
}else if (this.submitType === 'maintainWorkerCheckin') { // 签到
// 检查见到距离是否符合
if(!this.isErrorSign){
......@@ -666,7 +670,7 @@
this.visibale = false
// 交互规范
uni.switchTab({
url: 'pages/learn/index'
url: 'pages/index/learn'
})
},
threeDays() {
......
......@@ -121,11 +121,10 @@ export default {
reasonType: '报备', // 反馈类型
reasonRelegation: '客户', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '' // 备注
},
traceDate: null, // 反馈时间
timeRange: null, // 反馈时间段
dateItem: null,
timeItem: null,
showRemark: false,
......@@ -139,23 +138,15 @@ export default {
appointTime
},
watch: {
vuex_token(val) {
this.initPageData();
}
// vuex_token(val) {
// this.initPageData();
// }
},
computed: {
disabledSubmit() {
let self = this;
if(self.trace.reasonRelegation && self.trace.reason) {
if (self.trace.reasonType == '改约') {
if (self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) {
return false;
}
} else {
if (self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) {
return false;
}
}
if(self.trace.reasonRelegation && self.trace.reason && self.traceDate && self.timeRange) {
return false;
}
return true;
......@@ -222,9 +213,8 @@ export default {
self.trace.reason = tabList['owns'][self.curOwn]['types'][0];
self.appointTitle = self.appoint[self.curTab]
self.trace.remark = '';
self.trace.appointmentDatetime = null;
self.trace.appointmentDatetimeRange = null;
self.trace.nextTraceDatetime = null;
self.traceDate = null;
self.timeRange = null;
if (self.trace.reasonType == '改约') {
self.showRemark = true;
if (self.dateList && self.timeList) {
......@@ -300,12 +290,9 @@ export default {
},
dateChange(data) {
// 点击日期选择
console.log(data, 'week-data');
let self = this;
self.dateItem = data.item
if (self.trace.reasonType == '改约') {
self.trace.appointmentDatetime = data.item.day;
self.trace.nextTraceDatetime = null;
self.timeList.map((item, index) => {
if (data.item.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true;
......@@ -314,18 +301,17 @@ export default {
}
});
} else {
self.trace.appointmentDatetime = null;
self.trace.nextTraceDatetime = data.item.day;
self.timeList.map((item, index) => {
item.disabled = false;
});
}
self.trace.appointmentDatetimeRange = '';
self.traceDate = data.item.day;
self.timeRange = null;
},
timeChange(data) {
// 时间段选择变化
console.log(data, 'week-data');
this.trace.appointmentDatetimeRange = data.item.pkey;
this.timeRange = data.item.pkey;
this.timeItem = data.item
},
async submitForm() {
......@@ -341,15 +327,16 @@ export default {
self.submiting = true;
let params = this.$u.deepClone(self.trace);
if(self.trace.reasonType != '改约') {
params.appointmentDatetimeRange = null
params.appointmentDatetime = null
if(self.timeItem && self.timeItem.pkey && params.nextTraceDatetime){
let traceDate = self.moment(params.nextTraceDatetime);
if(self.timeItem && self.timeItem.pkey && self.traceDate){
let traceDate = self.moment(self.traceDate);
let timeArr = self.timeItem.pkey.split("_")
let hours = timeArr && timeArr.length && timeArr.pop()
let traceDateTime = traceDate.clone().add(Number(hours), 'hours');
params.nextTraceDatetime = traceDateTime.unix() * 1000
}
} else {
params.appointmentDatetime = self.traceDate
params.appointmentDatetimeRange = self.timeRange
}
let res = await self.$u.api.traceAndAppointment(params, self.orderId);
self.submiting = false;
......
<template>
<view class="mtr-content">
<view class="content-view">
<!-- 材料列表 -->
<view class="mtr-tab">
<u-table align="center" border-color="#FFFFFF" color="#333333" font-size="rpx" :th-style="thStyle"
padding="0">
<u-tr class="u-tr">
<u-th class="u-th content-tab-th" v-for="(value, key) in titles" :key="key" width="auto">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{value}}</text>
</u-th>
</u-tr>
<view class="line-view"></view>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td" v-for="(value, key) in titles" :key="key">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{item[key]}}</text>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 其他 -->
<view class="mtr-other">
<view class="line-view"></view>
<view class="other-space">
<text>其他</text>
<image class="image-view" :src="addImage" @click="handleAdd"></image>
</view>
<view v-if="other.length > 0" class="other-content">
<view class="other-space" v-for="(item, index) in other" :key="index">
<view class="input-view">
<view class="other-space">
<text class="input-title">说明:</text>
<view class="input-content">
<u-input v-model="item.title" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
<view class="other-space">
<text class="input-title">金额:</text>
<view class="input-content">
<u-input v-model="item.value" type="number" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
</view>
<image class="image-view" :src="subtractImage" @click="handleSubtract"></image>
</view>
</view>
<view class="other-space">
<text>超出金额</text>
<text>{{money}}元</text>
</view>
</view>
</view>
<!-- 底部确定按钮 -->
<view class="bottom-view">
<u-button class="sure-button" type="primary" shape="circle" @click="handleSure" :custom-style="buttonStyle">
确定
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [], // 材料列表
other: [], // 其他列表
};
},
computed: {
buttonStyle() {
return {
width: "600rpx",
height: "104rpx",
"font-size": "32rpx",
"font-weight": "bold",
};
},
titles() {
return {
name: '材料名称',
unit: '单位',
freeAmount: '免费量',
price: '单价/元',
consumption: '预计用量'
}
},
thStyle() {
return {
'font-weight': 'bold'
}
},
firstKey() {
return Object.keys(this.titles)[0]
},
subtractImage() {
return process.uniEnv.qn_base_url + 'qxiao.png'
},
addImage() {
return process.uniEnv.qn_base_url + 'tianjia.png'
},
money() { // 总额
var amount = 0
for (var item of this.list) {
if (Number(item.consumption) && Number(item.freeAmount) && Number(item.price)) {
amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price)
}
}
for (var item of this.other) {
if (item.value && Number(item.value)) {
amount += Number(item.value)
}
}
return amount
}
},
created() {
// 测试数据
console.log('0000')
for (var i = 0; i < 20; i++) {
this.list.push({
name: '开关发大法师放大范德萨发大水',
unit: '个',
freeAmount: '1',
price: '45.0',
consumption: '4',
})
}
},
methods: {
/* 其他添加新的 */
handleAdd() {
this.other.push({
title: '',
value: ''
})
},
/* 其他删除某个 */
handleSubtract(index) {
this.other.splice(index, 1)
},
handleSure() {
// 返回总额money
}
}
}
</script>
<style lang="scss" scoped>
.mtr-content {
display: flex;
flex-direction: column;
background-color: #F4F5F7;
height: 100vh;
.content-view {
padding: 30rpx 30rpx 60rpx 30rpx;
margin: 20rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
height: 100%;
overflow: auto;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin: 20rpx 0;
}
.mtr-tab {
.tab-th-txt {
background-color: #FFFFFF;
padding: 10rpx 0;
&.left {
text-align: left;
}
}
}
.mtr-other {
.other-space {
display: flex;
justify-content: space-between;
align-items: center;
}
.other-content {
margin-bottom: 30rpx;
}
.input-view {
padding: 10rpx 30rpx;
width: 100%;
border-radius: 12rpx;
border: 1px #F4F5F7 solid;
margin-bottom: 30rpx;
.input-title {
width: 80rpx;
flex-shrink: 0;
color: #333333;
font-size: 26rpx;
}
.input-content {
width: 100%;
}
}
.image-view {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin: 30rpx 0 30rpx 30rpx;
}
}
}
.bottom-view {
margin-bottom: 44rpx;
margin-top: 10rpx;
height: 104rpx;
}
}
</style>
<template>
</template>
<script>
</script>
<style>
</style>
......@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) {
*region: 地区 默认为:ECN
*/
resolve({
visitPrefix: data.host || globalUrl.qn_asset_url,
visitPrefix: data.host,
token: data.token || '',
folderPath: data.folderPath || '',
region: "ECN"
......
......@@ -26,7 +26,6 @@
:send-message-img="sendMessageImg"
:show-message-card="showMessageCard"
@getphonenumber="getphonenumber"
@getuserinfo="getuserinfo"
@error="error"
@opensetting="opensetting"
@launchapp="launchapp"
......@@ -325,9 +324,9 @@ export default {
getphonenumber(res) {
this.$emit('getphonenumber', res);
},
getuserinfo(res) {
this.$emit('getuserinfo', res);
},
// getuserinfo(res) {
// this.$emit('getuserinfo', res);
// },
error(res) {
this.$emit('error', res);
},
......
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