Sfoglia il codice sorgente

订单商品显示优化

hwb0 3 anni fa
parent
commit
11d918fa81

+ 8 - 0
App.vue

@@ -76,4 +76,12 @@
 		align-items: center;
 		justify-content: center;
 	}
+	
+	.ells{
+		overflow: hidden;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 2;
+	}
 </style>

+ 1 - 1
pages/about/index.vue

@@ -4,7 +4,7 @@
 		<view class="about">
 			<view class="flex about-logo">
 				<image src="../../static/logo.png" mode=""></image>
-				<view class="edition">v 1.0.5</view>
+				<view class="edition">v 1.0.6</view>
 			</view>
 			<view class="about-action">
 				<u-cell-group :border="false">

+ 1 - 1
pages/bean/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="我的豆"></u-navbar>
+		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="我的豆"></u-navbar>
 		<view class="bean">
 			<view class="flex bean-balance">
 				<image src="../../static/icon/bean.png" mode="aspectFill"></image>

+ 9 - 4
pages/choice/index.vue

@@ -14,7 +14,7 @@
 						</view>
 						<view class="title" v-if="item.prizeType && item.prizeType.value != 'coin'">{{ item.title }}
 						</view>
-						<view class="title" v-else>豆x {{ item.value }}</view>
+						<view class="title" v-else>豆x {{ item.value }}</view>
 						<view class="tip" v-if="item.remainQty == 0">已兑完</view>
 						<view class="flex action-icon" v-if="actionIndex == index && total > 1">
 							<u-icon name="checkmark" color="#fff" size="24"></u-icon>
@@ -41,11 +41,11 @@
 					<view class="title" v-if="actionInfo.prizeType && actionInfo.prizeType.value != 'coin'">
 						{{ actionInfo.title }}
 					</view>
-					<view class="title" v-else>豆x {{ actionInfo.value }}</view>
+					<view class="title" v-else>豆x {{ actionInfo.value }}</view>
 				</view>
 				<view class="confirm-prize-tip" v-if="actionInfo.prizeType && actionInfo.prizeType.value != 'coin'">
 					已放入我的奖品库</view>
-				<view class="confirm-prize-tip" v-else>已放入“我的豆”</view>
+				<view class="confirm-prize-tip" v-else>已放入“我的豆”</view>
 				<view class="flex confirm-prize-btn">
 					<view class="back" @click="back">返回</view>
 					<view class="confirm" @click="toPrize">前往查看</view>
@@ -320,7 +320,7 @@
 		align-items: center;
 		justify-content: center;
 		width: 80vw;
-		padding: 40rpx 0;
+		padding: 40rpx 0 0;
 
 		&-info {
 			width: 80%;
@@ -331,6 +331,11 @@
 				width: 150rpx;
 				height: 200rpx;
 			}
+				
+			.title{
+				flex: 1;
+				padding-left: 40rpx;
+			}
 		}
 
 		&-tip {

+ 8 - 8
pages/goods/detail.vue

@@ -178,10 +178,7 @@
 			},
 
 			exChange() {
-				this.getBean()
-				if(uni.getStorageSync('token')){
-					this.choiceShow = true
-				}
+				this.choiceShow = true
 			},
 
 			close() {
@@ -214,11 +211,13 @@
 			},
 
 			confirmPrize() {
+				let flag = false
 				let data = {
 					goodsId: this.payInfo.goodsId,
 					skuId: this.payInfo.skuId,
 					orderNum: this.orderNum,
 				}
+				if(flag) return
 				if(this.payInfo.quantity == 0){
 					uni.$u.toast('库存不足');
 					return
@@ -227,21 +226,22 @@
 					uni.$u.toast('库存不足');
 					return
 				}
-				if (this.initData.coinNum < this.payInfo.exchangePrice) {
-					uni.$u.toast('芒豆余额不足');
-					return
-				}
 				uni.showLoading({
 					title: '兑换中'
 				});
+				flag = true
 				$http.post('/api/v1/mp/user/exchange/submit', data).then(res=>{
 					uni.hideLoading();
+					flag = false
 					if(res.code == 0){
 						this.choiceShow = false
 						this.tipShow = true
 						this.getDetail()
+					}else{
+						uni.$u.toast(res.msg);
 					}
 				}).catch(() => {
+					flag = false
 					uni.hideLoading();
 				})
 			},

+ 23 - 10
pages/login/index.vue

@@ -1,11 +1,11 @@
 <template>
-	<view class="flex container">
+	<view class="container">
 		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" title="微信授权"></u-navbar>
-		<view class="login">
+		<view class="flex login">
 			<view class="flex login-image">
 				<image src="../../static/logo.png" mode=""></image>
+				<view class="login-image-txt">盲票</view>
 			</view>
-			<view class="login-txt">盲票</view>
 			<view class="login-txt">盲票将为您提供</view>
 			<view class="login-title">商品兑换、盲票购买等服务 请先完成授权登录</view>
 			<view class="login-btn">
@@ -43,7 +43,7 @@
 						uni.setStorageSync('token', res.token)
 						this.getBaseInfo()
 					}
-				}).catch(()=>{
+				}).catch(() => {
 					uni.hideLoading();
 				})
 			},
@@ -74,7 +74,7 @@
 							this.authShow = true
 						}
 					}
-				}).catch(()=>{
+				}).catch(() => {
 					uni.hideLoading();
 				})
 			},
@@ -86,17 +86,30 @@
 	.container {
 		height: 100vh;
 		width: 100%;
-		flex-direction: column;
 	}
 
 	.login {
+		flex-direction: column;
+		
 		&-image {
+			flex-direction: column;
+			padding: 100rpx 0 200rpx;
+
 			image {
 				width: 164rpx;
 				height: 164rpx;
 				border-radius: 10rpx;
 				margin-bottom: 14rpx;
 			}
+
+			&-txt {
+				text-align: center;
+				line-height: 40rpx;
+				font-weight: bold;
+				margin-bottom: 20rpx;
+				font-size: 36rpx;
+			}
+
 		}
 
 		&-txt {
@@ -115,10 +128,10 @@
 
 		&-btn {
 			button {
-				width: 570rpx;
-				height: 60rpx;
-				line-height: 60rpx;
-				border-radius: 30rpx;
+				width: 600rpx;
+				height: 80rpx;
+				line-height: 80rpx;
+				border-radius: 40rpx;
 				background-color: rgba(235, 112, 9, 100);
 				color: rgba(255, 255, 255, 100);
 				text-align: center;

+ 17 - 19
pages/order/detail.vue

@@ -20,12 +20,9 @@
 								</view>
 							</view>
 							<view class="detail-info-content-goods__detail__right">
-								<view class="title">{{ item.title }}</view>
-								<view class="flex num">
-									<view class="sku" v-if="!item.properties"></view>
-									<view class="sku" v-if="item.properties">规格:{{ item.properties }}</view>
-									<view class="">数量:{{ item.goodsNum }}</view>
-								</view>
+								<view class="ells title">{{ item.title }}</view>
+								<view class="sku" v-if="item.properties">规格:{{ item.properties }}</view>
+								<view class="num">数量:{{ item.goodsNum }}</view>
 							</view>
 						</view>
 					</view>
@@ -101,7 +98,7 @@
 					</view>
 				</view>
 			</view>
-			
+
 			<view class="detail-info" v-if="(status.value == 2 || status.value == 4) && deliverList.length == 1">
 				<view class="detail-info-title">发货信息</view>
 				<view class="detail-info-content" v-for="(item, index) in deliverList" :key="index">
@@ -274,7 +271,7 @@
 			}
 
 			&-content {
-				
+
 				&-goods {
 
 					&__detail {
@@ -302,16 +299,17 @@
 							height: 170rpx;
 							flex-direction: column;
 							justify-content: space-between;
-							align-items: flex-end;
+							align-items: flex-start;
+							font-size: 30rpx;
 
-							.num {
-								width: 100%;
-								justify-content: space-between;
+							.title {
+								font-weight: bold;
+							}
 
-								.sku {
-									color: #8C8C8C;
-								}
+							.sku {
+								color: #8C8C8C;
 							}
+
 						}
 
 					}
@@ -405,12 +403,12 @@
 					}
 				}
 			}
-			
-			.border{
+
+			.border {
 				border-bottom: 1px solid rgba(236, 236, 236, 100);
 			}
-			
-			.border:last-child{
+
+			.border:last-child {
 				border: none;
 			}
 		}

+ 11 - 13
pages/order/index.vue

@@ -36,12 +36,9 @@
 										</view>
 									</view>
 									<view class="order-list-data-item__info__detail__right">
-										<view class="title">{{ items.title }}</view>
-										<view class="flex num">
-											<view class="sku" v-if="!items.properties"></view>
-											<view class="sku" v-if="items.properties">规格:{{ items.properties }}</view>
-											<view class="">数量:{{ items.goodsNum }}</view>
-										</view>
+										<view class="ells title">{{ items.title }}</view>
+										<view class="sku" v-if="items.properties">规格:{{ items.properties }}</view>
+										<view class="num">数量:{{ items.goodsNum }}</view>
 									</view>
 								</view>
 							</navigator>
@@ -300,14 +297,15 @@
 								height: 170rpx;
 								flex-direction: column;
 								justify-content: space-between;
-								align-items: flex-end;
+								align-items: flex-start;
+								font-size: 30rpx;
 								
-								.num{
-									width: 100%;
-									justify-content: space-between;
-									.sku{
-										color: #8C8C8C;
-									}
+								.title{
+									font-weight: bold;
+								}
+
+								.sku {
+									color: #848484;
 								}
 							}
 

+ 18 - 20
pages/order/settlement.vue

@@ -51,12 +51,9 @@
 						</view>
 					</view>
 					<view class="settlement-goods__detail__right">
-						<view class="title">{{ item.title }}</view>
-						<view class="flex num">
-							<view class="sku" v-if="!item.properties"></view>
-							<view class="sku" v-if="item.properties">规格:{{ item.properties }}</view>
-							<view class="">数量:{{ item.goodsNum }}</view>
-						</view>
+						<view class="ells title">{{ item.title }}</view>
+						<view class="sku" v-if="item.properties">规格:{{ item.properties }}</view>
+						<view class="">数量:{{ item.goodsNum }}</view>
 					</view>
 				</view>
 			</view>
@@ -158,19 +155,19 @@
 												icon: 'success',
 												duration: 2000
 											})
-											setTimeout(()=>{
+											setTimeout(() => {
 												uni.redirectTo({
 													url: `/pages/order/index`
 												})
-											},500)
+											}, 500)
 										},
 										fail() {
 											payIng = false
-											setTimeout(()=>{
+											setTimeout(() => {
 												uni.redirectTo({
 													url: `/pages/order/index`
 												})
-											},500)
+											}, 500)
 										}
 									})
 								} else {
@@ -187,13 +184,13 @@
 								icon: 'success',
 								duration: 2000
 							})
-							setTimeout(()=>{
+							setTimeout(() => {
 								uni.redirectTo({
 									url: `/pages/order/index`
 								})
-							},500)
+							}, 500)
 						}
-					}else{
+					} else {
 						payIng = false
 						uni.$u.toast('提交失败!');
 					}
@@ -366,14 +363,15 @@
 					height: 170rpx;
 					flex-direction: column;
 					justify-content: space-between;
-					align-items: flex-end;
+					align-items: flex-start;
+					font-size: 30rpx;
 					
-					.num{
-						width: 100%;
-						justify-content: space-between;
-						.sku{
-							color: #8C8C8C;
-						}
+					.title{
+						font-weight: bold;
+					}
+
+					.sku {
+						color: #848484;
 					}
 				}
 

+ 2 - 7
pages/prize/index.vue

@@ -26,7 +26,7 @@
 					<view class="flex info">
 						<image :src="item.picUrl" mode="aspectFill"></image>
 						<view class="flex desc">
-							<view class="content">{{ item.title }}</view>
+							<view class="ells content">{{ item.title }}</view>
 							<view class="sku" v-if="item.properties">规格:{{ item.properties }}</view>
 							<view class="">数量:{{ item.goodsNum }}</view>
 						</view>
@@ -226,7 +226,7 @@
 
 	.prize-goods {
 		margin-top: 90rpx;
-		padding: 40rpx 20rpx 100rpx;
+		padding: 40rpx 20rpx 200rpx;
 
 		&-list {
 
@@ -262,11 +262,6 @@
 				.content {
 					line-height: 40rpx;
 					font-weight: bold;
-					overflow: hidden;
-					text-overflow: ellipsis;
-					display: -webkit-box;
-					-webkit-box-orient: vertical;
-					-webkit-line-clamp: 2;
 				}
 				.sku{
 					color: #848484;

+ 2 - 2
pages/user/index.vue

@@ -23,7 +23,7 @@
 				</navigator>
 				<navigator url="/pages/bean/index" class="flex account-info-item" hover-class="navigator-hover">
 					<view>{{ initData.coinNum }}</view>
-					<view>我的豆</view>
+					<view>我的豆</view>
 				</navigator>
 			</view>
 			<view class="flex account-info" v-else @click="notLogin">
@@ -37,7 +37,7 @@
 				</view>
 				<view class="flex account-info-item">
 					<view>-</view>
-					<view>我的豆</view>
+					<view>我的豆</view>
 				</view>
 			</view>
 		</view>