Commit 2710104d authored by 刘文虎's avatar 刘文虎

保存图片权限,开票样式

parent 2532d3f7
......@@ -326,7 +326,16 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
}]
} ,{
"path" : "bill-style",
"style" :
{
"navigationBarTitleText": "收据样式",
"enablePullDownRefresh": false
}
}
]
},
{
"root": "pages/card",
......
<template>
<view class="bill-style">
<view class="bill-style-title">请选择收据样式</view>
<view class="card-item" :class="{ active: item.type === type }" v-for="(item, index) in cardList" :key="index" @click="handleClick(item)">
<view class="card-item-icon" @click.stop="preview(item,index)"><image :src="item.icon" mode=""></image></view>
<view class="card-item-right">
<view class="card-item-right-title">
<view class="card-item-right-title-name">{{ item.title }}</view>
<view class="card-item-right-title-preview" @click.stop="preview(item,index)">
<view class="card-item-right-title-preview-icon"><image :src="previewIcon" mode=""></image></view>
<view class="card-item-right-title-preview-text">预览</view>
</view>
</view>
<view class="card-item-right-desc">{{ item.desc }}</view>
</view>
</view>
<submit-button @handleClick="submit" text="下一步"></submit-button>
</view>
</template>
<script>
import SubmitButton from '@/components/submit-button/index.vue';
import { billBaseUrl } from '@/utils/config.js';
export default {
components: {
SubmitButton
},
data() {
return {
previewIcon: billBaseUrl + 'yulanicon@3x.png',
cardList: [
{
type: '1',
icon: billBaseUrl + 'fuwuxiaopiaosuolue@3x.png',
image: billBaseUrl + 'weixiuzhangdan-1.png',
title: '服务小票',
desc: '适用个人用户的常规生活服务场景'
},
{
type: '2',
icon: billBaseUrl + 'sgoujupinzhengsuolue@3x.png',
image: billBaseUrl + 'dianzipinzheng-1.png',
title: '收据凭证',
desc: '适用企业用户的服务、售货、报销等场景'
}
],
previewImages:[billBaseUrl + 'weixiuzhangdan-1.png',billBaseUrl + 'dianzipinzheng-1.png'],
type: '1'
};
},
methods: {
handleClick(item) {
this.type = item.type;
},
preview(item,index) {
// 预览图片
uni.previewImage({
urls: this.previewImages,
current:index,
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
},
submit() {}
}
};
</script>
<style lang="scss" scoped>
.bill-style {
color: #333333;
padding: 0 24rpx;
&-title {
padding-top: 40rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 32px;
}
.card-item {
margin-top: 40rpx;
padding: 24rpx;
border-radius: 16rpx;
border: 2rpx solid #ffffff;
box-shadow: 4rpx 8rpx 16rpx 0px #ffffff;
width: 100%;
display: flex;
align-items: flex-start;
background-color: #ffffff;
&-icon {
width: 240rpx;
height: 180rpx;
margin-right: 32rpx;
}
&-right {
flex: 1;
height: 100%;
padding-top: 16rpx;
&-title {
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 32rpx;
&-name {
font-size: 40rpx;
line-height: 40rpx;
font-weight: bold;
}
&-preview {
font-size: 24rpx;
color: $default-color;
line-height: 24rpx;
display: flex;
align-items: center;
&-icon {
width: 32rpx;
height: 24rpx;
margin-right: 8rpx;
}
}
}
&-desc {
font-size: 24rpx;
line-height: 32rpx;
}
}
}
.active {
border: 2rpx solid $default-color;
box-shadow: 4rpx 8rpx 16rpx 0px rgba(2, 160, 116, 0.2);
}
}
</style>
<template>
<view class="bill-count">
<view class="bill-count-item" v-for="(item, index) in list" :key="index">
<view class="bill-count-item-value ellipsis " :class="{red:detail[item.value]>0}">{{ detail[item.value] }}</view>
<view class="bill-count-item-label">{{ item.label }}</view>
<view class="bill-count-item-line" v-if="index !== list.length - 1"></view>
</view>
</view>
</template>
<script>
import { billCountOptions } from '@/utils/options/maintain-bill/index.js';
export default {
props:{
detail:{
type:Object,
default:()=>{}
}
},
data() {
return {
list: billCountOptions,
};
}
};
</script>
<style lang="scss" scoped>
.bill-count {
// height: 160upx;
display: flex;
padding-top: 32rpx;
&-item {
width: 25%;
height: 100%;
padding: 0 12upx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
&-value {
width: 100%;
text-align: center;
margin-bottom: 20upx;
line-height: 32upx;
font-size: 28upx;
font-weight: bold;
}
.red{
color: #FC524D;
}
&-label {
font-size: 24upx;
color: #8d8d8d;
}
&-line{
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 2upx;
height: 32upx;
background: #F6F7FA;
}
}
}
</style>
......@@ -25,20 +25,27 @@
:input-style="{ 'font-size': '26rpx', color: '#333333' }"
></u-search>
</view>
<view class="title-view">
<view class="left-view">
<DateRangePicker ref="date-range-picker" v-model="daterange" :canReset="true" type="daterange" @change="handleClickChange">
<view class="select-view" hover-class="u-hover-class">
<view class="date-view">{{ dateString || '全部时段' }}</view>
<u-icon name="arrow-down-fill" color="#8D8D8D" size="24"></u-icon>
<view class="head">
<view class="head-view">
<view class="title-view">
<view class="left-view">
<DateRangePicker ref="date-range-picker" v-model="daterange" :canReset="true" type="daterange" @change="handleClickChange">
<view class="select-view" hover-class="u-hover-class">
<view class="date-view">{{ dateString || '全部时段' }}</view>
<u-icon name="arrow-down-fill" color="#8D8D8D" size="24"></u-icon>
</view>
</DateRangePicker>
</view>
</DateRangePicker>
</view>
<view class="right-view" hover-class="u-hover-class" @click="$u.throttle(handleSelectFilter, 500)">
<view :class="['icon-view', { filter: onlyDebt }]"><u-icon name="checkbox-mark" v-if="onlyDebt" color="#02a074" size="24"></u-icon></view>
<view class="filter-view">只看欠款</view>
<view class="right-view" hover-class="u-hover-class" @click="$u.throttle(handleSelectFilter, 500)">
<view :class="['icon-view', { filter: onlyDebt }]"><u-icon name="checkbox-mark" v-if="onlyDebt" color="#02a074" size="24"></u-icon></view>
<view class="filter-view">只看欠款</view>
</view>
</view>
<bill-count ref="bill-count" :detail="statistics"></bill-count>
</view>
</view>
<view class="content-view">
<scroll-view
scroll-y
......@@ -73,6 +80,7 @@ import CellMaintainBill from '@/components/cell-maintain-bill';
import FabView from '@/components/fab-view';
import NoData from '@/components/no-data';
import PopExport from '@/components/pop-export-bill';
import BillCount from './components/bill-count.vue';
import { repair } from '@/api/maintain/index.js';
import { downLoad } from '@/utils/download.js';
......@@ -83,7 +91,8 @@ export default {
CellMaintainBill,
NoData,
PopExport,
FabView
FabView,
BillCount
},
data() {
return {
......@@ -99,7 +108,12 @@ export default {
triggered: true,
freshing: false,
current: 1,
size: 10
size: 10,
statistics:{
income:0,
expense:0,
surplus:0,
}
};
},
computed: {
......@@ -284,12 +298,21 @@ export default {
font-size: 34rpx !important;
}
}
.head{
padding: 0 24rpx;
}
.head-view{
padding: 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
}
.title-view {
color: #333333;
display: flex;
align-items: center;
justify-content: space-between;
margin: 24rpx 24rpx 0 24rpx;
padding-bottom: 24rpx;
border-bottom: 2rpx solid #F6F7FA;
.left-view {
display: flex;
align-items: center;
......
......@@ -317,7 +317,7 @@ export default {
{
repairRecordId: this.billId,
name: '',
number: '1',
number: 1,
unit: '',
unitPrice: '',
total: ''
......
......@@ -30,7 +30,7 @@
<view class="detail-list part-view">
<view class="table">
<view class="table-tr table-th">
<view class="table-td" :class="{'table-td-mid':key === 1}" v-for="(item, key) in tableOptions" :key="key">
<view class="table-td" :class="{ 'table-td-mid': key === 1 }" v-for="(item, key) in tableOptions" :key="key">
<view v-if="key === 1">
<text>{{ item.label }}</text>
</view>
......@@ -41,12 +41,12 @@
</view>
</view>
<view class="table-tr" v-for="(item, index) in info.expenseDetails" :key="index">
<view class="table-td" :class="{'table-td-mid':key === 1}" v-for="(tdItem, key) in tableOptions" :key="key">
<view class="table-td" :class="{ 'table-td-mid': key === 1 }" v-for="(tdItem, key) in tableOptions" :key="key">
<view v-if="key === 1">
<text>
<text>{{ item.unitPrice }}</text>
<text v-if="item.unit">/</text>
<text>{{ item.unit||"" }}</text>
<text>{{ item.unit || '' }}</text>
<text>*</text>
<text>{{ item.number }}</text>
</text>
......@@ -578,9 +578,14 @@ export default {
});
};
// #ifdef APP-PLUS
// getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveBillImage();
// })
if (this.isIOS) {
this.saveBillImage();
} else {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => {
this.saveBillImage();
});
}
// #endif
// #ifdef MP-WEIXIN
getSetting('scope.writePhotosAlbum', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => {
......@@ -678,7 +683,7 @@ export default {
if (index === 1) {
el.css.width = '304rpx';
el.css.textAlign = 'center';
el.text = `${infoItem.unitPrice}${infoItem.unit?'/'+infoItem.unit:''}*${infoItem.number}`;
el.text = `${infoItem.unitPrice}${infoItem.unit ? '/' + infoItem.unit : ''}*${infoItem.number}`;
} else if (index === 2) {
el.css.textAlign = 'right';
}
......
......@@ -68,3 +68,22 @@ export const tableOptions = [{
label: "合计",
}
]
export const billCountOptions = [{
value: "income",
label: "账单",
},
{
value: "expense",
label: "应收",
},
{
value: "surplus",
label: "实收",
},
{
value: "surplus",
label: "欠款",
},
]
\ No newline at end of file
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