Skip to content

Commit

Permalink
feat: 新增小程序api的示例代码 (#24)
Browse files Browse the repository at this point in the history
* chore: code format

* chore: code format

* wip: 官方demo调整

* wip: api demo

* feat: api demo

* feat: api demo

* feat: api demo

* feat: api demo

* feat: api demo

* feat: api demo

* feat: i18n

* fix: 多语言

---------

Co-authored-by: xiangling <xiangling.yin@tuya.com>
  • Loading branch information
HandsomeFishYin and xiangling authored May 17, 2024
1 parent 46c71a1 commit 88ebb23
Show file tree
Hide file tree
Showing 201 changed files with 6,206 additions and 90,558 deletions.
14 changes: 14 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@ module.exports = {
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
singleAttributePerLine: false,
arrowParens: 'always',
htmlWhitespaceSensitivity: 'css',
overrides: [
{
files: '*.rjs',
options: {
parser: 'babel',
},
},
{
files: '*.tyss',
options: {
parser: 'css',
},
},
{
files: '*.tyml',
options: {
parser: 'html',
},
},
],
}
25 changes: 17 additions & 8 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,35 @@
"pages/pageAPI/getNetworkType/index",
"pages/pageAPI/storage/index",
"pages/pageAPI/getSystemInfo/index",
"pages/pageAPI/images/index",
"pages/pageAPI/makePhoneCall/index",
"pages/pageAPI/screenBrightness/index",
"pages/pageAPI/clipboardData/index",
"pages/pageAPI/addContact/index",
"pages/pageAPI/vibrate/index",
"pages/pageAPI/networkRequest/index",
"pages/pageAPI/audio/index",
"pages/pageAPI/downloadFile/index",
"pages/pageAPI/uploadFile/index",
"pages/pageAPI/scanCode/index",
"pages/pageAPI/getLocation/index",
"pages/pageAPI/getBatteryInfo/index",
"pages/pageAPI/voice/index",
"pages/pageAPI/pullDownRefresh/index",
"pages/pageAPI/navigationBarLoading/index",
"pages/pageAPI/actionSheet/index",
"pages/pageAPI/toast/index",
"pages/pageAPI/modal/index",
"pages/pageAPI/navigators/index",
"pages/pageAPI/getUserInfo/index",
"pages/pageAPI/getWifiList/index",
"pages/pageAPI/getSystemSetting/index",
"pages/pageAPI/getAccountInfo/index",
"pages/pageAPI/getAppInfo/index",
"pages/pageAPI/getConnectedWifi/index",
"pages/pageAPI/getLangContent/index",
"pages/pageAPI/getMenuButtonBoundingClientRect/index",
"pages/pageAPI/showStatusBar/index",
"pages/pageAPI/hideHomeButton/index",
"pages/pageAPI/showLoading/index",
"pages/pageAPI/updateVolume/index",
"pages/pageAPI/showMenuButton/index",
"pages/pageAPI/startPullDownRefresh/index",
"pages/components/pickerview/index",
"pages/components/picker/index",
"pages/panelDemo/index",
Expand Down Expand Up @@ -125,19 +134,19 @@
"list": [
{
"pagePath": "pages/components/index",
"text": "组件",
"text": "Component",
"iconPath": "@iconPath1",
"selectedIconPath": "@selectedIconPath1"
},
{
"pagePath": "pages/pageAPI/index",
"text": "接口",
"text": "API",
"iconPath": "@iconPath3",
"selectedIconPath": "@selectedIconPath3"
},
{
"pagePath": "pages/panelDemo/index",
"text": "面板",
"text": "Panel",
"iconPath": "@iconPath4",
"selectedIconPath": "@selectedIconPath4"
}
Expand Down
10 changes: 8 additions & 2 deletions app.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import './common.less';

:root {
--main-bg-color: rgb(254, 254, 254); /* 浅色背景 */
--main-bg-color: rgb(250, 250, 250); /* 浅色背景 */
--main-text-color: rgb(54, 54, 54); /* 深色文字 */
--main-arrow-color: #999;
--main-border-color: rgba(0, 0, 0, 0.05);
Expand All @@ -21,7 +21,13 @@
background-color: #2f2f2f;
color: var(--main-text-color);
}

page {
background: var(--plus-BG-0);
padding: 16px;
}
button {
margin: 16px 0;
}
.l-r-padding,
.px-20 {
padding-left: 20px;
Expand Down
4,475 changes: 4,475 additions & 0 deletions common.less

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions components/customComponent/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const app = getApp()

Component({
options: {
addGlobalClass: true,
Expand Down
2 changes: 1 addition & 1 deletion components/ff-chart/index.rjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// index.rjs
import F2 from '@antv/f2'
import {documentAdapter } from '@tuya-miniapp/rjs-adapter'
import { documentAdapter } from '@tuya-miniapp/rjs-adapter'
documentAdapter()
let chart
export default Render({
Expand Down
Loading

0 comments on commit 88ebb23

Please sign in to comment.