mine.vue 6 KB
Newer Older
zhangpeng committed
1
<template>
张成 committed
2
	<view class="pages">
张成 committed
3 4 5 6 7 8
		<view class="menu-banner">
			<view class="log">
				<image class="logImg" src="/static/imgs/hooloo.png"></image>
				<view class="logText">未 来 咖 啡</view>
			</view>
			<image src="../../static/imgs/banner.png"></image>
张成 committed
9
		</view>
张成 committed
10
		<view v-if="userms" class="mod11 flex-col">
张成 committed
11
			<view class="box16 flex-col"></view>
张成 committed
12
			<text class="txt6">{{ userInfo.customerName || '我是谁' }}</text>
张成 committed
13 14 15
			<view class="right_arrow">
				<u-icon name="arrow-right" color="#fff" size="14"></u-icon>
			</view>
张成 committed
16
		</view>
张成 committed
17
		<button class="mod11 flex-col" v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立刻登录</button>
张成 committed
18
		<view class="contents">
张成 committed
19
			<view class="myOrder" @click="goToPage('order')">
张成 committed
20 21 22 23 24 25 26 27
				<view class="order1">我的订单</view>
				<view class="order2">点击查看订单</view>
				<view>
					<image class="orderImg" src="../../static/imgs/myOrder.png">
					</image>
				</view>
			</view>
			<view class="right_box">
张成 committed
28
				<view class="box" @click.stop="goToPage('coupon')">
张成 committed
29 30 31 32 33 34 35 36 37
					<view class="left">
						<h3>HOOLOO券</h3>
						<view class="dec">优惠多多不要错过</view>
					</view>
					<view class="right">
						<image class="right_img" src="../../static/imgs/my3.png"></image>
					</view>
				</view>
				<view class="box two">
张成 committed
38 39 40
					<button v-if="!userms" class="payment" open-type="getPhoneNumber" @getphonenumber.stop="goToPage">
					</button>
					<view @click="goToPage('msg')" class="left">
张成 committed
41 42 43
						<h3>我的消息</h3>
						<view class="dec">点击查看我的消息</view>
					</view>
张成 committed
44
					<view @click="goToPage('msg')" class="right">
张成 committed
45 46 47 48 49 50 51 52 53
						<image class="right_img" src="../../static/imgs/myMail.png"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="function">
			<h3>常用功能</h3>
			<view class="function_item">
				<u-icon name="server-fill" color="#000000" size="16"></u-icon>
张成 committed
54 55
				<button class="function_item_text" open-type="contact" bindcontact="handleContact"
					session-from="sessionFrom">联系客服</button>
weijiguang committed
56
				<u-icon name="arrow-right" class="function_item_icon" color="#000000" size="12"></u-icon>
张成 committed
57 58
			</view>
		</view>
张成 committed
59

zhangpeng committed
60 61 62 63
	</view>
</template>

<script>
张成 committed
64 65
import User from '@/request/user'

张成 committed
66 67 68
export default {
	data() {
		return {
zhangpeng committed
69
		}
张成 committed
70 71
	},
	computed: {
张成 committed
72 73 74 75 76 77
		userms() {
			return this.$store.getters.Authorization;
		},
		userInfo() {
			return this.$store.state.user.userInfo;
		},
张成 committed
78 79
	},
	methods: {
张成 committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
		// 手机号授权登录
		getPhoneNumber(e) {
			if (e.detail.errMsg == 'getPhoneNumber:ok') {
				User.getPhoneNumber(e);
			} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
				uni.showToast({ title: '已拒绝手机号授权', icon: 'error' })
			}
		},
		goToPage(page) {
			if (!this.userms) {
				this.loginByPhoneNumber(page)
				return
			}
			page == 'order' && uni.switchTab({ url: '/pages/order/order' })
			page == 'coupon' && uni.showToast({ title: '功能未开放!', icon: 'none' });
			page == 'msg' && uni.navigateTo({ url: '/mineSubPackage/pages/msg/index' })
		}
zhangpeng committed
97
	}
张成 committed
98
}
zhangpeng committed
99 100
</script>

张成 committed
101
<style lang="scss" scoped>
张成 committed
102 103 104 105 106 107 108 109 110 111
.payment {
	border-radius: 0;
	display: block;
	position: absolute;
	width: 100%;
	height: 100%;
	opacity: 0;
	left: 0;
}

张成 committed
112 113 114 115 116 117 118 119
.menu-box {}

.menu-banner {
	height: 376rpx;
	position: relative;

	.log {
		position: absolute;
张成 committed
120
		z-index: 99;
张成 committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
		top: 100rpx;
		left: 30rpx;

		.logImg {
			width: 312rpx;
			height: 72rpx;
		}

		.logText {
			font-size: 42rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 600;
			color: #FFFFFF;

		}
	}

	image {
		width: 100%;
		height: 376rpx;


	}
zhangpeng committed
144

张成 committed
145
}
张成 committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229

.mod11 {
	margin: 0 auto;
	width: 692rpx;
	height: 144rpx;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 10rpx;
	backdrop-filter: blur(10rpx);
	display: flex;
	align-items: center;
	margin-top: -72rpx;
	padding: 0 30rpx;
	box-sizing: border-box;
	color: #fff;

	.right_arrow {
		margin-left: auto;
	}

	.txt6 {
		margin-left: 20rpx;
	}

	.box16 {
		width: 80rpx;
		height: 80rpx;
		background: #FF72C1;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(50, 50, 50, 0.25);
		border-radius: 4rpx;
	}
}

.contents {
	display: flex;
	align-items: center;
	margin: 34rpx auto;
	width: 692rpx;


	.myOrder {
		width: 270rpx;
		height: 272rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		text-align: center;

		.order1 {
			font-size: 28rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #000000;
			margin-top: 25rpx;
		}

		.order2 {
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #323232;
			margin-top: 10rpx;

		}

		.orderImg {
			width: 70rpx;
			height: 80rpx;
			margin: 0 auto;
			margin-top: 50rpx;
		}
	}

	.right_box {
		margin-left: 20rpx;
	}

	.box {
		width: 396rpx;
		height: 128rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 36rpx;
张成 committed
230
		position: relative;
张成 committed
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281

		&.two {
			margin-top: 15rpx;
		}

		.left {
			text-align: center;
		}

		h3 {
			font-size: 28rpx;
			font-family: Arial-BoldMT, Arial;
			font-weight: 700;
			color: #000000;
		}

		.dec {
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #323232;
			margin-top: 10rpx
		}


		.right_img {
			width: 80rpx;
			height: 55rpx;
		}

	}

}

.function {
	width: 692rpx;
	background: #FFFFFF;
	border-radius: 10rpx;
	margin: 0 auto;
	padding: 25rpx;
	box-sizing: border-box;


	h3 {
		font-size: 28rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 600;
		color: #000000;
	}

	.function_item {
weijiguang committed
282
		display: flex;
张成 committed
283 284 285 286 287 288 289 290 291 292
		font-size: 24rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 600;
		color: #000000;
		line-height: 34rpx;
		display: flex;
		align-items: center;
		margin-top: 20rpx;

		.function_item_text {
weijiguang committed
293
			flex: 1;
张成 committed
294
			margin: 0;
张成 committed
295
			margin-left: 10rpx;
张成 committed
296
			padding: 10rpx;
weijiguang committed
297
			text-align: left;
张成 committed
298 299 300 301
			line-height: 1;
			background-color: #FFFFFF;
			font-size: 24rpx;
			border-radius: 0px;
张成 committed
302 303
		}

张成 committed
304 305 306 307 308 309
		.function_item_text::after {
			position: unset !important;
			border: unset;
		}


张成 committed
310 311 312 313 314 315
		.function_item_icon {
			margin-left: auto;
		}

	}
}
张成 committed
316
</style>