Here we go. Here WE go. Here I go. After a week of development and bug handling, as well as through the comparison of official API documents of both sides. Keep track of new problems. (Please note that my project uses Taro 1.3.38 version, and the latest version may not have the same problem as mine. Why not upgrade to the latest version? At the beginning, it was due to the time cost, the upgrade of the big version involved too many dependent versions.)

  1. When Lodash was introduced to use debounce, an error was reported in the Alipay widget (date.now() method). No matter how much you tried to reinstall the dependency, you couldn’t find the problem in Modules. The solutions in Taro’s official issue are all 3.X version, which does not apply to my lower version.
  • My solution here is to write mylodash.js and introduce the intercepting and anti-jitter functions used in the project into my own file: Function now() {return date.now(); function now() {return date.now(); }

    The rest is the method needed by export. In fact, we can write one by ourselves, or go to Lodash git to get the method needed in our own project.

  1. Taron.getstoragesync (‘test’) taron.getStoragesync (‘test’)

    In this way, the data can not be obtained. According to the alipay API document, it needs to be changed to the following way

    my.getStorageSync({key: 'test'})

    It’s a giant crater!! And there will be development tools available, but the real machine debugging time is not the case! It’s very frustrating. It may also be that Taro’s version is too low. When this problem occurs, you can use the app.js file as I described in the last article to do the environment judgment to replace the use of the API.

Warm tip: small program development must be real machine debugging, sometimes development tools or preview can not work. This is a very bad one