Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
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
xulili
ybf
Commits
305c6a7e
Commit
305c6a7e
authored
Apr 07, 2020
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测一下大转盘页获取code的情况
parent
c51bb914
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
53 deletions
+100
-53
activeDetail.vue
wx_application/src/views/active/activeDetail.vue
+44
-0
index.vue
wx_application/src/views/mainSale/active/main/index.vue
+56
-53
No files found.
wx_application/src/views/active/activeDetail.vue
View file @
305c6a7e
...
@@ -78,6 +78,7 @@ export default {
...
@@ -78,6 +78,7 @@ export default {
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
code
:
''
,
type
:
"coupon"
,
type
:
"coupon"
,
freeze
:
false
,
freeze
:
false
,
rolling
:
false
,
rolling
:
false
,
...
@@ -119,6 +120,9 @@ export default {
...
@@ -119,6 +120,9 @@ export default {
},
},
created
()
{
created
()
{
this
.
type
=
this
.
$route
.
query
.
type
;
this
.
type
=
this
.
$route
.
query
.
type
;
// 检测用户身份
// 获取code
this
.
zReadyUserId
()
},
},
watch
:
{
watch
:
{
prizeNumber
()
{
prizeNumber
()
{
...
@@ -136,6 +140,46 @@ export default {
...
@@ -136,6 +140,46 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
zReadyUserId
()
{
if
(
this
.
$route
.
query
.
code
===
undefined
)
{
alert
(
"没code"
);
console
.
log
(
'code'
,
this
.
$route
.
query
.
code
);
this
.
zTestPreAuthCode
();
}
else
{
alert
(
"有code"
);
// this.zTestGetNowUrlInfo();
// this.zTestGetUserInfoByOldToken();
}
},
// 获取code
zTestPreAuthCode
()
{
// alert('获取code')
const
basicInfo
=
{
head
:
"https://open.weixin.qq.com/connect/oauth2/authorize?"
,
// appId: "wwd1cdbca7b8b2b6c4",
appId
:
"ww4df265003b43fa0d"
,
redirectUrI
:
encodeURIComponent
(
"oysales.oywanhao.com:8087/activeDetail?id=2&type=wheel"
),
responseType
:
"code"
,
scope
:
"snsapi_base"
,
state
:
"ztest"
,
tail
:
"#wechat_redirect"
};
let
url
=
basicInfo
.
head
+
"appid="
+
basicInfo
.
appId
+
"&redirect_uri="
+
basicInfo
.
redirectUrI
+
"&response_type="
+
basicInfo
.
responseType
+
"&scope="
+
basicInfo
.
scope
+
"&state="
+
basicInfo
.
state
+
basicInfo
.
tail
;
window
.
location
.
href
=
url
;
},
Start_Game
()
{
Start_Game
()
{
this
.
rolling
=
true
;
this
.
rolling
=
true
;
const
{
wheelDeg
,
prizeList
}
=
this
;
const
{
wheelDeg
,
prizeList
}
=
this
;
...
...
wx_application/src/views/mainSale/active/main/index.vue
View file @
305c6a7e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<!--
<div
class=
"menu"
>
<!--
<div
class=
"menu"
>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['1']"
/>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['1']"
/>
<div
class=
"menu-text"
>
优惠券核销
</div>
<div
class=
"menu-text"
>
优惠券核销
</div>
</div>
-->
</div>
-->
<div
class=
"menu"
@
click=
"menu02Click"
>
<div
class=
"menu"
@
click=
"menu02Click"
>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['2']"
/>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['2']"
/>
<div
class=
"menu-text"
>
任务列表
</div>
<div
class=
"menu-text"
>
任务列表
</div>
...
@@ -111,9 +111,9 @@
...
@@ -111,9 +111,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
axios
from
"axios"
import
axios
from
"axios"
;
import
{
getStoreDetail
}
from
"@/api/sidebar/voucher"
;
import
{
getStoreDetail
}
from
"@/api/sidebar/voucher"
;
import
{
configWx
,
getUserInfo
}
from
"@/utils/aCommon"
import
{
configWx
,
getUserInfo
}
from
"@/utils/aCommon"
;
import
{
getUserInfoByUserId
}
from
"@/api/sidebar/voucher"
;
import
{
getUserInfoByUserId
}
from
"@/api/sidebar/voucher"
;
export
default
{
export
default
{
name
:
"discountIndex"
,
name
:
"discountIndex"
,
...
@@ -191,12 +191,11 @@ export default {
...
@@ -191,12 +191,11 @@ export default {
"5"
:
"/mainSale/icon-menuBar-5-ac.png"
"5"
:
"/mainSale/icon-menuBar-5-ac.png"
}
}
}
}
},
}
},
},
dis
:
{},
dis
:
{},
oyStallCode
:
''
,
oyStallCode
:
""
,
userId
:
''
,
userId
:
""
,
zcache
:
{
zcache
:
{
nowUrl
:
""
,
nowUrl
:
""
,
preAuthCodeUrl
:
""
,
preAuthCodeUrl
:
""
,
...
@@ -205,16 +204,14 @@ export default {
...
@@ -205,16 +204,14 @@ export default {
userInfoResOld
:
""
,
userInfoResOld
:
""
,
userInfoResNew
:
""
userInfoResNew
:
""
}
}
}
}
;
},
},
created
()
{
created
()
{
this
.
checkNowMenuBar
()
this
.
checkNowMenuBar
()
;
this
.
zReadyUserId
()
//
this.zReadyUserId()
this
.
zTestGetNowUrlInfo
()
this
.
zTestGetNowUrlInfo
()
;
// this.oyStallCode = sessionStorage.getItem('oyStallCode')
// this.oyStallCode = sessionStorage.getItem('oyStallCode')
// this.userId = sessionStorage.getItem('userId')
// this.userId = sessionStorage.getItem('userId')
},
},
methods
:
{
methods
:
{
// 获取用户信息
// 获取用户信息
...
@@ -225,17 +222,19 @@ export default {
...
@@ -225,17 +222,19 @@ export default {
};
};
axios
({
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/user/get?userId="
+
this
.
zcache
.
userId
,
url
:
"http://139.155.48.151:8085/workWx/auth/user/get?userId="
+
this
.
zcache
.
userId
,
method
:
"get"
,
method
:
"get"
,
headers
:
headerData
headers
:
headerData
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
test
.
manInfo
.
barFrom
=
res
.
data
.
data
.
name
this
.
test
.
manInfo
.
barFrom
=
res
.
data
.
data
.
name
;
this
.
test
.
manInfo
.
logoUrl
=
res
.
data
.
data
.
avatar
this
.
test
.
manInfo
.
logoUrl
=
res
.
data
.
data
.
avatar
;
sessionStorage
.
setItem
(
"avatar"
,
res
.
data
.
data
.
avatar
)
sessionStorage
.
setItem
(
"avatar"
,
res
.
data
.
data
.
avatar
)
;
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
;
});
});
},
},
getFans
()
{
getFans
()
{
...
@@ -245,12 +244,14 @@ export default {
...
@@ -245,12 +244,14 @@ export default {
};
};
axios
({
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId="
+
this
.
zcache
.
userId
,
url
:
"http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId="
+
this
.
zcache
.
userId
,
method
:
"get"
,
method
:
"get"
,
headers
:
headerData
headers
:
headerData
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
test
.
barInfo
.
personalFans
=
res
.
data
.
data
.
length
this
.
test
.
barInfo
.
personalFans
=
res
.
data
.
data
.
length
;
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
);
console
.
log
(
err
);
...
@@ -260,12 +261,12 @@ export default {
...
@@ -260,12 +261,12 @@ export default {
getStore
()
{
getStore
()
{
let
params
=
{
let
params
=
{
oyStallCode
:
this
.
oyStallCode
oyStallCode
:
this
.
oyStallCode
}
}
;
getStoreDetail
(
params
).
then
(
res
=>
{
getStoreDetail
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
stallInfo
!=
null
)
{
if
(
res
.
data
.
stallInfo
!=
null
)
{
this
.
test
.
manInfo
.
barName
=
res
.
data
.
stallInfo
.
name
this
.
test
.
manInfo
.
barName
=
res
.
data
.
stallInfo
.
name
;
}
}
})
})
;
},
},
checkNowMenuBar
()
{
checkNowMenuBar
()
{
let
inData
=
"1"
;
let
inData
=
"1"
;
...
@@ -279,11 +280,11 @@ export default {
...
@@ -279,11 +280,11 @@ export default {
},
},
switchBarClick
()
{
switchBarClick
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'ChangeCounter'
,
path
:
"ChangeCounter"
,
query
:{
query
:
{
userId
:
this
.
zcache
.
userId
userId
:
this
.
zcache
.
userId
}
}
})
})
;
},
},
testButtonClick
()
{},
testButtonClick
()
{},
menu01Click
()
{},
menu01Click
()
{},
...
@@ -319,9 +320,9 @@ export default {
...
@@ -319,9 +320,9 @@ export default {
},
},
// 获取code
// 获取code
zReadyUserId
()
{
zReadyUserId
()
{
if
(
this
.
$route
.
query
.
code
===
undefined
){
if
(
this
.
$route
.
query
.
code
===
undefined
)
{
// alert('没code')
// alert('没code')
this
.
zTestPreAuthCode
()
this
.
zTestPreAuthCode
()
;
}
else
{
}
else
{
// alert('有code')
// alert('有code')
this
.
zTestGetNowUrlInfo
();
this
.
zTestGetNowUrlInfo
();
...
@@ -332,7 +333,7 @@ export default {
...
@@ -332,7 +333,7 @@ export default {
zTestGetNowUrlInfo
()
{
zTestGetNowUrlInfo
()
{
this
.
zcache
.
nowUrl
=
JSON
.
stringify
(
this
.
$route
.
query
);
this
.
zcache
.
nowUrl
=
JSON
.
stringify
(
this
.
$route
.
query
);
this
.
zcache
.
code
=
String
(
this
.
$route
.
query
.
code
);
this
.
zcache
.
code
=
String
(
this
.
$route
.
query
.
code
);
this
.
url
=
this
.
zcache
.
nowUrl
this
.
url
=
this
.
zcache
.
nowUrl
;
},
},
zTestPreAuthCode
()
{
zTestPreAuthCode
()
{
// alert('获取code')
// alert('获取code')
...
@@ -366,39 +367,41 @@ export default {
...
@@ -366,39 +367,41 @@ export default {
// 测试-获取用户信息
// 测试-获取用户信息
zTestGetUserInfoByOldToken
()
{
zTestGetUserInfoByOldToken
()
{
let
postData
=
{
let
postData
=
{
code
:
this
.
zcache
.
code
,
code
:
this
.
zcache
.
code
};
};
let
headerData
=
{
let
headerData
=
{
agentId
:
"1000033"
,
agentId
:
"1000033"
,
corpId
:
"ww4df265003b43fa0d"
corpId
:
"ww4df265003b43fa0d"
};
};
this
.
zcache
.
userInfoResOld
=
"PostData:"
+
JSON
.
stringify
(
postData
)
this
.
zcache
.
userInfoResOld
=
"PostData:"
+
JSON
.
stringify
(
postData
)
;
axios
({
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code="
+
this
.
zcache
.
code
,
url
:
"http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code="
+
this
.
zcache
.
code
,
method
:
"post"
,
method
:
"post"
,
headers
:
headerData
,
headers
:
headerData
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
// alert('获取用户信息接口成功')
// alert('获取用户信息接口成功')
sessionStorage
.
setItem
(
"userId"
,
String
(
res
.
data
.
data
.
userId
))
sessionStorage
.
setItem
(
"userId"
,
String
(
res
.
data
.
data
.
userId
))
;
this
.
zcache
.
userId
=
String
(
res
.
data
.
data
.
userId
)
this
.
zcache
.
userId
=
String
(
res
.
data
.
data
.
userId
)
;
this
.
getUserFromId
(
this
.
zcache
.
userId
)
this
.
getUserFromId
(
this
.
zcache
.
userId
)
;
this
.
getUserInfo
()
this
.
getUserInfo
()
;
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
;
});
});
},
},
getUserFromId
(
id
)
{
getUserFromId
(
id
)
{
let
userName
=
id
let
userName
=
id
;
getUserInfoByUserId
({
userName
}).
then
(
res
=>
{
getUserInfoByUserId
({
userName
})
sessionStorage
.
setItem
(
"oyStallCode"
,
res
.
data
[
0
].
oyStallCode
)
.
then
(
res
=>
{
this
.
oyStallCode
=
res
.
data
[
0
].
oyStallCode
sessionStorage
.
setItem
(
"oyStallCode"
,
res
.
data
[
0
].
oyStallCode
);
this
.
getStore
()
this
.
oyStallCode
=
res
.
data
[
0
].
oyStallCode
;
this
.
getFans
()
this
.
getStore
();
})
this
.
getFans
();
.
catch
(
err
=>
{
})
})
.
catch
(
err
=>
{});
}
}
}
}
};
};
...
...
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