zzl00770

导航

2024年7月28日 #

判断arr数组里的元素是否存在{name:'张三'},

摘要: const arr = [ {name: '李四', name: '王五', name: '张三'}, {name: '李四', name: '王五', name: '张三'}, ]; const hasZhangSan = arr.some(item => item.name '张三'); con 阅读全文

posted @ 2024-07-28 07:01 品味人生nuiapp 阅读(1) 评论(0) 推荐(0) 编辑

2024年7月27日 #

将小数转换为整数

摘要: let num = 3.14; // 向下取整let floorNum = Math.floor(num); // 结果为 3console.log("向下取整:", floorNum); // 向上取整let ceilNum = Math.ceil(num); // 结果为 4console.lo 阅读全文

posted @ 2024-07-27 12:02 品味人生nuiapp 阅读(6) 评论(0) 推荐(0) 编辑

js 判断字符串是不是数字

摘要: function isNumeric(str) { return /^\d+$/.test(str); } // 使用示例 console.log(isNumeric("123")); // 输出: true console.log(isNumeric("abc")); // 输出: false 阅读全文

posted @ 2024-07-27 12:00 品味人生nuiapp 阅读(2) 评论(0) 推荐(0) 编辑

2024年1月26日 #

getskiplimit 跳过指定条数的数据 ,常用于分页

摘要: //云端代码 'use strict'; const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const res 阅读全文

posted @ 2024-01-26 21:42 品味人生nuiapp 阅读(4) 评论(0) 推荐(0) 编辑

2024年1月24日 #

tabs 标签页

摘要: <scroll-view scroll-x="true" class="scroll-view-x" scroll-left="{{scrollleft}}" scroll-with-animation> <view class="scroll-view-item" wx:for="{{tabDat 阅读全文

posted @ 2024-01-24 20:45 品味人生nuiapp 阅读(1) 评论(0) 推荐(0) 编辑

2024年1月23日 #

updata 更新数据

摘要: //云端代码 'use strict'; const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const docL 阅读全文

posted @ 2024-01-23 23:04 品味人生nuiapp 阅读(10) 评论(0) 推荐(0) 编辑

remove 移除数据

摘要: //云端代码 const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const docList = await co 阅读全文

posted @ 2024-01-23 22:42 品味人生nuiapp 阅读(7) 评论(0) 推荐(0) 编辑

getdata 按条件查询数据

摘要: //云端代码 const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const res = await collec 阅读全文

posted @ 2024-01-23 22:00 品味人生nuiapp 阅读(7) 评论(0) 推荐(0) 编辑

getlimit 获取n条数据

摘要: //前端代码 getlimit() { uni.showLoading({ title: '处理中...' }) uniCloud.callFunction({ name: 'getlimit', data:{ name:'unicloud-test', data:{ product:"uniClo 阅读全文

posted @ 2024-01-23 20:46 品味人生nuiapp 阅读(6) 评论(0) 推荐(0) 编辑

add 添加一条数据

摘要: //云端函数 'use strict'; const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const res 阅读全文

posted @ 2024-01-23 20:29 品味人生nuiapp 阅读(5) 评论(0) 推荐(0) 编辑