diff --git a/package.json b/package.json index e944196..e914f52 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,7 @@ "autoprefixer": "^10.4.14", "react": "^18.0.0", "react-dom": "^18.0.0", - "react-refresh": "^0.11.0", - "tailwindcss": "^3.3.2" + "react-refresh": "^0.11.0" }, "devDependencies": { "@babel/core": "^7.8.0", diff --git a/src/app.config.js b/src/app.config.js index 494ca02..62c02ee 100644 --- a/src/app.config.js +++ b/src/app.config.js @@ -4,6 +4,26 @@ export default defineAppConfig({ 'pages/login/index', 'pages/register/index', 'pages/forgot/index', + 'pages/goods-detail/index', + 'pages/shopping/index', + 'pages/settle/index', + 'pages/pay-success/index', + 'pages/address/index', + 'pages/address-create/index', + 'pages/change-pwd/index', + 'pages/change-phone/index', + 'pages/home/index', + 'pages/user-info/index', + 'pages/add-card/index', + 'pages/my-card/index', + 'pages/team/index', + 'pages/cash/index', + 'pages/balance/index', + 'pages/transfer/index', + 'pages/income/index', + 'pages/conversion/index', + 'pages/scope/index', + 'pages/order/index', ], window: { backgroundTextStyle: 'light', @@ -11,5 +31,12 @@ export default defineAppConfig({ navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black', navigationStyle: 'custom' - } + }, + components: [ + 'pages/index/index', + 'pages/login/index', + 'pages/register/index', + 'pages/forgot/index', + 'pages/goods-detail/index', + ] }) diff --git a/src/app.scss b/src/app.scss index 6f3a5e4..3aa2b23 100644 --- a/src/app.scss +++ b/src/app.scss @@ -4,6 +4,18 @@ color: #2196F3; } +.text-gold { + color: #F67952 +} + +.text96c { + color: #F96C6C; +} + +.text853 { + color: #34A853; +} + .text-base { font-size: 16px; line-height: 24px; @@ -24,6 +36,10 @@ text-align: right; } +.t14 { + font-size: 14px; +} + .grid { display: grid; @@ -76,10 +92,18 @@ margin-left: 30px; } +.ml17 { + margin-left: 17px; +} + .mt-8 { margin-top: 32px; } +.mt20 { + margin-top: 20px; +} + .mt-22 { margin-top: 22px; } @@ -98,4 +122,74 @@ .bottom-16 { bottom: 16px; +} + +.columns-2 { + columns: 2; +} + +.top-10 { + top: 10px +} + +.left-10 { + left: 10px; +} + +.next-icon { + width: 6px; + height: 10px; +} + +.bt-none { + border-bottom: none !important +} + + +.nav-icon { + background: #FFFFFF; + box-shadow: 0px 16px 50px 0px rgba(49, 79, 124, 0.08); + border-radius: 16px 16px 16px 16px; +} + +.addr-detail-title { + width: 100vw; + height: 60px; + font-size: 18px; + font-weight: bold; + color: #1F2933; + line-height: 60px; + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} + +.flex-between { + display: flex; + justify-content: space-between; + align-items: center; +} + +.flex-center { + display: flex; + justify-content: center; + align-items: center; +} + +.flex-start { + display: flex; + justify-content: flex-start; + align-items: center; +} + +.flex-around { + display: flex; + justify-content: space-around; + align-items: center; +} + +.flex-col { + display: flex; + flex-direction: column; } \ No newline at end of file diff --git a/src/assets/images/addr.png b/src/assets/images/addr.png new file mode 100644 index 0000000..e8fae95 Binary files /dev/null and b/src/assets/images/addr.png differ diff --git a/src/assets/images/bal.png b/src/assets/images/bal.png new file mode 100644 index 0000000..b915c7a Binary files /dev/null and b/src/assets/images/bal.png differ diff --git a/src/assets/images/cart1.png b/src/assets/images/cart1.png index b5d67d4..6a1a57e 100644 Binary files a/src/assets/images/cart1.png and b/src/assets/images/cart1.png differ diff --git a/src/assets/images/delivery.png b/src/assets/images/delivery.png new file mode 100644 index 0000000..16e0f06 Binary files /dev/null and b/src/assets/images/delivery.png differ diff --git a/src/assets/images/done.png b/src/assets/images/done.png new file mode 100644 index 0000000..d30c21a Binary files /dev/null and b/src/assets/images/done.png differ diff --git a/src/assets/images/edit.png b/src/assets/images/edit.png new file mode 100644 index 0000000..f85b6e3 Binary files /dev/null and b/src/assets/images/edit.png differ diff --git a/src/assets/images/empty.png b/src/assets/images/empty.png new file mode 100644 index 0000000..868c0f0 Binary files /dev/null and b/src/assets/images/empty.png differ diff --git a/src/assets/images/eye.png b/src/assets/images/eye.png new file mode 100644 index 0000000..f4333b5 Binary files /dev/null and b/src/assets/images/eye.png differ diff --git a/src/assets/images/friend.png b/src/assets/images/friend.png new file mode 100644 index 0000000..4ac76f2 Binary files /dev/null and b/src/assets/images/friend.png differ diff --git a/src/assets/images/home.png b/src/assets/images/home.png new file mode 100644 index 0000000..8583a7f Binary files /dev/null and b/src/assets/images/home.png differ diff --git a/src/assets/images/income.png b/src/assets/images/income.png new file mode 100644 index 0000000..eacb345 Binary files /dev/null and b/src/assets/images/income.png differ diff --git a/src/assets/images/level1.png b/src/assets/images/level1.png new file mode 100644 index 0000000..8867641 Binary files /dev/null and b/src/assets/images/level1.png differ diff --git a/src/assets/images/level2.png b/src/assets/images/level2.png new file mode 100644 index 0000000..efbe8e9 Binary files /dev/null and b/src/assets/images/level2.png differ diff --git a/src/assets/images/mall.png b/src/assets/images/mall.png new file mode 100644 index 0000000..4a0f7a7 Binary files /dev/null and b/src/assets/images/mall.png differ diff --git a/src/assets/images/message.png b/src/assets/images/message.png new file mode 100644 index 0000000..ebe16f6 Binary files /dev/null and b/src/assets/images/message.png differ diff --git a/src/assets/images/next.png b/src/assets/images/next.png new file mode 100644 index 0000000..c84f17b Binary files /dev/null and b/src/assets/images/next.png differ diff --git a/src/assets/images/paysuccess.png b/src/assets/images/paysuccess.png new file mode 100644 index 0000000..ca0a24b Binary files /dev/null and b/src/assets/images/paysuccess.png differ diff --git a/src/assets/images/scope.png b/src/assets/images/scope.png new file mode 100644 index 0000000..26f3cfc Binary files /dev/null and b/src/assets/images/scope.png differ diff --git a/src/assets/images/setting.png b/src/assets/images/setting.png new file mode 100644 index 0000000..620c927 Binary files /dev/null and b/src/assets/images/setting.png differ diff --git a/src/assets/images/team.png b/src/assets/images/team.png new file mode 100644 index 0000000..23819b1 Binary files /dev/null and b/src/assets/images/team.png differ diff --git a/src/assets/images/uncheck.png b/src/assets/images/uncheck.png new file mode 100644 index 0000000..65e625f Binary files /dev/null and b/src/assets/images/uncheck.png differ diff --git a/src/assets/images/user1.png b/src/assets/images/user1.png new file mode 100644 index 0000000..0b2a2fd Binary files /dev/null and b/src/assets/images/user1.png differ diff --git a/src/assets/images/waitpay.png b/src/assets/images/waitpay.png new file mode 100644 index 0000000..6ef7339 Binary files /dev/null and b/src/assets/images/waitpay.png differ diff --git a/src/components/action.jsx b/src/components/action.jsx index e04ee40..91cebbd 100644 --- a/src/components/action.jsx +++ b/src/components/action.jsx @@ -4,26 +4,31 @@ import { View } from '@tarojs/components'; import cart from '@/images/cart.png' import cart1 from '@/images/cart1.png' import home1 from '@/images/home1.png' +import home from '@/images/home.png' import user from '@/images/user.png' +import user1 from '@/images/user1.png' import './action.scss' import { useState } from 'react'; import Taro from '@tarojs/taro' +import { useRouter } from '@tarojs/taro'; -const home = home1 const TabbarAction = (props = {}) => { - + const router = useRouter() const { index = 0 } = props const [activeIndex, setActiveIndex] = useState(index) const onSwitch = (_, id) => { + if (activeIndex == id) { + return + } setActiveIndex(id) if (id === 0) { nav('/pages/index/index') } else if (id === 1) { - nav('/pages/goods/index') + nav('/pages/shopping/index') } else if (id === 2) { nav('/pages/home/index') } @@ -37,7 +42,7 @@ const TabbarAction = (props = {}) => { return - diff --git a/src/pages/add-card/index.config.js b/src/pages/add-card/index.config.js new file mode 100644 index 0000000..225744a --- /dev/null +++ b/src/pages/add-card/index.config.js @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '我的团队' +}) diff --git a/src/pages/add-card/index.jsx b/src/pages/add-card/index.jsx new file mode 100644 index 0000000..4584f38 --- /dev/null +++ b/src/pages/add-card/index.jsx @@ -0,0 +1,113 @@ +import { Image, Input, Text, View } from "@tarojs/components" +import back from '@/images/back.png' +import checked from '@/images/checked.png' +import eyeClose from '@/images/eyeClose.png' +import eye from '@/images/eye.png' +import './index.scss' +import { Button } from "@nutui/nutui-react-taro" +import { useState } from "react" +import Taro from "@tarojs/taro" +import backNav from '@/images/backNav.png' + +const activeEye = eye + +const Login = () => { + + const [account, setAccount] = useState('') + const [pwd, setPwd] = useState() + const [loginMode, setLoginMode] = useState('account') + + const [mobile, setMobile] = useState('') + const [smsCode, setSmsCode] = useState('') + const [interval, setIntervalTime] = useState(0) + + + // 返回页面 + const backFn = () => { + Taro.getCurrentPages().length > 0 && Taro.navigateBack() + } + + + // 去登陆 + const loginFn = () => { + Taro.redirectTo({ + url: '/pages/login/index' + }) + } + + //清理数据 + const cleanFn = () => { + if (loginMode === 'account') { + setAccount('') + setPwd('') + return + } + setMobile('') + setSmsCode('') + } + + // 倒计时 + const countDown = () => { + if (!mobile) { + return + } + setIntervalTime(60) + if (interval > 0) { + return + } + let start = 60 + const timer = setInterval(() => { + if (start > 0) { + start-- + if (start <= 0) { + clearInterval(timer) + } + setIntervalTime(start) + } + }, 1000) + } + + return + + + 添加银行卡 + + + + + + 银行卡号 + + { + setAccount(v.detail.value) + }} /> + { + account && + } + + + + + 银行名称 + + { + setPwd(v.detail.value) + }} /> + { + pwd && + } + + + + + + + + + + + +} + + +export default Login \ No newline at end of file diff --git a/src/pages/add-card/index.scss b/src/pages/add-card/index.scss new file mode 100644 index 0000000..eb2ee2c --- /dev/null +++ b/src/pages/add-card/index.scss @@ -0,0 +1,117 @@ +.login-header { + height: 86px; +} + +.login-frame { + height: auto; + font-size: 14px; + background: #FBFBFD; + font-family: Source Han Sans CN-Bold, Source Han Sans CN; +} + +.change-pwd-container { + width: 375px; + height: calc(100vh - 86px); + border-radius: 20px 20px 0 0; + box-shadow: 0px 8px 51px 0px rgba(230, 234, 238, 0.8); + box-sizing: border-box; + padding: 20px 30px; +} + +.form-item { + height: 68px; + opacity: 1; +} + +.form-label { + font-size: 12px; + font-weight: bold; + font-family: Source Han Sans CN-Bold, Source Han Sans CN; + color: #2a2b2d; + line-height: 16px; +} + +.form-input>.weui-input { + border: none; + height: 52px; + line-height: 52px; + border-bottom: 1px solid #262A34; + position: relative; + font-size: 16px; + color: #000; +} + +.form-input>.weui-input:focus { + border-bottom: 2px solid #F67952; +} + +.form-input-placeholder, +.form-input>.weui-input::placeholder { + font-size: 16px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: bold; + color: #aeafb4; +} + +.form-control { + height: 52px; + position: relative; +} + +.forgot-password { + height: 24px; + font-size: 16px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #666; + line-height: 24px; + + text-align: right; +} + + +.login-btn { + width: 253px; + height: 55px; + background: #F67952; + border-radius: 68px 68px 68px 68px; + opacity: 1; + border: none; + color: white; + font-size: 16px; + font-family: Source Han Sans CN-Bold, Source Han Sans CN; + font-weight: bold; +} + +.change-phone-footer { + margin-top: 150px; + display: flex; + flex-direction: column; + align-items: center; +} + +.quick-login { + font-size: 16px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #000000; + line-height: 24px; + margin-top: 30px; +} + +.code-btn { + width: 83px; + height: 30px; + background: #F67952; + border-radius: 4px 4px 4px 4px; + opacity: 1; + font-size: 12px; + font-family: Source Han Sans CN-Bold, Source Han Sans CN; + font-weight: bold; + color: #FFFFFF; + border: none; + padding: 0; + position: absolute; + right: 0; + bottom: 12px; +} \ No newline at end of file diff --git a/src/pages/address-create/index.config.js b/src/pages/address-create/index.config.js new file mode 100644 index 0000000..299a639 --- /dev/null +++ b/src/pages/address-create/index.config.js @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '编辑地址' +}) diff --git a/src/pages/address-create/index.jsx b/src/pages/address-create/index.jsx new file mode 100644 index 0000000..c6959e4 --- /dev/null +++ b/src/pages/address-create/index.jsx @@ -0,0 +1,167 @@ +import React from 'react' +import { Image, Text, View, Input, Label } from '@tarojs/components' +import './index.scss' + +import { useEffect } from 'react'; +import { useState } from 'react'; +import backNav from '@/images/backNav.png' +import next from '@/images/next.png' +import uncheck from '@/images/uncheck.png' +import checked from '@/images/checked.png' +import Taro from '@tarojs/taro'; +import { useRouter } from '@tarojs/taro'; +import { Button, Textarea, Address } from '@nutui/nutui-react-taro'; + + + +function Index() { + + const param = useRouter().params + const [id] = useState(param.id) + const [home] = useState(param.home) + const [addrId, setAddrId] = useState(0) + const [isDefault, setIsDefault] = useState(false) + const [user, setUser] = useState('') + const [phone, setPhone] = useState('') + const [addrInfo, setAddrInfo] = useState('') + + + const [text, setText] = useState('请选择地址') + const [normal, setNormal] = useState(false) + const [province, setProvince] = useState([ + { id: 1, name: '北京', title: 'B' }, + { id: 2, name: '广西', title: 'G' }, + { id: 3, name: '江西', title: 'J' }, + { id: 4, name: '四川', title: 'S' }, + { id: 5, name: '浙江', title: 'Z' }, + ]) + + const [city, setCity] = useState([]) + + const [country, setCountry] = useState([]) + const [town, setTown] = useState([]) + + const [address, setAddress] = useState({ + province, + city, + country, + town, + }) + + const onChange = (cal) => { + setTimeout(() => { + switch (cal.next) { + case 'city': + setCity([ + { id: 7, name: '朝阳区', title: 'C' }, + { id: 8, name: '崇文区', title: 'C' }, + { id: 9, name: '昌平区', title: 'C' }, + { id: 6, name: '石景山区', title: 'S' }, + { id: 3, name: '八里庄街道', title: 'B' }, + { id: 10, name: '北苑', title: 'B' }, + ]) + break; + case 'country': + setCountry([ + { id: 3, name: '八里庄街道', title: 'B' }, + { id: 9, name: '北苑', title: 'B' }, + { id: 4, name: '常营乡', title: 'C' }, + ]) + break; + default: + setNormal(false) + } + }, 200) + } + const close = (val) => { + console.log(val, "Data") + setNormal(false) + + if (val.data && !!val.data.addressStr) { + setText((val.data).addressStr) + setAddress({ province: val.data.province, city: val.data.city, country: val.data.country, town: val.data.town }) + } + } + + + useEffect(() => { + + + }, [id]) + + + // 跳转 + const navDetailFn = (id) => { + Taro.navigateTo({ + url: `/pages/pay-success/index?id=${id}` + }) + } + // 返回页面 + const backFn = () => { + Taro.getCurrentPages().length > 0 && Taro.navigateBack() + } + + return ( + + + + { + home ? '我的地址' : "新增地址" + } + + + + + + + 收货人 + { + setUser(e.detail.value) + }} /> + + + 电话 + { + setPhone(e.detail.value) + }} /> + + + 所在地区 + { setNormal(true) }}> + + + + + + 详细地址 + +