- 小程序的三种弹框showToast、showModal、showLoading
前端-文龙刚
小程序小程序
小程序常用的三种弹框有:showToast:消息提示框showModal:模态对话框showLoading:加载框第一:showToast:消息提示框默认的样式自定义icon图标具体代码如下:wx.showToast({title:'成功',//提示内容icon:'loading',//图标(success成功图标、error失败图标、loading加载图标、none不显示图标)image:'..
- 小程序将图片保存到本地
前端-文龙刚
小程序小程序javascript开发语言
wx.downloadFile({//先将图片下载下来url:canvasToTempFilePath,//图片地址success:function(res){//图片保存本地操作wx.saveImageToPhotosAlbum({filePath:res.tempFilePath,success:function(data){wx.hideLoading()wx.showToast({titl
- 小程序常用界面交互api
前端-七木
微信小程序javascript前端
1.wx.showToast显示消息提示框显示一个消息提示框,一般用于操作成功后的提示wx.showToast({title:'操作成功',icon:'success',duration:2000});2.wx.showModal显示模态弹窗显示一个模态弹窗,可以用于提醒用户重要信息或让用户进行选择wx.showModal({title:'提示',content:'确认删除此项吗?',succes
- 小程序--本地存储API
煸橙干儿~~
微信小程序小程序
1、存储数据wx.setStorageSync():无需转换数据类型,存什么类型的就是什么类型的,data中的数据,使用时是this.data.名称。saveData(){wx.setStorageSync('list',this.data.list)wx.showToast({title:'存储成功',})},2、读取数据wx.getStorageSync():无需转换数据类型,存什么类型的读取
- 微信小程序(四十)API的封装与调用
代码对我眨眼睛
微信小程序微信小程序小程序
注释很详细,直接上代码上一篇新增内容:1.在单独的js文件中写js接口2.以注册为全局wx的方式调用接口源码:utils/testAPI.jsconsttestAPI={/****@param{*}title*/simpleToast(title='提示'){//可传参,默认为‘提示’wx.showToast({title:title,icon:'none',duration:2000,mask:
- 3-3【微信小程序全栈开发课程】登录功能(二)--自定义登录弹窗
l猫宁一
微信小程序有类似于wx.showToast,wx.showModal等的默认弹窗,但是样式较少,实现不了我们的需求,所以我们这节来自己写一个登录弹窗。还是继续编辑pages/index/index.vue文件1、效果展示这节我们先来看一下弹窗的效果是啥样的2、添加自定义弹窗(1)编辑pages/index/index.vue文件部分的样式代码这部分的样式是自定义弹窗的样式,将这些样式代码添加到st
- 微信小程序的100个api
前端fighter
微信小程序小程序
一、基础APIwx.request:发起网络请求,支持GET、POST等方式。wx.showToast:显示消息提示框,支持显示成功、失败、加载中等不同类型的提示。wx.showModal:显示模态对话框,支持显示标题、内容、按钮等。wx.navigateTo:保留当前页面,跳转到应用内的某个页面。wx.redirectTo:关闭当前页面,跳转到应用内的某个页面。wx.switchTab:跳转到应
- 微信小程序复制内容,复制内容换行
巨蟹座守护骑士
微信小程序微信小程序小程序
//微信自带api使用模板字符串\n换行,复制出来的就可以自动换行lettext=`姓名:巨蟹座守护骑士\n账号:1433223\n密码:1433223`wx.setClipboardData({data:text,success:function(){wx.showToast({title:'复制成功',icon:'success',duration:2000});}});
- 微信小程序wx.showToast一闪而过
zhanglong
伪代码wx.showLoading()http.reqeust({url:'/xxxx',method:'get'}).then(res=>{console.log(res)}).catch(()=>{wx.showToast({title:'系统异常'})}).finally((0=>{wx.hideLoading()})网接口异常时,catch里的showToast真机一闪而过。原因最新版微信
- wx.navigateTo()不生效
顾十方
微信小程序前端javascript微信小程序
问题代码:asyncsaveUserInfo(){constres=awaitrequestUtil({url:'/wxUser/save',method:'POST',data:this.data.userInfo})if(res.data.code===0){wx.switchTab({url:'/pages/Ta/Ta',})}else{wx.showToast({title:'保存失败,请
- 小程序弹窗
代码真的养发
小程序
小程序弹窗的例子如下:确认弹窗:wx.showModal({title:'提示',content:'确定要删除该记录吗?',success:function(res){if(res.confirm){console.log('用户点击确定')//执行删除操作}elseif(res.cancel){console.log('用户点击取消')}}})提示弹窗:wx.showToast({title:'
- 微信小程序API交互的自定义封装
金色888
哪天,正在蚂蚁森林疯狂偷能量的我被boss叫过去,告知我司要做一个线上直播公开课功能的微信小程序,博主第一次写小程序,复习了下文档,看了看腾讯云直播sdk,开工了。写着写着就发现不对劲了,这里面wx.showToast,wx.showModal,这一类的调用太多了,每次都写一遍太特么麻烦了,就拿wx.showToast做例子,产品要求是duration为2000ms,默认值是1500ms,且有时候
- wx.showToast一闪而过微信提示一闪而过
肥的ChuaChua
调试的时候发现toast闪过的太快了,而且在模拟器上是没有问题的,在真机上就不行后来给toast增加时长也不管用,了解了之后总结一下问题toast闪过的快有两种情况一种是加载的时候先是showloading,加载完成之后弹toast提示一下成功或者失败,这个toast关闭的特别快,后来发现showloading和hideloading必须得是搭配使用的,就是说如果showloading之后紧跟着s
- 微信小程序wx.showToast一闪而过的解决办法
AbnerZhang
1.执行wx.showToast后紧接着进行跳转,因为wx.showToast不会出现再新的页面中,此时如果需要能看到wx.showToast效果,可以加一个定时器,在定时器结束时跳转.如图1图12.在某个view的tap事件中,执行wx.showToast提示有的时候也会出现wx.showToast一闪而过的情况,模拟器没问题,真机测试会出现,我这边没找到好的解决办法,也是通过定时器实现的,如图
- 《微信小程序开发从入门到实战》学习六十三
那长长遥远的路
微信小程序学习小程序
6.4交互API使用交互API可以在小程序中显示各种弹窗或动画,达到交互反馈的目的。6.4.1提示框API使用wx.showToast接口可显示消息提示框。接口接受Object参。属性如下:title(必填)提示的内容icon图标,可选值为success(默认)、loading和noneimage自定义图标的本地路径,优先级高于iconduration提示框的显示时长,单位为毫秒,默认1500ma
- 【微信小程序】关于showToast提示后延迟
被卷成一团的江江
今天处理了一下修改个人信息,提交一类的都没有很大的问题,想着提示修改成功后应该等候一会,跳转至指定页面。最后效果:点击修改,成功后2000ms跳转到指定页面。让我们开始吧最开始是使用success:res=>{wx.showToast({title:'修改成功',icon:'success',duration:2000,success:res=>{wx.navigateTo({url:跳转页面,}
- 微信小程序中复制文本
m0_黎明
微信小程序小程序
在微信小程序中,可以使用wx.setClipboardData()方法来实现复制文本内容的功能。以下是一个示例代码://点击按钮触发复制事件copyText:function(){varthat=this;wx.setClipboardData({data:'要复制的文本内容',success:function(res){wx.showToast({title:'复制成功',icon:'succe
- 微信小程序---简单的复制
一个大长腿
微信小程序小程序
wxml复制jscopyText(e){console.log(e);letthat=this;wx.setClipboardData({//复制文本data:e.currentTarget.dataset.title,//要复制的文本内容success:function(res){wx.showToast({title:'复制成功',icon:"none",mask:"true"//是否设置点击
- 微信小程序 wx.showToast()的用法,更换icon图标
⎛⎝陈嗯嗯⎠⎞
前端微信小程序
wx.showToast({title:"成功",icon:'success',image:'../../images/fail.png',duration:2000,mask:false})参数讲解:title----------------标题,要显示的提示信息icon----------------图标,只支持"success"、"loading"image----------------自
- 微信小程序长按复制
吉宝程序圆
微信小程序微信小程序javascript小程序
fuzhibianhao(e){if(e.currentTarget.dataset.title!=''){lett=thiswx.setClipboardData({data:"bind&"+t.data.user.sysUserCode,success(res){//wx.hideToast()wx.getClipboardData({success(res){//wx.showToast({
- 微信小程序中复制文本
翻斗花园-图图
微信小程序小程序
在微信小程序中,可以使用wx.setClipboardData()方法来实现复制文本内容的功能。以下是一个示例代码://点击按钮触发复制事件copyText:function(){varthat=this;wx.setClipboardData({data:'要复制的文本内容',success:function(res){wx.showToast({title:'复制成功',icon:'succe
- uniapp和微信小程序的区别
木木木和小琳琳
uni-app微信小程序小程序
1、页面标签基本相同view,text、scroll-view,input、picker、swiper等等2、api基本相同,wx换成uni即可原生写法:wx.request、wx.showModal、wx.showToast、wx.showLoading、wx.chooseImage、wx.switchTab、wx.navigateo、wx.setStorageSync等等uniapp写法:un
- 微信小程序弹窗说明
munchmills
微信小程序小程序
1-最常用的加载防止服务器数据没有回调完成出发小程序页面!wx.showLoading({title:'加载中',mask:true})//开始wx.hideLoading()//完毕2-显示消息提示框wx.showToast({title:'内容',//提示的内容duration:2000,//持续的时间icon:'loading',//图标有success、error、loading、none
- 微信小程序form提交内容验证封装-手机号、内容为空、验证码倒计时
禾苗种树
微信小程序微信小程序javascript前端
//common.js//---封装文件复用-----//提交字段检验classCheck{constructor(){}content(txt,info){//内容if(txt==''){wx.showToast({title:info,icon:'none',duration:1000})returnfalse;}else{returntrue;}}tel(tel,info){//电话leti
- 微信小程序:清除缓存,退出登录
颖儿♡^▽^♡
微信小程序微信小程序
清除缓存,退出登录jsPage({//清除缓存,退出登录clear:function(){wx.clearStorageSync();//清除缓存wx.showToast({title:'退出登录成功',icon:'none',duration:2000,success:function(){setTimeout(function(){//跳转到首页,强制重启wx.reLaunch({url:'/
- 微信小程序获取剪切板的内容到输入框中
Big Fish 大鱼
#微信小程序开发微信小程序小程序
xml代码js代码Page({data:{code:''},getClipboard:function(){varthat=thiswx.getClipboardData({success:function(res){wx.showToast({title:'剪贴板内容是:'+res.data,icon:'none'})that.setData({code:res.data})},})return
- 微信小程序学习笔记(四)
pisces辰
1、微信小程序不支持jquery,不支持dom操作,小程序采用数据绑定形式。可以通过判断条件控制组件,在wxml添加if语句例如:if语句形式为wx:if,wx:elif,wx:else2、微信小程序提供的交互方法(常用)wx.showToast和wx.hideToast,显示消息提示框。wx.showToast({title:'成功',icon:'success',duration:2000})
- 微信小程序——简易复制文本
YqLty.˗ˏˋ♡ˎˊ˗
微信小程序小程序
在微信小程序中,可以使用wx.setClipboardData()方法来实现复制文本内容的功能。以下是一个示例代码://点击按钮触发复制事件copyText:function(){varthat=this;wx.setClipboardData({data:'要复制的文本内容',success:function(res){wx.showToast({title:'复制成功',icon:'succe
- 微信小程序自定义扫码界面
秋子丫
JavaScript微信小程序微信小程序小程序
因扫码功能需支持自定义输入,调用微信scanCode无法自定义界面补充输入框,所以使用原生组件camera。一、Demo演示小程序自定义扫码演示二、核心逻辑1、调用摄像头扫码将媒体组件camera应用模式设置为scanCode,并绑定扫码识别成功方法//wxml//jsscancode(event){const{result}=event.detail//获取校验扫描结果wx.showToast(
- 微信小程序之图片压缩
chent_某位
微信小程序微信小程序压缩图片
设计思路:选择图片后调用微信压缩图片接口,压缩后接收压缩图片的临时地址,调用微信储存接口保存图片至本地。参数:imagesrc:图片地址imgcount:是否选择图片show_hidden:是否展示按钮接口:wx.chooseImage:选择图片wx.compressImage:压缩图片wx.saveImageToPhotosAlbum:保存图片至相册wx.showToast:提示信息wxml(推
- mysql主从数据同步
林鹤霄
mysql主从数据同步
配置mysql5.5主从服务器(转)
教程开始:一、安装MySQL
说明:在两台MySQL服务器192.168.21.169和192.168.21.168上分别进行如下操作,安装MySQL 5.5.22
二、配置MySQL主服务器(192.168.21.169)mysql -uroot -p &nb
- oracle学习笔记
caoyong
oracle
1、ORACLE的安装
a>、ORACLE的版本
8i,9i : i是internet
10g,11g : grid (网格)
12c : cloud (云计算)
b>、10g不支持win7
&
- 数据库,SQL零基础入门
天子之骄
sql数据库入门基本术语
数据库,SQL零基础入门
做网站肯定离不开数据库,本人之前没怎么具体接触SQL,这几天起早贪黑得各种入门,恶补脑洞。一些具体的知识点,可以让小白不再迷茫的术语,拿来与大家分享。
数据库,永久数据的一个或多个大型结构化集合,通常与更新和查询数据的软件相关
- pom.xml
一炮送你回车库
pom.xml
1、一级元素dependencies是可以被子项目继承的
2、一级元素dependencyManagement是定义该项目群里jar包版本号的,通常和一级元素properties一起使用,既然有继承,也肯定有一级元素modules来定义子元素
3、父项目里的一级元素<modules>
<module>lcas-admin-war</module>
<
- sql查地区省市县
3213213333332132
sqlmysql
-- db_yhm_city
SELECT * FROM db_yhm_city WHERE class_parent_id = 1 -- 海南 class_id = 9 港、奥、台 class_id = 33、34、35
SELECT * FROM db_yhm_city WHERE class_parent_id =169
SELECT d1.cla
- 关于监听器那些让人头疼的事
宝剑锋梅花香
画图板监听器鼠标监听器
本人初学JAVA,对于界面开发我只能说有点蛋疼,用JAVA来做界面的话确实需要一定的耐心(不使用插件,就算使用插件的话也没好多少)既然Java提供了界面开发,老师又要求做,只能硬着头皮上啦。但是监听器还真是个难懂的地方,我是上了几次课才略微搞懂了些。
- JAVA的遍历MAP
darkranger
map
Java Map遍历方式的选择
1. 阐述
对于Java中Map的遍历方式,很多文章都推荐使用entrySet,认为其比keySet的效率高很多。理由是:entrySet方法一次拿到所有key和value的集合;而keySet拿到的只是key的集合,针对每个key,都要去Map中额外查找一次value,从而降低了总体效率。那么实际情况如何呢?
为了解遍历性能的真实差距,包括在遍历ke
- POJ 2312 Battle City 优先多列+bfs
aijuans
搜索
来源:http://poj.org/problem?id=2312
题意:题目背景就是小时候玩的坦克大战,求从起点到终点最少需要多少步。已知S和R是不能走得,E是空的,可以走,B是砖,只有打掉后才可以通过。
思路:很容易看出来这是一道广搜的题目,但是因为走E和走B所需要的时间不一样,因此不能用普通的队列存点。因为对于走B来说,要先打掉砖才能通过,所以我们可以理解为走B需要两步,而走E是指需要1
- Hibernate与Jpa的关系,终于弄懂
avords
javaHibernate数据库jpa
我知道Jpa是一种规范,而Hibernate是它的一种实现。除了Hibernate,还有EclipseLink(曾经的toplink),OpenJPA等可供选择,所以使用Jpa的一个好处是,可以更换实现而不必改动太多代码。
在play中定义Model时,使用的是jpa的annotations,比如javax.persistence.Entity, Table, Column, OneToMany
- 酸爽的console.log
bee1314
console
在前端的开发中,console.log那是开发必备啊,简直直观。通过写小函数,组合大功能。更容易测试。但是在打版本时,就要删除console.log,打完版本进入开发状态又要添加,真不够爽。重复劳动太多。所以可以做些简单地封装,方便开发和上线。
/**
* log.js hufeng
* The safe wrapper for `console.xxx` functions
*
- 哈佛教授:穷人和过于忙碌的人有一个共同思维特质
bijian1013
时间管理励志人生穷人过于忙碌
一个跨学科团队今年完成了一项对资源稀缺状况下人的思维方式的研究,结论是:穷人和过于忙碌的人有一个共同思维特质,即注意力被稀缺资源过分占据,引起认知和判断力的全面下降。这项研究是心理学、行为经济学和政策研究学者协作的典范。
这个研究源于穆来纳森对自己拖延症的憎恨。他7岁从印度移民美国,很快就如鱼得水,哈佛毕业
- other operate
征客丶
OSosx
一、Mac Finder 设置排序方式,预览栏 在显示-》查看显示选项中
二、有时预览显示时,卡死在那,有可能是一些临时文件夹被删除了,如:/private/tmp[有待验证]
--------------------------------------------------------------------
若有其他凝问或文中有错误,请及时向我指出,
我好及时改正,同时也让我们一
- 【Scala五】分析Spark源代码总结的Scala语法三
bit1129
scala
1. If语句作为表达式
val properties = if (jobIdToActiveJob.contains(jobId)) {
jobIdToActiveJob(stage.jobId).properties
} else {
// this stage will be assigned to "default" po
- ZooKeeper 入门
BlueSkator
中间件zk
ZooKeeper是一个高可用的分布式数据管理与系统协调框架。基于对Paxos算法的实现,使该框架保证了分布式环境中数据的强一致性,也正是基于这样的特性,使得ZooKeeper解决很多分布式问题。网上对ZK的应用场景也有不少介绍,本文将结合作者身边的项目例子,系统地对ZK的应用场景进行一个分门归类的介绍。
值得注意的是,ZK并非天生就是为这些应用场景设计的,都是后来众多开发者根据其框架的特性,利
- MySQL取得当前时间的函数是什么 格式化日期的函数是什么
BreakingBad
mysqlDate
取得当前时间用 now() 就行。
在数据库中格式化时间 用DATE_FORMA T(date, format) .
根据格式串format 格式化日期或日期和时间值date,返回结果串。
可用DATE_FORMAT( ) 来格式化DATE 或DATETIME 值,以便得到所希望的格式。根据format字符串格式化date值:
%S, %s 两位数字形式的秒( 00,01,
- 读《研磨设计模式》-代码笔记-组合模式
bylijinnan
java设计模式
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
import java.util.ArrayList;
import java.util.List;
abstract class Component {
public abstract void printStruct(Str
- 4_JAVA+Oracle面试题(有答案)
chenke
oracle
基础测试题
卷面上不能出现任何的涂写文字,所有的答案要求写在答题纸上,考卷不得带走。
选择题
1、 What will happen when you attempt to compile and run the following code? (3)
public class Static {
static {
int x = 5; // 在static内有效
}
st
- 新一代工作流系统设计目标
comsci
工作算法脚本
用户只需要给工作流系统制定若干个需求,流程系统根据需求,并结合事先输入的组织机构和权限结构,调用若干算法,在流程展示版面上面显示出系统自动生成的流程图,然后由用户根据实际情况对该流程图进行微调,直到满意为止,流程在运行过程中,系统和用户可以根据情况对流程进行实时的调整,包括拓扑结构的调整,权限的调整,内置脚本的调整。。。。。
在这个设计中,最难的地方是系统根据什么来生成流
- oracle 行链接与行迁移
daizj
oracle行迁移
表里的一行对于一个数据块太大的情况有二种(一行在一个数据块里放不下)
第一种情况:
INSERT的时候,INSERT时候行的大小就超一个块的大小。Oracle把这行的数据存储在一连串的数据块里(Oracle Stores the data for the row in a chain of data blocks),这种情况称为行链接(Row Chain),一般不可避免(除非使用更大的数据
- [JShop]开源电子商务系统jshop的系统缓存实现
dinguangx
jshop电子商务
前言
jeeshop中通过SystemManager管理了大量的缓存数据,来提升系统的性能,但这些缓存数据全部都是存放于内存中的,无法满足特定场景的数据更新(如集群环境)。JShop对jeeshop的缓存机制进行了扩展,提供CacheProvider来辅助SystemManager管理这些缓存数据,通过CacheProvider,可以把缓存存放在内存,ehcache,redis,memcache
- 初三全学年难记忆单词
dcj3sjt126com
englishword
several 儿子;若干
shelf 架子
knowledge 知识;学问
librarian 图书管理员
abroad 到国外,在国外
surf 冲浪
wave 浪;波浪
twice 两次;两倍
describe 描写;叙述
especially 特别;尤其
attract 吸引
prize 奖品;奖赏
competition 比赛;竞争
event 大事;事件
O
- sphinx实践
dcj3sjt126com
sphinx
安装参考地址:http://briansnelson.com/How_to_install_Sphinx_on_Centos_Server
yum install sphinx
如果失败的话使用下面的方式安装
wget http://sphinxsearch.com/files/sphinx-2.2.9-1.rhel6.x86_64.rpm
yum loca
- JPA之JPQL(三)
frank1234
ormjpaJPQL
1 什么是JPQL
JPQL是Java Persistence Query Language的简称,可以看成是JPA中的HQL, JPQL支持各种复杂查询。
2 检索单个对象
@Test
public void querySingleObject1() {
Query query = em.createQuery("sele
- Remove Duplicates from Sorted Array II
hcx2013
remove
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
For example,Given sorted array nums = [1,1,1,2,2,3],
Your function should return length
- Spring4新特性——Groovy Bean定义DSL
jinnianshilongnian
spring 4
Spring4新特性——泛型限定式依赖注入
Spring4新特性——核心容器的其他改进
Spring4新特性——Web开发的增强
Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC
Spring4新特性——Groovy Bean定义DSL
Spring4新特性——更好的Java泛型操作API
Spring4新
- CentOS安装Mysql5.5
liuxingguome
centos
CentOS下以RPM方式安装MySQL5.5
首先卸载系统自带Mysql:
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
查看是否还有mysql软件:
rpm -qa|grep mysql
去http://dev.mysql.c
- 第14章 工具函数(下)
onestopweb
函数
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/
- POJ 1050
SaraWon
二维数组子矩阵最大和
POJ ACM第1050题的详细描述,请参照
http://acm.pku.edu.cn/JudgeOnline/problem?id=1050
题目意思:
给定包含有正负整型的二维数组,找出所有子矩阵的和的最大值。
如二维数组
0 -2 -7 0
9 2 -6 2
-4 1 -4 1
-1 8 0 -2
中和最大的子矩阵是
9 2
-4 1
-1 8
且最大和是15
- [5]设计模式——单例模式
tsface
java单例设计模式虚拟机
单例模式:保证一个类仅有一个实例,并提供一个访问它的全局访问点
安全的单例模式:
/*
* @(#)Singleton.java 2014-8-1
*
* Copyright 2014 XXXX, Inc. All rights reserved.
*/
package com.fiberhome.singleton;
- Java8全新打造,英语学习supertool
yangshangchuan
javasuperword闭包java8函数式编程
superword是一个Java实现的英文单词分析软件,主要研究英语单词音近形似转化规律、前缀后缀规律、词之间的相似性规律等等。Clean code、Fluent style、Java8 feature: Lambdas, Streams and Functional-style Programming。
升学考试、工作求职、充电提高,都少不了英语的身影,英语对我们来说实在太重要