首次提交

This commit is contained in:
何江明
2025-02-28 16:19:58 +08:00
commit 15014e22aa
92 changed files with 15941 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {};
},
methods: {
showModel() {
common_vendor.index.showModal({
content: this.$t("api.message"),
success: (res) => {
common_vendor.index.__f__("log", "at pages/api/api.vue:17", res);
}
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o((...args) => $options.showModel && $options.showModel(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/api/api.js.map
+5
View File
@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "API",
"enablePullDownRefresh": false,
"usingComponents": {}
}
+1
View File
@@ -0,0 +1 @@
<view class="container"><button bindtap="{{a}}">uni.showModal</button></view>
View File
@@ -0,0 +1,24 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
title: this.$t("")
};
},
methods: {}
};
if (!Array) {
const _easycom_no_data2 = common_vendor.resolveComponent("no-data");
_easycom_no_data2();
}
const _easycom_no_data = () => "../../uni_modules/no-data/components/no-data/no-data.js";
if (!Math) {
_easycom_no_data();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/component/component.js.map
@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "Component",
"enablePullDownRefresh": false,
"usingComponents": {
"no-data": "../../uni_modules/no-data/components/no-data/no-data"
}
}
@@ -0,0 +1 @@
<view class="container"><no-data u-i="a3e3830c-0" bind:__l="__l"></no-data></view>
+87
View File
@@ -0,0 +1,87 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
systemLocale: "",
applicationLocale: ""
};
},
computed: {
locales() {
return [
{
text: this.$t("locale.auto"),
code: "auto"
},
{
text: this.$t("locale.en"),
code: "en"
},
{
text: this.$t("locale.zh-hans"),
code: "zh-Hans"
},
{
text: this.$t("locale.zh-hant"),
code: "zh-Hant"
},
{
text: this.$t("locale.ja"),
code: "ja"
}
];
}
},
onLoad() {
let systemInfo = common_vendor.index.getSystemInfoSync();
this.systemLocale = systemInfo.language;
this.applicationLocale = common_vendor.index.getLocale();
this.isAndroid = systemInfo.platform.toLowerCase() === "android";
common_vendor.index.onLocaleChange((e) => {
this.applicationLocale = e.locale;
});
},
methods: {
onLocaleChange(e) {
if (this.isAndroid) {
common_vendor.index.showModal({
content: this.$t("index.language-change-confirm"),
success: (res) => {
if (res.confirm) {
common_vendor.index.setLocale(e.code);
}
}
});
} else {
common_vendor.index.setLocale(e.code);
this.$i18n.locale = e.code;
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t(_ctx.$t("index.demo")),
b: common_vendor.t(_ctx.$t("index.demo-description")),
c: common_vendor.t(_ctx.$t("index.detail")),
d: common_vendor.t(_ctx.$t("index.language-info")),
e: common_vendor.t(_ctx.$t("index.system-language")),
f: common_vendor.t($data.systemLocale),
g: common_vendor.t(_ctx.$t("index.application-language")),
h: common_vendor.t($data.applicationLocale),
i: common_vendor.t(_ctx.$t("index.language")),
j: common_vendor.f($options.locales, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.text),
b: item.code == $data.applicationLocale
}, item.code == $data.applicationLocale ? {} : {}, {
c: index,
d: common_vendor.o(($event) => $options.onLocaleChange(item), index)
});
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
+4
View File
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "Hello i18n",
"usingComponents": {}
}
+1
View File
@@ -0,0 +1 @@
<view class="container"><view class="title">{{a}}</view><view class="description">{{b}}</view><view class="detail-link">{{c}}: <text class="link">https://uniapp.dcloud.net.cn/collocation/i18n</text></view><view class="locale-setting">{{d}}</view><view class="list-item"><text class="k">{{e}}:</text><text class="v">{{f}}</text></view><view class="list-item"><text class="k">{{g}}:</text><text class="v">{{h}}</text></view><view class="locale-setting">{{i}}</view><view class="locale-list"><view wx:for="{{j}}" wx:for-item="item" wx:key="c" class="locale-item" bindtap="{{item.d}}"><text class="text">{{item.a}}</text><text wx:if="{{item.b}}" class="icon-check"></text></view></view></view>
+55
View File
@@ -0,0 +1,55 @@
.title {
font-size: 16px;
font-weight: bold;
margin-bottom: 15px;
}
.description {
font-size: 14px;
opacity: 0.6;
margin-bottom: 15px;
}
.detail-link {
font-size: 14px;
word-break: break-all;
}
.link {
color: #007AFF;
margin-left: 10px;
}
.locale-setting {
font-size: 16px;
font-weight: bold;
margin-top: 25px;
margin-bottom: 5px;
padding-bottom: 5px;
border-bottom: 1px solid #f0f0f0;
}
.list-item {
font-size: 14px;
padding: 10px 0;
}
.list-item .v {
margin-left: 5px;
}
.locale-item {
display: flex;
flex-direction: row;
padding: 10px 0;
}
.locale-item .text {
flex: 1;
}
.icon-check {
margin-right: 5px;
border: 2px solid #007aff;
border-left: 0;
border-top: 0;
height: 12px;
width: 6px;
transform-origin: center;
transition: all 0.3s;
transform: rotate(45deg);
}
+42
View File
@@ -0,0 +1,42 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const collection = "hello";
const _sfc_main = {
data() {
return {
name: ""
};
},
methods: {
add() {
common_vendor.index.showLoading();
let db = common_vendor.er.database();
db.collection(collection).add({
name: this.name
}).then((res) => {
common_vendor.index.showToast({
title: this.$t("schema.add-success")
});
}).catch((err) => {
common_vendor.index.showModal({
content: err.message,
showCancel: false
});
}).finally(() => {
common_vendor.index.hideLoading();
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t(_ctx.$t("schema.name")),
b: $data.name,
c: common_vendor.o(($event) => $data.name = $event.detail.value),
d: common_vendor.t(_ctx.$t("schema.add")),
e: common_vendor.o((...args) => $options.add && $options.add(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/schema/schema.js.map
+5
View File
@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "Schema",
"enablePullDownRefresh": false,
"usingComponents": {}
}
+1
View File
@@ -0,0 +1 @@
<view class="container"><view>{{a}}</view><input class="input" value="{{b}}" bindinput="{{c}}"/><button type="primary" bindtap="{{e}}">{{d}}</button></view>
+8
View File
@@ -0,0 +1,8 @@
.input {
border: 1px solid #ebebeb;
border-radius: 3px;
margin-top: 15px;
margin-bottom: 15px;
padding: 8px;
}