Compare commits

..

No commits in common. "57e9bff831a3fdecf1fdedd2ed45eadf2b98b2f2" and "5be40135c3cf05cd44efc06d381bb4e1a7d6918d" have entirely different histories.

20 changed files with 71 additions and 132 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import { Image, Input, Text, View } from "@tarojs/components" import { Image, Input, Text, View } from "@tarojs/components"
import back from '@/images/back.png' import back from '@/images/back.png'
import empty from '@/images/empty.png' import checked from '@/images/checked.png'
import teamIcon from '@/images/teamIcon.png' import teamIcon from '@/images/teamIcon.png'
import eye from '@/images/eye.png' import eye from '@/images/eye.png'
import './index.scss' import './index.scss'
@ -12,7 +12,6 @@ import { Avatar } from "@nutui/nutui-react-taro"
import { invitedAreas, invitedUser, userDetail } from "../../utils/api" import { invitedAreas, invitedUser, userDetail } from "../../utils/api"
import { useEffect } from "react" import { useEffect } from "react"
import { formatDateByStr } from "../../utils/utils" import { formatDateByStr } from "../../utils/utils"
import { Infiniteloading } from "@nutui/nutui-react-taro"
const activeEye = eye const activeEye = eye
@ -21,33 +20,22 @@ const Login = () => {
const [user, setUser] = useState({}) const [user, setUser] = useState({})
const [list, setList] = useState([]) const [list, setList] = useState([])
const [areas, setAreas] = useState({}) const [areas, setAreas] = useState({})
const [total, setTotal] = useState(0)
const [page, setPage] = useState(1)
useEffect(() => { useEffect(() => {
userDetail().then(rs => { userDetail().then(rs => {
if (!rs) return if (!rs) return
setUser(rs) setUser(rs)
}) })
invitedUser().then(rs => {
if (!rs) return
setList(rs.items ?? [])
})
invitedAreas().then(rs => { invitedAreas().then(rs => {
if (!rs) return if (!rs) return
setAreas(rs) 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 = () => { const backFn = () => {
Taro.getCurrentPages().length > 0 && Taro.navigateBack() Taro.getCurrentPages().length > 0 && Taro.navigateBack()
@ -85,20 +73,6 @@ const Login = () => {
<View className="invite-container flex-col items-start"> <View className="invite-container flex-col items-start">
<View className="invite-title">我邀请的人</View> <View className="invite-title">我邀请的人</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 => { list.map(item => {
return <View className="invite-item flex-between" key={item.id}> return <View className="invite-item flex-between" key={item.id}>
@ -116,12 +90,6 @@ const Login = () => {
</View> </View>
}) })
} }
</Infiniteloading>
}
{
!list.length && <Image src={empty} className="order-empty" />
}
</View>
</View> </View>
</View> </View>
</View> </View>

View File

@ -34,7 +34,6 @@
border-radius: 16px 16px 16px 16px; border-radius: 16px 16px 16px 16px;
opacity: 1; opacity: 1;
margin-top: 16px; margin-top: 16px;
padding: 10px 0;
} }
.team-pre-item { .team-pre-item {
@ -64,7 +63,7 @@
width: 332px; width: 332px;
height: 82px; height: 82px;
background: #FFFFFF; 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; border-radius: 16px 16px 16px 16px;
opacity: 1; opacity: 1;
margin-top: 16px; margin-top: 16px;
@ -98,9 +97,3 @@
background-clip: text; background-clip: text;
color: transparent; 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' /> <Image src={next} className='next-icon' />
</View> </View>
</View> </View>
<View className='userInfo-form' onClick={() => { !user.is_city_partner && navigateTo('/pages/city-partant/index') }}> <View className='userInfo-form' onClick={() => { navigateTo('/pages/my-card/index') }}>
<View className='userInfo-form-name'>申请城市合伙人</View> <View className='userInfo-form-name'>申请城市合伙人</View>
<View className='flex justify-between items-center ' > <View className='flex justify-between items-center ' >
<Image src={next} className='next-icon' /> <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 }) return await put(`/users/profile/fields`, { field, value })
} }
export const invitedUser = async (data) => { export const invitedUser = async () => {
return await g(`/users/teams/invited-users`, data) return await g(`/users/teams/invited-users`)
} }
export const invitedAreas = async () => { export const invitedAreas = async () => {

View File

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