微信小程序怎么上传文件并显示出来

微信小程序怎么上传文件并显示出来,第1张

微信小程序 leancloud ——本地图片上传由于本站最近学习微信小程序的知识,这里记录下微信小程序实现本地上传的功能实现方法,以下是网上找的资料,大家看下。 将本地图片上兄历传至leancloud后台/6a0b4c301fed32d0e2a8 如果有同学用到leancloud,可以参照.其他可以看看文档. 微信小程序上传本地图片文件 2.index.wxml <!--index.wxml--> <羡或搜button style="margin:30rpx" bindtap="chooseimage">获取图片团轮</button> <image src="{{tempFilePaths }}" mode="aspecFill" style="width: 100%height: 450rpx"/> 感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

UI参照腾讯微云,开发支持感谢FatDong大神的博客源码: VueBlog 。本次项目只实芹没现了凯首枝盯敏文件上传,上传进度条,视图切换功能,后台接口独立开发。旨在学习:

线上地址

GitHub源码

项目独立完成,诚请大佬提出建议。

使用 Vue + LeanCloud 开发的一个周报系统,纯前端实现。并利用 LeanCloud 云引擎服务,实现每周五给全员发送邮件,提醒填写周报。周六周日分别再次对未填人员发码敏粗送拿庆邮件提醒。

LeanCloud 应用配置

前往 LeanCloud 或 LeanCloud 国际版新增应用。并导入 /appSchema/ 下的 schema

修改 src/config/av.config-example.js 文件,填入 LeanCloud 应用的 App ID App key 服务器地址

此 id 、 key 、 url 可以从 LeanCloud 要关联的应用 =>设置 =>应用 Key 中获取。

LeanCloud 国际版应用不强制要求绑定自有域名,如果使用 LeanCloud 国际版应用, url 可以留空( url: '' )。

周报配置

可以从 src/config/input.config.js 和 src/config/group.config.js 中配置周报填写的类型、说明以及小组配置,格式相应参见文件即可。

发送邮件配置

修改 mail/mailer-example.php 文件,配置完成后重命名为 mailer.php 即可

无需邮件服务器,迟镇直接使用各个邮箱的 SMTP 服务即可完成。

这里发送邮件的实现是使用了 PHPMailer 简单包装来实现的。

以上展示了配置发送邮件的功能,还需要定时查找用户或未提交的用户来发送邮件。

此处使用 LeanCloud 云引擎中的定时任务来实现:

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

相关文档可参考 LeanCloud 开发指南 。

构建使用步骤

此项目直接使用 Vue-cli 工具初始化,配置进行了略微修改,相关命令如下:

关于打包后的部署使用,请根据要放的目录,自行调整 /config/index.js 中的 assetsPublicPath 路径,并将打包生成的文件(默认在 /dist/ 下)全部拷贝到你指定目录下即可。

周报填写页面

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

周报汇总展示

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

汇总图表

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

只想看你关心的?这里有!

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

个人信息维护

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

管理员对成员查看和管理

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

支持任意时段的历史查看,并且支持导出 csv 表格。

<figcaption style="line-height: inheritmargin: 0pxpadding: 0pxmargin-top: 10pxtext-align: centercolor: rgb(153, 153, 153)font-size: 0.7em">在这里插入图片描述</figcaption>

点击查看更多云引擎项目示例 。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12193688.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存