Commit 6186a1a6 authored by 刘文虎's avatar 刘文虎

自定义报价,绘图使用px单位

parent d5f4ce9c
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "扳手记账", "name" : "扳手记账",
"appid" : "__UNI__EDB8C7C", "appid" : "__UNI__EDB8C7C",
"description" : "", "description" : "",
"versionName" : "1.0.5", "versionName" : "1.0.6",
"versionCode" : 105, "versionCode" : 106,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
......
...@@ -112,7 +112,8 @@ ...@@ -112,7 +112,8 @@
"path": "quoted-price/quoted-price", "path": "quoted-price/quoted-price",
"style": { "style": {
"navigationBarTitleText": "查报价", "navigationBarTitleText": "查报价",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
}, { }, {
...@@ -143,7 +144,55 @@ ...@@ -143,7 +144,55 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}] } ,{
"path" : "quoted-price/custom/custom",
"style" :
{
"navigationBarTitleText": "查报价",
"enablePullDownRefresh": false
}
}
,{
"path" : "quoted-price/select-price/select-price",
"style" :
{
"navigationBarTitleText": "选择报价",
"enablePullDownRefresh": false
}
}
,{
"path" : "quoted-price/create/create",
"style" :
{
"navigationBarTitleText": "创建报价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "quoted-price/create/edit",
"style" :
{
"navigationBarTitleText": "创建报价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "quoted-price/create/list",
"style" :
{
"navigationBarTitleText": "服务",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
]
}, { }, {
"root": "pages/mine", "root": "pages/mine",
"pages": [{ "pages": [{
......
<template>
<view class="select-view" @click="tabsClick">
<text>家电维安</text>
<u-icon name="arrow-down" class="arrow"></u-icon>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods:{
tabsClick(){
uni.navigateTo({
url:"/pages/bill/quoted-price/select-price/select-price"
})
}
}
}
</script>
<style lang="scss" scoped>
.select-view{
height: 52rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: start;
font-size: 40rpx;
font-weight: bold;
color: #333333;
line-height: 40px;
color: #333333;
.arrow{
margin-left: 12rpx;
font-size: 24rpx;
}
}
</style>
<template>
<view class="input-view">
<NavbarNormal :title="info.title" titleColor="#191C27" :border-bottom="false" title-bold></NavbarNormal>
<view class="content-view">
<u-input
v-model="value"
:type="info.type"
:height="info.height"
:placeholder="info.placeholder"
:placeholder-style="placeholderStyle"
focus
:border="false"
:custom-style="inputStyle"
:disabled="disabled"
:clearable="false"
@input="handleInput"
/>
<view v-if="!disabled" class="tip-view">{{ tipText }}</view>
<view class="bottom-view">
<u-button :customStyle="buttonStyle" @click="handleClick"><view class="button-text">确定</view></u-button>
</view>
</view>
</view>
</template>
<script>
import NavbarNormal from '@/components/navbar-normal';
export default {
components: {
NavbarNormal
},
data() {
return {
value: '',
type: '',
deleteType: '',
disabled: false,
deleteStyle: {
marginTop: '24rpx',
'background-color': '#FFFFFF',
height: '104rpx',
'border-radius': '16rpx'
},
id: null,
whiteSpace: false,
inputStyle: {
'border-radius': '8rpx',
'background-color': '#F6F7FA',
padding: '24rpx',
'font-size': '28rpx',
color: '#333333'
}
};
},
computed: {
baseUrl() {
return process.uniEnv.qn_base_url;
},
buttonStyle() {
return {
color: 'transparent',
'background-color': '#02A074',
height: '104rpx',
'border-radius': '16rpx'
};
},
placeholderStyle() {
return 'color: #cccccc;font-size: 28rpx;font-weight: bold;';
},
tipText() {
return `${this.value.length || 0}/${this.info.maxlength}`;
},
info() {
return {
title: '创建报价',
type: 'textarea',
placeholder: '请输入报价名称(10个字以内)',
maxlength: 10,
height: 240
};
}
},
onLoad(options) {},
onUnload() {},
methods: {
handleInput(event) {
// 直接给input设maxlength输入拼音的时候有影响
if (event.length > this.info.maxlength) {
this.$nextTick(() => {
this.value = event.substring(0, this.info.maxlength);
});
}
},
handleClick() {
if (!this.value.trim()) {
this.$u.toast('内容不能为空');
return false;
}
let str = this.value.replace(/[\r\n]/g, '');
this.create(str)
},
async create(name){
try{
// let {data}=await add({
// name:name
// })
this.$u.route({
url: '/pages/bill/quoted-price/create/edit',
type:'redirectTo',
params: {
// id: id
}
});
}catch(e){
//TODO handle the exception
console.log(e)
}
}
}
};
</script>
<style scoped lang="scss">
.input-view {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #ffffff;
.content-view {
height: 100%;
overflow: auto;
padding: 24rpx 32rpx;
.tip-view {
margin-top: 20rpx;
color: #333333;
font-size: 28rpx;
text-align: right;
}
}
.bottom-view {
margin: 24rpx 0;
height: 104rpx;
.button-text {
color: #ffffff;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
}
.delete-button {
text-align: center;
color: #fc524d;
}
}
}
</style>
<template>
<view class="edit-price">
<!-- <NavbarNormal title="创建报价" titleColor="#191C27" :border-bottom="false" title-bold></NavbarNormal> -->
<NavbarRight backTextBold backText="创建报价" />
<view class="content-view">
<view class="name">
<view class="name-label">报价名称</view>
<view class="name-value">
<u-input
v-model="info.name"
type="text"
height="36rpx"
input-align="right"
placeholder="填写报价名称,10字以内"
:border="false"
:custom-style="inputStyle"
:placeholder-style="placeholderStyle"
:clearable="false"
@input="handleInput"
/>
</view>
</view>
<view class="item" v-for="(item, index) in createCategoryOptions" :key="index">
<view class="item-left">
<view class="item-left-icon"><image :src="item.icon" mode=""></image></view>
<view class="item-left-label">{{ item.label }}</view>
<view class="item-left-num" v-if="info[item.value]">({{ (info[item.value] && info[item.value].length) || 0 }})</view>
</view>
<view class="item-right" hover-class="u-hover-class" @click="add(item)">
<view class="item-right-icon"><u-icon name="plus"></u-icon></view>
<view class="item-right-label">新建</view>
</view>
</view>
<view class="preview">
<image :src="previewIcon" mode="" class="preview-icon"></image>
<text>查看报价示意图</text>
</view>
</view>
<view class="bottom-view">
<view class="left-view">
<u-button :custom-style="customDelete" @click="handleClickDelete"><view class="skip-view">删除</view></u-button>
</view>
<view class="right-view">
<u-button :custom-style="customConFirm" @click="handleClickSure" :disabled="!canConfirm" :loading="buttonLoading"><view class="confirm-view">保存</view></u-button>
</view>
</view>
<PopNormal title="操作提醒" :visible.sync="visible" @confirm="handleClickConfirm" cancelText="取消" confirmText="确认" content="确认删除该条报价吗?" />
</view>
</template>
<script>
import NavbarNormal from '@/components/navbar-normal';
import NavbarRight from '@/components/navbar-right';
import PopNormal from '@/components/pop-normal';
import { billBaseUrl } from '@/utils/config.js';
import { createCategoryOptions } from '@/utils/options/bill/quoted-price.js';
export default {
components: {
NavbarNormal,
NavbarRight,
PopNormal,
},
data() {
return {
createCategoryOptions,
previewIcon: billBaseUrl + 'yulanicon@3x.png',
info: {
name: ''
},
inputStyle: {
'font-size': '28rpx',
lineHeight: '36rpx',
height: '36rpx',
fontWeight: 'bold'
},
placeholderStyle: 'font-weight:normal',
maxlength: 10,
customConFirm: {
color: 'transparent',
'background-color': this.canConfirm ? '#02a074' : '#7DCFB8',
height: '104rpx',
'border-radius': '16rpx'
},
customDelete: {
color: '#02A074',
height: '104rpx',
'border-radius': '16rpx',
width: '200rpx',
},
buttonLoading: false,
visible:false
};
},
computed: {
canConfirm() {
if (!this.info.name) {
return false;
}
return true;
}
},
methods: {
handleInput(event) {
// 直接给input设maxlength输入拼音的时候有影响
if (event.length > this.maxlength) {
this.$nextTick(() => {
this.info.name = event.substring(0, this.maxlength);
});
}
},
add(item) {
this.$u.route({
url: 'pages/bill/quoted-price/create/list',
type: 'navigateTo',
params: {
type: item.value
}
});
},
handleClickDelete(){
this.visible=true
},
handleClickSure(){
},
handleClickConfirm(){
},
}
};
</script>
<style lang="scss" scoped>
.edit-price {
padding: 0 24rpx;
padding-top: 24rpx;
color: #333333;
display: flex;
flex-direction: column;
height: 100vh;
.content-view {
height: 100%;
overflow: auto;
padding: 0 24rpx;
}
.bottom-view {
margin: 16rpx 32rpx 36rpx 32rpx;
display: flex;
align-items: center;
.left-view {
.skip-view {
color: #FC524D;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
}
}
.right-view {
margin-left: 32rpx;
flex: 1;
.confirm-view {
color: #ffffff;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
}
}
}
.name {
height: 108rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-label {
font-size: 28rpx;
color: #333333;
}
&-value {
width: 460rpx;
height: 100%;
}
}
.item {
margin-top: 24rpx;
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
padding: 56rpx 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-left {
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: bold;
&-icon {
width: 48rpx;
height: 48rpx;
margin-right: 32rpx;
}
}
&-right {
height: 100%;
display: flex;
align-items: center;
font-size: 28rpx;
&-icon {
color: $default-color;
}
&-label {
margin-left: 8rpx;
color: #cccccc;
}
}
}
.preview {
margin-top: 64rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: $default-color;
font-weight: bold;
font-size: 28rpx;
&-icon {
width: 32rpx;
height: 24rpx;
display: flex;
margin-right: 16rpx;
}
}
}
</style>
<template>
<view class="list">
<NavbarRight backTextBold backText="创建报价" />
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<block v-else>
<view class="item" v-for="(item, index) in list" :key="item.id" @click="clickCell(item)">
<view class="item-left">{{ item.name }}</view>
<view class="item-right">
<view class="item-right-price">
<text>¥</text>
<text>100</text>
<text>-</text>
<text>150</text>
</view>
<view class="item-right-icon"><u-icon name="edit-pen"></u-icon></view>
</view>
</view>
</block>
<PopInput title="删除提醒" type="text" sureText="确定" content="确认删除该定时计划?" :visible.sync="showConfirm" @click="handleConfirm" @cancel="handleCancel" />
<submit-button @handleClick="add" plusIcon text="创建服务价格"></submit-button>
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right';
import NoData from '@/components/no-data';
import PopInput from '@/components/pop-input-view';
import SubmitButton from '@/components/submit-button/index.vue';
import { billBaseUrl } from '@/utils/config.js';
import { getList, deleteById, enable, close } from '@/api/mine/timed.js';
export default {
components: {
NoData,
PopInput,
SubmitButton,
NavbarRight
},
data() {
return {
billBaseUrl,
showConfirm: false,
readyDeleteItem: null,
loaded: false,
noDataText: '当前暂无内容',
noDataImage: 'bill/wuzhangdanneirong@3x.png',
list: [],
title: '',
type: ''
};
},
onLoad(option) {
if (option && option.type) {
this.type = option.type;
}
},
onReady() {
this.getList();
},
computed: {
noData() {
return (this.list || []).length == 0 && this.loaded;
}
},
onUnload() {
uni.$off('timed-sure-delete');
},
methods: {
async getList() {
this.loaded = false;
try {
let params = {
current: 1,
size: 99999
};
let { data } = await getList(params);
data.records.forEach(item => {
item.label = item.classification.name;
item.icon = item.classification.recordSelectedIcon;
item.show = false;
item.loading = false;
});
this.list = data.records || [];
} catch (e) {
console.log(e);
//TODO handle the exception
}
this.loaded = true;
},
add() {
this.toEdit();
},
toEdit(id = '') {
this.$u.route({
url: '/pages/mine/timed/create-timed/create-timed',
params: {
id: id
}
});
uni.$once(`refreshList`, res => {
this.getList();
});
if (id) {
uni.$once(`timed-sure-delete`, res => {
this.list.map(el => {
if (el.id === res.id) {
this.beforeDelete(el);
}
});
});
}
},
clickCell(item) {
let flag = true;
this.list.map(el => {
if (el.show) {
flag = false;
}
});
if (flag) {
this.toEdit(item.id);
}
},
beforeDelete(item) {
this.readyDeleteItem = item;
this.showConfirm = true;
},
handleConfirm() {
this.onDelete();
},
handleCancel() {},
async onDelete() {
try {
let params = {
id: this.readyDeleteItem.id
};
let { data } = await deleteById(params);
this.getList();
} catch (e) {
console.log(e);
//TODO handle the exception
}
}
}
};
</script>
<style lang="scss" scoped>
.list {
width: 100%;
padding: 32rpx 24rpx;
padding-bottom: 144rpx;
min-height: 100%;
color: #333333;
.item {
width: 100%;
display: flex;
align-items: center;
background-color: #ffffff;
border-radius: 16rpx;
padding: 32rpx 24rpx;
&-left {
font-size: 28rpx;
font-weight: bold;
}
&-right {
&-price {
font-size: 28px;
font-weight: bold;
color: #fc524d;
}
&-icon {
margin-left: 32rpx;
color: #cccccc;
}
}
}
}
</style>
<template>
<u-popup v-model="show" border-radius="24" mode="bottom">
<view class="content">
<view class="charge footer">
<view class="charge-title">收费列表</view>
<view class="charge-body">
<scroll-view scroll-y="true" :style="{ height: '100%', width: '100%' }" :scroll-with-animation="false">
<view class="charge-body-item" v-for="(item, index) in list" :key="item.classC">
<view class="charge-body-item-title">
<text>{{item.parentTitle}}</text>
<text class="charge-body-item-title-subtitle">{{item.classCProject}}</text>
</view>
<view class="charge-body-item-bottom">
<text class="charge-body-item-bottom-price">
<text>¥</text>
<text>{{ item.chargeStandard }}{{item.unit}}</text>
</text>
<view class="charge-body-item-bottom-add">
<view class="charge-body-item-bottom-add-icon">
<number-box theme-colors="#02A074" inputHeight="40" v-model="item.num" disabled-input @change="valChange($event, item)"></number-box>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<shopping-cart :show.sync="cartShow" :autoHide="false" :list="list"></shopping-cart>
</view>
</u-popup>
</template>
<script>
import NumberBox from '@/components/number-box/number-box.vue';
import ShoppingCart from './shopping-cart.vue';
export default {
components: {
NumberBox,
ShoppingCart
},
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {
show: false,
cartShow: true,
};
},
methods: {
open() {
this.show = true;
},
close() {
this.show = false;
},
valChange(e, item) {
console.log('cart-popup,$event', e);
console.log('cart-popup, item', item);
this.$set(item, 'num', e.value);
let list=[...this.list]
list.forEach((item, index) => {
if (item.num === 0) {
// 当数量为0时,删除当前项
list.splice(index, 1);
}
});
let params = {
list: list,
deleted: null
};
// 当数量为0时,通知main里面计数器变为0
if (!item.num) {
params.deleted = item;
}
this.$emit('change', params);
if(!list.length){
this.close()
}
}
}
};
</script>
<style lang="scss" scoped>
.content {
position: relative;
padding: 32rpx;
background-color: #ffffff;
color: #333333;
.charge {
margin-bottom: 172rpx;
&-title {
margin: 8rpx 0;
line-height: 32rpx;
font-weight: bold;
font-size: 32rpx;
}
&-body {
height: 540rpx;
width: 100%;
&-item {
width: 100%;
height: 168rpx;
margin-top: 40rpx;
background: #f6f7fa;
border-radius: 16rpx;
padding: 32rpx;
&-title {
line-height: 32rpx;
font-weight: bold;
font-size: 32rpx;
&-subtitle {
margin-left: 28rpx;
line-height: 28rpx;
font-weight: normal;
font-size: 28rpx;
}
}
&-bottom {
margin-top: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-price {
color: #fc524d;
}
&-add {
}
&-add-icon {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
}
}
}
}
</style>
<template>
<view class="collapse-body">
<view class="collapse-body-title">{{detail.classCProject}}</view>
<view class="collapse-body-desc">{{detail.pubRemark}}</view>
<view class="collapse-body-bottom">
<text class="collapse-body-bottom-price">
<text>¥</text>
<text>{{ detail.chargeStandard }}{{detail.unit}}</text>
</text>
<view class="collapse-body-bottom-add">
<zb-tooltip placement="top-end" ref="tooltip1" color="#7f7f7f" :visible.sync="showTips">
<view class="collapse-body-bottom-add-icon" @click="add">
<number-box theme-colors="#02A074" inputHeight="40" v-model="form.num" disabled-input @change="valChange"></number-box>
</view>
<view class="tooltip" slot="content">
<text>点击可以加入计算器算出收费</text>
<u-icon name="close" class="tooltip-icon" @click="close"></u-icon>
</view>
</zb-tooltip>
</view>
</view>
</view>
</template>
<script>
import ZbTooltip from '@/components/zb-tooltip/zb-tooltip.vue';
import NumberBox from '@/components/number-box/number-box.vue';
export default {
components: {
ZbTooltip,
NumberBox
},
props: {
parentTitle:{
type: String,
default:""
},
detail: {
type: Object | null | String,
default: () => {}
},
showTips:{
type: Boolean,
default:false
}
},
data() {
return {
form: {
num: 0
}
};
},
watch: {
detail: {
handler(val, old) {
this.form.num = val.num || 0;
},
immediate: true
}
},
onReady() {},
methods: {
close() {
this.$store.dispatch('Set_quoted_price_tooltip', true);
},
valChange(e) {
console.log("collapse-body-valChange",e);
this.form.num = e.value;
this.add();
},
add() {
this.$emit('add', {
item: this.detail,
num: this.form.num,
parentTitle:this.parentTitle
});
}
}
};
</script>
<style lang="scss" scoped>
.collapse-body {
background: #f6f7fa;
border-radius: 16rpx;
padding: 24rpx;
color: #333333;
margin-bottom: 24rpx;
&-title {
font-weight: bold;
font-size: 24rpx;
margin-bottom: 18rpx;
}
&-desc {
font-size: 24rpx;
line-height: 36rpx;
color: #8d8d8d;
}
&-bottom {
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-price {
color: #fc524d;
}
&-add {
}
&-add-icon {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
.tooltip {
display: flex;
align-items: center;
height: 56rpx;
padding: 0 16rpx;
// background: #000000;
border-radius: 8rpx;
color: #ffffff;
font-size: 24rpx;
// opacity: 0.5;
.tooltip-icon {
margin-left: 16rpx;
}
}
}
</style>
<template>
<view class="shopping-cart footer" v-show="show">
<view class="shopping-cart-content">
<view class="shopping-cart-content-icon" @click="openCart">
<image :src="shoppingCartIcon" mode=""></image>
<u-badge size="mini" type="error" is-center :count="list.length"></u-badge>
</view>
<view class="shopping-cart-content-right">
<text>合计:</text>
<text class="shopping-cart-content-right-price">
<text>¥</text>
<text>{{totalPrice}}</text>
</text>
</view>
</view>
</view>
</template>
<script>
import { billBaseUrl } from '@/utils/config.js';
export default {
props:{
list:{
type:Array,
default:()=>[]
},
show:{
type:Boolean,
default:false
},
autoHide:{
type:Boolean,
default:true
}
},
watch:{
list:{
handler(val) {
if(!val.length){
if(this.autoHide){
this.$emit('update:show', false)
}
}
}
}
},
computed:{
totalPrice(){
let totalPrice=0
this.list.map(item=>{
totalPrice+=parseFloat(parseFloat(item.chargeStandard)*item.num)
})
return totalPrice
}
},
data() {
return {
shoppingCartIcon: billBaseUrl + 'shoufeijisuan@3x.png',
};
},
methods:{
openCart(){
this.$emit("handleClick")
}
}
};
</script>
<style lang="scss" scoped>
.shopping-cart {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #ffffff;
padding: 0 32rpx;
&-content {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 32rpx;
padding-bottom: 100rpx;
&-icon {
width: 36rpx;
height: 40rpx;
position: relative;
}
&-right {
line-height: 24rpx;
font-size: 24rpx;
display: flex;
// align-items: start;
align-items: center;
font-weight: bold;
&-price {
color: #fc524d;
line-height: 40rpx;
font-size: 40rpx;
}
}
}
}
</style>
This diff is collapsed.
<template> <template>
<!-- 查报价 --> <!-- 查报价 -->
<view class="quoted-price"> <view class="quoted-price">
<NavbarRight title="电子名片" imageWidth="20" />
<select-view></select-view>
<quoted-price-tips></quoted-price-tips> <quoted-price-tips></quoted-price-tips>
<quoted-price-step></quoted-price-step> <quoted-price-step></quoted-price-step>
<view class="quoted-price-brand"> <view class="quoted-price-brand">
...@@ -15,19 +17,24 @@ ...@@ -15,19 +17,24 @@
</template> </template>
<script> <script>
import NavbarRight from '@/components/navbar-right';
import QuotedPriceTips from './components/quoted-price-tips.vue'; import QuotedPriceTips from './components/quoted-price-tips.vue';
import QuotedPriceStep from './components/quoted-price-step.vue'; import QuotedPriceStep from './components/quoted-price-step.vue';
import SelectView from './components/select-view.vue';
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js'; import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
import { serviceTypeOptions, } from '@/utils/options/bill/quoted-price.js'; import { serviceTypeOptions, } from '@/utils/options/bill/quoted-price.js';
export default { export default {
components: { components: {
NavbarRight,
QuotedPriceTips, QuotedPriceTips,
QuotedPriceStep QuotedPriceStep,
SelectView
}, },
data() { data() {
return { return {
billBaseUrl, billBaseUrl,
backgroundImage:billBaseUrl+'baojiabeijing@3x.png',
list: serviceTypeOptions list: serviceTypeOptions
}; };
}, },
...@@ -46,7 +53,10 @@ export default { ...@@ -46,7 +53,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.quoted-price { .quoted-price {
padding: 0 24upx; padding: 0 24upx;
height: 100%;
background: url('https://static-book.kaying.cc/icon%2Fbill%2Fbaojiabeijing%403x.png') no-repeat ;
background-position: center top;
background-size: 100% 520rpx ;
&-brand { &-brand {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
<template>
<view class="list">
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<block v-else>
<view class="item" v-for="(item, index) in list" :key="item.id" @click="clickCell(item)">
<view class="item-left">
<view class="item-left-icon">
默认
</view>
<text>家电维安</text>
</view>
<view class="item-right">
<u-icon name="edit-pen"></u-icon>
</view>
</view>
</block>
<PopInput title="删除提醒" type="text" sureText="确定" content="确认删除该报价?" :visible.sync="showConfirm" @click="handleConfirm" @cancel="handleCancel" />
<submit-button @handleClick="add" plusIcon text="创建报价"></submit-button>
</view>
</template>
<script>
import NoData from '@/components/no-data';
import PopInput from '@/components/pop-input-view';
import SubmitButton from '@/components/submit-button/index.vue';
import { billBaseUrl } from '@/utils/config.js';
import { getList, deleteById, enable, close } from '@/api/mine/timed.js';
export default {
components: {
NoData,
PopInput,
SubmitButton
},
data() {
return {
billBaseUrl,
showConfirm: false,
readyDeleteItem: null,
loaded: false,
noDataText: '当前暂无内容',
noDataImage: 'bill/wuzhangdanneirong@3x.png',
list: [],
};
},
onReady() {
this.getList();
},
computed: {
noData() {
return (this.list || []).length == 0 && this.loaded;
}
},
onUnload() {
uni.$off("timed-sure-delete");
},
methods: {
async getList() {
this.loaded = false;
try {
let params = {
current: 1,
size: 99999
};
let { data } = await getList(params);
data.records.forEach(item => {
item.label = item.classification.name;
item.icon = item.classification.recordSelectedIcon;
item.show = false;
item.loading = false;
});
this.list = data.records || [];
} catch (e) {
console.log(e);
//TODO handle the exception
}
this.loaded = true;
},
add() {
this.$u.route({
url: '/pages/bill/quoted-price/create/create',
});
// uni.$once(`input-sure-create-price`, res => {
// this.$emit('update', {
// value: 'create-price',
// content: res.content
// });
// });
},
toEdit(id = '') {
this.$u.route({
url: '/pages/bill/quoted-price/create/create',
params: {
id: id
}
});
uni.$once(`refreshList`, res => {
this.getList();
});
// if(id){
// uni.$once(`timed-sure-delete`, res => {
// this.list.map(el => {
// if (el.id === res.id) {
// this.beforeDelete(el);
// }
// });
// });
// }
},
clickCell(item) {
},
beforeDelete(item) {
this.readyDeleteItem = item;
this.showConfirm = true;
},
handleConfirm() {
this.onDelete();
},
handleCancel() {
},
async onDelete() {
try {
let params = {
id: this.readyDeleteItem.id
};
let { data } = await deleteById(params);
this.getList();
} catch (e) {
console.log(e);
//TODO handle the exception
}
},
}
};
</script>
<style lang="scss" scoped>
.list {
width: 100%;
padding: 32rpx 24rpx;
padding-bottom: 144rpx;
min-height: 100%;
}
</style>
...@@ -159,18 +159,18 @@ export default { ...@@ -159,18 +159,18 @@ export default {
let scale = 1; let scale = 1;
let orangeColor = '#eb872f'; let orangeColor = '#eb872f';
let orangeBorderCss = '1rpx solid ' + orangeColor; let orangeBorderCss = '1rpx solid ' + orangeColor;
let borderCss = '2rpx solid #eeeeee'; let borderCss = '1px solid #eeeeee';
let trCss = { let trCss = {
width: '100%', width: '100%',
height: '36rpx', height: '18px',
lineHeight: '36rpx', lineHeight: '18px',
'border-top': borderCss 'border-top': borderCss
}; };
let thCss = { let thCss = {
height: '100%', height: '100%',
color: orangeColor, color: orangeColor,
padding: '0 4rpx', padding: '0 2px',
'border-right': borderCss, 'border-right': borderCss,
lineClamp: 1, lineClamp: 1,
display: 'inline-block', display: 'inline-block',
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
let tdCss = { let tdCss = {
height: '100%', height: '100%',
color: '#333333', color: '#333333',
padding: '0 4rpx', padding: '0 2px',
lineClamp: 1, lineClamp: 1,
'border-right': borderCss, 'border-right': borderCss,
display: 'inline-block', display: 'inline-block',
...@@ -191,9 +191,9 @@ export default { ...@@ -191,9 +191,9 @@ export default {
css: { css: {
width: '30%', width: '30%',
display: 'inline-block', display: 'inline-block',
fontSize: '14rpx', fontSize: '7px',
lineHeight: '22rpx', lineHeight: '11px',
'margin-bottom': '4rpx' 'margin-bottom': '2px'
}, },
views: [ views: [
{ {
...@@ -246,7 +246,7 @@ export default { ...@@ -246,7 +246,7 @@ export default {
type: 'view', type: 'view',
css: { css: {
...thCss, ...thCss,
width: `${106 * scale}rpx`, width: `${53 * scale}px`,
borderRight: 'none' borderRight: 'none'
}, },
views: [ views: [
...@@ -302,7 +302,7 @@ export default { ...@@ -302,7 +302,7 @@ export default {
{ {
type: 'view', type: 'view',
css: { css: {
width: `${582 * scale}rpx`, width: `${291 * scale}px`,
display: 'inline-block', display: 'inline-block',
}, },
views: tableBodyLeft views: tableBodyLeft
...@@ -311,13 +311,15 @@ export default { ...@@ -311,13 +311,15 @@ export default {
type: 'view', type: 'view',
css: { css: {
display: 'inline-block', display: 'inline-block',
padding: '0 4rpx', position: 'absolute',
width: `${110 * scale}rpx`, top:'0px',
right:'0px',
padding: '0 2px',
width: `${55 * scale}px`,
// #ifdef APP-PLUS // #ifdef APP-PLUS
boxSizing: 'border-box', right:'-1px',
padding: '0 6rpx',
// #endif // #endif
height: `${this.expenseArray.length * 36}rpx` height: `${this.expenseArray.length * 18}px`
}, },
views: [ views: [
{ {
...@@ -331,13 +333,11 @@ export default { ...@@ -331,13 +333,11 @@ export default {
]; ];
if (this.platform === '4') { if (this.platform === '4') {
if (this.isIOS) { if (this.isIOS) {
tableBody[0].css.width=`${574 * scale}rpx` tableBody[1].css.width=`${55 * scale}px`
tableBody[1].css.width=`${130 * scale}rpx` tableBody[1].views[0].css = { width: '55px', display: 'inline-block', boxSizing: 'border-box', height: '100%' };
tableBody[1].views[0].css = { width: '126rpx', display: 'inline-block', boxSizing: 'border-box', height: '100%' };
} else { } else {
tableBody[0].css.width=`${554 * scale}rpx` tableBody[1].css.width=`${60 * scale}px`
tableBody[1].css.width=`${140 * scale}rpx` tableBody[1].views[0].css = { verticalAlign:'top',padding:'4px 3px 0 3px',width: '66px', display: 'inline-block', boxSizing: 'border-box', height: '100%' };
tableBody[1].views[0].css = { verticalAlign:'top',padding:'8rpx 6rpx 0 6rpx',width: '190rpx', display: 'inline-block', boxSizing: 'border-box', height: '100%' };
} }
} }
let tableFooterCell = this.tableFooterOptions.map((item, index) => { let tableFooterCell = this.tableFooterOptions.map((item, index) => {
...@@ -372,8 +372,8 @@ export default { ...@@ -372,8 +372,8 @@ export default {
css: { css: {
...tdCss, ...tdCss,
'border-bottom': 'none', 'border-bottom': 'none',
lineHeight: '36rpx', lineHeight: '18px',
width: '48rpx' width: '24px'
}, },
views: [ views: [
{ {
...@@ -388,11 +388,11 @@ export default { ...@@ -388,11 +388,11 @@ export default {
...tdCss, ...tdCss,
'border-bottom': 'none', 'border-bottom': 'none',
borderRight: 'none', borderRight: 'none',
width: '652rpx', width: '326px',
display: 'flex', display: 'flex',
'align-items': 'center', 'align-items': 'center',
'text-align': 'left', 'text-align': 'left',
'padding-left': '16rpx' 'padding-left': '8px'
}, },
views: tableFooterCell views: tableFooterCell
} }
...@@ -424,7 +424,7 @@ export default { ...@@ -424,7 +424,7 @@ export default {
type: 'view', type: 'view',
css: { css: {
width: '100%', width: '100%',
height: '36rpx', height: '18px',
display: 'flex', display: 'flex',
'align-items': 'center', 'align-items': 'center',
'border-top': borderCss, 'border-top': borderCss,
...@@ -437,14 +437,15 @@ export default { ...@@ -437,14 +437,15 @@ export default {
type: 'view', type: 'view',
css: { css: {
position: 'absolute', position: 'absolute',
right: '-24rpx', right: '-12px',
top: '-5px',
// #ifdef APP-PLUS // #ifdef APP-PLUS
right: '-16rpx', right: '-8px',
top: this.isIOS?'0px':'-9px',
// #endif // #endif
top: '-18rpx', width: '5px',
width: '9rpx', fontSize: '5px',
fontSize: '10rpx', lineHeight: '8px',
lineHeight: '16rpx',
'text-align': 'center', 'text-align': 'center',
color: orangeColor color: orangeColor
}, },
...@@ -464,9 +465,9 @@ export default { ...@@ -464,9 +465,9 @@ export default {
css: { css: {
width: '25%', width: '25%',
display: 'inline-block', display: 'inline-block',
fontSize: '14rpx', fontSize: '7px',
lineHeight: '22rpx', lineHeight: '11px',
'margin-bottom': '4rpx' 'margin-bottom': '2px'
}, },
views: [ views: [
{ {
...@@ -505,9 +506,9 @@ export default { ...@@ -505,9 +506,9 @@ export default {
console.log(tableView); console.log(tableView);
this.poster = { this.poster = {
css: { css: {
width: `${750 * scale}rpx`, width: `${375 * scale}px`,
'background-color': '#FFFFFF', 'background-color': '#FFFFFF',
padding: '24rpx 16rpx', padding: '12px 8px',
color: '#333333' color: '#333333'
}, },
views: [ views: [
...@@ -516,8 +517,8 @@ export default { ...@@ -516,8 +517,8 @@ export default {
type: 'view', type: 'view',
css: { css: {
position: 'absolute', position: 'absolute',
top: '-20rpx', top: '-10px',
width: '702rpx', width: '351px',
display: 'flex', display: 'flex',
justifyContent: 'center' justifyContent: 'center'
}, },
...@@ -532,11 +533,11 @@ export default { ...@@ -532,11 +533,11 @@ export default {
type: 'text', type: 'text',
css: { css: {
display: 'inline-block', display: 'inline-block',
fontSize: '24rpx', fontSize: '12px',
textAlign: 'center', textAlign: 'center',
'font-weight': 'bold', 'font-weight': 'bold',
color: orangeColor, color: orangeColor,
'line-height': '52rpx' 'line-height': '26px'
}, },
text: this.stopInfo.name text: this.stopInfo.name
}, },
...@@ -544,11 +545,11 @@ export default { ...@@ -544,11 +545,11 @@ export default {
type: 'text', type: 'text',
css: { css: {
display: 'block', display: 'block',
'margin-top': '4rpx', 'margin-top': '2px',
// fontSize: '0rpx', // fontSize: '0rpx',
fontSize: '24rpx', fontSize: '12px',
'font-weight': 'bold', 'font-weight': 'bold',
height: '4rpx', height: '2px',
'border-top': orangeBorderCss, 'border-top': orangeBorderCss,
'border-bottom': orangeBorderCss, 'border-bottom': orangeBorderCss,
color: 'rgba(255,255,255,0)' color: 'rgba(255,255,255,0)'
...@@ -563,7 +564,7 @@ export default { ...@@ -563,7 +564,7 @@ export default {
{ {
type: 'view', type: 'view',
css: { css: {
'margin-top': '60rpx', 'margin-top': '30px',
// display: 'flex', // display: 'flex',
// 'flex-wrap': 'wrap', // 'flex-wrap': 'wrap',
overflow: 'hidden' overflow: 'hidden'
...@@ -574,11 +575,11 @@ export default { ...@@ -574,11 +575,11 @@ export default {
{ {
type: 'view', type: 'view',
css: { css: {
width: '702rpx', width: '351px',
fontSize: '14rpx', fontSize: '7px',
lineHeight: '22rpx', lineHeight: '11px',
textAlign: 'left', textAlign: 'left',
marginTop: '6rpx', marginTop: '3px',
border: borderCss border: borderCss
}, },
views: tableView views: tableView
...@@ -587,7 +588,7 @@ export default { ...@@ -587,7 +588,7 @@ export default {
{ {
type: 'view', type: 'view',
css: { css: {
'margin-top': '10rpx', 'margin-top': '5px',
overflow: 'hidden' overflow: 'hidden'
}, },
views: footerView views: footerView
......
import {
billBaseUrl
} from '@/utils/config.js';
export const tabsOptions = [{ export const tabsOptions = [{
value: "1", value: "1",
label: "空调", label: "空调",
...@@ -21,17 +25,17 @@ export const tabsOptions = [{ ...@@ -21,17 +25,17 @@ export const tabsOptions = [{
export const serviceTypeOptions = [{ export const serviceTypeOptions = [{
value: "WX", value: "WX",
label: "维修", label: "维修",
icon:"baojiaweixiu@3x.png" icon: "baojiaweixiu@3x.png"
}, },
{ {
value: "AZ", value: "AZ",
label: "安装", label: "安装",
icon:"baojiaanzhaung@3x.png" icon: "baojiaanzhaung@3x.png"
}, },
{ {
value: "BY", value: "BY",
label: "清洗保养", label: "清洗保养",
icon:"baojiabaoyang@3x.png" icon: "baojiabaoyang@3x.png"
}, },
// { // {
...@@ -51,3 +55,16 @@ export const serviceTypeOptions = [{ ...@@ -51,3 +55,16 @@ export const serviceTypeOptions = [{
// icon:"baojiahuishou@3x.png" // icon:"baojiahuishou@3x.png"
// }, // },
] ]
export const createCategoryOptions = [{
value: "1",
label: "服务分类",
icon: billBaseUrl + "fuwufenleitubiao@3x.png"
},
{
value: "2",
label: "服务价格",
icon: billBaseUrl + "fuwujiagetubiao@3x.png"
},
]
...@@ -181,33 +181,33 @@ export const tableCellOptions = [{ ...@@ -181,33 +181,33 @@ export const tableCellOptions = [{
export const canvasTableCellOptions = [{ export const canvasTableCellOptions = [{
value: "index", value: "index",
label: "序号", label: "序号",
width:"48rpx", width:"24px",
}, },
{ {
value: "name", value: "name",
label: "商品/服务名称", label: "商品/服务名称",
width:"142rpx", width:"71px",
}, },
{ {
value: "unit", value: "unit",
label: "单位", label: "单位",
width:"64rpx", width:"32px",
}, },
{ {
value: "number", value: "number",
label: "数量", label: "数量",
width:"64rpx", width:"32px",
}, },
{ {
value: "unitPrice", value: "unitPrice",
label: "单价", label: "单价",
width:"102rpx", width:"51px",
currencySign:'¥', currencySign:'¥',
}, },
{ {
value: "total", value: "total",
label: "金额", label: "金额",
width:"102rpx", width:"51px",
currencySign:'¥', currencySign:'¥',
}, },
] ]
......
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