This commit is contained in:
tangping 2023-06-04 00:13:15 +08:00
parent df72bbfcdf
commit 965be530af
11 changed files with 35 additions and 12 deletions

View File

@ -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",

View File

@ -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() {
}
</View>
<Button className='addr-btn' onClick={() => {
<Button className='addr-btn flex-center border-none' onClick={() => {
navDetailFn('')
}}>新增地址</Button>
</View>

View File

@ -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() {
</View>
</View>
</View>
<Button className='buy-btn' onClick={navDetailFn}>立即购买</Button>
<Button className='buy-btn flex-center border-none' onClick={navDetailFn}>立即购买</Button>
</View>
)

View File

@ -97,7 +97,7 @@
}
.my-container {
margin-bottom: 80px;
margin-bottom: 160px;
}
.home-bg {

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

View File

@ -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])

View File

@ -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)
})

View File

@ -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) {

View File

@ -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 <View className="setting-frame h-screen text-base">
<View className='addr-detail-title'>
@ -34,6 +40,10 @@ const Login = () => {
<Text>关于我们</Text>
<Image src={next} className="next-icon" />
</View>
<View className="flex-between setting-item" onClick={loginOut}>
<Text>退出登陆</Text>
<Image src={next} className="next-icon" />
</View>
</View>
</View>
}

View File

@ -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;

View File

@ -64,3 +64,7 @@ export function DelData(key) {
key: key
})
}
export function CleanData(key) {
return Taro.clearStorage()
}