Commit 2395e454 by duxingshan

扫码

parent 5e4a6713
...@@ -23,7 +23,7 @@ export function getCodeApi() { ...@@ -23,7 +23,7 @@ export function getCodeApi() {
//appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d //appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d
let url = let url =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
"wx977825b5a132b74d" + "wx765a55464b308d13" +
"&redirect_uri=" + "&redirect_uri=" +
urlNow + urlNow +
"&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect"; "&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect";
......
...@@ -2,8 +2,8 @@ import { createStore } from "vuex"; ...@@ -2,8 +2,8 @@ import { createStore } from "vuex";
export default createStore({ export default createStore({
state: { state: {
// appid : "wx765a55464b308d13", // 公众号的AppID 2023-08-14 测试的 appid : "wx765a55464b308d13", // 公众号的AppID 2023-08-14 测试的
appid : "wx977825b5a132b74d", // 公众号的AppID 正式的 // appid : "wx977825b5a132b74d", // 公众号的AppID 正式的
imgUrl: "http://43.143.63.140", imgUrl: "http://43.143.63.140",
studentId: "", //学生Id studentId: "", //学生Id
studentName: "", //学生姓名 studentName: "", //学生姓名
......
...@@ -12,8 +12,8 @@ import router from "../router"; ...@@ -12,8 +12,8 @@ import router from "../router";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {tansParams} from "@/utils/common"; import {tansParams} from "@/utils/common";
axios.defaults.baseURL = "/school"; // axios.defaults.baseURL = "/school";
// axios.defaults.baseURL = "/houduan"; axios.defaults.baseURL = "/houduan";
// axios.defaults.baseURL = "/schoolnw"; // axios.defaults.baseURL = "/schoolnw";
// process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095"; // process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095";
......
...@@ -41,63 +41,68 @@ export function scanCodeFun(appId,type){ ...@@ -41,63 +41,68 @@ export function scanCodeFun(appId,type){
'scanQRCode' 'scanQRCode'
], ],
success: function (res){ success: function (res){
wx.scanQRCode({ console.log("res.checkResult.scanQRCode",res.checkResult.scanQRCode)
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, if(res.checkResult.scanQRCode === true){
scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 wx.scanQRCode({
success: function (res) { needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
console.log(777) scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
encode = res.resultStr; // 当needResult 为 1 时,扫码返回的结果 success: function (res) {
if(type == 0){ console.log(777)
// 校产管理页面扫码显示设备信息 encode = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
router.push({ console.log(encode,"encode")
path: "/schoolProperty/equipmentInfo", if(type == 0){
query: { console.log(type,"type")
encode:encode // 校产管理页面扫码显示设备信息
} router.push({
}) path: "/schoolProperty/equipmentInfo",
} query: {
if(type == 1){ encode:encode
// 物品借用 }
router.push({ })
path: "/schoolProperty/borrow/detail", }
query:{ if(type == 1){
encode:encode // 物品借用
} router.push({
}); path: "/schoolProperty/borrow/detail",
}; query:{
if(type == 2){ encode:encode
// 归还管理 }
router.push({ });
path: "/schoolProperty/return/detail", };
query:{ if(type == 2){
encode:encode // 归还管理
} router.push({
}); path: "/schoolProperty/return/detail",
}; query:{
if(type == 3){ encode:encode
// 物品领用 }
router.push({ });
path: "/schoolProperty/use/add", };
query:{ if(type == 3){
encode:encode // 物品领用
} router.push({
}); path: "/schoolProperty/use/add",
}; query:{
if(type == 4){ encode:encode
// 设备报修 }
router.push({ });
path: "/schoolProperty/device/info", };
query:{ if(type == 4){
encode:encode, // 设备报修
name:'新增' router.push({
} path: "/schoolProperty/device/info",
}); query:{
} encode:encode,
}, name:'新增'
fail:function (res){ }
console.log('fail',res) });
} }
}) },
fail:function (res){
console.log('fail',res)
}
})
}
} }
}) })
}); });
......
...@@ -117,13 +117,13 @@ ...@@ -117,13 +117,13 @@
</van-form> </van-form>
</div> </div>
<!-- </div>--> <!-- </div>-->
<van-image <!-- <van-image-->
style="background: #e7f4fb; position: absolute; bottom: 0; height: auto" <!-- style="background: #e7f4fb; position: absolute; bottom: 0; height: auto"-->
:src="require('@/assets/login/loginback.png')" <!-- :src="require('@/assets/login/loginback.png')"-->
fit="contain" <!-- fit="contain"-->
width="100%" <!-- width="100%"-->
height="100%" <!-- height="100%"-->
></van-image> <!-- ></van-image>-->
</div> </div>
</template> </template>
...@@ -366,7 +366,6 @@ export default { ...@@ -366,7 +366,6 @@ export default {
/** 获取OpenId */ /** 获取OpenId */
const checkOpenIdOrWxCookie = async () => { const checkOpenIdOrWxCookie = async () => {
let appid = "wx977825b5a132b74d";
let openId; let openId;
let code = getUrlKey("code"); let code = getUrlKey("code");
console.log('code',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