zhengjinyi 3 лет назад
Родитель
Сommit
12fe26ceac

+ 80 - 40
components/cm-module/creatOrder/sellerCoupon.vue

@@ -14,45 +14,51 @@
 				</view>
 				<div class="tui-popup-main coupon">
 					<scroll-view class="tui-popup-scroll"  scroll-y="true">
-						<view v-for="(coupon,index) in dataList" :key="index" class="coupon-list"  @click.stop="checkedCoupon(index)">
-							<view class="list-cell-le">
-								<view class="coupon-maxMoney">
-									<text class="small">¥</text>
-									{{ coupon.couponAmount }}
-								</view>
-								<view class="coupon-minMoney">
-									满{{ coupon.touchPrice }}可用
+						<view class="coupon-empty" v-if="isCouponEmpty">
+							<image class="empty-container-image" :src="StaticUrl+'/icon/icon-coupon-empty@2x.png'"></image>
+							<text class="error-text">暂无可用优惠券~</text>
+						</view>
+						<template>
+							<view v-for="(coupon,index) in dataList" :key="index" class="coupon-list"  @click.stop="checkedCoupon(index)" v-if="dataList.length>0">
+								<view class="list-cell-le">
+									<view class="coupon-maxMoney">
+										<text class="small">¥</text>
+										{{ coupon.couponAmount }}
+									</view>
+									<view class="coupon-minMoney">
+										满{{ coupon.touchPrice }}可用
+									</view>
 								</view>
-							</view>
-							<view class="list-cell-ri">
-								<view class="list-cell-top">
-									<view class="list-cell-type">
-										<view class="list-cell-tags">
-											<text class="tags">{{ coupon.couponType | TypeFormat }}</text>
-										</view>
-										<view class="list-cell-texts">
-											<text v-if="coupon.couponType == 0">
-												{{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
-											</text>
-											<text v-if="coupon.couponType == 1">
-												{{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
-											</text>
-											<text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
-											<text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
+								<view class="list-cell-ri">
+									<view class="list-cell-top">
+										<view class="list-cell-type">
+											<view class="list-cell-tags">
+												<text class="tags">{{ coupon.couponType | TypeFormat }}</text>
+											</view>
+											<view class="list-cell-texts">
+												<text v-if="coupon.couponType == 0">
+													{{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+												</text>
+												<text v-if="coupon.couponType == 1">
+													{{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+												</text>
+												<text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
+												<text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
+											</view>
 										</view>
-									</view>
-									<view class="list-cell-btn">
-										<view class="list-cell-checkbox">
-											<view class="checkbox iconfont"											 
-												  :class="[coupon.ischecked ?'icon-yixuanze':'icon-weixuanze']"
-											>
+										<view class="list-cell-btn">
+											<view class="list-cell-checkbox">
+												<view class="checkbox iconfont"											 
+													  :class="[coupon.ischecked ?'icon-yixuanze':'icon-weixuanze']"
+												>
+												</view>
 											</view>
 										</view>
 									</view>
+									<view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
 								</view>
-								<view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
 							</view>
-						</view>
+						</template>
 					</scroll-view>
 				</div>
 				<view class="tui-right-flex tui-popup-btn">
@@ -75,8 +81,10 @@
 		},
 		data() {
 			return{
-				popupShow:false,
+				StaticUrl:this.$Static, //静态图片路径
 				isIphoneX:this.$store.state.isIphoneX,
+				popupShow:false,
+				isCouponEmpty:false,
 				checkedIndex:null,
 				dataList:[],
 				coupon:{
@@ -112,16 +120,27 @@
 		created(){
 			this.initData(this.couponList)
 		},
-		computed: {
-
+		watch: {
+			couponList: {
+				handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
+					console.log(el)
+					this.couponList = el
+				},
+				deep: true
+			}
 		},
 		methods:{
 			initData(data){
-				data.forEach((el,index) => {
-					this.dataList.push(Object.assign({},el,{ischecked:false}))
-				})
-				this.coupon.couponAmount = data[0].couponAmount
-				this.dataList[0].ischecked = true
+				if(data.length>0){
+					data.forEach((el,index) => {
+						this.dataList.push(Object.assign({},el,{ischecked:false}))
+					})
+					this.coupon.couponAmount = data[0].couponAmount
+					this.dataList[0].ischecked = true
+					this.isCouponEmpty = false
+				}else{
+					this.isCouponEmpty = true
+				}
 			},
 			checkedCoupon(idx){// 选择优惠券
 				this.checkedIndex = idx;
@@ -229,6 +248,27 @@
 			.tui-popup-scroll{
 				width: 100%;
 				height: 600rpx;
+				.coupon-empty{
+					width: 100%;
+					height: 600rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					flex-direction: column;
+					position: fixed;
+					background: $bg-color;
+					.empty-container-image{
+						width: 150rpx;
+						height: 150rpx;
+						margin-bottom: 0;
+						margin-top: 0;
+					}
+					.error-text{
+						font-size: $font-size-28;
+						color: #999999;
+						line-height: 88rpx;
+					}
+				}
 				.coupon-list{
 					width: 100%;
 					height: 200rpx;

+ 2 - 2
pages/login/login.vue

@@ -89,9 +89,9 @@
 			navigatorRegirst(url){
 				// 友盟埋点注册入口点击事件
 				if(process.env.NODE_ENV != 'development'){
-					this.$uma.trackEvent('Um_Event_zhuce', {
+					this.$uma.trackEvent('Um_Event_Regiest', {
 						Um_Key_PageName: '立即注册',
-						Um_Key_SourcePage: '个人中心',
+						Um_Key_SourcePage: '登录页面',
 					})
 				}
 				this.$api.navigateTo(url)

+ 7 - 1
pages/seller/order/create-order.vue

@@ -262,8 +262,8 @@
 						this.couponList = data.couponList
 						this.reducedPrice = data.reducedPrice
 						this.allPrice = data.totalAmount
+						this.isCouponShow = true
 						if(this.couponList.length>0){
-							this.isCouponShow = true
 							this.couponAmount = data.couponList[0].couponAmount
 							this.clubCouponId = data.couponList[0].clubCouponId 
 							this.payAllPrice = this.allPrice - this.couponAmount
@@ -823,6 +823,12 @@
 							font-size: $font-size-26;
 							color: #333333;
 							float: left;
+							text-overflow:ellipsis;
+							display: -webkit-box;
+							word-break: break-all;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 1;
+							overflow: hidden;
 						}
 						.list-cell-time{
 							width: 100%;

+ 6 - 0
pages/user/coupon/coupon-exchange.vue

@@ -289,6 +289,12 @@
 							font-size: $font-size-26;
 							color: #333333;
 							float: left;
+							text-overflow:ellipsis;
+							display: -webkit-box;
+							word-break: break-all;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 1;
+							overflow: hidden;
 						}
 						.list-cell-time{
 							width: 100%;

+ 6 - 0
pages/user/order/create-order.vue

@@ -812,6 +812,12 @@
 							font-size: $font-size-26;
 							color: #333333;
 							float: left;
+							text-overflow:ellipsis;
+							display: -webkit-box;
+							word-break: break-all;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 1;
+							overflow: hidden;
 						}
 						.list-cell-time{
 							width: 100%;