修改上传图片路径参数
This commit is contained in:
@ -29,8 +29,8 @@
|
||||
<template v-for="(label, labelIndex) in teaRoom.label" :key="labelIndex">
|
||||
<view class="mr-20rpx flex items-start">
|
||||
<wd-tag
|
||||
:color="Detail.handleRandomColor(labelIndex)"
|
||||
:bg-color="Detail.handleRandomColor(labelIndex)"
|
||||
:color="randomLabelColor(labelIndex)"
|
||||
:bg-color="randomLabelColor(labelIndex)"
|
||||
plain
|
||||
custom-class="!rounded-4rpx"
|
||||
>{{ label.label_name }}</wd-tag>
|
||||
@ -55,6 +55,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { getStoreOrderDetails } from '@/api/store'
|
||||
import PriceFormat from '@/components/PriceFormat.vue'
|
||||
import { randomLabelColor } from '@/utils/tools'
|
||||
|
||||
const swiperList = ref<string[]>([])
|
||||
const html: string = '<p>这里是富文本内容,需要后台传递</p>'
|
||||
@ -63,9 +64,6 @@
|
||||
const roomId = ref<number>(0) // 门店ID
|
||||
const teaRoom = ref<any>({})
|
||||
|
||||
// 随机颜色列表
|
||||
const tagColors = ['#40AE36', '#F55726']
|
||||
|
||||
onLoad((args) => {
|
||||
roomId.value = Number(args.id)
|
||||
Detail.handleInitReserveRoom()
|
||||
@ -80,16 +78,6 @@
|
||||
console.log("🚀 ~ res:", res)
|
||||
teaRoom.value = res.details
|
||||
swiperList.value = teaRoom.value.img_arr
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据索引返回伪随机颜色
|
||||
* @param index 索引
|
||||
* @returns 颜色值
|
||||
*/
|
||||
handleRandomColor: (index: number) => {
|
||||
// 可根据index做伪随机,保证每次渲染一致
|
||||
return tagColors[index % tagColors.length]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user