Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
818d7791
提交
818d7791
authored
12月 20, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:购买商品,请先登录
上级
e9ca783b
流水线
#7688
已通过 于阶段
in 4 分 58 秒
变更
5
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
37 行增加
和
4 行删除
+37
-4
index.tsx
src/components/loginModal/index.tsx
+15
-3
index.tsx
src/components/product-comp/product-head/index.tsx
+1
-0
index.tsx
src/components/toastModal/index.tsx
+17
-1
[id].tsx
src/pages/cart/submit/[id].tsx
+1
-0
globalData.ts
src/store/module/globalData.ts
+3
-0
没有找到文件。
src/components/loginModal/index.tsx
浏览文件 @
818d7791
...
@@ -2,9 +2,11 @@ import React, { useEffect, useState } from 'react';
...
@@ -2,9 +2,11 @@ import React, { useEffect, useState } from 'react';
import
{
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
message
,
Modal
}
from
'antd'
;
import
{
message
,
Modal
}
from
'antd'
;
import
Cookies
from
'js-cookie'
;
import
Cookies
from
'js-cookie'
;
import
{
useDispatch
}
from
'react-redux'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
CommonAPI
}
from
'@/api'
;
import
{
CommonAPI
}
from
'@/api'
;
import
{
RootState
}
from
'@/store'
;
import
{
GlobalDataState
}
from
'@/store/module/globalData'
;
import
{
setSystem
}
from
'@/store/module/system'
;
import
{
setSystem
}
from
'@/store/module/system'
;
import
{
setUserInfo
}
from
'@/store/module/userInfo'
;
import
{
setUserInfo
}
from
'@/store/module/userInfo'
;
...
@@ -93,6 +95,10 @@ const LoginModalView = ({
...
@@ -93,6 +95,10 @@ const LoginModalView = ({
open
:
boolean
;
open
:
boolean
;
onCancel
:
()
=>
void
;
onCancel
:
()
=>
void
;
})
=>
{
})
=>
{
// system
const
globalData
=
useSelector
(
(
state
:
RootState
)
=>
state
.
globalData
,
)
as
GlobalDataState
;
// store
// store
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
// 获取小程序二维码唯一标识
// 获取小程序二维码唯一标识
...
@@ -196,7 +202,9 @@ const LoginModalView = ({
...
@@ -196,7 +202,9 @@ const LoginModalView = ({
return
(
return
(
<
Modal
open=
{
open
}
footer=
{
null
}
onCancel=
{
handleClose
}
>
<
Modal
open=
{
open
}
footer=
{
null
}
onCancel=
{
handleClose
}
>
<
LoginModalWrap
>
<
LoginModalWrap
>
<
div
className=
"title"
>
微信扫码登录
</
div
>
<
div
className=
"title"
>
{
globalData
?.
loginModalTitle
||
`微信扫码登录`
}
</
div
>
<
div
className=
"qrcode"
>
<
div
className=
"qrcode"
>
{
qrCodeData
&&
(
{
qrCodeData
&&
(
<
img
src=
{
qrCodeData
}
alt=
"登录二维码"
className=
"image"
/>
<
img
src=
{
qrCodeData
}
alt=
"登录二维码"
className=
"image"
/>
...
@@ -212,7 +220,11 @@ const LoginModalView = ({
...
@@ -212,7 +220,11 @@ const LoginModalView = ({
</
div
>
</
div
>
<
div
className=
"text"
>
微信扫一扫,打开小程序
</
div
>
<
div
className=
"text"
>
微信扫一扫,打开小程序
</
div
>
<
div
className=
"text"
>
即可登录/注册
</
div
>
<
div
className=
"text"
>
即可登录/注册
</
div
>
<
div
className=
"action"
onClick=
{
handleBackEnd
}
>
<
div
className=
"action"
onClick=
{
handleBackEnd
}
style=
{
{
visibility
:
'hidden'
}
}
>
管理平台登录
{
'>'
}
管理平台登录
{
'>'
}
</
div
>
</
div
>
<
div
className=
"text"
>
「云享飞,让天空为世界所用」
</
div
>
<
div
className=
"text"
>
「云享飞,让天空为世界所用」
</
div
>
...
...
src/components/product-comp/product-head/index.tsx
浏览文件 @
818d7791
...
@@ -132,6 +132,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
...
@@ -132,6 +132,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
dispatch
(
dispatch
(
setGlobalData
({
setGlobalData
({
loginModalVisible
:
true
,
loginModalVisible
:
true
,
loginModalTitle
:
'购买商品,请先登录'
,
}),
}),
);
);
return
;
return
;
...
...
src/components/toastModal/index.tsx
浏览文件 @
818d7791
import
React
from
'react'
;
import
React
from
'react'
;
import
{
CheckCircleOutlined
}
from
'@ant-design/icons'
;
import
{
CheckCircleOutlined
}
from
'@ant-design/icons'
;
import
{
Modal
}
from
'antd'
;
import
{
Modal
}
from
'antd'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useSelector
}
from
'react-redux'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
RootState
}
from
'@/store'
;
import
{
GlobalDataState
}
from
'@/store/module/globalData'
;
const
ToastModalView
:
React
.
FC
<
{
const
ToastModalView
:
React
.
FC
<
{
open
:
boolean
;
open
:
boolean
;
onCancel
:
()
=>
void
;
onCancel
:
()
=>
void
;
}
>
=
({
open
,
onCancel
})
=>
{
}
>
=
({
open
,
onCancel
})
=>
{
// 路由钩子
const
router
=
useRouter
();
// system
const
globalData
=
useSelector
(
(
state
:
RootState
)
=>
state
.
globalData
,
)
as
GlobalDataState
;
// 关闭弹窗
const
handleClose
=
()
=>
{
onCancel
?.();
// 如果需要返回
if
(
globalData
.
toastModalBack
)
router
.
back
();
};
return
(
return
(
<
Modal
<
Modal
open=
{
open
}
open=
{
open
}
title=
{
'提示'
}
title=
{
'提示'
}
onCancel=
{
onCancel
}
onCancel=
{
handleClose
}
width=
{
400
}
width=
{
400
}
footer=
{
null
}
footer=
{
null
}
>
>
...
...
src/pages/cart/submit/[id].tsx
浏览文件 @
818d7791
...
@@ -83,6 +83,7 @@ const MallCartSubmitView: React.FC<{
...
@@ -83,6 +83,7 @@ const MallCartSubmitView: React.FC<{
dispatch
(
dispatch
(
setGlobalData
({
setGlobalData
({
toastModalVisible
:
true
,
toastModalVisible
:
true
,
toastModalBack
:
true
,
loadingSpinnerVisible
:
false
,
loadingSpinnerVisible
:
false
,
}),
}),
);
);
...
...
src/store/module/globalData.ts
浏览文件 @
818d7791
...
@@ -8,6 +8,7 @@ import { UserAddressSelectList } from '@/api/interface/user';
...
@@ -8,6 +8,7 @@ import { UserAddressSelectList } from '@/api/interface/user';
export
type
GlobalDataState
=
{
export
type
GlobalDataState
=
{
loadingSpinnerVisible
:
boolean
;
loadingSpinnerVisible
:
boolean
;
loginModalVisible
:
boolean
;
loginModalVisible
:
boolean
;
loginModalTitle
?:
string
;
qrcodeModalVisible
:
boolean
;
qrcodeModalVisible
:
boolean
;
qrcodeModalPath
?:
string
;
qrcodeModalPath
?:
string
;
qrcodeModalScene
?:
string
;
qrcodeModalScene
?:
string
;
...
@@ -16,6 +17,7 @@ export type GlobalDataState = {
...
@@ -16,6 +17,7 @@ export type GlobalDataState = {
productSpecNum
?:
number
;
productSpecNum
?:
number
;
priceUnitList
?:
InterDataType
<
ListInspectionPriceUnit
>
;
priceUnitList
?:
InterDataType
<
ListInspectionPriceUnit
>
;
toastModalVisible
:
boolean
;
toastModalVisible
:
boolean
;
toastModalBack
:
boolean
;
};
};
const
initialState
:
GlobalDataState
=
{
const
initialState
:
GlobalDataState
=
{
...
@@ -23,6 +25,7 @@ const initialState: GlobalDataState = {
...
@@ -23,6 +25,7 @@ const initialState: GlobalDataState = {
loginModalVisible
:
false
,
loginModalVisible
:
false
,
qrcodeModalVisible
:
false
,
qrcodeModalVisible
:
false
,
toastModalVisible
:
false
,
toastModalVisible
:
false
,
toastModalBack
:
false
,
};
};
const
globalDataSlice
=
createSlice
({
const
globalDataSlice
=
createSlice
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论