Compare commits
No commits in common. "bf9a9fb6e315751f71d941084bd516a5c75a70e2" and "a2474dddc0d43aeaedf0d2956171f10f8e87dd87" have entirely different histories.
bf9a9fb6e3
...
a2474dddc0
|
|
@ -2,10 +2,7 @@ import React, { Component } from 'react'
|
||||||
import Taro, { getCurrentInstance } from '@tarojs/taro'
|
import Taro, { getCurrentInstance } from '@tarojs/taro'
|
||||||
import { View, Text, Image } from '@tarojs/components'
|
import { View, Text, Image } from '@tarojs/components'
|
||||||
import { AtRate } from 'taro-ui'
|
import { AtRate } from 'taro-ui'
|
||||||
import {
|
import userIcon from '@/assets/imgs/user-icon.png'
|
||||||
SpImage
|
|
||||||
} from '@/components'
|
|
||||||
// import userIcon from '@/assets/imgs/user-icon.png'
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
export default class GoodsEvaluation extends Component {
|
export default class GoodsEvaluation extends Component {
|
||||||
|
|
@ -99,13 +96,12 @@ export default class GoodsEvaluation extends Component {
|
||||||
return (
|
return (
|
||||||
<View className='evaluation-item' onClick={this.handleSelectEvaluation.bind(this)} isBlack>
|
<View className='evaluation-item' onClick={this.handleSelectEvaluation.bind(this)} isBlack>
|
||||||
<View className='evaluation-item__avator'>
|
<View className='evaluation-item__avator'>
|
||||||
{/* <Image
|
<Image
|
||||||
src={info.anonymous ? userIcon : info.avatar}
|
src={info.anonymous ? userIcon : info.avatar}
|
||||||
mode='aspectFill'
|
mode='aspectFill'
|
||||||
className='avatar'
|
className='avatar'
|
||||||
fadeIn
|
fadeIn
|
||||||
/> */}
|
/>
|
||||||
<SpImage className='avatar' src={'cart/niming.jpg'} width={80} height={80} isNew />
|
|
||||||
</View>
|
</View>
|
||||||
<View className='evaluation-item__main'>
|
<View className='evaluation-item__main'>
|
||||||
<View className='name-wrap'>
|
<View className='name-wrap'>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ const voidFunc = () => { }
|
||||||
const SpButton = (props) => {
|
const SpButton = (props) => {
|
||||||
const {
|
const {
|
||||||
resetText = '取消',
|
resetText = '取消',
|
||||||
showReset = true,
|
|
||||||
confirmText = '确定',
|
confirmText = '确定',
|
||||||
onConfirm = voidFunc,
|
onConfirm = voidFunc,
|
||||||
onReset = voidFunc
|
onReset = voidFunc
|
||||||
|
|
@ -16,9 +15,9 @@ const SpButton = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='sp-button'>
|
<View className='sp-button'>
|
||||||
{showReset && <View className='sp-button__reset' onClick={onReset}>
|
<View className='sp-button__reset' onClick={onReset}>
|
||||||
{resetText}
|
{resetText}
|
||||||
</View>}
|
</View>
|
||||||
<View className='sp-button__confirm' onClick={onConfirm}>
|
<View className='sp-button__confirm' onClick={onConfirm}>
|
||||||
{confirmText}
|
{confirmText}
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ function SpCoupon (props) {
|
||||||
status,
|
status,
|
||||||
valid,
|
valid,
|
||||||
} = info
|
} = info
|
||||||
|
console.log("🚀 ~ info:", info)
|
||||||
|
|
||||||
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
||||||
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,6 @@ function SpGoodsCell (props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('isNaN(memberPrice):', info.orderItemType)
|
// console.log('isNaN(memberPrice):', info.orderItemType)
|
||||||
const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className='sp-goods-cell'>
|
<View className='sp-goods-cell'>
|
||||||
|
|
@ -130,7 +129,7 @@ function SpGoodsCell (props) {
|
||||||
</View>}
|
</View>}
|
||||||
<View className='item-ft'>
|
<View className='item-ft'>
|
||||||
|
|
||||||
{info.num && <Text className='item-num'>数量:{info.num} {max <= 5 && <Text style={{ marginLeft: '10px' }}>(库存紧张)</Text>}</Text>}
|
{info.num && <Text className='item-num'>数量:{info.num}</Text>}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ function SpPage (props, ref) {
|
||||||
showNavkfIcon = false,
|
showNavkfIcon = false,
|
||||||
showNavHomeIcon = false,
|
showNavHomeIcon = false,
|
||||||
showNavSearchIcon = false,
|
showNavSearchIcon = false,
|
||||||
showLogoLoading = false,
|
|
||||||
} = props
|
} = props
|
||||||
let { renderTitle } = props
|
let { renderTitle } = props
|
||||||
const wrapRef = useRef(null)
|
const wrapRef = useRef(null)
|
||||||
|
|
@ -372,10 +371,6 @@ function SpPage (props, ref) {
|
||||||
{/* {loading && <SpNote img='loading.gif' />} */}
|
{/* {loading && <SpNote img='loading.gif' />} */}
|
||||||
{loading && <SpLoading />}
|
{loading && <SpLoading />}
|
||||||
|
|
||||||
{showLogoLoading && <View className='loading-box'>
|
|
||||||
<SpImage height={244} width={244} src='logo-load.jpg' isNew />
|
|
||||||
</View>}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{!isDefault && !loading && <View className='sp-page-body' style={styleNames({
|
{!isDefault && !loading && <View className='sp-page-body' style={styleNames({
|
||||||
|
|
|
||||||
|
|
@ -212,33 +212,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.loading-box {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 1100;
|
|
||||||
background: rgba(255, 255, 255, 0.6);
|
|
||||||
animation: fadeInAnimation 0.3s ease-in;
|
|
||||||
.sp-image {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 300px;
|
|
||||||
height: 300px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes fadeInAnimation {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ const initialState = {
|
||||||
isClickNum: false,
|
isClickNum: false,
|
||||||
isClickPattern: false,
|
isClickPattern: false,
|
||||||
showClickPattern: false,
|
showClickPattern: false,
|
||||||
skuTxtArr: [],
|
skuTxtArr: []
|
||||||
selSkuList: [],
|
|
||||||
isNotStore: false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SpSkuSelect (props, ref) {
|
function SpSkuSelect (props, ref) {
|
||||||
|
|
@ -49,10 +47,9 @@ function SpSkuSelect (props, ref) {
|
||||||
// console.log('SpSkuSelect:info', info)
|
// console.log('SpSkuSelect:info', info)
|
||||||
// const [state, setState] = useImmer(initialState)
|
// const [state, setState] = useImmer(initialState)
|
||||||
const [state, setState] = useAsyncCallback(initialState)
|
const [state, setState] = useAsyncCallback(initialState)
|
||||||
const { selection, curImage, disabledSet, curItem, skuText, num, loading, isClickSku, showClickPattern, skuTxtArr, isClickPattern, selSkuList, isNotStore } = state
|
const { selection, curImage, disabledSet, curItem, skuText, num, loading, isClickSku, showClickPattern, skuTxtArr } = state
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const skuDictRef = useRef({})
|
const skuDictRef = useRef({})
|
||||||
const selKey = selSkuList[0] + '_' + selSkuList[1]
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (info && !info.nospec) {
|
if (info && !info.nospec) {
|
||||||
|
|
@ -85,9 +82,6 @@ function SpSkuSelect (props, ref) {
|
||||||
}
|
}
|
||||||
|
|
||||||
calcDisabled(selection, -1)
|
calcDisabled(selection, -1)
|
||||||
setState((draft) => {
|
|
||||||
draft.selSkuList[0] = selection[0]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const calcDisabled = (selection, e = 0) => {
|
const calcDisabled = (selection, e = 0) => {
|
||||||
|
|
@ -162,50 +156,37 @@ function SpSkuSelect (props, ref) {
|
||||||
|
|
||||||
// console.log('disabledSet:', disabledSet)
|
// console.log('disabledSet:', disabledSet)
|
||||||
|
|
||||||
const handleSelectSku = async (spec, idx) => {
|
const handleSelectSku = (spec, idx) => {
|
||||||
if (!isClickPattern && idx === 2) {
|
|
||||||
return showToast('请先选择版型')
|
|
||||||
}
|
|
||||||
const { specId } = spec
|
const { specId } = spec
|
||||||
const _selection = [...selection]
|
const _selection = [...selection]
|
||||||
|
|
||||||
_selection[idx] = specId
|
_selection[idx] = specId
|
||||||
const key = _selection.join('_')
|
const key = _selection.join('_')
|
||||||
const row = skuDictRef.current[key] || {}
|
const row = skuDictRef.current[key] || {}
|
||||||
// if (row?.store <= 0 && isClickPattern) {
|
if (row?.store <= 0) {
|
||||||
// if (disabledSet.has(specId) && idx !== 2) return
|
if (disabledSet.has(specId) && idx !== 2) return
|
||||||
// setState((draft) => {
|
setState((draft) => {
|
||||||
// draft.selection[idx] = specId //null
|
draft.selection[idx] = specId //null
|
||||||
// draft.curImage = 1
|
draft.curImage = 1
|
||||||
// })
|
|
||||||
// return showToast('该规格库存为空')
|
|
||||||
// }
|
|
||||||
if (!isClickPattern) {
|
|
||||||
await setState((draft) => {
|
|
||||||
draft.isClickPattern = idx === 1
|
|
||||||
})
|
})
|
||||||
|
return showToast('该规格库存为空')
|
||||||
}
|
}
|
||||||
if (!state.isClickNum) {
|
if (!state.isClickNum) {
|
||||||
await setState((draft) => {
|
setState((draft) => {
|
||||||
draft.isClickNum = idx === 2
|
draft.isClickNum = idx === 2
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const _selKey = _selection.slice(0, 2).join('_')
|
if (!state.isClickPattern) {
|
||||||
const isNotStore = ((idx === 0 && isClickPattern) || idx === 1) && Object.keys(skuDictRef.current).every((key) => {
|
setState((draft) => {
|
||||||
if (key.indexOf(_selKey) === 0) {
|
draft.isClickPattern = idx === 1
|
||||||
return skuDictRef.current[key].store <= 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
await setState(
|
}
|
||||||
|
setState(
|
||||||
(draft) => {
|
(draft) => {
|
||||||
draft.selection[idx] = specId //null
|
draft.selection[idx] = specId //null
|
||||||
draft.selSkuList[idx] = specId
|
|
||||||
draft.curImage = 1
|
draft.curImage = 1
|
||||||
draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2
|
draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2
|
||||||
draft.showClickPattern = draft.isClickPattern ? row.store > 0 : idx === 1
|
draft.showClickPattern = draft.isClickPattern ? row.store > 0 : idx === 1
|
||||||
draft.isNotStore = isNotStore
|
|
||||||
},
|
},
|
||||||
(row) => {
|
(row) => {
|
||||||
calcDisabled(row.selection, idx)
|
calcDisabled(row.selection, idx)
|
||||||
|
|
@ -447,7 +428,7 @@ function SpSkuSelect (props, ref) {
|
||||||
<View
|
<View
|
||||||
className={classNames('sku-btn', {
|
className={classNames('sku-btn', {
|
||||||
'active': spec.specId == selection[index],
|
'active': spec.specId == selection[index],
|
||||||
'disabled': isClickSku && disabledSet.has(spec.specId),
|
'disabled': disabledSet.has(spec.specId),
|
||||||
})}
|
})}
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
key={`sku-values-item__${idx}`}
|
key={`sku-values-item__${idx}`}
|
||||||
|
|
@ -457,38 +438,21 @@ function SpSkuSelect (props, ref) {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</ScrollView>}
|
</ScrollView>}
|
||||||
{/* {index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
{index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
||||||
<>
|
<>
|
||||||
{index === 2 && (showClickPattern && disabledSet.has(spec.specId)) ? null : <View
|
{index === 2 && (showClickPattern && disabledSet.has(spec.specId)) ? null : <View
|
||||||
className={classNames('sku-btn btn-noac', {
|
className={classNames('sku-btn btn-noac', {
|
||||||
'active': spec.specId == selection[index],
|
'active': spec.specId == selection[index],
|
||||||
'btn-primary': index !== 2 ? index === 1 ? spec.specId == selection[index] && showClickPattern : spec.specId == selection[index] : spec.specId == selection[index] && isClickSku,
|
'btn-primary': index !== 2 ? index === 1 ? spec.specId == selection[index] && showClickPattern : spec.specId == selection[index] : spec.specId == selection[index] && isClickSku,
|
||||||
'disabled': isClickPattern && index === 1 && disabledSet.has(spec.specId),
|
'disabled': index === 1 && disabledSet.has(spec.specId),
|
||||||
'sku-img': spec.specImgs.length > 0
|
|
||||||
})}
|
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
|
||||||
key={`sku-values-item__${idx}`}
|
|
||||||
>
|
|
||||||
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
|
||||||
</View>}
|
|
||||||
</>
|
|
||||||
)) : <View className="spec-name">暂无库存</View>)} */}
|
|
||||||
{/*
|
|
||||||
上面是备份下面为修改,2024-03-05 !!!
|
|
||||||
窄版只显示35-39 库存0置灰。常规版显示所有 库存0不显示。
|
|
||||||
*/}
|
|
||||||
{index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
|
||||||
// index === 2 && isNotStore ? null :
|
|
||||||
<>
|
|
||||||
{(index === 1 || !isClickPattern || (selSkuList[1] === '5' && spec.specName < 40) || (selSkuList[1] === '6' && skuDictRef.current[selKey + '_' + spec.specId]?.store > 0)) && <View
|
|
||||||
className={classNames('sku-btn btn-noac', {
|
|
||||||
'btn-primary': spec.specId === selSkuList[index],
|
|
||||||
'disabled': selSkuList[1] === 5 && skuDictRef.current[selKey + '_' + spec.specId]?.store <= 0,
|
|
||||||
'sku-img': spec.specImgs.length > 0
|
'sku-img': spec.specImgs.length > 0
|
||||||
})}
|
})}
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
key={`sku-values-item__${idx}`}
|
key={`sku-values-item__${idx}`}
|
||||||
>
|
>
|
||||||
|
{/* {spec.specImgs.length > 0 && (
|
||||||
|
<SpImage src={spec.specImgs[0]} width={260} height={260} />
|
||||||
|
)} */}
|
||||||
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
||||||
</View>}
|
</View>}
|
||||||
</>
|
</>
|
||||||
|
|
@ -496,7 +460,6 @@ function SpSkuSelect (props, ref) {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
{isNotStore && <View style={{ padding: '10rpx 0' }}>暂无库存</View>}
|
|
||||||
{/* {!hideInputNumber && renderLimitTip()} */}
|
{/* {!hideInputNumber && renderLimitTip()} */}
|
||||||
<View className="select">
|
<View className="select">
|
||||||
{/* {skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)} */}
|
{/* {skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)} */}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ export const CHECKOUT_GOODS_ITEM = {
|
||||||
origincountry_name: 'origincountry_name',
|
origincountry_name: 'origincountry_name',
|
||||||
point: 'point',
|
point: 'point',
|
||||||
isPoint: 'is_point',
|
isPoint: 'is_point',
|
||||||
store: 'store',
|
|
||||||
item_point: 'item_point',
|
item_point: 'item_point',
|
||||||
price: ({ price }) => price / 100, // 销售价
|
price: ({ price }) => price / 100, // 销售价
|
||||||
activityPrice: ({ activity_price }) => activity_price / 100, // 秒杀价
|
activityPrice: ({ activity_price }) => activity_price / 100, // 秒杀价
|
||||||
|
|
|
||||||
|
|
@ -257,15 +257,12 @@ export default class TradeRate extends Component {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='submit-btn'>
|
<View className='submit-btn'>
|
||||||
<View className='submit-btn__confirm' onClick={this.handleClickSubmit.bind(this, true)}>
|
<SpButton
|
||||||
立即评价
|
|
||||||
</View>
|
|
||||||
{/* <SpButton
|
|
||||||
resetText='匿名评价'
|
resetText='匿名评价'
|
||||||
confirmText='立即评价'
|
confirmText='立即评价'
|
||||||
onConfirm={this.handleClickSubmit.bind(this, false)}
|
onConfirm={this.handleClickSubmit.bind(this, false)}
|
||||||
onReset={this.handleClickSubmit.bind(this, true)}
|
onReset={this.handleClickSubmit.bind(this, true)}
|
||||||
></SpButton> */}
|
></SpButton>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</SpPage>
|
</SpPage>
|
||||||
|
|
|
||||||
|
|
@ -105,25 +105,9 @@ page {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 40px;
|
||||||
padding-bottom: 50px;
|
|
||||||
z-index: 88;
|
z-index: 88;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
&__confirm {
|
|
||||||
// width: 58%;
|
|
||||||
width: 90%;
|
|
||||||
margin: 0 auto;
|
|
||||||
/* prettier-ignore */
|
|
||||||
border: 1PX solid var(--color-primary);
|
|
||||||
background: var(--color-primary);
|
|
||||||
height: 80px;
|
|
||||||
border-radius: 6px;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 80px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,7 @@ function CompGoodsItem (props) {
|
||||||
onDelete = () => { },
|
onDelete = () => { },
|
||||||
onChange = () => { },
|
onChange = () => { },
|
||||||
onClickImgAndTitle = () => { },
|
onClickImgAndTitle = () => { },
|
||||||
onChangeGoodsIsCheck = () => { },
|
onChangeGoodsIsCheck = () => { }
|
||||||
showWarning = false
|
|
||||||
} = props
|
} = props
|
||||||
const { priceSetting } = useSelector((state) => state.sys)
|
const { priceSetting } = useSelector((state) => state.sys)
|
||||||
const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user)
|
const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user)
|
||||||
|
|
@ -69,7 +68,7 @@ function CompGoodsItem (props) {
|
||||||
limitTxt = `每${info?.limitedBuy?.rule.day}天,限购${limitNum}件`
|
limitTxt = `每${info?.limitedBuy?.rule.day}天,限购${limitNum}件`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
{children}
|
{children}
|
||||||
|
|
@ -126,14 +125,13 @@ function CompGoodsItem (props) {
|
||||||
{isShowAddInput ? (
|
{isShowAddInput ? (
|
||||||
<SpInputNumber
|
<SpInputNumber
|
||||||
value={localNum}
|
value={localNum}
|
||||||
max={max}
|
max={parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)}
|
||||||
min={1}
|
min={1}
|
||||||
onChange={onChangeInputNumber}
|
onChange={onChangeInputNumber}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Text className='item-num'>x {info.num}</Text>
|
<Text className='item-num'>x {info.num}</Text>
|
||||||
)}
|
)}
|
||||||
{showWarning && max <= 5 && <Text style={{ marginLeft: '10px' }}>(库存紧张)</Text>}
|
|
||||||
</View>
|
</View>
|
||||||
<SpPrice value={_price / 100} noDecimal={false} size={20} showSeparator />
|
<SpPrice value={_price / 100} noDecimal={false} size={20} showSeparator />
|
||||||
{info.market_price > 0 && enMarketPrice && (
|
{info.market_price > 0 && enMarketPrice && (
|
||||||
|
|
|
||||||
|
|
@ -880,7 +880,7 @@ function CartCheckout (props) {
|
||||||
<View className='goods-list'>
|
<View className='goods-list'>
|
||||||
{detailInfo.map((item, idx) => (
|
{detailInfo.map((item, idx) => (
|
||||||
<View className='sp-order-item__wrap' key={idx}>
|
<View className='sp-order-item__wrap' key={idx}>
|
||||||
<SpGoodsCell info={item} showWarning />
|
<SpGoodsCell info={item} />
|
||||||
{/* <SpOrderItem
|
{/* <SpOrderItem
|
||||||
key={`${idx}1`}
|
key={`${idx}1`}
|
||||||
info={item}
|
info={item}
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,7 @@ import './espier-index.scss'
|
||||||
const initialState = {
|
const initialState = {
|
||||||
recommendList: [], // 猜你喜欢
|
recommendList: [], // 猜你喜欢
|
||||||
current: 0, // 0:普通商品 1:跨境商品
|
current: 0, // 0:普通商品 1:跨境商品
|
||||||
policyModal: false, // 隐私弹框
|
policyModal: false // 隐私弹框
|
||||||
loading: false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function CartIndex () {
|
function CartIndex () {
|
||||||
|
|
@ -52,7 +51,7 @@ function CartIndex () {
|
||||||
const router = $instance.router
|
const router = $instance.router
|
||||||
|
|
||||||
const [state, setState] = useImmer(initialState)
|
const [state, setState] = useImmer(initialState)
|
||||||
const { current, recommendList, policyModal, loading } = state
|
const { current, recommendList, policyModal } = state
|
||||||
|
|
||||||
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
||||||
const { validCart = [], invalidCart = [], cartCount } = useSelector((state) => state.cart)
|
const { validCart = [], invalidCart = [], cartCount } = useSelector((state) => state.cart)
|
||||||
|
|
@ -67,6 +66,7 @@ function CartIndex () {
|
||||||
}, [isLogin])
|
}, [isLogin])
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
|
console.log('useDidShow', isLogin)
|
||||||
if (isLogin) fetch()
|
if (isLogin) fetch()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -80,20 +80,14 @@ function CartIndex () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCartList = async () => {
|
const getCartList = async () => {
|
||||||
// Taro.showLoading({ title: '', })
|
Taro.showLoading({ title: '' })
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = true
|
|
||||||
})
|
|
||||||
const { type = 'distributor' } = router?.params || {}
|
const { type = 'distributor' } = router?.params || {}
|
||||||
const params = {
|
const params = {
|
||||||
shop_type: type
|
shop_type: type
|
||||||
}
|
}
|
||||||
await dispatch(fetchCartList(params))
|
await dispatch(fetchCartList(params))
|
||||||
await dispatch(updateCount(params))
|
await dispatch(updateCount(params))
|
||||||
|
Taro.hideLoading()
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolveActiveGroup = () => {
|
const resolveActiveGroup = () => {
|
||||||
|
|
@ -172,6 +166,7 @@ function CartIndex () {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 1000
|
pageSize: 1000
|
||||||
})
|
})
|
||||||
|
console.log("🚀 ~ list:----169", list)
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.recommendList = list
|
draft.recommendList = list
|
||||||
})
|
})
|
||||||
|
|
@ -188,10 +183,7 @@ function CartIndex () {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
||||||
// Taro.showLoading({ title: '' })
|
Taro.showLoading({ title: '' })
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = true
|
|
||||||
})
|
|
||||||
let parmas = { is_checked: checked }
|
let parmas = { is_checked: checked }
|
||||||
if (type === 'all') {
|
if (type === 'all') {
|
||||||
const cartIds = item.list.map((item) => item.cart_id)
|
const cartIds = item.list.map((item) => item.cart_id)
|
||||||
|
|
@ -224,9 +216,6 @@ function CartIndex () {
|
||||||
|
|
||||||
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
||||||
console.log(`onChangeCartGoodsItem:`, num)
|
console.log(`onChangeCartGoodsItem:`, num)
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = true
|
|
||||||
})
|
|
||||||
let { shop_id, cart_id } = item
|
let { shop_id, cart_id } = item
|
||||||
const { type = 'distributor' } = router.params
|
const { type = 'distributor' } = router.params
|
||||||
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
||||||
|
|
@ -282,7 +271,6 @@ function CartIndex () {
|
||||||
'has-tabbar': tabbar == 1
|
'has-tabbar': tabbar == 1
|
||||||
})}
|
})}
|
||||||
renderFooter={tabbar == 1 && <SpTabbar />}
|
renderFooter={tabbar == 1 && <SpTabbar />}
|
||||||
showLogoLoading={loading}
|
|
||||||
showNavLogo isBlack showNavkfIcon
|
showNavLogo isBlack showNavkfIcon
|
||||||
>
|
>
|
||||||
{/* {!isLogin && (
|
{/* {!isLogin && (
|
||||||
|
|
@ -365,7 +353,6 @@ function CartIndex () {
|
||||||
onChange={onChangeCartGoodsItem.bind(this, c_sitem)}
|
onChange={onChangeCartGoodsItem.bind(this, c_sitem)}
|
||||||
onChangeGoodsIsCheck={onChangeGoodsIsCheck.bind(this, c_sitem, 'single', !c_sitem.is_checked)}
|
onChangeGoodsIsCheck={onChangeGoodsIsCheck.bind(this, c_sitem, 'single', !c_sitem.is_checked)}
|
||||||
onClickImgAndTitle={onClickImgAndTitle.bind(this, c_sitem)}
|
onClickImgAndTitle={onClickImgAndTitle.bind(this, c_sitem)}
|
||||||
showWarning
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{/**组合商品开始 */}
|
{/**组合商品开始 */}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
padding: 26px 40px 26px 60px;
|
padding: 26px 40px 26px 60px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: calc(#{$page-ipx-footer-height} - 2px);
|
bottom: calc(#{$page-ipx-footer-height} - 2px);
|
||||||
z-index: 100;
|
z-index: 1080;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
border-top: 1px solid #d9d9d9;
|
border-top: 1px solid #d9d9d9;
|
||||||
|
|
|
||||||
|
|
@ -76,31 +76,6 @@ page {
|
||||||
// &.swiper-narrow {
|
// &.swiper-narrow {
|
||||||
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
// }
|
// }
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.item-img-box {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0%);
|
|
||||||
bottom: 0px;
|
|
||||||
z-index: 99;
|
|
||||||
animation: fadeInAnimation 0.35s ease-in;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
.item-img-txt {
|
|
||||||
font-size: 26px;
|
|
||||||
color: #fff;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 74rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.item-img {
|
|
||||||
width: 190px;
|
|
||||||
height: 120px;
|
|
||||||
object-fit: contain;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
}
|
||||||
.swiper-narrow {
|
.swiper-narrow {
|
||||||
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
|
|
@ -144,11 +119,10 @@ page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.spot-pagination {
|
.spot-pagination {
|
||||||
animation: fadeInAnimation 0.35s ease-in;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
bottom: 10%;
|
bottom: 6%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
|
||||||
|
|
@ -507,10 +507,6 @@ function Home () {
|
||||||
</SwiperItem>
|
</SwiperItem>
|
||||||
))}
|
))}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
{!isUpOperation && <View className="item-img-box">
|
|
||||||
<View className="item-img-txt">滑 动 探 索</View>
|
|
||||||
<Image className="item-img" height="62" src={require('../assets/i-sou.gif')} isShowMenuByLongpress={false} lazyLoad isNew={false} />
|
|
||||||
</View>}
|
|
||||||
{!isUpOperation && <View className='spot-pagination'>
|
{!isUpOperation && <View className='spot-pagination'>
|
||||||
{swiperList.map((_, index) => (
|
{swiperList.map((_, index) => (
|
||||||
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ function CompEvaluation (props) {
|
||||||
</View> */}
|
</View> */}
|
||||||
<View className='evaluation-bd'>
|
<View className='evaluation-bd'>
|
||||||
{list.map((item) => (
|
{list.map((item) => (
|
||||||
<View className='evaluation-item-wrap'>
|
<View className='evaluation-item-wrap' onClick={onViewMore}>
|
||||||
<View className='item-hd'>
|
<View className='item-hd'>
|
||||||
<SpImage src={'cart/niming.jpg'} className='evaluation-icon' width={50} height={50} isNew />
|
<SpImage src={item.avatar} className='evaluation-icon' width={50} height={50} />
|
||||||
<Text className='evaluation-name'>{'匿名用户' || item.username}
|
<Text className='evaluation-name'>{'匿名用户' || item.username}
|
||||||
<Text style={{ marginLeft: '10rpx' }}>{fortmatStr(item.item_spec_desc)}</Text>
|
<Text style={{ marginLeft: '10rpx' }}>{fortmatStr(item.item_spec_desc)}</Text>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
@ -64,9 +64,7 @@ function CompEvaluation (props) {
|
||||||
<View className="evaluation-content-line"></View>
|
<View className="evaluation-content-line"></View>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
{list.length == 0 ? <View className='default-msg'>暂无商品评价</View>
|
{list.length == 0 && <View className='default-msg'>暂无商品评价</View>}
|
||||||
: <View className="click-all" onClick={onViewMore}>查看全部 <Text className='iconfont icon-qianwang-01'></Text></View>
|
|
||||||
}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -28,17 +28,6 @@
|
||||||
// margin-bottom: 20px;
|
// margin-bottom: 20px;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
.click-all {
|
|
||||||
text-align: center;
|
|
||||||
color: var(--color-primary);
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
padding: 6px 20px 0 20px;
|
|
||||||
.icon-qianwang-01 {
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.evaluation-icon {
|
.evaluation-icon {
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
|
|
@ -55,12 +44,12 @@
|
||||||
.item-hd {
|
.item-hd {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-bottom: -2px;
|
margin-bottom: -8px;
|
||||||
}
|
}
|
||||||
.evaluation-content {
|
.evaluation-content {
|
||||||
// padding-left: 50px;
|
// padding-left: 50px;
|
||||||
// padding-right: 16px;
|
// padding-right: 16px;
|
||||||
margin: 0 16px 0 60px;
|
margin: 0 16px 0 50px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
// padding-bottom: 28px;
|
// padding-bottom: 28px;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {
|
||||||
SpPage,
|
SpPage,
|
||||||
SpScrollView,
|
SpScrollView,
|
||||||
SpDrawer,
|
SpDrawer,
|
||||||
SpNote
|
SpSelect
|
||||||
} from '@/components'
|
} from '@/components'
|
||||||
import { fetchUserFavs } from '@/store/slices/user'
|
import { fetchUserFavs } from '@/store/slices/user'
|
||||||
import doc from '@/doc'
|
import doc from '@/doc'
|
||||||
|
|
@ -330,12 +330,6 @@ function ItemList () {
|
||||||
url
|
url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderEmpty = () => {
|
|
||||||
return (<SpNote className='sp-note-1' isUrl img={`${process.env.APP_IMAGE_CDN_NEW}/cart/logo-hui.png`} height={144} width={144}>
|
|
||||||
抱歉 没有搜索到结果
|
|
||||||
</SpNote>)
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<SpPage
|
<SpPage
|
||||||
scrollToTopBtn
|
scrollToTopBtn
|
||||||
|
|
@ -376,7 +370,7 @@ function ItemList () {
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View className='item-list-head'>
|
<View className='item-list-head'>
|
||||||
{false && tagList.length > 0 && (
|
{tagList.length > 0 && (
|
||||||
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag}>
|
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag}>
|
||||||
{/* <View
|
{/* <View
|
||||||
className="filter-btn"
|
className="filter-btn"
|
||||||
|
|
@ -396,7 +390,7 @@ function ItemList () {
|
||||||
onChange={handleFilterChange}
|
onChange={handleFilterChange}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<SpScrollView className='item-list-scroll' auto={false} ref={goodsRef} fetch={fetch} renderEmpty={renderEmpty()}>
|
<SpScrollView className='item-list-scroll' auto={false} ref={goodsRef} fetch={fetch}>
|
||||||
<View className='goods-list'>
|
<View className='goods-list'>
|
||||||
<View className='left-container'>
|
<View className='left-container'>
|
||||||
{leftList.map((list, idx) => {
|
{leftList.map((list, idx) => {
|
||||||
|
|
|
||||||
|
|
@ -71,19 +71,8 @@
|
||||||
// /* #ifdef h5 */
|
// /* #ifdef h5 */
|
||||||
// @include page-scroll($searchbar-height + $navigate-height + 16 * 2 + $tabs-height + 10, 0);
|
// @include page-scroll($searchbar-height + $navigate-height + 16 * 2 + $tabs-height + 10, 0);
|
||||||
// /* #endif */
|
// /* #endif */
|
||||||
// .sp-note {
|
.sp-note {
|
||||||
// margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
// }
|
|
||||||
.sp-note-1 {
|
|
||||||
.sp-image {
|
|
||||||
margin-top: 300px;
|
|
||||||
}
|
|
||||||
> .sp-note__text {
|
|
||||||
margin-top: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 40px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.filter-btn {
|
.filter-btn {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ export default class ItemFav extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onShareTimeline (res) {
|
onShareTimeline (res) {
|
||||||
|
console.log("🚀 ~ ItemFav ~ res:", res)
|
||||||
return this.getAppShareInfo()
|
return this.getAppShareInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,9 +358,7 @@ export default class ItemFav extends Component {
|
||||||
{/* {page.isLoading ? <Loading>正在加载...</Loading> : null} */}
|
{/* {page.isLoading ? <Loading>正在加载...</Loading> : null} */}
|
||||||
{/* !page.isLoading && */}
|
{/* !page.isLoading && */}
|
||||||
{!page.hasNext && !list.length && (
|
{!page.hasNext && !list.length && (
|
||||||
<SpNote isUrl img={`${process.env.APP_IMAGE_CDN_NEW}/cart/logo-hui.png`} height={144} width={144}>
|
<SpNote img='trades_empty.png'>暂无数据~</SpNote>
|
||||||
暂无收藏商品
|
|
||||||
</SpNote>
|
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,17 +84,6 @@
|
||||||
/* #ifdef h5 */
|
/* #ifdef h5 */
|
||||||
top: $navigate-height-h5 + $tabs-height + 29px;
|
top: $navigate-height-h5 + $tabs-height + 29px;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
.sp-note {
|
|
||||||
.sp-image {
|
|
||||||
margin-top: 400px;
|
|
||||||
}
|
|
||||||
&__text {
|
|
||||||
margin-top: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 40px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&__type-grid {
|
&__type-grid {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -587,7 +587,7 @@ export default class RecommendList extends Component {
|
||||||
const height = windowWidth * 9 / 17
|
const height = windowWidth * 9 / 17
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage renderFooter={<SpTabbar />} loading={page.isLoading} className='has-nav' title="" isBlack>
|
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="" isBlack>
|
||||||
<View className='page-recommend-list'>
|
<View className='page-recommend-list'>
|
||||||
{false && <>
|
{false && <>
|
||||||
<View className='recommend-list__toolbar'>
|
<View className='recommend-list__toolbar'>
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,7 @@ const initialState = {
|
||||||
finishNum: 0,
|
finishNum: 0,
|
||||||
zitiNum: 0,
|
zitiNum: 0,
|
||||||
deposit: 0,
|
deposit: 0,
|
||||||
isOpen: false,
|
isOpen: false
|
||||||
loading: false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function MemberIndex (props) {
|
function MemberIndex (props) {
|
||||||
|
|
@ -133,18 +132,12 @@ function MemberIndex (props) {
|
||||||
})
|
})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = true
|
|
||||||
})
|
|
||||||
getMemberCenterData()
|
getMemberCenterData()
|
||||||
setMemberBackground()
|
setMemberBackground()
|
||||||
const { redirect } = $instance.router.params
|
const { redirect } = $instance.router.params
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
Taro.redirectTo({ url: decodeURIComponent(redirect) })
|
Taro.redirectTo({ url: decodeURIComponent(redirect) })
|
||||||
}
|
}
|
||||||
setState((draft) => {
|
|
||||||
draft.loading = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}, [isLogin])
|
}, [isLogin])
|
||||||
|
|
||||||
|
|
@ -466,7 +459,7 @@ function MemberIndex (props) {
|
||||||
// console.log('====config===', config.menu)
|
// console.log('====config===', config.menu)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage loading={state.loading} className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
|
<SpPage className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
|
||||||
<View
|
<View
|
||||||
className='header-block'
|
className='header-block'
|
||||||
style={styleNames({
|
style={styleNames({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue