个人案例
- refresher-two-level-enabled 为什么设置为true,无法关闭?
refresher-two-level-enabled 初始为false,在bind:refresherstatuschange="onStatusChange"二层打开时,改变状态为true,为什么状态变成true后,无法通过this.scrollContext.closeTwoLevel 关闭二层。
星期三 09:37 - 下拉二楼报错(errMsg: "navigateTo:fail timeout")?
下拉二楼第一次下拉正常进入下一页,返回后第二次下拉就报错(errMsg: "navigateTo:fail timeout") <scroll-view id="scrollview" type="custom" scroll-y scroll-with-animation show-scrollbar="{{false}}" refresher-enabled="{{true}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" refresher-two-level-pinned="{{true}}" refresher-two-level-enabled refresher-two-level-threshold="{{150}}" refresher-two-level-triggered="{{twoLevelTriggered}}" bind:refresherpulling="onPulling" bind:refresherrefresh="onRefresh" bind:refresherrestore="onRestore" bind:refresherabort="onAbort" bind:refresherstatuschange="onStatusChange" worklet:onstartstart="handleScrollStart" worklet:onscrollupdate="handleScrollUpdate" worklet:onscrollend="handleScrollEnd"></scroll-view> onStatusChange(e) { const { status } = e.detail; const refreshStatus = this.buildText(this.getStatusName(status)); this.setData({ refreshStatus }); if (status === 7) { this.navigateToPrivacy(); } }, navigateToPrivacy() { wx.navigateTo({ url: "../privacy/privacy", events: { nextPageRouteDone: this.handleRouteDone.bind(this), }, fail: (err) => { console.error("navigateTo failed", err); }, }); }, handleRouteDone(data) { if (this.scrollContext) { this.scrollContext.closeTwoLevel({ duration: 1 }); } }, [图片]
星期二 20:03 - worklet.spring 给value 赋值为NaN?
initAnimation初始化的时候都正常,到didSpring方法中,this.sharedValueArr[idx].value) = NaN了 把spring换成timing方法就可以正常执行。 console.log("Calling spring with:", this.sharedValueArr[idx].value); import { worklet } from "../../../utils/animation/worklet-api"; const { shared, runOnUI, runOnJS, repeat, sequence, spring, timing, Easing, cancelAnimation } = worklet; const { screenWidth } = wx.getSystemInfoSync(); Component() .behavior(audioContext) .options({ multipleSlots: true }) .property("safeBottom", { type: Number, value: 0 }) .property("isSent", { type: Boolean, value: false }) .property("record", { type: Object, value: {} }) .data(() => ({ showMenu: false, move: "", })) .lifetime("attached", function () {}) .pageLifetime("show", function () { this.initAnimation(); }) .methods({ initAnimation() { const elements = [ { id: "menumove", toValue: { x: 0 } }, { id: "playmove", toValue: { x: 40 } }, ]; var _this = this; var numsOfBox = elements.length; var sharedValueArr = []; var _loop = function _loop(i) { var translate = shared(elements[i].toValue); sharedValueArr.push(translate); console.log("translate", translate); _this.applyAnimatedStyle(`.${elements[i].id}`, function () { "worklet"; return { transform: `translateX(${translate.value.x}px)`, }; }); }; for (var i = 0; i < numsOfBox; i++) { _loop(i); } this.sharedValueArr = sharedValueArr; console.log("sharedValueArr", sharedValueArr); }, startAnimation: function startAnimation() { const values = [{ x: screenWidth - 90 }, { x: 335 }]; this.didTiming(0, values[0]); this.didSpring(1, values[1]); }, didTiming(idx, toValue) { this.sharedValueArr[idx].value = timing( toValue, { duration: 1500, easing: Easing.linear, }, function () { "worklet"; console.log("timing done"); } ); }, didSpring(idx, toValue) { console.log("Calling spring toValue:", toValue); this.sharedValueArr[idx].value = spring( toValue, { damping: 20, stiffness: 90, }, function () { "worklet"; console.log("spring done"); } ); console.log("Calling spring with:", this.sharedValueArr[idx].value); }, }) .register();
12-10 - 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