Browse Source

修改弹窗滚动问题

xuqiaoying 3 years ago
parent
commit
b79b1420cb
4 changed files with 64 additions and 33 deletions
  1. 19 13
      pages2/bank/detail.vue
  2. 20 13
      pages3/course/detail.vue
  3. 15 3
      pages3/course/index.scss
  4. 10 4
      pages5/mockExam/examApply.vue

+ 19 - 13
pages2/bank/detail.vue

@@ -153,18 +153,24 @@
                 </view>
 				<view class="lines"></view>
                 <view class="check_con">
-					<view v-for="(item, index) in specList" :key="index" class="check_items">
-						<view class="grades">{{ item.name }}</view>
-						<view class="grade_names">
-							<view class="course_items" v-for="(child, c_index) in item.specAttrList" :key="c_index" :class="{'nactive': child.check }"
-							 @click="selectSku(child, index)">
-								{{ child.name }}
-							</view>
+					<scroll-view scroll-y="true" style="height: 490rpx;">
+						<view v-for="(item, index) in specList" :key="index" class="check_items">
+							<view class="grades">{{ item.name }}</view>
+							<scroll-view scroll-y="true" style="height: 180rpx;">
+								<view class="grade_names">
+									<view class="course_items" v-for="(child, c_index) in item.specAttrList" :key="c_index" :class="{'nactive': child.check }"
+									@click="selectSku(child, index)">
+										{{ child.name }}
+									</view>
+								</view>
+							</scroll-view>
 						</view>
-					</view>
+					</scroll-view>
                 </view>
-				<view v-if="Object.keys(skuItem).length == 0 || specList.length != isCheckSku" class="right_now r_disable">确 定</view>
-                <view v-else class="right_now" @click="rightNowBuy()">确 定</view>
+				<view class="confirm_btns">
+					<view v-if="Object.keys(skuItem).length == 0 || specList.length != isCheckSku" class="right_now r_disable">确 定</view>
+					<view v-else class="right_now" @click="rightNowBuy()">确 定</view>
+				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -524,7 +530,7 @@ export default {
 					this.skuItem = res.data.data || {}
 				} else {
 					this.skuItem = {}
-					this.$u.toast('该规格属性下没有设置商品')
+					this.$u.toast('商品已下架, 请重新选择')
 				}
 			})
 		},
@@ -534,12 +540,12 @@ export default {
 				return
 			}
 			if (this.skuItem.goodsStatus == 0) {
-				this.$message.warning('商品已下架, 请重新选择')
+				this.$u.toast('商品已下架, 请重新选择')
 				return
 			}
 			let sysTime = this.$method.timest()
 			if (sysTime <= this.skuItem.validityStartTime || sysTime >= this.skuItem.validityEndTime) {
-				this.$message.warning('商品不在有效期, 请重新选择')
+				this.$u.toast('商品不在有效期, 请重新选择')
 				return
 			}
             if (this.isCarOrBuy == 1) { // 加入购物车

+ 20 - 13
pages3/course/detail.vue

@@ -185,18 +185,25 @@
                 </view>
 				<view class="lines"></view>
                 <view class="check_con">
-					<view v-for="(item, index) in specList" :key="index" class="check_items">
-						<view class="grades">{{ item.name }}</view>
-						<view class="grade_names">
-							<view class="course_items" v-for="(child, c_index) in item.specAttrList" :key="c_index" :class="{'nactive': child.check }"
-							 @click="selectSku(child, index, c_index)">
-								{{ child.name }}
-							</view>
+					<scroll-view scroll-y="true" style="height: 490rpx;">
+						<view v-for="(item, index) in specList" :key="index" class="check_items">
+							<view class="grades">{{ item.name }}</view>
+							<scroll-view scroll-y="true" style="height: 180rpx;">
+								<view class="grade_names">
+									<view class="course_items" v-for="(child, c_index) in item.specAttrList" :key="c_index" :class="{'nactive': child.check }"
+									@click="selectSku(child, index, c_index)">
+										{{ child.name }}
+									</view>
+								</view>
+							</scroll-view>
 						</view>
-					</view>
+					</scroll-view>
                 </view>
-				<view v-if="Object.keys(skuItem).length == 0 || specList.length != isCheckSku" class="right_now r_disable">确 定</view>
-                <view v-else class="right_now" @click="rightNowBuy()">确 定</view>
+				<view class="confirm_btns">
+					<view v-if="Object.keys(skuItem).length == 0 || specList.length != isCheckSku" class="right_now r_disable">确 定</view>
+                	<view v-else class="right_now" @click="rightNowBuy()">确 定</view>
+				</view>
+				
 			</view>
 		</u-popup>
 	</view>
@@ -851,7 +858,7 @@ export default {
 					this.skuItem = res.data.data || {}
 				} else {
 					this.skuItem = {}
-					this.$u.toast('该规格属性下没有设置商品')
+					this.$u.toast('商品已下架, 请重新选择')
 				}
 			})
 		},
@@ -861,13 +868,13 @@ export default {
 				return
 			}
 			if (this.skuItem.goodsStatus == 0) {
-				this.$message.warning('商品已下架, 请重新选择')
+				this.$u.toast('商品已下架, 请重新选择')
 				return
 			}
 			
 			let sysTime = this.$method.timest()
 			if (sysTime <= this.skuItem.validityStartTime || sysTime >= this.skuItem.validityEndTime) {
-				this.$message.warning('商品不在有效期, 请重新选择')
+				this.$u.toast('商品不在有效期, 请重新选择')
 				return
 			}
 

+ 15 - 3
pages3/course/index.scss

@@ -128,6 +128,9 @@
     width: 100%;
     height: 938rpx;
     padding: 56rpx 56rpx 0rpx;
+	position: relative;
+	top: 0rpx;
+	left: 0rpx;
     .headers {
       width: 100%;
       display: flex;
@@ -176,8 +179,13 @@
 	}
 	.check_con {
 		width: 100%;
-		height: 500rpx;
-		overflow-y: auto;
+		// height: 500rpx;
+		// overflow-y: scroll;
+		.items_con {
+			width: 100%;
+			// height: 200rpx;
+			// overflow-y: scroll;
+		}
 		.check_items {
 			width: 100%;
 			// height: 500rpx;
@@ -208,8 +216,12 @@
 			}
 		}
 	}
+	.confirm_btns {
+		position: absolute;
+		bottom: 32rpx;
+	}
     .right_now {
-        width: 100%;
+        width: 640rpx;
         height: 92rpx;
         line-height: 92rpx;
         text-align: center;

+ 10 - 4
pages5/mockExam/examApply.vue

@@ -110,7 +110,8 @@
             </u-form>
             <!-- 提交按钮 -->
             <view class="btns">
-                <view class="submits" @click="submit()">
+                <view v-if="endTime <= sysTime" class="submits disable">提交</view>
+                <view v-else class="submits" @click="submit()">
                     提交
                 </view>
             </view>
@@ -163,10 +164,12 @@ export default {
             majorName: '',
             startTime: '',
             endTime: '',
+            sysTime: '', // 当前时间
         }
     },
     onLoad(option) {
-        console.log('option--: ', option)
+        this.sysTime = +this.$method.timest()
+        // console.log('option--: ', option)
         if (option.scene) {
             let tid = decodeURIComponent(option.scene)
             this.activityId = tid.split('=')[1]
@@ -189,7 +192,6 @@ export default {
             console.log('已登录')
             this.getActivity()
         }
-        
     },
     // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
 	onReady() {
@@ -244,13 +246,13 @@ export default {
 			console.log(e, this.examform.userSex);
 		},
         majorChange(e) {
-            this.examform.userMajors = []
             let index = e.detail.value
             const { majorName, majorId, mockMajorId } = this.majorList[index]
             this.majorName = majorName
             this.examform.majorId = majorId
             // console.log('1111majorId', this.examform.majorId)
             this.subjectLists = this.checkboxList.filter(e => e.mockMajorId == mockMajorId)
+            this.examform.userMajors = []
             this.subjectLists = this.subjectLists.map((item) => {
                 return {
                     name: '《' + item.subjectName + '》',
@@ -398,5 +400,9 @@ page {
         font-weight: 500;
         color: #FFFFFF;
     }
+    .disable {
+		background: #498AFE;
+		opacity: 0.5;
+	}
 }
 </style>