修复已知bug 新增商品评论功能
parent
0e7ad5270f
commit
2fa4f8034a
|
|
@ -15,11 +15,11 @@ export default class GoodsEvaluation extends Component {
|
|||
showComment: false
|
||||
}
|
||||
|
||||
constructor (props) {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
styles: { height: '220rpx' }
|
||||
styles: { height: '200rpx' }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -48,6 +48,28 @@ export default class GoodsEvaluation extends Component {
|
|||
this.props.onReplyRate() && this.props.onReplyRate(info)
|
||||
}
|
||||
|
||||
fortmatStr (desc) {
|
||||
console.log("🚀 ~ GoodsEvaluation ~ desc:", desc)
|
||||
let desc_info = '颜色分类:'
|
||||
if (desc) {
|
||||
try {
|
||||
const descArr = desc.split(',')
|
||||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
if (index === 2) {
|
||||
value = '尺码:' + value
|
||||
}
|
||||
desc_info += value + ';'
|
||||
})
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
return desc_info
|
||||
}
|
||||
|
||||
/*previewImg (url, e) {
|
||||
e.stopPropagation()
|
||||
this.props.onPreviewImg() && this.props.onPreviewImg(url)
|
||||
|
|
@ -59,6 +81,9 @@ export default class GoodsEvaluation extends Component {
|
|||
if (!info) {
|
||||
return null
|
||||
}
|
||||
if (info.item_spec_desc) {
|
||||
info.item_spec_desc_txt = this.fortmatStr(info.item_spec_desc)
|
||||
}
|
||||
|
||||
if (pathRoute === 'detail') {
|
||||
if (info && info.picList) {
|
||||
|
|
@ -68,19 +93,23 @@ export default class GoodsEvaluation extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View className='evaluation-item' onClick={this.handleSelectEvaluation.bind(this)}>
|
||||
<View className='evaluation-item' onClick={this.handleSelectEvaluation.bind(this)} isBlack>
|
||||
<View className='evaluation-item__avator'>
|
||||
<Image
|
||||
src={info.anonymous ? userIcon : info.avatar}
|
||||
mode='aspectFill'
|
||||
className='avatar'
|
||||
fadeIn
|
||||
/>
|
||||
</View>
|
||||
<View className='evaluation-item__main'>
|
||||
<View className='name-wrap'>
|
||||
<Text className='name'>{info.anonymous ? '匿名用户' : info.username}</Text>
|
||||
<AtRate size='12' value={info.star} />
|
||||
<View className='name'>{info.anonymous ? '匿名用户' : info.username}
|
||||
<Text style={{ marginLeft: '10rpx' }}>{info.item_spec_desc_txt}</Text>
|
||||
</View>
|
||||
<AtRate size='14' value={info.star} />
|
||||
</View>
|
||||
<View className='desc'>{info.content}</View>
|
||||
{info.rate_pic_num > 0 && (
|
||||
|
|
@ -97,6 +126,8 @@ export default class GoodsEvaluation extends Component {
|
|||
style={`height: ${styles.height}`}
|
||||
src={imgUrl}
|
||||
mode='aspectFill'
|
||||
fadeIn
|
||||
lazyLoad
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
@import "../../style/imports.scss";
|
||||
@import '../../style/imports.scss';
|
||||
|
||||
.evaluation-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 48px 0 0 0;
|
||||
padding: 20px 0 0 0;
|
||||
&__avator {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
|
@ -15,17 +15,18 @@
|
|||
}
|
||||
&__main {
|
||||
flex: 1;
|
||||
padding-bottom: 48px;
|
||||
padding-bottom: 20px;
|
||||
margin-left: 25px;
|
||||
border-bottom: 2px solid rgba(0, 0, 0, 0.05);
|
||||
.name-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
vertical-align: top;
|
||||
margin-bottom: 22px;
|
||||
.name {
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
font-size: 24px;
|
||||
color: #b1b1b1;
|
||||
}
|
||||
.at-rate__icon--on {
|
||||
color: #000000;
|
||||
|
|
@ -35,32 +36,37 @@
|
|||
font-size: 24px;
|
||||
line-height: 1.54;
|
||||
color: #000000;
|
||||
@include multi-ellipsis(2)
|
||||
// @include multi-ellipsis(2)
|
||||
}
|
||||
.evaluation_imgs {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
border-radius: 15px;
|
||||
margin-top: 48px;
|
||||
justify-content: space-between;
|
||||
// border-radius: 15px;
|
||||
margin-top: 20px;
|
||||
overflow: hidden;
|
||||
flex-wrap: wrap;
|
||||
.img-box {
|
||||
width: 33%;
|
||||
margin-right: 0.5%;
|
||||
}
|
||||
.img-box:nth-child(3n) {
|
||||
width: 33%;
|
||||
margin-right: 0;
|
||||
width: 32%;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
// margin-right: 0.5%;
|
||||
&:nth-child(n + 4) {
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
// .img-box:nth-child(3n) {
|
||||
// width: 33%;
|
||||
// margin-right: 0;
|
||||
// }
|
||||
.img-rate {
|
||||
width: 100%;
|
||||
/* #ifdef h5 */
|
||||
/* #ifdef h5 */
|
||||
height: 240px;
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply-comment{
|
||||
.reply-comment {
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
.text {
|
||||
|
|
@ -68,7 +74,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.marginBottom10{
|
||||
.marginBottom10 {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,16 +12,16 @@ $button-height: 80px;
|
|||
// border: 1px solid #444444;
|
||||
|
||||
&__reset {
|
||||
width: 58%;
|
||||
padding-right: 8%;
|
||||
width: 46%;
|
||||
// padding-right: 8%;
|
||||
color: var(--color-primary);
|
||||
height: 80px;
|
||||
/* prettier-ignore */
|
||||
border: 1PX solid #E5E5E5;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-radius: 40px;
|
||||
bottom: 0px;
|
||||
border-radius: 6px;
|
||||
color: #444;
|
||||
text-align: center;
|
||||
line-height: 80px;
|
||||
|
|
@ -29,12 +29,13 @@ $button-height: 80px;
|
|||
}
|
||||
|
||||
&__confirm {
|
||||
width: 58%;
|
||||
// width: 58%;
|
||||
width: 46%;
|
||||
/* prettier-ignore */
|
||||
border: 1PX solid var(--color-primary);
|
||||
background: var(--color-primary);
|
||||
height: 80px;
|
||||
border-radius: 40px;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const initialState = {
|
|||
isExpanded: false
|
||||
}
|
||||
function SpCoupon (props) {
|
||||
const { info, children, onClick = () => { }, isNew } = props
|
||||
const { info, children, onClick = () => { }, isNew, isNotUse = false } = props
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { isExpanded } = state
|
||||
if (!info) {
|
||||
|
|
@ -47,7 +47,7 @@ function SpCoupon (props) {
|
|||
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
||||
|
||||
return (<View className="coupons-list-item" key={`coupon-item__${id}`} style={styleNames({
|
||||
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${couponStatus ? couponStatus != 1 ? "quan-hui" : "quan-lan" : info.tagClass === 'used' ? 'quan-hui' : 'quan-lan'}.png) no-repeat`,
|
||||
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${((couponStatus && couponStatus != 1) || (info.tagClass === 'used' || info.tagClass === 'overdue') || isNotUse) ? "quan-hui" : "quan-lan"}.png) no-repeat`,
|
||||
'background-size': '100% 100%'
|
||||
})}>
|
||||
<View className="coupons-list-item-left">
|
||||
|
|
@ -62,8 +62,10 @@ function SpCoupon (props) {
|
|||
<View className="coupons-list-item-desc">有效日期:{beginDate}至{endDate}</View>}
|
||||
</View>
|
||||
{/* !valid || */}
|
||||
{info.tagClass === 'used' || info.tagClass === 'overdue' ? <View className="coupons-list-item-btn">已{info.tagClass === 'used' ? '使用' : '过期'}</View>
|
||||
: <View className="coupons-list-item-btn" onClick={onClick}>立即{isNew ? '兑换' : '使用'}</View>}
|
||||
{!isNotUse && <>
|
||||
{info.tagClass === 'used' || info.tagClass === 'overdue' ? <View className="coupons-list-item-btn">已{info.tagClass === 'used' ? '使用' : '过期'}</View>
|
||||
: <View className="coupons-list-item-btn" onClick={onClick}>立即{isNew ? '兑换' : '使用'}</View>}
|
||||
</>}
|
||||
</View>
|
||||
</View>)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function SpGoodsCell (props) {
|
|||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, 2)
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
desc_info += value + ' '
|
||||
})
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function SpGoodsPrice (props) {
|
|||
</View>
|
||||
}
|
||||
{
|
||||
!isPoint && <SpPrice size={36} className='sale-price' value={price} showSeparator noDecimal={false} />
|
||||
!isPoint && <SpPrice size={36} className='sale-price' value={price} showSeparator noDecimal />
|
||||
}
|
||||
{/* {marketPrice > 0 && enMarketPrice && (
|
||||
<SpPrice className='mkt-price' lineThrough value={marketPrice} />
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function SpOrderItem (props) {
|
|||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, 2)
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
desc_info += value + ' '
|
||||
})
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ const initialState = {
|
|||
skuText: '',
|
||||
num: 1,
|
||||
loading: false,
|
||||
isClickSku: false
|
||||
isClickSku: false,
|
||||
isClickNum: false
|
||||
}
|
||||
|
||||
function SpSkuSelect (props, ref) {
|
||||
|
|
@ -58,13 +59,19 @@ function SpSkuSelect (props, ref) {
|
|||
specItems.forEach((item) => {
|
||||
const key = item.specItem.map((spec) => spec.specId).join('_')
|
||||
skuDictRef.current[key] = item
|
||||
if (item.store > 0) {
|
||||
} else {
|
||||
// console.log("🚀 ~ item库存为0:", key, item.specItem.map((item) => item.specName).join('_'))
|
||||
}
|
||||
console.log("🚀 ~ item库存为:", key, item.specItem.map((item) => item.specName).join('_'), item.store)
|
||||
})
|
||||
let selItem = null
|
||||
if (skuList.length === 3) {
|
||||
const [a, b, c] = skuList
|
||||
if (a?.skuValue.length > 0 && b?.skuValue.length > 0 && c?.skuValue.length > 0) {
|
||||
const key = [a.skuValue[0].specId, b.skuValue[0].specId, c.skuValue[0].specId].join('_')
|
||||
const item = skuDictRef.current[key]
|
||||
selItem = key && item && item.store > 0 && ['onsale'].includes(item.approveStatus) ? item : null
|
||||
}
|
||||
}
|
||||
// 默认选中有库存并且前端可销售的sku
|
||||
const defaultSpecItem = specItems.find((item) => item.store > 0 && ['onsale'].includes(item.approveStatus))
|
||||
const defaultSpecItem = selItem ?? specItems.find((item) => item.store > 0 && ['onsale'].includes(item.approveStatus))
|
||||
let selection = Array(specItems.length).fill(null)
|
||||
if (defaultSpecItem) {
|
||||
selection = defaultSpecItem.specItem.map((item) => item.specId)
|
||||
|
|
@ -145,11 +152,16 @@ function SpSkuSelect (props, ref) {
|
|||
const key = _selection.join('_')
|
||||
const row = skuDictRef.current[key] || {}
|
||||
if (disabledSet.has(specId)) return
|
||||
if (!state.isClickNum) {
|
||||
setState((draft) => {
|
||||
draft.isClickNum = idx === 2
|
||||
})
|
||||
}
|
||||
setState(
|
||||
(draft) => {
|
||||
draft.selection[idx] = specId //null
|
||||
draft.curImage = 1
|
||||
draft.isClickSku = idx === 2 || row.store > 0
|
||||
draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2
|
||||
},
|
||||
(row) => {
|
||||
calcDisabled(row.selection, idx)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export const TRADE_ITEM = {
|
|||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, 2)
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
desc_info += value + ' '
|
||||
})
|
||||
|
|
@ -112,7 +112,7 @@ export const TRADE_AFTER_SALES_ITEM = {
|
|||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, 2)
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
desc_info += value + ' '
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import {
|
|||
FloatMenuItem,
|
||||
GoodsEvaluation,
|
||||
GoodsComment,
|
||||
SpNavBar
|
||||
SpNavBar,
|
||||
SpPage
|
||||
} from '@/components'
|
||||
import api from '@/api'
|
||||
import { withBackToTop, withPager } from '@/hocs'
|
||||
|
|
@ -24,7 +25,7 @@ export default class Evaluation extends Component {
|
|||
addGlobalClass: true
|
||||
}
|
||||
|
||||
constructor (props) {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
|
|
@ -156,23 +157,23 @@ export default class Evaluation extends Component {
|
|||
render () {
|
||||
const { showBackToTop, evaluationList, showCommentPanel } = this.state
|
||||
|
||||
if (!evaluationList.length) {
|
||||
return <Loading />
|
||||
}
|
||||
// if (!evaluationList.length) {
|
||||
// return <Loading />
|
||||
// }
|
||||
|
||||
return (
|
||||
<View className='page-goods-evaluation'>
|
||||
<SpNavBar title='评论列表' leftIconType='chevron-left' />
|
||||
<ScrollView className='goods-detail__scroll' onScrollToLower={this.nextPage} scrollY>
|
||||
<SpPage loading={!evaluationList.length} className='page-goods-evaluation has-navbar' title={"评价列表"}>
|
||||
{/* <SpNavBar title='评论列表' leftIconType='chevron-left' /> */}
|
||||
<ScrollView className='goods-detail__scroll' onScrollToLower={this.nextPage} style={{ top: 'var(--nav-height)' }} scrollY>
|
||||
<View className='goods-evaluation-wrap'>
|
||||
<View className='evaluation-list'>
|
||||
{evaluationList.map((item) => {
|
||||
{evaluationList.length > 0 && evaluationList.map((item) => {
|
||||
return (
|
||||
<GoodsEvaluation
|
||||
info={item}
|
||||
key={item.rate_id}
|
||||
pathRoute='espier-evaluation'
|
||||
showComment
|
||||
// showComment
|
||||
onReplyRate={this.handleClickViewEvaluation.bind(this, item)}
|
||||
/>
|
||||
)
|
||||
|
|
@ -197,7 +198,7 @@ export default class Evaluation extends Component {
|
|||
onReplyRate={this.handleReplyRate.bind(this)}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
</SpPage>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
@import "@/style/imports";
|
||||
@import '@/style/imports';
|
||||
|
||||
.page-goods-evaluation {
|
||||
/* #ifdef h5 */
|
||||
padding-top: $navigate-height-h5;
|
||||
/* #endif */
|
||||
.goods-detail__scroll {
|
||||
@include page-scroll($navigate-height);
|
||||
@include page-scroll(var(--nav-height), 40px);
|
||||
top: var(--nav-height);
|
||||
/* #ifdef h5 */
|
||||
@include page-scroll($navigate-height-h5);
|
||||
top:47px;
|
||||
top: 47px;
|
||||
/* #endif */
|
||||
}
|
||||
.goods-evaluation-wrap {
|
||||
background: #fff;
|
||||
padding: 30px 32px;
|
||||
padding: 0 32px;
|
||||
.evaluation-title {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import './rate.scss'
|
|||
)
|
||||
export default class TradeRate extends Component {
|
||||
$instance = getCurrentInstance()
|
||||
constructor (props) {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
|
|
@ -184,9 +184,12 @@ export default class TradeRate extends Component {
|
|||
})
|
||||
await api.trade.createOrderRate(params)
|
||||
Taro.hideLoading()
|
||||
Taro.navigateTo({
|
||||
url: `/marketing/pages/item/success`
|
||||
})
|
||||
// Taro.navigateTo({
|
||||
// url: `/marketing/pages/item/success`
|
||||
// })
|
||||
setTimeout(() => {
|
||||
Taro.navigateBack()
|
||||
}, 300)
|
||||
}
|
||||
|
||||
// TODO: 确认原有功能
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@import "@/style/imports";
|
||||
@import '@/style/imports';
|
||||
|
||||
page {
|
||||
width: 100%;
|
||||
|
|
@ -8,7 +8,7 @@ page {
|
|||
.trade-rate {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f5f5f5;
|
||||
// background: #f5f5f5;
|
||||
// padding: 20px;
|
||||
padding-bottom: 120px;
|
||||
overflow-y: auto;
|
||||
|
|
@ -40,15 +40,15 @@ page {
|
|||
}
|
||||
|
||||
/* #ifdef h5 */
|
||||
&__hd{
|
||||
&__hd {
|
||||
display: block;
|
||||
|
||||
.goods-item__img{
|
||||
.goods-item__img {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
.rate-wrap {
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
|
@ -93,7 +93,7 @@ page {
|
|||
min-height: 200px;
|
||||
}
|
||||
.upload-imgs {
|
||||
.at-image-picker__flex-box {
|
||||
.at-image-picker__flex-box {
|
||||
padding: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
|
@ -105,24 +105,23 @@ page {
|
|||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
bottom: 40px;
|
||||
z-index: 88;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* #ifdef h5 */
|
||||
*{
|
||||
box-sizing: border-box;
|
||||
/* #ifdef h5 */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.trade-rate {
|
||||
.footer {
|
||||
padding: 20px 24px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.trade-rate {
|
||||
.footer {
|
||||
padding: 20px 24px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
}
|
||||
/* #endif */
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function CashierResult (props) {
|
|||
<AtButton
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
Taro.redirectTo({ url: `/subpage/pages/trade/detail?id=${orderId}&type=pointitem` })
|
||||
Taro.redirectTo({ url: `/subpage/pages/trade/detail?id=${orderId}` })
|
||||
}}
|
||||
>
|
||||
订单详情
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ const CompSeries = (props) => {
|
|||
</View>
|
||||
<SpImage
|
||||
className={classNames(imgType ? 'cat-img' : 'cat-img-no')}
|
||||
mode='aspectFit'
|
||||
height={windowWidth > 400 ? 276 : 240}
|
||||
mode={currentID === '18' ? 'aspectFill' : 'aspectFit'}
|
||||
height={currentID === '18' ? 350 : windowWidth > 400 ? 278 : 242}
|
||||
src={item.img}
|
||||
/>
|
||||
</View> : <View
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@
|
|||
height: 100%;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
// @include page-scroll(var(--nav-height), $tabbar-height);
|
||||
// height: calc(100% - $tabbar-height - 20px);
|
||||
padding-bottom: 30px;
|
||||
.category-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
@ -133,10 +136,11 @@
|
|||
&__img {
|
||||
// width: 156px;
|
||||
// height: 230px;
|
||||
margin-top: 24px;
|
||||
margin-top: 4px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 2px solid #bcbcbc;
|
||||
font-size: 28px;
|
||||
color: #0e0e0e;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { SpImage } from '@/components'
|
|||
import { classNames } from '@/utils'
|
||||
import './comp-evaluation.scss'
|
||||
|
||||
function CompEvaluation(props) {
|
||||
function CompEvaluation (props) {
|
||||
const { className, list = [], itemId } = props
|
||||
|
||||
const onViewMore = () => {
|
||||
|
|
@ -19,13 +19,35 @@ function CompEvaluation(props) {
|
|||
})
|
||||
}
|
||||
|
||||
const fortmatStr = (desc) => {
|
||||
let desc_info = '颜色分类:'
|
||||
if (desc) {
|
||||
try {
|
||||
const descArr = desc.split(',')
|
||||
descArr.forEach((item, index) => {
|
||||
let [_, value] = item.split(':')
|
||||
if (index === 1) {
|
||||
value = value.substring(0, value.length - 1)
|
||||
}
|
||||
if (index === 2) {
|
||||
value = '尺码:' + value
|
||||
}
|
||||
desc_info += value + ';'
|
||||
})
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
return desc_info
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View className={classNames('comp-evaluation', className)}>
|
||||
<View className='evaluation-hd'>
|
||||
<View className='title'>{`评价(${list.length})`}</View>
|
||||
<View className='title'>{`商品评价(${list.length})`}</View>
|
||||
{list.length > 0 && (
|
||||
<View className='extra-more' onClick={onViewMore}>
|
||||
查看全部
|
||||
{/* 查看全部 */}
|
||||
<Text className='iconfont icon-qianwang-01'></Text>
|
||||
</View>
|
||||
)}
|
||||
|
|
@ -35,12 +57,15 @@ function CompEvaluation(props) {
|
|||
<View className='evaluation-item-wrap'>
|
||||
<View className='item-hd'>
|
||||
<SpImage src={item.avatar} className='evaluation-icon' width={50} height={50} />
|
||||
<Text className='evaluation-name'>{item.username || '匿名用户'}</Text>
|
||||
<Text className='evaluation-name'>{item.username || '匿名用户'}
|
||||
<Text style={{ marginLeft: '10rpx' }}>{fortmatStr(item.item_spec_desc)}</Text>
|
||||
</Text>
|
||||
</View>
|
||||
<View className='evaluation-content'>{item.content}</View>
|
||||
<View className="evaluation-content-line"></View>
|
||||
</View>
|
||||
))}
|
||||
{list.length == 0 && <View className='default-msg'>暂无商品评论</View>}
|
||||
{list.length == 0 && <View className='default-msg'>暂无商品评价</View>}
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,27 +1,31 @@
|
|||
.comp-evaluation {
|
||||
margin: 0 16px;
|
||||
// margin: 0 16px;
|
||||
background-color: #fff;
|
||||
padding: 0 16px;
|
||||
box-shadow: 0px 2px 10px 0px #eae7e0;
|
||||
padding: 0 30px;
|
||||
// box-shadow: 0px 2px 10px 0px #eae7e0;
|
||||
.evaluation-hd {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 24px 0;
|
||||
padding: 40px 10px 26px;
|
||||
/* prettier-ignore */
|
||||
border-bottom: 1PX solid #ddd;
|
||||
// border-bottom: 1PX solid #ddd;
|
||||
.extra-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--color-primary);
|
||||
font-size: 24px;
|
||||
.icon-qianwang-01 {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.evaluation-bd {
|
||||
padding: 24px 0;
|
||||
// padding: 24px 0;
|
||||
.evaluation-item-wrap {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
margin-bottom: 20px;
|
||||
// &:not(:last-child) {
|
||||
// margin-bottom: 20px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
.evaluation-icon {
|
||||
|
|
@ -34,14 +38,26 @@
|
|||
}
|
||||
.evaluation-name {
|
||||
font-size: 24px;
|
||||
color: #777;
|
||||
color: #b1b1b1;
|
||||
}
|
||||
.item-hd {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
.evaluation-content {
|
||||
margin-top: 16px;
|
||||
// padding-left: 50px;
|
||||
// padding-right: 16px;
|
||||
margin: 0 16px 0 50px;
|
||||
white-space: pre-wrap;
|
||||
font-size: 28px;
|
||||
// padding-bottom: 28px;
|
||||
@include multi-ellipsis(2);
|
||||
&-line {
|
||||
margin: 0 16px 0 50px;
|
||||
padding-top: 28px;
|
||||
border-bottom: 1px solid #9e9e9e80;
|
||||
}
|
||||
}
|
||||
.default-msg {
|
||||
color: #999;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ function EspierDetail (props) {
|
|||
if (id) {
|
||||
fetch()
|
||||
// getPackageList()
|
||||
// getEvaluationList()
|
||||
getEvaluationList()
|
||||
}
|
||||
}, [id])
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ function EspierDetail (props) {
|
|||
}
|
||||
})
|
||||
}
|
||||
console.log("🚀 ~ data.introList:", data)
|
||||
// console.log("🚀 ~ data.introList:", data)
|
||||
setState((draft) => {
|
||||
draft.info = {
|
||||
...data,
|
||||
|
|
@ -710,9 +710,6 @@ function EspierDetail (props) {
|
|||
</View>
|
||||
</View>} */}
|
||||
|
||||
{/* 商品评价 */}
|
||||
{/* <CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation> */}
|
||||
|
||||
{/* 店铺 */}
|
||||
{VERSION_PLATFORM && <CompStore info={info.distributorInfo} />}
|
||||
|
||||
|
|
@ -731,7 +728,7 @@ function EspierDetail (props) {
|
|||
})
|
||||
}}
|
||||
onChange={(skuText, curItem, idx) => {
|
||||
console.log("🚀 ~ curItem:", curItem, idx)
|
||||
// console.log("🚀 ~ curItem:", curItem, idx)
|
||||
curItem && setState((draft) => {
|
||||
draft.skuText = skuText
|
||||
draft.curItem = curItem
|
||||
|
|
@ -786,11 +783,11 @@ function EspierDetail (props) {
|
|||
})
|
||||
draft.introList[index].isOpen = !item.isOpen
|
||||
})
|
||||
if (!item.isOpen) {
|
||||
setState((draft) => {
|
||||
draft.scrollTop = 1010 + Math.random()
|
||||
})
|
||||
}
|
||||
// if (!item.isOpen) {
|
||||
// setState((draft) => {
|
||||
// draft.scrollTop = 742 + Math.random()
|
||||
// })
|
||||
// }
|
||||
}}
|
||||
title={item.title}
|
||||
>
|
||||
|
|
@ -804,17 +801,19 @@ function EspierDetail (props) {
|
|||
})
|
||||
draft.introList[index].isOpen = !item.isOpen
|
||||
})
|
||||
if (!item.isOpen) {
|
||||
setState((draft) => {
|
||||
draft.scrollTop = 1010 + Math.random()
|
||||
})
|
||||
}
|
||||
// if (!item.isOpen) {
|
||||
// setState((draft) => {
|
||||
// draft.scrollTop = 742 + Math.random()
|
||||
// })
|
||||
// }
|
||||
}}>
|
||||
{item.isOpen ? <AtIcon value='subtract' size='16' color='#000' /> :
|
||||
<AtIcon value='add' size='16' color='#000' />}
|
||||
{item.isOpen ? <></> : <View className="line"></View>}
|
||||
</View>
|
||||
</View>) : <View style={{ height: `calc(100% - 380px)` }}></View>}
|
||||
{/* 商品评价 */}
|
||||
<CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation>
|
||||
{isArray(historyList) ? <View className='bottom-box'>
|
||||
<View className="bottom-box-tit">浏览历史</View>
|
||||
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
|
||||
|
|
|
|||
|
|
@ -111,11 +111,11 @@
|
|||
background-color: #fff;
|
||||
// padding: 0 30px;
|
||||
// box-shadow: 0px 2px 10px 0px #eae7e0;
|
||||
height: calc(100vh - #{$page-ipx-footer-height} - var(--nav-height));
|
||||
// height: calc(100vh - #{$page-ipx-footer-height} - var(--nav-height));
|
||||
// padding-bottom: calc(#{$page-ipx-footer-height} + 30px);
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow-y: scroll;
|
||||
// overflow-y: scroll;
|
||||
&::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0px 50px;
|
||||
.left-container,
|
||||
.right-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.goods-list-wrap {
|
||||
// width: 345px;
|
||||
margin-bottom: 28px;
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ export default class TradeItem extends Component {
|
|||
{info.aftersales_bn ? '售后进度' : '申请售后'}
|
||||
</Button>
|
||||
)}
|
||||
{false && info.is_rate == 0 && !info.aftersales_bn && <Button
|
||||
{info.is_rate == 0 && !info.aftersales_bn && <Button
|
||||
className='btn-action'
|
||||
style={`background: ${colors.data[0].primary};width:120rpx`}
|
||||
// onClick={this.handleClickBtn.bind(this, 'detail')}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ export default class TradeList extends Component {
|
|||
const { status = 0, evaluate = 1 } = this.$instance.router.params
|
||||
const _tabList = JSON.parse(JSON.stringify(this.state.tabList))
|
||||
if (evaluate == 1) {
|
||||
// _tabList.push({ title: '待评价', status: '7', is_rate: 0 })
|
||||
_tabList.push({ title: '已完成', status: '7', is_rate: 0 })
|
||||
_tabList.push({ title: '待评价', status: '7', is_rate: 0 })
|
||||
_tabList.push({ title: '已完成', status: '3', is_rate: 0 })
|
||||
_tabList.push({ title: '售后', status: '---', is_rate: 0 })
|
||||
}
|
||||
const tabIdx = _tabList.findIndex((tab) => tab.status === status)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ function CouponPicker (props) {
|
|||
{couponListInVaild.length > 0 ? <View className='invalid-title'>不可用优惠券</View> : ''}
|
||||
{couponListInVaild.map((item, index) => (
|
||||
<View className='coupon-item-wrap' key={`coupon-item__${index}`}>
|
||||
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} />
|
||||
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} isNotUse />
|
||||
{/* <SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/> */}
|
||||
</View>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ const initialState = {
|
|||
waitRecevieNum: 0,
|
||||
waitEvaluateNum: 0,
|
||||
afterSalesNum: 0,
|
||||
finishNum: 0,
|
||||
zitiNum: 0,
|
||||
deposit: 0,
|
||||
isOpen: false
|
||||
|
|
@ -313,6 +314,7 @@ function MemberIndex (props) {
|
|||
// normal_payed_daishouhuo: 0 // 待收货
|
||||
// normal_payed_daiziti: 0 //待自提订单
|
||||
// normal_payed_notdelivery: 4 // 已付款未发货 or 已付款已发货
|
||||
// normal_finish:1 //已完成
|
||||
|
||||
const {
|
||||
aftersales, // 待处理售后
|
||||
|
|
@ -320,7 +322,8 @@ function MemberIndex (props) {
|
|||
normal_payed_daifahuo, // 待发货
|
||||
normal_payed_daishouhuo, // 待收货
|
||||
normal_payed_daiziti, // 待自提订单
|
||||
normal_not_rate // 待评论
|
||||
normal_not_rate, // 待评论
|
||||
normal_finish
|
||||
} = resTrade
|
||||
|
||||
setState((draft) => {
|
||||
|
|
@ -333,6 +336,7 @@ function MemberIndex (props) {
|
|||
draft.afterSalesNum = aftersales
|
||||
draft.zitiNum = normal_payed_daiziti
|
||||
draft.waitEvaluateNum = normal_not_rate
|
||||
draft.finishNum = normal_finish
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -598,9 +602,9 @@ function MemberIndex (props) {
|
|||
>
|
||||
<View className='order-item-view'>
|
||||
<SpImage src='member/daifahuo.png' className='icon-style' isNew />
|
||||
{state.waitRecevieNum + state.waitSendNum > 0 && (
|
||||
{state.waitSendNum > 0 && (
|
||||
<View className='order-bradge'>
|
||||
<Text>{state.waitRecevieNum + state.waitSendNum}</Text>
|
||||
<Text>{state.waitSendNum}</Text>
|
||||
</View>
|
||||
)}
|
||||
<Text className='order-txt'>待发货</Text>
|
||||
|
|
@ -622,29 +626,29 @@ function MemberIndex (props) {
|
|||
</SpLogin>
|
||||
<SpLogin
|
||||
className='order-item'
|
||||
onChange={handleClickLink.bind(this, '/subpage/pages/trade/list?status=7')}
|
||||
onChange={handleClickLink.bind(this, '/subpage/pages/trade/list?status=3')}
|
||||
>
|
||||
<View className='order-item-view'>
|
||||
<SpImage src='member/yiwancheng.png' className='icon-style' isNew />
|
||||
{state.waitEvaluateNum > 0 && (
|
||||
{state.finishNum > 0 && (
|
||||
<View className='order-bradge'>
|
||||
<Text>{state.waitEvaluateNum}</Text>
|
||||
<Text>{state.finishNum}</Text>
|
||||
</View>
|
||||
)}
|
||||
<Text className='order-txt'>已完成</Text>
|
||||
</View>
|
||||
</SpLogin>
|
||||
{/* 先隐藏评价功能 02-24 */}
|
||||
{false && <SpLogin
|
||||
{<SpLogin
|
||||
className='order-item'
|
||||
// /subpage/pages/trade/after-sale
|
||||
onChange={handleClickLink.bind(this, '/subpage/pages/trade/list?status=7')}
|
||||
>
|
||||
<View className='order-item-view'>
|
||||
<SpImage src='member/pingjia.png' className='icon-style' mode='aspectFit' height={42} isNew />
|
||||
{state.afterSalesNum > 0 && (
|
||||
{state.waitEvaluateNum > 0 && (
|
||||
<View className='order-bradge'>
|
||||
<Text>{state.afterSalesNum}</Text>
|
||||
<Text>{state.waitEvaluateNum}</Text>
|
||||
</View>
|
||||
)}
|
||||
<Text className='order-txt'>评价</Text>
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
padding: 30px 16px 50px;
|
||||
.comp-panel {
|
||||
&-bd {
|
||||
padding: 24px 50px;
|
||||
padding: 24px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.extra {
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ function TradeAfterSale (props) {
|
|||
<View className="iconfont icon-arrowRight" style={{ color: tabList[curTabIdx] > -1 ? '#000' : '#a5a5a5' }}></View>
|
||||
</View>
|
||||
</Picker>
|
||||
</View> : aftersales?.progress != 12 ? <View className="after-item">
|
||||
</View> : aftersales?.progress && aftersales.progress != 12 ? <View className="after-item">
|
||||
<View className="after-item-label">售后单号:{afterSaleTid}</View>
|
||||
<View className="after-item-label" style={{ fontSize: '30rpx', display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', opacity: '80', margin: '36rpx 0 50rpx 0', lineHeight: '0.8' }}>
|
||||
<Text style={{ marginRight: '20rpx', fontWeight: 'bold' }}>{['', '售后审核通过,请您发货并填写物流单号', '等待商家确认收货', '已驳回', '已完成', '退款驳回', '退款完成', '已关闭', '商家确认收货,等待审核退款', '退款处理中'][aftersales?.progress || 0]}</Text>
|
||||
|
|
@ -337,40 +337,42 @@ function TradeAfterSale (props) {
|
|||
</View>
|
||||
</View> : null}
|
||||
|
||||
<View className="after-item" style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', marginBottom: '30rpx' }}>
|
||||
<Text style={{ fontSize: '24rpx', marginTop: '-10rpx' }}>退货单号填写</Text>
|
||||
{aftersales?.hasAftersalesAddress && <Text onClick={() => setState(draft => { draft.isAddrOpened = true })} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', padding: '0 0 4rpx', marginTop: '-10rpx', lineHeight: 0.8 }}>查看退货地址</Text>}
|
||||
</View>
|
||||
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
|
||||
{!aftersales?.hasSendbackData ? <Picker
|
||||
mode='selector'
|
||||
rangeKey='name'
|
||||
range={expressList}
|
||||
onChange={onChangeExpress}
|
||||
>
|
||||
<View className="after-item-input">
|
||||
<View className={`input-txt`}>{`${getLogisticName() || '请选择快递公司'}`}</View>
|
||||
<View className="iconfont icon-arrowRight" style={{ color: getLogisticName() ? '#000' : '#a5a5a5' }}></View>
|
||||
</View>
|
||||
</Picker> : <View className="after-item-input">
|
||||
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.name || ''}`}</View>
|
||||
</View>}
|
||||
</View>
|
||||
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
|
||||
<View className="after-item-input">
|
||||
{!aftersales?.hasSendbackData ? <Input className="desc-ipt" value={logi_no} placeholder='物流单号' onInput={(e) => {
|
||||
setState(draft => {
|
||||
draft.logi_no = e.detail.value
|
||||
})
|
||||
}}></Input>
|
||||
:
|
||||
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.logi_no || ''}`}</View>}
|
||||
{aftersales?.progress >= 1 && aftersales?.progress != 3 && <>
|
||||
<View className="after-item" style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', marginBottom: '30rpx' }}>
|
||||
<Text style={{ fontSize: '24rpx', marginTop: '-10rpx' }}>退货单号填写</Text>
|
||||
{aftersales?.hasAftersalesAddress && <Text onClick={() => setState(draft => { draft.isAddrOpened = true })} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', padding: '0 0 4rpx', marginTop: '-10rpx', lineHeight: 0.8 }}>查看退货地址</Text>}
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ margin: '0 auto', marginBottom: '70rpx', textAlign: 'center' }}>
|
||||
{/* <AtButton type='primary' onClick={onSubmitExp}>确认上传</AtButton> */}
|
||||
<Text onClick={() => handleClickCopy(aftersales?.sendbackData?.logi_no || '')} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', lineHeight: 0.8 }}>复制物流单号</Text>
|
||||
</View>
|
||||
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
|
||||
{!aftersales?.hasSendbackData ? <Picker
|
||||
mode='selector'
|
||||
rangeKey='name'
|
||||
range={expressList}
|
||||
onChange={onChangeExpress}
|
||||
>
|
||||
<View className="after-item-input">
|
||||
<View className={`input-txt`}>{`${getLogisticName() || '请选择快递公司'}`}</View>
|
||||
<View className="iconfont icon-arrowRight" style={{ color: getLogisticName() ? '#000' : '#a5a5a5' }}></View>
|
||||
</View>
|
||||
</Picker> : <View className="after-item-input">
|
||||
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.name || ''}`}</View>
|
||||
</View>}
|
||||
</View>
|
||||
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
|
||||
<View className="after-item-input">
|
||||
{!aftersales?.hasSendbackData ? <Input className="desc-ipt" value={logi_no} placeholder='物流单号' onInput={(e) => {
|
||||
setState(draft => {
|
||||
draft.logi_no = e.detail.value
|
||||
})
|
||||
}}></Input>
|
||||
:
|
||||
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.logi_no || ''}`}</View>}
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ margin: '0 auto', marginBottom: '70rpx', textAlign: 'center' }}>
|
||||
{/* <AtButton type='primary' onClick={onSubmitExp}>确认上传</AtButton> */}
|
||||
<Text onClick={() => handleClickCopy(aftersales?.sendbackData?.logi_no || '')} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', lineHeight: 0.8 }}>复制物流单号</Text>
|
||||
</View>
|
||||
</>}
|
||||
|
||||
{/* <SpTabs current={curTabIdx} tablist={tabList} onChange={(e) => {
|
||||
setState(draft => {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
}
|
||||
.btn-wrap {
|
||||
padding: 50px;
|
||||
margin-bottom: 100px;
|
||||
// margin-bottom: 100px;
|
||||
.at-button__text {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue