Просмотр исходного кода

fix:拓客经理页面拓客规则显示优惠券

zhanghui 2 лет назад
Родитель
Сommit
cca4625e78
2 измененных файлов с 87 добавлено и 41 удалено
  1. 29 1
      pages/index/manager/index.rpx.css
  2. 58 40
      pages/index/manager/manager.vue

+ 29 - 1
pages/index/manager/index.rpx.css

@@ -1,5 +1,6 @@
 .page{
 .page{
     background: #F7F7F7;
     background: #F7F7F7;
+    height: 100vh;
     padding: 1rpx 32rpx;
     padding: 1rpx 32rpx;
 }
 }
 .outView{
 .outView{
@@ -32,6 +33,15 @@
 .award{
 .award{
     width: 500rpx;
     width: 500rpx;
 }
 }
+.discount{
+    margin-top: 20rpx;
+    border: 1px solid rgba(226, 136, 136, 0.83);
+    padding: 0 6rpx;
+    border-radius: 10rpx;
+}
+.discount:first-child{
+    margin-top: 0rpx;
+}
 .awardItem{
 .awardItem{
     min-width: 230rpx;
     min-width: 230rpx;
 }
 }
@@ -49,7 +59,8 @@
     margin-top: 24rpx;
     margin-top: 24rpx;
 }
 }
 .scroll-Y{
 .scroll-Y{
-    height: 600rpx;
+    height: 50vh;
+    overflow: auto;
 }
 }
 .rulePopup{
 .rulePopup{
     height: 900rpx;
     height: 900rpx;
@@ -137,3 +148,20 @@
     padding: 0rpx 15rpx;
     padding: 0rpx 15rpx;
     margin-left: 10rpx;
     margin-left: 10rpx;
 }
 }
+.dataNullView{
+    background: #FFFFFF;
+    border-radius: 20rpx;
+    padding: 24rpx;
+    text-align: center;
+}
+.dataNullImage{
+    width: 300rpx;
+    height: 300rpx;
+}
+.roleName1{
+    background: #FFFFFF;
+    color: #007aff;
+}
+.roleHint{
+    color: #999999;
+}

+ 58 - 40
pages/index/manager/manager.vue

@@ -10,20 +10,26 @@
 			</view>
 			</view>
 		</view>
 		</view>
 
 
-		<view>
-			<scroll-view scroll-y class="scroll-Y">
+		<view class="dataNullView flex-col" v-if="roleBindRuleList.length===0">
+			<view class="flex-row justify-center">
+				<image class="dataNullImage" src="/static/dataNull.png"></image>
+			</view>
+			<text class="roleName1">{{roleList[confirmRoleIndex].name}}<text class="roleHint">角色没有拓客规则,点击下方“添加规则”按钮可添加拓客规则</text></text>
+		</view>
+
+		<view v-else class="scroll-Y">
 				<view class="flex-col outView" v-for="(item,index) in roleBindRuleList" :key="index">
 				<view class="flex-col outView" v-for="(item,index) in roleBindRuleList" :key="index">
 					<view class="flex-row justify-between">
 					<view class="flex-row justify-between">
-						<text class="title">规则标题</text>
+						<text class="title">{{item.title}}</text>
 						<u-icon name="trash" color="#666" size="24" @click="deleteRule(item)"></u-icon>
 						<u-icon name="trash" color="#666" size="24" @click="deleteRule(item)"></u-icon>
 					</view>
 					</view>
 					<view class="flex-row justify-between  awardView">
 					<view class="flex-row justify-between  awardView">
 						<text>直推:</text>
 						<text>直推:</text>
 						<view>
 						<view>
-							<view class="flex-row  award ">
+							<view class="flex-row  award justify-between">
 								<text class="awardItem">注册现金:{{item.awardAmount}}元</text>
 								<text class="awardItem">注册现金:{{item.awardAmount}}元</text>
 							</view>
 							</view>
-							<view class="flex-row  award ">
+							<view class="flex-row  award justify-between">
 								<text class="awardItem">消费现金:{{item.consumeAmount}}元</text>
 								<text class="awardItem">消费现金:{{item.consumeAmount}}元</text>
 								<text class="awardItem">消费比例:{{item.consumeRatio * 100}}%</text>
 								<text class="awardItem">消费比例:{{item.consumeRatio * 100}}%</text>
 							</view>
 							</view>
@@ -31,20 +37,21 @@
 					</view>
 					</view>
 					<view class="flex-row justify-between  awardView">
 					<view class="flex-row justify-between  awardView">
 						<text>间推:</text>
 						<text>间推:</text>
-						<view class="flex-row  award ">
+						<view class="flex-row  award justify-between">
 							<text class="awardItem">间推现金:{{item.indirectAmount}}元</text>
 							<text class="awardItem">间推现金:{{item.indirectAmount}}元</text>
 							<text class="awardItem">间推比例:{{item.indirectRatio * 100}}%</text>
 							<text class="awardItem">间推比例:{{item.indirectRatio * 100}}%</text>
 						</view>
 						</view>
 					</view>
 					</view>
-<!--					<view class="flex-row justify-between  awardView">-->
-<!--						<text>优惠券:</text>-->
-<!--						<view class="flex-col  award ">-->
-<!--							<text>满100减250的优惠券</text>-->
-<!--							<text>有效期:2024-01-01 至 2024-01-30</text>-->
-<!--						</view>-->
-<!--					</view>-->
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col">
+							<view class="flex-col discount award" v-for="(item1,index1) in item.strategyList" :key="index1">
+								<text>{{item1.name}} * {{item1.degree}}张</text>
+								<text>有效期:{{item1.startTime.substring(0,10)}} 至 {{item1.endTime.substring(0,10)}}</text>
+							</view>
+						</view>
+					</view>
 				</view>
 				</view>
-			</scroll-view>
 		</view>
 		</view>
 
 
 
 
@@ -79,39 +86,50 @@
 					<u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
 					<u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
 				</view>
 				</view>
 				<scroll-view scroll-y class="scroll-Y1">
 				<scroll-view scroll-y class="scroll-Y1">
-
-					<view class="flex-col outView " :class="{selectRoleName1: item.select }"
-						  v-for="(item,index) in roleNoBindRuleList" :style="{marginTop: '24rpx'}" @click="selectRule(item,index)" :key="index">
-						<view class="flex-row justify-between">
-							<text class="title">{{item.title}}</text>
+					<view class="dataNullView flex-col" v-if="roleNoBindRuleList.length===0">
+						<view class="flex-row justify-center">
+							<image class="dataNullImage" src="/static/dataNull.png"></image>
 						</view>
 						</view>
-						<view class="flex-row justify-between  awardView">
-							<text>直推:</text>
-							<view>
-								<view class="flex-row  award ">
-									<text class="awardItem">注册现金:{{item.awardAmount}}元</text>
+						<text class="roleHint">暂无可添加的拓客规则</text>
+					</view>
+
+					<view v-else>
+						<view class="flex-col outView " :class="{selectRoleName1: item.select }"
+							  v-for="(item,index) in roleNoBindRuleList" :style="{marginTop: '24rpx'}" @click="selectRule(item,index)" :key="index">
+							<view class="flex-row justify-between">
+								<text class="title">{{item.title}}</text>
+							</view>
+							<view class="flex-row justify-between  awardView">
+								<text>直推:</text>
+								<view>
+									<view class="flex-row  award justify-between">
+										<text class="awardItem">注册现金:{{item.awardAmount}}元</text>
+									</view>
+									<view class="flex-row  award justify-between">
+										<text class="awardItem">消费现金:{{item.consumeAmount}}元</text>
+										<text class="awardItem">消费比例:{{item.consumeRatio * 100}}%</text>
+									</view>
 								</view>
 								</view>
-								<view class="flex-row  award ">
-									<text class="awardItem">消费现金:{{item.consumeAmount}}元</text>
-									<text class="awardItem">消费比例:{{item.consumeRatio * 100}}%</text>
+							</view>
+							<view class="flex-row justify-between  awardView">
+								<text>间推:</text>
+								<view class="flex-row  award justify-between">
+									<text class="awardItem">间推现金:{{item.indirectAmount}}元</text>
+									<text class="awardItem">间推比例:{{item.indirectRatio * 100}}%</text>
 								</view>
 								</view>
 							</view>
 							</view>
-						</view>
-						<view class="flex-row justify-between  awardView">
-							<text>间推:</text>
-							<view class="flex-row  award ">
-								<text class="awardItem">间推现金:{{item.indirectAmount}}元</text>
-								<text class="awardItem">间推比例:{{item.indirectRatio * 100}}%</text>
+							<view class="flex-row justify-between  awardView">
+								<text>优惠券:</text>
+								<view class="flex-col">
+									<view class="flex-col discount award" v-for="(item1,index1) in item.strategyList" :key="index1">
+										<text>{{item1.name}} * {{item1.degree}}张</text>
+										<text>有效期:{{item1.startTime.substring(0,10)}} 至 {{item1.endTime.substring(0,10)}}</text>
+									</view>
+								</view>
 							</view>
 							</view>
 						</view>
 						</view>
-<!--						<view class="flex-row justify-between  awardView">-->
-<!--							<text>优惠券:</text>-->
-<!--							<view class="flex-col  award ">-->
-<!--								<text>满100减250的优惠券</text>-->
-<!--								<text>有效期:2024-01-01 至 2024-01-30</text>-->
-<!--							</view>-->
-<!--						</view>-->
 					</view>
 					</view>
+
 				</scroll-view>
 				</scroll-view>
 				<view class="confirmButton" @click="confirmAddRule">
 				<view class="confirmButton" @click="confirmAddRule">
 					<text>确定</text>
 					<text>确定</text>