preface

In 2018, I began to contact wechat small programs, during which I made small programs, small program plug-ins, and small program templates developed by third-party platforms. During the two years, I mostly used official native development

In early 2020, the boss asked me to try developing with a multi-terminal framework. After a round of research, VUE is mostly used for front-end business development, so UNIAPP is more suitable and the learning cost is low.

The creation and construction of UniAPP will not be described, the official document has been completed, straight to the point.

The development of micro channel small program, the default small program refers to the micro channel small program

Fill an old hole and make a new one

There is no silver bullet in software engineering, the limitations of applets themselves in different device environments and some compatibility issues after uniApp is compiled into applets

Pit and solution described is combined with their own work to learn or community leaders to share, if there is a better solution welcome to exchange learning

Uniapp compilers generate sitemap repeatedly

Sitemap is generated repeatedly when HBuilderX, uniApp’s official development tool, is compiled into a small program. Over time, sitemap piles up.

Solutions:

Find manifest.json and add the following field to mp-weixin

"sitemapLocation" : "sitemap.json"
Copy the code

Two, scrolling page event penetration

Implement a bootstrap tip for subscription messages as shown in the following figure, where the middle translucency is a mask layer named mask, fixed with Position: Fixed, and the bottom main page. Normally we want the mask layer to block the event from the main page to avoid accidental contact, and the scroll on the front page will still penetrate without processing, even if the Z-index of the mask layer is higher than the main page.

The solution

The mask layer listens for events and returns

<view class="inner-mask" :catchtouchmove="CatchTouch"> ... </view> // CatchTouch: function () {return; }Copy the code

END

Never forget there will be echoes, effective efforts, will let you shine in the future.

This article is part of the “Gold Nuggets For Free!” Event, click to view details of the event.