monthlyPlan.vue 9.03 KB
Newer Older
王建威's avatar
王建威 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<template>
	<view class="main">
		<view class="top_bar">
			<view class="left" @click="$backup">
				<text class="eosfont left_icon">&#xe743;</text>l
				<text class="close_title">关闭</text>
			</view>
			<text class="middle">我的包年计划</text>
			<text class="my_contract" @click="$jump('/pages/monthlyContract/monthlyContract',2)">我的合同</text>
		</view>
		<view class="plan_info">
			<view class="info_title">当前累计已采购 (元)</view>
			<view class="info_amount">{{month_apply_info.total_amount}}</view>
			<view class="wait" v-if="month_apply_info.apply_status=== '1'" @click="$jump(`/pages/monthlyDeposit/monthlyDeposit?month_apply_id=${month_apply_info.month_apply_id}`,2)">您有一笔押金等待缴纳</view>
			<view class="info_detail">
				<view class="detail_item">
					<view class="title1">{{month_apply_info.date_diff}}</view>
					<view class="title2">剩余时间</view>
				</view>
				<text class="line"></text>
				<view class="detail_item">
					<view class="title1">{{month_apply_info.min_quantity}}</view>
					<view class="title2">计划总采购</view>
				</view>
				<text class="line"></text>
				<view class="detail_item">
					<view class="title1">{{month_apply_info.discount*10}}</view>
					<view  class="title2">当前享折扣</view>
				</view>
			</view>
		</view>
		<view class="mid_card">
			<view class="mid_left">
				<view class="text1">包年计划商品专区</view>
				<view class="text2">自由搭配 采购钜惠</view>
			</view>
			<view class="mid_right">
				<view class="text1">折扣采购</view>
				<view class="text2" @click="$jump('/pages/monthly/monthly',2)">去看看</view>
			</view>
		</view>
		<view class="pro_title">
			采购明细
			<text>/包含计划内商品的订单</text>
		</view>
		<view v-if="month_order_list !== null">
			<view class="pro_item" v-for="(item, index) in month_order_list" :key="index">
				<view class="item_top">计划内采购金额:<text>¥{{item.total_price}}</text></view>
				<view class="item_content">
王建威's avatar
王建威 committed
50
					<view class="content_item" v-for="(vo, key) in item.child" :key="key" @click="$jumpOrderDetail(vo.order_id)">
王建威's avatar
王建威 committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
						<image class="item_img" :src="vo.goods_image || $noGoodsImg"/>
						<view>
							<view class="item_name">{{vo.goods_name}}</view>
							<view class="item_spec" v-if="vo.specification" v-html="vo.specification"></view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-else class="no_data">
			<view class="no_title">暂无记录</view>
			<view class="no_btn" @click="$jump('/pages/monthly/monthly',2)">前往专区</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				month_apply_info: [],
				month_order_list: []
			}
		},
		onLoad(options) {
			let month_apply_id = options.month_apply_id;
			uni.request({
				url: '/uni/api/month/GetMyMonthApply',
				method: 'POST',
				data: {
					month_apply_id: month_apply_id
				},
				dataType: 'json',
				success: (res) => {
					if(res.data.code === 0) {
						this.month_apply_info = res.data.data.month_apply_info[0];
						res.data.data.month_order_list !== null && res.data.data.month_order_list.map((item, index) => {
							item.child.map((vo, key) => {
								if(!vo.specification) return
								vo.specification = vo.specification.replace(/src/, 'style="width:18px;height:18px;vertical-align:middle;" src');
							});
							
						});
						this.month_order_list = res.data.data.month_order_list;
王建威's avatar
王建威 committed
95 96 97 98 99 100 101 102
					} else {
						uni.showModal({
							title: '提示',
							content: '当前没有可履行的合同',
							success: () => {
								this.$jump('/pages/monthly/monthly',2);
							}
						})
王建威's avatar
王建威 committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
					}
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		.top_bar {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 80rpx;
			padding: 0 20rpx;
			.left {
				display: flex;
				align-items: center;
				color: #7c7c7c;
				.left_icon {
					font-weight: 900;
					margin-right: 10rpx;
					color: #000;
					font-size: 40rpx;
				}
				.close_title {
					font-size: 28rpx;
					color: #212121;
					margin-left: 10rpx;
				}
			}
			.middle {
				text-align: center;
				color: #000;
				font-size: 32rpx;
				line-height: 44rpx;
				font-family:PingFangSC-Medium,PingFang SC;
				font-weight:500;
			}
			.my_contract {
				color: #000;
				font-size: 26rpx;
				line-height: 36rpx;
			}
		}
		.plan_info {
			background:linear-gradient(135deg,rgba(255,232,199,1) 0%,rgba(214,163,93,1) 100%);
			overflow: hidden;
			.info_title {
				text-align: center;
				font-size: 28rpx;
				height: 40rpx;
				line-height: 40rpx;
				font-family:PingFangSC-Medium,PingFang SC;
				font-weight:500;
				color: rgba(0,0,0,0.6);
				margin-top: 40rpx;
			}
			.info_amount {
				text-align: center;
				font-size: 64rpx;
				color: #000;
				height: 90rpx;
				line-height: 90rpx;
				font-family:PingFangSC-Semibold,PingFang SC;
				font-weight:600;
			}
			.wait {
				width: 340rpx;
				height: 64rpx;
				line-height: 64rpx;
				text-align: center;
				border-radius: 32rpx;
				background-color: rgba(0,0,0,0.5);
				color: #fff;
				font-size: 28rpx;
				margin: 24rpx auto 0;
			}
			.info_detail {
				width: 710rpx;
				height: 160rpx;
				margin: 24rpx auto 0;
				border-radius:32rpx 32rpx 12rpx 12rpx;
				background:linear-gradient(180deg,rgba(51,51,51,1) 0%,rgba(48,47,53,1) 100%);
				box-shadow:0px 4rpx 60rpx 0px rgba(0,0,0,0.1);
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 36rpx;
				box-sizing: border-box;
				.line {
					width: 2rpx;
					height: 40rpx;
					background-color: #000;
				}
				.detail_item {
					text-align: center;
					min-width: 180rpx;
					.title1 {
						color: #FCE3C1;
						font-size: 36rpx;
						font-family:PingFangSC-Semibold,PingFang SC;
						font-weight:600;
						height: 50rpx;
						line-height: 50rpx;
					}
					.title2 {
						margin-top: 8rpx;
						color: rgba(253,228,194,0.5);
						font-size: 26rpx;
						line-height: 36rpx;
						height: 36rpx;
					}
				}
			}
		}
		.mid_card {
			width: 702rpx;
			height: 120rpx;
			margin: 30rpx auto 40rpx;
			border-radius: 16rpx;
			overflow: hidden;
			display: flex;
			.mid_left {
				background:linear-gradient(135deg,rgba(47,46,51,1) 0%,rgba(69,75,93,1) 100%);
				width: 422rpx;
				height: 100%;
				display: flex;
				justify-content: center;
				flex-direction: column;
				padding-left: 40rpx;
				.text1 {
					font-size: 32rpx;
					color: #FDE4C2;
					height: 44rpx;
					line-height: 44rpx;
					font-family:PingFangSC-Medium,PingFang SC;
					font-weight:500;
				}
				.text2 {
					font-size: 22rpx;
					color:rgba(253,228,194,0.6);
					height: 32rpx;
					line-height: 32rpx;
					letter-spacing: 2rpx;
					margin-top: 4rpx;
				}
			}
			.mid_right {
				width: 240rpx;
				height: 100%;
				background-color: #EFD5A2;
				display: flex;
				flex-direction: column;
				justify-content: center;
				.text1 {
					color: #2F2E33;
					font-size: 32rpx;
					height: 44rpx;
					line-height: 44rpx;
					font-family:PingFangSC-Medium,PingFang SC;
					font-weight:500;
					margin: -6rpx 0 6rpx 78rpx;
				}
				.text2 {
					width: 120rpx;
					height: 40rpx;
					line-height: 40rpx;
					text-align: center;
					background-color: #3B3E4A;
					border-radius: 20rpx;
					font-size: 24rpx;
					color: #fff;
					margin-left: 82rpx;
				}
			}
		}
		.pro_title {
			font-size: 36rpx;
			height: 50rpx;
			line-height: 50rpx;
			font-family:PingFangSC-Medium,PingFang SC;
			font-weight:500;
			padding-left: 24rpx;
			margin-bottom: 24rpx;
			text {
				margin-left: 16rpx;
				color: #959595;
				font-size: 28rpx;
				font-weight: initial;
			}
		}
		.pro_item {
			width: 702rpx;
			margin: 0 auto 34rpx;
			.item_top {
				width: 392rpx;
				height: 60rpx;
				line-height: 60rpx;
				background-color: #FAE0BB;
				border-radius:16rpx 80rpx 0px 0px;
				color: #2F2E33;
				font-size: 26rpx;
				line-height: 60rpx;
				padding-left: 20rpx;
				text {
					font-size: 32rpx;
					font-weight: 500;
				}
			}
			.item_content {
				background-color: #fff;
				padding: 24rpx 24rpx 0;
				box-shadow:0px 4rpx 60rpx 0px rgba(0,0,0,0.05);
				border-radius:20rpx;
				.content_item {
					padding-bottom: 24rpx;
					display: flex;
					.item_img {
						width: 160rpx;
						height: 160rpx;
						border-radius: 16rpx;
						margin-right: 24rpx;
					}
					.item_name {
						color: #212121;
						font-size: 28rpx;
						height: 40rpx;
						line-height: 40rpx;
						margin-bottom: 8rpx;
					}
					.item_spec {
						height: 36rpx;
						line-height: 36rpx;
						border-radius: 16rpx;
						background-color: #F5F5F5;
						padding: 0 16rpx;
						color: #7C7C7C;
						font-size: 22rpx;
					}
				}
			}
		}
		.no_data {
			margin-top: 120rpx;
			.no_title {
				color: #959595;
				font-size: 30rpx;
				height: 42rpx;
				line-height: 42rpx;
				text-align: center;
			}
			.no_btn {
				width: 180rpx;
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				border-radius: 10rpx;
				background-color: #E2B77C;
				font-size: 26rpx;
				color: #302F35;
				margin: 40rpx auto 0;
			}
		}
	}
</style>