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;
}
}
}
This diff is collapsed.
......@@ -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()
......
This diff is collapsed.
This diff is collapsed.
<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