dever 4 年之前
父节点
当前提交
952bb1affd
共有 7 个文件被更改,包括 253 次插入166 次删除
  1. 3 2
      pages/dream/buy.vue
  2. 224 150
      pages/dream/index.vue
  3. 10 4
      pages/dream/info.vue
  4. 9 3
      pages/dream/ranking.vue
  5. 3 3
      pages/index/index.vue
  6. 1 1
      pages/index/list.vue
  7. 3 3
      pages/user/index.vue

+ 3 - 2
pages/dream/buy.vue

@@ -209,7 +209,7 @@ export default {
 .buy-layer{
   padding: 50rpx 55rpx 62rpx;
   background-color: #fff;
-  position: absolute;
+  position: fixed;
   bottom: 0;
   left: 0;
   right: 0;
@@ -217,6 +217,7 @@ export default {
   transition-property: transform;
   transition-duration: 0.3s;
   transition-timing-function: ease-in;
+  overflow: auto;
 }
 .buy-layer.slidein{
   transform: translateY(0);
@@ -473,7 +474,7 @@ export default {
   border: 0;
   min-width: 0;
   box-sizing: border-box;
-  color: #999999;
+  /*color: #999999;*/
   width: 200rpx;
   border-radius: 5rpx;
 }

+ 224 - 150
pages/dream/index.vue

@@ -1,45 +1,49 @@
 <template>
 	<gracePage :customHeader="false">
-		<view class="container" slot="gBody">
-			<swiper class="banner-swiper" autoplay :interval="5000" :duration="1000" @change="change" :circular="swiper.circular">
+		<view class="container" slot="gBody" v-if="fetch.info.pic_bg">
+			<ourLoading isFullScreen :active="pageLoading" :text="pageLoadingText" />
+			<swiper class="banner-swiper" autoplay :interval="5000" :duration="1000" @change="change" :circular="swiper.circular" @click="closeOpen()">
 				<swiper-item class="banner-swiper-item" v-for="(v, k) in fetch.info.pic_bg" :key="k">
 					<image :src="v" mode="widthFix"></image>
 				</swiper-item>
 			</swiper>
 			<view class="content">
 				<!-- section-1 begin -->
-				<view class="section-1">
-					<navigator class="item">
+				<view class="section-1" @click="closeOpen()">
+					<view class="item">
 						<image :src="fetch.info.pic_cover" mode="widthFix"></image>
 						<view class="wenyue-font">{{fetch.info.name}}</view>
 						<view class="text-color-assist">{{fetch.info.desc}}</view>
-					</navigator>
+					</view>
 					<view class="item" v-if="fetch.info.uid > 0">
 						<image :src="fetch.info.user.avatar" mode="widthFix" class="avatar"></image>
 						<view class="wenyue-font">{{fetch.info.user.username}}</view>
 						<view class="text-color-assist">{{fetch.info.user.author}}</view>
 					</view>
 				</view>
-				<!-- section-2 end -->
-				<!-- section-2 begin -->
-				<view class="section-2">
-					<view class="item" v-for="(v, k) in fetch.button" :key="k">
-						<view class="title">
-							<image :src="v.icon" v-if="v.icon" style="width:33px;height:33px;"></image>
-							<view>{{v.name}}</view>
-						</view>
-						<view class="tips" v-if="v.info">{{v.info}}</view>
-					</view>
-				</view>
-				<!-- section-2 end -->
-				<view class="section-3">
-					<view class="my-integral">
-						<view class="tips">
-							<rich-text :nodes="fetch.info.content"></rich-text>
-						</view>
-					</view>
-					
-				</view>
+				<!-- section-2 end -->
+				<!-- section-2 begin -->
+				<view class="section-2">
+					<view class="item" :style="item_style" v-for="(v, k) in fetch.button" :key="k" @click="button(v)">
+						<view class="title">
+							<image :src="v.icon" v-if="v.icon" style="width:33px;height:33px;"></image>
+							<view>{{v.name}}</view>
+						</view>
+						<view class="tips" v-if="v.info">{{v.info}}</view>
+					</view>
+				</view>
+				<!-- section-2 end -->
+				<view class="section-3">
+					<view class="my-integral">
+						<view class="tips">
+							<rich-text :nodes="fetch.info.content"></rich-text>
+						</view>
+					</view>
+					
+				</view>
+				
+				
+				
 			</view>
 			
 			<view v-if="buyState">
@@ -101,13 +105,6 @@
 	export default {
 		data() {
 			return {
-				swipers: [
-					"https://go.cdn.heytea.com/storage/ad/2020/05/21/bfd57914d80d4671b19f5d0ccc176cd5.jpg",
-					"https://go.cdn.heytea.com/storage/ad/2020/05/24/49f9b50738dd47878cf1ab54c2eee2e0.jpg",
-					"https://go.cdn.heytea.com/storage/ad/2020/05/01/e1c6915022c849fd9492377021aef454.jpg",
-					"https://go.cdn.heytea.com/storage/ad/2020/04/27/db60b797c1cd4afabe9666e7df958ffd.jpg",
-					"https://go.cdn.heytea.com/storage/ad/2020/05/21/4ba53dda599345bdaf28a08420dd1b6f.jpg"
-				],
 				id : 0,
 				swiper : {
 					index : 0,
@@ -124,7 +121,8 @@
 				buyState : false,
 				rankingState : false,
 				infoState : false,
-				inviteState : true,
+				inviteState : true,
+				item_style : 'margin: 0 auto;',
 			}
 		},
 		onLoad(option) {
@@ -144,13 +142,33 @@
 			change : function(e) {
 				this.swiper.index = e.detail.current;
 			},
-			getData : function() {
+			getData : function() {
+				var self = this;
 				var url = this.Dever.host + '/pages/dream/index';
-				this.Dever.get(this, 'app/collection/?l=api.getInfo', {id:this.id,code:this.code,url:url}, function(t) {
+				this.Dever.get(this, 'app/collection/?l=api.getInfo', {id:this.id,code:this.code,url:url}, function(t) {
+					if (t.button.length > 2) {
+						self.item_style = 'margin-left:5rpx;';
+					} else {
+						self.item_style = 'margin:0 auto';
+					}
 					uni.setNavigationBarTitle({
 						title:t.info.name
 					});
 				});
+			},
+			button : function(v) {
+				if (v.type == 1) {
+					this.goView();
+				}
+				else if (v.type == 2) {
+					this.showBuy();
+				}
+				else if (v.type == 3) {
+					this.goRanking();
+				}
+				else if (v.type == 10) {
+					this.Dever.location(v.link);
+				}
 			},
 			goView : function() {
 				//是否登录
@@ -178,6 +196,12 @@
 			},
 			view : function() {
 				this.Dever.location('dream/view?code='+this.fetch.code + '&name=' + this.fetch.info.name);
+			},
+			closeOpen : function() {
+				this.hideRanking();
+				this.hideBuy();
+				this.hideInfo();
+				this.hideInvite();
 			},
 			showInvite : function() {
 				this.inviteState = true;
@@ -223,152 +247,202 @@
 </script>
 
 <style lang="scss" scoped>
-	page {
-		max-height: 100%;
-	}
+page {
+	max-height: 100%;
+}
+
+.banner-swiper {
+	width: 100%;
+	height: 600rpx;
 	
-	.banner-swiper {
-		width: 100%;
-		height: 600rpx;
-		
-		.banner-swiper-item {
-			image {
-				width: 100%;
-			}
+	.banner-swiper-item {
+		image {
+			width: 100%;
 		}
 	}
+}
+
+.content {
+	width: 100%;
+	padding: 0 30rpx;
+	position: relative;
+}
+
+.section-1 {
+	position: relative;
+	background-color: $bg-color-white;
+	margin-top: -60rpx;
+	border-radius: $border-radius-lg;
+	padding: 60rpx 0;
+	display: flex;
+	margin-bottom: 30rpx;
+	box-shadow: $box-shadow;
 	
-	.content {
-		width: 100%;
-		padding: 0 30rpx;
+	.item {
+		flex: 1;
+		flex-shrink: 0;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
 		position: relative;
+		
+		&:nth-child(1):after {
+			content: '';
+			position: absolute;
+			right: 0;
+			top: 0;
+			bottom: 0;
+			width: 2rpx;
+			background-color: $border-color;
+		}
+		
+		image {
+			width: 100rpx;
+			margin-bottom: 20rpx;
+		}
+		
+		.wenyue-font {
+			font-size: 48rpx;
+			margin-bottom: 10rpx;
+		}	
 	}
+}
+
+.section-2 {
+	display: flex;
+	justify-content: space-between;
+	margin-bottom: 30rpx;
 	
-	.section-1 {
-		position: relative;
-		background-color: $bg-color-white;
-		margin-top: -60rpx;
-		border-radius: $border-radius-lg;
-		padding: 60rpx 0;
+	.item {
+		width: 335rpx;
+		background-color: #EAEBEC;
+		padding: $spacing-row-lg 0;
 		display: flex;
-		margin-bottom: 30rpx;
-		box-shadow: $box-shadow;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		border-radius: $border-radius-lg;
 		
-		.item {
-			flex: 1;
-			flex-shrink: 0;
+		.title {
+			width: 100%;
 			display: flex;
-			flex-direction: column;
 			align-items: center;
-			position: relative;
-			
-			&:nth-child(1):after {
-				content: '';
-				position: absolute;
-				right: 0;
-				top: 0;
-				bottom: 0;
-				width: 2rpx;
-				background-color: $border-color;
-			}
+			justify-content: center;
+			font-size: $font-size-lg;
 			
 			image {
-				width: 100rpx;
-				margin-bottom: 20rpx;
+				width: 60rpx;
+				height: 60rpx;
+				margin-right: 10rpx;
 			}
-			
-			.wenyue-font {
-				font-size: 48rpx;
-				margin-bottom: 10rpx;
-			}	
+		}
+		
+		.tips {
+			color: $text-color-assist;
+			font-size: $font-size-base;
 		}
 	}
+}
+
+.section-3 {
+	margin-bottom: 30rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	font-size: $font-size-base;
+	color: $text-color-assist;
+	padding: 0 10rpx;
 	
-	.section-2 {
+	.my-integral {
+		flex: 1;
 		display: flex;
-		justify-content: space-between;
-		margin-bottom: 30rpx;
+		flex-direction: column;
 		
-		.item {
-			width: 335rpx;
-			background-color: #EAEBEC;
-			padding: $spacing-row-lg 0;
+		.integrals {
 			display: flex;
-			flex-direction: column;
 			align-items: center;
-			justify-content: center;
-			border-radius: $border-radius-lg;
+			font-size: $font-size-lg;
+			color: $text-color-base;
+			margin-bottom: 10rpx;
 			
-			.title {
-				width: 100%;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				font-size: $font-size-lg;
-				
-				image {
-					width: 60rpx;
-					height: 60rpx;
-					margin-right: 10rpx;
-				}
-			}
-			
-			.tips {
-				color: $text-color-assist;
-				font-size: $font-size-base;
+			.neutra-font {
+				margin-left: 10rpx;
+				font-size: 42rpx;
 			}
 		}
 	}
 	
-	.section-3 {
-		margin-bottom: 30rpx;
+	.my-code {
 		display: flex;
-		justify-content: space-between;
+		flex-direction: column;
 		align-items: center;
-		font-size: $font-size-base;
-		color: $text-color-assist;
-		padding: 0 10rpx;
+		padding: 0 30rpx;
+		position: relative;
 		
-		.my-integral {
-			flex: 1;
-			display: flex;
-			flex-direction: column;
-			
-			.integrals {
-				display: flex;
-				align-items: center;
-				font-size: $font-size-lg;
-				color: $text-color-base;
-				margin-bottom: 10rpx;
-				
-				.neutra-font {
-					margin-left: 10rpx;
-					font-size: 42rpx;
-				}
-			}
+		image {
+			width: 60rpx;
+			height: 60rpx;
+			margin-bottom: $spacing-col-sm;
 		}
 		
-		.my-code {
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			padding: 0 30rpx;
-			position: relative;
-			
-			image {
-				width: 60rpx;
-				height: 60rpx;
-				margin-bottom: $spacing-col-sm;
-			}
-			
-			&:before {
-				content: " ";
-				position: absolute;
-				left: 0;
-				top: 0;
-				bottom: 0;
-				border-left: 1rpx solid rgba($color: $border-color, $alpha: 0.6);
-			}
+		&:before {
+			content: " ";
+			position: absolute;
+			left: 0;
+			top: 0;
+			bottom: 0;
+			border-left: 1rpx solid rgba($color: $border-color, $alpha: 0.6);
 		}
 	}
+}
+
+.mask {
+  position: fixed;
+  left: 0;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.5);
+  z-index:100;
+}
+
+.mask .layer {
+  width: 570rpx;
+  box-sizing: border-box;
+  padding: 70rpx 60rpx;
+  background: #fff;
+  border-radius: 10rpx;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%,-50%);
+}
+
+.mask .layer .tit {
+  text-align: center;
+  font-size: 40rpx;
+  margin: 16rpx 0 60rpx;
+}
+
+.mask .layer input {
+  border-radius: 10rpx;
+  border: 1rpx solid #999;
+  height: 88rpx;
+  line-height: 88rpx;
+  padding: 0 28rpx;
+  box-sizing: border-box;
+  font-size: 24rpx;
+}
+
+.mask .layer .errtip {
+  color: #d1171a;
+  text-align: center;
+  font-size: 24rpx;
+  margin: 21rpx 0;
+  height: 34rpx;
+}
+
+.mask .layer .btn-wrapper {
+  padding-top: 30rpx;
+}
 </style>

+ 10 - 4
pages/dream/info.vue

@@ -1,5 +1,5 @@
 <template name="info">
-	<view class="grace-body container" :class="show ?'slidein':''" @touchstart="Dever.slide" @touchend="end">
+	<view class="grace-body container_info" :class="show ?'slidein':''" @touchstart="Dever.slide" @touchend="end">
 		<view class="grace-margin-top" style="padding:20rpx 0;">
 			<text class="grace-h4 grace-bold">个人中心</text>
 		</view>
@@ -127,7 +127,7 @@ export default {
 }
 </script>
 <style>
-.container {
+.container_info {
   background: white;
   flex: 1;
   display: flex;
@@ -136,9 +136,15 @@ export default {
   transition-property: transform;
   transition-duration: 0.3s;
   transition-timing-function: ease-in;
-  z-index:20;
+  z-index:20;
+  position: fixed;
+  height: 100%;
+  width: 100%;
+  left: 0;
+  bottom: 0;
+  overflow: hidden;
 }
-.container.slidein{
+.container_info.slidein{
   transform: translateY(0);
 }
 .ucenter-face{width:100rpx !important; height:100rpx !important;}

+ 9 - 3
pages/dream/ranking.vue

@@ -1,5 +1,5 @@
 <template name="ranking">
-	<view class="container" :class="show ?'slidein':''" @touchstart="Dever.slide" @touchend="end">
+	<view class="container_info" :class="show ?'slidein':''" @touchstart="Dever.slide" @touchend="end">
 		<scroll-view scroll-x class="bg-white nav">
 			<view class="flex text-center">
 				<view class="cu-item flex-sub" :class="k == index?'text-orange cur':''" v-for="(v, k) in fetch.ranking" :key="k" @click="select(k)">
@@ -136,7 +136,7 @@ export default {
 </script>
 
 <style>
-.container {
+.container_info {
   background: white;
   flex: 1;
   display: flex;
@@ -146,8 +146,14 @@ export default {
   transition-duration: 0.3s;
   transition-timing-function: ease-in;
   z-index:20;
+  position: fixed;
+  height: 80%;
+  width: 100%;
+  left: 0;
+  bottom: 0;
+  overflow: auto;
 }
-.container.slidein{
+.container_info.slidein{
   transform: translateY(0);
 }
 .container_content {

+ 3 - 3
pages/index/index.vue

@@ -11,16 +11,16 @@
 					</view>
 				</view>
 				
-				<view class="info" v-if="fetch.user.id > 0" style="margin-top: -14px;">
+				<view class="info" v-if="fetch.user.id > 0" style="margin-top: -28rpx;">
 					<image @tap="user" :src="fetch.user.avatar" class="avatar"></image>
-					<view class="title" style="margin-left: 13px;margin-top: -20px;">
+					<view class="title" style="margin-left: 26rpx;margin-top: -40rpx;">
 						<view class="wenyue-font" @tap="user">{{fetch.user.username}}</view>
 						<view class="tips" @tap="user">
 							<view v-if="fetch.user.title">{{fetch.user.title}}</view>
 							<view v-if="!fetch.user.title">无头衔</view>
 						</view>
 					</view>
-					<view class="badage" style="left:95px;bottom: 16px;word-break: break-all;overflow: auto;height:24px">
+					<view class="badage" style="left:180rpx;bottom: 32rpx;word-break: break-all;overflow: auto;">
 						<view v-if="fetch.user.info">{{fetch.user.info}}</view>
 						<view v-if="!fetch.user.info">暂无签名</view>
 					</view>

+ 1 - 1
pages/index/list.vue

@@ -27,7 +27,7 @@
 										<view class="right" @tap="location(v1.id_code)">
 											<text class="name">{{ v1.name }}</text>
 											<text class="tips">{{ v1.desc }}</text>
-											<view class="price_and_action" v-if="v1.buy == 1">
+											<view class="price_and_action" v-if="v1.buy == 1" style="display: none;">
 												<text class="price">¥{{ v1.buy_price }}</text>
 											</view>
 										</view>

+ 3 - 3
pages/user/index.vue

@@ -14,14 +14,14 @@
 			</list-cell>
 			<list-cell line-right padding="30rpx">
 				<view class="form-item">
-					<view class="label">介绍</view>
-					<input type="text" v-model="fetch.info"/>
+					<view class="label">头衔</view>
+					<input type="text" v-model="fetch.title"/>
 				</view>
 			</list-cell>
 			<list-cell line-right padding="30rpx">
 				<view class="form-item">
 					<view class="label">签名</view>
-					<input type="text" v-model="fetch.title"/>
+					<input type="text" v-model="fetch.info"/>
 				</view>
 			</list-cell>
 			<list-cell line-right padding="30rpx" style="display: none;">