Commit 0c64de08 authored by zhengzy's avatar zhengzy

Merge remote-tracking branch 'origin/dev'

# Conflicts:
#	.env.js
#	src/pages/index/learn.vue
#	src/pages/learn/news-details.vue
#	src/pages/order/detail.vue
parents 1d0da773 654c1b4c
......@@ -106,7 +106,7 @@ export default {
},
getSystemInfo() {
try {
let a = wx.getSystemInfoSync();
let a = this.$u.sys();
this.globalData.navHeight =
(a.statusBarHeight / a.screenWidth) * 750 + 90;
this.globalData.rpxScreenHeight =
......@@ -116,9 +116,6 @@ export default {
} catch (a) {}
},
async getBaseInfo(vm, callBack) {
// uni.showLoading({
// title: "加载中……",
// });
const res = await vm.$u.api.getSettleBaseInfo();
if (res.code !== 200) {
return false;
......@@ -131,7 +128,6 @@ export default {
if (typeof callBack == "function") {
callBack(vm, res.data);
}
// uni.hideLoading();
return res.data;
},
......
<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>
<template>
<view class="card base-item">
<view class="top-item">
<view class="left">
<view :class="['tag', {'active': order.orderServiceType == '安装'}]">{{ order.orderServiceType }}</view>
<text class="title">{{ order.categoryName }}</text>
</view>
<view class="right">{{ order.orderBusinessTypeText }}</view>
</view>
<view class="order-cell">
<text>工单编号:</text>
<text>{{ order.orderNumber }}</text>
</view>
<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">
<text>客户信息:</text>
<text>{{ order.contactName }}</text>
</view>
<image v-if="showOperate" style="width: 84rpx;height: 56rpx;" :src="phoneIcon"
@click="phoneToCustomer(order.contactPhone)">
</image>
</view>
<view class="order-cell">
<text>联系方式:</text>
<text>{{ order.contactPhone }}</text>
</view>
<view class="between-cell address-cell">
<view class="left-address">
<u-icon name="map" size="28"></u-icon>
<text class="address-txt">{{ formatAddress }}</text>
</view>
<image v-if="showOperate" style="width: 84rpx;height: 56rpx;" :src="navigationIcon"
@click="openLocation(order.contactAddress)"></image>
</view>
<view v-if="readMore" @click="handleClick(false)" class="read-more-toggle">
<u-icon name="arrow-down"></u-icon>
<text class="read-more-text">查看更多</text>
</view>
<view v-else class="order-item-more">
<view class="line-view"></view>
<view class="order-cell between-cell">
<text class="cell-title">品牌:</text>
<text>{{ order.brandName }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">数量:</text>
<text>x{{ order.orderProductCount }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">充电桩信息:</text>
<text>{{ order.serviceContent }}</text>
</view>
<view class="read-more-toggle" @click="handleClick(true)">
<u-icon name="arrow-up"></u-icon>
<text class="read-more-text">点击收起</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
// 履约记录
order: {
type: Object,
default () {
return {}
}
},
// true 显示「查看更多」按钮, false 显示「点击收起」按钮
readMore: {
type: Boolean,
default: true
},
// 可以点击电话和地址
operate: {
type: Boolean,
default: true
},
// 显示点击电话和地址
showOperate: {
type: Boolean,
default: true
}
},
data() {
return {}
},
computed: {
formatAddress() {
let self = this
let address = ""
if (self.order) {
address = self.order.contactProvinceText || ""
address += self.order.contactCityText || ""
address += self.order.contactCommunityText || ""
address += self.order.contactStreetText || ""
address += self.order.contactAddress || ""
}
return address
},
phoneIcon() {
//self-support/icon/dianhua-0@2x.png
if (this.operate) {
return process.uniEnv.qn_base_url + 'dianhua.png'
} else {
return process.uniEnv.qn_base_url + 'dianhua-d.png'
}
},
navigationIcon() {
//self-support/icon/daohang-0@2x.png
if (this.operate) {
return process.uniEnv.qn_base_url + 'daohang.png'
} else {
return process.uniEnv.qn_base_url + 'daohang-d.png'
}
},
},
methods: {
openLocation(address) {
if (this.operate) {
const latitude = this.order.contactAddressLatitud //res.latitude;
const longitude = this.order.contactAddressLongitud //res.longitude;
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function() {
console.log('success');
}
});
}
},
phoneToCustomer(phone) { // 联系客户
if (this.operate) {
uni.makePhoneCall({
phoneNumber: phone, //仅为示例
complete() {}
});
this.contactTime()
}
},
contactTime() {
let self = this
var data = {}
if (this.submitType === "workerAppointment") {
self.$u.api.contactTime(data, this.order.orderId)
}
},
handleClick(val) {
this.$emit('update:readMore', val)
}
}
}
</script>
<style lang="scss" scoped>
.base-item {
padding-bottom: 6rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
// padding: 30rpx 30rpx 0 30rpx;
border-radius: 6px;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.title {
margin-left: 20rpx;
height: 36rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
.right {
text-align: center;
width: 100rpx;
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
font-size: 22rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
}
}
.address-cell {
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 24rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-address {
display: flex;
align-items: flex-start;
.address-txt {
line-height: 30rpx;
margin-left: 8rpx;
margin-right: 30rpx;
}
}
}
}
.read-more-toggle {
text-align: center;
color: #2272FF;
font-size: 26rpx;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.read-more-text {
padding-left: 8rpx;
}
.order-item-more {
font-size: 26rpx;
color: #333333;
text-align: right;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin-bottom: 20rpx;
}
}
.order-cell {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 48rpx;
margin-bottom: 10rpx;
}
.between-cell {
display: flex;
justify-content: space-between;
align-items: center;
}
.display-cell {
display: flex;
}
.cell-title {
text-align: left;
flex-shrink: 0;
}
</style>
......@@ -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,14 +281,14 @@
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
if (timestamp == 0 && !this.timeout) {
if (timestamp == 0 && !this.timeout) { // 超时之后倒计时变为正计时
setTimeout(()=> {
this.timestamp = 1
this.timeout = true
......
<template>
<view class="order-record-view">
<view class="top-item">
<text>履约记录</text>
</view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</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 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>
</view>
</view>
<view class="right-view">
<view class="line-view-top">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.exception?'异常':''}}</text>
<text style="color: #2272FF;" v-show="record.isTrace">跟进</text>
</view>
<view class="line-view-item">
<view>
<text>{{record.operationTypeText}}</text>
</view>
<view class="item-operation-view" v-show="record.isTrace">
<text class="item-label" >{{record.traceLabel + ":"}}</text>
<text class="item-content">{{record.traceTime}}</text>
</view>
<view class="item-operation-view" v-show="record.operationContent">
<text class="item-label">备注:</text>
<text class="item-content">{{ record.operationContent }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view v-if="orderRecords && orderRecords.length > showLenght" @click="readMoreRecord = !readMoreRecord">
<view v-if="readMoreRecord" class="read-more-toggle">
<u-icon name="arrow-down"></u-icon>
<text class="read-more-text">查看更多</text>
</view>
<view v-else class="read-more-toggle">
<u-icon name="arrow-up"></u-icon>
<text class="read-more-text">点击收起</text>
</view>
</view>
<view v-else style="height: 10rpx;"></view>
</view>
</view>
</template>
<script>
export default {
props: {
// 履约记录
orderRecords: {
type: Array,
default () {
return []
}
},
},
data() {
return {
readMoreRecord: true,
showLenght: 5,
}
},
computed: {
showOrderRecords() {
if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) {
return this.orderRecords.slice(0, this.showLenght)
} else {
return this.orderRecords
}
},
},
}
</script>
<style lang="scss" scoped>
.order-record-view {
.top-item {
font-size: 32rpx;
color: #333333;
font-weight: bold;
margin-bottom: 20rpx;
}
.no-record-view {
font-size: 26rpx;
color: #333333;
padding-bottom: 30rpx;
}
.record-list-view {
position: relative;
&.short {
padding-bottom: 30rpx;
}
.record-right-view {
position: relative;
display: flex;
justify-content: space-between;
.dashed-line-view {
position: absolute;
width: 2rpx;
border-left: 1px dashed #2272FF;
height: 100%;
top: 14rpx;
left: 11rpx;
}
.order-list {
width: 100%;
.order-cell {
margin-top: 50rpx;
display: flex;
&.first {
margin-top: 0;
}
.node-view {
margin-right: 18rpx;
flex-shrink: 0;
margin-top: 8rpx;
z-index: 1;
.node-border-view {
border: 2rpx solid #2272FF;
border-radius: 11rpx;
width: 22rpx;
height: 22rpx;
// display: flex;
// align-items: center;
// justify-content: center;
padding: 5rpx;
background-color: #FFFFFF;
.node-middle-view {
width: 10rpx;
height: 10rpx;
background-color: #2272FF;
border-radius: 6rpx;
}
}
}
.right-view {
width: 100%;
.line-view-top {
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
font-weight: bold;
font-size: 28rpx;
}
.line-view-item {
color: #666666;
font-size: 26rpx;
margin-top: 10rpx;
.item-operation-view {
margin-top: 20rpx;
.item-label {
color: #2272FF;
}
.item-content {
word-break: break-all;
}
}
}
}
}
}
}
}
.read-more-toggle {
text-align: center;
color: #2272FF;
font-size: 26rpx;
padding-top: 30rpx;
padding-bottom: 30rpx;
}
.read-more-text {
padding-left: 8rpx;
}
.order-item-more {
font-size: 26rpx;
color: #333333;
text-align: right;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin-bottom: 20rpx;
}
}
}
</style>
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,15 +26,15 @@
"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
}
},
......@@ -47,8 +46,9 @@
"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,53 @@
{
"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"
}
},
{
"path": "document",
"style": {
"navigationBarTitleText": "资料文件",
"navigationStyle": "custom",
"enablePullDownRefresh": false
// "disableScroll": true
}
}
]
},
......@@ -340,22 +341,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 +367,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 +391,7 @@
"path": "index",
"style": {
"navigationBarTitleText": "入驻",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -436,7 +437,7 @@
"path": "sign-contract",
"style": {
"navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationStyle": "custom",
"disableScroll": true
}
},
......@@ -454,7 +455,11 @@
"preloadRule": {
"pages/index/index": {
"network": "all",
"packages": ["pages/order", "pages/learn", "pages/mine"]
"packages": [
"pages/order",
"pages/learn",
"pages/mine"
]
}
},
"globalStyle": {
......
......@@ -4,7 +4,7 @@
<scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" enable-back-to-top>
@refresherrestore="onRestore" enable-back-to-top>
<!-- <TabBarPage title="扳手会"> -->
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
......@@ -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() {
......
......@@ -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,11 +43,12 @@
export default {
data() {
return {
qnPath: process.uniEnv.qn_base_url,
serviceTel: '18124099271',
showSuperButton: false,
show: false,
content: '是否确认退出该账户?'
content: '是否确认退出该账户?',
wodebeijingImage: '',
placeholderImage: ''
}
},
computed: {
......@@ -122,12 +123,6 @@
headImageUrl() {
return this.avatar || this.placeholderImage
},
wodebeijingImage() {
return util.imageCache(this, 'wodebeijing.png')
},
placeholderImage() {
return util.imageCache(this, 'touxiang.png')
},
headImageStyle() {
return this.avatar ? 'width:136rpx; height:136rpx;border-radius:68rpx' : 'width:144rpx; height:144rpx;border-radius:72rpx'
},
......@@ -135,7 +130,7 @@
return this.avatar ? 136 : 144
}
},
onLoad() {
async onLoad() {
app.trackPage('我的首页')
if(this.vuex_token ) {
if (!this.showSuperButton) {
......@@ -146,9 +141,13 @@
this.getData()
}
}
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="">
<!-- <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>
......@@ -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
......@@ -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">
<view class="pg-complete">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" :pass="pass" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check>
<view class="u-wrap">
<view class="com-content">
<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">
<u-tabs class="order-tabs" ref="tabs" :current="current" name="panelName" :list="tabList" @change="swichMenu" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs>
<view class="u-menu-wrap">
<!-- <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>
</scroll-view> -->
<scroll-view :scroll-top="scrollRightTop" style="height: 100%;" 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>
<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] || ""'
<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">
</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>
<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>
</view>
</template>
</u-form>
</scroll-view>
</template>
</u-form>
</scroll-view>
</view>
<view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]">
<u-button class="btn-submit" @click="saveComplete"
......@@ -125,10 +124,11 @@
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 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 baseFile from '@/components/upload/index'
import Detail from "@/components/order/detail.vue"
// import XhRadio from '@/components/createCom/XhRadio.vue'
export default {
data() {
......@@ -174,7 +174,7 @@
takeStatus: false,
currentItemDate:{},
photoItem: {},
showTab: true
// showTab: true,
}
},
components: {
......@@ -191,6 +191,7 @@
XhServiceMeasure,
XhServiceMore,
XhLabel,
Detail,
'take-photo': takePhoto
},
mixins: [baseFile],
......@@ -200,13 +201,20 @@
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 == '挚达充电桩'
if (option.pageIndex) {
this.tabIndex = option.pageIndex
uni.setNavigationBarTitle({
title: this.title
});
}
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 =item.partnerCompanyName == '挚达充电桩'
} else {
this.orderId = 11880091
this.categoryId = 1100000214
......@@ -223,6 +231,15 @@
//console.log(this.form.name, 'form.name')
},
computed: {
pageTitles() {
return ['勘察信息', '完工信息', '基本信息']
},
title() {
return this.pageTitles[this.tabIndex]
},
tabList() { // 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0 ? this.list[this.tabIndex].items : [{name:''}]
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
......@@ -363,7 +380,7 @@
}
}
this.list = res.data.config
this.showTab = this.list.length > 1
// this.showTab = this.list.length > 1
this.form = res.data.value || {}
// 异常单处理
if (this.auditResultsId) this.checkCompleteError()
......@@ -833,7 +850,7 @@
// ---------------------------- 表单样式end ----------------------------
.u-wrap {
.com-content{
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
......@@ -856,16 +873,17 @@
}
.u-menu-wrap {
flex: 1;
// flex: 1;
height: 100%;
display: flex;
overflow: hidden;
overflow: auto;
// overflow: hidden;
border-radius: 12rpx 12rpx 0 0;
&.one {
border-radius: 0;
}
}
.detail-view {
border-radius: 12rpx;
margin: 30rpx;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
......
<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">
<<<<<<< HEAD
<view class="top-item">
<view class="left">
<view :class="['tag', {'active': order.orderServiceType == '安装'}]">{{ order.orderServiceType }}</view>
......@@ -75,8 +87,11 @@
</view>
</view>
<!-- </u-read-more> -->
=======
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
>>>>>>> origin/dev
</view>
<!-- 从我的页面进来显示计算信息 -->
<!-- 从我的页面进来显示结算信息 -->
<view v-if="isFromMine" class="settlement-view">
<view class="settlement-title">结算信息</view>
<view class="settlement-content">
......@@ -93,97 +108,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 order-item record-item">
<view class="top-item">
<text class="title">履约记录</text>
<!-- 履约记录 -->
<view class="card record-item">
<Record :orderRecords="orderRecords"></Record>
</view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view>
<view v-else>
<view class="record-line-view">
<view class="order-cell display-cell" v-for="(record,index) in shwoOrderRecords" :key="record.operationContent">
<view class="node-view"></view>
<view class="line-view-left">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd \n hh:MM:ss')}} </text>
</view>
<view class="line-view-right">
<view>
<text>{{record.operationTypeText}}</text>
<text style="color: red;">{{record.overTime?'(超时)':''}}{{record.exception?'(异常)':''}}</text>
<text style="color: #2272FF;" v-show="record.operationType==='报备' || record.operationType==='改约'">(跟进)</text>
</view>
<view v-show="record.operationType==='报备' || record.operationType==='预约'|| record.operationType==='改约'">
<text>{{record.operationType==='报备' ? '下次联系时间:' : record.operationType==='改约'?'改约时间:': ''}}</text>
<text style="color: #2272FF;word-break: break-all;">{{record.orderRecordRemark}}</text>
</view>
</view>
</view>
</view>
<view v-if="orderRecords && orderRecords.length > showLenght">
<view v-if="readMoreRecord" @click="readMoreRecord = false" class="read-more-toggle">
<u-icon name="arrow-down"></u-icon>
<text class="read-more-text">查看更多</text>
</view>
<view v-else class="read-more-toggle">
<u-icon name="arrow-up"></u-icon>
<text class="read-more-text" @click="readMoreRecord = true">点击收起</text>
</view>
</view>
<view v-else style="height: 10rpx;"></view>
</view>
</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"
......@@ -202,21 +152,25 @@
// import PopView from "@/components/popView/index.vue"
import baseFile from '@/components/upload/index'
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: {
appointTime,
'take-photo': takePhoto,
// PopView,
Customer
Customer,
Record,
Detail,
BottomButtons
},
mixins: [baseFile],
data() {
return {
title: ' ',
readMore: true,
readMoreRecord: true,
showLenght: 5,
dateList: [
{day: now, timeRange: []},
{day: now + (1*86400000), timeRange: []},
......@@ -252,14 +206,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,
......@@ -278,7 +231,10 @@
centerBtnDisabled:false,
isFromMine: false,
settlementInfo: {formatTime: '-', list: [], amount: ''},
unloaded: false
unloaded: false,
timeout: false,
timestamp: 0,
showFile: false, // 显示查看业务文件
}
},
onLoad(option) {
......@@ -287,6 +243,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) {
......@@ -308,61 +269,70 @@
this.closeLocationChange()
},
computed: {
phoneIcon() {
//self-support/icon/dianhua-0@2x.png
if(this.isAllowDianhuaAndDaohang){
return process.uniEnv.qn_base_url + 'dianhua.png'
}else{
return process.uniEnv.qn_base_url + 'dianhua-d.png'
customStyle() {
return {
'height': '48rpx',
'width': '100rpx',
'color': '#FFFFFF',
'border-color': 'transparent',
'background-color': 'transparent'
}
},
navigationIcon() {
//self-support/icon/daohang-0@2x.png
if(this.isAllowDianhuaAndDaohang){
return process.uniEnv.qn_base_url + 'daohang.png'
}else{
return process.uniEnv.qn_base_url + 'daohang-d.png'
tipText() {
switch (this.bottomButtonText) {
case '接单':
return this.timeout ? '您的订单已超时,请及时接单' : '请您注意剩余时间,及时接单'
case '预约':
return this.timeout ? '您的订单已超时,请及时预约' : '请您注意剩余时间,及时预约'
case '去完工':
return this.timeout ? '您的订单已超时,请及时完工' : '请您注意剩余时间,及时完工'
default:
return ''
}
},
centerButtonClass() {
let btnClass = "appoint-btn"
return btnClass
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'
}
}]
},
shwoOrderRecords() {
if (this.readMoreRecord && this.orderRecords && this.orderRecords.length>0) {
return this.orderRecords.slice(0, 5)
} else {
return this.orderRecords
}
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian.png'
},
formatAddress() {
let self = this
let address = ""
if(self.order) {
address = self.order.contactProvinceText || ""
address += self.order.contactCityText || ""
address += self.order.contactCommunityText || ""
address += self.order.contactStreetText || ""
address += self.order.contactAddress || ""
}
return address
}
},
methods: {
openLocation(address){
if(this.isAllowDianhuaAndDaohang){
const latitude = this.order.contactAddressLatitud //res.latitude;
const longitude =this.order.contactAddressLongitud //res.longitude;
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function () {
console.log('success');
}
});
}
},
updateLocation(){
let self = this
wx.startLocationUpdate({
......@@ -381,7 +351,6 @@
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离
this.btnClass = "isGan-btn"
this.centerBtnDisabled = false
}else{
this.centerBtnDisabled = true
......@@ -395,23 +364,6 @@
console.log("closeLocationChange")
wx.offLocationChange(this._locationChangeFn);
},
phoneToCustomer(phone){ // 联系客户
if(this.isAllowDianhuaAndDaohang){
uni.makePhoneCall({
phoneNumber: phone ,//仅为示例
complete() {
}
});
this.contactTime()
}
},
contactTime() {
let self = this
var data={}
if(this.submitType === "workerAppointment"){
self.$u.api.contactTime(data,this.order.orderId)
}
},
handleClickRight(active) {
this.scenePhoto ? this.scenePhotoClick() : this.take()
},
......@@ -451,13 +403,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 {
......@@ -500,16 +448,26 @@
self.$u.api.listOrderRecord(param).then((res) => {
if (res.code == 200) {
res.data.forEach(item =>{
if(item.operationType === '预约'){
item.operationTypeText = '上门时间'
}else if (item.operationType === '报备' || item.operationType === '改约'){
item.isTrace = false
item.traceTime = null
item.traceLabel = item.operationType
if (item.operationType === '报备' || item.operationType === '改约'){
item.isTrace = true
item.traceLabel = item.operationType === '报备' ? '下次联系时间' : '改约时间'
item.operationTypeText = item.operationType
item.traceTime = item.orderRecordRemark
let arr = item.orderRecordRemark.split(',')
item.operationTypeText = arr[0]
if(arr.length > 1){
item.orderRecordRemark = arr[1].substring(arr[1].indexOf(':')+1,arr[1].length)
if(arr && arr.length > 1) {
let remark = arr[1].substring(arr[1].indexOf(':')+1,arr[1].length)
item.traceTime = remark
item.operationTypeText = arr[0]
}
}else{
item.operationTypeText = item.operationType + '时间'
} else if(item.operationType === '预约') {
let remark = item.orderRecordRemark.substring(item.orderRecordRemark.lastIndexOf(",")+1);
item.traceTime = remark
item.operationTypeText = `上门 ${remark}`
} else {
item.operationTypeText = item.operationType
}
})
self.orderRecords = res.data
......@@ -595,54 +553,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
}
......@@ -662,6 +642,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){
......@@ -727,7 +725,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(){
......@@ -752,6 +750,10 @@
})
}
})
},
// 去业务材料页面
handleClickFile() {
},
trackOrder() {
// 接单成功事件,签到成功事件
......@@ -771,18 +773,19 @@
})
},
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(){
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+this.order.orderId
+ "&categoryId=" + this.order.categoryId
......@@ -857,23 +860,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
......@@ -886,9 +880,6 @@
this.visible = false
// 添加客服
},
threeDays() {
return this.timestampDiff(this.order.currentOverTime) > 3600 * 24 * 3
}
}
};
</script>
......@@ -906,26 +897,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;
}
}
}
......@@ -933,9 +935,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;
......@@ -944,179 +944,6 @@
border-radius: 6px;
}
.base-item {
padding-bottom: 6rpx;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.title {
margin-left: 20rpx;
height: 36rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
.right {
text-align: center;
width: 100rpx;
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
font-size: 22rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
}
}
.address-cell {
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 24rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-address {
display: flex;
align-items: flex-start;
.address-txt {
line-height: 30rpx;
margin-left: 8rpx;
margin-right: 30rpx;
}
}
}
}
.read-more-toggle {
text-align: center;
color: #2272FF;
font-size: 26rpx;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.read-more-text {
padding-left: 8rpx;
}
.order-item-more {
font-size: 26rpx;
color: #333333;
text-align: right;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin-bottom: 20rpx;
}
}
.order-item {
padding-bottom: 6rpx;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
height: 32rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
.no-record-view {
font-size: 26rpx;
color: #333333;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.record-line-view {
padding-left: 30rpx;
position: relative;
margin-left: 6rpx;
}
.line-view-left {
width: 170rpx;
flex-shrink: 0;
}
.line-view-right {
// text-align: right;
}
.record-line-view ::before {
content: " ";
position: absolute;
left: 0;
top: 20rpx;
width: 1px;
bottom: 20rpx;
border-left: 1px dashed #2272FF;
transform-origin: 0 0;
transform: scaleX(0.5);
}
.node-view {
margin-top: 16rpx;
position: absolute;
left: -3px;
background-color: #2272FF;
border-radius: 7rpx;
width: 14rpx;
height: 14rpx;
z-index: 1;
}
// .address-cell {
// height: 24rpx;
// font-size: 24rpx;
// font-weight: 400;
// color: #333333;
// line-height: 24rpx;
// .left {
// .address-txt {
// margin-left: 8rpx;
// }
// }
// }
}
.record-item {
margin-bottom: 0rpx;
}
......@@ -1217,28 +1044,6 @@
}
}
// 页面公用css
.order-cell {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 48rpx;
margin-bottom: 10rpx;
}
.between-cell {
display: flex;
justify-content: space-between;
align-items: center;
}
.display-cell {
display: flex;
}
.cell-title {
text-align: left;
flex-shrink: 0;
}
.settlement-view {
padding: 30rpx;
background-color: #FFFFFF;
......@@ -1260,4 +1065,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>
<template>
<view class="doc-wrap">
<u-navbar title="资料文件" :border-bottom="false"/>
<view class="filter">
<u-icon class="filter-icon" name="bag" label="品牌" label-size="24"/>
<u-icon class="filter-icon" name="tags" label="品类" label-size="24"/>
</view>
<view class="content">
<view class="row" v-for="(item, index) in list" :key="index">
<view class="icon">
<u-icon name="file-text"></u-icon>
</view>
<view class="item">
<view class="title">
<view class="name">{{item.name}}</view>
<view class="desc">
<text>{{item.time | datefmt('YYYY-MM-DD')}}</text>
<text class="u-p-l-30">{{'来源:' + (item.from.join('、'))}}</text>
</view>
</view>
<view class="right">
<u-icon
class="opt-icon" name="share"
label="分享" label-pos="bottom"
label-color="#999999" label-size="24">
</u-icon>
<u-icon
class="opt-icon" name="order"
label="查看" label-pos="bottom"
label-color="#999999" label-size="24">
</u-icon>
</view>
</view>
</view>
<u-loadmore :status="status" margin-top="30"/>
<u-gap height="316"/>
</view>
</view>
</template>
<script>
let now = Date.now()
export default {
data() {
return {
list: [],
status: 'loadmore',
total: 0,
};
},
onLoad() {
console.log("onLoad===========");
this.loadDocuments()
},
onReachBottom() {
if(this.list.length >= this.total) return;
console.log("onReachBottom===========");
this.status = 'loading';
this.loadDocuments()
},
methods: {
loadDocuments() {
let data = [
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
]
this.total = 100
let newList = this.$u.deepMerge(this.list, data);
this.list = newList
console.log("loadDocuments===========");
if(newList.length >= this.total) this.status = 'nomore';
else this.status = 'loadmore';
},
}
};
</script>
<style lang="scss" scoped>
.doc-wrap {
background-color: #FFFFFF;
.filter {
padding-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
z-index: 2;
.filter-icon {
margin-right: 60rpx;
}
}
.content {
// height: 100vh;
// overflow: auto;
.row {
display: flex;
align-items: center;
.icon {
margin-left: 30rpx;
font-size: 56rpx;
color: #2272FF;
}
.item {
margin-left: 20rpx;
flex-basis: calc(100%);
align-items: center;
min-height: 108rpx;
display: flex;
justify-content: space-between;
border-bottom: 2rpx solid #F4F5F7;
.title {
word-break: break-all;
max-width: 460rpx;
.name {
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
.desc {
color: #666666;
font-size: 24rpx;
}
}
.right {
margin-right: 30rpx;
.opt-icon {
margin-left: 20rpx;
color: #999999;
}
}
}
}
}
}
</style>
......@@ -35,15 +35,18 @@ const setOpenid = function (openid) {
}
}
async function validImages(imgurl) {
let exists = false
await uni.getImageInfo({
src: imgurl,
success (res) {
exists = true
}
})
return exists
function validImages(imgurl) {
return new Promise((resolve, reject) => {
uni.getImageInfo({
src: imgurl,
success(res) {
resolve(true)
},
fail() {
reject(false)
}
})
})
}
/**
......@@ -52,14 +55,13 @@ async function validImages(imgurl) {
* @param {Object} src 图片地址
* @param {Object} host 图片前缀,默认使用qn_base_url
*/
const imageCache = function (vm, src, host) {
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);
if (vm.vuex_cache && arr.length && arr.includes(image_name) &&
validImages(vm.vuex_cache[image_name])) {
const result = await validImages(vm.vuex_cache[image_name])
if (vm.vuex_cache && arr.length && arr.includes(image_name) && result) {
return vm.vuex_cache[image_name]
} else {
// 本地没有缓存 需要下载
......@@ -67,7 +69,6 @@ const imageCache = 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