Commit 356fb247 authored by chuan.liu's avatar chuan.liu

制票单页面新增

parent ddb48118
...@@ -447,6 +447,21 @@ ...@@ -447,6 +447,21 @@
} }
} }
} }
},
{
"path": "pages/ticket-order/ticket-order",
"style": {
"app-plus": {
"titleNView": {
"titleAlign": "left",
"titleColor": "#333",
"titleSize": "17px",
"backgroundColor": "#fff",
"titleText": "制票单",
"autoBackButton": true
}
}
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -368,10 +368,6 @@ ...@@ -368,10 +368,6 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.uni-collapse-item{
flex-direction: column;
}
.refresh { .refresh {
justify-content: center; justify-content: center;
} }
......
<template>
<view class="order view">
<view class="top">
<text class="title-no">制票编号:TP10000021</text>
<view class="title-info">
<button class="title-info__status" type="default">待审批</button>
</view>
</view>
<view class="middle view">
<text class="middle-title">配额酒制票通知单(计划内)</text>
<view class="text-block">
<text class="middle-date">2021-08-06 05:14</text>
<text class="middle-date-des">下单日期</text>
</view>
<view class="text-block">
<text class="middle-date middle-billno">92353634474578</text>
<text class="middle-date-des">发票号</text>
</view>
</view>
<view class="bottom view">
<view class="bottom-nav">
<view class="bottom-nav-arrow" @click="handleShowDetail">
<text class="arrow-des">明细</text>
<image class="icon-arrow" :class="{'icon-arrow-rotate':ishowDetail}"
src="@/static/image/arrow_up@3x.png" mode="aspectFit"></image>
</view>
</view>
<view v-if="ishowDetail" class="bottom-content">
<view class="text-block">
<text class="middle-date">五粮液1618</text>
<text class="middle-date-des">产品描述</text>
</view>
<view class="text-block">
<text class="middle-date">52% 500ml *4</text>
<text class="middle-date-des">规格</text>
</view>
<view class="text-block-2">
<view class="text-block text-block-1">
<text class="middle-date">100</text>
<text class="middle-date-des">开票件数</text>
</view>
<view class="text-block">
<text class="middle-date">瓶</text>
<text class="middle-date-des">单位</text>
</view>
</view>
<view class="text-block-2">
<view class="text-block text-block-1">
<text class="middle-date">100</text>
<text class="middle-date-des">单价</text>
</view>
<view class="text-block">
<text class="middle-date">4000</text>
<text class="middle-date-des">数量</text>
</view>
</view>
<view class="text-block-2">
<view class="text-block text-block-1">
<text class="middle-date">100</text>
<text class="middle-date-des">剩余开票件数</text>
</view>
<view class="text-block">
<text class="middle-date">17%</text>
<text class="middle-date-des">税率</text>
</view>
</view>
<view class="text-block-2">
<view class="text-block text-block-1">
<text class="middle-date">100</text>
<text class="middle-date-des">剩余发货件数</text>
</view>
<view class="text-block">
<text class="middle-date">400,000.00</text>
<text class="middle-date-des">价税合计</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
newsItem: {
type: Object,
default: function(e) {
return {}
}
}
},
data() {
return {
ishowDetail: true
}
},
methods: {
click() {
this.$emit('click');
},
close(e) {
e.stopPropagation();
this.$emit('close');
},
handleShowDetail() {
this.ishowDetail = !this.ishowDetail
},
}
}
</script>
<style lang="scss" scoped>
.view {
flex-direction: column;
}
.order {
flex: 1;
background: #ffffff;
border-radius: 16rpx 100rpx 16rpx 16rpx;
box-shadow: 0px 2px 4px 0px #dbe4ee;
margin-bottom: 60rpx;
margin-top: 28rpx;
padding-top: 30rpx;
}
.top {
height: 72rpx;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
.title-no {
font-size: 24rpx;
color: #555555;
}
.title-info {
align-items: center;
margin-right: 26rpx;
}
.title-info__status {
width: 120rpx;
height: 48rpx;
line-height: 48rpx;
background: #f61d30;
border-radius: 8rpx 200rpx 200rpx 8rpx;
font-size: 12px;
color: #fff;
text-align: center;
}
.middle {
position: relative;
padding: 26rpx 32rpx;
}
.middle-title {
font-weight: 500;
font-size: 32rpx;
color: $text-base-color;
margin-bottom: 32rpx;
font-family: PingFangSC, PingFangSC-Medium;
}
.text-block {
flex: 1;
flex-direction: column;
margin-bottom: 32rpx;
}
.middle-date {
font-size: 28rpx;
color: $text-base-color;
margin-bottom: 8rpx;
}
.middle-date-des {
font-size: 24rpx;
color: #999;
}
.bottom {
padding: 0 50rpx 48rpx;
}
.bottom-nav {
height: 40rpx;
justify-content: flex-end;
align-items: center;
}
.bottom-nav-arrow{
align-items: center;
}
.arrow-des {
font-size: 24rpx;
color: #999;
}
.icon-arrow {
width: 7px;
height: 4px;
margin-left: 16rpx;
margin-top: 2px;
transition-property: transform;
transition-duration: 0.15s;
transform: rotate(0deg);
}
.icon-arrow-rotate {
transform: rotate(180deg);
}
.bottom-content {
flex-direction: column;
margin-top: 48rpx;
}
.text-block-2 {
flex-direction: row;
}
.text-block-1 {
flex: 2;
}
</style>
<template>
<view class="page-news">
<uni-list ref="list" class="listview" :enableBackToTop="true" :scroll-y="true" @scrolltolower="loadMore()">
<uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
<div class="refresh-view">
<image class="refresh-icon" :src="refreshIcon" :style="{width: (refreshing || pulling) ? 0: '32px'}" :class="{'refresh-icon-active': refreshFlag}"></image>
<uni-load-more v-if="refreshing" class="loading-icon" status="loading" :contentText="loadingMoreText"></uni-load-more>
<text class="loading-text">{{refreshText}}</text>
</div>
</uni-refresh>
<uni-cell v-for="(item, index) in dataList" :key="item.id">
<order-item :newsItem="item" @click="goDetail(item)"></order-item>
</uni-cell>
<uni-cell v-if="isLoading || dataList.length > 4">
<view class="loading-more">
<text class="loading-more-text">{{loadingText}}</text>
</view>
</uni-cell>
</uni-list>
<!-- <no-data class="no-data" v-if="isNoData" @retry="loadMore"></no-data> -->
</view>
</template>
<script>
import uniList from '@/components/uni-list.vue';
import uniCell from '@/components/uni-cell.vue';
import uniRefresh from '@/components/uni-refresh.vue';
import uniLoadMore from '@/components/uni-load-more.vue';
import noData from '@/components/nodata.nvue';
import orderItem from './order-item.nvue';
export default {
components: {
uniList,
uniCell,
uniRefresh,
uniLoadMore,
noData,
orderItem
},
props: {
nid: {
type: [Number, String],
default: ''
}
},
data() {
return {
dataList: [],
navigateFlag: false,
pulling: false,
refreshing: false,
refreshFlag: false,
refreshText: "",
isLoading: false,
loadingText: '加载中...',
isNoData: false,
pulling: false,
angle: 0,
loadingMoreText: {
contentdown: '',
contentrefresh: '',
contentnomore: ''
},
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg=="
}
},
created() {
this.pullTimer = null;
this.requestParams = {
columnId: this.nid,
minId: 0,
pageSize: 10,
column: 'id,post_id,title,author_name,cover,published_at,comments_count'
};
this._isWidescreen = false;
// #ifdef H5
var mediaQueryOb = uni.createMediaQueryObserver(this)
mediaQueryOb.observe({
minWidth: 768
}, matches => {
this._isWidescreen = matches;
})
// #endif
},
methods: {
loadData(refresh) {
if (this.isLoading) {
return;
}
this.isLoading = true;
this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
var startTime = new Date();
uni.request({
// url: this.$host + 'api/news',
url: 'https://unidemo.dcloud.net.cn/api/news',
data: this.requestParams,
success: (result) => {
var endTime = new Date();
const data = result.data;
this.isNoData = (data.length <= 0);
const data_list = data.map((news) => {
return {
id: this.newGuid() + news.id,
newsid: news.id,
article_type: 1,
datetime: (new Date(news.published_at.replace(/\-/g, '/')).getTime()),
title: news.title,
image_url: news.cover,
source: news.author_name,
comment_count: news.comments_count,
post_id: news.post_id
};
});
if (refresh) {
this.dataList = data_list;
this.requestParams.minId = 0;
} else {
this.dataList = this.dataList.concat(data_list);
this.requestParams.minId = data[data.length - 1].id;
}
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]);
}
},
fail: (err) => {
if (this.dataList.length == 0) {
this.isNoData = true;
}
},
complete: (e) => {
this.isLoading = false;
if (refresh) {
this.refreshing = false;
this.refreshFlag = false;
this.refreshText = "已刷新";
if (this.pullTimer) {
clearTimeout(this.pullTimer);
}
this.pullTimer = setTimeout(() => {
this.pulling = false;
}, 1000);
}
}
});
},
loadMore(e) {
this.loadData();
},
clear() {
this.dataList.length = 0;
this.requestParams.minId = 0;
},
goDetail(detail) {
},
refreshData() {
if (this.isLoading) {
return;
}
this.pulling = true;
this.refreshing = true;
this.refreshText = "正在刷新...";
this.loadData(true);
},
onrefresh(e) {
this.refreshData();
// #ifdef APP-NVUE
this.$refs.list.resetLoadmore();
// #endif
},
onpullingdown(e) {
if (this.refreshing) {
return;
}
// var angle = (e.pullingDistance) / e.viewHeight * 180;
// if (angle > 180) {
// angle = 180;
// }
// tab.angle = angle;
this.pulling = false;
if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
this.refreshFlag = true;
this.refreshText = "释放立即刷新";
} else {
this.refreshFlag = false;
this.refreshText = "下拉可以刷新";
}
},
newGuid() {
let s4 = function() {
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
}
return (s4() + s4() + "-" + s4() + "-4" + s4().substr(0, 3) + "-" + s4() + "-" + s4() + s4() + s4()).toUpperCase();
}
}
}
</script>
<style lang="scss" scoped>
.no-data {
flex: 1;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.page-news {
flex: 1;
flex-direction: column;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.listview {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
/* #ifndef MP-ALIPAY */
flex-direction: column;
/* #endif */
}
.refresh {
justify-content: center;
}
.refresh-view {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 750rpx;
height: 64px;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
.refresh-icon {
width: 32px;
height: 32px;
transition-duration: .5s;
transition-property: transform;
transform: rotate(0deg);
transform-origin: 15px 15px;
}
.refresh-icon-active {
transform: rotate(180deg);
}
.loading-icon {
width: 28px;
height: 28px;
margin-right: 5px;
color: gray;
}
.loading-text {
margin-left: 2px;
font-size: 16px;
color: #999999;
}
.loading-more {
align-items: center;
justify-content: center;
padding-top: 14px;
padding-bottom: 14px;
text-align: center;
}
.loading-more-text {
font-size: 28upx;
color: #999;
}
</style>
This diff is collapsed.
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<text class="entry-bill-text">生产下单</text> <text class="entry-bill-text">生产下单</text>
</view> </view>
<view class="entry-block"> <view class="entry-block" @click="goPage('ticket-order')">
<view class="entry-bill"> <view class="entry-bill">
<image class="entry-bill-icon" src="@/static/image/uc_company@3x.png" mode=""></image> <image class="entry-bill-icon" src="@/static/image/uc_company@3x.png" mode=""></image>
</view> </view>
......
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