合并
This commit is contained in:
commit
f0cdb49ebc
@ -1,5 +1,5 @@
|
||||
import { ScrollView, View } from "@tarojs/components"
|
||||
import { memo, ReactNode, useState } from "react"
|
||||
import { memo, ReactNode, useMemo, useState } from "react"
|
||||
import style from "./index.module.scss"
|
||||
import DotLoading from "@/components/dotLoading"
|
||||
import LoadingCard from "../loadingCard"
|
||||
@ -64,6 +64,13 @@ export default memo(({
|
||||
selfOnRefresherAbort?.()
|
||||
}
|
||||
|
||||
//返回顶部
|
||||
const scrollTop = useMemo(() => {
|
||||
if(statusMore == 0) {
|
||||
return 0.1
|
||||
}
|
||||
},[statusMore])
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollView
|
||||
@ -81,6 +88,7 @@ export default memo(({
|
||||
onRefresherRestore = {() => refresherRestore()}
|
||||
onRefresherAbort = {() => refresherAbort()}
|
||||
refresherBackground ='#F8F8F8'
|
||||
scrollTop={scrollTop}
|
||||
>
|
||||
{!moreStatus&&<>
|
||||
<View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}>
|
||||
|
@ -1,7 +1,7 @@
|
||||
.btns_list{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 30px;
|
||||
// margin-top: 30px;
|
||||
.btns_item{
|
||||
width: 152px;
|
||||
height: 72px;
|
||||
|
@ -202,6 +202,7 @@ export default ({show = false, onClose}: param) => {
|
||||
} else {
|
||||
let ids = selectIds.current.join('-')
|
||||
setParam({ids, sale_mode:selectIndex})
|
||||
closePopup()
|
||||
goLink('/pages/order/comfirm')
|
||||
}
|
||||
}, 500)
|
||||
|
@ -27,15 +27,14 @@ type param = {
|
||||
export default memo(({show = false, onClose, title = '', productId = 0}: param) => {
|
||||
const {adminUserInfo} = useSelector(state => state.userInfo)
|
||||
|
||||
const [selectList, setSelectList] = useState([
|
||||
{id: 0, step:1, digits:0, maxNum:100000, defaultNum:1, title:'大货', unit:'件', eunit:'kg', priceField:'bulk_price'},
|
||||
const [selectList, _] = useState([
|
||||
{id: 0, step:1, digits:0, maxNum:100000, defaultNum:1, title:'大货', unit:'条', eunit:'kg', priceField:'bulk_price'},
|
||||
{id: 1, step:1, digits:2, maxNum:9.99, defaultNum:1, title:'剪板', unit:'米', eunit:'m', priceField:'length_cut_price'},
|
||||
{id: 2, step:1, digits:2, minNum:10, maxNum:100000, defaultNum:10, title:'散剪', unit:'米', eunit:'kg', priceField:'weight_cut_price'},
|
||||
])
|
||||
const [selectIndex, setSelectIndex] = useState(0)
|
||||
const selectProduct = (index:number) => {
|
||||
setSelectIndex(() => index)
|
||||
|
||||
}
|
||||
|
||||
//重置数据
|
||||
@ -144,13 +143,13 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
|
||||
//添加购物车
|
||||
const {getSelfUserInfo} = UseLogin()
|
||||
const {fetchData:addFetchData} = AddShoppingCartApi()
|
||||
const addShopCart = debounce( async () => {
|
||||
const addShopCart = async () => {
|
||||
try {
|
||||
await getSelfUserInfo()
|
||||
} catch(msg) {
|
||||
Taro.showToast({
|
||||
icon:'none',
|
||||
title:msg
|
||||
title:'授权失败,请求完善授权'
|
||||
})
|
||||
return false
|
||||
}
|
||||
@ -178,7 +177,7 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
|
||||
})
|
||||
}
|
||||
|
||||
}, 500)
|
||||
}
|
||||
|
||||
//筛选数据
|
||||
const searchInput = useCallback((e) => {
|
||||
|
@ -48,6 +48,7 @@ export default (props:Params) => {
|
||||
useDidShow(() => {
|
||||
checkLogin()
|
||||
judgeParam()
|
||||
setShowCart(false)
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -7,7 +7,7 @@ import MoveBtn from '@/components/moveBtn'
|
||||
import ShopCart from '@/components/shopCart'
|
||||
import { goLink } from '@/common/common'
|
||||
import styles from './index.module.scss'
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import Taro, { Events, useDidShow, usePullDownRefresh} from '@tarojs/taro'
|
||||
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
|
||||
import useLogin from '@/use/useLogin'
|
||||
@ -56,22 +56,23 @@ export default () => {
|
||||
|
||||
|
||||
//点击面料类型
|
||||
const getProductKindId = async (e) => {
|
||||
const getProductKindId = useCallback((e) => {
|
||||
pageNum.current.page = 1
|
||||
setFiltrate({...filtrate, size:5, product_kind_id:e.id})
|
||||
setHasMore(true)
|
||||
}
|
||||
setProductData({list:[], total:0})
|
||||
setFiltrate((list) => ({...list, size:5, product_kind_id:e.id}))
|
||||
// setHasMore(true)
|
||||
}, [])
|
||||
|
||||
//上拉加载数据
|
||||
const getScrolltolower = () => {
|
||||
const getScrolltolower = useCallback(() => {
|
||||
if(productData.list.length >= productData.total) {
|
||||
setHasMore(false)
|
||||
} else {
|
||||
pageNum.current.page++
|
||||
const newSize = pageNum.current.size * pageNum.current.page
|
||||
setFiltrate({...filtrate, size:newSize})
|
||||
setFiltrate((e) => ({...e, size:newSize}))
|
||||
}
|
||||
}
|
||||
}, [productData])
|
||||
|
||||
|
||||
const [showShopCart, setShowShopCart] = useState(false)
|
||||
@ -79,7 +80,7 @@ export default () => {
|
||||
//列表下拉刷新
|
||||
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
||||
const getRefresherRefresh = async () => {
|
||||
pageNum.current.size = 1
|
||||
pageNum.current.page = 1
|
||||
setFiltrate({...filtrate, size:5})
|
||||
setHasMore(true)
|
||||
setRefresherTriggeredStatus(true)
|
||||
@ -88,9 +89,9 @@ export default () => {
|
||||
|
||||
//页面下拉刷新
|
||||
// const res = useManualPullDownRefresh()
|
||||
usePullDownRefresh(() => {
|
||||
console.log('123')
|
||||
})
|
||||
// usePullDownRefresh(() => {
|
||||
// console.log('123')
|
||||
// })
|
||||
|
||||
//数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
@ -108,7 +109,7 @@ export default () => {
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.products}>
|
||||
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={() => getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
||||
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={getScrolltolower} sideBarOnClick={getProductKindId} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
||||
<Product productList={productData.list}/>
|
||||
</SideBar>
|
||||
</View>
|
||||
|
@ -116,6 +116,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, defaultValue =
|
||||
<View className={styles.order_address_title}>请选择收货地址</View>
|
||||
<AddressList onSelect={getAddress}/>
|
||||
</View>
|
||||
<View className="common_safe_area_y"></View>
|
||||
</Popup>
|
||||
</View>
|
||||
)
|
||||
|
@ -22,42 +22,155 @@
|
||||
}
|
||||
}
|
||||
.apply_after_sales_con{
|
||||
padding: 0 20px;
|
||||
.apply_after_sales_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.tag{
|
||||
font-size: $font_size_min;
|
||||
background-color: #CDE5FF;
|
||||
padding: 5px 10px;
|
||||
border-radius: 6px;
|
||||
color: $color_main;
|
||||
}
|
||||
.title{
|
||||
font-weight: 700;
|
||||
font-size: $font_size;
|
||||
margin-left: 20px;
|
||||
flex:1;
|
||||
}
|
||||
height: 80vh;
|
||||
.scroll{
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
.color_list {
|
||||
.color_item{
|
||||
.returnSaleInput{
|
||||
margin: 0 20px;
|
||||
padding-top: 30px;
|
||||
border-top: 1px solid #F6F6F6;
|
||||
.returnSaleInput_item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.image{
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
padding-bottom: 20px;
|
||||
.title{
|
||||
font-size: $font_size;
|
||||
font-weight: 700;
|
||||
}
|
||||
.select{
|
||||
flex:1;
|
||||
height: 60px;
|
||||
border: 2px solid #e6e6e6;
|
||||
border-radius: 10px;
|
||||
margin-left: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-size: 26px;
|
||||
color: $color_font_two;
|
||||
.miconfont{
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadImg{
|
||||
width: 202px;
|
||||
height: 150px;
|
||||
background: #f0f0f0;
|
||||
border: 2px dashed #cccccc;
|
||||
margin-left: 20px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
.miconfont{
|
||||
font-size: 50px;
|
||||
}
|
||||
.uploadText{
|
||||
font-size: 26px;
|
||||
color: $color_font_three;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.name_and_number{
|
||||
|
||||
}
|
||||
.other_desc{
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
.title{
|
||||
font-size: $font_size;
|
||||
font-weight: 700;
|
||||
}
|
||||
.uploadImg{
|
||||
position: relative;
|
||||
.descDataNum{
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
font-size: 22px;
|
||||
color: #ABABAB;
|
||||
}
|
||||
}
|
||||
Textarea{
|
||||
background-color: #f3f3f3;
|
||||
border: 2px solid #e6e6e6;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
font-size: 25px;
|
||||
height: 165.4px;
|
||||
padding: 20px 20px 30px 20px;
|
||||
box-sizing: border-box;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.apply_after_sales_list{
|
||||
padding: 0 20px;
|
||||
.apply_after_sales_item{
|
||||
margin-bottom: 30px;
|
||||
.apply_after_sales_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.tag{
|
||||
font-size: $font_size_min;
|
||||
background-color: #CDE5FF;
|
||||
padding: 5px 10px;
|
||||
border-radius: 6px;
|
||||
color: $color_main;
|
||||
}
|
||||
.title{
|
||||
font-weight: 700;
|
||||
font-size: $font_size;
|
||||
margin-left: 20px;
|
||||
flex:1;
|
||||
}
|
||||
}
|
||||
.color_list {
|
||||
.color_item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.image{
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.name_and_number{
|
||||
padding-left: 30px;
|
||||
flex:1;
|
||||
text{
|
||||
&:nth-child(1) {
|
||||
font-weight: 700;
|
||||
font-size: $font_size;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
color: $color_font_two;
|
||||
font-size: $font_size;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn_count{
|
||||
width: 235px;
|
||||
height: 64px;
|
||||
background-color: #ECF5FF;
|
||||
border-radius: 40px 0px 16px 0px;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Image, Text, View } from "@tarojs/components";
|
||||
import { Image, ScrollView, Text, Textarea, View } from "@tarojs/components";
|
||||
import { memo, useState } from "react";
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
@ -10,25 +10,98 @@ export default memo(() => {
|
||||
const [showDesc, setShowDesc] = useState(true)
|
||||
return (
|
||||
<View className={styles.apply_after_sales_main}>
|
||||
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)} >
|
||||
<View className={styles.apply_after_sales_head}>申请退货</View>
|
||||
<View className={styles.kind_number}><Text>2种面料,3种颜色,共6条</Text></View>
|
||||
<Popup showIconButton={true} show={showDesc} showTitle={false} onClose={() => setShowDesc(false)} >
|
||||
<View className={styles.apply_after_sales_con}>
|
||||
<View className={styles.apply_after_sales_title}>
|
||||
<View className={styles.tag}>大货</View>
|
||||
<View className={styles.title}>0770# 21S单面平纹(食毛)</View>
|
||||
</View>
|
||||
<View className={styles.color_list}>
|
||||
<View className={styles.color_item}>
|
||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||
<View className={styles.name_and_number}><Text>1# 薄荷绿</Text><Text>x1</Text></View>
|
||||
<View className={styles.name_and_number}>
|
||||
<Counter/>
|
||||
<View className={styles.apply_after_sales_head}>申请退货</View>
|
||||
<View className={styles.kind_number}><Text>2种面料,3种颜色,共6条</Text></View>
|
||||
<ScrollView scrollY className={styles.scroll}>
|
||||
<View className={styles.apply_after_sales_list}>
|
||||
<View className={styles.apply_after_sales_item}>
|
||||
<View className={styles.apply_after_sales_title}>
|
||||
<View className={styles.tag}>大货</View>
|
||||
<View className={styles.title}>0770# 21S单面平纹(食毛)</View>
|
||||
</View>
|
||||
<View className={styles.color_list}>
|
||||
<View className={styles.color_item}>
|
||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||
<View className={styles.name_and_number}><Text>1# 薄荷绿</Text><Text>x1</Text></View>
|
||||
<View className={styles.btn_count}>
|
||||
<Counter/>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.color_item}>
|
||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||
<View className={styles.name_and_number}><Text>1# 薄荷绿</Text><Text>x1</Text></View>
|
||||
<View className={styles.btn_count}>
|
||||
<Counter/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.apply_after_sales_item}>
|
||||
<View className={styles.apply_after_sales_title}>
|
||||
<View className={styles.tag}>大货</View>
|
||||
<View className={styles.title}>0770# 21S单面平纹(食毛)</View>
|
||||
</View>
|
||||
<View className={styles.color_list}>
|
||||
<View className={styles.color_item}>
|
||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||
<View className={styles.name_and_number}><Text>1# 薄荷绿</Text><Text>x1</Text></View>
|
||||
<View className={styles.btn_count}>
|
||||
<Counter/>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.color_item}>
|
||||
<View className={styles.image}><Image src={formatImgUrl('')}/></View>
|
||||
<View className={styles.name_and_number}><Text>1# 薄荷绿</Text><Text>x1</Text></View>
|
||||
<View className={styles.btn_count}>
|
||||
<Counter/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput}>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货原因</View>
|
||||
<View className={styles.select}>
|
||||
<Text>请选择</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>货物状况</View>
|
||||
<View className={styles.select}>
|
||||
<Text>请选择</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货说明</View>
|
||||
<View className={styles.select}>
|
||||
<Text>请选择</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>拍照上传</View>
|
||||
<View className={styles.uploadImg}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-saomazhifu')}></Text>
|
||||
<Text className={styles.uploadText}>上传照片</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
<View className={styles.other_desc}>
|
||||
<View className={styles.title}>其他说明</View>
|
||||
<View className={styles.uploadImg}>
|
||||
<Textarea placeholder="一般情况下选填,当退货说明=“其它问题”时,必填" cursorSpacing={100}></Textarea>
|
||||
<View className={styles.descDataNum}>0/100</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className="common_safe_area_y"></View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
<View className="common_safe_area_y"></View>
|
||||
</Popup>
|
||||
</View>
|
||||
)
|
||||
|
@ -83,7 +83,8 @@ export default () => {
|
||||
}
|
||||
},
|
||||
fail:(e) => {
|
||||
reject(e)
|
||||
console.log('授权失败::',e)
|
||||
reject(e.errMsg)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user