商城测试版v8_2
This commit is contained in:
parent
09e34ecabe
commit
bcce0ce036
@ -3,7 +3,6 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"pre"',
|
NODE_ENV: '"pre"',
|
||||||
},
|
},
|
||||||
outputRoot: 'pre_dis',
|
|
||||||
defineConstants: {},
|
defineConstants: {},
|
||||||
mini: {
|
mini: {
|
||||||
optimizeMainPackage: {
|
optimizeMainPackage: {
|
||||||
@ -32,16 +31,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
h5: {
|
h5: {},
|
||||||
/**
|
|
||||||
* 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
|
|
||||||
* 参考代码如下:
|
|
||||||
* webpackChain (chain) {
|
|
||||||
* chain.plugin('analyzer')
|
|
||||||
* .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
},
|
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, '..', 'src'),
|
'@': path.resolve(__dirname, '..', 'src'),
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
"dev:rn": "npm run build:rn -- --watch",
|
"dev:rn": "npm run build:rn -- --watch",
|
||||||
"dev:qq": "npm run build:qq -- --watch",
|
"dev:qq": "npm run build:qq -- --watch",
|
||||||
"dev:jd": "npm run build:jd -- --watch",
|
"dev:jd": "npm run build:jd -- --watch",
|
||||||
"dev:quickapp": "npm run build:quickapp -- --watch"
|
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||||
|
"build:weapp:pre": "cross-env NODE_ENV=pre taro build --type weapp"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 3 versions",
|
"last 3 versions",
|
||||||
@ -63,6 +64,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
||||||
"@typescript-eslint/parser": "^4.15.1",
|
"@typescript-eslint/parser": "^4.15.1",
|
||||||
"babel-preset-taro": "3.3.10",
|
"babel-preset-taro": "3.3.10",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-config-taro": "3.3.10",
|
"eslint-config-taro": "3.3.10",
|
||||||
"eslint-plugin-import": "^2.12.0",
|
"eslint-plugin-import": "^2.12.0",
|
||||||
|
@ -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.75:50001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.0.89: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://10.0.0.5:50001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.0.89:40001/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 = `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:40001/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.30:50001/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/`
|
export const UPLOAD_CDN_URL = `https://v0.api.upyun.com/`
|
||||||
|
|
||||||
// cdn
|
// 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://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://www.cdn.zzfzyc.com'
|
||||||
|
|
||||||
//在线支付图片baseUrl
|
//在线支付图片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://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 CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
||||||
|
@ -1,60 +1,53 @@
|
|||||||
import { Image, Swiper, SwiperItem, View } from "@tarojs/components"
|
import { Image, Swiper, SwiperItem, View } from '@tarojs/components'
|
||||||
import { goLink } from "@/common/common"
|
import { goLink } from '@/common/common'
|
||||||
import {GetBannerList} from "@/api/banner"
|
import { GetBannerList } from '@/api/banner'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from 'react'
|
||||||
import { formatImgUrl } from "@/common/fotmat"
|
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 = {
|
type params = {
|
||||||
list?: item[]
|
list?: item[]
|
||||||
swiperOnClick?: (val: item) => void,
|
swiperOnClick?: (val: item) => void
|
||||||
style?: Object
|
style?: Object
|
||||||
}
|
}
|
||||||
export default (props:params) => {
|
export default (props: params) => {
|
||||||
let {swiperOnClick, style = {}} = props
|
let { swiperOnClick, style = {} } = props
|
||||||
|
|
||||||
const [list, setList] = useState<any[]>([])
|
const [list, setList] = useState<any[]>([])
|
||||||
const {fetchData, state} = GetBannerList()
|
const { fetchData, state } = GetBannerList()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getData()
|
getData()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const res = await fetchData()
|
const res = await fetchData()
|
||||||
setList(res.data?.list)
|
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) => {
|
return (
|
||||||
if(item.jump_type == 2) {
|
<View className={styles.swiper_con} style={style}>
|
||||||
goLink(item.link + '&title=' + item.title)
|
<Swiper className={styles.xswiper} indicatorColor='#ccc' indicatorActiveColor='#fff' circular indicatorDots autoplay>
|
||||||
} else {
|
{list?.map((item) => {
|
||||||
goLink(item.link)
|
return (
|
||||||
}
|
<SwiperItem key={item.id}>
|
||||||
}
|
<View className={styles.image_item} onClick={() => skipTo(item)}>
|
||||||
|
<Image mode='aspectFill' src={formatImgUrl(item.prev_view_url, '!w800')}></Image>
|
||||||
return (
|
</View>
|
||||||
<View className={styles.swiper_con} style={style}>
|
</SwiperItem>
|
||||||
<Swiper
|
)
|
||||||
className={styles.xswiper}
|
})}
|
||||||
indicatorColor='#ccc'
|
</Swiper>
|
||||||
indicatorActiveColor='#fff'
|
</View>
|
||||||
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>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -4659,7 +4659,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
|
|||||||
safe-buffer "^5.0.1"
|
safe-buffer "^5.0.1"
|
||||||
sha.js "^2.4.8"
|
sha.js "^2.4.8"
|
||||||
|
|
||||||
cross-spawn@7.0.3, cross-spawn@^7.0.3:
|
cross-env@^7.0.3:
|
||||||
|
version "7.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
|
||||||
|
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
|
||||||
|
dependencies:
|
||||||
|
cross-spawn "^7.0.1"
|
||||||
|
|
||||||
|
cross-spawn@7.0.3, cross-spawn@^7.0.1, cross-spawn@^7.0.3:
|
||||||
version "7.0.3"
|
version "7.0.3"
|
||||||
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
|
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
|
||||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user