Skip to content

Commit a946755

Browse files
committed
feat:分包改造
1 parent 30db3e0 commit a946755

File tree

1,120 files changed

+18283
-4947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,120 files changed

+18283
-4947
lines changed

miniprogram/app-darkmode.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"text": "组件"
1818
},
1919
{
20-
"pagePath": "page/weui/example/index",
20+
"pagePath": "page/extend/index",
2121
"iconPath": "image/icon_component_HL.png",
2222
"selectedIconPath": "image/icon_component_dark.png",
2323
"text": "扩展能力"

miniprogram/app.json

+192-179
Large diffs are not rendered by default.
4.55 KB
Loading

miniprogram/packageAPI/pages/action-sheet/action-sheet.js

-17
This file was deleted.

miniprogram/packageAPI/pages/add-contact/add-contact.wxss

-5
This file was deleted.

miniprogram/packageAPI/pages/animation/animation.js

-46
This file was deleted.

miniprogram/packageAPI/pages/choose-address/choose-address.js miniprogram/packageAPI/pages/api/choose-address/choose-address.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ Page({
22
onShareAppMessage() {
33
return {
44
title: '收货地址',
5-
path: 'packageAPI/pages/choose-address/choose-address'
5+
path: 'packageAPI/pages/api/choose-address/choose-address'
66
}
77
},
88

99
data: {
10+
theme: 'light',
1011
addressInfo: null
1112
},
1213
chooseAddress() {
@@ -20,5 +21,16 @@ Page({
2021
console.log(err)
2122
}
2223
})
24+
},
25+
onLoad() {
26+
this.setData({
27+
theme: wx.getSystemInfoSync().theme || 'light'
28+
})
29+
30+
if (wx.onThemeChange) {
31+
wx.onThemeChange(({theme}) => {
32+
this.setData({theme})
33+
})
34+
}
2335
}
2436
})

miniprogram/packageAPI/pages/choose-address/choose-address.wxml miniprogram/packageAPI/pages/api/choose-address/choose-address.wxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<import src="../../../common/head.wxml" />
22
<import src="../../../common/foot.wxml" />
33

4-
<view class="container">
4+
<view class="container page" data-weui-theme="{{theme}}">
55
<template is="head" data="{{title: 'chooseAddress'}}"/>
66

77
<form>

miniprogram/packageAPI/pages/choose-address/choose-address.wxss miniprogram/packageAPI/pages/api/choose-address/choose-address.wxss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../../common/lib/weui.wxss";
1+
22

33
form {
44
margin-top: 15px;

miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.js miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ Page({
22
onShareAppMessage() {
33
return {
44
title: '获取发票抬头',
5-
path: 'packageAPI/pages/choose-invoice-title/choose-invoice-title'
5+
path: 'packageAPI/pages/api/choose-invoice-title/choose-invoice-title'
66
}
77
},
88

99
data: {
10+
theme: 'light',
1011
type: '',
1112
title: '',
1213
taxNumber: '',
@@ -32,5 +33,16 @@ Page({
3233
console.error(err)
3334
}
3435
})
36+
},
37+
onLoad() {
38+
this.setData({
39+
theme: wx.getSystemInfoSync().theme || 'light'
40+
})
41+
42+
if (wx.onThemeChange) {
43+
wx.onThemeChange(({theme}) => {
44+
this.setData({theme})
45+
})
46+
}
3547
}
3648
})

miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxml miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<import src="../../../common/head.wxml" />
22
<import src="../../../common/foot.wxml" />
33

4-
<view class="container">
4+
<view class="container page" data-weui-theme="{{theme}}">
55
<template is="head" data="{{title: 'chooseInvoiceTitle'}}"/>
66

77
<view class="page-body">

miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxss miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../../common/lib/weui.wxss";
1+
22

33
form {
44
margin-top: 15px;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Page({
2+
onShareAppMessage() {
3+
return {
4+
title: '客服消息',
5+
path: 'packageAPI/pages/api/custom-message/custom-message'
6+
}
7+
},
8+
handleContact (e) {
9+
console.log(e.detail.path)
10+
console.log(e.detail.query)
11+
},
12+
onLoad() {
13+
this.setData({
14+
theme: wx.getSystemInfoSync().theme || 'light'
15+
})
16+
17+
if (wx.onThemeChange) {
18+
wx.onThemeChange(({theme}) => {
19+
this.setData({theme})
20+
})
21+
}
22+
}
23+
})

miniprogram/packageAPI/pages/custom-message/custom-message.wxml miniprogram/packageAPI/pages/api/custom-message/custom-message.wxml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
<import src="../../../common/head.wxml" />
22
<import src="../../../common/foot.wxml" />
33

4-
<view class="container">
4+
<view class="container page" data-weui-theme="{{theme}}">
55
<template is="head" data="{{title: 'customMessage'}}"/>
66

77
<view class="page-body">
88
<view class="page-body-wrapper">
9-
<text class="page-body-title">
10-
点击气泡icon打开客服消息界面
11-
</text>
129
<view class="page-body-line">
13-
<contact-button size="40" session-from="weapp"></contact-button>
10+
<button type="primary" open-type="contact" bindcontact="handleContact">客服消息</button>
1411
</view>
1512
</view>
1613
</view>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Page({
2+
onShareAppMessage() {
3+
return {
4+
title: '获取用户信息',
5+
path: 'packageAPI/pages/api/get-user-info/get-user-info'
6+
}
7+
},
8+
9+
data: {
10+
theme: 'light',
11+
hasUserInfo: false,
12+
canIUseGetUserProfile: false
13+
},
14+
getUserInfo(info) {
15+
console.log('getUserInfo')
16+
const userInfo = info.detail.userInfo
17+
this.setData({
18+
userInfo,
19+
hasUserInfo: true
20+
})
21+
},
22+
handleGetUserProfile(e) {
23+
console.log('getUserProfile')
24+
wx.getUserProfile({
25+
desc: '用于演示 wx.getUserProfile', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
26+
success: (res) => {
27+
console.log('wx.getUserProfile: ', res.userInfo)
28+
this.setData({
29+
userInfo: res.userInfo,
30+
hasUserInfo: true
31+
})
32+
}
33+
})
34+
},
35+
clear() {
36+
this.setData({
37+
hasUserInfo: false,
38+
userInfo: {}
39+
})
40+
},
41+
onLoad() {
42+
this.setData({
43+
theme: wx.getSystemInfoSync().theme || 'light'
44+
})
45+
46+
if (wx.onThemeChange) {
47+
wx.onThemeChange(({theme}) => {
48+
this.setData({theme})
49+
})
50+
}
51+
if (wx.getUserProfile) {
52+
this.setData({
53+
canIUseGetUserProfile: true
54+
})
55+
}
56+
}
57+
})

miniprogram/packageAPI/pages/get-user-info/get-user-info.wxml miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<import src="../../../common/head.wxml" />
22
<import src="../../../common/foot.wxml" />
33

4-
<view class="container">
4+
<view class="container page" data-weui-theme="{{theme}}">
55
<template is="head" data="{{title: 'getUserInfo'}}"/>
66

77
<view class="page-body">
@@ -18,7 +18,8 @@
1818
</block>
1919
</view>
2020
<view class="btn-area">
21-
<button type="primary" open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息</button>
21+
<button wx:if="{{canIUseGetUserProfile}}" type="primary" bindtap="handleGetUserProfile"> 获取用户信息GetUserProfile</button>
22+
<button wx:else type="primary" open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息getUserInfo</button>
2223
<button bindtap="clear">清空</button>
2324
</view>
2425
</view>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Page({
2+
onShareAppMessage() {
3+
return {
4+
title: '跳转',
5+
path: 'packageAPI/pages/api/jump/jump'
6+
}
7+
},
8+
9+
data: {
10+
theme: 'light',
11+
setting: {}
12+
},
13+
//打开半屏小程序
14+
openhalfscreenminiprogram(){
15+
wx.openEmbeddedMiniProgram({
16+
appId: 'wxfdcee92a299bcaf1', // 腾讯公益
17+
extraData: {
18+
foo: 'bar'
19+
},
20+
// envVersion: 'develop',
21+
success(res) {
22+
// 打开成功
23+
}
24+
})
25+
},
26+
//打开另一个小程序
27+
openanotherminiprogram(){
28+
wx.navigateToMiniProgram({
29+
appId: 'wxfdcee92a299bcaf1', // 腾讯公益
30+
// extraData: {
31+
// foo: 'bar'
32+
// },
33+
// envVersion: 'develop',
34+
success(res) {
35+
// 打开成功
36+
}
37+
})
38+
},
39+
//退出当前小程序
40+
exitminiprogram(){
41+
wx.exitMiniProgram({
42+
success(){
43+
wx.showToast({
44+
title: '退出成功',
45+
icon: 'none',
46+
duration: 2000
47+
})
48+
},
49+
fail(){
50+
wx.showToast({
51+
title: '退出失败',
52+
icon: 'none',
53+
duration: 2000
54+
})
55+
}
56+
})
57+
},
58+
onLoad() {
59+
this.setData({
60+
theme: wx.getSystemInfoSync().theme || 'light'
61+
})
62+
63+
if (wx.onThemeChange) {
64+
wx.onThemeChange(({theme}) => {
65+
this.setData({theme})
66+
})
67+
}
68+
}
69+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"navigationBarTitleText": "跳转"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<import src="../../../common/head.wxml" />
2+
<import src="../../../common/foot.wxml" />
3+
4+
<view class="container page" data-weui-theme="{{theme}}">
5+
<template is="head" />
6+
<view class="page-body">
7+
<view class="btn-area">
8+
<button type="primary" data-mode="fingerPrint" bindtap="openhalfscreenminiprogram">打开半屏小程序</button>
9+
</view>
10+
<view class="btn-area">
11+
<button type="primary" data-mode="fingerPrint" bindtap="openanotherminiprogram">打开小程序</button>
12+
</view>
13+
<!-- <view class="btn-area">
14+
<button type="primary" data-mode="fingerPrint" bindtap="returnminiprogram">返回上一个小程序</button>
15+
</view> -->
16+
<view class="btn-area">
17+
<button type="primary" data-mode="fingerPrint" bindtap="exitminiprogram">退出当前小程序</button>
18+
</view>
19+
</view>
20+
<template is="foot" />
21+
</view>

0 commit comments

Comments
 (0)