From 3f8655aec9371d5b320d78bb9b7eee3664d403a7 Mon Sep 17 00:00:00 2001 From: weixin_47563380 Date: Tue, 30 Jul 2024 11:42:00 +0800 Subject: [PATCH] Tue Jul 30 11:42:00 CST 2024 inscode --- .inscode | 6 +- InvMgmtIN/InvMgmtIN.json | 3 + InvMgmtIN/InvMgmtIN.less | 16 +++ InvMgmtIN/InvMgmtIN.ts | 230 +++++++++++++++++++++++++++++++++++++ InvMgmtIN/InvMgmtIN.wxml | 26 +++++ MDmaterial/MDmaterial.json | 5 + MDmaterial/MDmaterial.less | 51 ++++++++ MDmaterial/MDmaterial.ts | 151 ++++++++++++++++++++++++ MDmaterial/MDmaterial.wxml | 33 ++++++ app.json | 45 ++++++++ home/home.js | 0 home/home.json | 3 + home/home.less | 39 +++++++ home/home.ts | 99 ++++++++++++++++ home/home.wxml | 64 +++++++++++ passlist/passlist.json | 5 + passlist/passlist.less | 38 ++++++ passlist/passlist.ts | 157 +++++++++++++++++++++++++ passlist/passlist.wxml | 22 ++++ 19 files changed, 992 insertions(+), 1 deletion(-) create mode 100644 InvMgmtIN/InvMgmtIN.json create mode 100644 InvMgmtIN/InvMgmtIN.less create mode 100644 InvMgmtIN/InvMgmtIN.ts create mode 100644 InvMgmtIN/InvMgmtIN.wxml create mode 100644 MDmaterial/MDmaterial.json create mode 100644 MDmaterial/MDmaterial.less create mode 100644 MDmaterial/MDmaterial.ts create mode 100644 MDmaterial/MDmaterial.wxml create mode 100644 app.json create mode 100644 home/home.js create mode 100644 home/home.json create mode 100644 home/home.less create mode 100644 home/home.ts create mode 100644 home/home.wxml create mode 100644 passlist/passlist.json create mode 100644 passlist/passlist.less create mode 100644 passlist/passlist.ts create mode 100644 passlist/passlist.wxml diff --git a/.inscode b/.inscode index ecc8bdd..e177731 100644 --- a/.inscode +++ b/.inscode @@ -1,6 +1,10 @@ run = "npm i && npm run dev" +language = "node" [env] PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" XDG_CONFIG_HOME = "/root/.config" -npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" \ No newline at end of file +npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" + +[debugger] +program = "main.js" diff --git a/InvMgmtIN/InvMgmtIN.json b/InvMgmtIN/InvMgmtIN.json new file mode 100644 index 0000000..6f5247b --- /dev/null +++ b/InvMgmtIN/InvMgmtIN.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/InvMgmtIN/InvMgmtIN.less b/InvMgmtIN/InvMgmtIN.less new file mode 100644 index 0000000..1865eda --- /dev/null +++ b/InvMgmtIN/InvMgmtIN.less @@ -0,0 +1,16 @@ +/* pages/InvMgmtIN/InvMgmtIN.wxss */ + +.input { + display: flex; + width: 100%; + padding: 16px; + box-sizing: border-box; + border-top: .5px solid rgba(0, 0, 0, 0.1); + border-bottom: .5px solid rgba(0, 0, 0, 0.1); + color: black; +} + +.label { + width: 105px; +} + diff --git a/InvMgmtIN/InvMgmtIN.ts b/InvMgmtIN/InvMgmtIN.ts new file mode 100644 index 0000000..92b2889 --- /dev/null +++ b/InvMgmtIN/InvMgmtIN.ts @@ -0,0 +1,230 @@ +// pages/InvMgmtIN/InvMgmtIN.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + noError: true, + isShow: true, + currentTime: '',//年月日时分秒 + MText: '',//物料描述 + MCode: '',//批次编码 + MLocation: '',//存放地点 + src: '',// 存储拍摄的照片路径 + formData: { + MText: '',//物料描述 + MCode: '',//批次编码 + MLocation: '',//存放地点 + src: '',// 存储拍摄的照片路径 + }, + // 初始时,stkmat数组为空 + stkmats: [] + }, + + selectImage: function () { + wx.chooseImage({ + count: 1, + success: function (res) { + const tempFilePath = res.tempFilePaths[0]; // 用户选择的图片临时文件路径 + + // 将图片路径保存到本地缓存 + wx.setStorageSync('imagePath', tempFilePath); + + // 同时更新页面的数据,以便立即显示图片 + this.setData({ + src: tempFilePath + }); + this.setData({ + 'formData.src': tempFilePath + }); + }.bind(this) // 注意这里需要绑定this + }); + }, + + // 错误处理函数 + error: function (e: any) { + console.error('摄像头组件发生错误:', e.detail); + this.setData({ + isShow: false // 现在显示 + }); + // 这里可以添加你的错误处理逻辑 + }, + + addOrUpdateItem: function (e: any) { + const { MText, MCode, MLocation, src } = this.data.formData; + if (!MText || !MCode || !MLocation || !src) { + this.setData({ + noError: false + }) + return wx.showToast({ title: '请填写完整信息', icon: 'none' }); + }else{ + this.setData({ + noError: true + }) + } + let stkmat = { + MText: MText,//物料描述 + MCode: MCode,//批次编码 + MLocation: MLocation,//存放地点 + src: this.data.src,// 存储拍摄的照片路径 + }; + // 尝试从本地存储中获取'stkmats' + let storedItems = wx.getStorageSync('stkmats'); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + const itemslist = storedItems ? JSON.parse(storedItems) : []; + + // 使用Object.keys()来获取所有键,并计算它们的数量 + let recordCount = Object.keys(itemslist).length; + + // 将新记录添加到itemsList对象中,使用新记录的ID作为键 + itemslist[recordCount.toString()] = stkmat; + this.saveItems(itemslist); + }, + + saveItems: function (itemslist: any) { + wx.setStorageSync('stkmats', JSON.stringify(itemslist)); + + /* let storedItems = wx.getStorageSync('stkmats'); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + const itemslist1 = storedItems ? JSON.parse(storedItems) : []; + this.setData({ + items: itemslist + }); */ + }, + + onInputMText(e: any) { + this.setData({ + 'formData.MText': e.detail.value + }); + }, + + onInputMCode(e: any) { + this.setData({ + 'formData.MCode': e.detail.value + }); + }, + + onInputMLocation(e: any) { + this.setData({ + 'formData.MLocation': e.detail.value + }); + }, + + takePhoto() { + const ctx = wx.createCameraContext() + + ctx.takePhoto({ + quality: 'high', + success: (res) => { + this.setData({ + src: res.tempImagePath + }) + this.setData({ + 'formData.src': res.tempImagePath + }); + } + }) + }, + + savePhoto() { + this.addOrUpdateItem(); + if (this.data.noError) { + wx.showToast({ + title: '保存成功', + icon: 'success', + duration: 2000 + }) + } else { + wx.showToast({ + title: '保存失败', + icon: 'none', + duration: 2000 + }) + } + + /* wx.saveImageToPhotosAlbum({ + filePath: this.data.src, + success: function (res) { + wx.showToast({ + title: '保存成功', + icon: 'success', + duration: 2000 + }) + }, + fail: function (err) { + wx.showToast({ + title: '保存失败', + icon: 'none', + duration: 2000 + }) + } + }) */ + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + // 获取当前时间 + let now = new Date(); + // 格式化日期时间字符串 + let formattedTime = `${now.getFullYear()}${(now.getMonth() + 1).toString().padStart(2, '0')}${now.getDate().toString().padStart(2, '0')}${now.getHours().toString().padStart(2, '0')}${now.getMinutes().toString().padStart(2, '0')}${now.getSeconds().toString().padStart(2, '0')}`; + // 更新页面数据 + this.setData({ + 'formData.MCode': formattedTime + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + wx.setNavigationBarTitle({ + title: '扫码入库', + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/InvMgmtIN/InvMgmtIN.wxml b/InvMgmtIN/InvMgmtIN.wxml new file mode 100644 index 0000000..4bd0225 --- /dev/null +++ b/InvMgmtIN/InvMgmtIN.wxml @@ -0,0 +1,26 @@ + + +显示图片 + + + + + 物料描述 + + + + 批次编码 + + + + 存放地点 + + + + \ No newline at end of file diff --git a/MDmaterial/MDmaterial.json b/MDmaterial/MDmaterial.json new file mode 100644 index 0000000..31b9d1f --- /dev/null +++ b/MDmaterial/MDmaterial.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navigation-bar": "/components/navigation-bar/navigation-bar" + } +} \ No newline at end of file diff --git a/MDmaterial/MDmaterial.less b/MDmaterial/MDmaterial.less new file mode 100644 index 0000000..4e471fb --- /dev/null +++ b/MDmaterial/MDmaterial.less @@ -0,0 +1,51 @@ +/* pages/MDmaterial/MDmaterial.wxss */ + +.menu { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10rpx 10rpx; + background-color: #feffff; +} + +.menu-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.menu-item image { + width: 80rpx; + height: 80rpx; +} + +.menu-item text { + margin-top: 10rpx; + font-size: 28rpx; + color: #000000; +} + +.shop-item{ + display: flex; + padding: 15rpx; + border: 1px solid #efefef; + margin: 15rpx; + border-radius: 8rpx; + box-shadow: 1rpx 1rpx 15rpx #ddd; +} +.thumb image{ + width: 250rpx; + height: 250rpx; + display: block; + margin-right: 15rpx; +} +.info{ + display: flex; + flex-direction: column; + justify-content: space-around; + font-size: 24rpx; +} +.shop-title{ + font-weight: bold; +} \ No newline at end of file diff --git a/MDmaterial/MDmaterial.ts b/MDmaterial/MDmaterial.ts new file mode 100644 index 0000000..e62afc2 --- /dev/null +++ b/MDmaterial/MDmaterial.ts @@ -0,0 +1,151 @@ +// pages/MDmaterial/MDmaterial.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + isShow:true, + searchInput: '', // 用户输入的查询条件 + searchResults: [], // 查询结果 + imagePath: '', // 用于存储图片的路径 + MText: '',//物料描述 + MCode: '',//批次编码 + MLocation: '',//存放地点 + src: '',// 存储拍摄的照片路径 + item: { + MText: '',//物料描述 + MCode: '',//批次编码 + MLocation: '',//存放地点 + src: '',// 存储拍摄的照片路径 + }, + // 初始时,stkmat数组为空 + itmes: [] + }, + + // 处理输入事件 + handleInput: function (e) { + this.setData({ + searchInput: e.detail.value + }); + }, + + // 执行查询 + searchData: function () { + let searchInput = this.data.searchInput.trim(); + let searchResults = []; + + // 这里我们进行简单的模糊查询,即检查name或info字段是否包含搜索条件 + this.data.items.forEach(item => { + if (item.MText.includes(searchInput) || item.MCode.includes(searchInput) || item.MLocation.includes(searchInput)) { + searchResults.push(item); + this.setData({ + isShow: false + }); + } + }); + + // 更新查询结果到页面上 + this.setData({ + searchResults: searchResults + }); + }, + + selectImage: function () { + wx.chooseImage({ + count: 1, + success: function (res) { + const tempFilePath = res.tempFilePaths[0]; // 用户选择的图片临时文件路径 + + // 将图片路径保存到本地缓存 + wx.setStorageSync('imagePath', tempFilePath); + + // 同时更新页面的数据,以便立即显示图片 + this.setData({ + imagePath: tempFilePath + }); + }.bind(this) // 注意这里需要绑定this + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + // 页面加载时,尝试从缓存中读取图片路径 + const cachedImagePath = wx.getStorageSync('imagePath') || ''; + if (cachedImagePath) { + this.setData({ + imagePath: cachedImagePath + }); + } else { + this.setData({ + imagePath: "/images/banner1.jpg" //初始图片 + }); + } + + // 尝试从本地存储中获取'items' + const storedItems = wx.getStorageSync('stkmats'); + //console.log('storedItems:'+storedItems); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + // 如果是null,则默认为空数组;否则,尝试解析JSON字符串为数组 + const itemslist = storedItems ? JSON.parse(storedItems) : []; + + //if(itemslist) + //console.log('itemslist:'+itemslist); + // 更新页面的items数据 + this.setData({ + items: itemslist + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + wx.setNavigationBarTitle({ + title: '物料管理', + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/MDmaterial/MDmaterial.wxml b/MDmaterial/MDmaterial.wxml new file mode 100644 index 0000000..61400b8 --- /dev/null +++ b/MDmaterial/MDmaterial.wxml @@ -0,0 +1,33 @@ + + + + + {{item.MText}} - {{item.MCode}} - {{item.MLocation}} + + + + + + + + + + + 物料描述: {{item.MText}} + 批次编码:{{item.MCode}} + 存放地点: {{item.MLocation}} + + + + + + + + + + + 物料描述: {{item.MText}} + 批次编码:{{item.MCode}} + 存放地点: {{item.MLocation}} + + diff --git a/app.json b/app.json new file mode 100644 index 0000000..1170b1c --- /dev/null +++ b/app.json @@ -0,0 +1,45 @@ +{ + "pages": [ + "pages/home/home", + "pages/passlist/passlist", + "pages/InvMgmtIN/InvMgmtIN", + "pages/MDmaterial/MDmaterial" + ], + "window": { + "backgroundTextStyle":"light", + "navigationBarBackgroundColor": "#008c8c", + "navigationBarTitleText": "小型仓储系统-单机版", + "navigationBarTextStyle":"white" + }, + "tabBar": { + "list": [{ + "pagePath": "pages/home/home", + "text": "首页", + "iconPath": "/images/card1.jpg", + "selectedIconPath": "/images/card1.jpg" + },{ + "pagePath": "pages/message/message", + "text": "消息", + "iconPath": "/images/card1.jpg", + "selectedIconPath": "/images/card1.jpg" + },{ + "pagePath": "pages/contact/contact", + "text": "联系我们", + "iconPath": "/images/card1.jpg", + "selectedIconPath": "/images/card1.jpg" + }] + }, + + "style": "v2", + "rendererOptions": { + "skyline": { + "defaultDisplayBlock": true, + "disableABTest": true, + "sdkVersionBegin": "3.0.0", + "sdkVersionEnd": "15.255.255" + } + }, + "componentFramework": "glass-easel", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents" +} \ No newline at end of file diff --git a/home/home.js b/home/home.js new file mode 100644 index 0000000..e69de29 diff --git a/home/home.json b/home/home.json new file mode 100644 index 0000000..6f5247b --- /dev/null +++ b/home/home.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/home/home.less b/home/home.less new file mode 100644 index 0000000..d276870 --- /dev/null +++ b/home/home.less @@ -0,0 +1,39 @@ +.swiper-image{ + width: 100%; + height: 100%; +} +.grid-list{ + display: flex; + flex-wrap: wrap; /* 让弹性盒元素在必要的时候拆行 */ + border-left: 1px solid #efefef; + border-top: 1px solid #efefef; +} +.grid-item{ + width: 33.33%; + height: 200rpx; + display: flex; + flex-direction: column;/* 项目将垂直显示,正如一个列一样。 */ + align-items: center; /* 定义flex子项在flex容器的中心 */ + justify-content: center;/*用于设置或检索弹性盒子元素在主轴(横轴)方向上的对齐方式为居中*/ + border-right: 1px solid #efefef; + border-bottom: 1px solid #efefef; + box-sizing: border-box; +} +.grid-item image { + width: 60rpx; + height: 60rpx; +} +.grid-item text{ + font-size: 24rpx; + margin-top: 10rpx; +} +/* 图片 */ +.img-box{ + display: flex; + padding: 20rpx 10rpx; + justify-content: space-around; +} +.img-box image{ + width: 45%; + height: 250rpx; +} \ No newline at end of file diff --git a/home/home.ts b/home/home.ts new file mode 100644 index 0000000..4fcc2a2 --- /dev/null +++ b/home/home.ts @@ -0,0 +1,99 @@ +// pages/home/home.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + SwiperList: [] + }, + + // 获取轮播图的方法 + getSwiperList() { + console.log('执行getSwiperList') + // wx.request({ + // //url: 'https://www.escook.cn/slides', + // url: 'https://www.csdn.net/', + // method: 'GET', + // success: (res) => { + // // 类似于React中的setState,将状态数据更新 + // this.setData({ + // SwiperList: res.data + // }) + // } + // }) + }, + + goToInvMgmt: function() { + wx.navigateTo({ + url: '/pages/InvMgmt/InvMgmt' // 库存管理 + }); + }, + + goToMDmaterial: function() { + wx.navigateTo({ + url: '/pages/MDmaterial/MDmaterial' // 物料管理 + }); + }, + + goToPasslist: function() { + wx.navigateTo({ + url: '/pages/passlist/passlist' // 用户管理 + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + this.getSwiperList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/home/home.wxml b/home/home.wxml new file mode 100644 index 0000000..7d5fe8d --- /dev/null +++ b/home/home.wxml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + 物料管理 + + + + 库存管理 + + + + 用户管理 + + + + 赚钱建家 + + + + 赚钱建家 + + + + 赚钱建家 + + + + 赚钱建家 + + + + 赚钱建家 + + + + 赚钱建家 + + + + + + + \ No newline at end of file diff --git a/passlist/passlist.json b/passlist/passlist.json new file mode 100644 index 0000000..31b9d1f --- /dev/null +++ b/passlist/passlist.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navigation-bar": "/components/navigation-bar/navigation-bar" + } +} \ No newline at end of file diff --git a/passlist/passlist.less b/passlist/passlist.less new file mode 100644 index 0000000..edecce9 --- /dev/null +++ b/passlist/passlist.less @@ -0,0 +1,38 @@ +.container { + padding: 20px; +} + +.input{ + margin: 10px 0; +} +.textlist { + display: flex; + justify-content: space-between; + align-items: left; + padding: 10px; + height: 100px; + width: 100%; +} +.form-container{ + display: grid; + width:100%; + padding: 10px; +} +.list-container{ + display: grid; + width:100%; +} +.list-container .item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px; + border-bottom: 1px solid #ccc; + +} + +.button{ + display: flex; + margin-left: 10px; + width: 50%; +} diff --git a/passlist/passlist.ts b/passlist/passlist.ts new file mode 100644 index 0000000..374d5b4 --- /dev/null +++ b/passlist/passlist.ts @@ -0,0 +1,157 @@ +// pages/passlist/passlist.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + name:'', + age:'', + formData: { + name: '', + age: '' + }, + // 初始时,items数组为空 + items: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + this.loadItems(); + }, + bindNameInput: function(e:any) { + console.log(e.detail.value); + this.setData({ + 'formData.name': e.detail.value + }); + }, + bindAgeInput: function(e:any) { + this.setData({ + 'formData.age': e.detail.value + }); + }, + + addOrUpdateItem: function(e:any) { + const { name, age } = this.data.formData; + if (!name || !age) return wx.showToast({ title: '请填写完整信息', icon: 'none' }); + let item = { + name: name, + age: age + }; + // 尝试从本地存储中获取'items' + let storedItems = wx.getStorageSync('items'); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + const itemslist = storedItems ? JSON.parse(storedItems) : []; + + // 使用Object.keys()来获取所有键,并计算它们的数量 + let recordCount = Object.keys(itemslist).length; + + // 将新记录添加到itemsList对象中,使用新记录的ID作为键 + itemslist[recordCount.toString()] = item; + this.saveItems(itemslist); + }, + + editItem: function(e:any) { + const index = e.currentTarget.dataset.index; + const item = this.data.items[index]; + console.log(typeof item); + this.setData({ + //这里会报错:类型“never”上不存在属性“name”。这不影响传值。不用理会报错。 + formData: { name: item.name, age: item.age } + }); + }, + deleteItem: function(e:any) { + const index = e.currentTarget.dataset.index; + const items = [...this.data.items]; + items.splice(index, 1); + this.setData({ + items:items + }); + this.saveItems(items); + }, + + saveItems: function(itemslist:any) { + console.log('保存'); + wx.setStorageSync('items', JSON.stringify(itemslist)); + let storedItems = wx.getStorageSync('items'); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + const itemslist1 = storedItems ? JSON.parse(storedItems) : []; + //var itemslist = wx.getStorageSync('items'); + this.setData({ + items:itemslist + }); + }, + + loadItems: function() { + // 尝试从本地存储中获取'items' + const storedItems = wx.getStorageSync('items'); + //console.log('storedItems:'+storedItems); + // 检查storedItems是否为null(或undefined,但wx.getStorageSync不会返回undefined) + // 如果是null,则默认为空数组;否则,尝试解析JSON字符串为数组 + const itemslist = storedItems ? JSON.parse(storedItems) : []; + + //if(itemslist) + //console.log('itemslist:'+itemslist); + // 更新页面的items数据 + this.setData({ + items:itemslist + }); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + wx.setNavigationBarTitle({ + title: '用户管理', + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + // 在这里调用API显示提示框 + wx.showToast({ + title: '人家是有底线的。', // 提示的内容 + icon: 'none', // 图标,'success'、'loading'等,默认无图标 + duration: 2000 // 提示的延迟时间,单位毫秒,默认1500 + }); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/passlist/passlist.wxml b/passlist/passlist.wxml new file mode 100644 index 0000000..87230af --- /dev/null +++ b/passlist/passlist.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + {{item.name}} - {{item.age}} + + + + + + + + + \ No newline at end of file -- GitLab