<template>
|
<view class="container">
|
<view class="form">
|
<image src="/static/bg_ai_assistant_title.png" class="banner"></image>
|
</view>
|
<u-transition :show="true" mode="slide-right">
|
<view class="tool_list">
|
<view class="group_tool_wrap" v-for="item in models" :key="item.assistant_id" @click="handleJump(item)">
|
<view class="tool_wrap">
|
<u--image :showLoading="true" :src="`${setting_data.base_url+item.icon}`" width="112rpx" height="112rpx" class="tool_icon"></u--image>
|
<view class="tool_info">
|
<view class="tool_name">
|
<view class="tool_name_l">
|
{{item.title}}
|
<view class="label_wrap" style="background-color: #FF9900" v-if="item.tag">{{item.tag}}</view>
|
<view class="label_wrap" v-else></view>
|
</view>
|
<span>去提问</span>
|
</view>
|
<view class="tool_hint">{{item.description}}</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</u-transition>
|
<m-tabbar v-if="showTab" fixed fill :current="tabIndex" :tabbar="tabbar"></m-tabbar>
|
</view>
|
</template>
|
|
<script>
|
import setting from "@/common/config.js"
|
// import {
|
// handleConfig,
|
// handleTime
|
// } from "@/uni_modules/chao-AI/js_sdk/common.js"
|
// import {
|
// getAppla, recognition
|
// } from "@/uni_modules/chao-AI/js_sdk/index.js"
|
// import pageNav from "@/uni_modules/chao-AI/components/page-nav.vue"
|
import { mapState } from "vuex"
|
import mixin from "@/mixin/checkLoaded";
|
export default {
|
mixins: [mixin],
|
// components: {
|
// pageNav
|
// },
|
data() {
|
return {
|
setting_data:'null',
|
showTab: false,
|
tabIndex: 0
|
};
|
},
|
computed: {
|
...mapState(['models','tabbar','userInfo'])
|
},
|
async onLoad() {
|
console.log(this.models,"assisstent")
|
this.setting_data = setting
|
this.getTabIndex()
|
|
},
|
onShareAppMessage: function() {
|
return {
|
title: '一键AI问答',
|
imageUrl: '/static/wenda.png',
|
};
|
},
|
onShareTimeline: function() {
|
return {
|
title: '一键AI问答',
|
imageUrl: '/static/wenda.png',
|
};
|
},
|
methods: {
|
getTabIndex() {
|
let list = this.tabbar.list;
|
for (var i = 0; i < list.length; i++) {
|
if (list[i].pagePath == '/pages/tab/assistant') {
|
this.tabIndex = i
|
this.showTab = true
|
}
|
}
|
},
|
async handlegetAppla({
|
pageIndex,
|
pageSize
|
}) {
|
const res = await getAppla({
|
id: uni.getAccountInfoSync().miniProgram.appId,
|
pageIndex,
|
pageSize
|
})
|
this.list = res.data
|
},
|
handleJump(item) {
|
if (!this.userInfo.token) {
|
uni.navigateTo({
|
url: "/pages/login/newlogin"
|
})
|
return
|
}
|
uni.navigateTo({
|
url: "/pages/index/chat?model=" + JSON.stringify(item)
|
})
|
},
|
async handlefig(code) {
|
const res = await handleConfig(code)
|
const {
|
admin
|
} = res
|
this.admin = admin
|
const data = {
|
pageIndex: 1,
|
pageSize: 12
|
}
|
await this.handlegetAppla(data)
|
uni.hideLoading()
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import url("@/static/style/color-ui.css");
|
|
.form {
|
border-bottom-left-radius: 30rpx;
|
border-bottom-right-radius: 30rpx;
|
padding: 0 0;
|
/* #ifndef H5 */
|
padding-top: var(--status-bar-height);
|
margin-top: 60rpx;
|
/* #endif */
|
}
|
|
.head-top {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.logo {
|
width: 30%;
|
height: 6rem;
|
max-width: 120px;
|
margin-right: 10px;
|
}
|
|
.head-top-right {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
flex: 1;
|
}
|
|
.ai-consult {
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.ai {
|
display: flex;
|
}
|
|
.ai-btn {
|
padding: 6px 14px 6px 0px;
|
font-weight: bold;
|
border-radius: 4px;
|
font-size: 18px;
|
margin: 8px 0px 0px 10px;
|
}
|
|
.member {
|
font-size: 12px;
|
color: #f6c244;
|
margin-top: 10px;
|
flex: 1;
|
}
|
|
.consult {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-top: 10px;
|
}
|
|
.consult-btn {
|
padding: 6px 10px;
|
color: #7369ff;
|
font-size: 8px;
|
width: 150px;
|
text-align: center;
|
}
|
|
.admin-btn {
|
padding: 6px 10px;
|
background-color: #23c27e;
|
color: #ffffff;
|
border-radius: 4px;
|
font-size: 16px;
|
margin-left: 10px;
|
}
|
|
.head-bottom {
|
padding: 10px 0;
|
}
|
|
.description {
|
font-size: 12px;
|
color: #333333;
|
}
|
|
.tool_list {
|
flex-wrap: wrap;
|
padding: 0 32rpx;
|
padding-bottom: 60rpx;
|
|
.group_tool_wrap {
|
align-items: center;
|
justify-content: space-between;
|
min-height: 168rpx;
|
display: flex;
|
border-radius: 24rpx;
|
background: url('@/static/img/box-bg.png') #fbfbfb no-repeat;
|
background-position: left top;
|
background-size: 180rpx 180rpx;
|
margin-top: 24rpx;
|
align-items: center;
|
|
.label_wrap {
|
display: inline-block;
|
margin-left: 8rpx;
|
width: 60rpx;
|
height: 32rpx;
|
line-height: 32rpx;
|
border-radius: 3px;
|
color: #fff;
|
font-size: 20rpx;
|
font-weight: normal;
|
text-align: center;
|
}
|
|
.tool_wrap {
|
box-sizing: border-box;
|
display: flex;
|
padding: 32rpx;
|
align-items: center;
|
|
.tool_info {
|
width: calc(100vw - 132px);
|
|
.tool_name {
|
display: flex;
|
font-size: 40rpx;
|
font-weight: 600;
|
color: #08073F;
|
align-items: center;
|
.tool_name_l{
|
flex: 1;
|
display: flex;
|
align-items: center;
|
}
|
|
& > span{
|
width: 108rpx;
|
height: 48rpx;
|
line-height: 46rpx;
|
background: #2F2DDC;
|
color: #fff;
|
text-align: center;
|
font-size: 26rpx;
|
font-weight: normal;
|
border-radius: 8rpx;
|
}
|
}
|
|
.tool_hint {
|
display: -webkit-box;
|
margin: 12rpx 12rpx 0 0;
|
font-size: 26rpx;
|
color: #5C738C;
|
|
overflow: hidden;
|
-webkit-box-orient: vertical;
|
word-break: break-all;
|
text-overflow: ellipsis;
|
-webkit-line-clamp: 2;
|
line-clamp: 2;
|
text-align: justify;
|
}
|
}
|
|
.tool_icon {
|
margin-right: 24rpx;
|
border-radius: 50%;
|
overflow: hidden;
|
}
|
}
|
}
|
}
|
</style>
|
<style scoped>
|
.banner{
|
width: 100vw;
|
height: calc(100vw * 0.324);
|
}
|
</style>
|