🐞 fix(ID1000708 首页购物车按钮问题):
This commit is contained in:
parent
812971f6b2
commit
24773447e9
@ -1,4 +1,4 @@
|
|||||||
export const BASE_URL = CURRENT_BASE_URL
|
// export const BASE_URL = CURRENT_BASE_URL
|
||||||
// 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`
|
||||||
@ -14,7 +14,7 @@ export const BASE_URL = CURRENT_BASE_URL
|
|||||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||||
// export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷
|
// export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷
|
||||||
// export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰
|
export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import { MovableArea, MovableView, View } from "@tarojs/components"
|
import { MovableArea, MovableView, View } from '@tarojs/components'
|
||||||
import Taro, { useReady } from "@tarojs/taro"
|
import Taro, { useReady } from '@tarojs/taro'
|
||||||
import { ReactElement, useEffect, useRef, useState } from "react"
|
import { ReactElement, useEffect, useLayoutEffect, useRef, useState } from 'react'
|
||||||
import classnames from "classnames";
|
import classnames from 'classnames'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { GetShoppingCartApi } from "@/api/shopCart";
|
import { GetShoppingCartApi } from '@/api/shopCart'
|
||||||
import useCommonData from "@/use/useCommonData";
|
import useCommonData from '@/use/useCommonData'
|
||||||
import { useSelector } from "@/reducers/hooks";
|
import { useSelector } from '@/reducers/hooks'
|
||||||
|
|
||||||
type param = {
|
type param = {
|
||||||
children?: ReactElement|null,
|
children?: ReactElement | null
|
||||||
onClick?: () => void
|
onClick?: () => void
|
||||||
}
|
}
|
||||||
export default ({ children = null, onClick }: param) => {
|
export default ({ children = null, onClick }: param) => {
|
||||||
@ -18,7 +18,7 @@ export default ({children = null, onClick}:param) => {
|
|||||||
const [screenHeight, setScreenHeight] = useState(0)
|
const [screenHeight, setScreenHeight] = useState(0)
|
||||||
const [showMoveBtn, setShowMoveBtn] = useState(false)
|
const [showMoveBtn, setShowMoveBtn] = useState(false)
|
||||||
const screenWidthRef = useRef(0)
|
const screenWidthRef = useRef(0)
|
||||||
useReady(() => {
|
useLayoutEffect(() => {
|
||||||
const res = Taro.getSystemInfoSync()
|
const res = Taro.getSystemInfoSync()
|
||||||
if (res.screenHeight) {
|
if (res.screenHeight) {
|
||||||
let ratio = 750 / res.screenWidth
|
let ratio = 750 / res.screenWidth
|
||||||
@ -32,17 +32,22 @@ export default ({children = null, onClick}:param) => {
|
|||||||
getShopCount()
|
getShopCount()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const dragEnd = (e) => {
|
const dragEnd = (e) => {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MovableArea className={styles.movableItem}>
|
<MovableArea className={styles.movableItem}>
|
||||||
{children}
|
{children}
|
||||||
{showMoveBtn&&<MovableView onClick={onClick} className={styles.moveBtn} direction="all" inertia={true} x="630rpx" y={screenHeight+'rpx'} onTouchEnd={(e) => dragEnd(e)}>
|
<MovableView
|
||||||
|
onClick={onClick}
|
||||||
|
className={styles.moveBtn}
|
||||||
|
direction='all'
|
||||||
|
inertia={true}
|
||||||
|
x='630rpx'
|
||||||
|
y={screenHeight + 'rpx'}
|
||||||
|
onTouchEnd={(e) => dragEnd(e)}>
|
||||||
<View className={classnames('iconfont', 'icon-gouwuche', styles.shop_icon)}></View>
|
<View className={classnames('iconfont', 'icon-gouwuche', styles.shop_icon)}></View>
|
||||||
{(commonData.shopCount > 0)&&<View className={styles.product_num}>{commonData.shopCount > 99?'99+':commonData.shopCount}</View>}
|
{commonData.shopCount > 0 && <View className={styles.product_num}>{commonData.shopCount > 99 ? '99+' : commonData.shopCount}</View>}
|
||||||
</MovableView>}
|
</MovableView>
|
||||||
</MovableArea>
|
</MovableArea>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -84,7 +84,6 @@
|
|||||||
width: 156.5px;
|
width: 156.5px;
|
||||||
height: 156.5px;
|
height: 156.5px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.item_con {
|
.item_con {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -99,6 +98,11 @@
|
|||||||
.num {
|
.num {
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
color: $color_main;
|
color: $color_main;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
.weight_error {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #666666;
|
||||||
}
|
}
|
||||||
.priceText {
|
.priceText {
|
||||||
font-size: $font_size_big;
|
font-size: $font_size_big;
|
||||||
@ -123,7 +127,7 @@
|
|||||||
.btn_count {
|
.btn_count {
|
||||||
width: 235px;
|
width: 235px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
background-color: #ECF5FF;
|
background-color: #ecf5ff;
|
||||||
border-radius: 40px 0px 16px 0px;
|
border-radius: 40px 0px 16px 0px;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import { GetColorList } from '@/api/materialColor'
|
|||||||
import { AddShoppingCartApi } from '@/api/shopCart'
|
import { AddShoppingCartApi } from '@/api/shopCart'
|
||||||
import Taro, { useRouter } from '@tarojs/taro'
|
import Taro, { useRouter } from '@tarojs/taro'
|
||||||
import UseLogin from '@/use/useLogin'
|
import UseLogin from '@/use/useLogin'
|
||||||
import { formatHashTag, formatPriceDiv } from '@/common/fotmat'
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from '@/common/fotmat'
|
||||||
import { getFilterData } from '@/common/util'
|
import { getFilterData } from '@/common/util'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
import VirtualList from '@tarojs/components/virtual-list'
|
import VirtualList from '@tarojs/components/virtual-list'
|
||||||
@ -228,6 +228,7 @@ export default memo(({ show = false, onClose, title = '', productId = 0 }: param
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.item_con}>
|
<View className={styles.item_con}>
|
||||||
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
|
<View className={styles.weight_error}>空差:{formatWeightDiv(item.weight_error)}kg</View>
|
||||||
<View className={styles.num}>{formatPrice(item)}</View>
|
<View className={styles.num}>{formatPrice(item)}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.btn_con}>
|
<View className={styles.btn_con}>
|
||||||
|
|||||||
@ -23,7 +23,8 @@
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.share, .collect {
|
.share,
|
||||||
|
.collect {
|
||||||
width: 76px;
|
width: 76px;
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -46,7 +47,7 @@
|
|||||||
font-size: 45px;
|
font-size: 45px;
|
||||||
}
|
}
|
||||||
.collected {
|
.collected {
|
||||||
color: #FFC300;
|
color: #ffc300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.des_data {
|
.des_data {
|
||||||
@ -81,7 +82,6 @@
|
|||||||
color: $color_font_one;
|
color: $color_font_one;
|
||||||
font-size: $font_size_medium;
|
font-size: $font_size_medium;
|
||||||
.title {
|
.title {
|
||||||
|
|
||||||
}
|
}
|
||||||
.list {
|
.list {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
@ -90,7 +90,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.item {
|
.item {
|
||||||
width: 210px;
|
width: 210px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 28px;
|
||||||
.item_color {
|
.item_color {
|
||||||
width: 210px;
|
width: 210px;
|
||||||
height: 210px;
|
height: 210px;
|
||||||
@ -104,6 +104,12 @@
|
|||||||
.item_name {
|
.item_name {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
|
.bulk_price {
|
||||||
|
color: #8a8a8a;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,7 +132,6 @@
|
|||||||
padding-bottom: constant(safe-area-inset-bottom);
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
|
||||||
|
|
||||||
.buy_cart {
|
.buy_cart {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
color: $color_font_three;
|
color: $color_font_three;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import OrderCount from './components/orderCount'
|
|||||||
import ShopCart from '@/components/shopCart'
|
import ShopCart from '@/components/shopCart'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { formatHashTag, formatImgUrl } from '@/common/fotmat'
|
import { formatHashTag, formatImgUrl, formatPriceDiv } from '@/common/fotmat'
|
||||||
import { GetProductDetailApi } from '@/api/material'
|
import { GetProductDetailApi } from '@/api/material'
|
||||||
import useLogin from '@/use/useLogin'
|
import useLogin from '@/use/useLogin'
|
||||||
import { AnalysisShortCodeApi, GetShortCodeApi } from '@/api/share'
|
import { AnalysisShortCodeApi, GetShortCodeApi } from '@/api/share'
|
||||||
@ -218,7 +218,8 @@ export default (props: Params) => {
|
|||||||
<View className={styles.item_color}>
|
<View className={styles.item_color}>
|
||||||
<LabAndImg value={{ lab: item.lab, rgb: item.rgb, texture_url: item.texture_url, title: item.code }} showStatus={true} />
|
<LabAndImg value={{ lab: item.lab, rgb: item.rgb, texture_url: item.texture_url, title: item.code }} showStatus={true} />
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.item_name}>{item.code}</View>
|
<View className={styles.item_name}>{formatHashTag(item.code, item.name)}</View>
|
||||||
|
<View className={styles.bulk_price}>{formatPriceDiv(item.bulk_price)}/Kg</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@ -341,7 +341,16 @@ const Main = memo(() => {
|
|||||||
<View className={styles['card-main-list-content-item-right']}>
|
<View className={styles['card-main-list-content-item-right']}>
|
||||||
<Text className='iconfont icon-a-moreback'></Text>
|
<Text className='iconfont icon-a-moreback'></Text>
|
||||||
</View>
|
</View>
|
||||||
{item.type === 'customer' && <Button openType='contact' className={styles.customer}></Button>}
|
{item.type === 'customer' && (
|
||||||
|
<Button
|
||||||
|
openType='contact'
|
||||||
|
// sendMessageTitle='有个靓仔要询货:0770# 21S全棉平纹'
|
||||||
|
// showMessageCard={true}
|
||||||
|
// sendMessageImg='https://test.cdn.zzfzyc.com/mall/no_img.png'
|
||||||
|
// sendMessagePath='/pages/details/index?id=21'
|
||||||
|
// onContact={(e) => console.log('ee:::', e)}
|
||||||
|
className={styles.customer}></Button>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user