|
@@ -0,0 +1,173 @@
|
|
1
|
+<html>
|
|
2
|
+
|
|
3
|
+<head>
|
|
4
|
+ <title>jolijoli</title>
|
|
5
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
6
|
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
|
|
7
|
+ <!-- <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.1/weui.min.css">
|
|
8
|
+ </link> -->
|
|
9
|
+ <link rel="icon" href="./image/icon_logo.png" type="image/x-icon">
|
|
10
|
+ <script src="./jquery.js"></script>
|
|
11
|
+ <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
12
|
+ <style>
|
|
13
|
+ html,body,p {
|
|
14
|
+ margin: 0;
|
|
15
|
+ padding: 0;
|
|
16
|
+ }
|
|
17
|
+ img {
|
|
18
|
+ width: 100%;
|
|
19
|
+ }
|
|
20
|
+ .fixed {
|
|
21
|
+ position: fixed;
|
|
22
|
+ bottom: 0;
|
|
23
|
+ left: 0;
|
|
24
|
+ width: 100%;
|
|
25
|
+ height: 98px;
|
|
26
|
+ background-color: #fff;
|
|
27
|
+ }
|
|
28
|
+ .model {
|
|
29
|
+ position: fixed;
|
|
30
|
+ left: 0;
|
|
31
|
+ top: 0;
|
|
32
|
+ width: 100%;
|
|
33
|
+ height: 100%;
|
|
34
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
35
|
+ display: flex;
|
|
36
|
+ justify-content: center;
|
|
37
|
+ align-items: center;
|
|
38
|
+ }
|
|
39
|
+ .model img{
|
|
40
|
+ width: 70%;
|
|
41
|
+ }
|
|
42
|
+ </style>
|
|
43
|
+</head>
|
|
44
|
+
|
|
45
|
+<body>
|
|
46
|
+ <div class="box">
|
|
47
|
+
|
|
48
|
+ </div>
|
|
49
|
+ <div style="height: 98px;"></div>
|
|
50
|
+ <div class="fixed">
|
|
51
|
+ <div class="btm-btn-wx" style="display: block;">
|
|
52
|
+ <!-- <wx-open-launch-weapp id="launch-btn" username="gh_38d7446511dd" path="pages/home/home.html">
|
|
53
|
+ <template>
|
|
54
|
+ <style>
|
|
55
|
+ img {
|
|
56
|
+ width: 100%;
|
|
57
|
+ }
|
|
58
|
+ .img {
|
|
59
|
+ width: 100%;
|
|
60
|
+ }
|
|
61
|
+ </style>
|
|
62
|
+ <div style="padding: 20px;">
|
|
63
|
+ <img class="img btn-img" src="https://test-m.ijolijoli.com/image/image_07.png" alt="">
|
|
64
|
+ <img class="img btn-img" src="" alt="">
|
|
65
|
+ </div>
|
|
66
|
+ </template>
|
|
67
|
+ </wx-open-launch-weapp> -->
|
|
68
|
+ </div>
|
|
69
|
+ <div class="btm-btn" style="display: none;">
|
|
70
|
+ <div style="padding: 20px;">
|
|
71
|
+ <img class="img btn-img" src="./image/image_07.png" alt="">
|
|
72
|
+ </div>
|
|
73
|
+ </div>
|
|
74
|
+ </div>
|
|
75
|
+ <div class="model" style="display: none;">
|
|
76
|
+ <img class="wx-code" src="./image/wx_code.jpg" alt="">
|
|
77
|
+ </div>
|
|
78
|
+
|
|
79
|
+ <script type="text/javascript">
|
|
80
|
+ $(document).ready(function () {
|
|
81
|
+ let host = window.location.host;
|
|
82
|
+ let api_url,data_url;
|
|
83
|
+ if(host == "m.ijolijoli.com") {
|
|
84
|
+ api_url = 'https://api.ijolijoli.com'
|
|
85
|
+ data_url = "https://m.ijolijoli.com"
|
|
86
|
+ } else if(host == "test-m.ijolijoli.com") {
|
|
87
|
+ api_url = 'https://test-api.ijolijoli.com'
|
|
88
|
+ data_url = "https://test-m.ijolijoli.com"
|
|
89
|
+ } else {
|
|
90
|
+ api_url = 'https://test-api.ijolijoli.com'
|
|
91
|
+ data_url = "https://test-m.ijolijoli.com"
|
|
92
|
+ }
|
|
93
|
+ console.log(host)
|
|
94
|
+ function dff() {
|
|
95
|
+ $.ajax({
|
|
96
|
+ url: `${api_url}/api/show`,
|
|
97
|
+ type: 'GET',
|
|
98
|
+ data:{
|
|
99
|
+ url: data_url + '/'
|
|
100
|
+ },
|
|
101
|
+ success: function (res) {
|
|
102
|
+ console.log('33333')
|
|
103
|
+ let str = `<wx-open-launch-weapp id="launch-btn" username="gh_38d7446511dd" path="pages/home/home.html">
|
|
104
|
+ <template>
|
|
105
|
+ <style>
|
|
106
|
+ img {
|
|
107
|
+ width: 100%;
|
|
108
|
+ }
|
|
109
|
+ .img {
|
|
110
|
+ width: 100%;
|
|
111
|
+ }
|
|
112
|
+ </style>
|
|
113
|
+ <div style="padding: 20px;">
|
|
114
|
+ <img class="img btn-img" src="${res.data.btn_image_url}" alt="">
|
|
115
|
+ </div>
|
|
116
|
+ </template>
|
|
117
|
+ </wx-open-launch-weapp>`
|
|
118
|
+ $('.btm-btn-wx').html(str)
|
|
119
|
+ $('.box').html(res.data.content)
|
|
120
|
+ $('.btn-img').attr('src',res.data.btn_image_url);
|
|
121
|
+ $('.wx-code').attr('src',res.data.wxmini_image_url)
|
|
122
|
+ wx.config({
|
|
123
|
+ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
124
|
+ appId: res.data.jssdk.appId, // 必填,公众号的唯一标识
|
|
125
|
+ timestamp: res.data.jssdk.timestamp, // 必填,生成签名的时间戳
|
|
126
|
+ nonceStr: res.data.jssdk.nonceStr, // 必填,生成签名的随机串
|
|
127
|
+ signature: res.data.jssdk.signature,// 必填,签名
|
|
128
|
+ jsApiList: ['chooseImage', 'previewImage'], // 必填,需要使用的JS接口列表
|
|
129
|
+ openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表
|
|
130
|
+ });
|
|
131
|
+ // wx.config(res.data)
|
|
132
|
+ }
|
|
133
|
+ });
|
|
134
|
+ }
|
|
135
|
+ dff();
|
|
136
|
+
|
|
137
|
+ var ua = window.navigator.userAgent.toLowerCase();// 不加window部分Android机会显示不了提示图,即判断不了是否是微信
|
|
138
|
+ if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
|
139
|
+ $('.btm-btn').hide()
|
|
140
|
+ $('.btm-btn-wx').show()
|
|
141
|
+ wx.ready(function () {
|
|
142
|
+ console.log('config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中')
|
|
143
|
+
|
|
144
|
+ var btn = document.getElementById('launch-btn');
|
|
145
|
+ btn.addEventListener('launch', function (e) {
|
|
146
|
+ console.log('success');
|
|
147
|
+ // alert('success')
|
|
148
|
+ });
|
|
149
|
+ btn.addEventListener('error', function (e) {
|
|
150
|
+ console.log('fail', e.detail);
|
|
151
|
+ alert('fail', e.detail)
|
|
152
|
+ // alert('fail', e.detail)
|
|
153
|
+ });
|
|
154
|
+ });
|
|
155
|
+ } else {
|
|
156
|
+ $('.btm-btn').show()
|
|
157
|
+ $('.btm-btn-wx').hide()
|
|
158
|
+ }
|
|
159
|
+
|
|
160
|
+ $('.btm-btn').on('click',function() {
|
|
161
|
+ $('.model').show()
|
|
162
|
+ })
|
|
163
|
+
|
|
164
|
+ $('.model').on('click',function() {
|
|
165
|
+ $('.model').hide()
|
|
166
|
+ })
|
|
167
|
+
|
|
168
|
+ })
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+ </script>
|
|
173
|
+</body>
|