Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24814b7dee | ||
|
|
cd7a77c6e4 | ||
|
|
90864a4a8c | ||
|
|
b6febf2df9 |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
VITE_ENABLE_MOCK=false
|
||||
VITE_API_PREFIX=/api
|
||||
VITE_PROXY_ENDPOINT=https://bright.yilibili.com
|
||||
VITE_PROXY_ENDPOINT=https://bright.yilibili.com/api
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { get } from '@/api/request'
|
||||
import httpClient from '@/api/httpClient'
|
||||
|
||||
function getCarousalList() {
|
||||
return get('https://bright.yilibili.com/api/carousals/active-list')
|
||||
return httpClient.get('/carousals/active-list')
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createUniAppAxiosAdapter } from '@uni-helper/axios-adapter'
|
||||
import axios from 'axios'
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_URL,
|
||||
baseURL: import.meta.env.VITE_PROXY_ENDPOINT,
|
||||
adapter: createUniAppAxiosAdapter(),
|
||||
})
|
||||
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
import type { CreateTokenRequest } from '@/model/token'
|
||||
import httpClient from './httpClient'
|
||||
|
||||
export function createToken(createTokenRequest: CreateTokenRequest) {
|
||||
return httpClient.post<{ token: string }>('/tokens', createTokenRequest)
|
||||
export function createToken(code: string) {
|
||||
return httpClient.post<{ token: string }>(`/we-chat/tokens/${code}`)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface CreateCarousalsRequest {
|
||||
imageUrl: string
|
||||
targetType: string
|
||||
targetUrl?: string
|
||||
targetId?: string
|
||||
}
|
||||
@@ -37,6 +37,5 @@
|
||||
"navigationBarTitleText": "Vitesse-Uni",
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"__esModule": true,
|
||||
"subPackages": []
|
||||
}
|
||||
@@ -18,13 +18,13 @@ const videoSrc = ref(
|
||||
>
|
||||
<view class="container">
|
||||
<video
|
||||
class="video-player min-h-80 max-w-full"
|
||||
class="absolute top-0 left-0 w-screen h-screen"
|
||||
:src="videoSrc"
|
||||
autoplay
|
||||
loop
|
||||
object-fit="cover"
|
||||
muted
|
||||
:controls="false"
|
||||
objectFit="fill"
|
||||
/>
|
||||
<view class="content">
|
||||
<image :src="left_top_logo" class="left-3 w-48 h-6" />
|
||||
@@ -73,7 +73,8 @@ const videoSrc = ref(
|
||||
width: 100%
|
||||
height: 100%
|
||||
controlslist: none
|
||||
objectfit: cover /* 修改适应方式为覆盖 */
|
||||
aspect-ratio: 16 / 9
|
||||
object-fit: cover
|
||||
|
||||
.content
|
||||
position: absolute
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { CreateCarousalsRequest } from '@/model/carousals'
|
||||
import carousalApi from '@/api/carousal'
|
||||
import CardList from '@/pages/pet-manual/components/CardList.vue'
|
||||
// const searchValue = ref('')
|
||||
@@ -13,9 +14,9 @@ interface ListItem {
|
||||
desc: string
|
||||
time: string
|
||||
}
|
||||
interface Item {
|
||||
content: string
|
||||
}
|
||||
// interface Item {
|
||||
// content: string
|
||||
// }
|
||||
interface DotStyle {
|
||||
backgroundColor: string
|
||||
selectedBackgroundColor: string
|
||||
@@ -74,10 +75,13 @@ const listModel = ref<ListItem[]>([
|
||||
const safeHeight = ToolApi.getSafeHeight()
|
||||
const searchValue = ref<string>('')
|
||||
|
||||
const info = ref<Item[]>([
|
||||
{ content: '内容 A' },
|
||||
{ content: '内容 B' },
|
||||
{ content: '内容 C' },
|
||||
const info = ref<CreateCarousalsRequest[] | null>([
|
||||
{
|
||||
imageUrl: '',
|
||||
targetId: '',
|
||||
targetType: '',
|
||||
targetUrl: '',
|
||||
},
|
||||
])
|
||||
|
||||
const current = ref<number>(0)
|
||||
@@ -121,8 +125,16 @@ const findList = ref<{ name: string }[]>([
|
||||
{ name: '宠物吃饭慢' },
|
||||
{ name: '猫咪尿闭怎么办' },
|
||||
])
|
||||
function onLoad() {
|
||||
carousalApi.getCarousalList()
|
||||
async function onLoad() {
|
||||
const getCarousalListApi = await carousalApi.getCarousalList()
|
||||
info.value = getCarousalListApi
|
||||
}
|
||||
function handleJumpUrl(item: CreateCarousalsRequest) {
|
||||
if (item.targetType === 'url') {
|
||||
uni.navigateTo({
|
||||
url: item.targetUrl,
|
||||
})
|
||||
}
|
||||
}
|
||||
onLoad()
|
||||
</script>
|
||||
@@ -176,9 +188,9 @@ onLoad()
|
||||
<view class="mx-4 mt-4">
|
||||
<uni-swiper-dot :info="info" :current="current" field="content" mode="dot" :dots-styles="dotStyle">
|
||||
<swiper class="swiper-box" @change="change">
|
||||
<swiper-item v-for="(item, index) in info" :key="index" style="background: rgba(0, 0, 0, 0.20)">
|
||||
<view class="swiper-item">
|
||||
{{ item.content }}
|
||||
<swiper-item v-for="(item, index) in info" :key="index">
|
||||
<view class="swiper-item w-full h-full flex items-center justify-center">
|
||||
<image :src="item.imageUrl" mode="heightFix" class="w-full h-full" @tap="handleJumpUrl(item)" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
Reference in new issue
Block a user