flx:提交中水免登录
This commit is contained in:
parent
253fedc8dd
commit
268616e85e
3
main.js
3
main.js
@ -125,7 +125,8 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// Vue.prototype.url_config = 'http://101.43.164.214:11112/'// 新金湾
|
||||
Vue.prototype.work_url = 'http://101.43.164.214:11137'// 新金湾地址 通用
|
||||
|
||||
Vue.prototype.url_config = 'http://jxj.zhgdyun.com:9500/'// 测试环境h5
|
||||
// Vue.prototype.url_config = 'http://jxj.zhgdyun.com:9500/'// 测试环境h5
|
||||
Vue.prototype.url_config = 'https://192.168.1.2/'// 青海中水北方
|
||||
|
||||
|
||||
// Vue.prototype.url_config = 'http://222.80.185.228:6090/' // 木垒县新能源工程线上地址
|
||||
|
||||
76
pages/homePage/scandownload.vue
Normal file
76
pages/homePage/scandownload.vue
Normal file
@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<view v-if="viewParam.isWeixin" class="scandownload_main"></view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
viewParam: {},
|
||||
scanInfoUrl: "",
|
||||
}
|
||||
},
|
||||
onLoad(ops) {
|
||||
console.log(ops);
|
||||
this.scanInfoUrl = ops.url;
|
||||
this.modelUtilInit();
|
||||
},
|
||||
methods: {
|
||||
//判断浏览器类型
|
||||
modelUtilInit() {
|
||||
var UA = navigator.userAgent,
|
||||
isAndroid = /android|adr/gi.test(UA),
|
||||
isIOS = /iphone|ipod|ipad/gi.test(UA) && !isAndroid,
|
||||
isBlackBerry = /BlackBerry/i.test(UA),
|
||||
isWindowPhone = /IEMobile/i.test(UA),
|
||||
isMobile = isAndroid || isIOS || isBlackBerry || isWindowPhone;
|
||||
this.viewParam = {
|
||||
isAndroid: isAndroid,
|
||||
isIOS: isIOS,
|
||||
isMobile: isMobile,
|
||||
isWeixin: /MicroMessenger/gi.test(UA),
|
||||
isQQ: /QQ/gi.test(UA)
|
||||
};
|
||||
console.log(this.viewParam);
|
||||
this.downloadCourseware()
|
||||
},
|
||||
/** 下载文件 */
|
||||
downloadCourseware() {
|
||||
// plus.runtime.openURL('https://uniapp.dcloud.io/h5')
|
||||
// 判断是否是微信内置浏览器
|
||||
if (this.viewParam.isWeixin) {
|
||||
// 安卓浏览器
|
||||
// if (this.viewParam.isAndroid) {
|
||||
// // var iframe = document.createElement("iframe");
|
||||
// // iframe.style.display = "none";
|
||||
// // iframe.src = 'http://192.168.34.133:20626/123456.xlsx';
|
||||
// // document.body.appendChild(iframe);
|
||||
// // iframe.click();
|
||||
// }
|
||||
// // IOS浏览器
|
||||
// else if (this.viewParam.isIOS) {
|
||||
// var entityDom = document.getElementById('BtnClick');
|
||||
// entityDom.href = this.scanInfoUrl;
|
||||
// entityDom.click();
|
||||
// }
|
||||
// window.location.href = this.scanInfoUrl;
|
||||
// plus.runtime.openURL('https://uniapp.dcloud.io/h5')
|
||||
}
|
||||
// 非微信内置浏览器
|
||||
else {
|
||||
window.location.replace(this.scanInfoUrl);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scandownload_main {
|
||||
width: 100vw;
|
||||
height: 1200rpx;
|
||||
background-image: url('@/static/scandownload_bg.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
</style>
|
||||
93
pages/login/uidLogin.vue
Normal file
93
pages/login/uidLogin.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
opts: {
|
||||
UID: '',
|
||||
type: '',
|
||||
searchsn: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(opts) {
|
||||
console.log(opts);
|
||||
this.opts = opts;
|
||||
this.formSubmit();
|
||||
},
|
||||
methods: {
|
||||
formSubmit(e) {
|
||||
let fileType = this.opts.type;
|
||||
var json = {
|
||||
uid: this.opts.UID,
|
||||
}
|
||||
|
||||
this.sendRequest({
|
||||
url: "xmgl/base/getUserByUid",
|
||||
data: json,
|
||||
method: "POST",
|
||||
success: (res) => {
|
||||
// #ifdef APP-PLUS
|
||||
// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章
|
||||
plus.push.getClientInfoAsync((info) => {
|
||||
const cid = info["clientid"];
|
||||
// console.log(cid,"cidcidcidcidcid")
|
||||
// const cid = "f4b3246189fc051c5875a35e198ca223";
|
||||
const userId = res.result.userId;
|
||||
const jsonParams = {
|
||||
clientId: cid,
|
||||
alias: userId
|
||||
}
|
||||
//触发绑定请求
|
||||
this.sendRequest({
|
||||
url: "xmgl/push/bindAlias", //替换掉后端彭定生的接口
|
||||
data: jsonParams,
|
||||
method: "POST",
|
||||
})
|
||||
});
|
||||
// #endif
|
||||
|
||||
// uni.setStorageSync('account', e.detail.value.account);
|
||||
// uni.setStorageSync('password', e.detail.value.password);
|
||||
uni.setStorageSync('userInfo', JSON.stringify(res.result));
|
||||
this.searchsn = res.result.sn;
|
||||
this.getProjectDetail();
|
||||
setTimeout(() => {
|
||||
const objUrl = {
|
||||
1: '/pages/projectEnd/laborManage/index',
|
||||
2: '/pages/projectEnd/environment/menu'
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: objUrl[fileType]
|
||||
})
|
||||
}, 800);
|
||||
}
|
||||
})
|
||||
},
|
||||
getProjectDetail() {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/project/getProjectInfoBySn',
|
||||
data: {
|
||||
projectSn: this.searchsn
|
||||
// 获取存储数组最底层的projectSn
|
||||
},
|
||||
method: 'POST',
|
||||
success(res) {
|
||||
uni.setStorageSync('projectDetail', JSON.stringify(res.result))
|
||||
// that.loadWeather()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
BIN
static/scandownload_bg.png
Normal file
BIN
static/scandownload_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 482 KiB |
Loading…
x
Reference in New Issue
Block a user