From c2cb12bcd295512de34023fd3b0943fc8ab75f34 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 19 八月 2025 09:31:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
h5/App.vue | 301 ++++++++++++++++++++++++-------------------------
1 files changed, 146 insertions(+), 155 deletions(-)
diff --git a/h5/App.vue b/h5/App.vue
index bba739d..f037b3a 100644
--- a/h5/App.vue
+++ b/h5/App.vue
@@ -1,7 +1,8 @@
<script>
export default {
onLaunch: function() {
- this.init()
+ // this.init()
+ this.initRegister()
},
onShow: function() {
console.log('App Show')
@@ -10,174 +11,26 @@
console.log('App Hide')
},
methods: {
- async init() {
- // ShiXuHui GuoJiWenWu
- if (!this.$store.state.userInfo) {
- let res = await this.$u.api.login({ code: 'GuoJiWenWu' })
- if (res.code === 200) {
- this.$store.commit('setUserInfo', res.data)
- }
- }
- return
- let code = this.getQueryVariable('code')
- if (code) {
- if (!uni.getStorageSync('code')) {
- uni.setStorageSync('code', code);
-
- let res = await this.$u.api.login({ code: code })
- if (res.code === 200) {
- this.$store.commit('setUserInfo', res.data)
- this.initRegister()
-
- // 鍒ゆ柇鏄惁璺宠浆璇︽儏
- let url = window.location.href
- if (url.indexOf('state=') !== -1 && url.indexOf('#') !== -1) {
- let value = url.substring(url.indexOf('state=') + 6, url.indexOf('#')).split('_')
- console.log(value)
- if (value[0] !== '') {
- if (value[0] == 0) {
- uni.navigateTo({
- url: `/pages/details_she/details_she?id=${value[1]}`
- })
- } else if (value[0] == 1) {
- uni.navigateTo({
- url: `/pages/details_dca/details_dca?id=${value[1]}&isShow=true`
- })
- } else if (value[0] == 3) {
- uni.navigateTo({
- url: `/pages/workOrder_she/workOrder_she?id=${value[1]}`
- })
- }
- }
- }
- }
- } else if (uni.getStorageSync('code') !== code) {
- uni.setStorageSync('code', code);
- let res = await this.$u.api.login({ code: code })
- if (res.code === 200) {
- this.$store.commit('setUserInfo', res.data)
- this.initRegister()
-
- // 鍒ゆ柇鏄惁璺宠浆璇︽儏
- let url = window.location.href
- if (url.indexOf('state=') !== -1 && url.indexOf('#') !== -1) {
- let value = url.substring(url.indexOf('state=') + 6, url.indexOf('#')).split('_')
- console.log(value)
- if (value[0] !== '') {
- if (value[0] == 0) {
- uni.navigateTo({
- url: `/pages/details_she/details_she?id=${value[1]}`
- })
- } else if (value[0] == 1) {
- uni.navigateTo({
- url: `/pages/details_dca/details_dca?id=${value[1]}&isShow=true`
- })
- } else if (value[0] == 3) {
- uni.navigateTo({
- url: `/pages/workOrder_she/workOrder_she?id=${value[1]}`
- })
- }
- }
- }
- }
-
- } else {
- let loc_href = encodeURIComponent("https://dmtest.ahapp.net/lianhelihua_web/")
-
- let corpId = 'wweea8f71b54e3b835';
- let agentId = '1000095';
-
- let wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${corpId}&redirect_uri=${loc_href}&response_type=code&scope=snsapi_base&state=#wechat_redirect`
-
- location.href = wxUrl;
- }
- } else {
- let loc_href = encodeURIComponent("https://dmtest.ahapp.net/lianhelihua_web/")
-
- let corpId = 'wweea8f71b54e3b835';
- let agentId = '1000095';
-
- let wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${corpId}&redirect_uri=${loc_href}&response_type=code&scope=snsapi_base&state=#wechat_redirect`
-
- location.href = wxUrl;
- }
- // ShiXuHui
- // if (!this.$store.state.userInfo) {
- // let res = await this.$u.api.login({ code: 'GuoJiWenWu' })
- // if (res.code === 200) {
- // this.$store.commit('setUserInfo', res.data)
- // }
- // }
- // return
- // let code = this.getQueryVariable('code')
- // if (code) {
- // let res = await this.$u.api.login({ code: code })
- // if (res.code === 200) {
- // this.$store.commit('setUserInfo', res.data)
- // this.initRegister()
-
- // // 鍒ゆ柇鏄惁璺宠浆璇︽儏
- // let url = window.location.href
- // if (url.indexOf('state=') !== -1 && url.indexOf('#') !== -1) {
- // let value = url.substring(url.indexOf('state=') + 6, url.indexOf('#')).split('_')
- // console.log(value)
- // if (value[0] !== '') {
- // if (value[0] == 0) {
- // uni.navigateTo({
- // url: `/pages/details_she/details_she?id=${value[1]}`
- // })
- // } else if (value[0] == 1) {
- // uni.navigateTo({
- // url: `/pages/workOrder_dca/workOrder_dca?id=${value[1]}`
- // })
- // } else if (value[0] == 3) {
- // uni.navigateTo({
- // url: `/pages/workOrder_she/workOrder_she?id=${value[1]}`
- // })
- // }
- // }
- // }
- // }
- // } else {
- // let loc_href = encodeURIComponent("https://dmtest.ahapp.net/lianhelihua_web/")
-
- // let corpId = 'wweea8f71b54e3b835';
- // let agentId = '1000095';
-
- // let wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${corpId}&redirect_uri=${loc_href}&response_type=code&scope=snsapi_base&state=#wechat_redirect`
-
- // location.href = wxUrl;
- // }
- },
- // 鑾峰彇url鍙傛暟
- getQueryVariable(variable) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == variable) {
- return pair[1];
- }
- }
- return (false);
- },
async initRegister() {
let fullURL = window.location.href.substring(0, window.location.href.lastIndexOf('#'))
console.log(fullURL)
let resData = await this.$u.api.getQwSignature({ url: fullURL })
if (resData.code === 200) {
this.$ww.register({
- corpId: 'wweea8f71b54e3b835',
- agentId: '1000095',
+ corpId: 'ww08b163f924524474',
+ agentId: '1000165',
jsApiList: [
'initOpenData',
- 'selectEnterpriseContact'
+ 'selectEnterpriseContact',
+ 'chooseImage',
+ 'uploadImage'
],
getConfigSignature: (url) => {
console.log(this.$ww.getSignature(resData.data.ticket))
return this.$ww.getSignature(resData.data.ticket)
}
})
+ console.log(this.$ww)
this.$ww.initOpenData({
success: (res) => {
console.log('success', res)
@@ -188,6 +41,144 @@
})
}
}
+ // async init() {
+ // // ShiXuHui GuoJiWenWu
+ // if (!this.$store.state.userInfo) {
+ // let res = await this.$u.api.login({ code: 'GuoJiWenWu' })
+ // if (res.code === 200) {
+ // this.$store.commit('setUserInfo', res.data)
+ // }
+ // }
+ // return
+ // let code = this.getQueryVariable('code')
+ // if (code) {
+ // if (!uni.getStorageSync('code')) {
+ // uni.setStorageSync('code', code);
+
+ // let res = await this.$u.api.login({ code: code })
+ // if (res.code === 200) {
+ // this.$store.commit('setUserInfo', res.data)
+ // this.initRegister()
+
+ // // 鍒ゆ柇鏄惁璺宠浆璇︽儏
+ // let url = window.location.href
+ // if (url.indexOf('state=') !== -1 && url.indexOf('#') !== -1) {
+ // let value = url.substring(url.indexOf('state=') + 6, url.indexOf('#')).split('_')
+ // console.log(value)
+ // if (value[0] !== '') {
+ // if (value[0] == 0) {
+ // uni.navigateTo({
+ // url: `/pages/details_she/details_she?id=${value[1]}`
+ // })
+ // } else if (value[0] == 1) {
+ // uni.navigateTo({
+ // url: `/pages/details_dca/details_dca?id=${value[1]}&isShow=true`
+ // })
+ // } else if (value[0] == 3) {
+ // uni.navigateTo({
+ // url: `/pages/workOrder_she/workOrder_she?id=${value[1]}`
+ // })
+ // }
+ // }
+ // }
+ // }
+ // } else if (uni.getStorageSync('code') !== code) {
+
+ // uni.setStorageSync('code', code);
+
+ // let res = await this.$u.api.login({ code: code })
+ // if (res.code === 200) {
+ // this.$store.commit('setUserInfo', res.data)
+ // this.initRegister()
+
+ // // 鍒ゆ柇鏄惁璺宠浆璇︽儏
+ // let url = window.location.href
+ // if (url.indexOf('state=') !== -1 && url.indexOf('#') !== -1) {
+ // let value = url.substring(url.indexOf('state=') + 6, url.indexOf('#')).split('_')
+ // console.log(value)
+ // if (value[0] !== '') {
+ // if (value[0] == 0) {
+ // uni.navigateTo({
+ // url: `/pages/details_she/details_she?id=${value[1]}`
+ // })
+ // } else if (value[0] == 1) {
+ // uni.navigateTo({
+ // url: `/pages/details_dca/details_dca?id=${value[1]}&isShow=true`
+ // })
+ // } else if (value[0] == 3) {
+ // uni.navigateTo({
+ // url: `/pages/workOrder_she/workOrder_she?id=${value[1]}`
+ // })
+ // }
+ // }
+ // }
+ // }
+
+ // } else {
+ // // test.doumee.cn
+ // // dmtest.ahapp.net
+ // let loc_href = encodeURIComponent("https://test.doumee.cn/lianhelihua_web/")
+
+ // let corpId = 'wweea8f71b54e3b835';
+ // let agentId = '1000095';
+
+ // let wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${corpId}&redirect_uri=${loc_href}&response_type=code&scope=snsapi_base&state=#wechat_redirect`
+
+ // location.href = wxUrl;
+ // }
+ // } else {
+ // let loc_href = encodeURIComponent("https://test.doumee.cn/lianhelihua_web/")
+
+ // let corpId = 'wweea8f71b54e3b835';
+ // let agentId = '1000095';
+
+ // let wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${corpId}&redirect_uri=${loc_href}&response_type=code&scope=snsapi_base&state=#wechat_redirect`
+
+ // location.href = wxUrl;
+ // }
+ // },
+ // // 鑾峰彇url鍙傛暟
+ // getQueryVariable(variable) {
+ // var query = window.location.search.substring(1);
+ // var vars = query.split("&");
+ // for (var i = 0; i < vars.length; i++) {
+ // var pair = vars[i].split("=");
+ // if (pair[0] == variable) {
+ // return pair[1];
+ // }
+ // }
+ // return (false);
+ // },
+ // async initRegister() {
+ // let fullURL = window.location.href.substring(0, window.location.href.lastIndexOf('#'))
+ // console.log(fullURL)
+ // let resData = await this.$u.api.getQwSignature({ url: fullURL })
+ // if (resData.code === 200) {
+ // this.$ww.register({
+ // corpId: 'wweea8f71b54e3b835',
+ // agentId: '1000095',
+ // jsApiList: [
+ // 'initOpenData',
+ // 'selectEnterpriseContact',
+ // 'chooseImage',
+ // 'uploadImage'
+ // ],
+ // getConfigSignature: (url) => {
+ // console.log(this.$ww.getSignature(resData.data.ticket))
+ // return this.$ww.getSignature(resData.data.ticket)
+ // }
+ // })
+ // console.log(this.$ww)
+ // this.$ww.initOpenData({
+ // success: (res) => {
+ // console.log('success', res)
+ // },
+ // fail: (err) => {
+ // console.log('fail', err)
+ // }
+ // })
+ // }
+ // }
}
}
</script>
--
Gitblit v1.9.3