Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
mp
user
Commits
017b947f
Commit
017b947f
authored
May 30, 2023
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
15f4467a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
10 deletions
+47
-10
components/bocft-popup/initPopup.js
+12
-2
pages/menu/menu.vue
+8
-0
request/menu/index.js
+4
-0
request/user/index.js
+23
-8
No files found.
components/bocft-popup/initPopup.js
View file @
017b947f
...
@@ -13,8 +13,15 @@ export default function initPopup(v) {
...
@@ -13,8 +13,15 @@ export default function initPopup(v) {
state
.
show
=
false
state
.
show
=
false
},
},
showPopup
(
state
,
data
)
{
showPopup
(
state
,
data
)
{
state
=
Object
.
assign
(
state
,
data
)
state
.
url
=
''
state
.
show
=
true
state
.
title
=
''
console
.
log
(
data
,
'data'
)
const
timer
=
setTimeout
(()
=>
{
state
.
url
=
data
.
url
state
.
title
=
data
.
title
state
.
show
=
true
clearTimeout
(
timer
)
},
1
);
},
},
}
}
})
})
...
@@ -26,4 +33,7 @@ export default function initPopup(v) {
...
@@ -26,4 +33,7 @@ export default function initPopup(v) {
v
.
prototype
.
$popupStore
.
commit
(
'showPopup'
,
option
)
v
.
prototype
.
$popupStore
.
commit
(
'showPopup'
,
option
)
}
}
}
}
v
.
prototype
.
closePopup
=
function
(
option
)
{
v
.
prototype
.
$popupStore
.
commit
(
'closePopup'
)
}
}
}
pages/menu/menu.vue
View file @
017b947f
...
@@ -207,6 +207,14 @@ export default {
...
@@ -207,6 +207,14 @@ export default {
}
else
{
}
else
{
Store
.
commit
(
"setMenuOption"
,
optionDecode
);
Store
.
commit
(
"setMenuOption"
,
optionDecode
);
}
}
}
else
{
if
(
this
.
userms
)
{
const
sendData
=
{
phone
:
this
.
userInfo
.
phoneNumber
,
user_id
:
this
.
userInfo
.
id
,
};
Menu
.
sendUserCoupon
(
sendData
);
}
}
}
uni
.
getSetting
({
uni
.
getSetting
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
...
...
request/menu/index.js
View file @
017b947f
...
@@ -136,6 +136,10 @@ export default {
...
@@ -136,6 +136,10 @@ export default {
return
uni
.
$u
.
http
return
uni
.
$u
.
http
.
post
(
"/v1/issue/user/coupon"
,
data
)
.
post
(
"/v1/issue/user/coupon"
,
data
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
const
{
url
,
flag
,
title
}
=
res
.
data
.
data
if
(
flag
===
1
)
{
context
.
showPopup
({
url
:
url
,
title
:
title
});
}
return
res
;
return
res
;
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
...
request/user/index.js
View file @
017b947f
...
@@ -152,6 +152,10 @@ export default {
...
@@ -152,6 +152,10 @@ export default {
.
post
(
"/v1/issue/user/coupon"
,
data
)
.
post
(
"/v1/issue/user/coupon"
,
data
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
Store
.
commit
(
"setMenuOption"
,
{});
Store
.
commit
(
"setMenuOption"
,
{});
const
{
url
,
flag
,
title
}
=
res
.
data
.
data
if
(
flag
===
1
)
{
context
.
showPopup
({
url
:
url
,
title
:
title
});
}
return
res
;
return
res
;
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -190,20 +194,31 @@ export default {
...
@@ -190,20 +194,31 @@ export default {
uni
.
setStorageSync
(
"UserInfo"
,
sendData
);
uni
.
setStorageSync
(
"UserInfo"
,
sendData
);
this
.
getCouponImg
()
this
.
getCouponImg
()
const
MenuOption
=
Store
.
state
.
user
.
menuOption
;
const
MenuOption
=
Store
.
state
.
user
.
menuOption
;
if
(
JSON
.
stringify
(
MenuOption
)
!==
"{}"
)
{
if
(
JSON
.
stringify
(
MenuOption
)
!==
"{}"
)
{
// 扫码进入逻辑
const
{
num
,
serial_no
,
source
,
serials
}
=
MenuOption
;
const
{
num
,
serial_no
,
source
,
serials
}
=
MenuOption
;
if
(
source
)
{
const
sendDataOption
=
{
phone
:
sendData
.
phoneNumber
,
user_id
:
sendData
.
id
,
source
:
source
,
param
:
JSON
.
stringify
({
serial_no
,
num
,
serials
}),
};
this
.
sendUserCoupon
(
sendDataOption
);
}
}
else
{
// 非扫码进入逻辑
const
sendDataOption
=
{
const
sendDataOption
=
{
phone
:
sendData
.
phoneNumber
,
phone
:
sendData
.
phoneNumber
,
user_id
:
sendData
.
id
,
user_id
:
sendData
.
id
source
:
source
,
param
:
JSON
.
stringify
({
serial_no
,
num
,
serials
}),
};
};
this
.
sendUserCoupon
(
sendDataOption
);
this
.
sendUserCoupon
(
sendDataOption
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
context
.
showToast
({
context
.
showToast
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment