Mini Program Pitfall Record

After spending five days creating a mini program, I discovered that personal mini programs do not allow users to publish content when preparing for review. My heart sank...

Issues with the update function?

    1. Database permissions: First, check if the current database collection is set to the first option, where all users can read, and only the creator can read and write.
    1. Check if the collection contains the openid field. If you are importing a table from an external source, you need to add the openid field.
  • 3. When using update on the mini program side, you can only update fields where the openid matches your current openid. If you need to change information created by others, you should use update in a cloud function. Refer to the official documentation; it's quite simple.

    1. When using the cloud function update, remember to fill in your environment ID in cloud.init({env: 'xxx'}).
    1. Ensure that the data you upload is not undefined; otherwise, even if the upload is successful, it will show that one record was updated.
  • The cloud.init() method should be placed in the onLaunch lifecycle of app.js, so you don't need to call it again later.
  • After making changes, remember to right-click the modified file and select Upload, otherwise the changes will not take effect.

Precautions Before Development

  • First, search to see if there are any name conflicts.

  • Carefully read the official documentation on Service Categories.

  • Personal mini programs cannot have users publish content!

Why are tabBar icons not displaying?

You can debug on a real device. Here is a tool to convert SVG to PNG format, which is convenient for converting SVG icons from design drafts to PNG.