Commit a9854512 authored by 刘文虎's avatar 刘文虎
parents 7224a1b6 feb2c1d4
Pipeline #2818 canceled with stages
//吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息
function getPhoto(token, type = 2, count = 1, showLoading = true) {
return new Promise((resolve, reject) => {
let types = [['camera'], ['album'] , ['album', 'camera']]
let sourceType = types[type]
uni.chooseImage({
count: count, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, //从相册选择
success: function(res) {
if (showLoading) {
uni.showLoading({
title: '上传中...',
})
}
console.log('-------------:', res)
uploads(res.tempFiles, token)
.then((result) => {
let keys = []
let urls = []
if (result) {
for (var item of result) {
keys.push(item.key)
urls.push(item.url)
}
}
resolve({
key: keys,
files: urls
})
})
.catch((msg) => {
reject(msg)
})
// var state = 0 // 上传第几张图片
// var imgList = [] // 保存图片数组
// var uploadNum = res.tempFiles.length // 上传数组的长度
// //上传七牛
// for (let i = 0; i < uploadNum; i++) {
// let filePath = res.tempFiles[i].path //为需要上传的文件
// upload(filePath, token)
// .then((msg) => {
// //最后七牛返回的key
// state++
// imgList.push(msg)
// if (state == uploadNum) {
// resolve({
// key: imgList,
// files: res.tempFiles,
// })
// }
// })
// .catch((msg) => {
// reject(msg)
// })
// }
},
complete: function() {},
})
})
}
function uploadOneWHPhoto(token, type = 2, block) {
return new Promise((resolve, reject) => {
let types = [['camera'], ['album'] , ['album', 'camera']]
let sourceType = types[type]
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, //从相册选择
success: function(res) {
if (res.tempFilePaths.length > 0) {
let filePath = res.tempFilePaths[0]
uni.getImageInfo({
src: filePath,
success: function (image) {
var key = new Date().getTime() + Math.random(1000) + filePath.split('/').pop().replace(/\_/g, '') //key为自定义文件名
key = key.replace(/\.(?=.*\.)/g, '')
key = key.replace(/\./, `_${image.width}_${image.height}_.`)
if (block) block(filePath, key)
uni.uploadFile({
url: uploadUrl, // default ecn华北的地址,在七牛云中选择对应位置的网址
filePath: filePath,
name: 'file',
formData: {
token: token,
key: key,
},
complete: (res) => {
if (res.statusCode === 200) {
resolve(JSON.parse(res.data).key || JSON.parse(res.data).src)
} else {
reject(res.errMsg)
}
},
})
}
});
}
},
complete: function() {},
})
})
}
function uploads(list, token) {
return new Promise((resolve, reject) => {
var state = 0 // 上传第几张图片
var imgList = [] // 保存图片数组
var uploadNum = list.length // 上传数组的长度
//上传七牛
for (let i = 0; i < uploadNum; i++) {
let filePath = list[i].path || list[i].url //为需要上传的文件
upload(filePath, token)
.then((msg) => {
//最后七牛返回的key
state++
imgList.push({key: msg, url: filePath})
if (state == uploadNum) {
resolve(imgList)
}
})
.catch((msg) => {
reject(msg)
})
}
})
}
function uploadFiles(token, tempFilePaths, success, progress, error ) {
var count = 0 // 上传第几张图片
var fileList = []
var tasks = []
for (let i = 0; i < tempFilePaths.length; i++) {
let item = {...tempFilePaths[i]}
let filePath = item.path
var key = new Date().getTime() + Math.random(1000) + filePath.split('/').pop().replace(/\=/g, '') //key为自定义文件名
key = key.replace(/\.(?=.*\.)/g, '')
var task = uni.uploadFile({
url: uploadUrl, // default ecn华北的地址,在七牛云中选择对应位置的网址
filePath: filePath,
name: 'file',
formData: {
token: token,
key: key,
},
complete: (res) => {
if (res.statusCode === 200) {
fileList.push({path: filePath, url: JSON.parse(res.data).key || JSON.parse(res.data).src})
count++
if (count == tempFilePaths.length) {
success(fileList)
}
} else {
error(item,res.errMsg)
}
}
})
task.onProgressUpdate((res) => {
progress({...item, progress: res.progress, task: task})
});
tasks[i] = task
}
}
const uploadUrl = 'https://up-z2.qiniup.com'
//上传七牛
function upload(filePath, token, duration = '') {
return new Promise((resolve, reject) => {
var key = new Date().getTime() + Math.random(1000) + filePath.split('/').pop().replace(/\=/g, '') //key为自定义文件名
key = key.replace(/\.(?=.*\.)/g, '')
if (duration) key = key.replace(/\./, `durationTime=${duration * 1000}.`)
uni.uploadFile({
url: uploadUrl, // default ecn华北的地址,在七牛云中选择对应位置的网址
filePath: filePath,
name: 'file',
formData: {
token: token,
key: key,
},
complete: (res) => {
if (res.statusCode === 200) {
resolve(JSON.parse(res.data).key || JSON.parse(res.data).src)
} else {
reject(res.errMsg)
}
},
})
})
}
export default {
uploadUrl,
upload,
uploads,
getPhoto,
uploadOneWHPhoto,
uploadFiles
}
<template>
<view class="cell-card">
<template v-if="isGreen">
<view class="back-view" v-if="isGreen">
<image :src="image"></image>
</view>
<view class="content-view">
<view class="top-view">
<view class="title-view">{{ info.title }}</view>
</view>
<view class="name-view">{{ info.name }}</view>
<view class="info-view">
<view class="left-view">
<view class="item-view">
<view class="label-view">电话:</view>
<view class="value-view">{{ info.phone }}</view>
</view>
<view class="item-view">
<view class="label-view">地址:</view>
<view class="value-view">{{ info.address }}</view>
</view>
</view>
<view
class="right-view"
hover-class="u-hover-class"
@click="$u.throttle(previewQRCode, 500)"
>
<image :src="info.qrCode"></image>
</view>
</view>
</view>
</template>
<template v-else-if="isBlue">
<view class="content-view">
<view class="top-view top-blue">
<view class="title-view title-blue">{{ info.title }}</view>
<view
class="right-view"
hover-class="u-hover-class"
@click="$u.throttle(previewQRCode, 500)"
>
<image :src="info.qrCode"></image>
</view>
</view>
<view class="name-view">{{ info.name }}</view>
<view class="info-view">
<view class="left-view">
<view class="item-view">
<view class="label-view">电话:</view>
<view class="value-view">{{ info.phone }}</view>
</view>
<view class="item-view">
<view class="label-view">地址:</view>
<view class="value-view">{{ info.address }}</view>
</view>
</view>
</view>
</view>
</template>
<template v-else-if="isBlack">
<view class="content-view">
<view class="name-view name-black">{{ info.name }}</view>
<view class="info-view">
<view class="left-view">
<view class="item-view">
<view class="label-view">电话:</view>
<view class="value-view">{{ info.phone }}</view>
</view>
<view class="item-view">
<view class="label-view">地址:</view>
<view class="value-view">{{ info.address }}</view>
</view>
</view>
<view
class="right-view"
hover-class="u-hover-class"
@click="$u.throttle(previewQRCode, 500)"
>
<image :src="info.qrCode"></image>
</view>
</view>
</view>
<view class="bottom-view">
<view class="title-view">{{ info.title }}</view>
</view>
</template>
</view>
</template>
<script>
export default {
props: {
info: {
type: Object,
default() {
return {}
},
},
},
data() {
return {
loading: true,
}
},
computed: {
baseUrl() {
return process.uniEnv.qn_base_url
},
image() {
return this.baseUrl + 'muban1zhengmian@3x.png'
},
isGreen() {
return this.info.type == 'green'
},
isBlue() {
return this.info.type == 'blue'
},
isBlack() {
return this.info.type == 'black'
},
// green 绿;blue 蓝;black 黑;
settings() {
switch (this.info.type) {
case 'green':
return {
color: '#02A074',
}
case 'blue':
return {
color: '#2D60E7',
}
case 'black':
return {
color: '#FFFFFF',
backgroundColor: '#354255',
}
}
},
},
methods: {
previewQRCode() {
uni.previewImage({
urls: [this.info.qrCode],
current: 0,
longPressActions: {
success: function (data) {
console.log(
'选中了第' +
(data.tapIndex + 1) +
'个按钮,第' +
(data.index + 1) +
'张图片'
)
},
fail: function (err) {
console.log(err.errMsg)
},
},
})
},
},
}
</script>
<style scoped lang="scss">
.cell-card {
width: 100%;
height: 420rpx;
border-radius: 16rpx;
background-color: #ffffff;
position: relative;
overflow: hidden;
.back-view {
position: absolute;
top: 0;
right: 0;
height: 0;
width: 100%;
height: 100%;
}
.content-view {
position: relative;
margin-top: 8rpx;
.top-view {
display: flex;
justify-content: space-between;
align-items: center;
height: 136rpx;
font-size: 40rpx;
font-weight: bold;
padding: 0 32rpx;
.title-view {
}
}
.name-view {
margin: 24rpx 32rpx 0rpx 32rpx;
font-size: 28rpx;
color: #333333;
font-weight: bold;
}
.info-view {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 24rpx 32rpx 36rpx 32rpx;
.left-view {
.item-view {
display: flex;
align-items: flex-start;
color: #333333;
font-size: 24rpx;
margin-top: 8rpx;
.label-view {
width: 74rpx;
flex-shrink: 0;
}
.value-view {
}
}
}
}
.right-view {
width: 120rpx;
height: 120rpx;
margin-left: 50rpx;
flex-shrink: 0;
}
.top-blue {
margin-top: 40rpx;
.title-blue {
color: #2d60e7;
}
}
.name-black {
padding-top: 24rpx;
}
}
.bottom-view {
background-color: #354255;
position: absolute;
bottom: 0;
right: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
height: 136rpx;
font-size: 40rpx;
font-weight: bold;
padding: 0 32rpx;
color: #ffffff;
text-align: center;
}
}
</style>
<template>
<view class="cell-particular">
<view class="part-view">
<view
class="delete-view"
v-if="showDelete"
hover-class="u-hover-class"
@click="$u.throttle(handleClickDelete, 500)"
>删除</view
>
<view class="title-view">明细信息</view>
<view class="item-view">
<view class="label-view">工时/配件</view>
<view class="value-view">
<u-input
type="text"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="name"
placeholder="填写费用名称"
/>
</view>
</view>
<view class="line-view"></view>
<view class="item-view">
<view class="label-view">数量</view>
<view class="value-view">
<u-number-box color="#cccccc" size="28" v-model="number" bg-color="#ffffff"></u-number-box>
</view>
</view>
<view class="line-view"></view>
<view class="item-view">
<view class="label-view">单价</view>
<view class="value-view">
<u-input
type="digit"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="price"
placeholder="填写单价费用"
/>
</view>
</view>
<view class="line-view"></view>
<view class="item-view">
<view class="label-view">总价</view>
<view class="value-view">
<u-input
type="digit"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="all"
placeholder="填写总价费用"
/>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
showDelete: {
type: Boolean,
default: false,
},
defaultInfo: {
type: Object,
default() {
return {}
},
},
},
data() {
return {
name: '',
number: '',
price: '',
all: '',
}
},
watch: {
showDelete(val) {
console.log('------showDelete------', val)
},
name(value) {
this.handleChange('name', value)
},
number(value) {
this.handleChange('number', value)
},
price(value) {
this.handleChange('price', value)
},
all(value) {
this.handleChange('all', value)
},
},
computed: {
placeholderStyle() {
return 'color:#ccc;font-size:28rpx;font-weight: bold;'
},
customStyle() {
return {
fontSize: '28rpx',
textAlign: 'right',
fontWeight: 'bold',
}
},
},
created() {
this.name = this.defaultInfo.name
this.price = this.defaultInfo.price
this.number = this.defaultInfo.number
this.all = this.defaultInfo.all
},
methods: {
handleChange(key, value) {
this.$emit('change', { key: key, value: value })
},
handleClickDelete() {
console.log('(-----handleClickDelete-----)')
this.$emit('delete')
},
},
}
</script>
<style scoped lang="scss">
.cell-particular {
position: relative;
.delete-view {
position: absolute;
top: 16rpx;
right: 24rpx;
color: #fc524d;
font-size: 28rpx;
height: 44rpx;
margin-top: 16rpx;
width: 80rpx;
text-align: right
}
.part-view {
position: relative;
padding: 16rpx 24rpx;
background-color: #ffffff;
border-radius: 16rpx;
margin-top: 24rpx;
.title-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin: 16rpx 0 8rpx 0;
}
.item-view {
padding: 24rpx 0 8rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
.label-view {
color: #8d8d8d;
flex-shrink: 0;
}
.value-view {
font-weight: bold;
color: #333333;
text-align: right;
}
}
.line-view {
height: 2rpx;
background-color: #f6f7fa;
// margin: 16rpx 0;
}
}
}
</style>
<template>
<view class="cell-relation">
<view class="content-view">
<view class="left-view" @click="$u.throttle(handleClickMember, 500)">
<image
mode="aspectFill"
:src="member.avatar || defaultImage"
class="image-view"
></image>
<view class="name-view">{{ member.nickname }}</view>
</view>
<!-- <view class="text-view">{{ member.business }}</view> -->
<view class="time-view">{{ member.createTime }}</view>
</view>
</view>
</template>
<script>
export default {
props: {
member: {
type: Object,
default() {
return {}
},
},
bottomBorder: {
type: Boolean,
default: false
}
},
data() {
return {}
},
computed: {
baseUrl() {
return process.uniEnv.qn_base_url
},
defaultImage() {
return this.baseUrl + 'toxuiang@3x.png'
},
},
created() {},
methods: {
handleClickMember() {
this.$emit('click', this.member)
},
},
}
</script>
<style scoped lang="scss">
.cell-relation {
padding: 0 24rpx;
background-color: #2D3340;
.content-view {
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
color: #ffffff;
.left-view {
display: flex;
align-items: center;
flex-shrink: 0;
width: 260rpx;
.image-view {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
background-color: #ffffff;
}
.name-view {
margin-left: 16rpx;
width:176rpx;
flex-shrink: 0;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
// .text-view {
// width: 120rpx;
// flex-shrink: 0;
// }
.time-view {
flex: 1;
text-align: right;
}
}
}
</style>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<script> <script>
const sys = uni.getSystemInfoSync() const sys = uni.getSystemInfoSync()
const edgeWidth = 58
export default { export default {
props: { props: {
// 是否启用自动停靠 // 是否启用自动停靠
...@@ -49,8 +50,8 @@ export default { ...@@ -49,8 +50,8 @@ export default {
data() { data() {
return { return {
clicked: 1, clicked: 1,
top: sys.windowHeight - 58, top: sys.windowHeight - edgeWidth,
left: sys.windowWidth - 58, left: sys.windowWidth - edgeWidth,
width: 0, width: 0,
height: 0, height: 0,
offsetWidth: 0, offsetWidth: 0,
...@@ -135,7 +136,7 @@ export default { ...@@ -135,7 +136,7 @@ export default {
// #ifdef H5 // #ifdef H5
clientY += this.height clientY += this.height
// #endif // #endif
let edgeBottom = this.windowHeight - 58 let edgeBottom = this.windowHeight - edgeWidth
// 上下触及边界 // 上下触及边界
if (clientY < this.edge) { if (clientY < this.edge) {
......
<template> <template>
<u-navbar <u-navbar
:back-text="title" :title="title"
:title-color="titleColor"
:back-icon-color="backIconColor"
title-bold
:back-text="backText"
:back-text-style="backTextStyle" :back-text-style="backTextStyle"
:background="background" :background="background"
:border-bottom="false" :border-bottom="false"
> >
<view <view
v-if="text || image"
class="slot-wrap" class="slot-wrap"
slot="right" slot="right"
hover-class="u-hover-class" hover-class="u-hover-class"
@click="$u.throttle(handleClickRight, 500)" @click="$u.throttle(handleClickRight, 500)"
> >
<view v-if="image" class="image-view" :style="'width:' + imageWidth + 'rpx'"><image mode="widthFix" :src="image"></image></view> <view
v-if="image"
class="image-view"
:style="'width:' + imageWidth + 'rpx'"
><image mode="widthFix" :src="image"></image
></view>
<view>{{ text }}</view> <view>{{ text }}</view>
</view> </view>
</u-navbar> </u-navbar>
...@@ -24,16 +34,20 @@ export default { ...@@ -24,16 +34,20 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
backText: {
type: String,
default: '',
},
text: { text: {
type: String, type: String,
default: '导出账单', default: '',
}, },
image: { image: {
type: String, type: String,
default: '', default: '',
}, },
imageWidth: { imageWidth: {
type: [String,Number], type: [String, Number],
default: '24', default: '24',
}, },
background: { background: {
...@@ -42,10 +56,23 @@ export default { ...@@ -42,10 +56,23 @@ export default {
return { 'background-color': 'transparent' } return { 'background-color': 'transparent' }
}, },
}, },
backIconColor: {
type: String,
default: '#333333',
},
titleColor: {
type: String,
default: '#191C27',
},
backTextStyle: { backTextStyle: {
type: Object, type: Object,
default() { default() {
return { color: '#191C27', 'font-size': 'weight', 'font-size': '32rpx', 'margin-left': '8rpx' } return {
color: '#191C27',
'font-size': 'weight',
'font-size': '32rpx',
'margin-left': '8rpx',
}
}, },
}, },
}, },
......
<template> <template>
<u-upload <UploadImages
ref="upload-images"
:max-count="maxCount" :max-count="maxCount"
:width="width" :width="width"
:height="height" :height="height"
...@@ -7,9 +8,7 @@ ...@@ -7,9 +8,7 @@
:file-list="fileList" :file-list="fileList"
:auto-upload="autoUpload" :auto-upload="autoUpload"
:show-progress="false" :show-progress="false"
:deletable="deletable" :show-add="showAdd"
:show-upload-list="showUploadList"
:preview-full-image="previewFullImage"
@on-list-change="handleListChange" @on-list-change="handleListChange"
> >
<view <view
...@@ -19,16 +18,18 @@ ...@@ -19,16 +18,18 @@
:style="slotStyle" :style="slotStyle"
hover-stay-time="150" hover-stay-time="150"
> >
<u-icon name="plus" :size="addSize" color="#999999"></u-icon> <u-icon name="plus" :size="addSize" color="#D8D8D8"></u-icon>
</view> </view>
</u-upload> </UploadImages>
</template> </template>
<script> <script>
import upload from '@/utils/upload.js' import upload from '@/common/upload'
import {getQiNiuToken} from "@/api/common/index.js" import UploadImages from '@/components/upload/u-upload'
export default { export default {
components: {
UploadImages,
},
props: { props: {
// 给fileList赋初始值用 // 给fileList赋初始值用
list: { list: {
...@@ -65,22 +66,10 @@ export default { ...@@ -65,22 +66,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
hide:{ showAdd: {
type: Boolean, type: Boolean,
default: false default: true
}, },
deletable:{
type: Boolean,
default: true
},
previewFullImage:{
type: Boolean,
default: false
},
showUploadList:{
type: Boolean,
default: true
}
}, },
data() { data() {
return { return {
...@@ -172,10 +161,13 @@ export default { ...@@ -172,10 +161,13 @@ export default {
} }
}, },
getQiniuToken() { getQiniuToken() {
getQiNiuToken().then((res) => { // this.$u.api.getQiNiuToken().then((res) => {
this.qiniuToken = res // this.qiniuToken = res
}) // })
}, },
selectFile() { // 触发选择图片;不能改文件名,外部要调
this.$refs['upload-images'].selectFile()
}
}, },
} }
</script> </script>
......
This diff is collapsed.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"serve": "npm run dev:h5", "serve": "npm run dev:h5",
"build": "npm run build:h5", "build": "npm run build:h5",
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build", "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --minimize --watch", "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i" "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
}, },
"repository": { "repository": {
......
...@@ -241,13 +241,53 @@ ...@@ -241,13 +241,53 @@
} }
},{ },{
"path": "detail", "path": "detail",
"name": "maintain-bill", "name": "maintain-bill-detail",
"style": { "style": {
"navigationBarTitleText": "详情", "navigationBarTitleText": "详情",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
},{
"path": "create",
"name": "maintain-bill-create",
"style": {
"navigationBarTitleText": "填写",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},{
"path": "particulars",
"name": "maintain-bill-particulars",
"style": {
"navigationBarTitleText": "维修明细",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},{
"path": "show",
"name": "maintain-bill-show",
"style": {
"navigationBarTitleText": "客户确认",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
}]
},
{
"root": "pages/card",
"pages": [{
"path": "index",
"name": "visiting-card",
"style": {
"navigationBarTitleText": "电子名片",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
}] }]
}], }],
"globalStyle": { "globalStyle": {
......
<template>
<view class="visiting-card">
<NavbarRight title="电子名片" imageWidth="20" />
<view class="content-view">
<view class="card-view">
<view class="no-card" v-if="!info.card">
<view
class="add-item-button"
hover-class="u-hover-class"
@click="$u.throttle(handleClickAdd, 500)"
>
<u-icon name="plus" color="#02A074" size="36"></u-icon>
<view class="add-text">添加明细</view>
</view>
</view>
<template v-else>
<view class="card-content">
<Card :info="info.card"/>
</view>
<view class="tool-view">
<view
class="item-view"
v-for="(item, index) in toolInfos"
:key="index"
hover-class="u-hover-class"
@click="handleClickTool(index)"
>
<view class="image-view">
<image :src="item.image"></image>
</view>
<view>{{ item.text }}</view>
</view>
</view>
</template>
</view>
<view class="detail-view">
<view class="info-view">
<view class="item-view" v-for="(item, key) in infoKeys" :key="key">
<template v-if="key.indexOf('0') == -1">
<view hover-class="u-hover-class" @click="handleChangeList(key)">
<view class="count-view">{{ info[key] }}</view>
<view>{{ item }}</view>
</view>
<view class="mark-view">
<image v-if="currentKey == key" :src="markImage"></image>
</view>
</template>
<view class="line-view-column" v-else></view>
</view>
</view>
<view class="list-view">
<view
class="list-content"
v-if="currentList && currentList.length > 0"
></view>
<NoData
v-else-if="!loading"
customStyle="margin-top:0rpx;height:510rpx"
:image="noDataImage"
text="当前暂无相关信息"
/>
</view>
</view>
</view>
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right'
import NoData from '@/components/no-data'
import Card from '@/components/cell-card'
import CellRelation from '@/components/cell-relation'
export default {
components: {
NavbarRight,
NoData,
Card,
CellRelation
},
data() {
return {
info: {},
list: [],
currentKey: 'looked',
loading: true,
}
},
computed: {
baseUrl() {
return process.uniEnv.qn_base_url
},
markImage() {
return this.baseUrl + 'xiaosanjiao@3x.png'
},
noDataImage() {
return this.baseUrl + 'mingpianwuxinxi@3x.png'
},
infoKeys() {
return {
looked: '被查看',
'00': '',
call: '拨打电话',
'000': '',
address: '加通讯录',
}
},
toolInfos() {
return [
{ text: '编辑', image: this.baseUrl + 'bianjimingpian@3x.png' },
{ text: '保存', image: this.baseUrl + 'baocunmingpian@3x.png' },
{ text: '转发', image: this.baseUrl + 'zhuanfamingp@3x.png' },
]
},
},
onLoad() {
this.getInfo()
},
onUnload() {},
onShow() {},
methods: {
getInfo() {
this.info = {
looked: '44',
call: '0',
address: '2',
card: {
type: 'green',
title: '扳手专业品牌家电维修',
name: '小扳手',
address:
'dfsafdsafdasf发撒范德萨范德萨发的范德萨范大师傅的范德萨范大事发声的范德萨范德萨发撒发',
phone: '131231241314',
qrCode: 'http://reu2asz23.hn-bkt.clouddn.com/icon/beijing%403x.png',
},
}
this.list = []
this.loading = false
},
handleChangeList(key) {
this.currentKey = key
this.loading = true
this.getInfo()
},
},
}
</script>
<style scoped lang="scss">
.visiting-card {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.content-view {
height: 100%;
overflow: auto;
padding: 24rpx 24rpx 44rpx 24rpx;
.card-view {
.no-card {
display: flex;
justify-content: center;
align-items: center;
height: 420rpx;
margin-right: 24rpx;
.add-item-button {
display: flex;
align-items: center;
justify-content: center;
color: #02a074;
font-weight: bold;
font-size: 32rpx;
background-color: #ffffff;
height: 100%;
width: 100%;
border-radius: 16rpx;
.add-text {
margin-left: 12rpx;
}
}
}
.card-content {
}
.tool-view {
display: flex;
justify-content: space-around;
align-items: center;
height: 104rpx;
background-color: #ffffff;
border-radius: 16rpx;
margin-top: 4rpx;
.item-view {
display: flex;
align-items: center;
.image-view {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
}
}
}
}
.detail-view {
background-color: #ffffff;
padding: 32rpx 24rpx;
border-radius: 16rpx;
margin-top: 24rpx;
.info-view {
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 8rpx;
.item-view {
color: #8d8d8d;
font-size: 24rpx;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
.count-view {
font-weight: bold;
color: #333333;
font-size: 48rpx;
margin-bottom: 8rpx;
}
.mark-view {
width: 32rpx;
height: 22rpx;
margin-top: 24rpx;
}
.line-view-column {
width: 2rpx;
height: 48rpx;
background-color: #f6f7fa;
margin-bottom: 36rpx;
}
}
}
.list-view {
background-color: #f6f7fa;
border-radius: 16rpx;
.list-content {
}
.no-data {
}
}
}
}
}
</style>
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
}, },
{ {
image: this.baseUrl + 'famingpian@3x.png', image: this.baseUrl + 'famingpian@3x.png',
path: '', path: 'pages/card/index',
name: '发名片', name: '发名片',
}, },
{ {
......
This diff is collapsed.
<template> <template>
<view class="maintain-detail"> <view class="maintain-detail">
<NavbarRight <NavbarRight
title="详情" backText="详情"
text="删除" text="删除"
:image="deleteImage" :image="deleteImage"
@click="handlClickDelete" @click="handlClickDelete"
...@@ -85,6 +85,37 @@ ...@@ -85,6 +85,37 @@
</u-time-line> </u-time-line>
</view> </view>
</view> </view>
<view class="bottom-view">
<view class="left-view">
<view class="go-home-view"
hover-class="u-hover-class"
@click="$u.throttle(handleClickHome, 500)">
<view class="image-view">
<image :src="homeImage"></image>
</view>
<view>回首页</view>
</view>
</view>
<view class="right-view">
<u-button :custom-style="customStatus" @click="handleClickStatus">
<view
class="status-view"
:style="'color:' + bottomColors[info.statusA]"
>{{ bottomStatusStrings[info.statusA] }}</view
>
</u-button>
<u-button
:custom-style="customChange"
@click="handleClickChange"
class="change-button"
>
<view class="change-view">修改</view>
</u-button>
<u-button :custom-style="customConFirm" @click="handleClickSure" class="confirm-button">
<view class="confirm-view">发送客户确认</view>
</u-button>
</view>
</view>
<PopNormal <PopNormal
:visible.sync="visible" :visible.sync="visible"
@confirm="handleClickConfirm" @confirm="handleClickConfirm"
...@@ -112,7 +143,7 @@ export default { ...@@ -112,7 +143,7 @@ export default {
billId: '', billId: '',
info: {}, info: {},
visible: false, visible: false,
current: 0 current: 0,
} }
}, },
computed: { computed: {
...@@ -122,6 +153,9 @@ export default { ...@@ -122,6 +153,9 @@ export default {
deleteImage() { deleteImage() {
return this.baseUrl + 'shanchuzhangdanxiangqing@3x.png' return this.baseUrl + 'shanchuzhangdanxiangqing@3x.png'
}, },
homeImage() {
return this.baseUrl + 'huishouye@3x.png'
},
colors() { colors() {
return { return {
未确认: '#333333', 未确认: '#333333',
...@@ -157,6 +191,15 @@ export default { ...@@ -157,6 +191,15 @@ export default {
已确认: '已结清', 已确认: '已结清',
} }
}, },
bottomStatusStrings() {
return {
未确认: '未同步记账',
未结清: '未同步记账',
未发送: '未同步记账',
已结清: '已同步记账',
已确认: '已同步记账',
}
},
currentPopInfo() { currentPopInfo() {
return this.current == 0 return this.current == 0
? { ? {
...@@ -174,6 +217,58 @@ export default { ...@@ -174,6 +217,58 @@ export default {
bottomTip: '', bottomTip: '',
} }
}, },
customStatus() {
switch (this.info.statusA) {
case '未确认':
case '未结清':
case '未发送':
return {
color: 'transparent',
'background-color': '#ffffff',
height: '104rpx',
'border-radius': '16rpx',
width: '200rpx',
}
case '已结清':
case '已确认':
return {
color: 'transparent',
'background-color': '#cccccc',
height: '104rpx',
'border-radius': '16rpx',
width: '200rpx',
}
}
},
customChange() {
return {
color: '#02a074',
'background-color': '#ffffff',
height: '104rpx',
'border-radius': '16rpx',
width: '156rpx',
background: 'linear-gradient(-80deg, transparent 32rpx, #FFFFFF 0)',
}
},
bottomColors() {
return {
未确认: '#02A074',
未结清: '#02A074',
未发送: '#02A074',
已结清: '#FFFFFF',
已确认: '#FFFFFF',
}
},
customConFirm() {
return {
color: 'transparent',
'background-color': '#02a074',
height: '104rpx',
'border-radius': '16rpx',
width: '240rpx',
background: 'linear-gradient(100deg, transparent 32rpx, #02a074 0)',
}
},
}, },
onLoad(options) { onLoad(options) {
if (options && options.billId) { if (options && options.billId) {
...@@ -249,11 +344,20 @@ export default { ...@@ -249,11 +344,20 @@ export default {
this.current = 1 this.current = 1
this.visible = true this.visible = true
}, },
handleClickSure() {},
handleClickStatus() {},
handleClickHome() {
this.$u.route({
url: '/pages/index/index',
type: 'switchTab'
});
},
handleClickChange() {
console.log('--------handleClickChange---------')
},
handleClickConfirm(select) { handleClickConfirm(select) {
if (this.current == 0) { if (this.current == 0) {
} else { } else {
} }
}, },
handleClickPreview(index) { handleClickPreview(index) {
...@@ -415,5 +519,72 @@ export default { ...@@ -415,5 +519,72 @@ export default {
} }
} }
} }
.bottom-view {
margin: 16rpx 24rpx 36rpx 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
.left-view {
display: flex;
align-items: center;
.go-home-view {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 104rpx;
padding: 4rpx 8rpx 4rpx 0;
color: #8d8d8d;
font-size: 24rpx;
.image-view {
width: 48rpx;
height: 48rpx;
}
}
}
.right-view {
margin-left: 24rpx;
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
.status-view {
color: #ffffff;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
margin: 24rpx;
}
.change-button {
margin-right: -64rpx;
margin-left: 24rpx;
}
.confirm-button {
/deep/ .u-default-hover {
// border: 2rpx solid red !important;
color: transparent !important;
background-color: transparent !important;
border-color: transparent !important;
}
}
.change-view {
color: #02a074;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
padding-right: 32rpx;
}
.confirm-view {
color: #ffffff;
height: rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
padding-left: 16rpx;
}
}
}
} }
</style> </style>
<template> <template>
<view class="maintain-bill"> <view class="maintain-bill">
<NavbarRight <NavbarRight
title="维修记账" backText="维修记账"
text="导出账单" text="导出账单"
imageWidth="20" imageWidth="20"
:image="outImage" :image="outImage"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<NoData v-else-if="!loading" customStyle="margin-top:100rpx" :image="currentNoData.image" :text="currentNoData.text"/> <NoData v-else-if="!loading" customStyle="margin-top:100rpx" :image="currentNoData.image" :text="currentNoData.text"/>
</view> </view>
<PopNormal title="操作提醒" :visible.sync="visible" @confirm="handleClickConfirm" cancelText="取消" confirmText="导出" content="确认导出账单吗?"/> <PopNormal title="操作提醒" :visible.sync="visible" @confirm="handleClickConfirm" cancelText="取消" confirmText="导出" content="确认导出账单吗?"/>
<FabView/> <FabView @click="handleClickFab"/>
</view> </view>
</template> </template>
...@@ -201,6 +201,13 @@ export default { ...@@ -201,6 +201,13 @@ export default {
}, },
}) })
}, },
handleClickFab() {
this.$u.route({
url: 'pages/maintain-bill/create',
params: {
},
})
},
handlClickOut() { handlClickOut() {
this.visible = true this.visible = true
}, },
......
<template>
<view class="maintain-particulars">
<NavbarRight title="维修明细" />
<view class="content-view">
<view class="tip-view">
<u-icon name="error-circle" color="#02A074" size="30"></u-icon>
<view class="tip-text">若客户需要详细维修账单请填写</view>
<view class="other-text">(如不需要可不填)</view>
</view>
<view class="part-view">
<view class="item-view one-line">
<view class="label-view">填写故障记录</view>
<view class="value-view">
<u-switch
v-model="showRecord"
active-color="#02a074"
inactive-color="#CCCCCC"
@change="handleChangeShowRecord"
>
</u-switch>
</view>
</view>
</view>
<view class="part-view record-type" v-if="showRecord">
<view class="title-view">故障信息</view>
<view class="item-view">
<view class="label-view">品牌</view>
<view class="value-view">
<u-input
type="text"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="price"
placeholder="填写品牌名称"
/>
</view>
</view>
<view class="line-view"></view>
<view class="item-view">
<view class="label-view">型号</view>
<view class="value-view">
<u-input
type="digit"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="all"
placeholder="填写型号名称"
/>
</view>
</view>
<view class="line-view"></view>
<view class="item-view" style="display: block">
<view class="lable-view">故障现象</view>
<view class="value-view area-view">
<u-input
type="textarea"
height="240"
:clearable="false"
:custom-style="customAreaStyle"
:placeholder-style="placeholderStyle"
v-model="form.phone"
placeholder="填写故障现象详细信息"
/>
</view>
</view>
<view class="line-view"></view>
<view class="item-view" style="display: block">
<view class="lable-view">检修结果</view>
<view class="value-view area-view">
<u-input
type="textarea"
height="240"
:clearable="false"
:custom-style="customAreaStyle"
:placeholder-style="placeholderStyle"
v-model="form.phone"
placeholder="填写检修结果详细信息"
/>
</view>
</view>
</view>
<view class="list-view">
<view v-for="(item, index) in list" :key="index">
<CellParticulars
:showDelete="showDeleteButton"
:defaultInfo="item"
@change="handleChange($event, index)"
@delete="handleClickDelete(index)"
/>
</view>
<view class="add-item-view">
<view
class="add-item-button"
hover-class="u-hover-class"
@click="$u.throttle(handleClickAdd, 500)"
>
<u-icon name="plus" color="#02A074" size="26"></u-icon>
<view class="add-text">添加明细</view>
</view>
</view>
</view>
</view>
<view class="bottom-view">
<view class="left-view">
<u-button :custom-style="customSkip" @click="handleClickSkip">
<view class="skip-view">跳过</view>
</u-button>
</view>
<view class="right-view">
<u-button
:custom-style="customConFirm"
@click="handleClickSure"
:disabled="!canConfirm"
>
<view class="confirm-view">保存</view>
</u-button>
</view>
</view>
<PopNormal
title="操作提醒"
:visible.sync="visible"
@confirm="handleClickConfirm"
cancelText="取消"
confirmText="确认"
content="确认删除该条明细吗?"
/>
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right'
import CellParticulars from '@/components/cell-particular'
import PopNormal from '@/components/pop-normal'
export default {
components: {
NavbarRight,
CellParticulars,
PopNormal,
},
data() {
return {
visible: false,
info: {},
list: [
{
name: 'a',
number: '1',
price: '2',
all: '3',
},
],
showRecord: false,
canConfirm: false,
currentIndex: 0,
}
},
computed: {
customConFirm() {
return {
color: 'transparent',
'background-color': this.canConfirm ? '#02a074' : '#7DCFB8',
height: '96rpx',
'border-radius': '16rpx',
}
},
customSkip() {
return {
color: 'transparent',
'background-color': '#666666',
height: '96rpx',
'border-radius': '16rpx',
width: '200rpx',
}
},
showDeleteButton() {
return this.list.length > 1
},
placeholderStyle() {
return 'color:#ccc;font-size:28rpx;font-weight: bold;'
},
customStyle() {
return {
fontSize: '28rpx',
textAlign: 'right',
fontWeight: 'bold',
}
},
customAreaStyle() {
return {
fontSize: '28rpx',
fontWeight: 'bold',
'background-color': '#F6F7FA',
'text-align': 'left',
padding: '32rpx 24rpx',
'border-radius': '16rpx',
}
},
},
onLoad(options) {},
onReady() {},
onUnload() {},
onShow() {},
methods: {
handleChangeShowRecord(event) {
this.showRecord = event.value
},
handleChange(event, index) {
this.list[index][event.key] = event.value
for (var item of this.list) {
for (var key in item) {
if (!this.list[index][key]) {
this.canConfirm = false
return
}
}
}
this.canConfirm = true
},
handleClickAdd() {
this.list = [
...this.list,
{
name: '',
number: '',
price: '',
all: '',
},
]
},
handleClickDelete(index) {
this.currentIndex = index
this.visible = true
},
handleClickConfirm() {
this.list.splice(this.currentIndex, 1)
},
handleClickSkip(date) {},
handleClickSure() {},
},
}
</script>
<style scoped lang="scss">
.maintain-particulars {
/deep/.u-number-input {
color: #333333 !important;
font-weight: bold;
}
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.content-view {
height: 100%;
overflow: auto;
padding: 0 24rpx 44rpx 24rpx;
.tip-view {
font-size: 24rpx;
display: flex;
align-items: center;
.tip-text {
color: #8d8d8d;
margin-left: 12rpx;
}
.other-text {
color: #fc524d;
}
}
.part-view {
padding: 16rpx 24rpx 0rpx 24rpx;
background-color: #ffffff;
border-radius: 16rpx;
margin-top: 24rpx;
&.record-type {
padding: 24rpx 16rpx 8rpx 24rpx;
}
.title-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin: 16rpx 0 8rpx 0;
}
.item-view {
padding: 24rpx 0 8rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
&.one-line {
padding: 8rpx 0;
}
.label-view {
color: #8d8d8d;
flex-shrink: 0;
}
.value-view {
font-weight: bold;
color: #333333;
text-align: right;
}
.area-view {
margin: 24rpx 0;
}
}
.line-view {
height: 2rpx;
background-color: #f6f7fa;
// margin: 16rpx 0;
}
}
.add-item-view {
display: flex;
justify-content: center;
align-items: center;
margin: 56rpx 0 24rpx 0;
.add-item-button {
display: flex;
align-items: center;
justify-content: center;
color: #02a074;
font-weight: bold;
font-size: 28rpx;
background-color: #ffffff;
height: 80rpx;
border-radius: 40rpx;
width: 224rpx;
.add-text {
margin-left: 16rpx;
}
}
}
}
.bottom-view {
margin: 16rpx 32rpx 36rpx 32rpx;
display: flex;
align-items: center;
.left-view {
.skip-view {
color: #ffffff;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
}
}
.right-view {
margin-left: 32rpx;
flex: 1;
.confirm-view {
color: #ffffff;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
}
}
}
}
</style>
This diff is collapsed.
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