From 827cd5ed4b7c08aef5dabf3f881419e4d3f54092 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Sat, 19 Nov 2022 14:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 - README.md | 22 +-- miniprogram/app.js | 19 +-- miniprogram/app.json | 17 +- miniprogram/images/icon/help.png | Bin 0 -> 2084 bytes miniprogram/images/icon/icon_home.png | Bin 1583 -> 2478 bytes miniprogram/images/icon/icon_home_active.png | Bin 757 -> 2654 bytes miniprogram/images/icon/no_wifi.png | Bin 0 -> 2135 bytes miniprogram/model/index.js | 1 + miniprogram/pages/home/home.js | 154 ++++++++++-------- miniprogram/pages/home/home.json | 3 + miniprogram/pages/home/home.wxml | 40 +++-- miniprogram/pages/home/home.wxss | 106 +++++++++--- miniprogram/pages/list/list.js | 114 ------------- miniprogram/pages/list/list.wxml | 9 - miniprogram/pages/more/more.js | 3 +- miniprogram/pages/more/more.json | 3 + miniprogram/pages/more/more.wxml | 4 +- .../pages/{list/list.wxss => more/more.wxss} | 5 +- miniprogram/pages/partner/partner.js | 91 ----------- miniprogram/pages/partner/partner.wxml | 1 - miniprogram/pages/partner/partner.wxss | 6 - miniprogram/sitemap45.json | 7 - package.json | 12 ++ 24 files changed, 232 insertions(+), 388 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 miniprogram/images/icon/help.png create mode 100644 miniprogram/images/icon/no_wifi.png create mode 100644 miniprogram/model/index.js create mode 100644 miniprogram/pages/home/home.json delete mode 100644 miniprogram/pages/list/list.js delete mode 100644 miniprogram/pages/list/list.wxml create mode 100644 miniprogram/pages/more/more.json rename miniprogram/pages/{list/list.wxss => more/more.wxss} (57%) delete mode 100644 miniprogram/pages/partner/partner.js delete mode 100644 miniprogram/pages/partner/partner.wxml delete mode 100644 miniprogram/pages/partner/partner.wxss delete mode 100644 miniprogram/sitemap45.json create mode 100644 package.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 4fdff43..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "editor.emptySelectionClipboard": false -} \ No newline at end of file diff --git a/README.md b/README.md index e097b0c..e7f5d12 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# 云开发 quickstart - -这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力: - -- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库 -- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理 -- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码 - -## 参考文档 - -- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html) +# 项目背景 + - 该微信小程序主要用来获取用户wifi的BSSID信息,通过wifi的BSSID配合公众号号的围栏功能,使围栏告警更加准确。 + - 主要流程:公众号/h5携带围栏信息-》跳转到此小程序-》小程序获取用户相关wifi信息-》保存wifi信息。 + - 因功能单一,现主要采用小程序原生开发,后续有需要再使用其它框架迭代 +# 版本管理 +## 2.0.0 +`2022.11.16` +- 重构小程序 + - 重构内容 + 1. A增加 获取用户wifi信息功能 + 2. A 增加 版本控制 diff --git a/miniprogram/app.js b/miniprogram/app.js index e0b83de..01f6d94 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -1,19 +1,2 @@ //app.js -App({ - onLaunch: function () { - if (!wx.cloud) { - console.error('请使用 2.2.3 或以上的基础库以使用云能力') - } else { - wx.cloud.init({ - // env 参数说明: - // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源 - // 此处请填入环境 ID, 环境 ID 可打开云控制台查看 - // 如不填则使用默认环境(第一个创建的环境) - env: 'cloud1-7g8hw3qu242eeb5f', - traceUser: true, //将用户访问记录到用户管理中 - }) - } - - this.globalData = {} - } -}) +App({}) diff --git a/miniprogram/app.json b/miniprogram/app.json index 0797487..95c8b76 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,8 +1,6 @@ { "pages": [ "pages/home/home", - "pages/list/list", - "pages/partner/partner", "pages/more/more" ], "permission": { @@ -13,7 +11,7 @@ "window": { "backgroundTextStyle": "dark", "navigationBarBackgroundColor": "#1772cb", - "navigationBarTitleText": "发不好看", + "navigationBarTitleText": "随手精灵", "navigationBarTextStyle": "white" }, "tabBar": { @@ -28,10 +26,10 @@ "text": "首页" }, { - "pagePath": "pages/list/list", - "iconPath": "images/icon/icon_list.png", - "selectedIconPath": "images/icon/icon_list_active.png", - "text": "列表" + "pagePath": "pages/more/more", + "iconPath": "images/icon/icon_more.png", + "selectedIconPath": "images/icon/icon_more_active.png", + "text": "更多" } ] }, @@ -40,8 +38,5 @@ "downloadFile": 10000 }, "debug": true, - "navigateToMiniProgramAppIdList": [ - "wx64cc3af90544c0cd" - ], - "sitemapLocation": "sitemap45.json" + "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/miniprogram/images/icon/help.png b/miniprogram/images/icon/help.png new file mode 100644 index 0000000000000000000000000000000000000000..44fc12654b893f781d701cfaac886b06d9854f92 GIT binary patch literal 2084 zcmV+<2;29GP)Px+-bqA3RCr$PoM~)SRTRhn=e{x&6c8=4sHi{y(MV@d3IvU7)HH~i2xZZjz)UqN z#wFkfW1=xCs1Ucrc8W0y7BK;<(J#gi8eFO}Q;1PS!DwP|p$HnGw)5^WciJ(v%$v8} zJ2NHok|s^&+_U`N-S0h*PC1pg~2YCRQM7AfQ1-S=Ge4 zO+2!zt7p1^m_#;BlorMjP{R@j1>+Yc{)u7j8`_0$+gH(_8sgWYqNEUKHFeiXVa+E{ z9Ro3dCwq^I_7RX`aJwz-9lIMN?cU4kl`Ja68CyA0eFQg3wigi5GQFVy%)D8U^-k9) zZ2x)@b?eseq_1cYqs{gj5LN>?wFto-0%Kh|VXZBKE%TG@*hX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Cxxm!lc1{p;aO{*4Eki88<1RxiLo5J+0+=XgVgVrjA4D-~*IN_|AOHXW M07*qoM6N<$g4eJZ)c^nh literal 757 zcmVPx%uSrBfRCr$P+&@kNK@y341=tcUH!?Y}MO;o~QeextT*zd=O~B=tE=YizgiD>| z+Q1e@vCwH^?>w2{9YnQ&o0wc`*F4J#0{(wj9Y%%xsLk*&uVkPpOdkhy*-g4 ztgr0s>du|t+>>6nIpB}U*nI)`F9aN88WNm)fN=mL!2sUsaCC5v1Dl+44i$llKt&V{ zx~K?L#CA3?rWri0#3qMLPH>aUeLyGG2?`RNPcVR)UorwPGjPC%b;ec)Dgv9F;3kIz z+p7p1xHC@?00yvN2Q!RmNH7vCm|%t}0tsfGg8>X+R0Li!DmkD)MPP~$tO(4(%x4i? n!0*qor<_6S&n|D1zkT%=po$D1T1e-=00000NkvXXu0mjfZ0t$k diff --git a/miniprogram/images/icon/no_wifi.png b/miniprogram/images/icon/no_wifi.png new file mode 100644 index 0000000000000000000000000000000000000000..78933f0b6ebdd659c01e1d6056c00b6fa0cb6fa4 GIT binary patch literal 2135 zcmV-d2&ngoP)Px-5lKWrRCr$PoM+56MHPS_gs21&Yb>Z(fS}ljJyC)|0V`5e5-S?85Ic4gUGRr>-cqHJb>28_j%=Qi7FyONVWs+IPg80e+@HQEp`ZjQ8m|FflmfRcIwU+LX zQSpZY%queTt_)(X_GylMd;UAh{!ZWneL)V|r73Z(bWFw47vjOdyIWfODe#^EP(yhgM4R*#z-wAM{H`GvF%Vc8SWr4!mPkwpi|f3i7Fu z?$9YS?BT$7bLz{5ct_wDfNoopybE}JPJ?Tf=c&LaTGsWQ0hOawav*L8oC~B(hW&t( zx*E#--d*(p!NYOGs?ybAopP-*eZO?wYH5Gl;2x&z%qIksELlYt#GQao0ryPQVASO& znSh$Iso_r#MspR-$*u0kA%b(+NT!p9zQ%i#>R1~@2l%BBs*2028CwC@=8ibZ z=ME@5lkJQll@WhBa6!)sPfK`Qe**SMZ8mKXKMK6C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Z2+z##7YU*b`xouCF`;#=9n>69$yEji9WSh3t2aaZ5mhy=A9Wq`p+_Emvw@e3$TLr zhhX+J9ezy;c3mKLt%3T}p3}tQi+-PsWxWPn71?!w*ac8e3NOb{3f%VoD2BcHo@?$fnnz_XRGWgW}u}-vqoZ z8hDo>?ehvX(*J}~iO)OK)LCS1h))6z3I|xOeO2m$;q9=ugmV7#i$Pc8x*F^Her||e z{kutgzd#(}XIdaG5Jw;|LKTZ9E)Yi`FhUiJCN2<1ATUA|izbc$@do_QY+<;04haAN N002ovPDHLkV1jlt1>67t literal 0 HcmV?d00001 diff --git a/miniprogram/model/index.js b/miniprogram/model/index.js new file mode 100644 index 0000000..12b546d --- /dev/null +++ b/miniprogram/model/index.js @@ -0,0 +1 @@ +export const VersionModel = '2.0.0F'; \ No newline at end of file diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index 95dcdf8..93ed90b 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -5,36 +5,18 @@ Page({ * 页面的初始数据 */ data: { - wifiList: [ - /* {SSID: '114141111', BSSID: '141142424151215'}, - {SSID: '11414111', BSSID: '1441421411215'} */ - ], //当前wifi列表 + wlanList: [ + ], //当前wlan列表 + isConnectWlan: null, //是否已经连接上WLAN + connectWlanBssid: '', //当前连接WLAN的SSID }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - // 加载wifi模板 - wx.startWifi({ - success(res) { - console.log("成功", res.errMsg); - }, - fail(res) { - console.log("失败", res.errMsg); - wx.showModal({ - title: '温馨提示', - content: '请打开WIFI和GPS再操作', - success(res) { - if (res.confirm) { - console.log('用户点击确定'); - } else if (res.cancel) { - console.log('用户点击取消'); - } - } - }) - } - }); + this.onStartWifi(); + // todo 获取从微信公众号跳转的参数 }, /** @@ -95,42 +77,20 @@ Page({ url: "/pages/list/list", }) }, - redirectTo() { - wx.redirectTo({ - url: '/pages/home/imgshow/imgshow' - }) - }, - // 复制周边wifi的bsid - copyWifiBsid(value) { - const wifiBsid = value.currentTarget.dataset.name; - console.log("复制的值::", wifiBsid); - wx.setClipboardData({data: wifiBsid}) - }, - // 获取当前链接的wifi信息 - getConnectedWifi: function () { - wx.getConnectedWifi({ + // 加载wifi模板 + onStartWifi() { + let that = this; + wx.startWifi({ success(res) { - console.log(res); - const wifiBssid = res.wifi.BSSID; - wx.showModal({ - title: '当前wifiBSSID是', - content: wifiBssid, - confirmText: '复制', - cancelText: '关闭', - success(res) { - if (res.confirm) { - console.log("wifiBssid", wifiBssid); - console.log("复制"); - wx.setClipboardData({data: wifiBssid}) - } - } - }) + console.log("成功", res.errMsg); + that.getWifiList(); }, fail(res) { - console.log(res.errMsg); + console.log("失败", res.errMsg); wx.showModal({ title: '温馨提示', - content: '请打开WIFI和GPS再操作', + content: `当前用户未打开WIFI和GPS`, + showCancel: false, success(res) { if (res.confirm) { console.log('用户点击确定'); @@ -140,13 +100,56 @@ Page({ } }) } + }); + }, + // 获取当前链接的wifi信息 + getConnectedWifi: function () { + let that = this; + wx.getConnectedWifi({ + success(res) { + console.log(res); + if(res) { + // 如果已经连接上WLAN + that.setData({ + isConnectWlan: true, + connectWlanBssid: res.wifi.BSSID, + }) + } + }, + fail(res) { + console.log(res.errMsg); + that.setData({ + isConnectWlan: false + }) + } }) }, - // 获取周边的wifi列表 + // 刷新 + onRefresh() { + this.getWifiList(); + }, + // 搜索不到WLAN + onHelp() { + wx.showModal({ + title: '温馨提示', + content: `请您前往手机-设置-WLAN,打开WLAN开关并且打开手机的GPS`, + showCancel: false, + }) + }, + // 保存WLAN信息 + onSave(value) { + let that = this; + const currentWlanInfo = value.currentTarget.dataset.name; + console.log("当前点击的WLAN信息", currentWlanInfo); + // todo 调取接口 + }, + // 获取当前连接的周边的wifi列表 getWifiList() { let that = this; + // 先获取当前连接的wifi信息 + that.getConnectedWifi(); wx.showLoading({ - title: '获取中...' + title: '获取中WLAN...' }); wx.getWifiList({ success(res) { @@ -157,25 +160,36 @@ Page({ icon: 'success' }); wx.onGetWifiList((result) => { - that.setData({ - wifiList: result.wifiList - }) - console.log(result); - }) + // 筛选wifi名称为空的数据 + let wifiList = result.wifiList.filter(item => { + return item.SSID !== ''; + }); + // ,如果有已连接的wifi则将已连接的wifi移动到第一位,否则不做任何操作 + if(that.data.connectWlanBssid !== '') { + //let newWifiList = that.data.wlanList; + // 找到与当前已连接wifi相同bssid数据的下标 + const index = wifiList.findIndex(v => v.BSSID === that.data.connectWlanBssid); + //根据该对象在数组的下标从数组中移出 + const moveObj = wifiList.splice(index, 1); + //把当前数据插入到数据首位 + wifiList.splice(0, 0, ...moveObj); + that.setData({ + wlanList: wifiList + }) + } else { + that.setData({ + wlanList: wifiList + }) + } + }); }, fail(res) { console.log(res.errMsg); wx.hideLoading(); wx.showModal({ title: '温馨提示', - content: '请打开WIFI和GPS再操作', - success(res) { - if (res.confirm) { - console.log('用户点击确定'); - } else if (res.cancel) { - console.log('用户点击取消'); - } - } + content: '当前用户未打开WIFI和GPS', + showCancel: false, }) }, }); diff --git a/miniprogram/pages/home/home.json b/miniprogram/pages/home/home.json new file mode 100644 index 0000000..eea7301 --- /dev/null +++ b/miniprogram/pages/home/home.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "首页" + } \ No newline at end of file diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml index 152bd28..62fe8ce 100644 --- a/miniprogram/pages/home/home.wxml +++ b/miniprogram/pages/home/home.wxml @@ -1,23 +1,31 @@ - - 周边WIFI列表 - - - WIFI名称:{{wifiList[index].SSID}} - - BSSID:{{wifiList[index].BSSID}} - - - + + + 设备不支持5G类型以及机场,酒店等热点WLAN。如未获取到,请打开WIFI和GPS后刷新页面。点击WLAN名称可查看WLAN信息。 + + + + 可用WLAN列表 + + + + + + + + (当前手机连接网络) + {{wlanList[index].SSID}} - - 无 - + + + + 找不到WLAN? + - - - + + + 搜索不到WLAN \ No newline at end of file diff --git a/miniprogram/pages/home/home.wxss b/miniprogram/pages/home/home.wxss index 6cfd905..e3f3fce 100644 --- a/miniprogram/pages/home/home.wxss +++ b/miniprogram/pages/home/home.wxss @@ -1,42 +1,96 @@ /* pages/home/home.wxss.wxss */ .home-container { - height: 100%; + position: relative; + height: 100vh; + overflow: hidden; + background-color: #f2f4f5; +} +.header { + height: 80px; display: flex; justify-content: center; align-items: center; - flex-direction: column; + padding: 0 20px; + background-color: #fff; + font-size: 14px; + color: gray; } -.picker { - margin: 30px 0; +.disable-wlan { + height: 50px; + line-height: 50px; + margin-top: 15px; + padding: 0 20px; + display: flex; + justify-content: space-between; + align-items: center; + background-color: white; } -.wifi-list { +.disable-wlan-btn { + width: 120px; + display: flex; + justify-content: space-between; + align-items: center; +} +.refresh-img { + height: 25px; + width: 25px; +} +.body { + height: calc(100vh - 205px); + overflow: auto; + background-color: #f2f4f5; +} +.wlan-list { + flex: 1; + background-color: #f2f4f5; + overflow: auto; +} +.wlan-list-empty { + height: 100%; display: flex; justify-content: center; align-items: center; flex-direction: column; - border: 1px solid; - margin-bottom: 40px; -} -.wifi-title { - width: 100%; - background-color: rgb(245, 238, 238); - text-align: center; - line-height: 40px; -} -.wifi-container { - max-height: 200px; - width: 300px; - text-align: center; - overflow: scroll; -} -.btn-container { - width: 300px; +} +.no_wifi { + height: 80px; + width: 80px; + margin-bottom: 10px; + opacity: .6; +} +button { + width: 120px; + margin: 10px 0; +} +.wlan-item { + height: 65px; + line-height: 65px; + padding-left: 20px; + margin: 5px 0; + background-color: #fff; + white-space: nowrap; + overflow-y: hidden; +} +.wlan-item-text { + font-size: 14px; +} +.isConnect { + color: #2599ff; +} +.footer { + height: 55px; display: flex; justify-content: center; align-items: center; - flex-direction: column; + color: #2599ff; + background-color: #fff; + position: absolute; + bottom: 5px; + left: 0; + right: 0; } -.btn { - height: 40px; - width: 100%; +.help { + height: 25px; + width: 25px; + margin-right: 5px; } \ No newline at end of file diff --git a/miniprogram/pages/list/list.js b/miniprogram/pages/list/list.js deleted file mode 100644 index be9aec2..0000000 --- a/miniprogram/pages/list/list.js +++ /dev/null @@ -1,114 +0,0 @@ -// pages/list/list.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - dataArr: [ - {name: '1冥', age: 16, className: '阿瑟斯s1'}, - {name: '2冥', age: 26, className: '阿瑟斯s2'}, - {name: '3冥', age: 36, className: '阿瑟斯s3'}, - {name: '4冥', age: 46, className: '阿瑟斯s4'}, - ], - isShow: true, - imgUrls: [ - 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640', - 'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640', - 'https://images.unsplash.com/photo-1551446591-142875a901a1?w=640' - ], - interval: 5000, - duration: 1000, - indicatorDots: true, - indicatorColor: "#ffffff", - activecolor:"#2971f6", - autoplay: true, - count: 'count', - nowTime: new Date().toLocaleDateString(), - url: '', - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - wx.startWifi({ - success (res) { - console.log("成功", res.errMsg); - - }, - fail(res) { - console.log("失败", res.errMsg); - } - }); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - // 跳转h5测试 - jumph5() { - let id = 'test';//需要发送到H5页面的参数 - wx.navigateTo({ - //测试时可以用本地IP地址进行跳转(上线时换为线上的真实IP地址) - url:`https://id.ssjlai.com/parentweb/#/index?id=${id}`, - }) - }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, - /* - 注册点击事件 - */ - onClickCount: function() { - wx.getConnectedWifi({ - success (res) { - console.log(res); - }, - fail(res) { - console.log(res.errMsg); - } - }) - } -}) \ No newline at end of file diff --git a/miniprogram/pages/list/list.wxml b/miniprogram/pages/list/list.wxml deleted file mode 100644 index 9dce75a..0000000 --- a/miniprogram/pages/list/list.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - -现在是: {{nowTime}} - - - - - - \ No newline at end of file diff --git a/miniprogram/pages/more/more.js b/miniprogram/pages/more/more.js index 2df501d..14870a3 100644 --- a/miniprogram/pages/more/more.js +++ b/miniprogram/pages/more/more.js @@ -1,11 +1,12 @@ // pages/more/more.js +import { VersionModel } from '../../model/index' Page({ /** * 页面的初始数据 */ data: { - + version: VersionModel, //版本号 }, /** diff --git a/miniprogram/pages/more/more.json b/miniprogram/pages/more/more.json new file mode 100644 index 0000000..c0c9438 --- /dev/null +++ b/miniprogram/pages/more/more.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "更多" + } \ No newline at end of file diff --git a/miniprogram/pages/more/more.wxml b/miniprogram/pages/more/more.wxml index 2b01eb5..6f5be68 100644 --- a/miniprogram/pages/more/more.wxml +++ b/miniprogram/pages/more/more.wxml @@ -1,2 +1,4 @@ -更多 + + 当前小程序版本号:{{version}} + \ No newline at end of file diff --git a/miniprogram/pages/list/list.wxss b/miniprogram/pages/more/more.wxss similarity index 57% rename from miniprogram/pages/list/list.wxss rename to miniprogram/pages/more/more.wxss index 546ceea..96ba6f2 100644 --- a/miniprogram/pages/list/list.wxss +++ b/miniprogram/pages/more/more.wxss @@ -1,8 +1,7 @@ -.list-container { +.more-container { height: 100%; - padding: 10px; + width: 100%; display: flex; justify-content: center; align-items: center; - flex-direction: column; } \ No newline at end of file diff --git a/miniprogram/pages/partner/partner.js b/miniprogram/pages/partner/partner.js deleted file mode 100644 index ad2786a..0000000 --- a/miniprogram/pages/partner/partner.js +++ /dev/null @@ -1,91 +0,0 @@ -Page({ - data: { - userInfo: {}, - hasUserInfo: false, - canIUseGetUserProfile: false, - array: ['美国', '中国', '巴西', '日本'], - index: 0 - }, - onLoad() { - if (wx.getUserProfile) { - this.setData({ - canIUseGetUserProfile: true - }) - } - }, - getUserProfile(e) { - // 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 - // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 - wx.getUserProfile({ - desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - }, - getUserInfo(e) { - // 不推荐使用 getUserInfo 获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 - this.setData({ - userInfo: e.detail.userInfo, - hasUserInfo: true - }) - }, - onStore() { - wx.setStorage({ - key: "test", - data: "testStore" - }) - }, - onGetStore() { - wx.showLoading({ - title: '加载中', - }) - setTimeout(function () { - wx.hideLoading() - wx.showToast({ - title: '成功', - icon: 'success', - duration: 2000, - mask: true - }); - }, 2000) - /* wx.showToast({ - title: '成功', - icon: 'success', - duration: 2000 - }); */ - wx.getStorage({ - key: 'test', - success(res) { - console.log(res.data) - } - }) - }, - onGetDialop() { - wx.showModal({ - title: '温馨提示', - content: '这是一个模态弹窗', - success(res) { - if (res.confirm) { - console.log('用户点击确定'); - } else if (res.cancel) { - console.log('用户点击取消'); - } - } - }) - }, - onGetPay() { - wx.showActionSheet({ - itemList: ['A', 'B', 'C'], - success (res) { - console.log(res.tapIndex) - }, - fail (res) { - console.log(res.errMsg) - } - }) - } -}) \ No newline at end of file diff --git a/miniprogram/pages/partner/partner.wxml b/miniprogram/pages/partner/partner.wxml deleted file mode 100644 index 1738cf4..0000000 --- a/miniprogram/pages/partner/partner.wxml +++ /dev/null @@ -1 +0,0 @@ -伙伴 \ No newline at end of file diff --git a/miniprogram/pages/partner/partner.wxss b/miniprogram/pages/partner/partner.wxss deleted file mode 100644 index 30e255a..0000000 --- a/miniprogram/pages/partner/partner.wxss +++ /dev/null @@ -1,6 +0,0 @@ -/* pages/partner/partner.wxss.wxss */ -map { - height: 100vh; - width: 100%; - background-color: red; -} \ No newline at end of file diff --git a/miniprogram/sitemap45.json b/miniprogram/sitemap45.json deleted file mode 100644 index ca02add..0000000 --- a/miniprogram/sitemap45.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", - "rules": [{ - "action": "allow", - "page": "*" - }] -} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a55592b --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "dependencies": {}, + "name": "miniprogram-4", + "description": "这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +}