main
王文龙 2024-02-22 09:59:42 +08:00
parent bf90b988f0
commit 5545b6d619
13 changed files with 231 additions and 102 deletions

BIN
src/assets/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -88,15 +88,16 @@ export default class SpFilterBar extends Component {
{item.icon && <Text className={classNames('iconfont', isArray(item.icon) ? item.icon[sortOrder == 1 ? 0 : 1] : item.icon)}></Text>} {item.icon && <Text className={classNames('iconfont', isArray(item.icon) ? item.icon[sortOrder == 1 ? 0 : 1] : item.icon)}></Text>}
</View> </View>
))} */} ))} */}
<SpPicker mode="select" isTop source={list} value={value} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="筛选" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}> {/* 2024年02月21日暂时不做了胡和客户开会沟通过了 */}
{false && <SpPicker mode="select" isTop source={list} value={value} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="筛选" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
<View className="item" onClick={() => false && this.setState({ showFilter: true })}> <View className="item" onClick={() => false && this.setState({ showFilter: true })}>
<Text className='text'>筛选</Text> <Text className='text'>筛选</Text>
{/* <Image className="img" src={require('@/assets/icon/filter.png')}></Image> */} {/* <Image className="img" src={require('@/assets/icon/filter.png')}></Image> */}
<AtIcon value='menu' size='16' color='#000'></AtIcon> <AtIcon value='menu' size='16' color='#000'></AtIcon>
</View> </View>
</SpPicker> </SpPicker>}
<SpPicker mode="select" source={list} value={sortVal} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="排序" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}> <SpPicker mode="select" source={list} value={sortVal} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="排序" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
<View className="item item-right"> <View className="item item-right-1">
<Text className='text'>排序</Text> <Text className='text'>排序</Text>
<Image className="img" src={require('@/assets/icon/sort.png')}></Image> <Image className="img" src={require('@/assets/icon/sort.png')}></Image>
</View> </View>

View File

@ -28,7 +28,7 @@
&.ipx { &.ipx {
padding-bottom: 20px; padding-bottom: 20px;
.sp-page-footer { .sp-page-footer {
height: $page-ipx-footer-height; min-height: $page-ipx-footer-height;
} }
.sp-float-layout-ft { .sp-float-layout-ft {
padding-bottom: 40px; padding-bottom: 40px;
@ -63,7 +63,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: $toolbar-height; //+20 // height: $toolbar-height; //+20
z-index: $z-index-level-3; z-index: $z-index-level-3;
background: #fff; background: #fff;
} }

View File

@ -19,7 +19,8 @@ export default (props = {}) => {
// const { params, orderInfo } = state // const { params, orderInfo } = state
const cashierResultUrl = `/pages/cart/cashier-result` const cashierResultUrl = `/pages/cart/cashier-result`
const $instance = getCurrentInstance() const $instance = getCurrentInstance()
const currentPath = $instance.router.path console.log("🚀 ~ $instance.router:", $instance.router)
const currentPath = $instance.router?.path
const cashierPayment = (params, orderInfo) => { const cashierPayment = (params, orderInfo) => {
console.log(`cashierPayment:`, params, orderInfo) console.log(`cashierPayment:`, params, orderInfo)
@ -101,13 +102,13 @@ export default (props = {}) => {
// 是否开启adapay小程序插件 // 是否开启adapay小程序插件
if (process.env.APP_ADAPAY == 'true') { if (process.env.APP_ADAPAY == 'true') {
const adapayPlugin = requirePlugin("Adapay"); const adapayPlugin = requirePlugin("Adapay")
adapayPlugin.requestPay(weappOrderInfo.expend, () => { adapayPlugin.requestPay(weappOrderInfo.expend, () => {
paySuccess(params, orderInfo) paySuccess(params, orderInfo)
}, (e) => { }, (e) => {
console.error('adapayPlugin:', e) console.error('adapayPlugin:', e)
payError(orderInfo) payError(orderInfo)
}); })
} else { } else {
await Taro.requestPayment(weappOrderInfo) await Taro.requestPayment(weappOrderInfo)
paySuccess(params, orderInfo) paySuccess(params, orderInfo)

View File

@ -1,10 +1,11 @@
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import { useImmer } from 'use-immer' import { useImmer } from 'use-immer'
import Taro, { getCurrentInstance, getCurrentPages } from '@tarojs/taro' import Taro, { getCurrentInstance, getCurrentPages } from '@tarojs/taro'
import { View, Text } from '@tarojs/components' import { View, Text, Image } from '@tarojs/components'
import { AtButton, AtSwipeAction } from 'taro-ui' import { AtButton, AtSwipeAction } from 'taro-ui'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { SpToast, SpNavBar, SpPage } from '@/components' import { SpToast, SpNavBar, SpPage, SpCheckboxNew } from '@/components'
import { classNames } from '@/utils'
import S from '@/spx' import S from '@/spx'
import api from '@/api' import api from '@/api'
@ -15,7 +16,11 @@ const ADDRESS_ID = 'address_id'
const initialState = { const initialState = {
list: [], list: [],
isPicker: false, isPicker: false,
selectedId: null selectedId: null,
isSelected: '',
selItem: null,
editId: null,
visible: false
} }
function AddressIndex (props) { function AddressIndex (props) {
@ -34,12 +39,17 @@ function AddressIndex (props) {
} }
const fetch = async (isDelete = false) => { const fetch = async (isDelete = false) => {
const { isPicker, receipt_type = '', city = '' } = $instance.router.params const { isPicker, isSelected = '', receipt_type = '', city = '' } = $instance.router.params
if (isPicker) { if (isPicker) {
setState(draft => { setState(draft => {
draft.isPicker = true draft.isPicker = true
}) })
} }
if (isSelected) {
setState(draft => {
draft.isSelected = isSelected
})
}
Taro.showLoading({ title: '' }) Taro.showLoading({ title: '' })
const { list } = await api.member.addressList() const { list } = await api.member.addressList()
Taro.hideLoading() Taro.hideLoading()
@ -64,9 +74,14 @@ function AddressIndex (props) {
} else { } else {
selectedId = list.find((addr) => addr.is_def > 0) || null selectedId = list.find((addr) => addr.is_def > 0) || null
} }
let item = null
if (isSelected) {
item = list.find((addr) => addr[ADDRESS_ID] == isSelected)
}
setState(draft => { setState(draft => {
draft.list = newList draft.list = newList
draft.selectedId = selectedId draft.selectedId = selectedId
draft.selItem = item
}) })
} }
@ -168,7 +183,7 @@ function AddressIndex (props) {
Taro.navigateBack() Taro.navigateBack()
} }
const { selectedId, isPicker, list } = state const { selectedId, isPicker, list, isSelected, selItem, editId, visible } = state
const options = [ const options = [
{ {
text: '', text: '',
@ -180,15 +195,30 @@ function AddressIndex (props) {
} }
} }
] ]
const editAddr = async () => {
setState(draft => {
draft.visible = true
})
setTimeout(() => {
setState(draft => {
draft.visible = false
})
// Taro.navigateBack()
}, 700)
}
return ( return (
<SpPage <SpPage
className='page-address-index' className='page-address-index'
title={isSelected || isPicker ? '修改地址' : '收货地址管理'}
renderFooter={ renderFooter={
<View className='btn-wrap'> <View className='btn-wrap'>
<AtButton type='primary' onClick={handleClickToEdit}> <AtButton onClick={handleClickToEdit}>
新增地址 新增地址
</AtButton> </AtButton>
{!!isSelected && <AtButton type='primary' disabled={!editId} onClick={editAddr} style={{ margin: '30rpx 0 100rpx 0' }}>
确认修改
</AtButton>}
</View> </View>
} }
> >
@ -214,6 +244,35 @@ function AddressIndex (props) {
)} */} )} */}
<View className='member-address-list'> <View className='member-address-list'>
{selectedId && selItem && <>
<View className="address-item">
<View className="address-item__content" style={{ display: 'flex', alignItems: 'center', padding: '16rpx 26rpx 16rpx 20rpx' }}>
<Image src='/assets/info.png' className='info-icon'></Image>
<View className="info__txt">
修改后会影响物流时效送货上门等服务只能原价修改且付款后只能修改一次
若因商品换仓已发货运费变更等原因导致修改失败请您谅解
</View>
</View>
</View>
<View className='address-item'>
<View className='address-item__content'>
<View className='address-item__title' style={{ marginBottom: "20rpx" }}>
<View className='address-item__info'>
<Text>原地址</Text>
</View>
</View>
<View className='address-item__detail_box'>
<View className='address-item__detail'>
{selItem.province}
{selItem.city}
{selItem.county}
{selItem.adrdetail}
</View>
</View>
<Text className='address-item__info_tel'>{selItem.username} {selItem.telephone}</Text>
</View>
</View>
</>}
{list?.length > 0 && list.map((item, index) => { {list?.length > 0 && list.map((item, index) => {
return ( return (
<View <View
@ -221,80 +280,87 @@ function AddressIndex (props) {
className={`address-item ${item.disabled ? 'disabled' : ''}`} className={`address-item ${item.disabled ? 'disabled' : ''}`}
> >
<AtSwipeAction options={options} disabled={item.disabled} isOpened={item.isOpened} autoClose onClick={e => handleDelete(e, item, index)} key={item[ADDRESS_ID]}> <AtSwipeAction options={options} disabled={item.disabled} isOpened={item.isOpened} autoClose onClick={e => handleDelete(e, item, index)} key={item[ADDRESS_ID]}>
<View className='address-item__content'> <View className='address-item__content' style={{ display: 'flex', alignItems: 'center' }} onClick={() => {
<View className='address-item__title'> !!selectedId && setState(draft => {
<View className='address-item__info'> draft.editId = item[ADDRESS_ID]
<Text>{item.username}</Text> })
<Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text> }}>
</View> {!!isSelected && <SpCheckboxNew checked={editId == item[ADDRESS_ID]} onChange={e => ''} />}
<Text className='address-item__info_tel'>{item.telephone}</Text> <View className='' style={{ flex: 1, marginLeft: isSelected ? '50rpx' : 0 }}>
</View> <View className='address-item__title'>
<View className='address-item__detail_box'> <View className='address-item__info'>
<View className='address-item__detail'> <Text>{item.username}</Text>
{item.province} {!isSelected && <Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text>}
{item.city} </View>
{item.county} <Text className='address-item__info_tel'>{item.telephone}</Text>
{item.adrdetail} </View>
</View> <View className='address-item__detail_box'>
<View className='address-item__detail'>
{isPicker && !item.disabled && ( {item.province}
<View className='address-item__check' onClick={e => handleClickChecked(e, item)}> {item.city}
{item[ADDRESS_ID] === selectedId ? ( {item.county}
<Text {item.adrdetail}
className='iconfont icon-check address-item__checked'
style={{ color: colors.colorPrimary }}
></Text>
) : (
<Text
className='address-item__unchecked'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
)}
</View> </View>
)}
</View>
<View className='address-item__footer'> {isPicker && !item.disabled && (
<View <View className='address-item__check' onClick={e => handleClickChecked(e, item)}>
className='address-item__footer_default' {item[ADDRESS_ID] === selectedId ? (
onClick={(e) => handleChangeDefault(e, item)} <Text
> className='iconfont icon-check address-item__checked'
{item.is_def ? ( style={{ color: colors.colorPrimary }}
<> ></Text>
<Text ) : (
// className='iconfont icon-check default__icon default__checked' <Text
className='icon-my icon-checkbox-xuanzhong' className='address-item__unchecked'
style={{ color: colors.colorPrimary }} style={{ borderColor: colors.colorPrimary }}
> >
{' '} {' '}
</Text> </Text>
<Text className='default-text'>已设为默认</Text> )}
</> </View>
) : (
<>
<Text
// className='address-item__unchecked'
className='icon-my icon-checkbox-weixuan'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>设为默认</Text>
</>
)} )}
</View> </View>
{/* <View className='address-item__footer_edit'>
<View className='footer-text' onClick={(e) => handleDelete(e, item, index)}> {!isSelected && <View className='address-item__footer'>
<Text className='iconfont icon-trashCan footer-icon'> </Text> <View
<Text>删除</Text> className='address-item__footer_default'
onClick={(e) => handleChangeDefault(e, item)}
>
{item.is_def ? (
<>
<Text
// className='iconfont icon-check default__icon default__checked'
className='icon-my icon-checkbox-xuanzhong'
style={{ color: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>已设为默认</Text>
</>
) : (
<>
<Text
// className='address-item__unchecked'
className='icon-my icon-checkbox-weixuan'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>设为默认</Text>
</>
)}
</View> </View>
<View className='footer-text' onClick={(e) => handleClickToEdit(e, item)}> {/* <View className='address-item__footer_edit'>
<Text className='iconfont icon-edit footer-icon'> </Text> <View className='footer-text' onClick={(e) => handleDelete(e, item, index)}>
<Text>编辑</Text> <Text className='iconfont icon-trashCan footer-icon'> </Text>
</View> <Text>删除</Text>
</View> */} </View>
<View className='footer-text' onClick={(e) => handleClickToEdit(e, item)}>
<Text className='iconfont icon-edit footer-icon'> </Text>
<Text>编辑</Text>
</View>
</View> */}
</View>}
</View> </View>
</View> </View>
</AtSwipeAction> </AtSwipeAction>
@ -303,6 +369,12 @@ function AddressIndex (props) {
})} })}
</View> </View>
<SpToast /> <SpToast />
<View className={classNames('toast', {
'visible': visible
})}>
<View>修改成功</View>
</View>
</View> </View>
</SpPage> </SpPage>
) )

View File

@ -4,11 +4,16 @@
// background: #f5f5f5; // background: #f5f5f5;
padding: 20px; padding: 20px;
.btn-wrap { .btn-wrap {
padding: 0 50px; padding: 20px 50px 0;
border: transparent 1px solid; border: transparent 1px solid;
.at-button__text { .at-button__text {
font-size: 32px; font-size: 32px;
} }
.at-button {
&:not(:first-child) {
margin: 30px 0 100px;
}
}
} }
.member-address-list { .member-address-list {
// /* #ifdef h5 */ // /* #ifdef h5 */
@ -63,6 +68,16 @@
// margin-left: 12px; // margin-left: 12px;
padding: 40px 30px; padding: 40px 30px;
color: #000; color: #000;
.info-icon {
width: 26px;
height: 26px;
}
.info__txt {
flex: 1;
font-size: 18px;
line-height: 1.8;
margin-left: 20px;
}
} }
&__title { &__title {
color: #010101; color: #010101;
@ -89,7 +104,7 @@
} }
&__detail { &__detail {
@include multi-ellipsis(2); @include multi-ellipsis(2);
margin: 0 30px 50px 0; // margin: 0 30px 50px 0;
color: #959595; color: #959595;
} }
.at-swipe-action { .at-swipe-action {
@ -107,6 +122,7 @@
.address-item__footer { .address-item__footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 50px;
// color: #9d9d9d; // color: #9d9d9d;
// padding-top: 19px; // padding-top: 19px;
&_default { &_default {
@ -158,4 +174,30 @@
line-height: 80px; line-height: 80px;
font-size: 26px; font-size: 26px;
} }
.toast {
position: fixed;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 400px;
height: 120px;
background: #666;
color: #fff;
border-radius: 10px;
view {
font-size: 30px;
}
&.visible {
visibility: visible;
opacity: 1;
}
}
} }

View File

@ -948,7 +948,7 @@ function CartCheckout (props) {
// : '' // : ''
return ( return (
<SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()}> <SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()} title="订单结算">
{isObjectsValue(shoppingGuideData) && ( {isObjectsValue(shoppingGuideData) && (
<View className='shopping-guide__header'> <View className='shopping-guide__header'>
此订单商品来自{shoppingGuideData.store_name}导购 {shoppingGuideData.name}的推荐 此订单商品来自{shoppingGuideData.store_name}导购 {shoppingGuideData.name}的推荐
@ -1022,7 +1022,7 @@ function CartCheckout (props) {
value={couponText || '请选择'} value={couponText || '请选择'}
/> />
)} */} )} */}
{/* {isWeixin && !bargain_id && totalInfo.invoice_status && ( {isWeixin && !bargain_id && totalInfo.invoice_status && (
<SpCell <SpCell
isLink isLink
title='开发票' title='开发票'
@ -1040,7 +1040,7 @@ function CartCheckout (props) {
</View> </View>
} }
/> />
)} */} )}
{packInfo.is_open && ( {packInfo.is_open && (
<SpCell <SpCell

View File

@ -457,7 +457,8 @@ function CartIndex () {
</View> </View>
)} )}
{validCart.length == 0 && invalidCart.length == 0 && ( {/* && invalidCart.length == 0 */}
{validCart.length == 0 && (
<View className='empty-box'> <View className='empty-box'>
{/* <SpDefault type='cart' message=''> {/* <SpDefault type='cart' message=''>
<AtButton type='primary' circle onClick={navigateTo.bind(this, '/pages/index', true)}> <AtButton type='primary' circle onClick={navigateTo.bind(this, '/pages/index', true)}>

View File

@ -724,7 +724,7 @@ export default class RecommendList extends Component {
<Video <Video
id="recommend-video" id="recommend-video"
src={`${process.env.APP_IMAGE_CDN_NEW}/recommend/162S.mp4`} src={`${process.env.APP_IMAGE_CDN_NEW}/recommend/162S.mp4`}
poster={`${process.env.APP_IMAGE_CDN_NEW}/recommend/02.jpg`} poster={`${process.env.APP_IMAGE_CDN_NEW}/recommend/poster.jpg`}
initialTime={0} initialTime={0}
controls={play} controls={play}
autoplay={false} autoplay={false}
@ -764,14 +764,14 @@ export default class RecommendList extends Component {
<View className="line"></View> <View className="line"></View>
</View> */} </View> */}
<View className="content-item"> <View className="content-item">
<SpImage height={400} width={750} src='recommend/02.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/02.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/03.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/03.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/04.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/04.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/05.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/05.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/06.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/06.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/07.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/07.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/08.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/08.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew /> <SpImage height={400} width={750} mode="aspectFill" src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
</View> </View>
</View> </View>
} }

View File

@ -191,8 +191,10 @@
} }
&--normal { &--normal {
/* prettier-ignore */ /* prettier-ignore */
border: 1PX solid #E5E5E5; // border: 1PX solid #E5E5E5;
color: #444; // color: #444;
border: 1px solid #000;
color: #000;
} }
&--default { &--default {
border-color: var(--color-primary) !important; border-color: var(--color-primary) !important;

View File

@ -14,6 +14,9 @@
border-color: #000; border-color: #000;
background-color: #fff; background-color: #fff;
} }
.at-textarea {
border-color: #00000080;
}
} }
.cancel-reason { .cancel-reason {
margin: 0 6px 0 0; margin: 0 6px 0 0;

View File

@ -72,6 +72,13 @@ export default class TradeItem extends Component {
) )
} }
// 修改地址
clickToEditAddress (choose) {
Taro.navigateTo({
url: `/marketing/pages/member/address?isSelected=${choose}`
})
}
render () { render () {
const { const {
customFooter, customFooter,
@ -134,7 +141,7 @@ export default class TradeItem extends Component {
) : null} ) : null}
<Button <Button
className='btn-action' className='btn-action'
style={`background: ${colors.data[0].primary}`} style={`background: ${colors.data[0].primary};width:120rpx`}
onClick={this.handleClickBtn.bind(this, 'pay')} onClick={this.handleClickBtn.bind(this, 'pay')}
> >
去支付 去支付

View File

@ -1188,7 +1188,7 @@ export default class TradeDetail extends Component {
<Button <Button
className='trade-detail__footer__btn trade-detail__footer_active trade-detail__footer_allWidthBtn' className='trade-detail__footer__btn trade-detail__footer_active trade-detail__footer_allWidthBtn'
type='primary' type='primary'
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}`} style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}; color: #fff;`}
loading={payLoading} loading={payLoading}
onClick={this.handleClickBtn.bind(this, 'pay')} onClick={this.handleClickBtn.bind(this, 'pay')}
> >