![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
微信小程序
jack@london
这个作者很懒,什么都没留下…
展开
-
小程序根据变量状态显示按钮文本
一种方法:如下表示:当 isbind 为True 时,按钮文本 显示”退出账户“。当 isbind 为 False时,按钮文本显示”用户登录“。 <button wx:if= "{{isbind}}" type="primary" class="save-btn-top" bindtap="btnUnbinding">退出帐户</button> <button wx:else type="primary" class="save-btn-..原创 2022-06-02 16:28:45 · 419 阅读 · 3 评论 -
实现小程序图片预览功能
在wxml中将<image class="contentHeaderImg" src="{{item.img}}"></image>改写为<image class="contentHeaderImg" data-idd = "{{item.img}}" bindtap="previewimage" src="{{item.img}}"></image>然后去 js 文件中添加 previewimage 函数 previewi..原创 2022-05-12 17:24:02 · 306 阅读 · 1 评论 -
小程序使用时间转换
首先,在pages外,创建一个utils文件夹模块在其中添加一个utils.js文件,添加代码如下const formatTime =date=>{ const year= date.getFullYear() const month=date.getMonth()+1 const day=date.getDate() const hour=date.getHours() const minute=date.getMinutes() const second = da原创 2022-05-12 14:52:20 · 657 阅读 · 0 评论 -
数学口卡 微信小程序版本
这里只简单说说 微信小程序的 for 循环语句写法,感觉比较特别算式图片如下 for (let a = 6, b = 1, total = 0; a <10; a++, b = b + 2) { for (let j = a - b; j<= a; j++) { console.log(String(a) ,'+', String(j)) total += 1 } cons原创 2022-03-04 09:42:12 · 199 阅读 · 0 评论 -
微信小程序开发——接口调用
利用 前一篇 http_get 调用接口函数。 wx.cloud.callFunction({ name: 'http_get', data: { "options": { "method": "POST", "uri": "http://ip:port/test", "body": { }, "json": true } },.原创 2022-03-03 17:03:51 · 2405 阅读 · 0 评论 -
微信小程序开发
注册微信小程序首先,在如下链接注册微信小程序:小程序全部完成后,将会获取到AppID。对于个人开发者帐户,每个人(身份证)只能注册5个小程序。每个email邮箱对应1个小程序。开发微信小程序在 微信开发者工具 中选择该AppID,选中”云环境“后,正式创建该项目。...原创 2022-01-24 14:19:02 · 141 阅读 · 0 评论 -
微信小程序开发之三——写个按钮函数
小程序启动后首个进来的页面是 pages/index因此,可以在 index.wxml中添加一个按钮 <view class="uploader" > <button type="primary" class="save-btn" bindtap="gotoPage_test_get">Test</button> </view>然后再index.js中添加其函数响应 gotoPage_test_get: function ..原创 2022-01-20 13:28:58 · 995 阅读 · 0 评论 -
微信小程序开发之二——http_get函数
有时候需要从云上调用api接口等,需要一个云函数作为转发接口打开微信开发者工具,在小程序项目中选中cloudfunctions文件夹后,鼠标右键选择”新建nodejs云函数“,输入名称http_get,则自动建立了目录在index.js中输入代码// 云函数入口文件const cloud = require('wx-server-sdk')//--引入request-promise用户http请求var rp = require('request-promise')cloud.i..原创 2022-01-20 11:24:37 · 2646 阅读 · 0 评论