Lou
2024-01-05 47909ab7f1991adb2d5c92ac00a8b0ea41764caa
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
import {
    minioBaseUrl
} from "./setting.js"
 
/**
 *  @description 设置图片回显路径 
 *  @param {String} str 路径
 *  @param {Number} type 回显类型    1普通回显   2上传回显
 */
export const setImageUrl = (str, type = 1) => {
    if (str) {
        let strArr = str.split(",")
        let urls = [];
        if (type == 1) {
            for (let i of strArr) {
                urls.push(`${minioBaseUrl}${i}`)
            }
        } else {
            for (let i of strArr) {
                urls.push({
                    name: i,
                    url: `${minioBaseUrl}${i}`
                })
            }
        }
        return urls;
    } else {
        return []
    }
}
export const showTips = (text, icon) => {
    uni.showToast({
        title: text,
        icon: icon ? icon : 'none'
    })
}