粉丝5993获赞4.0万

大家好,欢迎来到本期视频教程,我是隶属科技小白,上期视频讲到编写两个新的 ted bar 页面,你们是否已经做出这两个 ted bar 页面了呢? 这期视频我们来了解一个新的知识点,小程序的生命周期,记得先点赞收藏,以免后面找不到哦! 什么是微信小程序的生命周期?微信小程序的生命周期可以理解为由框架自己触发的一系列函数,不需要人来参与,也可以理解为会自动执行的函数。 onload 函数方法,页面加在十处法,一个页面只会吊用一次,可以在 onload 的参数中获取打开当前页面路径中的参数。昂首函数方法,页面显示, 切入前台十,触发一个页面可以触发很多次。 already 函数方法,页面初次渲染完成。十,触发一个页面只会调用一次。 on head 函数方法,页面隐藏,切入后台十处发,一个页面可以触发很多次 on on load 函数方法页面卸载十处发。学习到这里,你是否对微信小程序的生命周期已经有所了解了呢? 接下来我们就来实践一下前面说的知识点。首先,单机 app gson 文件,在 pages 这个对象下复制一段代码粘贴并更名为 my cart, 然后点击编译,这样就可以声称一个新的页面。在微信小程序 pages 这个对象中,默认优先展示第一个值,也就是第一个页面。我们可以看到,在刚才生成的页面文件中有四个文件,这些文件在前面的视频里也有跟小伙伴们解释过他们的用处。 如果对这四个文件还不了解的小伙伴可以翻翻前面的视频看一下。单击打开 my card 点 gs 页面,在右边代码编写区找到 onload 函数方法,这里输入 console, 点 log 括号,这是我的第一个小程序。要记住一点,除了英文字母和数字, 其他的内容都需要用单引号引起来,不然会代码报错。然后点击编译,这个时候我们可以看到在右下角的代码调试器看搜这里已经将刚才的那一句话给打印出来了,每次重新编译进入到这个页面都会打 打印出这句话。好了,本期视频就先告一段落了,下期视频将继续讲解微信小程序的其他生命周期,别忘了用你发财的小手点一下,双击加关注,我们下期视频见!

这节课来看 gs 的二楼的事件,如果定义了这个事件,当整个网页加载完之后,会自动触发这个事件,那么我们就可以根据这个事件所调的函数来达到我们的目的。来看代码,这是一个按钮,他的 id 通过 id 获取到这个节点,然后再获取他的音的,而且贴膜属性,得到他里边的内容这两个字,再把他的内容弹出来,页面上应该弹出按钮这两个字来看效果 没有弹出,下面报错了。不能读取这个属性,谁的属性不能读取闹的这个属性,那为什么会是闹呢?这里边是明明存在的这个按钮, 以前我们也是这样获取的。来分析一下。认识甜美尔王爷,他的加载顺序是由上到下,加载完上面的时候执行这段代码,这个时候下边还没有加载 按钮,还不存在,所以获取不到。以前我们这样写是因为这些代码是在函数里面,函数只有在调用的时候才执行,都是我们通过事件调用之后才去获取的, 所以那个时候不会爆错。而这两个代码是直接在这个标线下面,不在函数里边, 那既然是有线路秩序,那我把这段代码放到他下边,加载完这个按钮之后再加载, 是不是应该可以了?来看页面弹出来了,那不喜欢把这些脚本 放在玻璃里边,还放在黑的下边,应该怎么做?应该实现,当他加载完之后再执行这个脚本,那可以用安乐的事件,通常把它写在这里边,表示当整个网页加载完之后触发这个事件, 明明有函数 在这里,把它定一个函数 放海水里边, 整体意思就是当网页加载完之后,触发这个事件, 调用这个函数,函数里边获取这个按钮,然后弹出他的内容, 看效果弹出来了,这就是按漏的时间。应用的场景,也就是当某些脚本需要自动执行,不需要我们手动点击的时候, 就得考虑整个网页是否加载完毕,可以通过阿罗的事件让整个网页加载完之后再执行这些脚本。好了,这节课就到这里。

大家好,欢迎来到本期视频教程,我是隶属科技小白。上期视频讲到微信小程序的生命周期 onload, 接下来我们将继续讲解微信小程序的其他生命周期。接下来要讲解的是昂首函数方法。先打开之前的代码, 找到 fjsom 文件,将 pages 对象下的 index 文件和 my card 文件调换一下代码书写的位置。调换位置后,页面将优先展示 index 页面, 然后点击编译,这个时候页面已经切换好了。紧接着找到 index wxml 文件,将里面的其他代码全部删除,只留下一个 view 盒子。然后在盒子中加入一个 button 按钮,以实现页面跳转到 mike card 页面的。 给按钮绑定一个触发事件 jumaicaard。 然后单击 index js 文件。在 buying built tap 事件处理函数上面,这里新建一个函数方法。这个函数方法就是对应前面的按钮所绑定的 to my card 函数方法。 记得要多写一些代码注释,这样才能方便自己和人家阅读你自己写的代码。 像一些代码的规范和写法,我会在后面的教程里详细的跟大家解释一遍。现在只需要大概理解他们是什么意思就可以了。 在 to my card 函数方法里加上这样一段代码 wx now gate to 函数。这个函数里的 url 是要跳转到的地址路径。这里我们输入 pages my card 斜杠 my card。 输入完成后,不要忘记了编译哦,也就是保存。如果不想每次都手动点击保存,直接 control 加 s 保存也是可以的,这样会更方便快捷。线这个步骤完成后,点 点击点我去到 my card 页面,这个按钮就可以跳转到 my card 这个页面了。目光来到调试,记者已经打印出这是我的第一个小程序这句话了。点击返回上的页面,再次测试一下是否能够打印出来。 结果有目共睹。这就是小程序生命周期昂兽的用法,每次切换到这个页面都会执行一次。这个代码。昂 low 和昂寿的作用差不多,但是昂 low 的一个页面只能执行一次,昂寿则一个页面可执行多次。好了,本期视频就先告一段落了, 下期视频将继续讲解微信小程序的其他生命周期。别忘了用你发财的小手点一下双击加关注我们,下期视频见!



hey guys i'm gonna show you! my favorite really quick way to enhance your lip shape whatever lip shape you have this will actually make a difference and all you really need is a really good lipstick and preferably a map one i'm going to show you the new este lauder pure color lipstick which by the way there are 69 colors in the range which is amazing it's glamorous and it's so divine it also has the iconic estee lauder logo on both the packaging and the bullet which i love when i first use these i found out from testing them that you don't even need a lip liner with them and they stay a really long time okay so the key tip i'm going to show you is how to use the lipstick in certain areas of the mouth to get the illusion of symmetry and evenness i'm going to use this gorgeous blue tone red from este lauder this is the color thrill me it's a super comfort misty velvet texture that won't make your lips feel dry put your lipstick on but concentrate the product on the top of the lip then pressure lips together in a back and forth motion to transfer reapply to the top lip only you want top lip to have the most amount of color that's the tip so the next common lip shape that i often hear needs tweaking is the wideness of the lips so concentrating the lipstick at the corners of the mouth do a light coating in the center of the lips as well so that things are even in fact if you want to look even more amazing add some concealer in the center of the lips to make them stand out so let me show you a couple of these st lordy shades why i'm here now? these are not only stunning but they are so long wearing that really helps work with this technique through all me six 99 it's a true blue red tone which really makes your lip stand out and just gives confidence to your face next romance six to six this is a really pretty apricot color which suits so many skin tones and you can wear it in so many different occasions whether you're going to school hanging out or dating solenhard 669 a cool tone pink a rosy color which is really wearable every day speak up 6a3 this is a reddish brown and has a really cool retrofield activated 666 this is a gorgeous and vibrant orange shape which is perfect as the weather warms up let me know what you think of the technique so i've shown you here remember it's all about color play and focusing on on the areas that you want the eye to be drawn to let me know if you try any of these lipsticks i love this velvety soft feeling i get so i can't wait to hear what you think i really look forward to seeing you all next time thank you for watching you are all beautiful bye bye。