Commit 76aa12f2 authored by Damon's avatar Damon

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

parents 188113e5 cf7ce8b4
......@@ -2,7 +2,7 @@
(function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null;
let VERSION_NUMBER = '1.2.9';//版本号
let VERSION_NUMBER = '1.3.1';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') {
......
<template>
<view class="cus-wrap-component">
<image class="top-image" mode="widthFix" v-if="!isPop" :src="minekefutuImage"></image>
<image class="top-image" mode="widthFix" v-if="!isPop" :src="qnFile(imageName)"></image>
<view class="content-view">
<view :class="['title-view', {'is-mine': isMine}]">
<text :class="['title-text', {'is-mine': isMine}]">{{titleText[typeIndex]}}</text>
<text>{{tipText[typeIndex]}}</text>
</view>
<u-image :class="['qrcode', {'is-mine': isMine}]" :src="cusQrcode" mode="widthFix" :fade="true"
duration="450">
<u-image :class="['qrcode', {'is-mine': isMine}]" :src="qnFile(cusQrcode)" mode="widthFix" :fade="false">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
<button :class="['settle-button', {'is-mine': isMine}]" type="primary" :open-type="openTypes[typeIndex]" show-message-card
send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="kefuzxiaoxiImage"
send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="qnFile('kefuzxiaoxi.png')"
send-message-path="/pages/index/index">
{{buttonText[typeIndex]}}
</button>
......@@ -45,14 +44,7 @@
},
computed: {
cusQrcode() {
let src = this.isMine ? 'erweima-rk.png' : 'dingdanzhushou-n.png';
return util.imageCache(this, src)
},
kefuzxiaoxiImage() {
return util.imageCache(this, 'kefuzxiaoxi.png')
},
minekefutuImage() {
return util.imageCache(this, this.imageName)
return this.isMine ? 'erweima-rk.png' : 'dingdanzhushou-n.png';
},
imageName() {
return this.isMine ? 'kefufuwu-n.png' : 'kefutuzs.png'
......@@ -92,6 +84,9 @@
}
},
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
phoneToCustomer() { // 联系客户
uni.makePhoneCall({
phoneNumber: this.phone, //仅为示例
......
<template>
<view class="bottom-button">
<view v-for="(item, index) in list" :class="['button-view', item.type]">
<u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
:custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
<view class="image-view" v-if="item.type == 'image'">
<image :src="baseImageUrl + item.image" class="image-content"></image>
</view>
<view :class="['text-content', item.type]">{{item.label}}</view>
</u-button>
</view>
</view>
</template>
<script>
export default {
props: {
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
// customStyle: 自定义button样式
buttons: {
type: Array,
default () {
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: true,
disabled: false,
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false,
disabled: false
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: true,
disabled: false,
},
{
label: '接单',
type: 'text',
show: true,
disabled: true,
customStyle: {
'background-color': '#2272FF'
}
}
]
}
}
},
computed: {
baseImageUrl() {
return process.uniEnv.qn_base_url
},
list() {
return this.buttons.filter((item) => {
return item.show == true
})
},
buttonStyle() {
return {
'image': {
'background-color': 'transparent',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '82rpx',
},
'text': {
'background-color': '#2272FF',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%',
},
'disabled': {
'background-color': '#D1D4D4',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%'
},
}
},
},
methods: {
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
handleClick(item) {
if (item.disabled) return
this.$emit('submit', item.id)
}
}
}
</script>
<style lang="scss" scoped>
.bottom-button {
display: flex;
justify-content: center;
align-items: center;
padding: 0 30rpx 44rpx 30rpx;
.button-view {
max-width: 600rpx;
display: flex;
&.image {}
&.text {
width: 100%;
display: flex;
justify-content: flex-end;
}
.list-button {
display: flex;
flex-direction: column;
width: 100%;
&.image {
margin-right: 40rpx;
}
&.text {
width: 400rpx;
margin-left: 40rpx;
&.one {
width: 600rpx;
margin-left: 0rpx;
}
}
.image-view {
flex-shrink: 0;
background-color: #FFFFFF;
border-radius: 38rpx;
width: 76rpx;
height: 76rpx;
.image-content {
width: 76rpx;
height: 76rpx;
}
}
.text-content {
&.text {
color: #FFFFFF;
font-size: 32rpx;
font-weight: bold;
}
&.image {
color: #333333;
font-size: 20rpx;
line-height: 20rpx;
height: 20rpx;
margin-top: 8rpx;
}
}
}
}
}
</style>
......@@ -14,6 +14,10 @@
<view class="order-cell">
<text>合作厂商:</text>
<text>{{ order.partnerCompanyName }}</text>
</view>
<view class="order-cell">
<text>厂商编号:</text>
<text>{{ order.partnerSerialNumber }}</text>
</view>
<view class="order-cell between-cell">
<view class="left">
......@@ -164,7 +168,7 @@
padding-bottom: 6rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
padding: 30rpx 30rpx 0 30rpx;
// padding: 30rpx 30rpx 0 30rpx;
border-radius: 6px;
.top-item {
......
......@@ -40,7 +40,7 @@
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange"separator-color="#666666" ref="order-count-down"></u-count-down>
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" separator-color="#666666" ref="order-count-down"></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{timeTitle}}</text>
......@@ -196,6 +196,17 @@
showDistance() {
return this.orderType == 0 && this.location.length >= 2 && (this.orderData.contactAddressLatitud || this.orderData.contactAddressLongitud)
},
titles() {
return {
'waitAccept': '待' + this.type0Text, // 待接单、
'waitAppointment': '待预约', // 待预约、
'waitCheckIn': '待签到', // 待签到、
'waitFinish': '待完工', // 待完工、
'audit': '审核中', // 审核中、
'exception': '异常单', // 异常单、
'finish': '已完工', //已完工
}
},
types() {
return {
'waitAccept': 0, // 待接单、
......@@ -207,6 +218,9 @@
'finish': 6, //已完工
}
},
title() {
return this.titles[this.type]
},
orderDistance() {
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
},
......@@ -243,7 +257,7 @@
return 3
} else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) {
return 4
} else if (this.orderData.orderStatus == 86 ||this.orderData.orderStatus == 88) {
} else if (this.orderData.orderStatus == 86 || this.orderData.orderStatus == 88) {
return 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
return 6
......@@ -267,10 +281,10 @@
methods: {
handleClick() {
// if (this.buttonDisabled) return
this.$emit('action')
this.$emit('action', this.orderData, this.title)
},
handleClickCell() {
this.$emit('click')
this.$emit('click', this.orderData, this.title)
},
handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2
......
......@@ -4,11 +4,11 @@
<text>履约记录</text>
</view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view>
<view v-else class="record-list-view">
<view v-else :class="['record-list-view', {'short': orderRecords.length <= showLenght}]">
<view class="record-right-view">
<view class="dashed-line-view"></view>
<view class="order-list">
<view v-for="(record,index) in shwoOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]">
<view v-for="(record,index) in showOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]">
<view class="node-view">
<view class="node-border-view">
<view class="node-middle-view"></view>
......@@ -71,7 +71,7 @@
}
},
computed: {
shwoOrderRecords() {
showOrderRecords() {
if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) {
return this.orderRecords.slice(0, this.showLenght)
} else {
......@@ -99,8 +99,10 @@
.record-list-view {
position: relative;
&.short {
padding-bottom: 30rpx;
}
.record-right-view {
position: relative;
display: flex;
......@@ -189,7 +191,7 @@
text-align: center;
color: #2272FF;
font-size: 26rpx;
margin-top: 30rpx;
padding-top: 30rpx;
padding-bottom: 30rpx;
}
......
import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}
export default {
name: 'qiniup',
components: {},
data() {
return {
domain: 'http://upload.qiniup.com', // 七牛上传域名地址
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens', // 上传token地址
files:[], // 上传文件
fileMaps:[], // 上传文件返回对象
keys:[], // 七牛返回key
uploadToken: '', // 上传token
maximum:999, // 最大上传数量
qiniuOptions: {}, // 七牛上传配置
};
},
created() {
this.initQiniu()
},
methods: {
initQiniu: function() {
var defaulfs = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'ECN',
bucket: 'fa-cms',
qiniuBucketURLPrefix: 'uploads',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL: this.uptokenURL,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc: function() {
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain: this.domain,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName: true
};
let options = {}
if(Object.keys(this.qiniuOptions).length) {
Object.assign(options, defaulfs, this.qiniuOptions);
} else {
options = defaulfs;
}
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
},
/**
* 确认上传
* @param {boolean} submit
*/
confirmUpload(submit = false) {
let self = this
const fileList = self.files
if (self.maximum - fileList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + self.maximum,
icon: 'none'
})
return
}
for (let file of fileList) {
let name = self.getUrlKey(file)
// 交给七牛上传
let item = {
src: '',
id: '',
key:'',
// filesize: '',
progress: 0
}
const params = {
name:name,
file:file,
}
qiniuUploader.upload(params, (res) => {
let inLen = self.maximum - fileList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
self.fileMaps.push(item);
self.keys.push(item.key)
if(submit) {
self.submitFile()
}
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
}
import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}
export default {
name: 'upload-img',
components: {},
data() {
return {
domain: 'http://upload.qiniup.com',
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens',
imgList: [],
imgs:[],
uploadToken: '',
selectNum:999,
};
},
computed: {
uploadBtnShow() {
let flag = this.imgList.length < this.selectNum
return flag && this.uploadVisible
}
},
created() {
this.initQiniu()
this.initImg();
},
methods: {
initQiniu: function() {
var options = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'ECN',
bucket: 'fa-cms',
qiniuBucketURLPrefix: 'uploads',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL: this.uptokenURL,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc: function() {
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain: this.domain,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName: true
};
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
chooseImage() {
if (this.selectNum - this.imgList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + this.selectNum,
icon: 'none'
})
return
}
uni.chooseImage({
count: this.selectNum, //默认9 this.selectNum
success: (chooseImageRes) => {
for (var i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
let file = chooseImageRes.tempFilePaths[i];
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
// 交给七牛上传
let newLen = this.selectNum - this.imgList.length
let item = {
src: '',
id: '',
key:'',
// filesize: '',
progress: 0
}
const params = {
name:name,
file:file,
}
if (newLen > 0) {
qiniuUploader.upload(params, (res) => {
let inLen = this.selectNum - this.imgList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
this.imgList.push(item);
this.imgs.push(res.key)
// this.addRecord(item,res)
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
// item.filesize = res.totalBytesSent
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
})
},
perviewImg(index) {
let urls = []
this.imgList.map(item => {
urls.push(item.src)
})
uni.previewImage({
current: index,
urls: urls
});
},
initImg() {
//传入图片,回显
this.imgList = this.initImgList.map(item=>{
let imgItem = {
src:'',
id:''
}
if(typeof item === 'string'){
imgItem.src = item
}else{
imgItem.src = item.src || item.pic || item.image
imgItem.id = item.id || '0'
}
return imgItem
})
},
// async addRecord(item, res) {
// let path = res.key;
// let hash = res.hash;
// let ext = path.substr(path.lastIndexOf('.') + 1);
// //推送到增加记录接口
// let params = {
// filename: hash + '.' + ext,
// full_url: res.fileURL,
// absolute_path: path,
// filesize: item.filesize,
// ext: ext
// };
// let recordRes = await this.$u.api.qiniuRecord(params);
// if (recordRes.code != 1) {
// uni.showToast({
// title: recordRs.msg,
// icon: 'none'
// })
// return
// }
// item.id = recordRes.data.id.id
// },
async removeImg(index) {
this.imgList.splice(index, 1)
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
}
}
}
......@@ -5,13 +5,12 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
}
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
// "enablePullDownRefresh": true,
"disableScroll": true
}
},
......@@ -27,28 +26,29 @@
"path": "pages/index/learn",
"style": {
"navigationBarTitleText": "学习",
"navigationStyle":"custom",//隐藏系统导航栏
"disableScroll": true
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "pages/index/mine",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom" ,
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "授权登录",
"navigationStyle": "custom" ,
// "navigationBarTitleText": "授权登录",
"navigationBarBackgroundColor":"#FFFFFF",
"disableScroll": true
}
}
],
"subPackages": [{
],
"subPackages": [
{
"root": "pages/exam",
"pages": [
{
......@@ -74,42 +74,42 @@
"path": "assessment",
"style": {
"navigationBarTitleText": "认证介绍",
"navigationStyle":"custom"
"navigationStyle": "custom"
}
},
{
"path": "answer",
"style": {
"navigationBarTitleText": "考核认证",
"navigationStyle":"custom"
"navigationStyle": "custom"
}
},
{
"path":"result",
"style":{
"navigationBarTitleText":"",
"navigationStyle":"custom"
"path": "result",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "news-details",
"style": {
"navigationBarTitleText": "",
"navigationStyle":"custom"
"navigationStyle": "custom"
}
},
{
"path":"section",
"style" :{
"path": "section",
"style": {
"navigationBarTitleText": "",
"navigationStyle":"custom"
"navigationStyle": "custom"
}
},
{
"path": "curriculum",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom" // 隐藏系统导航栏
"navigationStyle": "custom"
}
},
{
......@@ -117,7 +117,7 @@
"style": {
"navigationBarTitleText": "在线考试",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -125,18 +125,18 @@
"path": "course-detail",
"style": {
"navigationBarTitleText": "培训视频",
"navigationBarBackgroundColor":"#F4F5F7",
"navigationBarBackgroundColor": "#F4F5F7",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
{
{
"path": "exam-pass",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
"navigationStyle": "custom"
}
}
]
......@@ -149,7 +149,7 @@
"style": {
"navigationBarTitleText": "收获地址",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -158,7 +158,7 @@
"style": {
"navigationBarTitleText": "修改地址",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -168,8 +168,8 @@
"navigationBarTitleText": "我的钱包",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
......@@ -178,8 +178,8 @@
"navigationBarTitleText": "提现",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
......@@ -188,8 +188,8 @@
"navigationBarTitleText": "收入流水",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
......@@ -198,80 +198,77 @@
"navigationBarTitleText": "结算账单",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
}
},
{
"path": "cert/index",
"style": {
"navigationBarTitleText": "我的证件",
"navigationStyle":"custom",
"disableScroll": true
}
},
{
"path": "cert/detail",
"style": {
"navigationBarTitleText": "",//证件详情
"navigationStyle":"custom"
}
},
{
"path": "cert/upload",
"style": {
"navigationBarTitleText": "",//证件上传
"navigationStyle":"custom"
}
},
{
"path":"contract/index",
"style":{
"navigationBarTitleText":"",//我的合同
"navigationStyle":"custom"
}
},
{
"path":"contract/out",
"style":{
"navigationBarTitleText":""
}
},
{
"path": "customer/index",
"style": {
"navigationStyle":"custom",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "cert/index",
"style": {
"navigationBarTitleText": "我的证件",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "cert/detail",
"style": {
"navigationBarTitleText": "证件详情",
"navigationStyle": "custom"
}
},
{
"path": "cert/upload",
"style": {
"navigationBarTitleText": "证件上传",
"navigationStyle": "custom"
}
},
{
"path": "contract/index",
"style": {
"navigationBarTitleText": "我的合同",
"navigationStyle": "custom"
}
},
{
"path": "contract/out",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "customer/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "联系客服",
"enablePullDownRefresh": false,
"enablePullDownRefresh": false,
"disableScroll": true
}
},
},
{
"path": "deposit/index",
"style": {
"navigationStyle":"custom",
"path": "deposit/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "配件押金",
"enablePullDownRefresh": false
}
},
},
{
"path": "warehouse/index",
"style": {
"navigationStyle":"custom",
"path": "warehouse/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "我的仓库",
"enablePullDownRefresh": false
}
},
{
"path": "superLogin/index",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "superLogin/index",
"style": {
"navigationBarTitleText": ""
}
}
]
]
},
{
"root": "pages/order",
......@@ -279,7 +276,7 @@
{
"path": "complete",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "订单完工",
"navigationStyle": "custom",
"disableScroll": true
}
......@@ -287,49 +284,44 @@
{
"path": "feedback",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "过程反馈",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "refuse",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "订单拒单",
"enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path" : "detail",
"style" :
{
"path": "detail",
"style": {
"navigationBarTitleText": "订单详情",
"navigationStyle": "custom",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path" : "search",
"style" :
{
"navigationBarTitleText": "订单搜索",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#F4F5F7"
}
},
{
"path" : "material",
"style" :
{
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#FFFFFF"
}
}
},
{
"path": "search",
"style": {
"navigationBarTitleText": "订单搜索",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "material",
"style": {
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF"
}
}
]
},
......@@ -340,22 +332,22 @@
"path": "index",
"style": {
"navigationBarTitleText": "拍照小工具",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#F4F5F7"
}
},
{
"path": "setting",
"style": {
"navigationBarTitleText": "水印设置",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#F4F5F7"
}
},
{
"path": "take",
"style": {
"navigationStyle":"custom",
"navigationStyle": "custom",
"navigationBarTitleText": "拍照",
"navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF",
......@@ -366,18 +358,18 @@
"path": "preview",
"style": {
"navigationBarTitleText": "照片预览",
"navigationBarBackgroundColor":"#333333",
"backgroundColor":"#FFFFFF",
"navigationBarTextStyle":"white"
"navigationBarBackgroundColor": "#333333",
"backgroundColor": "#FFFFFF",
"navigationBarTextStyle": "white"
}
},
{
"path": "list",
"style": {
"navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#F4F5F7",
"navigationStyle": "custom",
"disableScroll": true
}
}
......@@ -390,7 +382,7 @@
"path": "index",
"style": {
"navigationBarTitleText": "入驻",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -436,7 +428,7 @@
"path": "sign-contract",
"style": {
"navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -454,7 +446,11 @@
"preloadRule": {
"pages/index/index": {
"network": "all",
"packages": ["pages/order", "pages/learn", "pages/mine"]
"packages": [
"pages/order",
"pages/learn",
"pages/mine"
]
}
},
"globalStyle": {
......
......@@ -51,7 +51,7 @@
scroll-anchoring> -->
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick(item.orderId)" @action="handleAction(item.orderId)">
@click="handleClick" @action="handleClick">
</OrderCell>
</view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
......@@ -166,15 +166,9 @@
this.getOrderCount()
this.initSettleInfo();
},
handleClick(orderId) { // 点击了cell
this.viewOderItem(orderId)
},
handleAction(orderId) { // 点击了按钮
this.viewOderItem(orderId)
},
viewOderItem(orderId) { // 跳转工单详情页面
handleClick(item, title) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
})
},
async initSettleInfo() {
......
......@@ -41,7 +41,7 @@
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<swiper-item @touchmove.stop.prevent="stopTouchMove" v-if="version">
<scroll-view scroll-y style="height:100%;width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="learn-currency-class">
......@@ -231,12 +231,12 @@ var json = {
sectionId: "",
},
{
title: "充电桩安装要点提示",
desc: "在充电装安装过程中需要着重注意的要点",
title: "学习-我的模块",
desc: "学习-我的模块",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 151,
id: 152,
sectionId: "",
},
],
......@@ -374,6 +374,9 @@ export default {
{
name: "消息通知",
},
{
name: "在线学习",
},
{
name: "考核认证",
},
......@@ -385,9 +388,6 @@ export default {
{
name: "消息通知",
},
{
name: "在线学习",
},
{
name: "考核认证",
},
......@@ -474,7 +474,7 @@ export default {
isReflesh: true,
triggered: false,
_freshing: false,
version: false,
version: true,
};
},
onLoad(param) {
......@@ -512,8 +512,9 @@ export default {
.getVersionInfo(version)
.then((res) => {
let data = res.data;
if(data.hasOwnProperty('is_audit') && data.is_audit == 1){
if(data.hasOwnProperty('is_audit') && data.is_audit == 0){
that.tabs = that.tabs2;
that.version = false
}
})
.catch((err) => {
......@@ -800,6 +801,7 @@ export default {
var news = {
body: e.body,
title: e.title,
create_at: e.create_at,
};
let that = this;
wx.navigateTo({
......
......@@ -23,7 +23,7 @@
<u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)">
<image slot="icon" :src="qnPath + item.icon" :style="item.imageStyle"></image>
<image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image>
<view slot="title" class="item-title">{{item.title}}</view>
<view slot="value" class="item-value">{{value}}</view>
</u-cell-item>
......@@ -43,7 +43,6 @@
export default {
data() {
return {
qnPath: process.uniEnv.qn_base_url,
serviceTel: '18124099271',
showSuperButton: false,
show: false,
......@@ -142,10 +141,13 @@
this.getData()
}
}
this.wodebeijingImage = await util.imageCache(this, 'wodebeijing.png')
this.placeholderImage = await util.imageCache(this, 'touxiang.png')
this.wodebeijingImage = this.qnFile('wodebeijing.png')
this.placeholderImage = this.qnFile('touxiang.png')
},
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
getData() {
let self = this
app.getBaseInfo(self);
......
......@@ -28,8 +28,8 @@
<NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" />
<template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick(item)"
@action="handleAction(item)"> </OrderCell>
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick"
@action="handleClick"> </OrderCell>
</view>
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</template>
......@@ -282,17 +282,15 @@
}
});
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
})
},
handleClick(item) {
handleClick(item, title) {
console.log(item, title)
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
this.viewOderItem(item.orderId)
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
})
},
filish(item){
// 去完工
......@@ -305,13 +303,13 @@
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'')
})
},
handleAction(item) {
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
this.viewOderItem(item.orderId)
},
// handleAction(item) {
// if(item.orderStatus===86 || item.orderStatus===88){
// this.filish(item)
// return
// }
// this.viewOderItem(item.orderId)
// },
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
......
<template>
<view class="learn-vedio">
<u-navbar title="培训视频"></u-navbar>
<view class="uni-padding-wrap uni-common-mt">
<view
><video
object-fit="fill"
class="course-video"
id="courseVideo"
:src="courseSrc"
@play="playCourse"
@error="videoErrorCallback"
controls
></video
></view>
<view class="title-content">
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{
courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
}}</text>
</view>
<view class="item-title">{{
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
<view class="learn-vedio">
<view v-if="version && loaded">
<u-navbar title="培训视频"></u-navbar>
<view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="fill" class="course-video" id="courseVideo" :src="courseSrc" @play="playCourse"
@error="videoErrorCallback" controls></video></view>
<view class="title-content">
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{ courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" }}</text>
</view>
<view class="item-title">{{ courseTitle.split(" ") ? courseTitle.split(" ")[1] : "" }}</view>
</view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view>
<view class="learn-list" v-for="(item, key) in courseOutlines[courseId]" :key="key">
<view class="learn-list-item">{{ item }}</view>
</view>
</view>
</view>
</view>
<view
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view
>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view>
<view
class="learn-list"
v-for="(item, key) in courseOutlines[courseId]"
:key="key"
>
<view class="learn-list-item">{{ item }}</view>
<view v-else-if="loaded">
<u-navbar title=" "></u-navbar>
<view style="text-align: center;">暂无数据</view>
</view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
export default {
data() {
return {
courseId: "",
courseStatus: 0,
courseSrc: "",
courseTitle: "",
courseDesc: "",
currentIndex: -1, // 第几个视频
};
},
computed: {
courseOutlines() {
// 视频内容介绍
return {
1: [
"1、考核规则:接单及时率",
"2、考核规则:上门及时率",
"3、考核规则:安装完工率",
"4、考核规则:资料提交及时率",
"5、考核规则:安装完工率",
"6、考核规则:客户满意度",
],
2: ["1、必备材料4大类", "2、施工工具准备"],
3: [
"1、接线安装工艺标准",
"2、PVC、镀锌管电缆管明敷",
"3、电缆敷设的防火要求",
"4、电源点标识",
"5、配电箱接线及安装",
"6、管线敷设接头处理",
"7、充电桩内部接线",
"8、配电箱安装",
],
4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
};
},
kcImage() {
return process.uniEnv.qn_base_url + "kc.png";
},
},
onLoad(e) {
app.trackPage('入驻培训视频页')
if (e) {
if (e.courseId) {
this.courseId = e.courseId;
}
if (e.id) {
this.courseId = e.courseId;
this.courseSrc = app.globalData.service_standard[e.id].url;
this.courseTitle = app.globalData.service_standard[e.id].title;
this.courseDesc = app.globalData.service_standard[e.id].desc;
}
if (e.status) {
this.courseStatus = e.status;
}
}
},
onReady: function (res) {
// #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext("courseVideo");
// #endif
},
methods: {
videoErrorCallback: function (e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
playCourse: function (e) {
if(this.courseStatus && (this.courseStatus == "1"||this.courseStatus == 1)) {
return
}
this.changeCourseStatus();
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
let app = getApp();
export default {
data() {
return {
courseId: "",
courseStatus: 0,
courseSrc: "",
courseTitle: "",
courseDesc: "",
currentIndex: -1, // 第几个视频
version: true,
loaded: false
};
},
computed: {
courseOutlines() {
// 视频内容介绍
return {
1: [
"1、考核规则:接单及时率",
"2、考核规则:上门及时率",
"3、考核规则:安装完工率",
"4、考核规则:资料提交及时率",
"5、考核规则:安装完工率",
"6、考核规则:客户满意度",
],
2: ["1、必备材料4大类", "2、施工工具准备"],
3: [
"1、接线安装工艺标准",
"2、PVC、镀锌管电缆管明敷",
"3、电缆敷设的防火要求",
"4、电源点标识",
"5、配电箱接线及安装",
"6、管线敷设接头处理",
"7、充电桩内部接线",
"8、配电箱安装",
],
4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
};
},
kcImage() {
return process.uniEnv.qn_base_url + "kc.png";
},
},
onLoad(e) {
app.trackPage('入驻培训视频页')
if (e) {
if (e.courseId) {
this.courseId = e.courseId;
}
if (e.id) {
this.courseId = e.courseId;
this.courseSrc = app.globalData.service_standard[e.id].url;
this.courseTitle = app.globalData.service_standard[e.id].title;
this.courseDesc = app.globalData.service_standard[e.id].desc;
}
if (e.status) {
this.courseStatus = e.status;
}
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
},
};
this.getVersion();
},
onReady: function(res) {
// #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext("courseVideo");
// #endif
},
methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
that.loaded = true
let data = res.data;
if (data.hasOwnProperty('is_audit') && data.is_audit == 0) {
that.version = false
}
})
.catch((err) => {
});
},
videoErrorCallback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
playCourse: function(e) {
if (this.courseStatus && (this.courseStatus == "1" || this.courseStatus == 1)) {
return
}
this.changeCourseStatus();
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
},
};
</script>
<style lang="scss" scoped>
.learn-vedio {
background-color: #f4f5f7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow-y:auto;
}
.course-video {
width: 750rpx;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #ffffff;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
line-height: 24rpx;
position: relative;
.item-st-text {
color: #ffffff;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
.learn-vedio {
background-color: #f4f5f7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.course-video {
width: 750rpx;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #ffffff;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
line-height: 24rpx;
position: relative;
.item-st-text {
color: #ffffff;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
.item-title {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
}
}
.item-title {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
}
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.learn-view {
background-color: #ffffff;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
width: 100%;
.item-title {
color: #333333;
font-size: 28rpx;
}
.learn-view {
background-color: #ffffff;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
width: 100%;
}
}
}
}
}
</style>
</style>
<template>
<view>
<view class="news-wrap">
<u-navbar
back-icon-color="#000000"
:background="background"
......@@ -9,8 +9,11 @@
<view class="title">
{{ title }}
</view>
<view class="time-txt">
{{time | datefmt('YYYY.MM.DD HH:mm:ss')}}
</view>
<view class="u-content">
<u-parse :html="body" :tag-style="style"></u-parse>
<u-parse :html="body" :tag-style="style" :selectable="true"></u-parse>
</view>
</view>
</template>
......@@ -20,7 +23,20 @@
data() {
return {
title: '',
body: ''
body: '',
time: '',
style: {
// 字符串的形式
p: `
color: #666666;
font-size: 24rpx;
letter-spacing: 0.03rpx;
`,
span: 'font-size: 26rpx',
img: `
padding: 40rpx 0;
`,
},
}
},
onLoad() {
......@@ -30,25 +46,35 @@
eventChannel.on('acceptDataFromLearn', function(data) {
that.title = data.title;
that.body = data.body;
that.time = data.create_at
})
this.$u.mpShare.path = ''
},
}
</script>
<style>
<style>
.news-wrap {
background-color: #FFFFFF;
height: 100vh;
}
.title{
font-size: 32rpx;
font-size: 36rpx;
font-weight: bold;
margin-left: 30rpx;
margin-top: 30rpx;
}
margin: 20rpx 30rpx;
}
.time-txt {
margin: 0 30rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
line-height: 24rpx;
}
.u-content{
font-size: 24rpx;
line-height: 36rpx;
color: #666666;
margin-left: 30rpx;
margin-top: 30rpx;
margin-right: 30rpx;
}
</style>
<template>
<template v-cloak>
<view class="">
<view class="learn-vedio">
<view class="learn-vedio" v-if="version && loaded">
<u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false">
</u-navbar>
<view class="uni-padding-wrap uni-common-mt">
......@@ -48,6 +48,11 @@
</view>
</view>
</view>
<view v-else-if="loaded">
<u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false">
</u-navbar>
<view style="text-align: center;">暂无数据</view>
</view>
</view>
</template>
......@@ -100,7 +105,9 @@
scrollTop: null
},
scrollValue: 0,
nowTime: 0
nowTime: 0,
version: true,
loaded: false
};
},
computed: {
......@@ -109,18 +116,37 @@
},
},
onLoad(e) {
getApp().trackPage('学习视频详情页')
this.section_id = e.section_id
this.params.course_id = e.course_id
this.getCapterDetails()
this.getSectionInfo({
section_id: e.section_id
})
this.getVersion();
getApp().trackPage('学习视频详情页')
if(e){
this.section_id = e.section_id
this.params.course_id = e.course_id
this.getCapterDetails()
this.getSectionInfo({
section_id: e.section_id
})
}
},
onReady: function(res) {
this.videoContext = uni.createVideoContext("courseVideo");
},
methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
that.loaded = true
let data = res.data;
if(data.hasOwnProperty('is_audit') && data.is_audit == 0){
that.version = false
}
})
.catch((err) => {
that.loaded = true
});
},
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop
},
......
<template>
<view class="">
<!-- <w-navbar></w-navbar> -->
<view class="backView">
<view class="login-block" v-if="needAuth">
<u-image class="u-flex u-row-center logo" :src="logo" width="200" height="200">
<u-image :fade="false" class="u-flex u-row-center logo" :src="logo" width="200" height="200">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
<u-image class="u-flex u-row-center logo2" :src="logo2" width="214" height="60">
<u-image :fade="false" class="u-flex u-row-center logo2" :src="logo2" width="214" height="60">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
</view>
<view class="bind-block" v-else>
<u-image class="u-flex u-row-between logo" :src="logo" width="148" height="148">
<u-image :fade="false" class="u-flex u-row-between logo" :src="logo" width="148" height="148">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
<view class="bind-phone">{{ bindPhone }}</view>
<view class="bind-tips">{{ bindTips }}</view>
</view>
<u-gap height="570"></u-gap>
<u-gap height="480"></u-gap>
<button class="loginBtn" v-if="needAuth" lang="zh_CN" @tap="getUserProfile">
<text class="u-font-32 white">{{ loginTitle }}</text>
</button>
......@@ -38,7 +39,6 @@ const app = getApp()
export default {
data() {
return {
qnPath: process.uniEnv.qn_base_url,
needAuth: true,
TimeID: -1,
loginTitle: '用户登录',
......@@ -50,10 +50,10 @@ export default {
},
computed: {
logo() {
return util.imageCache(this, 'logo.png')
return this.qnFile('logo.png')
},
logo2() {
return util.imageCache(this, 'logo-2.png')
return this.qnFile('logo-2.png')
},
},
onLoad(e) {
......@@ -67,6 +67,9 @@ export default {
this.getCode()
},
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
async getCode() {
login.appLogin().then(res => {
this.code = res.code
......@@ -160,7 +163,7 @@ export default {
login.signup(params).then(res => {
uni.hideLoading()
if (res) {
app.setUserData(res.data, that)
login.setUserData(res.data, that)
app.track('signup_login', {mobile: res.data.mobile});
app.profileSet(that)
app.profileAppend(that)
......@@ -171,11 +174,11 @@ export default {
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus(false)
that.setLoginStatus(false)
}
}).catch(res => {
uni.hideLoading()
this.setLoginStatus(false)
that.setLoginStatus(false)
})
},
fail () {
......@@ -184,7 +187,7 @@ export default {
}
})
} else {
this.toLogin(params)
that.toLogin(params)
}
} else {
uni.showModal({
......
......@@ -4,7 +4,7 @@
:border-bottom="false" title-bold></u-navbar>
<view class="wallet-content-view">
<view class="header-view">
<image class="header-image" :src="qianbaobeijing"></image>
<image class="header-image" :src="qnFile('qianbaobeijing.png')"></image>
</view>
<view class="survey-view">
<view class="survey-top-view">
......@@ -109,9 +109,6 @@
imageUrl() {
return process.uniEnv.qn_base_url
},
qianbaobeijing() {
return util.imageCache(this, 'qianbaobeijing.png')
},
buttonStyle() {
return {
width: "200rpx",
......@@ -139,6 +136,9 @@
this.loadStatement()
},
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
// 提现
handleClickWithdraw() {
this.$u.route({
......
......@@ -20,7 +20,7 @@
</view>
</view>
</view>
<image :src="liushuibeijingImage" class="head-back-image" mode="widthFix"></image>
<image :src="qnFile('liushuibeijing.png')" class="head-back-image" mode="widthFix"></image>
<view class="list-view" v-if="hasInfo">
<view class="u-flex u-row-center" v-if="loading">
<u-gap height="20"></u-gap>
......@@ -31,7 +31,7 @@
</view>
</view>
<view class="list-view-empty" v-else>
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="true" duration="450">
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="false">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
......@@ -64,9 +64,6 @@
}
},
computed: {
liushuibeijingImage() {
return util.imageCache(this, 'liushuibeijing.png')
},
imageUrl() {
return process.uniEnv.qn_base_url
},
......@@ -74,7 +71,7 @@
return this.loading || this.info.payableRecordExtendDtos && this.info.payableRecordExtendDtos.length
},
banner() {
return util.imageCache(this, 'receipt.png')
return this.qnFile('receipt.png')
},
},
onLoad() {
......@@ -82,6 +79,9 @@
this.loadPayRecord()
},
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
async loadPayRecord() {
let self = this
self.loading = true
......
......@@ -20,7 +20,7 @@
</view>
</view>
</view>
<image :src="liushuibeijingImage" class="head-back-image" mode="widthFix"></image>
<image :src="qnFile('liushuibeijing.png')" class="head-back-image" mode="widthFix"></image>
<view class="list-view" v-if="hasInfo">
<view class="u-flex u-row-center" v-if="loading">
<u-gap height="20"></u-gap>
......@@ -31,7 +31,7 @@
</view>
</view>
<view class="list-view-empty" v-else>
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="true" duration="450">
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="false">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
......@@ -84,14 +84,11 @@
}
},
liushuibeijingImage() {
return util.imageCache(this, 'liushuibeijing.png')
},
imageUrl() {
return process.uniEnv.qn_base_url
},
banner() {
return util.imageCache(this, 'receipt.png')
return this.qnFile('receipt.png')
},
hasInfo() {
return this.loading || this.data.statementList && this.data.statementList.length
......@@ -101,7 +98,10 @@
getApp().trackPage('收入流水列表页')
this.loadStatement()
},
methods: {
methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
bindDateChange: function(e) {
this.date = e.target.value
this.loadStatement()
......
<template>
<view class="com-content">
<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="完工信息" title-bold></u-navbar>
<u-tabs v-show="showTab" 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>
<view :class="['u-menu-wrap', {'one': !showTab}]">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" v-if="list[tabIndex].items.length > 1 && showTab">
<view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId">
<u-form :model="form" ref="uForm">
<template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])">
<view class="class-item" :key="groupIndex">
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view>
<view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
</view>
<template v-if="item.fieldsType">
<xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' @value-change="fieldValueChange">
</xh-input>
<xh-multi-input v-else-if="item.formType==='multiinput'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-multi-input>
<xh-radio v-else-if="item.formType==='radio'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-radio>
<xh-checkbox v-else-if="item.formType==='checkbox'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-checkbox>
<xh-select v-else-if="item.formType==='select'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-select>
<view v-else-if="item.formType==='file'">
<xh-files
:ref="`fileChild${groupIndex}${itemIndex}`"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
<template v-slot>
<view class="img-list">
<u-image class="pic" width="160rpx" height="160rpx" :border-radius="10" @click="selectUpload(JSON.stringify(item), groupIndex, itemIndex)" :src="uploadImage"></u-image>
</view>
</template>
</xh-files>
</view>
<xh-location v-else-if="item.formType==='location'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-location>
<xh-scan v-else-if="item.formType==='scan'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-scan>
<xh-picker v-else-if="item.formType==='picker'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-picker>
<xh-service-measure v-else-if="item.formType==='servicemeasure'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId"
:orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]"
@value-change="fieldValueChange">
</xh-service-measure>
<xh-time v-else-if="item.formType==='time'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-time>
<xh-service-more v-else-if="item.formType==='form'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-service-more>
<xh-label v-else-if="item.formType==='label'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
</xh-label>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view>
<view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]">
<u-button class="btn-submit" @click="saveComplete"
type="primary" shape="circle" :custom-style="customStyle" :hover-class="submitStatus ? '' : 'none'">
暂存
</u-button>
<u-button class="btn-submit" @click="orderFinish" v-if="tabIndex===list.length - 1"
type="primary" shape="circle" :custom-style="buttonStyle" :hover-class="submitStatus ? '' : 'none'">
完工
</u-button>
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" v-else
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
下一步
</u-button>
</view>
</view>
<u-toast ref="uToast" />
<take-photo v-if="takeStatus" @close="closeTake" :upload="false" :currentItem="currentItemDate"></take-photo>
<u-action-sheet :list="carmeraList" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet>
</view>
</template>
<script>
import XhInput from '@/components/createCom/XhInput.vue'
import XhMultiInput from '@/components/createCom/XhMultiInput.vue'
import XhRadio from '@/components/createCom/XhRadio.vue'
import XhCheckbox from '@/components/createCom/XhCheckbox.vue'
import XhSelect from '@/components/createCom/XhSelect.vue'
import XhFiles from '@/components/createCom/XhFiles.vue'
import XhLocation from '@/components/createCom/XhLocation.vue'
import XhScan from '@/components/createCom/XhScan.vue'
import XhPicker from '@/components/createCom/XhPicker.vue'
import XhTime from '@/components/createCom/XhTime.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from "../../components/createCom/XhServiceMore";
import XhLabel from "../../components/createCom/XhLabel";
import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index';
// import XhRadio from '@/components/createCom/XhRadio.vue'
export default {
data() {
return {
orderId:0,
categoryId:0,
orderServiceType:'',
inGuaranteePeriod:'',
partnerCompanyId:'',
auditResultsId: '',
list: [],
tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0,
current: 0, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id
oldItemId: '',
menuItemPos: [],
arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器
form: { // 一维表单
},
submitBtnStatus: false,
completeCheckStatus: false,
completeCheckResult: [],
waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0,
pass: false,
// 上传组件相关
carmeraList: [
{
text: '相册'
},
{
text: '拍照'
}
],
maskShow: false,
takeStatus: false,
currentItemDate:{},
photoItem: {},
showTab: true
}
},
components: {
XhInput,
XhMultiInput,
XhRadio,
XhCheckbox,
XhSelect,
XhFiles,
XhLocation,
XhScan,
XhPicker,
XhTime,
XhServiceMeasure,
XhServiceMore,
XhLabel,
'take-photo': takePhoto
},
mixins: [baseFile],
created() {
// console.log(allComponents,'allComponents')
},
onLoad(option) {
getApp().trackPage('订单完工信息页')
if (option) {
this.orderId = option.orderId
this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.auditResultsId = option.auditResultsId
this.showTab =option.partnerCompanyName == '挚达充电桩'
} else {
this.orderId = 11880091
this.categoryId = 1100000214
this.orderServiceType = '安装'
this.inGuaranteePeriod = 'Y'
}
this.getCompleteData()
},
onReady() {
// 导航栏滚动切换
this.getMenuItemTop()
},
updated() {
//console.log(this.form.name, 'form.name')
},
computed: {
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
uploadImage() {
return process.uniEnv.qn_base_url + 'upload-file.png'
},
buttonStyle() {
return {
'color': '#FFFFFF',
'background-color': '#2272FF;',
'width': '300rpx',
'height': '104rpx',
'font-size': '32rpx',
'font-weight': 'bold',
'margin-left': '50rpx'
}
},
customStyle() {
return {
'background-color': '#D1D4D4',
'width': '300rpx',
'height': '104rpx',
'background-color': 'transparent',
'border': '1px solid #2272FF',
'color': '#2272FF',
'font-weight': 'bold',
'font-size': '32rpx',
}
},
show200() {
return this.form.paymentMethodsType && this.form.paymentMethodsType != '03'
}
},
methods: {
getCompleteData() {//获取工单配置的完工项目
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.initData(res)
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
});
}
},
initData(res) {
for (var item of res.data.config) {
for (var i of item.items) {
for (var d of i.items) {
var inputType = 'text'
var formType = ''
var type = d.fieldsType.toLocaleLowerCase()
switch (type) {
case 'text':
inputType = 'textarea'
formType = 'input'
break
case 'password':
inputType = 'password'
formType = 'input'
break
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
inputType = 'digit'
break
case 'string':
formType='input',
inputType = 'text'
break
case 'multiinput':
formType = 'multiinput'
inputType = 'text'
break;
case 'select':
case 'specifications':
formType = 'select'
inputType = 'text'
break
case 'radio':
formType = 'radio'
inputType = 'text'
break
case 'checkbox':
formType = 'checkbox'
inputType = 'text'
break
case 'file':
case 'photos':
formType = 'file'
inputType = 'text'
break
case 'location':
formType = 'location'
inputType = 'text'
break
case 'scan':
case 'machine_code':
formType = 'scan'
inputType = 'text'
break
case 'picker':
case 'mutipicker':
formType = 'picker'
inputType = 'text'
break
case 'service_measures':
formType = 'servicemeasure'
inputType = 'text'
break
case 'time':
case 'date':
formType = 'time'
inputType = 'text'
break
case 'form':
formType = 'form'
inputType = 'text'
break
case 'label':
formType = 'label'
inputType = 'text'
break
}
d.formType = formType
d.inputType = inputType
if (d.fieldsId == 200 && res.data.value) {
d.required = res.data.value['paymentMethodsType'] !='03'
}
}
}
}
this.list = res.data.config
this.showTab = this.list.length > 1
this.form = res.data.value || {}
// 异常单处理
if (this.auditResultsId) this.checkCompleteError()
},
checkCompleteError() { // 异常单定位错误项
let self = this
self.list.forEach((panel, panelIndex)=>{
panel.items.forEach((group, groupIndex) =>{
group.items.forEach((ele, eleIndex)=>{
if (ele.fieldsName === self.auditResultsId) {
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
}
})
})
})
this.locationCompleteItem(self.waitHandlerPanelIndex, self.waitHandlerGroupIndex, self.waitHandlerEleIndex)
},
handleSaveData(){
let param = {}
this.list.forEach((panel)=>{
param[panel.panelFieldsName] = []
panel.items.forEach((group) =>{
group.items.forEach((ele)=>{
if(this.form[ele.fieldsName]){
param[panel.panelFieldsName].push({
"fieldsName": ele.fieldsName,
"fieldsType": ele.fieldsType,
"fieldsValue": this.form[ele.fieldsName],
"required": ele.required,
})
}
})
})
})
return param
},
saveComplete(){// 保存完工信息
let self = this
let param = self.handleSaveData()
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{
if (res.code == 200) {
this.$refs.uToast.show({
title: '保存成功',
type: 'success',
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
checkCompleteItem(){
let self = this
let checkResult = []
let pass = true
let first = true
self.list.forEach((panel, panelIndex)=>{
let panelResult = {label: panel.panelName, submitted: 0, required: 0, pass: true}
panel.items.forEach((group, groupIndex) =>{
group.items.forEach((ele, eleIndex)=>{
if(ele.required){
panelResult.required++
let value = self.form[ele.fieldsName]
if(value&&!Array.isArray(value)){
panelResult.submitted++
}else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
first = false
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
}
}
})
})
panelResult.pass = panelResult.required <= panelResult.submitted
pass = pass&&panelResult.pass
checkResult.push(panelResult)
})
console.log(checkResult)
self.completeCheckResult = checkResult
return pass
},
confirm(){// 检查结果窗口 确认回调
uni.reLaunch({
url: '/pages/index/order?type=3'
})
},
closeCheckResult(){// 检查结果窗口取消回调
this.completeCheckStatus = false
},
handerProgrom(){// 检查结果窗口 去处理回调 定位到缺失的项
this.completeCheckStatus = false
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
this.swichMenu(groupIndex)
})
},
orderFinish(){
let self = this
let pass = this.checkCompleteItem()
if(!pass){
self.completeCheckStatus = true
}else{// 先保存完工项
let param = self.handleSaveData()
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{
if (res.code == 200) {//完工项信息保存成功再次完工工单
console.log("完工");
this.pass = pass
if(self.inGuaranteePeriod === 'Y'){
self.$u.api.inOrderFinish(self.orderId).then((res)=>{
console.log(res)
self.completeCheckStatus = true
})
}else{
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{
console.log(res)
self.completeCheckStatus = true
})
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
}
},
calMaterialCraftListAmount(arr){
let amount = 0
if(arr){
arr.forEach(item =>{
if (Number(item.useLength) && Number(item.freeLength) && Number(item.unitAmt)) {
amount += Math.max(Number(item.useLength) - Number(item.freeLength), 0) * Number(item.unitAmt)
}
if(Number(item.extraAmt)){
amount += Number(item.extraAmt)
}
})
}
return amount
},
setData(data){// 通过页面设置数据
Object.keys(data).forEach(key => {
this.$set(this.form,key,data[key])
})
// 更新预计超出金额
let amount = this.calMaterialCraftListAmount(this.form.materialList)
amount += this.calMaterialCraftListAmount(this.form.craftList)
this.$set(this.form,'overAmount',amount)
},
// 字段的值更新
fieldValueChange(data) {
const groupItem = this.list[this.tabIndex].items[data.groupIndex]
let innerItem
if (groupItem.items) {
innerItem = groupItem.items[data.itemIndex]
}
if(innerItem.fieldsType ==='multiInput'){
// 多个输入框的值触发
let key = Object.keys(data.value)[0]
this.form[key] = data.value[key]
}else{
this.$set(this.form,innerItem.fieldsName,data.value)
}
if (innerItem.fieldsId == 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var list of this.list) { // 同时修改基本信息和完工信息
for (var item of list.items) {
for (var i of item.items) {
if (i.fieldsId == 200) {
i.required = data.value !='03'
}
}
}
}
}
},
nextStep() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
this.leftMenuStatus(0)
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
})
}
},
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.leftMenuStatus(0)
this.$nextTick(function() {
if (this.oldItemId)this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex){
const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0].imgList
if (imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error',
})
}
this.photoItem = {
...JSON.parse(item),
groupIndex,
itemIndex,
}
// 弹窗展示
this.maskShow = true
},
// 区分上传动作
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo')
} else {
this.uploadFile()
}
},
// 拍照回调
async closeTake(val) {
if(val && val.length > 0){
const files = val.map(v => v.path)
const value = await this.saveToTask(files)
this.$refs[`fileChild${this.photoItem.groupIndex}${this.photoItem.itemIndex}`][0].setTmpValue(value)
}
this.takeStatus = false
},
// 上传图片
async uploadFile(type){
const self = this
if(type&&type==='photo'){
// 直接打开相册
let options = {
sourceType:['album'],//['album', 'camera']
count: 3,
sizeType: ['compressed']
}
const value = await this.chooseImg(options)
self.$refs[`fileChild${self.photoItem.groupIndex}${self.photoItem.itemIndex}`][0].setTmpValue(value)
return
}
// 使用拍照工具拍摄
this.photograph()
this.getWatermark()
},
// 获取拍照规范
photograph(){
let self = this
let param = {
"partnerCompanyId":this.partnerCompanyId || '',
"categoryId":this.categoryId,
"brandId":this.brandId || '',
"fieldName":this.photoItem.fieldsName}
this.$u.api.orderStandardItem(param).then((res)=>{
if (res.code == 200 && res.data.length>0) {
self.currentItemDate = res.data[0]
}else{
console.log("获取完工项的拍照标准异常",res.data.message)
}
self.takeStatus = true
})
},
// 获取水印
getWatermark(){
if(getApp().globalData.photo.waterSetting){
return
}
var data={partnerCompanyId:this.partnerCompanyId || ''}
this.$u.api.getWatermark(data).then((res) => {
if (res.code == 200) {
getApp().globalData.photo.waterSetting = res.data
} else {
console.log("获取水印备注异常",res.data.message)
}
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
this.itemId = this.oldItemId
if(!this.oldItemId) this.scrollRightTop = this.arr[index];
this.oldItemId = ''
this.current = index;
this.leftMenuStatus(index);
})
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成,res值为null,循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
resolve();
}).exec();
})
},
// 观测元素相交状态
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
})
},
// 设置左边菜单的滚动状态
async leftMenuStatus(index) {
this.current = index;
// 如果为0,意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// 将菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop() {
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop();
}, 10);
return;
}
rects.forEach((rect) => {
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this.arr.push(rect.top - rects[0].top);
resolve();
})
}).exec()
})
},
// 右边菜单滚动
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
this.timer = setTimeout(() => { // 节流
this.timer = null;
// scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i];
let height2 = this.arr[i + 1];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i);
return;
}
}
}, 10)
},
handleTouchstart() { // 防止输入光标滚动出现错乱
uni.hideKeyboard()
}
}
}
</script>
<style lang="scss" scoped>
// ---------------------------- 表单样式begin ----------------------------
/deep/ .u-form-item {
.u-form-item__message {
padding-left: 0 !important;
}
.u-form-item--left__content--required {
vertical-align: top;
}
}
.class-item {
background-color: #fff;
padding: 28rpx;
border-radius: 8rpx;
.title {
font-weight: bold;
font-size: 32rpx;
line-height: 32rpx;
color: #333;
}
.label {
color: #333;
font-size: 28rpx;
line-height: 40rpx;
padding-bottom: 20rpx;
}
.label-bold {
font-size: 32rpx;
font-weight: bold;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
// ---------------------------- 表单样式end ----------------------------
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
background-color: #FFFFFF;
background-image: linear-gradient(to top, #2272ff 0%, #2272ff 100%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.order-tabs {
margin-top: 20rpx;
margin-bottom: 32rpx;
}
.u-menu-wrap {
flex: 1;
height: 100%;
display: flex;
overflow: hidden;
border-radius: 12rpx 12rpx 0 0;
&.one {
border-radius: 0;
}
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: $u-tips-color;
margin-left: 10rpx;
}
.u-tab-view {
width: 200rpx;
height: 100%;
border: 4rpx solid #F4F5F7;
overflow: auto;
}
.u-tab-item {
height: 110rpx;
background: #fff;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #333333;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #2272FF;
background: #fff;
}
// .u-tab-item-active::before {
// content: "";
// position: absolute;
// border-left: 4px solid $u-type-primary;
// height: 32rpx;
// left: 0;
// top: 39rpx;
// }
.u-tab-view {
height: 100%;
}
.right-box, .right-boxs {
// background-color: rgb(250, 250, 250);
background-color: #FFFFFF;
overflow: auto;
width: 100%;
}
.page-view {
padding: 16rpx;
}
.class-item:last-child {
max-height: 100vh;
}
.item-title {
font-size: 26rpx;
color: $u-main-color;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 24rpx;
color: $u-main-color;
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
}
.item-menu-image {
width: 120rpx;
height: 120rpx;
}
/*提交按钮*/
.btn-bottom {
border: 2rpx solid #F4F5F7;
}
.btn-wrap {
width: 100%;
padding: 20rpx 0 44rpx 0;
display: flex;
justify-content: center;
align-items: center;
}
.btn-save {
color: #FFFFFF;
background-color: #2272FF;
font-size: 32rpx;
font-weight: bold;
}
.img-list {
position: relative;
margin: 8rpx;
width: 160rpx;
height: 160rpx;
.pic{
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&:nth-child(3n){
margin-right: 0;
}
}
}
</style>
<template>
<view class="order-wrap">
<u-navbar back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar>
<view class="header">
<view class="title">订单信息</view>
<view v-show="allowRejection" class="button" @click="rejectOrder">拒单</view>
<u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar>
<view class="header" v-if="order.currentOverTime && showTimeOut">
<!-- 倒计时 -->
<view class="title">
<view class="bottom-tag-view"><text>{{timeout ? '超时' : '剩余'}}</text></view>
<u-count-down :timestamp="timestamp" font-size="28" show-days separator="zh" separator-size="32" height="40"
color="#2272FF" separator-color="#FFFFFF" @change="timeOutChange" ref="order-count-down" bg-color="#FFFFFF"></u-count-down>
</view>
<view class="header-content">
<!-- 抓紧时间提示 -->
<view class="tip-text">{{tipText}}</view>
<!-- 拒单 -->
<view v-show="allowRejection" class="reject-button" @click="$u.throttle(rejectOrder, 500)">拒单</view>
</view>
</view>
<view class="content">
<!-- 订单详情 -->
<view class="card base-item">
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
</view>
<!-- 从我的页面进来显示计算信息 -->
<!-- 从我的页面进来显示结算信息 -->
<view v-if="isFromMine" class="settlement-view">
<view class="settlement-title">结算信息</view>
<view class="settlement-content">
......@@ -26,62 +37,32 @@
<text>{{settlementInfo.amount}}元</text>
</view>
</view>
<!-- 其他页面进来 -->
<!-- 不是从我的页面,而是其他页面进来 -->
<view v-else>
<!-- 业务文件 -->
<view class="order-file" v-if="showFile">
<view class="order-file-left">
<image :src="wenjianImage" class="file-image"></image>
<text>充电桩安装业务文件</text>
</view>
<view class="order-file-right" @click="$u.throttle(handleClickFile, 500)">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 时间选择 -->
<view class="card appoint-item" v-show="showTimeSelect">
<appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view>
<!-- 履约记录 -->
<view class="card record-item">
<Record :orderRecords="orderRecords"></Record>
</view>
</view>
</view>
<!-- 不是从我的页面进来不用显示 -->
<!-- 不是从我的页面进来才显示 -->
<template v-if="!isFromMine">
<view v-if="showCenterBtn" class="toolbar">
<!-- 背景,内容,请求接口 根据状态不同改变 {{operationDoing[order.orderStatus].background}} -->
<!-- 过程反馈 -->
<view class="left">
<view v-if="allowFeedback" @click="clickFeedback" class="button">
<text>反馈</text>
</view>
</view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view class="center">
<view>
<u-toast ref="uToast" />
</view>
<view v-if="showCenterBtn" @click="$u.throttle(handleClickSure, 500)" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime && showTimeOut" class="time-view">
<text style="padding-right: 8rpx;">{{order.currentOverTime > new Date().getTime()?'剩':'超'}}</text>
<u-count-down
:timestamp="timestampDiff(order.currentOverTime)"
font-size="20"
color="#FFFFFF"
bg-color="transparent"
separator-color="#FFFFFF"
separator-size="20"
:ref="'uCountDown'"
show-days
height="20"
:show-days="threeDays()"
:show-minutes="!threeDays()"
:show-seconds="!threeDays()"
:separator="threeDays() ? 'zh' : 'colon'"
@change="timeOutChange(order.currentOverTime)" >
</u-count-down>
</view>
</view>
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right">
<view v-if="errorSignIn || scenePhoto" @click="$u.throttle(handleClickRight, 500)" :class="['button', {'active': scenePhoto}]">
<text :style="errorSignIn ? 'font-size:24rpx' : ''">{{errorSignIn ? '异常\n签到' : '拍照'}}</text>
</view>
</view>
</view>
<BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons>
<take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo>
<!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> -->
<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
......@@ -102,6 +83,7 @@
import Customer from "@/components/mine/customer.vue"
import Record from "@/components/order/performanceRecord.vue"
import Detail from "@/components/order/detail.vue"
import BottomButtons from "@/components/order/bottomButtons.vue"
let now = new Date(new Date().toLocaleDateString()).getTime();
export default {
components: {
......@@ -110,11 +92,13 @@
// PopView,
Customer,
Record,
Detail
Detail,
BottomButtons
},
mixins: [baseFile],
data() {
return {
title: ' ',
readMore: true,
dateList: [
{day: now, timeRange: []},
......@@ -151,14 +135,13 @@
allowFeedback: false, // 允许过程反馈
needPhotograph: true, // 需要现场拍摄
centerButton: '', // 是否显示按钮
centerButtonText: '',
bottomButtonText: '',
orderRecords: [],
method: null,
showCenterBtn: false,
showBottomBtn: false,
showTimeSelect: false,
submitType: '',
nextUrl:'',
btnClass:'appoint-btn',
takeStatus:false,
errorSignIn:false,
scenePhoto: false,
......@@ -177,7 +160,10 @@
centerBtnDisabled:false,
isFromMine: false,
settlementInfo: {formatTime: '-', list: [], amount: ''},
unloaded: false
unloaded: false,
timeout: false,
timestamp: 0,
showFile: false, // 显示查看业务文件
}
},
onLoad(option) {
......@@ -186,6 +172,11 @@
if (option && option.id) {
this.orderId = option.id
}
if (option && option.title) {
this.title = decodeURIComponent(option.title)
} else {
this.title = "订单信息"
}
this.loadOrderDetail()
this.getLocation()
if (option && option.isFromMine) {
......@@ -207,11 +198,68 @@
this.closeLocationChange()
},
computed: {
centerButtonClass() {
let btnClass = "appoint-btn"
return btnClass
customStyle() {
return {
'height': '48rpx',
'width': '100rpx',
'color': '#FFFFFF',
'border-color': 'transparent',
'background-color': 'transparent'
}
},
tipText() {
switch (this.bottomButtonText) {
case '接单':
return this.timeout ? '您的订单已超时,请及时接单' : '请您注意剩余时间,及时接单'
case '预约':
return this.timeout ? '您的订单已超时,请及时预约' : '请您注意剩余时间,及时预约'
case '去完工':
return this.timeout ? '您的订单已超时,请及时完工' : '请您注意剩余时间,及时完工'
default:
return ''
}
},
buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: this.allowFeedback,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: this.errorSignIn,
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: this.scenePhoto,
disabled: false,
id: 3
},
{
label: this.bottomButtonText,
type: 'text',
image: '',
show: true,
disabled: this.centerBtnDisabled,
id: 0,
customStyle: {
'background-color': this.title == '待抢单' ? '#FF930D' : '#2272FF'
}
}]
},
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian.png'
},
},
methods: {
updateLocation(){
......@@ -232,7 +280,6 @@
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离
this.btnClass = "isGan-btn"
this.centerBtnDisabled = false
}else{
this.centerBtnDisabled = true
......@@ -285,13 +332,9 @@
if (res.code == 200) {
self.order = res.data
this.getCurrentBtn()
var nowTime = new Date();
if(this.showTimeOut && this.order.currentOverTime && nowTime.getTime() > this.order.currentOverTime){
this.btnClass='timeOut-btn'
}
// if(self.order.isFirstOrder){
// this.visible = true
// }
var nowTime = new Date().getTime();
this.timeout = this.order.currentOverTime && nowTime> this.order.currentOverTime
this.timestamp = Math.round(Math.abs(this.order.currentOverTime - nowTime) / 1000)
// 格式化时间
this.settlementInfo.formatTime = this.order.settleCenterSyncDatetime ? this.$u.timeFormat(this.order.settleCenterSyncDatetime, 'yyyy.mm.dd hh:MM:ss') : '-'
} else {
......@@ -439,54 +482,76 @@
var orderBusinessType = this.order.orderBusinessTypeText
if (orderStatus < 31 && orderBusinessType === '指派单') {
// 接单
this.showCenterBtn = true
this.centerButtonText = "接单"
this.showBottomBtn = true
this.bottomButtonText = "接单"
// 已派单的时显示拒单按钮
this.allowRejection = true
this.submitType = "orderAccept"
this.readMore = false
this.isAllowDianhuaAndDaohang = false
this.title = '待接单',
this.showFile = false
} else if (orderStatus < 31 && orderBusinessType === '订单池') {
// 抢单
this.centerButton = "appoint1"
this.centerButtonText = "抢单"
this.showCenterBtn = true
this.bottomButtonText = "抢单"
this.showBottomBtn = true
this.submitType = "orderGan"
this.showTimeOut=false
this.readMore = false
this.isAllowDianhuaAndDaohang = false
this.title = '待抢单',
this.showFile = false
} else if (orderStatus === 31 && !this.order.appointmentDatetime) {
// 预约
this.centerButton = "appoint2"
this.centerButtonText = "预约"
this.bottomButtonText = "预约"
this.allowFeedback = true
this.showCenterBtn = true
this.showBottomBtn = true
this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true
this.readMore = true
this.submitType = "workerAppointment"
this.title = '待预约',
this.showFile = true
this.loadCalendar()
} else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到
this.centerButton = "appoint3"
this.centerButtonText = "签到"
this.bottomButtonText = "签到"
this.allowFeedback = true
this.showCenterBtn = true
this.showBottomBtn = true
this.submitType = "maintainWorkerCheckin"
this.isAllowDianhuaAndDaohang = true
this.errorSignIn = true
this.title = '待签到',
this.showFile = true
// this.addressToCoordinate()
this.updateLocation()
} else if (orderStatus > 31 && orderStatus < 80) {
// 完工
this.centerButton = "filish"
this.centerButtonText = "去完工"
this.bottomButtonText = "去完工"
this.submitType = "toFilish"
this.allowFeedback = true
this.showCenterBtn = true
this.showBottomBtn = true
this.scenePhoto = true
this.readMore = true
this.isAllowDianhuaAndDaohang = true
this.title = '待完工',
this.showFile = true
}else if (orderStatus == 85 || orderStatus == 87) { // 审核中
this.isAllowDianhuaAndDaohang = true
this.title = '审核中',
this.showFile = true
} else if (orderStatus == 86 || orderStatus == 88) { // 异常单
this.isAllowDianhuaAndDaohang = true
this.title = '异常单',
this.showFile = true
} else if ([80, 81, 89, 110].indexOf(orderStatus) != -1) { // 已完工
this.isAllowDianhuaAndDaohang = true
this.title = '已完工',
this.showFile = true
} else {
this.isAllowDianhuaAndDaohang = true
}
......@@ -506,6 +571,24 @@
this.handleBtn()
}
},
handleSubmit(id) {
console.log(id)
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
switch (id) {
case 0:
this.handleClickSure()
break
case 1:
this.clickFeedback()
break
case 2:
this.take()
break
case 3:
this.scenePhotoClick()
break
}
},
handleBtn() {
console.log('click button')
if(!this.submitType){
......@@ -571,7 +654,7 @@
|| (res.code!==undefined && res.code === 200) ) {
this.trackOrder()
this.$refs.uToast.show({
title: this.centerButtonText + '操作成功',
title: this.bottomButtonText + '操作成功',
type: 'success',
duration: 1000,
callback : function(){
......@@ -596,6 +679,10 @@
})
}
})
},
// 去业务材料页面
handleClickFile() {
},
trackOrder() {
// 接单成功事件,签到成功事件
......@@ -615,14 +702,14 @@
})
},
isGan(){
this.centerButtonText = "已被抢"
this.bottomButtonText = "已被抢"
this.submitType = ""
this.btnClass='isGan-btn'
this.centerBtnDisabled = true
},
clickFeedback(){
// 过程反馈
uni.navigateTo({
url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.centerButtonText != '预约' ? '1' : '0')
url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.bottomButtonText != '预约' ? '1' : '0')
})
},
filish(){
......@@ -703,23 +790,14 @@
Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
},
timestampDiff(currentOverTime){ // 计算超时时间
if(!currentOverTime){
return 0
}
return Math.round(Math.abs(this.order.currentOverTime - new Date().getTime()) / 1000);
},
timeOutChange(currentOverTime){
let self = this
var nowTime = new Date(); // 当前时间
if(currentOverTime && nowTime.getTime() > currentOverTime){
if(this.centerBtnDisabled === false && this.submitType === 'maintainWorkerCheckin'){
this.btnClass = "isGan-btn"
}else{
this.btnClass='timeOut-btn'
}
this.$refs['uCountDown'].seconds += 2
}
timeOutChange(timestamp){
if (this.timeout) this.$refs['order-count-down'].seconds += 2
if (timestamp == 0 && !this.timeout) { // 超时之后倒计时变为正计时
setTimeout(()=> {
this.timestamp = 1
this.timeout = true
}, 1000)
}
},
// handleClick(){
// this.visible = false
......@@ -732,9 +810,6 @@
this.visible = false
// 添加客服
},
threeDays() {
return this.timestampDiff(this.order.currentOverTime) > 3600 * 24 * 3
}
}
};
</script>
......@@ -752,26 +827,37 @@
flex-direction: column;
.header {
padding: 30rpx 30rpx 46rpx 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.title {
line-height: 40rpx;
font-size:40rpx;
color:#fff;
padding: 4rpx 32rpx 14rpx 32rpx;
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 12rpx;
.tip-text {
font-size: 26rpx;
color: #EFEFEF;
}
.reject-button {
text-align: center;
width: 106rpx;
height: 52rpx;
border-radius: 40rpx;
font-size: 24rpx;
font-weight: 400;
line-height: 52rpx;
color: #DEDEDE;
text-align: right;
}
}
.button {
text-align: center;
width: 106rpx;
height: 52rpx;
border-radius: 40rpx;
font-size: 24rpx;
font-weight: 400;
line-height: 52rpx;
color: #DEDEDE;
.title {
display: flex;
align-items: center;
.bottom-tag-view {
color: #FFFFFF;
font-size: 40rpx;
margin-right: 10rpx;
}
}
}
......@@ -779,9 +865,7 @@
height: 100%;
border-radius: 12rpx;
overflow: auto;
margin-right: 30rpx;
margin-left: 30rpx;
margin-bottom: 30rpx;
margin: 6rpx 30rpx 30rpx 30rpx;
.card {
background-color: #FFFFFF;
......@@ -911,4 +995,30 @@
}
}
}
.order-file {
display: flex;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
border-radius: 12rpx;
background-color: #FFFFFF;
padding: 24rpx 30rpx;
.order-file-left {
color: #333333;
font-size: 26rpx;
display: flex;
align-items: center;
.file-image {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
}
.order-file-right {
color: #2272FF;
font-size: 26rpx;
}
}
</style>
......@@ -38,14 +38,14 @@ const setOpenid = function (openid) {
function validImages(imgurl) {
return new Promise((resolve, reject) => {
uni.getImageInfo({
src: imgurl,
success (res) {
resolve(true)
},
fail () {
reject(false)
}
})
src: imgurl,
success(res) {
resolve(true)
},
fail() {
reject(false)
}
})
})
}
......@@ -58,7 +58,6 @@ function validImages(imgurl) {
const imageCache = async function (vm, src, host) {
host = host || process.uniEnv.qn_base_url
let image_url = host + src
return image_url // 临时
let image_name = md5Libs.md5(image_url)
var arr = Object.keys(vm.vuex_cache);
const result = await validImages(vm.vuex_cache[image_name])
......@@ -70,7 +69,6 @@ const imageCache = async function (vm, src, host) {
url: image_url,
success: (res) => {
if (res.statusCode === 200) {
// call_back(res.tempFilePath)
vm.$u.vuex(`vuex_cache.${image_name}`, res.tempFilePath)
}
}
......
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