AIBazaar.vue
4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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
<template>
<view class="ai-box">
<view class="ai-welcome">
<view class="sprite-icon icon-ai-bazaar"></view>
<view class="welcome-title">欢迎使用广联AI集市</view>
</view>
<view class="ai-content">
<view
class="list-box"
v-for="item in list"
:key="item.id"
>
<view class="list-title">{{ item.preEntryName }}</view>
<view class="item-box">
<view
class="item"
@click="jump(i)"
v-for="i in item.agentList"
:key="i.id"
>
<image
class="item-img"
:src="i.entryLogoUrl"
mode="scaleToFill"
/>
<view class="text">{{ i.entryName }}</view>
<view
v-if="i.tipShowFlag == 1"
class="red-dot"
></view>
</view>
</view>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'AIBazaar',
props: {
isPermissionFunction: null
},
data () {
return {
list: []
}
},
created () {
uni.$on('pageBack', () => {
this.getAiagentList()
})
},
mounted () {
this.getAiagentList()
},
methods: {
async getAiagentList () {
const { phone } = uni.$storage.get("userInfo")
const params = {
ownerShipType: 1, // 驻店
accountPhone: phone
}
const res = await uni.$api.commonApi.getAiagentList(params)
console.log(res)
this.list = res
},
async jump (data) {
let { agentUrl, domainName, presuppositionProblem, taskStatus, checkDate, agentCode } = data
if (agentCode == 'AI7') {
const isPermision = await this.isPermissionFunction('请打开麦克风权限')
if (!isPermision) return
}
if (!agentUrl) {
return uni.showToast({
title: '待开放',
icon: 'none'
})
}
let url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}`
const { phone } = uni.$storage.get("userInfo")
url += `&practice_status=${taskStatus}&date=${checkDate}`
const res = await uni.$api.commonApi.updateSopAiAgentMessageStatus({
staffPhone: phone
})
uni.navigateTo({ url })
}
}
}
</script>
<style scoped lang="scss">
.ai-box {
box-sizing: border-box;
height: calc(100vh - #{toRpx(160)});
overflow: hidden;
background-color: rgba(255, 255, 255, 0.35);
box-shadow: inset 0 0 16px 0 rgb(255, 255, 255);
margin-top: toRpx(80);
margin-right: toRpx(66);
border-radius: toRpx(48);
.ai-welcome {
display: flex;
flex-direction: column;
align-items: center;
margin-top: toRpx(120);
.welcome-title {
margin-top: toRpx(48);
font-size: toRpx(48);
font-weight: 500;
background: linear-gradient(90deg, #369eff, #2c66f7);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.ai-content {
margin: toRpx(64);
}
.list-box {
border-radius: toRpx(16);
background-color: #fff;
padding: toRpx(48);
margin-bottom: toRpx(40);
.list-title {
position: relative;
margin-left: toRpx(24);
font-size: toRpx(32);
font-weight: 500;
color: #333;
&::before {
content: '';
display: inline-block;
position: absolute;
top: 50%;
left: toRpx(-24);
transform: translateY(-50%);
width: toRpx(8);
height: toRpx(36);
background: linear-gradient(158deg, #4facfe, #00f2fe);
border-radius: 0 toRpx(8) toRpx(8) 0;
}
}
.item-box {
display: flex;
flex-wrap: wrap;
margin-top: toRpx(40);
gap: toRpx(48);
.item {
display: inline-flex;
align-items: center;
width: toRpx(412);
box-sizing: border-box;
font-size: toRpx(30);
color: #333;
border-radius: toRpx(16);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
padding: toRpx(16) toRpx(32);
// margin-right: toRpx(50);
margin-bottom: toRpx(30);
&:nth-child(5n) {
margin-right: 0;
}
.text {
margin-left: toRpx(15);
// width: toRpx(160);
}
&-img {
width: toRpx(96);
height: toRpx(96);
// margin-left: toRpx(20);
}
.red-dot {
background-color: #f24724;
width: toRpx(16);
height: toRpx(16);
border-radius: 50%;
margin-left: toRpx(8);
}
}
}
}
}
</style>