Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_zhxy
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_zhxy
Commits
2395e454
Commit
2395e454
authored
Aug 25, 2023
by
duxingshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
扫码
parent
5e4a6713
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
70 deletions
+74
-70
src/service/utils.js
+1
-1
src/store/index.js
+2
-2
src/utils/axios.js
+2
-2
src/utils/scanCode.js
+62
-57
src/views/login/login.vue
+7
-8
vue.config.js
+0
-0
No files found.
src/service/utils.js
View file @
2395e454
...
...
@@ -23,7 +23,7 @@ export function getCodeApi() {
//appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d
let
url
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
"wx
977825b5a132b74d
"
+
"wx
765a55464b308d13
"
+
"&redirect_uri="
+
urlNow
+
"&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect"
;
...
...
src/store/index.js
View file @
2395e454
...
...
@@ -2,8 +2,8 @@ import { createStore } from "vuex";
export
default
createStore
({
state
:
{
//
appid : "wx765a55464b308d13", // 公众号的AppID 2023-08-14 测试的
appid
:
"wx977825b5a132b74d"
,
// 公众号的AppID 正式的
appid
:
"wx765a55464b308d13"
,
// 公众号的AppID 2023-08-14 测试的
//
appid : "wx977825b5a132b74d", // 公众号的AppID 正式的
imgUrl
:
"http://43.143.63.140"
,
studentId
:
""
,
//学生Id
studentName
:
""
,
//学生姓名
...
...
src/utils/axios.js
View file @
2395e454
...
...
@@ -12,8 +12,8 @@ import router from "../router";
import
{
getToken
}
from
"@/utils/auth"
;
import
{
tansParams
}
from
"@/utils/common"
;
axios
.
defaults
.
baseURL
=
"/school"
;
//
axios.defaults.baseURL = "/houduan";
//
axios.defaults.baseURL = "/school";
axios
.
defaults
.
baseURL
=
"/houduan"
;
// axios.defaults.baseURL = "/schoolnw";
// process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095";
...
...
src/utils/scanCode.js
View file @
2395e454
...
...
@@ -41,63 +41,68 @@ export function scanCodeFun(appId,type){
'scanQRCode'
],
success
:
function
(
res
){
wx
.
scanQRCode
({
needResult
:
1
,
// 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
scanType
:
[
"qrCode"
,
"barCode"
],
// 可以指定扫二维码还是一维码,默认二者都有
success
:
function
(
res
)
{
console
.
log
(
777
)
encode
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
if
(
type
==
0
){
// 校产管理页面扫码显示设备信息
router
.
push
({
path
:
"/schoolProperty/equipmentInfo"
,
query
:
{
encode
:
encode
}
})
}
if
(
type
==
1
){
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
2
){
// 归还管理
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
3
){
// 物品领用
router
.
push
({
path
:
"/schoolProperty/use/add"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
4
){
// 设备报修
router
.
push
({
path
:
"/schoolProperty/device/info"
,
query
:{
encode
:
encode
,
name
:
'新增'
}
});
}
},
fail
:
function
(
res
){
console
.
log
(
'fail'
,
res
)
}
})
console
.
log
(
"res.checkResult.scanQRCode"
,
res
.
checkResult
.
scanQRCode
)
if
(
res
.
checkResult
.
scanQRCode
===
true
){
wx
.
scanQRCode
({
needResult
:
1
,
// 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
scanType
:
[
"qrCode"
,
"barCode"
],
// 可以指定扫二维码还是一维码,默认二者都有
success
:
function
(
res
)
{
console
.
log
(
777
)
encode
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
console
.
log
(
encode
,
"encode"
)
if
(
type
==
0
){
console
.
log
(
type
,
"type"
)
// 校产管理页面扫码显示设备信息
router
.
push
({
path
:
"/schoolProperty/equipmentInfo"
,
query
:
{
encode
:
encode
}
})
}
if
(
type
==
1
){
// 物品借用
router
.
push
({
path
:
"/schoolProperty/borrow/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
2
){
// 归还管理
router
.
push
({
path
:
"/schoolProperty/return/detail"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
3
){
// 物品领用
router
.
push
({
path
:
"/schoolProperty/use/add"
,
query
:{
encode
:
encode
}
});
};
if
(
type
==
4
){
// 设备报修
router
.
push
({
path
:
"/schoolProperty/device/info"
,
query
:{
encode
:
encode
,
name
:
'新增'
}
});
}
},
fail
:
function
(
res
){
console
.
log
(
'fail'
,
res
)
}
})
}
}
})
});
...
...
src/views/login/login.vue
View file @
2395e454
...
...
@@ -117,13 +117,13 @@
</van-form>
</div>
<!--
</div>
-->
<van-image
style=
"background: #e7f4fb; position: absolute; bottom: 0; height: auto"
:src=
"require('@/assets/login/loginback.png')"
fit=
"contain"
width=
"100%"
height=
"100%"
></van-image
>
<!--
<van-image-->
<!-- style="background: #e7f4fb; position: absolute; bottom: 0; height: auto"-->
<!-- :src="require('@/assets/login/loginback.png')"-->
<!-- fit="contain"-->
<!-- width="100%"-->
<!-- height="100%"-->
<!-- >
</van-image>
--
>
</div>
</
template
>
...
...
@@ -366,7 +366,6 @@ export default {
/** 获取OpenId */
const
checkOpenIdOrWxCookie
=
async
()
=>
{
let
appid
=
"wx977825b5a132b74d"
;
let
openId
;
let
code
=
getUrlKey
(
"code"
);
console
.
log
(
'code'
,
code
);
...
...
vue.config.js
View file @
2395e454
No preview for this file type
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