xiaohaizhao 2 лет назад
Родитель
Сommit
b268143b4c

+ 99 - 0
components/bottomTabControl.vue

@@ -0,0 +1,99 @@
+<template>
+    <u-overlay :show="active" @click="active = false">
+        <view class="tabbar-box-wrap">
+            <view class="tabbar-box">
+                <view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-release/tabbar-3-release')">
+                    <image class="box-image" src="../static/img/logo.png" mode="aspectFit"></image>
+                    <text class="explain">发图文</text>
+                </view>
+                <view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-video/tabbar-3-video')">
+                    <image class="box-image" src="../static/img/logo.png" mode="aspectFit"></image>
+                    <text class="explain">发视频</text>
+                </view>
+                <view class="tabbar-box-item" @click="goToPage('/pages/tabbar-3-detial/tabbar-3-qa/tabbar-3-qa')">
+                    <image class="box-image" src="../static/img/logo.png" mode="aspectFit"></image>
+                    <text class="explain">提问</text>
+                </view>
+
+            </view>
+        </view>
+    </u-overlay>
+</template>
+
+<script>
+export default {
+    name: "TabControl",
+    props: {},
+    data() {
+        return {
+            active: false
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.tabbar-box-wrap {
+    position: absolute;
+    width: 100%;
+    padding: 50upx;
+    box-sizing: border-box;
+    bottom: calc(52px + env(safe-area-inset-bottom) / 2);
+    left: 0;
+
+    .tabbar-box {
+        position: relative;
+        display: flex;
+        width: 100%;
+        background: #fff;
+        border-radius: 20upx;
+        padding: 15upx 20upx;
+        box-sizing: border-box;
+        z-index: 2;
+        box-shadow: 0px 2px 5px 2px rgba(0, 0, 0, 0.1);
+
+        &:after {
+            content: '';
+            position: absolute;
+            bottom: -16upx;
+            left: 0;
+            right: 0;
+            margin: auto;
+            width: 50upx;
+            height: 50upx;
+            transform: rotate(45deg);
+            background: #fff;
+            z-index: 1;
+            box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.1);
+            border-radius: 2px;
+        }
+
+        &:before {
+            content: '';
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            background: #ffffff;
+            border-radius: 20upx;
+            z-index: 2;
+        }
+
+        .tabbar-box-item {
+            // position: relative;
+            width: 100%;
+            z-index: 3;
+            margin: 10upx;
+            color: $uni-color-subtitle;
+            text-align: center;
+            font-size: $uni-font-size-base;
+
+            .box-image {
+                width: 100%;
+                height: $uni-img-size-lg;
+            }
+        }
+    }
+}
+</style>>

+ 65 - 12
pages/index/index.vue

@@ -1,22 +1,75 @@
 <template>
-	<view class="content">
+	<view class="container">
+		<tab-control ref="tabControl" :active='opentabControl' />
+		<home v-show="PageCur == 'Home'" />
+		<my-map v-show="PageCur == 'Map'" />
+		<message v-show="PageCur == 'Message'" />
+		<mine v-show="PageCur == 'Mine'" />
+		<view class="cu-bar tabbar bg-white foot" style="z-index: 100000;" @click="opentabControl(false)">
+			<!-- bg-black -->
+			<view @click="PageCur = 'Home'" :class="PageCur == 'Home' ? 'action pitch-on-color' : 'action text-gray'">
+				<view class="iconfont" :class="PageCur == 'Home' ? 'icon-shouye-xuanzhong' : 'icon-shouye-weixuanzhong'" />
+				首页
+			</view>
+			<view @click="PageCur = 'Map'" :class="PageCur == 'Map' ? 'action pitch-on-color' : 'action text-gray'">
+				<view class="iconfont" :class="PageCur == 'Map' ? 'icon-ditu-xuanzhong' : 'icon-ditu-weixuanzhong'" /> 地图
+			</view>
+			<view class="text-gray" @click.stop="opentabControl(true)">
+				<button class="cu-btn cuIcon-add shadow more" style="background-color:#0B3F7E;color: #fff;"></button>
+			</view>
+			<view @click="PageCur = 'Message'" :class="PageCur == 'Message' ? 'action pitch-on-color' : 'action text-gray'">
+				<view class="iconfont" :class="PageCur == 'Message' ? 'icon-xiaoxi-xuanzhong' : 'icon-xiaoxi-weixuanzhong'">
+					<view class="cu-tag badge">99</view>
+				</view> 消息
+			</view>
+			<view @click="PageCur = 'Mine'" :class="PageCur == 'Mine' ? 'action pitch-on-color' : 'action text-gray'">
+				<view class="iconfont" :class="PageCur == 'Mine' ? 'icon-wode-xuanzhong' : 'icon-wode-weixuanzhong'" /> 我的
+			</view>
+		</view>
+		<!-- <view style="height: calc(62px + env(safe-area-inset-bottom) / 2);" /> -->
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-
+import home from "./modules/home.vue";
+import myMap from "./modules/my-map.vue";
+import message from "./modules/message.vue";
+import mine from "./modules/mine.vue";
+import tabControl from "../../components/bottomTabControl.vue";
+export default {
+	components: { home, myMap, message, mine, tabControl },
+	data() {
+		return {
+			PageCur: "Mine",
+		}
+	},
+	methods: {
+		opentabControl(active) {
+			if (this.$refs.tabControl.active !== active) this.$nextTick(() => {
+				this.$refs.tabControl.active = active;
+			});
 		}
 	}
+}
 </script>
 
-<style>
+<style lang="scss" scoped>
+.action .iconfont {
+	width: 104rpx;
+	position: relative;
+	display: block;
+	height: auto;
+	margin: 0 auto 10rpx;
+	text-align: center;
+	font-size: 40rpx;
+}
+
+.pitch-on-color {
+	color: #0B3F7E;
+}
+
+.more {
+	height: 80rpx;
+	font-size: 50rpx;
+}
 </style>

+ 36 - 0
pages/index/modules/home.vue

@@ -0,0 +1,36 @@
+<template>
+	<view>
+		<cu-custom ref="Dustom"
+			bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png">
+			<block slot="backText">返回</block>
+			<block slot="content">
+			</block>
+		</cu-custom>
+		首页
+		<view style="width:20px;height: 100vh;background-color: red;">
+		</view>
+		<view style="width:50px;height: 100vh;background-color: red;">
+		</view>
+		<view style="width:120px;height: 100vh;background-color: red;">
+		</view>
+
+		<view style="height: calc(62px + env(safe-area-inset-bottom) / 2);" />
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'Home',
+	data() {
+		return {
+
+		};
+	},
+	mounted() {
+		const Dustom = this.$refs.Dustom;
+		Dustom.CustomBar = Dustom.CustomBar + 66;
+	},
+}
+</script>
+
+<style lang="scss"></style>

+ 20 - 0
pages/index/modules/message.vue

@@ -0,0 +1,20 @@
+<template>
+	<view>
+		消息
+	</view>
+</template>
+
+<script>
+	export default {
+		name:'Message',
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 229 - 0
pages/index/modules/mine.vue

@@ -0,0 +1,229 @@
+<template>
+	<view>
+		<cu-custom ref="Dustom"
+			bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png">
+			<view slot="head" class="head" :style="{ 'height': headHeight, 'top': posTop }">
+				<view class="custom-bar" :style="{ 'height': customBar }">
+					<navigator class="iconfont icon-wode-xuanzhong" url="#">
+
+					</navigator>
+				</view>
+				<navigator class="user" url="#">
+					<view class="profile-photo">
+						<view class="substitution">
+							<text class="iconfont icon-wode-xuanzhong" />
+						</view>
+					</view>
+					<view class="text">
+						<view class="name u-line-1">
+							{{ userMsg.name }}
+						</view>
+						<view class="replenish">
+							<text class="iconfont icon-daka" style="margin-right: 10rpx;" />
+							{{ userMsg.phonenumber || '未填写' }}
+							<text style="margin: 0 20rpx;">
+								|
+							</text>
+							{{ userMsg.hr.position || '未知职位' }}
+						</view>
+					</view>
+				</navigator>
+			</view>
+		</cu-custom>
+
+		<view class="nav-box">
+			<navigator class="nav-item" url="#">
+				<text class="iconfont icon-wode-xuanzhong" style="margin-right: 20rpx;" />
+				<view>
+					修改登录密码
+				</view>
+				<text class="iconfont icon-wode-xuanzhong" />
+			</navigator>
+			<navigator class="nav-item" url="#">
+				<text class="iconfont icon-wode-xuanzhong" style="margin-right: 20rpx;" />
+				<view>
+					修改登录手机号
+				</view>
+				<text class="iconfont icon-wode-xuanzhong" />
+			</navigator>
+			<navigator class="nav-item" url="#">
+				<text class="iconfont icon-wode-xuanzhong" style="margin-right: 20rpx;" />
+				<view>
+					绑定微信
+				</view>
+				<text class="iconfont icon-wode-xuanzhong" />
+			</navigator>
+		</view>
+		<u-button :customStyle="butStyle" @click="logOut()">退出登录</u-button>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'Mine',
+	data() {
+		return {
+			headHeight: 0,
+			posTop: 0,
+			customBar: 0,
+			butStyle: {
+				position: "fixed",
+				bottom: '240rpx',
+				left: "20rpx",
+				width: "710rpx",
+				height: "90rpx",
+				background: "rgba(255,255,255,0.1)",
+				borderRadius: "8rpx",
+				border: "1rpx solid rgba(255,255,255,0.5)",
+				fontSize: "30rpx",
+				color: "#FFFFFF"
+			},
+			userMsg: {}
+		};
+	},
+	created() {
+		this.getUserMsg()
+	},
+	mounted() {
+		const Dustom = this.$refs.Dustom;
+		Dustom.CustomBar = Dustom.CustomBar + 94;
+		this.headHeight = (Dustom.CustomBar - this.StatusBar) + 'px';
+		this.customBar = (this.CustomBar - this.StatusBar) + 'px';
+		this.posTop = this.StatusBar + 'px';
+	},
+	methods: {
+		// 获取用户信息
+		getUserMsg() {
+			this.$Http.basic({
+				id: 20230608105102,
+				content: {
+					nocache: true
+				}
+			}).then(res => {
+				if (this.cutoff(res.msg)) return;
+				this.userMsg = res.data;
+				console.log(this.userMsg)
+
+			})
+		},
+		logOut() {
+			uni.showModal({
+				title: '提示',
+				content: '是否确认退出登录',
+				success: ({ confirm }) => {
+					if (confirm) uni.reLaunch({
+						url: "/pages/login/login"
+					})
+				},
+			})
+		},
+	},
+}
+</script>
+
+<style lang="scss">
+.head {
+	position: fixed;
+	width: 100vw;
+	z-index: 99991;
+
+
+	.custom-bar {
+		width: 100vw;
+		position: relative;
+
+		.iconfont {
+			position: absolute;
+			bottom: 28rpx;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			margin-left: 20rpx;
+		}
+	}
+
+	.user {
+		display: flex;
+		height: 168rpx;
+		width: 100vw;
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.profile-photo {
+			width: 128rpx;
+			height: 128rpx;
+			border-radius: 50%;
+			overflow: hidden;
+			flex-shrink: 0;
+			margin-right: 20rpx;
+
+			.substitution {
+				width: 128rpx;
+				line-height: 128rpx;
+				text-align: center;
+				background: #EFF4FA;
+
+				.iconfont {
+					font-size: 64rpx;
+					color: #7C98BB;
+				}
+			}
+
+
+		}
+
+		.text {
+			flex: 1;
+			height: 128rpx;
+			width: 0;
+
+			.name {
+				height: 48rpx;
+				line-height: 48rpx;
+				font-size: 34rpx;
+				color: #FFFFFF;
+				margin-top: 10rpx;
+			}
+
+			.replenish {
+				margin-top: 20rpx;
+				line-height: 40rpx;
+				font-size: 28rpx;
+				color: #FFFFFF;
+			}
+		}
+	}
+}
+
+.nav-box {
+	width: 710rpx;
+	margin: 20rpx auto 0;
+	border-radius: 8rpx;
+	overflow: hidden;
+	background: rgba($color: #fff, $alpha: 0.1);
+
+	.nav-item {
+		display: flex;
+		align-items: center;
+		width: 710rpx;
+		height: 90rpx;
+		padding: 0 20rpx;
+		box-sizing: border-box;
+		color: #fff;
+		font-size: 28rpx;
+
+		view {
+			flex: 1;
+		}
+
+		text {
+			flex-shrink: 0;
+		}
+	}
+}
+
+
+
+.cu-bar .content {
+	overflow: auto !important;
+}
+</style>

+ 34 - 0
pages/index/modules/my-map.vue

@@ -0,0 +1,34 @@
+<template>
+	<view>
+		<map name="map" subkey="UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN" layer-style="1" show-location enable-poi></map>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'My-map',
+	data() {
+		return {
+			//subkey: 'GUCBZ-FWJCQ-AOQ5J-BUCCC-V7MJV-2QBDD',微信小程序个性化样式KEY
+		};
+	},
+	created() {
+		// #ifdef H5
+		console.log("H5")
+		// #endif
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+page {
+	width: 100vw;
+	height: 100vh;
+	overflow: hidden;
+}
+
+map {
+	width: 750rpx;
+	height: 100vh;
+}
+</style>