当前位置:网站首页>【微信小程序】协同工作和发布 数据绑定
【微信小程序】协同工作和发布 数据绑定
2022-06-21 18:28:00 【热爱编程的小白白】
目录
协同工作和发布 - 小程序成员管理
1. 成员管理的两个方面

2. 不同项目成员对应的权限
| 权限 | 运营者 | 开发者 | 数据分析者 |
开发者权限 | √ | ||
体验者权限 | √ | √ | √ |
登录 | √ | √ | √ |
数据分析 | √ | ||
微信支付 | √ | ||
推广 | √ | ||
开发管理 | √ | ||
开发设置 | √ | ||
暂停服务 | √ | ||
解除关联公众号 | √ | ||
腾讯云管理 | √ | ||
小程序插件 | √ | ||
游戏运营管理 | √ |
3. 开发者的权限说明
4. 添加项目成员和体验成员


协同工作和发布 - 小程序的版本
1. 软件开发过程中的不同版本
2. 小程序的版本
版本阶段 | 说明 |
开发版本 | 使用开发者工具,可将代码上传到开发版本中。 开发版本只保留每人最新的一份上传的代码。 点击提交审核,可将代码提交审核。开发版本可删除,不影响线上版本和审核中版本的代码。 |
体验版本 | 可以选择某个开发版本作为体验版,并且选取一份体验版。 |
审核中的版本 | 只能有一份代码处于审核中。有审核结果后可以发布到线上,也可直接重新提交审核,覆盖原审核版本。 |
线上版本 | 线上所有用户使用的代码版本,该版本代码在新版本代码发布后被覆盖更新。 |
协同工作和发布 - 发布上线
1. 小程序发布上线的整体步骤
2. 上传代码
① 点击开发者工具顶部工具栏中的“上传” 按钮



3. 在后台查看上传之后的版本

4. 提交审核
5. 发布

6. 基于小程序码进行推广
协同工作和发布 - 运营数据
1. 查看小程序运营数据的两种方式
WXML 模板语法 - 数据绑定
1. 数据绑定的基本原则
2. 在 data 中定义页面的数据
这是默认的index页面:

// index.js
// 获取应用实例
const app = getApp()
Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
canIUseGetUserProfile: false,
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad() {
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
console.log(e)
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}
})

新建一个页面,打开js文件


Page({
data: {
word:"内容"
}
})
3. Mustache 语法的格式
4. Mustache 语法的应用场景
WXML:
<view>{
{word}}</view>WXSS:
Page({
data: {
word:"卷起来 冲冲冲"
}
})效果:

<image src="{
{image}}" mode="widthFix"></image>WXSS:
Page({
data: {
image:"/image/a.jpg"
}
})效果:

Page({
data: {
randomNum:Math.random()*100
}
})<view>{
{randomNum>=50 ? '大于等于50':'小于50'}}</view>
生成的随机数为:97.50952738069331>50

算术运算
页面的数据如下:
Page({
data: {
randomNum:Math.random().toFixed(2)
}
})页面的结构如下:
<view>{
{randomNum*100}}</view>
边栏推荐
- 开通融资融券账户安全吗?有什么要求?
- 删除倒数第k个节点-链表专题
- SQL语句知识点有哪些
- HMS Core机器学习服务身份证识别功能,实现信息高效录入
- zabbix6.0+timescaledb+企业微信告警
- Medical expense list can be entered at a second speed, and OCR recognition can help double the efficiency
- Datagear uses coordinate mapping table to make geographic coordinate data visualization Kanban
- 技术实践 | 场景导向的音视频通话体验优化
- Envi classic annotation object how to recall modification and deletion of element legend scale added
- JVM内存结构
猜你喜欢

SQL语句知识点有哪些

【ICML2022】CtrlFormer: 通过Transformer学习视觉控制的可迁移状态表示

How to simulate a request or modify a requested domain name in Chrome browser

Kubernetes migration of persistent volumes across storageclasses Complete Guide

研报精选 | 麦肯锡《中国数字创新未来》趋势解读

Shang Silicon Valley Shang Silicon Valley | what is Clickhouse table engine memory and merge

mysql增加的语句是什么

gorm数据库是否需要设置外键
![[complete course of time series prediction] take temperature prediction as an example to illustrate the composition of the paper and the construction of pytorch code pipeline](/img/fe/c204ea78051fb0544b27d44e6d1297.png)
[complete course of time series prediction] take temperature prediction as an example to illustrate the composition of the paper and the construction of pytorch code pipeline

【CVPR2022】CMU《多模态机器学习》教程,200+页阐述表示、对齐、推理、迁移、生成与量化六大挑战的多模态学习系统知识
随机推荐
播放量高达4000w+,情侣如何靠撒狗粮出圈?
inno setup 安装路径框学习
[complete course of time series prediction] take temperature prediction as an example to illustrate the composition of the paper and the construction of pytorch code pipeline
[dry goods knowledge] redis: from the application to the bottom, one article will help you
mysql如何對列求和
LeetCode个人题解(剑指offer 21-25)21. 调整数组顺序使奇数位于偶数前面,22. 链表中倒数第k个节点,24. 反转链表,25. 合并两个排序的链表
机器学习之贝叶斯分类与集成学习
How to query all tables in MySQL
汇编语言贪吃蛇、俄罗斯方块双任务设计实现详解(二)——贪吃蛇详细设计
记一些PAT题目(一)
Clustering, dimension reduction and measurement techniques for machine learning
理财产品如果过了开放日期怎么赎回?
大鱼吃小鱼小游戏完整版
manjaro安装下载的ttf字体文件
mysql中有没有关键字
【时序预测完整教程】以气温预测为例说明论文组成及PyTorch代码管道构建
Introduction to machine learning
一种简单的架构设计逻辑|得物技术
新手使用APICloud可视化开发搭建商城主页
机器学习之模型评估与选择