Commit 2395e454 by duxingshan

扫码

parent 5e4a6713
......@@ -23,7 +23,7 @@ export function getCodeApi() {
//appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d
let url =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
"wx977825b5a132b74d" +
"wx765a55464b308d13" +
"&redirect_uri=" +
urlNow +
"&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect";
......
......@@ -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: "", //学生姓名
......
......@@ -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";
......
......@@ -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)
}
})
}
}
})
});
......
......@@ -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);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment