From 965be530af3a6fcfed679e6180148e6e72ad9733 Mon Sep 17 00:00:00 2001 From: tangping Date: Sun, 4 Jun 2023 00:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 4 ++-- src/pages/address/index.jsx | 5 ++--- src/pages/goods-detail/index.jsx | 5 ++--- src/pages/home/index.scss | 2 +- src/pages/income/index.jsx | 1 + src/pages/index/index.jsx | 6 ++++++ src/pages/invite/index.jsx | 2 +- src/pages/register/index.jsx | 5 ++++- src/pages/setting/index.jsx | 10 ++++++++++ src/pages/team/index.scss | 3 ++- src/utils/storage.js | 4 ++++ 11 files changed, 35 insertions(+), 12 deletions(-) diff --git a/project.config.json b/project.config.json index 1274c87..7f090dd 100644 --- a/project.config.json +++ b/project.config.json @@ -2,7 +2,6 @@ "miniprogramRoot": "dist/", "projectname": "mall", "description": "商城", - "appid": "touristappid", "setting": { "urlCheck": true, "es6": false, @@ -15,7 +14,8 @@ "disablePlugins": [], "outputPath": "" }, - "condition": false + "condition": false, + "ignoreUploadUnusedFiles": true }, "compileType": "miniprogram", "libVersion": "2.25.3", diff --git a/src/pages/address/index.jsx b/src/pages/address/index.jsx index 20f1ae6..f2b222a 100644 --- a/src/pages/address/index.jsx +++ b/src/pages/address/index.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { Image, Text, View } from '@tarojs/components' +import { Image, Text, View, Button } from '@tarojs/components' import './index.scss' import { useEffect } from 'react'; @@ -11,7 +11,6 @@ import checked from '@/images/checked.png' import edit from '@/images/edit.png' import Taro from '@tarojs/taro'; import { useRouter } from '@tarojs/taro'; -import { Button } from '@nutui/nutui-react-taro'; import { deleteAddress, getAddress } from '../../utils/api'; import { backTo, closeLoading, loading, redirectTo, successNotice } from '../../utils/utils'; import { SetData } from '../../utils/storage'; @@ -113,7 +112,7 @@ function Index() { } - diff --git a/src/pages/goods-detail/index.jsx b/src/pages/goods-detail/index.jsx index 589fa7e..0559e71 100644 --- a/src/pages/goods-detail/index.jsx +++ b/src/pages/goods-detail/index.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { Image, Swiper, SwiperItem, Text, View } from '@tarojs/components' +import { Image, Swiper, SwiperItem, Text, View, Button } from '@tarojs/components' // import { Swiper, SwiperItem } from '@nutui/nutui-react-taro'; import './index.scss' import TabbarAction from '@/components/action'; @@ -10,7 +10,6 @@ import backNav from '@/images/backNav.png' import Taro from '@tarojs/taro'; import { useRouter } from '@tarojs/taro'; import { useDidShow } from '@tarojs/taro'; -import { Button } from '@nutui/nutui-react-taro'; import { mallDetail } from '../../utils/api'; import { ImagePreview } from '@nutui/nutui-react-taro'; @@ -127,7 +126,7 @@ function Index() { - + ) diff --git a/src/pages/home/index.scss b/src/pages/home/index.scss index 9731569..5d08efe 100644 --- a/src/pages/home/index.scss +++ b/src/pages/home/index.scss @@ -97,7 +97,7 @@ } .my-container { - margin-bottom: 80px; + margin-bottom: 160px; } .home-bg { diff --git a/src/pages/income/index.jsx b/src/pages/income/index.jsx index 9eea4af..7d1edda 100644 --- a/src/pages/income/index.jsx +++ b/src/pages/income/index.jsx @@ -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 diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index a4f793f..9e7a02c 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -7,9 +7,12 @@ import { useEffect } from 'react'; import { useState } from 'react'; import { mallList } from '../../utils/api'; import Taro from '@tarojs/taro'; +import { useRouter } from '@tarojs/taro'; +import { SetData } from '../../utils/storage'; function Index() { + const param = useRouter().params const limit = 20 const [list, setList] = useState([]) const [total, setTotal] = useState(0) @@ -21,6 +24,9 @@ function Index() { return } fetchList(page) + if (param.code) { + SetData("inviteCode", param.code) + } }, [page]) diff --git a/src/pages/invite/index.jsx b/src/pages/invite/index.jsx index f22c985..ebd0c0b 100644 --- a/src/pages/invite/index.jsx +++ b/src/pages/invite/index.jsx @@ -25,7 +25,7 @@ const Index = () => { userDetail().then(rs => { if (!rs) return setUser(rs) - const img = jrQrcode.getQrBase64(window.location.host + '/#/pages/index/index?code=' + rs.invite_code) + const img = jrQrcode.getQrBase64(window.location.origin + '/#/pages/index/index?code=' + rs.invite_code) setCode(img) }) diff --git a/src/pages/register/index.jsx b/src/pages/register/index.jsx index 9851fc2..6e0a497 100644 --- a/src/pages/register/index.jsx +++ b/src/pages/register/index.jsx @@ -8,6 +8,7 @@ import { Button } from "@nutui/nutui-react-taro" import { useState } from "react" import Taro from "@tarojs/taro" import { register, sendCode } from "../../utils/api" +import { GetData } from "../../utils/storage" const activeEye = eye @@ -62,6 +63,7 @@ const Login = () => { return } Taro.showLoading({ title: '正在注册中~', }) + const inviteCode = GetData("inviteCode") const re = await register({ nick_name: mobile, phone: mobile, @@ -69,7 +71,8 @@ const Login = () => { password: pwd, confirm_password: confirmPassword, pay_password: payPassword, - confirm_pay_pwd: confirmPayPassword + confirm_pay_pwd: confirmPayPassword, + invite_code: inviteCode }) Taro.hideLoading() if (re) { diff --git a/src/pages/setting/index.jsx b/src/pages/setting/index.jsx index dbcbfa9..135d762 100644 --- a/src/pages/setting/index.jsx +++ b/src/pages/setting/index.jsx @@ -5,6 +5,8 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { useEffect } from "react" +import { CleanData, DelData } from "../../utils/storage" +import { navigateTo, redirectTo } from "../../utils/utils" const Login = () => { @@ -23,6 +25,10 @@ const Login = () => { }) } + const loginOut = () => { + CleanData() + redirectTo('/pages/login/index') + } return @@ -34,6 +40,10 @@ const Login = () => { 关于我们 + + 退出登陆 + + } diff --git a/src/pages/team/index.scss b/src/pages/team/index.scss index 541559f..33e4926 100644 --- a/src/pages/team/index.scss +++ b/src/pages/team/index.scss @@ -1,7 +1,7 @@ .team-page { height: 100vh; font-size: 14px; - background: #FBFBFD; + background: #ededef80; font-family: Source Han Sans CN-Bold, Source Han Sans CN; } @@ -63,6 +63,7 @@ width: 332px; height: 82px; background: #FFFFFF; + box-shadow: -2px 8px 46px 0px rgba(37, 45, 50, 0.05); border-radius: 16px 16px 16px 16px; opacity: 1; margin-top: 16px; diff --git a/src/utils/storage.js b/src/utils/storage.js index 142f8a8..3debfe8 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -64,3 +64,7 @@ export function DelData(key) { key: key }) } + +export function CleanData(key) { + return Taro.clearStorage() +}