ccjgmwz 4 年之前
父节点
当前提交
cb8711abe5
共有 1 个文件被更改,包括 157 次插入0 次删除
  1. 157 0
      unimall-app/pageB/contract/look.vue

+ 157 - 0
unimall-app/pageB/contract/look.vue

@@ -0,0 +1,157 @@
+<template>
+	<view class="container">
+		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold1()'>
+			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
+				<text>结算价({{contractInfo.sumNet}})</text>
+				<text>已收({{contractInfo.payMoney}})</text>
+				<text>未收({{contractInfo.notPayMoney}})</text>
+			</view>
+			<view :class="isOpen1 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
+		</view>
+		<view :class="isOpen1 ? 'content-open' : 'content-close'" class='content1'>
+			<view class='flex justify-between padding-xs'>
+				<view>车牌号</view>
+				<view>净重</view>
+				<view>结算单价</view>
+			</view>
+			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList'>
+				<view>{{item.carNo}}</view>
+				<view>{{item.netWeight}}</view>
+				<view>{{item.SumPrice}}</view>
+			</view>
+		</view>
+		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold2()'>
+			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
+				<text>平仓({{contractInfo.payMoneyClose}})</text>
+				<text>结算价({{contractInfo.sumNetClose}})</text>
+			</view>
+			
+			<view :class="isOpen2 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
+		</view>
+		<view :class="isOpen2 ? 'content-open' : 'content-close'" class='content2'>
+			<view class='flex justify-between padding-xs'>
+				<view>平仓吨数</view>
+				<view>结算单价</view>
+			</view>
+			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList1'>
+				<view>{{item.closeTon}}</view>
+				<view>{{item.sumPriceClose}}</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+			data() {
+				return {
+					contractInfo: [],
+					pages:1,//页数
+					limit:10 ,//每次取条目数
+					price: 0,
+					loadStatus:'loading',  //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+					isLoadMore:false, //是否加载中
+					isOpen1:false,
+					isOpen2:false
+				};
+			},
+			computed: {
+				...mapState(['hasLogin','userInfo'])
+			},
+			onShow() {
+				
+			},
+			//下拉刷新
+			onPullDownRefresh() {
+				this.pages = 1
+				this.isLoadMore = false
+				this.loadStatus = 'loading'
+				this.loadData()
+			},
+			onLoad(options) {
+				this.contractNo=options.contractNo
+				this.loadData()
+			},
+			// onPageScroll(e) {
+			// 	//兼容iOS端下拉时顶部漂移
+			// 	if (e.scrollTop >= 0) {
+			// 		this.headerPosition = "fixed";
+			// 	} else {
+			// 		this.headerPosition = "absolute";
+			// 	}
+			// },
+			onReachBottom(){  //上拉触底函数
+			  if(!this.isLoadMore){  //此处判断,上锁,防止重复请求
+					this.isLoadMore=true
+					this.pages += 1
+					this.getContractData()
+			  }
+			},
+			
+			methods: {
+				unfold1(){
+					this.isOpen1=!this.isOpen1
+				},
+				unfold2(){
+					this.isOpen2=!this.isOpen2
+				},
+				async loadData() {
+					const that = this
+					uni.showLoading({
+						title: '正在加载'
+					})
+					that.$api.request('contract', 'getContractInfo',{
+						page: this.pages,
+						limit:this.limit,
+						contractNo:that.contractNo
+					}, failres => {
+						that.$api.msg(failres.errmsg)
+						this.isLoadMore = false
+						this.loadStatus = 'nomore'
+						if(this.pages>1){this.pages=1}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					}).then(res => {
+						that.contractInfo = res.data
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					})
+					if (!this.hasLogin) {
+						uni.showModal({
+							title: '登录提示',
+							content: '您尚未登录,是否立即登录?',
+							showCancel: true,
+							confirmText: '登录',
+							success: (e) => {
+								if (e.confirm) {
+									uni.navigateTo({
+										url: '/pages/public/login'
+									})
+								}
+							},
+							fail: () => {},
+							complete: () => {}
+						})
+					}
+				},
+			},
+		}
+</script>
+
+<style scoped>
+	.padding-xl{
+		padding:25rpx 50rpx;
+	}
+	.content-open{
+		display:block;
+	}
+	.content1,.content2{
+		padding: 10rpx 50rpx;
+	}
+	.content-close{
+		display:none;
+	}
+</style>