商城测试版v8_2

This commit is contained in:
2022-07-30 20:29:18 +08:00
parent 09e34ecabe
commit bcce0ce036
5 changed files with 69 additions and 68 deletions
+15 -6
View File
@@ -1,10 +1,19 @@
// export const BASE_URL = CURRENT_ENV.includes('development') ? `https://test.zzfzyc.com/lymarket` : `https://www.zzfzyc.com/lymarket`
function BASE_URL_LIST() {
return {
development: `https://test.zzfzyc.com/lymarket`,
production: `https://www.zzfzyc.com/lymarket`,
pre: `https://pre.zzfzyc.com/lymarket`,
}[process.env.NODE_ENV || 'production']
}
export const BASE_URL = BASE_URL_LIST()
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
// export const BASE_URL = `https://pre.zzfzyc.com/lymarket` // 预发布
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
@@ -20,12 +29,12 @@ export const GET_UPLOAD_SIGN = `/upyun/getsign` // 请求签名 url
export const UPLOAD_CDN_URL = `https://v0.api.upyun.com/`
// cdn
// export const IMG_CND_Prefix = CURRENT_ENV.includes('development')? "https://test.cdn.zzfzyc.com":"https://cdn.zzfzyc.com"
export const IMG_CND_Prefix = CURRENT_ENV.includes('development') ? 'https://test.cdn.zzfzyc.com' : 'https://test.cdn.zzfzyc.com'
export const IMG_CND_Prefix = CURRENT_ENV.includes('development') ? 'https://test.cdn.zzfzyc.com' : 'https://cdn.zzfzyc.com'
// export const IMG_CND_Prefix = CURRENT_ENV.includes('development') ? 'https://test.cdn.zzfzyc.com' : 'https://www.cdn.zzfzyc.com'
//在线支付图片baseUrl
// export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development')? "https://test.zzfzyc.com":"https://www.zzfzyc.com"
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development') ? 'https://test.zzfzyc.com' : 'https://test.zzfzyc.com'
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development') ? 'https://test.zzfzyc.com' : 'https://www.zzfzyc.com'
// export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development') ? 'https://test.zzfzyc.com' : 'https://www.zzfzyc.com'
// 上传图片视频
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
+42 -49
View File
@@ -1,60 +1,53 @@
import { Image, Swiper, SwiperItem, View } from "@tarojs/components"
import { goLink } from "@/common/common"
import {GetBannerList} from "@/api/banner"
import styles from './index.module.scss'
import { useEffect, useState } from "react"
import { formatImgUrl } from "@/common/fotmat"
import { Image, Swiper, SwiperItem, View } from '@tarojs/components'
import { goLink } from '@/common/common'
import { GetBannerList } from '@/api/banner'
import styles from './index.module.scss'
import { useEffect, useState } from 'react'
import { formatImgUrl } from '@/common/fotmat'
type item = {title:string, img:string, url:string, id:number}
type item = { title: string; img: string; url: string; id: number }
type params = {
list?: item[]
swiperOnClick?: (val: item) => void,
swiperOnClick?: (val: item) => void
style?: Object
}
export default (props:params) => {
let {swiperOnClick, style = {}} = props
export default (props: params) => {
let { swiperOnClick, style = {} } = props
const [list, setList] = useState<any[]>([])
const {fetchData, state} = GetBannerList()
const [list, setList] = useState<any[]>([])
const { fetchData, state } = GetBannerList()
useEffect(() => {
getData()
}, [])
useEffect(() => {
getData()
}, [])
const getData = async () => {
const res = await fetchData()
setList(res.data?.list)
const getData = async () => {
const res = await fetchData()
setList(res.data?.list)
}
const skipTo = (item) => {
if (item.jump_type == 2) {
goLink(item.link + '&title=' + item.title)
} else {
goLink(item.link)
}
}
const skipTo = (item) => {
if(item.jump_type == 2) {
goLink(item.link + '&title=' + item.title)
} else {
goLink(item.link)
}
}
return (
<View className={styles.swiper_con} style={style}>
<Swiper
className={styles.xswiper}
indicatorColor='#ccc'
indicatorActiveColor='#fff'
circular
indicatorDots
autoplay>
{
list?.map(item => {
return <SwiperItem key={item.id}>
<View className={styles.image_item} onClick={() => skipTo(item)}>
<Image mode="aspectFill" src={formatImgUrl(item.prev_view_url, '!w800')}></Image>
</View>
</SwiperItem>
})
}
</Swiper>
</View>
)
}
return (
<View className={styles.swiper_con} style={style}>
<Swiper className={styles.xswiper} indicatorColor='#ccc' indicatorActiveColor='#fff' circular indicatorDots autoplay>
{list?.map((item) => {
return (
<SwiperItem key={item.id}>
<View className={styles.image_item} onClick={() => skipTo(item)}>
<Image mode='aspectFill' src={formatImgUrl(item.prev_view_url, '!w800')}></Image>
</View>
</SwiperItem>
)
})}
</Swiper>
</View>
)
}