Compare commits

..

3 Commits

Author SHA1 Message Date
tangping
57e9bff831 变更待收货状态 2023-06-12 22:43:31 +08:00
tangping
b9331e98e0 fix bug 2023-06-08 22:05:27 +08:00
tangping
bb36af3684 fix bug 2023-06-08 22:05:08 +08:00
20 changed files with 132 additions and 71 deletions

View File

@ -18,6 +18,7 @@ const Login = () => {
const [account, setAccount] = useState('')
const [user, setUser] = useState('')
const [accountNumber, setAccountNumber] = useState()
const [disable, setDisable] = useState(false)
//
@ -27,16 +28,19 @@ const Login = () => {
const submit = () => {
setDisable(true)
if (!account || !accountNumber || !user) {
setDisable(false)
errorNotice('请完善银行卡信息')
return
}
if (account.length > 10) {
console.log(account.length, account, "dd")
setDisable(false)
errorNotice('银行名称不能超过10个字符')
return
}
if (accountNumber.length < 10) {
setDisable(false)
errorNotice('银行卡号不能小于10个字符')
return
}
@ -50,9 +54,7 @@ const Login = () => {
closeLoading()
if (!re) return
successNotice('银行卡添加成功')
setTimeout(() => {
backFn()
}, 1000)
backFn()
}
@ -101,7 +103,7 @@ const Login = () => {
</View>
<View className="change-phone-footer flex flex-col justify-center">
<Button className="login-btn" onClick={submit}>保存</Button>
<Button className="login-btn" onClick={submit} disabled={disable}>保存</Button>
</View>
</View>

View File

@ -62,7 +62,6 @@ function Index() {
const data = re.items.filter(item => item.id == id)
if (data.length < 1) return
const addr = data[0]
console.log(addr)
setAddrId([addr.province_id, addr.city_id, addr.county_id])
setText(`${addr.province.name}${addr.city.name}${addr.county.name}`)
setAddrInfo(addr.address)
@ -80,6 +79,9 @@ function Index() {
setCountry(r.items)
})
}
if (addr.is_default) {
setIsDefault(addr.is_default)
}
})
}, [id])
@ -124,8 +126,13 @@ function Index() {
return
}
if (user.length < 2) {
errorNotice('收货人姓名不能小于2个字符')
return
}
if (addrInfo.length < 6) {
errorNotice('详细地址信息错误')
errorNotice('详细地址信息不能小于6个字符')
return
}

View File

@ -39,6 +39,10 @@ function Index() {
}
}, [id, ref])
useDidShow(() => {
setRef(ref + 1)
})
//
const navDetailFn = (id) => {

View File

@ -40,9 +40,10 @@ const Login = () => {
}
useEffect(() => {
if (total <= list.length && list.length > 0) return
let offset = (page - 1) * limit
userLogs('score', offset, limit).then(rs => {
if (!rs) return
userLogs('score', { offset, limit }).then(rs => {
if (!rs || rs.items.length == 0) return
setList(it => [...it, ...rs.items])
setTotal(rs.total)
})
@ -91,7 +92,7 @@ const Login = () => {
!!list.length && <Infiniteloading
containerId="balanceScroll"
useWindow={false}
loadTxt="loading"
loadTxt="正在加载中,请稍后..."
loadMoreTxt="没有数据啦~"
loadIcon='loading'
hasMore={total >= list.length}

View File

@ -8,7 +8,7 @@ import { Button } from "@nutui/nutui-react-taro"
import { useState } from "react"
import Taro from "@tarojs/taro"
import backNav from '@/images/backNav.png'
import { phoneManage } from "../../utils/api"
import { phoneManage, sendCode } from "../../utils/api"
import { closeLoading, errorNotice, loading, redirectTo, successNotice } from "../../utils/utils"
const activeEye = eye
@ -31,7 +31,7 @@ const Login = () => {
//
const countDown = () => {
const countDown = async () => {
if (!account) {
return
}
@ -49,6 +49,9 @@ const Login = () => {
setIntervalTime(start)
}
}, 1000)
const re = await sendCode(account)
if (!re) return
Taro.showToast({ title: '验证码发送成功', icon: 'success' })
}
const submit = async () => {

View File

@ -9,7 +9,7 @@ import { useState } from "react"
import Taro from "@tarojs/taro"
import backNav from '@/images/backNav.png'
import { closeLoading, errorNotice, loading, successNotice } from "../../utils/utils"
import { pwdManage } from "../../utils/api"
import { pwdManage, sendCode } from "../../utils/api"
const activeEye = eye
@ -30,7 +30,7 @@ const Login = () => {
}
//
const countDown = () => {
const countDown = async () => {
if (!account) {
return
}
@ -48,6 +48,9 @@ const Login = () => {
setIntervalTime(start)
}
}, 1000)
const re = await sendCode(account)
if (!re) return
Taro.showToast({ title: '验证码发送成功', icon: 'success' })
}
const submit = async () => {

View File

@ -38,17 +38,6 @@ const Login = () => {
})
}
//
const cleanFn = () => {
if (loginMode === 'account') {
setAccount('')
setPwd('')
return
}
setMobile('')
setSmsCode('')
}
//
const countDown = async () => {
if (!account) {
@ -68,7 +57,7 @@ const Login = () => {
setIntervalTime(start)
}
}, 1000)
const re = await sendCode(mobile)
const re = await sendCode(account)
if (!re) return
Taro.showToast({ title: '验证码发送成功', icon: 'success' })
}

View File

@ -101,7 +101,7 @@ const Index = () => {
<Text>待发货</Text>
</View>
<View className='flex-col my-order-tool-item' onClick={() => {
navigateTo('/pages/order/index?state=sent')
navigateTo('/pages/order/index?state=send')
}}>
<View className="relative my-order-tool-box">
<Image className='my-order-tool-icon' src={delivery} />

View File

@ -39,9 +39,10 @@ const Login = () => {
}
useEffect(() => {
if (total <= list.length && list.length > 0) return
let offset = (page - 1) * limit
userLogs('profit', offset, limit).then(rs => {
if (!rs) return
userLogs('profit', { offset, limit }).then(rs => {
if (!rs || rs.items.length == 0) return
setList(it => [...it, ...rs.items])
setTotal(rs.total)
})

View File

@ -67,7 +67,7 @@ const Login = () => {
</View>
})
}
<View className="change-phone-footer flex flex-col justify-center">
<View className="my-card-footer flex flex-col justify-center">
<Button className="login-btn" onClick={navCreate}>新增银行</Button>
</View>

View File

@ -31,13 +31,12 @@
}
.change-phone-footer {
.my-card-footer {
margin-top: 150px;
display: flex;
flex-direction: column;
align-items: center;
position: fixed;
bottom: 60px;
}

View File

@ -95,7 +95,7 @@ function Index() {
</View>
<View className='order-detail-price-container'>
<View>总价</View>
<View className='order-detail-price-p'>¥1{detail.amount}</View>
<View className='order-detail-price-p'>¥{detail.amount}</View>
</View>
</View>

View File

@ -36,11 +36,20 @@ const Login = () => {
state = ''
}
orderList(chanel, { state, offset, limit }).then(re => {
setList(it => [...it, ...re.items])
let ls = [...list, ...re.items]
if (page == 1) {
ls = re.items
}
setList(ls)
setTotal(re.total)
})
}, [tabKey, page])
const changeTab = (key) => {
setPage(1)
setTabKey(key)
}
return <View className="order-frame bg-slate-50 h-screen text-base">
<View className='addr-detail-title'>
@ -51,10 +60,10 @@ const Login = () => {
<View className="order-container relative">
<View className="order-tabs flex-around">
<View className={'order-tab-pane ' + (tabKey == '0' ? 'order-tab-pane-active' : '')} onClick={() => setTabKey('0')}>全部</View>
<View className={'order-tab-pane ' + (tabKey == 'paid' ? 'order-tab-pane-active' : '')} onClick={() => setTabKey('paid')}>待发货</View>
<View className={'order-tab-pane ' + (tabKey == 'sent' ? 'order-tab-pane-active' : '')} onClick={() => setTabKey('sent')}>已发货</View>
<View className={'order-tab-pane ' + (tabKey == 'received' ? 'order-tab-pane-active' : '')} onClick={() => setTabKey('received')}>已收货</View>
<View className={'order-tab-pane ' + (tabKey == '0' ? 'order-tab-pane-active' : '')} onClick={() => changeTab('0')}>全部</View>
<View className={'order-tab-pane ' + (tabKey == 'paid' ? 'order-tab-pane-active' : '')} onClick={() => changeTab('paid')}>待发货</View>
<View className={'order-tab-pane ' + (tabKey == 'send' ? 'order-tab-pane-active' : '')} onClick={() => changeTab('send')}>已发货</View>
<View className={'order-tab-pane ' + (tabKey == 'received' ? 'order-tab-pane-active' : '')} onClick={() => changeTab('received')}>已收货</View>
</View>
<View className="orderScroll" id="orderScroll">
{

View File

@ -64,6 +64,7 @@ const Login = () => {
}
Taro.showLoading({ title: '正在注册中~', })
const inviteCode = GetData("inviteCode")
const c = inviteCode ? inviteCode : ''
const re = await register({
nick_name: mobile,
phone: mobile,
@ -72,8 +73,9 @@ const Login = () => {
confirm_password: confirmPassword,
pay_password: payPassword,
confirm_pay_pwd: confirmPayPassword,
invite_code: inviteCode
invite_code: c
})
Taro.hideLoading()
if (re) {
Taro.showToast({ title: '注册成功', icon: 'success' })

View File

@ -13,6 +13,7 @@ import { Tabs, TabPane } from "@nutui/nutui-react-taro"
import { Infiniteloading } from "@nutui/nutui-react-taro"
import { useEffect } from "react"
import { userDetail, userLogs } from "../../utils/api"
import { formatDateByStr } from "../../utils/utils"
const activeEye = eye
@ -37,9 +38,10 @@ const Login = () => {
}
useEffect(() => {
if (total <= list.length && list.length > 0) return
let offset = (page - 1) * limit
userLogs('shopping_score', offset, limit).then(rs => {
if (!rs) return
userLogs('shopping_score', { offset, limit }).then(rs => {
if (!rs || rs.items.length == 0) return
setList(it => [...it, ...rs.items])
setTotal(rs.total)
})

View File

@ -1,6 +1,6 @@
import { Image, Input, Text, View } from "@tarojs/components"
import back from '@/images/back.png'
import checked from '@/images/checked.png'
import empty from '@/images/empty.png'
import teamIcon from '@/images/teamIcon.png'
import eye from '@/images/eye.png'
import './index.scss'
@ -12,6 +12,7 @@ import { Avatar } from "@nutui/nutui-react-taro"
import { invitedAreas, invitedUser, userDetail } from "../../utils/api"
import { useEffect } from "react"
import { formatDateByStr } from "../../utils/utils"
import { Infiniteloading } from "@nutui/nutui-react-taro"
const activeEye = eye
@ -20,22 +21,33 @@ const Login = () => {
const [user, setUser] = useState({})
const [list, setList] = useState([])
const [areas, setAreas] = useState({})
const [total, setTotal] = useState(0)
const [page, setPage] = useState(1)
useEffect(() => {
userDetail().then(rs => {
if (!rs) return
setUser(rs)
})
invitedUser().then(rs => {
if (!rs) return
setList(rs.items ?? [])
})
invitedAreas().then(rs => {
if (!rs) return
setAreas(rs)
})
}, [])
useEffect(() => {
console.log(page)
if (total <= list.length && list.length > 0) return
let offset = (page - 1) * 20
invitedUser({ offset, limit: 20 }).then(rs => {
if (!rs || rs.items.length == 0) return
setList(it => [...it, ...rs.items])
setTotal(rs.total)
})
}, [page])
//
const backFn = () => {
Taro.getCurrentPages().length > 0 && Taro.navigateBack()
@ -59,7 +71,7 @@ const Login = () => {
<Text className="team-logo-text">我的等级</Text>
</View>
<View className="team-pre-container flex-around">
<View className="team-pre-container flex-around">
<View className="team-pre-item flex-col justify-center items-center">
<Text className="team-pre-price">{areas.largest}</Text>
<Text>大区业绩</Text>
@ -73,23 +85,43 @@ const Login = () => {
<View className="invite-container flex-col items-start">
<View className="invite-title">我邀请的人</View>
{
list.map(item => {
return <View className="invite-item flex-between" key={item.id}>
<View className="invite-item-left flex-start items-center">
<Avatar size={42} icon={item.avatar} alt={item.nick_name}
/>
<View className="flex-col invite-item-content">
<Text>{item.nick_name}</Text>
<Text className="team-pre-item">{formatDateByStr(item.created_at)}</Text>
</View>
</View>
<View className="invite-level">
<Text className="invite-level-text">{item.user_level?.name}</Text>
</View>
</View>
})
}
<View id='invite-user' className="invite-user-list">
{
!!list.length && <Infiniteloading
containerId="invite-user"
useWindow={false}
loadTxt="loading"
loadMoreTxt="没有数据啦~"
loadIcon='loading'
hasMore={total >= list.length}
onLoadMore={(x) => {
setPage(p => p + 1)
x()
}}
>
{
list.map(item => {
return <View className="invite-item flex-between" key={item.id}>
<View className="invite-item-left flex-start items-center">
<Avatar size={42} icon={item.avatar} alt={item.nick_name}
/>
<View className="flex-col invite-item-content">
<Text>{item.nick_name}</Text>
<Text className="team-pre-item">{formatDateByStr(item.created_at)}</Text>
</View>
</View>
<View className="invite-level">
<Text className="invite-level-text">{item.user_level?.name}</Text>
</View>
</View>
})
}
</Infiniteloading>
}
{
!list.length && <Image src={empty} className="order-empty" />
}
</View>
</View>
</View>
</View>

View File

@ -34,6 +34,7 @@
border-radius: 16px 16px 16px 16px;
opacity: 1;
margin-top: 16px;
padding: 10px 0;
}
.team-pre-item {
@ -63,7 +64,7 @@
width: 332px;
height: 82px;
background: #FFFFFF;
box-shadow: -2px 8px 46px 0px rgba(37, 45, 50, 0.05);
// box-shadow: -2px 8px 46px 0px rgba(37, 45, 50, 0.05);
border-radius: 16px 16px 16px 16px;
opacity: 1;
margin-top: 16px;
@ -96,4 +97,10 @@
background: linear-gradient(297deg, #FCA12D 0%, #FEF9F8 100%);
background-clip: text;
color: transparent;
}
.invite-user-list {
background: none;
height: calc(100vh - 300px - 40px);
}

View File

@ -126,7 +126,7 @@ function Index() {
<Image src={next} className='next-icon' />
</View>
</View>
<View className='userInfo-form' onClick={() => { navigateTo('/pages/my-card/index') }}>
<View className='userInfo-form' onClick={() => { !user.is_city_partner && navigateTo('/pages/city-partant/index') }}>
<View className='userInfo-form-name'>申请城市合伙人</View>
<View className='flex justify-between items-center ' >
<Image src={next} className='next-icon' />

View File

@ -104,8 +104,8 @@ export const modifyUser = async (field, value) => {
return await put(`/users/profile/fields`, { field, value })
}
export const invitedUser = async () => {
return await g(`/users/teams/invited-users`)
export const invitedUser = async (data) => {
return await g(`/users/teams/invited-users`, data)
}
export const invitedAreas = async () => {

View File

@ -2,13 +2,13 @@ import Taro from "@tarojs/taro"
export const orderState = new Map([
['paid', '待发货'],
['sent', '已发货'],
['send', '已发货'],
['received', '已收货'],
])
export const orderStateNotice = new Map([
['paid', '请耐心等待'],
['sent', '请耐心等待'],
['send', '请耐心等待'],
['received', ''],
])