Ver código fonte

Initial Commit

feat
JinxChen 2 anos atrás
commit
c32647bd15
43 arquivos alterados com 3028 adições e 0 exclusões
  1. +14
    -0
      .gitignore
  2. +3
    -0
      .vscode/settings.json
  3. +12
    -0
      README.md
  4. +7
    -0
      cloudfunctions/callback/config.json
  5. +25
    -0
      cloudfunctions/callback/index.js
  6. +14
    -0
      cloudfunctions/callback/package.json
  7. +5
    -0
      cloudfunctions/echo/config.json
  8. +8
    -0
      cloudfunctions/echo/index.js
  9. +14
    -0
      cloudfunctions/echo/package.json
  10. +5
    -0
      cloudfunctions/login/config.json
  11. +36
    -0
      cloudfunctions/login/index.js
  12. +2051
    -0
      cloudfunctions/login/package-lock.json
  13. +14
    -0
      cloudfunctions/login/package.json
  14. +15
    -0
      cloudfunctions/openapi/config.json
  15. +86
    -0
      cloudfunctions/openapi/index.js
  16. +14
    -0
      cloudfunctions/openapi/package.json
  17. +19
    -0
      miniprogram/app.js
  18. +47
    -0
      miniprogram/app.json
  19. +1
    -0
      miniprogram/app.wxss
  20. BIN
      miniprogram/images/icon/icon_home.png
  21. BIN
      miniprogram/images/icon/icon_home_active.png
  22. BIN
      miniprogram/images/icon/icon_list.png
  23. BIN
      miniprogram/images/icon/icon_list_active.png
  24. BIN
      miniprogram/images/icon/icon_more.png
  25. BIN
      miniprogram/images/icon/icon_more_active.png
  26. BIN
      miniprogram/images/icon/icon_partner.png
  27. BIN
      miniprogram/images/icon/icon_partner_active.png
  28. +183
    -0
      miniprogram/pages/home/home.js
  29. +23
    -0
      miniprogram/pages/home/home.wxml
  30. +42
    -0
      miniprogram/pages/home/home.wxss
  31. +114
    -0
      miniprogram/pages/list/list.js
  32. +9
    -0
      miniprogram/pages/list/list.wxml
  33. +8
    -0
      miniprogram/pages/list/list.wxss
  34. +66
    -0
      miniprogram/pages/more/more.js
  35. +2
    -0
      miniprogram/pages/more/more.wxml
  36. +91
    -0
      miniprogram/pages/partner/partner.js
  37. +1
    -0
      miniprogram/pages/partner/partner.wxml
  38. +6
    -0
      miniprogram/pages/partner/partner.wxss
  39. +7
    -0
      miniprogram/sitemap.json
  40. +7
    -0
      miniprogram/sitemap45.json
  41. +6
    -0
      miniprogram/style/app.wxss
  42. +67
    -0
      project.config.json
  43. +6
    -0
      project.private.config.json

+ 14
- 0
.gitignore Ver arquivo

@@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/

# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes

# Node.js
node_modules/

+ 3
- 0
.vscode/settings.json Ver arquivo

@@ -0,0 +1,3 @@
{
"editor.emptySelectionClipboard": false
}

+ 12
- 0
README.md Ver arquivo

@@ -0,0 +1,12 @@
# 云开发 quickstart

这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:

- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码

## 参考文档

- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)


+ 7
- 0
cloudfunctions/callback/config.json Ver arquivo

@@ -0,0 +1,7 @@
{
"permissions": {
"openapi": [
"customerServiceMessage.send"
]
}
}

+ 25
- 0
cloudfunctions/callback/index.js Ver arquivo

@@ -0,0 +1,25 @@
const cloud = require('wx-server-sdk')

cloud.init({
// API 调用都保持和云函数当前所在环境一致
env: cloud.DYNAMIC_CURRENT_ENV
})

// 云函数入口函数
exports.main = async (event, context) => {
console.log(event)

const { OPENID } = cloud.getWXContext()

const result = await cloud.openapi.customerServiceMessage.send({
touser: OPENID,
msgtype: 'text',
text: {
content: `收到:${event.Content}`,
}
})

console.log(result)

return result
}

+ 14
- 0
cloudfunctions/callback/package.json Ver arquivo

@@ -0,0 +1,14 @@
{
"name": "callback",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.5.3"
}
}

+ 5
- 0
cloudfunctions/echo/config.json Ver arquivo

@@ -0,0 +1,5 @@
{
"permissions": {
"openapi": []
}
}

+ 8
- 0
cloudfunctions/echo/index.js Ver arquivo

@@ -0,0 +1,8 @@
const cloud = require('wx-server-sdk')

exports.main = async (event, context) => {
// event.userInfo 是已废弃的保留字段,在此不做展示
// 获取 OPENID 等微信上下文请使用 cloud.getWXContext()
delete event.userInfo
return event
}

+ 14
- 0
cloudfunctions/echo/package.json Ver arquivo

@@ -0,0 +1,14 @@
{
"name": "echo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.5.3"
}
}

+ 5
- 0
cloudfunctions/login/config.json Ver arquivo

@@ -0,0 +1,5 @@
{
"permissions": {
"openapi": []
}
}

+ 36
- 0
cloudfunctions/login/index.js Ver arquivo

@@ -0,0 +1,36 @@
// 云函数模板
// 部署:在 cloud-functions/login 文件夹右击选择 “上传并部署”

const cloud = require('wx-server-sdk')

// 初始化 cloud
cloud.init({
// API 调用都保持和云函数当前所在环境一致
env: cloud.DYNAMIC_CURRENT_ENV
})

/**
* 这个示例将经自动鉴权过的小程序用户 openid 返回给小程序端
*
* event 参数包含小程序端调用传入的 data
*
*/
exports.main = async (event, context) => {
console.log(event)
console.log(context)

// 可执行其他自定义逻辑
// console.log 的内容可以在云开发云函数调用日志查看

// 获取 WX Context (微信调用上下文),包括 OPENID、APPID、及 UNIONID(需满足 UNIONID 获取条件)等信息
const wxContext = cloud.getWXContext()

return {
event,
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
env: wxContext.ENV,
}
}


+ 2051
- 0
cloudfunctions/login/package-lock.json
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 14
- 0
cloudfunctions/login/package.json Ver arquivo

@@ -0,0 +1,14 @@
{
"name": "login",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.5.3"
}
}

+ 15
- 0
cloudfunctions/openapi/config.json Ver arquivo

@@ -0,0 +1,15 @@
{
"permissions": {
"openapi": [
"wxacode.get",
"subscribeMessage.send",
"subscribeMessage.addTemplate",
"templateMessage.send",
"templateMessage.addTemplate",
"templateMessage.deleteTemplate",
"templateMessage.getTemplateList",
"templateMessage.getTemplateLibraryById",
"templateMessage.getTemplateLibraryList"
]
}
}

+ 86
- 0
cloudfunctions/openapi/index.js Ver arquivo

@@ -0,0 +1,86 @@
// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
console.log(event)
switch (event.action) {
case 'requestSubscribeMessage': {
return requestSubscribeMessage(event)
}
case 'sendSubscribeMessage': {
return sendSubscribeMessage(event)
}
case 'getWXACode': {
return getWXACode(event)
}
case 'getOpenData': {
return getOpenData(event)
}
default: {
return
}
}
}

async function requestSubscribeMessage(event) {
// 此处为模板 ID,开发者需要到小程序管理后台 - 订阅消息 - 公共模板库中添加模板,
// 然后在我的模板中找到对应模板的 ID,填入此处
return '请到管理后台申请模板 ID 然后在此替换' // 如 'N_J6F05_bjhqd6zh2h1LHJ9TAv9IpkCiAJEpSw0PrmQ'
}

async function sendSubscribeMessage(event) {
const { OPENID } = cloud.getWXContext()

const { templateId } = event

const sendResult = await cloud.openapi.subscribeMessage.send({
touser: OPENID,
templateId,
miniprogram_state: 'developer',
page: 'pages/openapi/openapi',
// 此处字段应修改为所申请模板所要求的字段
data: {
thing1: {
value: '咖啡',
},
time3: {
value: '2020-01-01 00:00',
},
}
})

return sendResult
}

async function getWXACode(event) {
// 此处将获取永久有效的小程序码,并将其保存在云文件存储中,最后返回云文件 ID 给前端使用

const wxacodeResult = await cloud.openapi.wxacode.get({
path: 'pages/openapi/openapi',
})

const fileExtensionMatches = wxacodeResult.contentType.match(/\/([^/]+)/)
const fileExtension = (fileExtensionMatches && fileExtensionMatches[1]) || 'jpg'

const uploadResult = await cloud.uploadFile({
// 云文件路径,此处为演示采用一个固定名称
cloudPath: `wxacode_default_openapi_page.${fileExtension}`,
// 要上传的文件内容可直接传入图片 Buffer
fileContent: wxacodeResult.buffer,
})

if (!uploadResult.fileID) {
throw new Error(`upload failed with empty fileID and storage server status code ${uploadResult.statusCode}`)
}

return uploadResult.fileID
}

async function getOpenData(event) {
return cloud.getOpenData({
list: event.openData.list,
})
}

+ 14
- 0
cloudfunctions/openapi/package.json Ver arquivo

@@ -0,0 +1,14 @@
{
"name": "openapi",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.5.3"
}
}

+ 19
- 0
miniprogram/app.js Ver arquivo

@@ -0,0 +1,19 @@
//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 = {}
}
})

+ 47
- 0
miniprogram/app.json Ver arquivo

@@ -0,0 +1,47 @@
{
"pages": [
"pages/home/home",
"pages/list/list",
"pages/partner/partner",
"pages/more/more"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#1772cb",
"navigationBarTitleText": "发不好看",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#13227a",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/home",
"iconPath": "images/icon/icon_home.png",
"selectedIconPath": "images/icon/icon_home_active.png",
"text": "首页"
},
{
"pagePath": "pages/list/list",
"iconPath": "images/icon/icon_list.png",
"selectedIconPath": "images/icon/icon_list_active.png",
"text": "列表"
}
]
},
"networkTimeout": {
"request": 10000,
"downloadFile": 10000
},
"debug": true,
"navigateToMiniProgramAppIdList": [
"wx64cc3af90544c0cd"
],
"sitemapLocation": "sitemap45.json"
}

+ 1
- 0
miniprogram/app.wxss Ver arquivo

@@ -0,0 +1 @@
@import 'style/app.wxss';

BIN
miniprogram/images/icon/icon_home.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 1.5KB

BIN
miniprogram/images/icon/icon_home_active.png Ver arquivo

Antes Depois
Largura: 88  |  Altura: 81  |  Tamanho: 757B

BIN
miniprogram/images/icon/icon_list.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 1.4KB

BIN
miniprogram/images/icon/icon_list_active.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 2.2KB

BIN
miniprogram/images/icon/icon_more.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 1.1KB

BIN
miniprogram/images/icon/icon_more_active.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 2.2KB

BIN
miniprogram/images/icon/icon_partner.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 1.7KB

BIN
miniprogram/images/icon/icon_partner_active.png Ver arquivo

Antes Depois
Largura: 81  |  Altura: 81  |  Tamanho: 5.9KB

+ 183
- 0
miniprogram/pages/home/home.js Ver arquivo

@@ -0,0 +1,183 @@
// pages/home/home.js
Page({

/**
* 页面的初始数据
*/
data: {
wifiList: [
/* {SSID: '114141111', BSSID: '141142424151215'},
{SSID: '11414111', BSSID: '1441421411215'} */
], //当前wifi列表
},

/**
* 生命周期函数--监听页面加载
*/
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('用户点击取消');
}
}
})
}
});
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

},
navigateTo() {
wx.navigateTo({
url: '/pages/lifecyle/lifecyle'
})
},
switchTab() {
wx.switchTab({
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({
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})
}
}
})
},
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('用户点击取消');
}
}
})
}
})
},
// 获取周边的wifi列表
getWifiList() {
let that = this;
wx.showLoading({
title: '获取中...'
});
wx.getWifiList({
success(res) {
console.log("getWifiList", res);
wx.hideLoading();
wx.showToast({
title: '获取成功',
icon: 'success'
});
wx.onGetWifiList((result) => {
that.setData({
wifiList: result.wifiList
})
console.log(result);
})
},
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('用户点击取消');
}
}
})
},
});
}
})

+ 23
- 0
miniprogram/pages/home/home.wxml Ver arquivo

@@ -0,0 +1,23 @@
<view class="home-container">
<view class="wifi-list">
<text class="wifi-title">周边WIFI列表</text>
<view class="wifi-container">
<view wx:for="{{wifiList}}" wx:key="index">
<text> WIFI名称:{{wifiList[index].SSID}}</text>
<view>
<text>BSSID:{{wifiList[index].BSSID}}</text>
</view>
<view>
<button size="mini" type="primary" bindtap="copyWifiBsid" data-name="{{wifiList[index].BSSID}}">复制</button>
</view>
</view>
<text wx:if="{{wifiList.length === 0}}">
</text>
</view>
</view>
<view class="btn-container">
<button bindtap="getConnectedWifi" size="mini" class="btn">获取当前链接wifi的信息</button>
<button bindtap="getWifiList" size="mini" class="btn">获取当前周边wifi的信息</button>
</view>
</view>

+ 42
- 0
miniprogram/pages/home/home.wxss Ver arquivo

@@ -0,0 +1,42 @@
/* pages/home/home.wxss.wxss */
.home-container {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.picker {
margin: 30px 0;
}
.wifi-list {
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;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.btn {
height: 40px;
width: 100%;
}

+ 114
- 0
miniprogram/pages/list/list.js Ver arquivo

@@ -0,0 +1,114 @@
// 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);
}
})
}
})

+ 9
- 0
miniprogram/pages/list/list.wxml Ver arquivo

@@ -0,0 +1,9 @@
<view class="list-container">
<text>
现在是: {{nowTime}}
</text>
<view>
<web-view src="{{ url }}"></web-view>
</view>
<button bindtap="jumph5" size="mini" class="btn">跳转h5测试</button>
</view>

+ 8
- 0
miniprogram/pages/list/list.wxss Ver arquivo

@@ -0,0 +1,8 @@
.list-container {
height: 100%;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}

+ 66
- 0
miniprogram/pages/more/more.js Ver arquivo

@@ -0,0 +1,66 @@
// pages/more/more.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 2
- 0
miniprogram/pages/more/more.wxml Ver arquivo

@@ -0,0 +1,2 @@
<!--pages/more/more.wxml-->
<text>更多</text>

+ 91
- 0
miniprogram/pages/partner/partner.js Ver arquivo

@@ -0,0 +1,91 @@
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)
}
})
}
})

+ 1
- 0
miniprogram/pages/partner/partner.wxml Ver arquivo

@@ -0,0 +1 @@
<view>伙伴</view>

+ 6
- 0
miniprogram/pages/partner/partner.wxss Ver arquivo

@@ -0,0 +1,6 @@
/* pages/partner/partner.wxss.wxss */
map {
height: 100vh;
width: 100%;
background-color: red;
}

+ 7
- 0
miniprogram/sitemap.json Ver arquivo

@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

+ 7
- 0
miniprogram/sitemap45.json Ver arquivo

@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

+ 6
- 0
miniprogram/style/app.wxss
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 67
- 0
project.config.json Ver arquivo

@@ -0,0 +1,67 @@
{
"miniprogramRoot": "miniprogram/",
"cloudfunctionRoot": "cloudfunctions/",
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"minifyWXML": true,
"useStaticServer": true
},
"appid": "wx64cc3af90544c0cd",
"projectname": "cloudbase",
"libVersion": "2.14.1",
"condition": {
"miniprogram": {
"list": [
{
"name": "db guide",
"pathName": "pages/databaseGuide/databaseGuide",
"query": ""
}
]
}
},
"compileType": "miniprogram",
"srcMiniprogramRoot": "miniprogram/",
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
}

+ 6
- 0
project.private.config.json Ver arquivo

@@ -0,0 +1,6 @@
{
"setting": {
"compileHotReLoad": true
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
}

Carregando…
Cancelar
Salvar