随笔分类 -  微信

摘要:一、效果图 二、代码 <view class="content"> <view class="left"> <block wx:for="{{lists}}" wx:key="index"> <template is="item" data="{{...item}}" wx:if="{{index% 阅读全文
posted @ 2020-10-09 16:55 样子2018 阅读(346) 评论(0) 推荐(0)
摘要:在生成骨架屏之前,先确保微信开发者工具是 1.03.2006032 或 1.04.2006032 以上的版本 在页面index.wxml中使用: <import src="index.skeleton.wxml"/> <template is="skeleton" wx-if="{{loading} 阅读全文
posted @ 2020-10-07 11:21 样子2018 阅读(504) 评论(0) 推荐(0)
摘要:一、代码 //request通用 const request = (url, param, method = 'get', dataType = 'json', responseType = 'text') => { var method = method.toLowerCase() return 阅读全文
posted @ 2020-10-07 11:06 样子2018 阅读(524) 评论(0) 推荐(0)
摘要:一、效果图 二、自定义tabbar Component({ options: { multipleSlots: true // 在组件定义时的选项中启用多slot支持 }, /** * 组件的属性列表 */ properties: { color:{ type:String, value:'#333 阅读全文
posted @ 2020-10-07 11:02 样子2018 阅读(2013) 评论(0) 推荐(0)
摘要:一、App.js //app.js App({ onLaunch: function (options) { console.log(options) }, globalData: { userInfo: null, token: 'Yang' }, //以下为生成签名代码 getSign(url, 阅读全文
posted @ 2020-09-18 11:05 样子2018 阅读(737) 评论(0) 推荐(0)
摘要:一、banner广告 <ad unit-id="adunit-6522d0488e5925c3"></ad> 二、插屏广告 // 在页面中定义插屏广告 let interstitialAd = null // 在页面onLoad回调事件中创建插屏广告实例 if (wx.createInterstit 阅读全文
posted @ 2020-09-14 16:55 样子2018 阅读(377) 评论(0) 推荐(0)
摘要:场景值在app.js中判断 //场景值判断 sceneInfo: function(s) { var scene = []; switch (s) { case 1001: scene.push(s, "发现栏小程序主入口"); break; case 1005: scene.push(s, "顶部 阅读全文
posted @ 2020-08-20 09:50 样子2018 阅读(1329) 评论(0) 推荐(0)
摘要:需要通过调用 wx.showShareMenu 并且设置 withShareTicket 为 true。这一项必须设置,这样当用户将小程序分享到任一群聊之后,才可以获取到此次分享的 shareTicket。 onLoad: function (options) { wx.showShareMenu( 阅读全文
posted @ 2020-08-19 09:34 样子2018 阅读(468) 评论(0) 推荐(0)
摘要:一、session_key管理 调用wx.login()获取code,服务端根据这个code和appid和appsecret获取SessionKey。 把SessionKey保存到服务器上,一般是不在网络传输,建立自己的SesstionID和生成的SessionKey的对应关系。 然后把生成的Ses 阅读全文
posted @ 2020-07-14 10:48 样子2018 阅读(2402) 评论(0) 推荐(0)
摘要:注意:小程序同一个页面video支持3个 一、效果图 二、代码 <cu-custom bgColor="my-bg" isBack="{{false}}"> <view slot="backText"></view> <view slot="content"></view> <view slot=" 阅读全文
posted @ 2020-06-04 10:42 样子2018 阅读(1740) 评论(0) 推荐(0)
摘要:wx.switchTab:跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 wx.reLaunch:关闭所有页面,打开到应用内的某个页面。 wx.reLaunch是可以跳转到tabBar页面的。它和wx.switchTab的区别就是:前者可以触发onLoad事件,而后者则不能触发。所 阅读全文
posted @ 2020-05-30 11:13 样子2018 阅读(1870) 评论(0) 推荐(0)
摘要:一、效果图 二、代码 <button wx:if="{{is_authorize==false}}" open-type="openSetting" class="weui-btn mini-btn font-size16" style="margin-top: 0;background-color 阅读全文
posted @ 2020-05-09 09:37 样子2018 阅读(284) 评论(0) 推荐(0)
摘要:一、前端代码 wx.requestSubscribeMessage({ tmplIds: ['S_7Z7zvjbdGgPiZ7Y9xRo7Y8jV-CitJ5P6_Bj0yM7Yw'], success(res) { console.log(res) clearInterval(listen) wx 阅读全文
posted @ 2020-05-06 09:45 样子2018 阅读(306) 评论(0) 推荐(0)
摘要:一、效果图 二、操作步骤 1、申请腾讯地图key 地址:https://lbs.qq.com/dev/console/key/add 2、小程序后台添加腾讯插件 开发文档:https://lbs.qq.com/miniprogram_plugin/route-plan.html 3、小程序代码设置 阅读全文
posted @ 2019-11-12 17:08 样子2018 阅读(1819) 评论(0) 推荐(0)
摘要:一、request封装 request(url, data, successCallBack = function (data) {}, completeCallBack = function (data) {}, method = "GET", dataType = 'json', respons 阅读全文
posted @ 2019-10-31 17:01 样子2018 阅读(896) 评论(0) 推荐(0)
摘要:一、设置borderStyle 二、设置page样式 三、效果 阅读全文
posted @ 2019-10-26 16:14 样子2018 阅读(3088) 评论(0) 推荐(0)
摘要:一、效果图 二、代码 阅读全文
posted @ 2019-10-26 09:22 样子2018 阅读(8736) 评论(0) 推荐(0)
摘要:一、下载 链接:https://pan.baidu.com/s/1D6vNSSBZI22_K1BzLEXpbg 提取码:of6g 修改binding.js中的window.bind=binding为如下: 二、示例 三、参考算法 https://blog.csdn.net/jiexiaopei_20 阅读全文
posted @ 2019-10-25 10:29 样子2018 阅读(4555) 评论(2) 推荐(1)
摘要:一、效果图 二、wxml 三、wxss 四、js代码 阅读全文
posted @ 2019-10-18 13:16 样子2018 阅读(1295) 评论(0) 推荐(0)
摘要:通过 wx:for-index 和 wx:for-item改变 阅读全文
posted @ 2019-10-18 09:21 样子2018 阅读(2604) 评论(0) 推荐(0)