|
@@ -1,6 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="playlet-group-wrap">
|
3
|
|
- <van-list
|
|
3
|
+ <!-- <van-list
|
4
|
4
|
v-model:loading="playletGroup.loading"
|
5
|
5
|
:finished="playletGroup.finished"
|
6
|
6
|
finished-text="没有更多了"
|
|
@@ -11,7 +11,8 @@
|
11
|
11
|
<div class="p-name">{{ item.name }}</div>
|
12
|
12
|
<van-image class="p-img" :src="item.avatar" radius="10" fit="cover" />
|
13
|
13
|
</div>
|
14
|
|
- </van-list>
|
|
14
|
+ </van-list> -->
|
|
15
|
+ <button @click="onClickMiniapp">跳转小程序</button>
|
15
|
16
|
</div>
|
16
|
17
|
</template>
|
17
|
18
|
|
|
@@ -35,29 +36,29 @@ const params = reactive({
|
35
|
36
|
user_id: getQueryString('user_id'),
|
36
|
37
|
})
|
37
|
38
|
|
38
|
|
-// onBeforeMount(() => {//组件挂载之前
|
39
|
|
-// if (getQueryString('againJump')) {
|
40
|
|
-// params.corpid = getQueryString('corpid')
|
41
|
|
-// params.rule_id = getQueryString('rule_id')
|
42
|
|
-// params.user_id = getQueryString('user_id')
|
43
|
|
-// getWxConfig(() => {
|
44
|
|
-// // handleGetSopDetail()
|
45
|
|
-// });
|
46
|
|
-// } else {//获取用户信息
|
47
|
|
-// getWxConfig('', (authInfo) => {
|
48
|
|
-// let redirect_uri = encodeURIComponent(window.location.href + '&againJump=true')
|
49
|
|
-// let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${authInfo.corpid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=1&agentid=${authInfo.agent_id}#wechat_redirect`;
|
50
|
|
-// let link = document.createElement("a");
|
51
|
|
-// link.href = url;
|
52
|
|
-// document.body.appendChild(link);
|
53
|
|
-// link.click();
|
54
|
|
-// document.body.removeChild(link);
|
55
|
|
-// });
|
56
|
|
-// }
|
57
|
|
-// });
|
|
39
|
+onBeforeMount(() => {//组件挂载之前
|
|
40
|
+ if (getQueryString('againJump')) {
|
|
41
|
+ params.corpid = getQueryString('corpid')
|
|
42
|
+ params.rule_id = getQueryString('rule_id')
|
|
43
|
+ params.user_id = getQueryString('user_id')
|
|
44
|
+ getWxConfig(() => {
|
|
45
|
+ // handleGetPlayletGroup()
|
|
46
|
+ });
|
|
47
|
+ } else {//获取用户信息
|
|
48
|
+ getWxConfig('', (authInfo) => {
|
|
49
|
+ let redirect_uri = encodeURIComponent(window.location.href + '&againJump=true')
|
|
50
|
+ let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${authInfo.corpid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=1&agentid=${authInfo.agent_id}#wechat_redirect`;
|
|
51
|
+ let link = document.createElement("a");
|
|
52
|
+ link.href = url;
|
|
53
|
+ document.body.appendChild(link);
|
|
54
|
+ link.click();
|
|
55
|
+ document.body.removeChild(link);
|
|
56
|
+ });
|
|
57
|
+ }
|
|
58
|
+});
|
58
|
59
|
|
59
|
60
|
onMounted(() => {
|
60
|
|
- handleGetPlayletGroup()
|
|
61
|
+ // handleGetPlayletGroup()
|
61
|
62
|
})
|
62
|
63
|
|
63
|
64
|
|
|
@@ -102,6 +103,20 @@ const handleGetPlayletGroup = async () => {
|
102
|
103
|
}
|
103
|
104
|
}
|
104
|
105
|
|
|
106
|
+const onClickMiniapp = () => {
|
|
107
|
+ wx.invoke('launchMiniprogram', {
|
|
108
|
+ "appid" : "wx34a41e0e17327363", // 需跳转的小程序appid
|
|
109
|
+ "path" : "/pages/index/index.html?pathId=63856f98b86c030805fad962", // 所需跳转的小程序内页面路径及参数。非必填
|
|
110
|
+ }, function(res) {
|
|
111
|
+ if(res.err_msg == "launchMiniprogram:ok") {
|
|
112
|
+ // 正常
|
|
113
|
+ } else {
|
|
114
|
+ // 错误处理
|
|
115
|
+ }
|
|
116
|
+ }
|
|
117
|
+ );
|
|
118
|
+}
|
|
119
|
+
|
105
|
120
|
</script>
|
106
|
121
|
|
107
|
122
|
<style lang="scss" scoped>
|