订单售后

This commit is contained in:
czm 2022-06-08 14:40:07 +08:00
parent c76d6f6448
commit 2c5c3a8ae3
11 changed files with 263 additions and 84 deletions

View File

@ -6,6 +6,7 @@
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境 // export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境 // export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞

View File

@ -1,5 +1,5 @@
import { ScrollView, View } from "@tarojs/components" 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 style from "./index.module.scss"
import DotLoading from "@/components/dotLoading" import DotLoading from "@/components/dotLoading"
import LoadingCard from "../loadingCard" import LoadingCard from "../loadingCard"
@ -64,6 +64,13 @@ export default memo(({
selfOnRefresherAbort?.() selfOnRefresherAbort?.()
} }
//返回顶部
const scrollTop = useMemo(() => {
if(statusMore == 0) {
return 0.1
}
},[statusMore])
return ( return (
<> <>
<ScrollView <ScrollView
@ -81,6 +88,7 @@ export default memo(({
onRefresherRestore = {() => refresherRestore()} onRefresherRestore = {() => refresherRestore()}
onRefresherAbort = {() => refresherAbort()} onRefresherAbort = {() => refresherAbort()}
refresherBackground ='#F8F8F8' refresherBackground ='#F8F8F8'
scrollTop={scrollTop}
> >
{!moreStatus&&<> {!moreStatus&&<>
<View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}> <View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}>

View File

@ -202,6 +202,7 @@ export default ({show = false, onClose}: param) => {
} else { } else {
let ids = selectIds.current.join('-') let ids = selectIds.current.join('-')
setParam({ids, sale_mode:selectIndex}) setParam({ids, sale_mode:selectIndex})
closePopup()
goLink('/pages/order/comfirm') goLink('/pages/order/comfirm')
} }
}, 500) }, 500)

View File

@ -27,15 +27,14 @@ type param = {
export default memo(({show = false, onClose, title = '', productId = 0}: param) => { export default memo(({show = false, onClose, title = '', productId = 0}: param) => {
const {adminUserInfo} = useSelector(state => state.userInfo) const {adminUserInfo} = useSelector(state => state.userInfo)
const [selectList, setSelectList] = useState([ const [selectList, _] = useState([
{id: 0, step:1, digits:0, maxNum:100000, defaultNum:1, title:'大货', unit:'', eunit:'kg', priceField:'bulk_price'}, {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: 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'}, {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 [selectIndex, setSelectIndex] = useState(0)
const selectProduct = (index:number) => { const selectProduct = (index:number) => {
setSelectIndex(() => index) setSelectIndex(() => index)
} }
//重置数据 //重置数据
@ -144,13 +143,13 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
//添加购物车 //添加购物车
const {getSelfUserInfo} = UseLogin() const {getSelfUserInfo} = UseLogin()
const {fetchData:addFetchData} = AddShoppingCartApi() const {fetchData:addFetchData} = AddShoppingCartApi()
const addShopCart = debounce( async () => { const addShopCart = async () => {
try { try {
await getSelfUserInfo() await getSelfUserInfo()
} catch(msg) { } catch(msg) {
Taro.showToast({ Taro.showToast({
icon:'none', icon:'none',
title:msg title:'授权失败,请求完善授权'
}) })
return false return false
} }
@ -178,7 +177,7 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
}) })
} }
}, 500) }
//筛选数据 //筛选数据
const searchInput = useCallback((e) => { const searchInput = useCallback((e) => {

View File

@ -48,6 +48,7 @@ export default (props:Params) => {
useDidShow(() => { useDidShow(() => {
checkLogin() checkLogin()
judgeParam() judgeParam()
setShowCart(false)
}) })
useEffect(() => { useEffect(() => {

View File

@ -7,7 +7,7 @@ import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart' import ShopCart from '@/components/shopCart'
import { goLink } from '@/common/common' import { goLink } from '@/common/common'
import styles from './index.module.scss' 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 Taro, { Events, useDidShow, usePullDownRefresh} from '@tarojs/taro'
import {GetProductKindListApi, GetProductListApi} from '@/api/material' import {GetProductKindListApi, GetProductListApi} from '@/api/material'
import useLogin from '@/use/useLogin' import useLogin from '@/use/useLogin'
@ -56,22 +56,23 @@ export default () => {
//点击面料类型 //点击面料类型
const getProductKindId = async (e) => { const getProductKindId = useCallback((e) => {
pageNum.current.page = 1 pageNum.current.page = 1
setFiltrate({...filtrate, size:5, product_kind_id:e.id}) setProductData({list:[], total:0})
setHasMore(true) setFiltrate((list) => ({...list, size:5, product_kind_id:e.id}))
} // setHasMore(true)
}, [])
//上拉加载数据 //上拉加载数据
const getScrolltolower = () => { const getScrolltolower = useCallback(() => {
if(productData.list.length >= productData.total) { if(productData.list.length >= productData.total) {
setHasMore(false) setHasMore(false)
} else { } else {
pageNum.current.page++ pageNum.current.page++
const newSize = pageNum.current.size * 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) const [showShopCart, setShowShopCart] = useState(false)
@ -79,7 +80,7 @@ export default () => {
//列表下拉刷新 //列表下拉刷新
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getRefresherRefresh = async () => { const getRefresherRefresh = async () => {
pageNum.current.size = 1 pageNum.current.page = 1
setFiltrate({...filtrate, size:5}) setFiltrate({...filtrate, size:5})
setHasMore(true) setHasMore(true)
setRefresherTriggeredStatus(true) setRefresherTriggeredStatus(true)
@ -88,9 +89,9 @@ export default () => {
//页面下拉刷新 //页面下拉刷新
// const res = useManualPullDownRefresh() // const res = useManualPullDownRefresh()
usePullDownRefresh(() => { // usePullDownRefresh(() => {
console.log('123') // console.log('123')
}) // })
//数据加载状态 //数据加载状态
const statusMore = useMemo(() => { const statusMore = useMemo(() => {
@ -108,7 +109,7 @@ export default () => {
</View> </View>
</View> </View>
<View className={styles.products}> <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}/> <Product productList={productData.list}/>
</SideBar> </SideBar>
</View> </View>

View File

@ -116,6 +116,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, defaultValue =
<View className={styles.order_address_title}></View> <View className={styles.order_address_title}></View>
<AddressList onSelect={getAddress}/> <AddressList onSelect={getAddress}/>
</View> </View>
<View className="common_safe_area_y"></View>
</Popup> </Popup>
</View> </View>
) )

View File

@ -22,55 +22,155 @@
} }
} }
.apply_after_sales_con{ .apply_after_sales_con{
padding: 0 20px; height: 80vh;
.apply_after_sales_title{ .scroll{
display: flex; height: calc(100% - 80px);
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 { .returnSaleInput{
.color_item{ margin: 0 20px;
padding-top: 30px;
border-top: 1px solid #F6F6F6;
.returnSaleInput_item{
display: flex; display: flex;
align-items: center; align-items: center;
margin: 20px 0; padding-bottom: 20px;
} .title{
.image{ font-size: $font_size;
width: 70px; font-weight: 700;
height: 70px;
image{
width: 100%;
height: 100%;
border-radius: 50%;
} }
} .select{
.name_and_number{ flex:1;
padding-left: 30px; height: 60px;
flex:1; border: 2px solid #e6e6e6;
text{ border-radius: 10px;
&:nth-child(1) { margin-left: 20px;
font-weight: 700; display: flex;
font-size: $font_size; align-items: center;
} justify-content: space-between;
&:nth-child(2) { padding: 0 20px;
color: $color_font_two; font-size: 26px;
font-size: $font_size; color: $color_font_two;
margin-left: 20px; .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;
}
}
}
}
.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;
}
}
}
}
} }

View File

@ -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 { memo, useState } from "react";
import classnames from "classnames"; import classnames from "classnames";
import styles from './index.module.scss' import styles from './index.module.scss'
@ -10,32 +10,98 @@ export default memo(() => {
const [showDesc, setShowDesc] = useState(true) const [showDesc, setShowDesc] = useState(true)
return ( return (
<View className={styles.apply_after_sales_main}> <View className={styles.apply_after_sales_main}>
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)} > <Popup showIconButton={true} show={showDesc} showTitle={false} onClose={() => setShowDesc(false)} >
<View className={styles.apply_after_sales_head}>退</View>
<View className={styles.kind_number}><Text>236</Text></View>
<View className={styles.apply_after_sales_con}> <View className={styles.apply_after_sales_con}>
<View className={styles.apply_after_sales_title}> <View className={styles.apply_after_sales_head}>退</View>
<View className={styles.tag}></View> <View className={styles.kind_number}><Text>236</Text></View>
<View className={styles.title}>0770# 21S单面平纹()</View> <ScrollView scrollY className={styles.scroll}>
</View> <View className={styles.apply_after_sales_list}>
<View className={styles.color_list}> <View className={styles.apply_after_sales_item}>
<View className={styles.color_item}> <View className={styles.apply_after_sales_title}>
<View className={styles.image}><Image src={formatImgUrl('')}/></View> <View className={styles.tag}></View>
<View className={styles.name_and_number}><Text>1# 绿</Text><Text>x1</Text></View> <View className={styles.title}>0770# 21S单面平纹()</View>
<View className={styles.count}> </View>
<Counter/> <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>
<View className={styles.color_item}> <View className={styles.returnSaleInput}>
<View className={styles.image}><Image src={formatImgUrl('')}/></View> <View className={styles.returnSaleInput_item}>
<View className={styles.name_and_number}><Text>1# 绿</Text><Text>x1</Text></View> <View className={styles.title}>退</View>
<View className={styles.count}> <View className={styles.select}>
<Counter/> <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> </View>
</View> <View className="common_safe_area_y"></View>
</ScrollView>
</View> </View>
<View className="common_safe_area_y"></View>
</Popup> </Popup>
</View> </View>
) )

View File

@ -226,7 +226,7 @@ import styles from './index.module.scss'
<Remark onSave={(e) => getRemark(e)}/> <Remark onSave={(e) => getRemark(e)}/>
</Popup> </Popup>
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={payOrderInfo} /> <Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={payOrderInfo} />
{/* <ApplyAfterSales/> */} <ApplyAfterSales/>
<View className="common_safe_area_y"></View> <View className="common_safe_area_y"></View>
</View> </View>
) )

View File

@ -83,7 +83,8 @@ export default () => {
} }
}, },
fail:(e) => { fail:(e) => {
reject(e) console.log('授权失败::',e)
reject(e.errMsg)
} }
}) })
}) })