geely-four-service 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/App.vue +66 -0
  2. package/package.json +30 -0
package/App.vue ADDED
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <view class="container">
3
+ <view class="switch">
4
+ <text style="margin-right: 20rpx">是否授权</text>
5
+ <switch :checked="mode === 'auth'" @change="change" />
6
+ </view>
7
+ <view class="item" @click="open({})">直接打开</view>
8
+ <view class="item" @click="open({ mpTitle: '自定义标题' })">自定义标题</view>
9
+ <view class="item" @click="open({ isDisableShared: '1' })">禁用分享</view>
10
+ <view class="item" @click="open({ customShare: '1' })">H5自定义分享</view>
11
+ <view class="item" @click="open({ needLogin: '1' })">必须登录</view>
12
+ <view class="item" @click="open({ needLocation: '1' })">需要经纬度</view>
13
+ <view class="item" @click="open({ isNeedAsInfo: '1' })">需要数据分析(仅抖音)</view>
14
+ <view class="item" @click="open({ ccode: 'test_ccode' })">渠道码</view>
15
+ <view class="item" @click="open({ themeColor: 'ff0000', titleColor: 'ffffff' })">红色主题</view>
16
+ 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
17
+ </view>
18
+ </template>
19
+ <script>
20
+ export default {
21
+ data() {
22
+ return {
23
+ mode: 'open' // open | auth
24
+ }
25
+ },
26
+ methods: {
27
+ change() {
28
+ this.mode = this.mode === 'open' ? 'auth' : 'open'
29
+ },
30
+ open(params) {
31
+ const query = Object.keys(params)
32
+ .map((key) => `${key}=${params[key]}`)
33
+ .join('&')
34
+
35
+ const h5Url = `https://galaxy-user-h5.geely-test.com/session-view-test.html?env=uat${query ? `&${query}` : ''}`
36
+ // const h5Url = 'http://127.0.0.1:8080/douyin-session-test.html'
37
+ if (this.mode === 'auth') {
38
+ uni.navigateTo({
39
+ url: `/pages/webview/session?url=${encodeURIComponent(
40
+ h5Url + '&isAuthCode=1&response_type=code&client_id=30000325&scope=snsapiUserinfo&state=123123'
41
+ )}` // 生产 30000080 测试 30000305
42
+ })
43
+ return
44
+ }
45
+ uni.navigateTo({
46
+ url: `/pages/webview/session?url=${encodeURIComponent(h5Url)}&${query}`
47
+ })
48
+ }
49
+ }
50
+ }
51
+ </script>
52
+ <style>
53
+ .container {
54
+ padding: 20rpx;
55
+ }
56
+ .switch {
57
+ display: flex;
58
+ align-items: center;
59
+ height: 100rpx;
60
+ }
61
+ .item {
62
+ padding: 20rpx;
63
+ background-color: #eee;
64
+ margin-bottom: 20rpx;
65
+ }
66
+ </style>
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "geely-four-service",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "111"
11
+ ],
12
+ "author": "zhuyuxiang",
13
+ "license": "ISC",
14
+ "uni_modules": {
15
+ "dependencies": [],
16
+ "encrypt": [],
17
+ "platforms": [
18
+ "App",
19
+ "H5",
20
+ "MP-WEIXIN",
21
+ "MP-ALIPAY",
22
+ "MP-BAIDU",
23
+ "MP-TOUTIAO",
24
+ "MP-QQ",
25
+ "MP-KUAISHOU",
26
+ "QUICKAPP-WEBVIEW",
27
+ "QUICKAPP-NATIVE"
28
+ ]
29
+ }
30
+ }