From 1ceaf78fb70d9da75ce42f522374bb453efb5ee0 Mon Sep 17 00:00:00 2001 From: tangping Date: Tue, 30 May 2023 01:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=AF=B9=E6=8E=A5=E5=AE=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + pnpm-lock.yaml | 41 ++++++++++ src/app.config.js | 3 +- src/app.scss | 8 ++ src/assets/images/inviteBg.png | Bin 0 -> 10504 bytes src/assets/images/qrcode.png | Bin 0 -> 1922 bytes src/assets/images/share.png | Bin 0 -> 1717 bytes src/assets/images/wechat.png | Bin 0 -> 2229 bytes src/config/config.js | 1 + src/pages/about-me/index.jsx | 17 +++-- src/pages/about-me/index.scss | 1 + src/pages/cash/index.jsx | 92 ++++++++++++++++------ src/pages/change-user/index.jsx | 76 ++++++++----------- src/pages/conversion/index.jsx | 56 +++++++------- src/pages/home/index.jsx | 6 +- src/pages/income/index.jsx | 5 +- src/pages/invite/index.config.js | 3 + src/pages/invite/index.jsx | 109 ++++++++++++++++++++++++++ src/pages/invite/index.scss | 79 +++++++++++++++++++ src/pages/message-detail/index.jsx | 21 ++++- src/pages/message-list/index.jsx | 79 ++++++++++++------- src/pages/message-list/index.scss | 1 + src/pages/order-detail/index.jsx | 8 -- src/pages/team/index.jsx | 118 +++++++++++------------------ src/pages/team/index.scss | 3 +- src/pages/user-info/index.jsx | 47 +++++++----- src/pages/user-info/index.scss | 22 +++--- src/utils/api.js | 34 +++++++++ src/utils/request.js | 44 ++++++----- 29 files changed, 610 insertions(+), 266 deletions(-) create mode 100644 src/assets/images/inviteBg.png create mode 100644 src/assets/images/qrcode.png create mode 100644 src/assets/images/share.png create mode 100644 src/assets/images/wechat.png create mode 100644 src/pages/invite/index.config.js create mode 100644 src/pages/invite/index.jsx create mode 100644 src/pages/invite/index.scss diff --git a/package.json b/package.json index cd55bb4..c0023fb 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,8 @@ "@tarojs/shared": "3.6.5", "@tarojs/taro": "3.6.5", "autoprefixer": "^10.4.14", + "html2canvas": "^1.4.1", + "jr-qrcode": "^1.1.4", "react": "^18.0.0", "react-dom": "^18.0.0", "react-refresh": "^0.11.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2284de..c1f16ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,6 +55,12 @@ dependencies: autoprefixer: specifier: ^10.4.14 version: 10.4.14(postcss@8.4.18) + html2canvas: + specifier: ^1.4.1 + version: 1.4.1 + jr-qrcode: + specifier: ^1.1.4 + version: 1.1.4 react: specifier: ^18.0.0 version: 18.0.0 @@ -4640,6 +4646,11 @@ packages: resolution: {integrity: sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==} dev: true + /base64-arraybuffer@1.0.2: + resolution: {integrity: sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==} + engines: {node: '>= 0.6.0'} + dev: false + /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -5336,6 +5347,12 @@ packages: engines: {node: '>=12.22'} dev: true + /css-line-break@2.1.0: + resolution: {integrity: sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==} + dependencies: + utrie: 1.0.2 + dev: false + /css-loader@6.7.3(webpack@5.78.0): resolution: {integrity: sha512-qhOH1KlBMnZP8FzRO6YCH9UHXQhVMcEGLyNdb7Hv2cpcmJbW0YrddO+tG1ab5nT41KpHIYGsbeHqxB9xPu1pKQ==} engines: {node: '>= 12.13.0'} @@ -7439,6 +7456,14 @@ packages: webpack: 5.78.0(@swc/core@1.3.42) dev: true + /html2canvas@1.4.1: + resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==} + engines: {node: '>=8.0.0'} + dependencies: + css-line-break: 2.1.0 + text-segmentation: 1.0.3 + dev: false + /htmlparser2@6.1.0: resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} dependencies: @@ -8077,6 +8102,10 @@ packages: engines: {node: '>=10'} dev: true + /jr-qrcode@1.1.4: + resolution: {integrity: sha512-041B7axC/tzKRFbCc4g5QCaPzga2IgyBGmUBkWQ+t4CMl83DBzFv9tq9XdJr7uIqe9X6zYZC7Cy5J9ttiBNxrw==} + dev: false + /js-tokens@3.0.2: resolution: {integrity: sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==} dev: true @@ -11405,6 +11434,12 @@ packages: commander: 2.20.3 source-map-support: 0.5.21 + /text-segmentation@1.0.3: + resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==} + dependencies: + utrie: 1.0.2 + dev: false + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true @@ -11799,6 +11834,12 @@ packages: engines: {node: '>= 0.4.0'} dev: true + /utrie@1.0.2: + resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==} + dependencies: + base64-arraybuffer: 1.0.2 + dev: false + /uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. diff --git a/src/app.config.js b/src/app.config.js index 067c4e4..25a7e56 100644 --- a/src/app.config.js +++ b/src/app.config.js @@ -31,7 +31,8 @@ export default defineAppConfig({ 'pages/message/index', 'pages/message-list/index', 'pages/message-detail/index', - '/pages/login-quick/index' + '/pages/login-quick/index', + '/pages/invite/index', ], window: { backgroundTextStyle: 'light', diff --git a/src/app.scss b/src/app.scss index ca8f36b..6e82958 100644 --- a/src/app.scss +++ b/src/app.scss @@ -100,6 +100,10 @@ margin-left: 17px; } +.mt6 { + margin-top: 6px; +} + .mt-8 { margin-top: 32px; } @@ -120,6 +124,10 @@ margin-top: 25px; } +.mt32 { + margin-top: 32px; +} + .mt-58 { margin-top: 58px; diff --git a/src/assets/images/inviteBg.png b/src/assets/images/inviteBg.png new file mode 100644 index 0000000000000000000000000000000000000000..8bd30a15e763e0b40214e2697ac0d189508c7aac GIT binary patch literal 10504 zcmeHtc{tSV{{JmS2tA3C2~kv*v1J{!Sdy(LjIkSxAV{23-OXHF3p$(_9D@wMA ziNS=jFO6*~V(eu5ee^s%r}O=t=bZDsuHWy!<8od1XYS8?dA;BFeZQA`ChDS*E+_jT zb^rjU-g&J{0PIKtfEl@)1)9oZm0JIMVoN>ZAV1)HN&{)hR4B9Es zy9tAUIF7oSqVOm~164)l*$$=2eY|u&a~0 zi1{f)8AGpg7#G*`K|UChAR|-9AU8)9ClO5zVFW=H65xTsqlF0`?w-D?1a*<`a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/images/qrcode.png b/src/assets/images/qrcode.png new file mode 100644 index 0000000000000000000000000000000000000000..cc1dcbe430de81d52667030aa47822d1381e77b6 GIT binary patch literal 1922 zcmaJ?Yg7|w8jf5-i(t_bDi+sifR=so|Z16zugov6_MSa!~t`7Y;qp7(j* z@BPkH%Hks3U01o1NF?{@C|FL6fy7IHjcoreIf4*_H!e=W6R}L(q%+(>e&@7_9&=nGM z`!+}gUO@0%5%s016sZh|zzhh$XR;V-2!a5ZclxmggeSi(ISs=s#SsVrg34;Ve z4hMMkP>FB`O{P!|OI`&dRw8OPj_ZXWXfm0YrXVI}$O2gcfdGWqAe+q~5Dep16jz!V zsL^*`0Y;2!gI14gF%+;XDpgoME}{}vU*@3GFUX?CS9KyP2AY+6ki~@TIn4v5(*FLig7>*gUF+IQz zVnRSbvKG}~CL`?yK`IqSqefhbs*z||L?tAcTCGMXfw*D;k1dhFESSX-!va1OE)M3x z5SPV)xh%mv7sk~2It0b%xtaxT5VR=Q-V8cD5gA4d+AWAiV!(93i=2hp#l66b>b>G> z7WKjwFUkc8Gobxs|8&yxTSWWVrwffsEEZZHL5Y4h5RGk<`2fUyu|>mS3iCgHs85fg zBzRmMX;{%?6PerVk#rRc|}4kWyZ3n zw#KilFef#k6Ksw>D<8PgfX?-d1^Z0jDcCZ(pJ%;y=xmm0Vtj0@UXaC2AK`j9Z7CsJ z(~|3WGPk=apYd08i-(k9oi6Lhx7t2R_lYOvX(mIvSEK>M&aSCqwcSJO|Lru^7 zT8jGGvg__TfB!)Rj~C7lPI>@u@4xQ2+p_jovg>M|jr4QN#_diu4y&y(b< z**GoOg?gcDW$hT3=cB1FJ^A@E?~AEV_SLi(T6PUQF)j0+y>oxxS`YrHOL^(<6xrjd zcFHHgg4x1!k5i3$Ug&RL)}fxdT&MfRc~zvGumYgJ<|Fb0wdXlJ?)&xBZ+iS1wy&fP z?hWV*FE}H8UY_o#$qO|7ee;uyq+d#>BemmuhVG~$Os6~wZ!7W-O73~AX>^jg2|YcB zV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al 0 HcmV?d00001 diff --git a/src/assets/images/wechat.png b/src/assets/images/wechat.png new file mode 100644 index 0000000000000000000000000000000000000000..9b85eb42b2bee7f27857dac0d1e247263cd0a944 GIT binary patch literal 2229 zcmaJ@c|25mA0ASci&C~IcO1p!GP`9as>v~#YFwd=7Pm2TjKM6;9A>7Ht;Cf?q6HCC zxVlJ-UN@2!yXqE7Wyv7iEQx5lqnqyg$J={8pL2f8=Xsv*_WW_;J={0wXqjjs5C|Qb z8|bNA3Ch=6V}bH(CS}Q#%Tm~t0ecAoUkFxVzOm>>L4csV%`d_ zHv?wSHGb~(~`l#>gvm<=T)yNDnrED(7M1R-;6^avEd0&$=~h{O}nSR~4a z%V!HD;#FS=bUK;F7sE_G3!;I}fKmd@<+91Ht`0;Jmf}JMaUc%o3X(_^lH+>N9_Na4 za0H3?IW8z*h4LUiJjZ4K%LTv7oizhbsEiCkB5oMOriuhSSs-0$Z?`L5nqF8lkr ztp6?-qf7=fJK6u5^xT!wKC|0z##J7^Ss&sn{Vq}(+ek~h2Z5MxMFT0`(x;85fnn0p;ATT4>W1+0$sX&k#k6sjMxxZ|& z`R*brR|A=(AxE`t)4$lNTDiUS%9Wvr(TFCYBWLRM^L;*6(~w}QG4szS`(8I@kVx?$ zkapfXa!0j|hn8j3gP;#K?+hiha!9(S`^`quZ!H zLsRQWskqBHPLD%*d#R^G@N>P7kIneBwuev-wL2lrrTc7f*Ur(J-O&-0% z>?fWasiAH!U(gy!v75$~X!NROpp0zhoi%lL&WvhGZI0{qdBl#04mxJ^@SyB++l9XN zjT{$Az{S(O+9wSrJ&|pD3S^!}R|#8VE#!Kno-L|RA7w0zRWu4mof9WxHYSXNCCfAB zUAS4Ve;1=Jh$>!3C~r7NI57z}$8edBZ}MgiWeLIaFXJ~UEDtkfQ@XwroE`9p_sb4K z=y^nj9H*HxebkPB+)lTKuxuuYG+~bGemX>cm>hHWx83(mh*P!n4c%U(z&;K> z`PQYyaLn_rB>fqms3+O#!{;iCV$WO$`l4U$&fjx3m1X21DEb}ivJ1d0CexT zR9mDyyqi?J`lF3;`e2>(L?5-p`dsv6*l3}=XN`_-l)d5a<5>pLiwz4E`%|)Nf6Z6H z#85hpkF~xH)^pO4{pg23pl~-l>+`<6YSAce+e-qcONlZco=jb24zes=)Ho;+;#Pcg4q!pen4Y1OI9y1eM@daJCtnUq|)I z-~Z=QXLjawKb;Uw<|Tgv^NO1*65QuI$bLxaP1WmC8AZK0_Uiuo!Own$!DTTYM971R z5(@p&ZG7dT4|3Sv7tXsKge!dalXj+Nm&4Ibw-P&ky^*_L7UKwnK5w~P)|pe*5Vv_= zS~j*bCAiS`Djc;_ac6XSc2t{UIImZ&)=KQ%QP7&hx|;da<^))=GU+lSYE8lo$NEebU(+_@482wRoTbWt!!192wx(>LQRBd* zf~4;rbtC&oghPCPNJ}$IcHrdC7i-#6<2U!NcHk3T)PdbxFr&BOdNGg~S%T&YGA ztIZPBuJ~*;&2n2sY;2j{%&0|=x>(dN@A9Qrwj?s58?W9Lwr9}0O)Mtgi)31yDM-9a@gn1o6;@{@TCwU;CB3&k zy*z7D(w<`#K0L3HDLzvA=0l}J?E_gV{*-QFH-3nn*d~YbPP|{X<9e1`u%zX4)6y#7 nalNQ=A3&&1+TJZtS%CO>Q*n#7{@%dsj|9!t9sGU$?&!Y(;?TAD literal 0 HcmV?d00001 diff --git a/src/config/config.js b/src/config/config.js index 4cd750b..0208418 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,5 +1,6 @@ export default { api: "http://1.14.121.134:9101", debugApi: "http://1.14.121.134:9101", + home: '', debug: false } diff --git a/src/pages/about-me/index.jsx b/src/pages/about-me/index.jsx index dcec2a0..89bcbf4 100644 --- a/src/pages/about-me/index.jsx +++ b/src/pages/about-me/index.jsx @@ -1,15 +1,22 @@ import { Image, Text, View } from "@tarojs/components" import next from '@/images/next.png' import './index.scss' -import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' -import { useEffect } from "react" +import { useEffect, useState } from "react" +import { configs } from "../../utils/api" const Login = () => { + const [about, setAbout] = useState({}) + useEffect(() => { + configs().then(rs => { + if (!rs) return + setAbout(rs.about) + }) + }, []) // 返回页面 const backFn = () => { @@ -30,16 +37,16 @@ const Login = () => { 关于我们 - + 客服邮箱 - lhqjN@example.com + {about.email} 当前版本 - v1.0 + {about.version} diff --git a/src/pages/about-me/index.scss b/src/pages/about-me/index.scss index 6d2c429..b139a7f 100644 --- a/src/pages/about-me/index.scss +++ b/src/pages/about-me/index.scss @@ -38,4 +38,5 @@ .about-logo { margin-top: 40px; + width: 100%; } \ No newline at end of file diff --git a/src/pages/cash/index.jsx b/src/pages/cash/index.jsx index 00e13af..7fbd5f3 100644 --- a/src/pages/cash/index.jsx +++ b/src/pages/cash/index.jsx @@ -9,6 +9,9 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { Picker } from "@nutui/nutui-react-taro" +import { cardList, scoreWithdraw, userDetail } from "../../utils/api" +import { useEffect } from "react" +import { closeLoading, errorNotice, loading, successNotice } from "../../utils/utils" const activeEye = eye @@ -18,8 +21,23 @@ const Login = () => { const [visible, setVisible] = useState(false) const [bank, setBank] = useState({ value: 0, text: '' }) + const [pwd, setPwd] = useState('') + const [user, setUser] = useState({}) + const [card, setCard] = useState([]) + const [bankList, setBankList] = useState([]) + useEffect(() => { + userDetail().then(rs => { + if (!rs) return + setUser(rs) + }) + cardList().then(rs => { + if (!rs) return + setCard(rs.items) + setBankList([rs.items.map(item => ({ value: item.id, text: `${item.bank_name} ${item.account_number}` }))]) + }) + }, []) // 返回页面 const backFn = () => { @@ -29,39 +47,55 @@ const Login = () => { const confirmPicker = (val, list) => { list.forEach(item => { - console.log(item, "C") setBank(item) }) } - const listData1 = [ - [ - { value: 1, text: '南京市', }, - { value: 2, text: '无锡市', }, - { value: 3, text: '海北藏族自治区', }, - { value: 4, text: '北京市', }, - { value: 5, text: '连云港市', }, - { value: 6, text: '浙江市', }, - { value: 7, text: '江苏市', }, - { value: 8, text: '大庆市', }, - { value: 9, text: '绥化市', }, - { value: 10, text: '潍坊市', }, - { value: 11, text: '请按市', }, - { value: 12, text: '乌鲁木齐市' }, - ], - ] + const submit = async () => { + if (!account) { + errorNotice("请输入转换金额") + return + } + if (!bank) { + errorNotice("请选择提现银行卡") + return + } + if (!pwd) { + errorNotice('请输入支付密码') + return + } + if (user.score < 1) { + errorNotice("余额不足") + return + } + loading('提现申请中...') + const data = card.filter(it => it.id == bank.value) + const re = await scoreWithdraw({ + "account_name": data[0].account_name, + "account_number": data[0].account_number, + "amount": account, + "bank_branch": data[0].bank_branch, + "bank_name": data[0].bank_name, + "password": pwd + }) + closeLoading() + if (!re) return + successNotice('提现成功') + setTimeout(() => { + backFn() + }, 1000) + } return 立即提现 - 当前余额 - 50000 + {user.score} @@ -80,13 +114,27 @@ const Login = () => { 银行卡 - + + + + + 支付密码 + + { + setPwd(v.detail.value) + }} /> { account && !!bank.value && - + } @@ -94,7 +142,7 @@ const Login = () => { confirmPicker(values, list)} onClose={() => setVisible(false)} diff --git a/src/pages/change-user/index.jsx b/src/pages/change-user/index.jsx index ba93773..b51f3fe 100644 --- a/src/pages/change-user/index.jsx +++ b/src/pages/change-user/index.jsx @@ -8,18 +8,26 @@ import { Button } from "@nutui/nutui-react-taro" import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' +import { closeLoading, errorNotice, loading, successNotice } from "../../utils/utils" +import { modifyUser, userDetail } from "../../utils/api" +import { useEffect } from "react" const activeEye = eye const uinfo = () => { const [account, setAccount] = useState('') - const [pwd, setPwd] = useState() - const [uinfoMode, setuinfoMode] = useState('account') + const [user, setUser] = useState({}) - const [mobile, setMobile] = useState('') - const [smsCode, setSmsCode] = useState('') - const [interval, setIntervalTime] = useState(0) + + useEffect(() => { + userDetail().then(rs => { + if (!rs) return + setUser(rs) + setAccount(rs.nick_name) + }) + + }, []) // 返回页面 @@ -27,46 +35,22 @@ const uinfo = () => { Taro.getCurrentPages().length > 0 && Taro.navigateBack() } - - // 去登陆 - const uinfoFn = () => { - Taro.redirectTo({ - url: '/pages/uinfo/index' - }) - } - - //清理数据 - const cleanFn = () => { - if (uinfoMode === 'account') { - setAccount('') - setPwd('') + const submit = async () => { + if (!account) { + errorNotice("请输入要修改的昵称") 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) - } + loading('昵称修改中...') + const re = await modifyUser('nick_name', account) + closeLoading() + if (!re) return + successNotice('昵称修改成功') + setTimeout(() => { + backFn() }, 1000) } + return @@ -75,7 +59,7 @@ const uinfo = () => { - + {/* 用户名 { @@ -86,20 +70,20 @@ const uinfo = () => { } - + */} 昵称 - { - setPwd(v.detail.value) + { + setAccount(v.detail.value) }} /> { - pwd && + account && } - + diff --git a/src/pages/conversion/index.jsx b/src/pages/conversion/index.jsx index b61dacc..acf32f5 100644 --- a/src/pages/conversion/index.jsx +++ b/src/pages/conversion/index.jsx @@ -9,48 +9,50 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { Picker } from "@nutui/nutui-react-taro" +import { profitToScore, userDetail } from "../../utils/api" +import { useEffect } from "react" +import { closeLoading, errorNotice, loading, successNotice } from "../../utils/utils" const activeEye = eye const Login = () => { const [account, setAccount] = useState('') - + const [user, setUser] = useState({}) const [visible, setVisible] = useState(false) const [bank, setBank] = useState({ value: 0, text: '' }) - + useEffect(() => { + userDetail().then(rs => { + if (!rs) return + setUser(rs) + }) + }, []) // 返回页面 const backFn = () => { Taro.getCurrentPages().length > 0 && Taro.navigateBack() } - - const confirmPicker = (val, list) => { - list.forEach(item => { - console.log(item, "C") - setBank(item) - }) + const submit = async () => { + if (!account) { + errorNotice("请输入转换金额") + return + } + if (user.profit < 1) { + errorNotice("余额不足") + return + } + loading('转换中...') + const re = await profitToScore(account) + closeLoading() + if (!re) return + successNotice('余额转换成功') + setTimeout(() => { + backFn() + }, 1000) } - const listData1 = [ - [ - { value: 1, text: '南京市', }, - { value: 2, text: '无锡市', }, - { value: 3, text: '海北藏族自治区', }, - { value: 4, text: '北京市', }, - { value: 5, text: '连云港市', }, - { value: 6, text: '浙江市', }, - { value: 7, text: '江苏市', }, - { value: 8, text: '大庆市', }, - { value: 9, text: '绥化市', }, - { value: 10, text: '潍坊市', }, - { value: 11, text: '请按市', }, - { value: 12, text: '乌鲁木齐市' }, - ], - ] - return @@ -60,7 +62,7 @@ const Login = () => { 当前收益 - 50000 + {user.profit} @@ -78,7 +80,7 @@ const Login = () => { { - + } diff --git a/src/pages/home/index.jsx b/src/pages/home/index.jsx index 38ea0f8..2575ad9 100644 --- a/src/pages/home/index.jsx +++ b/src/pages/home/index.jsx @@ -39,7 +39,7 @@ const Index = () => { { navigateTo('/pages/setting/index') }} /> - { navigateTo('/pages/message/index') }} /> + { navigateTo('/pages/message-list/index') }} /> @@ -162,7 +162,9 @@ const Index = () => { 常用工具 - + { + navigateTo('/pages/invite/index') + }}> diff --git a/src/pages/income/index.jsx b/src/pages/income/index.jsx index af8a572..9eea4af 100644 --- a/src/pages/income/index.jsx +++ b/src/pages/income/index.jsx @@ -39,7 +39,7 @@ const Login = () => { useEffect(() => { let offset = (page - 1) * limit - userLogs('shopping_score', offset, limit).then(rs => { + userLogs('profit', offset, limit).then(rs => { if (!rs) return setList(it => [...it, ...rs.items]) setTotal(rs.total) @@ -59,13 +59,12 @@ const Login = () => { 我的收益 - 当前余额 - 50000 + {user.profit} diff --git a/src/pages/invite/index.config.js b/src/pages/invite/index.config.js new file mode 100644 index 0000000..c9fe430 --- /dev/null +++ b/src/pages/invite/index.config.js @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '邀请好友' +}) diff --git a/src/pages/invite/index.jsx b/src/pages/invite/index.jsx new file mode 100644 index 0000000..f22c985 --- /dev/null +++ b/src/pages/invite/index.jsx @@ -0,0 +1,109 @@ +import { View, Image, Text } from "@tarojs/components" +import backNav from '@/images/backNav.png' +import inviteBg from '@/images/inviteBg.png' +import share from '@/images/share.png' +import wechat from '@/images/wechat.png' +import qrcode from '@/images/qrcode.png' +import './index.scss' +import { backTo, errorNotice, successNotice } from "../../utils/utils" +import { userDetail } from "../../utils/api" +import { useState } from "react" +import jrQrcode from 'jr-qrcode' +import { useEffect } from "react" +import { Button } from "@nutui/nutui-react-taro" +import config from "../../config/config" +import Taro from "@tarojs/taro" +import html2canvas from 'html2canvas'; + + +const Index = () => { + + const [user, setUser] = useState({}) + const [code, setCode] = useState('') + + useEffect(() => { + userDetail().then(rs => { + if (!rs) return + setUser(rs) + const img = jrQrcode.getQrBase64(window.location.host + '/#/pages/index/index?code=' + rs.invite_code) + setCode(img) + }) + + }, []) + + const backFn = () => { + backTo() + } + + const genImage = () => { + const canvas = document.createElement("canvas") + let canvasBox = document.getElementById('imageWrapper') + const width = canvasBox.offsetWidth + const height = canvasBox.offsetHeight + canvas.width = width * 3 + canvas.height = height * 3 + + const options = { + backgroundColor: '#F67952', + canvas: canvas, + useCORS: true, + y: 66, + allowTaint: true, + onrendered: (x) => { + console.log(x, "CCC") + } + }; + + html2canvas(canvasBox, options).then((canvas) => { + let dataURL = canvas.toDataURL("image/png"); + //下载 + downloadImage(dataURL); + //显示 + }) + } + + const downloadImage = (url) => { + let link = document.createElement("a"); + link.href = url; + link.setAttribute("download", "邀请码.png"); + link.click(); + } + + const shareFn = async () => { + genImage() + } + + return + + + 邀请好友 + + + + + 邀请好友,福利多多 + + 邀请码:{user.invite_code} + + + + + + + + 点击分享二维码 + + + + 分享至微信 + + + + 好友扫码加入 + + + +} + + +export default Index \ No newline at end of file diff --git a/src/pages/invite/index.scss b/src/pages/invite/index.scss new file mode 100644 index 0000000..024cdd4 --- /dev/null +++ b/src/pages/invite/index.scss @@ -0,0 +1,79 @@ +.invite-container { + width: 100vw; + min-height: 100vh; + height: auto; + background: #F67952; +} + +.invite-header { + background: #fff; +} + +.invite-body { + width: 100vw; + margin-top: 60px; + position: relative; + z-index: 1; +} + +.invite-body-bg { + width: 315px; + position: absolute; + top: 0px; + z-index: -1; +} + +.invite-content { + z-index: 10; +} + +.invite-body-title { + font-size: 20px; + color: #000; + margin-top: 40px; + +} + +.invite-code-img { + width: 168px; + height: 168px; +} + +.invite-code-help { + font-weight: 400; + color: rgba(0, 0, 0, 0.5); + font-size: 16px; + margin-top: 6px; +} + +.invite-btn { + width: 185px; + height: 46px; + border-radius: 123px 123px 123px 123px; + background: #F67952; + border: none; + color: #FFFFFF; + margin-top: 30px; + font-size: 16px; +} + +.invite-footer { + width: 315px; + margin: 0 auto; + margin-top: 70px; + align-content: flex-start; + justify-items: flex-start; + align-items: flex-start; +} + +.invite-action { + font-size: 12px; + color: #fff; + width: 78px; + text-align: center; +} + +.invite-action-icon { + width: 24px; + margin-bottom: 8px; +} \ No newline at end of file diff --git a/src/pages/message-detail/index.jsx b/src/pages/message-detail/index.jsx index 6304c89..d189390 100644 --- a/src/pages/message-detail/index.jsx +++ b/src/pages/message-detail/index.jsx @@ -5,10 +5,25 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { useEffect } from "react" +import { useRouter } from "@tarojs/taro" +import { msgDetail } from "../../utils/api" +import { formatDateByStr } from "../../utils/utils" const Login = () => { + const params = useRouter().params + const [id] = useState(params.id) + const [detail, setDetail] = useState({}) + + useEffect(() => { + if (!id) return + msgDetail(id).then(rs => { + if (!rs) return + setDetail(rs) + }) + }, [id]) + // 返回页面 const backFn = () => { Taro.getCurrentPages().length > 0 && Taro.navigateBack() @@ -21,10 +36,10 @@ const Login = () => { 消息中心 - 秒杀专区暂时下线公告 - 2023-05-23 13:12:00 + {detail.title} + {formatDateByStr(detail.created_at)} - 秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告 + {detail.content} diff --git a/src/pages/message-list/index.jsx b/src/pages/message-list/index.jsx index db9eac1..77256aa 100644 --- a/src/pages/message-list/index.jsx +++ b/src/pages/message-list/index.jsx @@ -5,10 +5,25 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { useEffect } from "react" - +import { Infiniteloading } from "@nutui/nutui-react-taro" +import empty from '@/images/empty.png' +import { msgList } from "../../utils/api" +import { formatDateByStr } from "../../utils/utils" const Login = () => { + const limit = 20 + const [page, setPage] = useState(1) + const [list, setList] = useState([]) + const [total, setTotal] = useState(0) + useEffect(() => { + const offset = (page - 1) * limit + + msgList({ offset, limit }).then(re => { + setList(it => [...it, ...re.items]) + setTotal(re.total) + }) + }, [page]) // 返回页面 const backFn = () => { Taro.getCurrentPages().length > 0 && Taro.navigateBack() @@ -25,33 +40,41 @@ const Login = () => { 消息中心 - - - 今天8:00 - - - 秒杀专区暂时下线公告 - 秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告 - - { navDetail(1) }}> - 查看详情 - - - - - - 今天8:00 - - - 秒杀专区暂时下线公告 - 秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告秒杀专区暂时下线公告 - - - 查看详情 - - - - + + + } + loadIcon='loading' + hasMore={total > list.length} + onLoadMore={(x) => { + setPage(p => p + 1) + x() + }} + > + { + list.map(item => { + return + {formatDateByStr(item.created_at)} + + + {item.title} + {item.summary} + + { navDetail(item.id) }}> + 查看详情 + + + + + }) + } + + { + !list.length && + } } diff --git a/src/pages/message-list/index.scss b/src/pages/message-list/index.scss index 398eee9..700113f 100644 --- a/src/pages/message-list/index.scss +++ b/src/pages/message-list/index.scss @@ -37,6 +37,7 @@ .message-time { color: #72778ac6; + font-size: 12px; } .message-item-title { diff --git a/src/pages/order-detail/index.jsx b/src/pages/order-detail/index.jsx index a2b033c..b36abb3 100644 --- a/src/pages/order-detail/index.jsx +++ b/src/pages/order-detail/index.jsx @@ -147,14 +147,6 @@ function Index() { navigateTo(`/pages/settle/index?id=${detail.product_id}`) }}>再次购买 - - - { setShowBasic(false) }}> - - - {actionText} - - ) } diff --git a/src/pages/team/index.jsx b/src/pages/team/index.jsx index be02100..35027ab 100644 --- a/src/pages/team/index.jsx +++ b/src/pages/team/index.jsx @@ -9,19 +9,32 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { Avatar } from "@nutui/nutui-react-taro" +import { invitedAreas, invitedUser, userDetail } from "../../utils/api" +import { useEffect } from "react" +import { formatDateByStr } from "../../utils/utils" 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 [user, setUser] = useState({}) + const [list, setList] = useState([]) + const [areas, setAreas] = useState({}) + 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) + }) + }, []) // 返回页面 const backFn = () => { @@ -29,44 +42,7 @@ const Login = () => { } - // 去登陆 - 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 @@ -77,49 +53,43 @@ const Login = () => { - 城市合伙人 + { + user.is_city_partner && 城市合伙人 + } 我的等级 - - 0.00 + + {areas.largest} 大区业绩 - - 0.00 + + {areas.lesser} 小区业绩 我邀请的人 - - - - - PB-60635 - 2021-04-09 + + { + list.map(item => { + return + + + + {item.nick_name} + {formatDateByStr(item.created_at)} + + + + {item.user_level?.name} + - - - V5 - - - - - - - PB-60635 - 2021-04-09 - - - - V5 - - + }) + } diff --git a/src/pages/team/index.scss b/src/pages/team/index.scss index 2fcac02..541559f 100644 --- a/src/pages/team/index.scss +++ b/src/pages/team/index.scss @@ -49,6 +49,7 @@ .invite-container { margin-top: 20px; + width: 100%; } .invite-title { @@ -78,7 +79,7 @@ } .invite-level { - width: 38px; + padding: 0 8px; height: 24px; background: linear-gradient(117deg, #0F1732 0%, #2F3A58 100%); border-radius: 12px; diff --git a/src/pages/user-info/index.jsx b/src/pages/user-info/index.jsx index 8aa6f2e..e86f687 100644 --- a/src/pages/user-info/index.jsx +++ b/src/pages/user-info/index.jsx @@ -13,8 +13,9 @@ import { useRouter } from '@tarojs/taro'; import { Button, Textarea, Address } from '@nutui/nutui-react-taro'; import { Avatar } from '@nutui/nutui-react-taro'; import { Overlay } from '@nutui/nutui-react-taro'; -import { userDetail } from '../../utils/api'; -import { navigateTo } from '../../utils/utils'; +import { modifyUser, userDetail } from '../../utils/api'; +import { closeLoading, errorNotice, loading, navigateTo, successNotice } from '../../utils/utils'; +import { upload } from '../../utils/request'; @@ -54,25 +55,37 @@ function Index() { Taro.chooseImage({ sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 + count: 1, sourceType: [type], // 可以指定来源是相册还是相机,默认二者都有,在H5浏览器端支持使用 `user` 和 `environment`分别指定为前后摄像头 - success: function (res) { + success: async function (res) { + setVisible(false) + loading('头像上传中, 请稍后') // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 var tempFilePaths = res.tempFilePaths - console.log(tempFilePaths) + try { + const re = await upload(tempFilePaths[0]) + const r = await modifyUser('avatar', re.url) + closeLoading() + if (!r) return + successNotice('头像上传成功') + setUser({ ...user, avatar: re.url }) + } catch { + errorNotice('头像上传失败') + } } }) } return ( - - + + 编辑资料 - - + + - - { navigateTo('/pages/change-user/index') }}> - 个人信息 + + { navigateTo('/pages/change-user/index') }}> + 个人信息 - { navigateTo('/pages/change-pwd/index') }}> - 修改密码 + { navigateTo('/pages/change-pwd/index') }}> + 修改密码 - { navigateTo('/pages/change-phone/index') }}> - 修改手机号 + { navigateTo('/pages/change-phone/index') }}> + 修改手机号 - { navigateTo('/pages/my-card/index') }}> - 我的银行卡 + { navigateTo('/pages/my-card/index') }}> + 我的银行卡 diff --git a/src/pages/user-info/index.scss b/src/pages/user-info/index.scss index 5f81cf9..6d3494b 100644 --- a/src/pages/user-info/index.scss +++ b/src/pages/user-info/index.scss @@ -1,4 +1,4 @@ -.addr-container { +.userInfo-container { font-family: Source Han Sans CN-Bold, Source Han Sans CN; font-size: 14px; background: #FBFBFD; @@ -11,7 +11,7 @@ border-radius: 16px 16px 16px 16px; } -.addr-detail-title { +.userInfo-detail-title { width: 100vw; height: 60px; font-size: 18px; @@ -24,7 +24,7 @@ justify-content: center; } -.addr-body { +.userInfo-body { padding: 21px; height: auto; box-sizing: border-box; @@ -34,7 +34,7 @@ align-content: center; } -.addr-box { +.userInfo-box { width: 333px; background: #FFFFFF; box-shadow: 4px 7px 9px 0px rgba(56, 63, 68, 0.03); @@ -43,7 +43,7 @@ padding: 0 12px; } -.addr-item { +.userInfo-item { width: 333px; background: #FFFFFF; box-shadow: 4px 7px 9px 0px rgba(56, 63, 68, 0.03); @@ -60,7 +60,7 @@ font-size: 12px; } -.addr-form { +.userInfo-form { width: 308px; box-sizing: border-box; height: 48px; @@ -73,18 +73,18 @@ font-size: 14px; } -.addr-form-name { +.userInfo-form-name { font-weight: bold; color: #000000; font-size: 15px; margin-right: 10px; } -.addr-form-input { +.userInfo-form-input { width: 230px; } -.addr-btn { +.userInfo-btn { width: 233px; height: 55px; border-radius: 107px 107px 107px 107px; @@ -98,12 +98,12 @@ left: calc((100vw - 233px)/2); } -.addr-item>.nut-textarea { +.userInfo-item>.nut-textarea { padding-left: 0; padding-right: 0; } -.addr-item .weui-input { +.userInfo-item .weui-input { color: var(--nutui-textarea-text-color, var(--nutui-gray-1, #1a1a1a)); } diff --git a/src/utils/api.js b/src/utils/api.js index c88ffde..826b224 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -88,4 +88,38 @@ export const userLogs = async (type, data = {}) => { export const transferAmount = async (data = {}) => { return await p(`/users/assets/score-transfer`, data) +} + + +export const profitToScore = async (amount) => { + return await p(`/users/assets/profit-to-score`, { amount }) +} + +export const scoreWithdraw = async (data) => { + return await p(`/users/assets/score-withdraw`, data) +} + +// +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 invitedAreas = async () => { + return await g(`/users/teams/invitee-areas`) +} + +export const configs = async () => { + return await g('/config') +} + +export const msgList = async (params) => { + return await g('/news', params) +} + +export const msgDetail = async (id) => { + return await g(`/news/${id}`) } \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index decf3c1..fb182ff 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -101,7 +101,7 @@ export function put(url, data, base) { export const upload = async (file) => { let base = config.api if (config.debug) { - base = config.debugApi + // base = config.debugApi } let jwt = GetData(JWT); jwt = typeof jwt === 'string' ? jwt : '' @@ -109,27 +109,35 @@ export const upload = async (file) => { // 'Jwt': `Bearer ${jwt}`, 'Authorization': 'Bearer ' + jwt } - const re = await Taro.uploadFile({ - url: `${base}api/camp_chat/upload_image`, - filePath: file, - name: 'image', - header: header, - }) - if (re.statusCode == 200) { - const resp = JSON.parse(re.data) - if (resp.hasOwnProperty("data")) { - return resp.data + try { + const re = await Taro.uploadFile({ + url: `${base}/files`, + filePath: file, + name: 'file', + header: header, + fileName: 'file', + withCredentials: false + }) + + if (re.statusCode == 200) { + const resp = JSON.parse(re.data) + if (resp.hasOwnProperty("data")) { + return resp.data + } } + } catch { + Taro.showModal({ + "title": "信息提示", + showCancel: false, + "content": "上传失败", + mask: true + }) + return null } - Taro.showModal({ - "title": "信息提示", - showCancel: false, - "content": re.errMsg, - mask: true - }) + RequestError.prototype = Object.create(Error.prototype) RequestError.prototype.constructor = RequestError - throw new RequestError(re.errMsg, re.statusCode) + return null }