个人案例
- Skyline 模式下 mobx-miniprogram-bindings 只能手工绑定吗?
Skyline 模式下 mobx-miniprogram-bindings 只能手工绑定吗?BehaviorWithStore绑定报错 import { createStoreBindings } from "mobx-miniprogram-bindings"; import { store as receiveds } from "./reservations"; const STORE_TYPES = { RECEIVED_RESERVATIONS: "ReceivedReservations", }; const STORE_CONFIGS = { [STORE_TYPES.RECEIVED_RESERVATIONS]: { store: receiveds, fields: ["receiveds"], actions: ["updatedReceived"], }, }; export const handleStores = (context, stores) => { return stores.map((store) => { const config = STORE_CONFIGS[store]; if (!config) { throw new Error(`Unknown store type: ${store}`); } return createStoreBindings(context, config); }); };
11-03 - skyline 模式下腾讯位置服务城市选择器返回null?
skyline 模式下腾讯位置服务城市选择器返回null [图片] [图片]
10-26 - 云开发添加数据成功后,无法立即查询?
用户提交注册信息后,使用 [代码]watch[代码] 方法成功监听到数据已提交。然而,当我在数据提交后立即进行查询时,却无法获取到刚刚提交的数据。 补充:如果新建数据后,刷新小程序,调用同一个查询函数,会获取到数据。 app.router("SignUp", async (ctx, next) => { const { nickName, documentType, nationality } = event.value; const collections = [ { name: "Users", data: { nickName, nationality, open_id: wxContext.OPENID, status: status.PENDING_REDRIVE, }, }, { name: "CertData", data: { documentType, }, }, ]; try { const result = await db.runTransaction(async (transaction) => { const uploadPromises = collections.map(async (collection) => { const params = { unionid_id: wxContext.UNIONID, createAt, ...collection.data, }; const { _id } = await transaction.collection(collection.name).add({ data: params }); return { _id, type: collection.name }; }); return Promise.all(uploadPromises); }); ctx.body = { data: result }; } catch (error) { console.error("Transaction error: ", error); ctx.body = { error: error.message }; } }); [图片]
10-23 - Skyline 为什么组件高度和设置的高度不一致?
[图片]swiper 定义的height: 360rpx;但是实际高度缺变成了187.2px
10-02 - 这个插件wx8dbde411dd544d42报错,开发者没有留联系方式?
这个插件wx8dbde411dd544d42报错,开发者没有留联系方式?如何联系开发者
07-04 - ekiKey获取失败
initSDKInfo ekiKey获取失败。
07-02 - 使用了 scss 新建分包报错:["subPackages"][1]["root"]字段需为目录?
找到原因了,是我使用了 scss ,取消 scss 就不报错了。 [ miniprogram/app.json 文件内容错误] miniprogram/app.json: ["subPackages"][1]["root"] 字段需为 目录 ["subPackages"][2]["root"] 字段需为 目录(env: macOS,mp,1.06.2405010; lib: 3.4.5) 新建项目、以前的项目,现在新建分包都会报错。以前项目的app.json没有修改过。 我看app.miniapp.json是多端框架的,没有开通多端框架,为什么会提示这个错误。 [图片]
06-01 - 云函数报错collection.aggregate:fail -501001?
collection.aggregate:fail -501001 resource system error. tmp secret key expire 环境是资源方的环境
05-27 - 自定义组件内如果通过this.createSelectQuery查询slot的节点信息?
组件生命周期函数ready中查询slot的节点信息,返回结果为null ready() { const { scrollIntoView } = this.properties; // <slot id="{{scrollIntoView}}" name="content"></slot>,获取slot的位置. const query = this.createSelectorQuery(); query.select(`#${scrollIntoView}`).boundingClientRect(); query.selectViewport().scrollOffset(); query.exec((res) => { console.log("scrollIntoView", res); }); }, <view class="scroll-box column"> <view class="outer-scroll {{ styleConfig.back }}"> <scroll-view scroll-y="true" enable-flex="true" enable-passive="true" enhanced="true" scroll-into-view="{{scrollIntoView}}" scroll-into-view-alignment="start" bindscrolltolower="bindscrolltouppernew" > <slot id="{{scrollIntoView}}" name="content"></slot> <view class="scroll_bottom"> </view> </scroll-view> <view class="scroll-bar {{ styleConfig.back + ' ' + styleConfig.border['top'] }}"> <slot name="bar"></slot> </view> </view> <view class="bottom-bar flex_space safe_area_margin"> <button class="center btn_empty radius_100 {{ styleConfig.button }}"> <text class="{{ styleConfig.text['button'] }}">{{"分诊派单"}}</text> </button> </view> </view>
05-16 - 云函数 group 和 skip 组合使用?
group 阶段按当前月、日分组 假设当前日有1000条数据,那最终结果group 的 list 中会同时取出这1000条数据吗? skip 是按所有分组中list.length求和的结果跳过吗? app.router("GetBookedByAdmin", async (ctx, next) => { try { const month = new Date().getMonth() + 1; const { identity_id, skip, limit } = event.value; const { list } = await db .collection("TestingOrders") .aggregate() .match({ "appointment.month": month, "nurse._id": identity_id, serviceState: status.TRIAGED, }) .sort({ "appointment.day": -1 }) .lookup({ from: "Users", let: { user_id: "$user_id" }, pipeline: $.pipeline() .match(_.expr($.eq(["$_id", "$$user_id"]))) .limit(1) .project({ _id: 0, avatarUrl: 1, nickName: 1, }) .done(), as: "userInfo", }) .replaceRoot({ newRoot: $.mergeObjects([$.arrayElemAt(["$userInfo", 0]), "$$ROOT"]) }) .project({ userInfo: 0 }) .group({ _id: { month: "$appointment.month", day: "$appointment.day", }, list: $.push({ _id: "$_id", appointment: "$appointment", doctor: "$doctor", location: "$location", serviceState: "$serviceState", status: "$status", symptoms: "$symptoms", user_id: "$user_id", avatarUrl: "$avatarUrl", nickName: "$nickName", }), }) .skip(skip) .limit(limit) .end(); ctx.body = { data: list }; } catch (error) { console.error("GetBookedByAdmin -> ", error); ctx.body = { data: error }; } });
03-03