首页 > 微信 > 详细

微信小程序开发

时间:2021-03-08 09:29:09      阅读:31      评论:0      收藏:0      [点我收藏+]

1.下载开发环境

https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
2.开发环境介绍
3.组件:
<view>hello</view>
<text selectable>hello</text> =<div> p 是否可选择
<text decode>hello&nbsp;hello</text> =<span> 转义字符
<button type="primary">click</button> 4种样式,form-type submit,reset ;opent-type 3种使用方法:getUserInfo,getPhone,contact
<checkbox-group>
<checkbox value="1">boy</checkbox>
<checkbox value="2">girl</checkbox>
</checkbox-group>
<radio-group>
<radio>boy</radio>
<radio>girl</radio>
</radio-group>

<block>hello</block> 代码块不会被渲染,里面的标签会渲染
<block>
<view>hello</view>
<text selectable>hello</text>
</block>

<input type="text" value="hello"></input>
<input type="password"></input>
<input type="number"></input>
<input placeholder="hello" placeholder-style="color:red" placeholder-class="style1" disabled maxlength="10"></input>

绑定事件 bindinput="changeme"
传参数data-test2="1" envent.currentTarget.dataset

this.setData(
{
msg:"update msg"
}
)

获取用户信息,获取电话号码,联系客服

富文本标签,msg="html"
<rich-text nodes="{{msg}}"></rich-text>

弹窗:
wx.showToast(
{
title:‘jiazaizhong‘,
icon:‘loading‘, //success,none
duration:2000
}
)

wx.showLoading()
xw.hideLoading();
wx.showModal()
{
title:‘tishi‘,
content:‘tangchuang‘,
success(res){
if(res.confirm==true)
{
确定
}
else{
取消
}
}
}

页面跳转:
标签跳转:<navigator url="/pages/test/test">goto</navigator>
事件跳转:wx.navigateTo(
{
url:‘/page/test/test?id=1‘,
}
)

获取后端数据:

getdatat(){
var that=this;
wx.request(
url:‘http://localhost:1028/jobs‘,
success(res)
{
var data=res.data;
that.setData(
{
jobs:data
}
)
}
)
}

demo:view,text,video,block,class,api

微信小程序开发

原文:https://www.cnblogs.com/csj007523/p/14497621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!