|
@@ -1,271 +1,249 @@
|
|
|
<template>
|
|
|
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
- <div class="top" :style="{'background-image':'url('+require('../static/top_bg.png')+')','margin-top':-mt+'px'}">
|
|
|
- <div class="t_box" :style="{'background-image':'url('+require('../static/top_boxbg.png')+')'}">
|
|
|
- <image src="@/static/ai_shape.png"></image>
|
|
|
- <div class="text adffcac">
|
|
|
- <text>Hi!我是甜心小兔</text>
|
|
|
- <p>
|
|
|
- 支持语音唤醒 按键对话<br>
|
|
|
- 回应每一个奇思妙想<br>
|
|
|
- 好奇的孩子更聪明~
|
|
|
- </p>
|
|
|
- </div>
|
|
|
+ <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
+ <image class="topbg" src="@/static/home_topbg.png"></image>
|
|
|
+ <template v-if="list.length">
|
|
|
+ <div class="list" :style="{'margin-top':(360-mt-61)+'px'}">
|
|
|
+ <u-list @scrolltolower="scrolltolower">
|
|
|
+ <u-list-item v-for="(item, index) in list" :key="index">
|
|
|
+ <div class="l_box box">
|
|
|
+ <div class="l_top adfacjb">
|
|
|
+ <div class="lt_l">我的设备:{{1}}</div>
|
|
|
+ <div class="lt_r adfac">
|
|
|
+ <image src="@/static/wifi_on_mini.png" v-if="index===0"></image>
|
|
|
+ <image src="@/static/wifi_off_mini.png" v-else></image>
|
|
|
+ <image src="@/static/online_mini.png" v-if="index===0"></image>
|
|
|
+ <image src="@/static/offline_mini.png" v-else></image>
|
|
|
+ <div class="ltr_zt" :class="{'zx':index===0,'lx':index===1}">{{index===0?'在线':'离线'}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="l_content">
|
|
|
+ <div class="lc_role adfac">
|
|
|
+ <image class="lcr_l" src="@/static/avatar_default.png"></image>
|
|
|
+ <div class="lcr_r">
|
|
|
+ <p>{{'角色昵称'}}</p>
|
|
|
+ <div class="text">角色模板:{{'英语老师'}}</div>
|
|
|
+ <div class="text">绑定时间:{{'2025-05-25'}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="lc_info">
|
|
|
+ {{'一个充满活力与好奇心的年轻人。性格开朗乐观,对生活充满热情。你喜欢在公园等自由自在的地方与朋友们一起探索乐趣…'}}
|
|
|
+ </div>
|
|
|
+ <div class="lc_btns adfac">
|
|
|
+ <div class="lcb_pre">角色编辑</div>
|
|
|
+ <div class="lcb_pre">更换网络</div>
|
|
|
+ <div class="lcb_pre">解绑设备</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </u-list-item>
|
|
|
+ </u-list>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="card">
|
|
|
- <div class="title adfacjb">
|
|
|
- <div class="t_l">我的设备</div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div class="empty box">
|
|
|
+ <image src="@/static/empty_device.png"></image>
|
|
|
+ <p>暂无设备,快去添加开始聊天吧~</p>
|
|
|
+ <div class="zt_btn" @tap="addDevice"> + 添加新设备</div>
|
|
|
</div>
|
|
|
- <div class="device_boxs adfacjb">
|
|
|
- <div class="db_pre adffcjb" :style="{'background-image':'url('+require('../static/box_bg2.png')+')'}" @tap="addBindDevice">
|
|
|
- <div class="dp_top adfac">
|
|
|
- <image src="@/static/bind.png"></image>
|
|
|
- <span>绑定设备</span>
|
|
|
- </div>
|
|
|
- <div class="dp_tip">按照产品教程绑定设备,添加成功后选择角色</div>
|
|
|
- </div>
|
|
|
- <div class="db_pre adffcjb" :style="{'background-image':'url('+require('../static/box_bg1.png')+')'}" @tap="toTurn('/pages/wifi')">
|
|
|
- <div class="dp_top adfac">
|
|
|
- <image src="@/static/change.png"></image>
|
|
|
- <span>网络连接</span>
|
|
|
- </div>
|
|
|
- <div class="dp_tip">请先连接热点,然后选择要连接的网络</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <template v-if="agentList.length">
|
|
|
- <div class="title adfacjb" style="margin-top: 70rpx;margin-bottom: 22rpx;">
|
|
|
- <div class="t_l">我的角色</div>
|
|
|
- <div class="t_r">查看全部</div>
|
|
|
- </div>
|
|
|
- <div class="a_item adfacjb" v-for="(item,index) in agentList" :key="index">
|
|
|
- <div class="ai_l">
|
|
|
- {{item.agentName}}
|
|
|
- </div>
|
|
|
- <div class="ai_r" @tap="toAgentDetail(item)">查看</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <cus-tabbar :tabbarIndex="0"></cus-tabbar>
|
|
|
+ <bind-device ref="bdRef"></bind-device>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import cusTabbar from '@/components/CusTabbar/index.vue'
|
|
|
+ import bindDevice from '@/components/bindDevice/index.vue'
|
|
|
export default {
|
|
|
+ components:{
|
|
|
+ cusTabbar,
|
|
|
+ bindDevice
|
|
|
+ },
|
|
|
data(){
|
|
|
return {
|
|
|
- deviceList:[],
|
|
|
- agentList:[]
|
|
|
+ list:[]
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- this.getAgentList();
|
|
|
- },
|
|
|
methods:{
|
|
|
- getAgentList(){
|
|
|
- this.$api.get('/agent/list').then(res=>{
|
|
|
- if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
- this.agentList = res.data.data.splice(0,5);
|
|
|
- })
|
|
|
- },
|
|
|
- addBindDevice(){
|
|
|
- uni.scanCode({
|
|
|
- success: (res) => {
|
|
|
- let result = JSON.parse(res.result);
|
|
|
- if(res.errMsg==='scanCode:ok'){
|
|
|
- this.$api.post('/device/bindAdd',{
|
|
|
- ...result,
|
|
|
- "type": "",
|
|
|
- "userId": 0,
|
|
|
- "agentId": ""
|
|
|
- }).then(res=>{
|
|
|
- if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/agentCreate'
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ addDevice(){
|
|
|
+ this.$refs.bdRef.show = true;
|
|
|
},
|
|
|
- toTurn(url){
|
|
|
- uni.navigateTo({ url })
|
|
|
- },
|
|
|
- toAgentDetail(item){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/agentDetail?id='+item.id+'&vname='+item.ttsVoiceName
|
|
|
- })
|
|
|
+ scrolltolower(){
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
- .page{
|
|
|
- background: linear-gradient( 180deg, #E0EEFF 0%, #F6FCFF 100%);
|
|
|
+ .tabPage{
|
|
|
+ background: #FFFFFF;
|
|
|
+ padding-bottom: 192rpx;
|
|
|
box-sizing: border-box;
|
|
|
- .top{
|
|
|
+
|
|
|
+ .topbg{
|
|
|
width: 100%;
|
|
|
- height: 564rpx;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
+ height: 720rpx;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .box{
|
|
|
position: relative;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: flex-end;
|
|
|
- .t_box{
|
|
|
- width: calc(100% - 60rpx);
|
|
|
- height: 296rpx;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- position: relative;
|
|
|
- bottom: 30rpx;
|
|
|
- left: 30rpx;
|
|
|
- image{
|
|
|
- width: 256rpx;
|
|
|
- height: 336rpx;
|
|
|
- position: absolute;
|
|
|
- left: 38rpx;
|
|
|
- bottom: 14rpx;
|
|
|
- }
|
|
|
- .text{
|
|
|
- padding: 66rpx 46rpx 0 332rpx;
|
|
|
- text{
|
|
|
- font-family: PingFangSC, PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 40rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- line-height: 56rpx;
|
|
|
- }
|
|
|
- p{
|
|
|
- font-family: PingFangSC, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 26rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- line-height: 48rpx;
|
|
|
- margin-top: 12rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ width: calc(100% - 60rpx);
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0,0,0,0.04);
|
|
|
+ border-radius: 32rpx;
|
|
|
+ border: 1rpx solid #D9F159;
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
- .card{
|
|
|
- padding: 0 30rpx 30rpx;
|
|
|
- .title{
|
|
|
- margin-top: 36rpx;
|
|
|
- .t_l{
|
|
|
- font-family: PingFangSC, PingFang SC;
|
|
|
- font-weight: 600;
|
|
|
- font-size: 36rpx;
|
|
|
- color: #111111;
|
|
|
- line-height: 50rpx;
|
|
|
- text-align: left;
|
|
|
- }
|
|
|
- .t_r{
|
|
|
- font-family: PingFangSC, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #0066FE;
|
|
|
- line-height: 40rpx;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
+ .list{
|
|
|
+ position: relative;
|
|
|
+ margin: 0 30rpx 0;
|
|
|
+ width: calc(100% - 60rpx);
|
|
|
+ height: calc(100vh - 740rpx);
|
|
|
+ ::v-deep .u-list{
|
|
|
+ width: 100%;
|
|
|
+ height: 100% !important;
|
|
|
}
|
|
|
- .device_empty{
|
|
|
- background: #FFFFFF;
|
|
|
- box-shadow: 0rpx 4rpx 20rpx 0rpx #E5EDFF;
|
|
|
- border-radius: 24rpx;
|
|
|
- margin-top: 32rpx;
|
|
|
- padding: 48rpx 79rpx;
|
|
|
- background: #FFFFFF;
|
|
|
- p{
|
|
|
- font-family: PingFangSC, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #5C5C5C;
|
|
|
- line-height: 48rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .de_btn{
|
|
|
- width: 320rpx;
|
|
|
- height: 72rpx;
|
|
|
- background: #0066FE;
|
|
|
- border-radius: 16rpx;
|
|
|
- margin-top: 40rpx;
|
|
|
- image{
|
|
|
- width: 30rpx;
|
|
|
- height: 30rpx;
|
|
|
- }
|
|
|
- span{
|
|
|
+ ::v-deep .u-list-item{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .l_box{
|
|
|
+ width: 100%;
|
|
|
+ padding: 49rpx 30rpx 40rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ .l_top{
|
|
|
+ .lt_l{
|
|
|
font-family: PingFang-SC, PingFang-SC;
|
|
|
font-weight: bold;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- line-height: 32rpx;
|
|
|
- margin-left: 16rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #111111;
|
|
|
+ line-height: 40rpx;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- .device_boxs{
|
|
|
- margin-top: 31rpx;
|
|
|
- .db_pre{
|
|
|
- width: calc(50% - 15rpx);
|
|
|
- height: 138px;
|
|
|
- padding: 36rpx 30rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- .dp_top{
|
|
|
+ .lt_r{
|
|
|
image{
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
+ width: 42rpx;
|
|
|
+ height: 42rpx;
|
|
|
+ margin-right: 34rpx;
|
|
|
}
|
|
|
- span{
|
|
|
- font-family: PingFang-SC, PingFang-SC;
|
|
|
- font-weight: bold;
|
|
|
- font-size: 32rpx;
|
|
|
- color: #333333;
|
|
|
- line-height: 32rpx;
|
|
|
- text-align: left;
|
|
|
- margin-left: 40rpx;
|
|
|
+ .ltr_zt{
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 26rpx;
|
|
|
+ line-height: 37rpx;
|
|
|
+ padding-left: 22rpx;
|
|
|
+ position: relative;
|
|
|
+ &::before{
|
|
|
+ content: '';
|
|
|
+ width: 12rpx;
|
|
|
+ height: 12rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 50%;
|
|
|
+ margin-top: -6rpx;
|
|
|
+ }
|
|
|
+ &.zx{
|
|
|
+ color: #1B50FF;
|
|
|
+ &::before{
|
|
|
+ background: #1B50FF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.lx{
|
|
|
+ color: #C7C7C7;
|
|
|
+ &::before{
|
|
|
+ background: #C7C7C7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .l_content{
|
|
|
+ border-top: 1rpx solid #E2E2E2;
|
|
|
+ margin-top: 37rpx;
|
|
|
+ padding-top: 36rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ .lc_role{
|
|
|
+ .lcr_l{
|
|
|
+ width: 148rpx;
|
|
|
+ height: 148rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ .lcr_r{
|
|
|
+ width: calc(100% - 148rpx);
|
|
|
+ padding-left: 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ p{
|
|
|
+ font-family: PingFang-SC, PingFang-SC;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #111111;
|
|
|
+ line-height: 32rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .text{
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #7C8592;
|
|
|
+ line-height: 24rpx;
|
|
|
+ margin-top: 24rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- .dp_tip{
|
|
|
+ .lc_info{
|
|
|
+ margin-top: 36rpx;
|
|
|
font-family: PingFangSC, PingFang SC;
|
|
|
font-weight: 400;
|
|
|
font-size: 24rpx;
|
|
|
- color: #6E696F;
|
|
|
+ color: #7C8592;
|
|
|
line-height: 40rpx;
|
|
|
}
|
|
|
+ .lc_btns{
|
|
|
+ margin-top: 62rpx;
|
|
|
+ margin-left: -1rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ .lcb_pre{
|
|
|
+ width: calc(100% / 3);
|
|
|
+ height: 37rpx;
|
|
|
+ border-left: 1rpx solid #72832B;
|
|
|
+ font-family: PingFang-SC, PingFang-SC;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #72832B;
|
|
|
+ line-height: 37rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- .a_item{
|
|
|
- width: 100%;
|
|
|
- padding: 37rpx 20rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- background: #FFFFFF;
|
|
|
+ }
|
|
|
+ .empty{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin: 392rpx 30rpx 0;
|
|
|
+ padding: 84rpx 40rpx 64rpx;
|
|
|
+
|
|
|
+ image{
|
|
|
+ width: 64rpx;
|
|
|
+ height: 66rpx;
|
|
|
+ }
|
|
|
+ p{
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #A6A6A6;
|
|
|
+ line-height: 42rpx;
|
|
|
+ text-align: center;
|
|
|
margin-top: 30rpx;
|
|
|
- .ai_l{
|
|
|
- width: calc(100% - 114rpx);
|
|
|
- font-family: PingFang-SC, PingFang-SC;
|
|
|
- font-weight: bold;
|
|
|
- font-size: 32rpx;
|
|
|
- color: #111111;
|
|
|
- line-height: 32rpx;
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
- .ai_r{
|
|
|
- width: 94rpx;
|
|
|
- height: 56rpx;
|
|
|
- background: #0066FE;
|
|
|
- border-radius: 16rpx;
|
|
|
- font-family: PingFang-SC, PingFang-SC;
|
|
|
- font-weight: bold;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- line-height: 56rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
+ }
|
|
|
+ .zt_btn{
|
|
|
+ margin-top: 80rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|