123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <template>
- <view class="container">
- <view class="robot">
- <image src="../../static/nav_robot.png" mode="aspectFit"></image>
- </view>
- <view class="titleText">SmartAssistant</view>
- <view class="selectContent">
- <view class="select_box" v-for="(item, index) in dataList" :key="index" @click="clickToItem(item, index)">
- {{ item }}
- </view>
- </view>
- <view class="userInfo">
- <view class="user_regist" @click="clickToRegist">注册</view>
- <view class="user_login" @click="clickToLogin">登录</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dataList: ['首页', 'AI聊天', 'AI画图'],
- currenIndex: this.selectedIndex
- }
- },
- props: {
- selectedIndex: {
- type: Number,
- default: 0
- }
- },
- mounted() {
- this.$emit('clickToIndex', this.currenIndex)
- },
- methods:{
- clickToItem(item, index) {
- if(this.currenIndex === index) {
- return
- }
- this.currenIndex = index
- this.$emit('clickToIndex', index)
- },
- clickToRegist() {
-
- },
- clickToLogin() {
-
- }
- }
-
- }
- </script>
- <style lang="scss">
- .container{
- position: fixed;
- width: 100%;
- height: 60px;
- top: 0%;
- left: 0;
- background: linear-gradient(to right, #303373, #C9A391);
- display: flex;
- box-sizing: border-box;
- align-items: center;
- .robot{
- flex-shrink: 0;
- width: 48px;
- height: 48px;
- margin-left: 15px;
- image{
- width: 100%;
- height: 100%;
- }
- }
- .titleText{
- display: flex;
- margin-left: 10px;
- // height: 100%;
- font-size: 30px;
- font-weight: 500;
- color: #ffffff;
- }
- .selectContent{
- display: flex;
- flex-direction: row;
- height: 100%;
- align-items: center;
-
- .select_box{
- display: flex;
- margin-left: 40px;
- color: #ffffff;
- }
- }
-
- .userInfo{
- position: absolute;
- display: flex;
- box-sizing: border-box;
- height: 100%;
- top: 0px;
- right: 15px;
- align-items: center;
- .user_regist{
- display: flex;
- width: 65px;
- height: 28px;
- border-radius: 28px;
- color: #878787;
- background-color: #ffffff;
- justify-content: center;
- align-items: center;
- }
- .user_login{
- display: flex;
- width: 65px;
- height: 28px;
- border-radius: 28px;
- color: #ffffff;
- background-color: #4C9CF1;
- justify-content: center;
- align-items: center;
- margin-left: 15px;
- }
- }
- }
- </style>
|