teraliner.blogg.se

Building a wechat mini program
Building a wechat mini program





building a wechat mini program
  1. #Building a wechat mini program movie
  2. #Building a wechat mini program code
  3. #Building a wechat mini program license

createCanvasContext ( " canvas-id " ) // polyfill for ctx.globalAlpha = 0.3 Object. You can just add the missing setter attributes with something like:Ĭonst ctx = wx. The lack of using standard attribute setters is annoying as well, but it’s easy to polyfill. Lack of Path2D is annoying, but you can accomplish the same thing with plain canvas curve commands.

  • If you try to draw to a canvas that doesn’t exist, Wechat will silently appear to work yet do nothing.
  • You need to explicitly call ctx.draw() to make your changes appear.
  • So instead of ctx.globalAlpha = 0.3, you need to say ctx.setGlobalAlpha(0.3).
  • No setter attributes, everything has a ctx.setAttr() method.
  • No Path2D helper for working with SVG paths.
  • building a wechat mini program

    The main differences working with Wechat canvas contexts appear to be the following:

    #Building a wechat mini program code

    Wechat has a Canvas API which is clearly inspired by Canvas on web, but with slight differences that make it difficult to reuse canvas code from the web directly. It also seems like it’s inspired by React, since pages have a setData() method which is used to set state and trigger a render similar to React’s setState().įor my case, I was most interested in the Canvas API since that’s one method Hanzi Writer can use to render in web. Of course, it’s not the web, and the files are in custom formats wxss (wechat CSS) and wxml (wechat HTML). Wechat miniprograms are clearly inspired by the web, with separate files for CSS, JS, and HTML. I’m just making a plugin for other developers to use, so whatever, but it’s still extremely frustrating to discover I’m barred for creating a miniprogram just because I’m not Chinese. I don’t have a company, so it seems like I’m only able to make a test app that can never run on real phones.

    #Building a wechat mini program license

    As a foreigner, it seems I’m not allowed to actually make a developer account unless it’s for a company, and it then asks for your company business license forms and address. To get started, I first downloaded the Wechat Developer IDE, and attempted to make a developer account as instructed. You can pick what you want to order, then pay for it all in the miniprogram. If you scan that QR code in Wechat, it will open up a miniprogram with the restaurant’s menu on it. Miniprograms have access to user identity, payments, and sharing all built-in, so it’s incredibly powerful.įor example, in China it’s common to enter a restaurant and find a QR code on your table. A recent addition to Wechat are Miniprograms, which are a cross between a website and an app that run inside of Wechat itself without needing to be explicitly installed.

    #Building a wechat mini program movie

    You can do almost anything on Wechat, from paying your phone bill, to buying movie tickets, to ordering a Taxi. It acts as a social network like Facebook with a wall, and has mobile payments built-in which are ubiquitous inside China. Wechat is a chat app similar to Whatsapp, but with an incredibly array of capabilities beyond anything available outside of China. Below are my experiences with building this Wechat miniprogram plugin. Fortunately, just such an opportunity came along to build out a Miniprogram plugin for the Hanzi Writer project, so I used it as a chance to experiment with the technology. Wechat miniprograms are extremely popular in China right now, so I’ve been looking for a project to try building one.







    Building a wechat mini program