Skip to content

Commit c12a241

Browse files
author
v_guanglwen
committed
fix: Update code format and appid
1 parent fef90e8 commit c12a241

File tree

2 files changed

+59
-60
lines changed

2 files changed

+59
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const htmlSnip =
2-
`<div class="div_class">
2+
`<div class="div_class">
33
<h1>Title</h1>
44
<p class="p">
55
Life is&nbsp;<i>like</i>&nbsp;a box of
@@ -8,65 +8,64 @@ const htmlSnip =
88
</div>
99
`
1010
Page({
11-
data: {
12-
theme: 'light',
13-
disableContextMenu: true,
14-
showBtn: false,
15-
btnX: 0,
16-
btnY: 0,
17-
selectedString: '',
18-
htmlSnip,
19-
},
20-
onShareAppMessage() {
21-
return {
22-
title: 'selection',
23-
path: 'packageComponent/pages/content/selection/selection'
24-
}
25-
},
26-
onUnload() {
27-
if (wx.offThemeChange) {
28-
wx.offThemeChange()
29-
}
30-
},
31-
onLoad() {
11+
data: {
12+
theme: 'light',
13+
disableContextMenu: true,
14+
showBtn: false,
15+
btnX: 0,
16+
btnY: 0,
17+
selectedString: '',
18+
htmlSnip,
19+
},
20+
onShareAppMessage() {
21+
return {
22+
title: 'selection',
23+
path: 'packageComponent/pages/content/selection/selection'
24+
}
25+
},
26+
onUnload() {
27+
if (wx.offThemeChange) {
28+
wx.offThemeChange()
29+
}
30+
},
31+
onLoad() {
32+
this.setData({
33+
theme: wx.getSystemInfoSync().theme || 'light'
34+
})
35+
36+
if (wx.onThemeChange) {
37+
wx.onThemeChange(({theme}) => {
38+
this.setData({theme})
39+
})
40+
}
41+
},
42+
selectionChangeHandler(e) {
43+
const selection = e.detail
44+
if (selection.isCollapsed === false) {
45+
this.setData({
46+
showBtn: true,
47+
selectedString: e.detail.selectedString,
48+
btnX: e.detail.firstRangeRect.x,
49+
btnY: e.detail.firstRangeRect.y,
50+
})
51+
} else {
3252
this.setData({
33-
theme: wx.getSystemInfoSync().theme || 'light'
53+
showBtn: false
3454
})
35-
36-
if (wx.onThemeChange) {
37-
wx.onThemeChange(({theme}) => {
38-
this.setData({theme})
55+
}
56+
},
57+
copySelectedString() {
58+
wx.setClipboardData({
59+
data: this.data.selectedString,
60+
success() {
61+
wx.getClipboardData({
62+
success(res) {
63+
wx.showToast({
64+
title: `复制成功:${res.data}`
65+
})
66+
}
3967
})
4068
}
41-
},
42-
selectionChangeHandler(e) {
43-
const selection = e.detail
44-
if (selection.isCollapsed === false) {
45-
this.setData({
46-
showBtn: true,
47-
selectedString: e.detail.selectedString,
48-
btnX: e.detail.firstRangeRect.x,
49-
btnY: e.detail.firstRangeRect.y,
50-
})
51-
} else {
52-
this.setData({
53-
showBtn: false
54-
})
55-
}
56-
},
57-
copySelectedString() {
58-
wx.setClipboardData({
59-
data: this.data.selectedString,
60-
success() {
61-
wx.getClipboardData({
62-
success(res) {
63-
wx.showToast({
64-
title: `复制成功:${res.data}`
65-
})
66-
}
67-
})
68-
}
69-
})
70-
}
71-
})
72-
69+
})
70+
}
71+
})

project.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"ignore": [],
7575
"include": []
7676
},
77-
"appid": "wx622bee4f78fa4f5a",
77+
"appid": "wxe5f52902cf4de896",
7878
"projectname": "miniprogram-demo-master",
7979
"libVersion": "3.7.6"
8080
}

0 commit comments

Comments
 (0)