软工小组第一阶段——发帖
功能需求分析
为了实现经验分享功能,让用户可以输入文字、上传本地图片。对于文字数量、图片数量都有数字限制。
代码部分
qesupfile.wxml
<!--pages/qesUpfile/qesUpfile.wxml-->
<view class="file">
<view class="title">文件信息</view>
<radio-group class="options">
<radio class="opt" bindtap="clickOne" checked="{
{checked}}">课程相关(试卷、复习资料、电子书籍等)</radio>
<radio class="opt" bindtap="clickTwo" checked="{
{checked}}">其他(考研、考公、考证等)</radio>
</radio-group>
<!--课程相关-->
<view hidden="{
{hiddenOne}}" class="file-info">
<form bindsubmit="onSubmit">
<text>课程名</text>
<input placeholder="选填" class="file-input" name="need" value="{
{input}}"></input>
<text>作者</text>
<input placeholder="选填" class="file-input" name="author" value="{
{input}}"></input>
<text class="remind">转载请标明作者信息(如教师授课PPT,电子书籍等)</text>
<text>备注</text>
<input placeholder="选填" class="file-input" name="remark" value="{
{input}}"></input>
<view class="upFile" bindtap="selectFile" hidden="{
{!fileHidden}}">
<view class="uptext">文件上传</view>
</view>
<view hidden="{
{fileHidden}}" class="upFile">
<view class=" file-detail">
<view class="img-container" wx:if="{
{fileSuffix =='.xls'||fileSuffix =='.xlsx'}}">
<image src="/images/exl.png" class="file-icon"></image>
</view>
<view class="img-container" wx:elif="{
{fileSuffix =='.doc'||fileSuffix =='.docx'}}">
<image src="/images/doc.png" class="file-icon"></image>
</view>
<view class="img-container" wx:elif="{
{fileSuffix =='.ppt'||fileSuffix =='.pptx'}}">
<image src="/images/ppt.png" class="file-icon"></image>
</view>
<view class="img-container" wx:elif="{
{fileSuffix =='.rar'||fileSuffix =='.zip'}}">
<image src="/images/rar.png" class="file-icon"></image>
</view>
<view class="img-container" wx:elif="{
{fileSuffix =='.pdf'}}">