网站的关键词怎么设置,网站建设怎么宣传,做一个简单的网站要多少钱,网站建设的方法和技术锋哥原创的uniapp微信小程序投票系统实战#xff1a;
uniapp微信小程序投票系统实战课程 (SpringBoot2vue3.2element plus ) ( 火爆连载更新中... )_哔哩哔哩_bilibiliuniapp微信小程序投票系统实战课程 (SpringBoot2vue3.2element plus ) ( 火爆连载更新中... )共计21条视频…锋哥原创的uniapp微信小程序投票系统实战
uniapp微信小程序投票系统实战课程 (SpringBoot2vue3.2element plus ) ( 火爆连载更新中... )_哔哩哔哩_bilibiliuniapp微信小程序投票系统实战课程 (SpringBoot2vue3.2element plus ) ( 火爆连载更新中... )共计21条视频包括uniapp微信小程序投票系统实战课程 (SpringBoot2vue3.2element plus ) ( 火爆连载更新中... )、第2讲 投票项目后端架构搭建、第3讲 小程序端 TabBar搭建等UP主更多精彩视频请关注UP账号。https://www.bilibili.com/video/BV1ea4y137xf/图文投票和文字投票基本一样就是在投票选项里面多了一个选项图片 view classoption_item v-for(item,index) in options :keyitem.idview classoption_inputtext classremoveOption clickremoveOption(item.id)#xe618;/textinput typetext v-modelitem.name placeholder输入选项名称 placeholder-stylecolor:#bababa;font-size:14px/view view classoption_uploaduni-file-pickerselectselectVoteItemFileFunc($event,index):auto-uploadfalse limit1:del-iconfalse disable-preview file-mediatypeimage :imageStylesvoteItemImageStylesview classuploadtext classsmallUploadImg#xe727;/text/view/uni-file-picker/view/view
.option_item{margin-top: 10px;border-radius: 5px;background-color: white;padding: 10px;.option_input{display: flex;}.option_upload{margin-top: 20rpx;.upload{margin: 10rpx;background-color: #f4f5f7;width:90rpx;height: 90rpx;display: flex;align-items: center;justify-content: center;}}} voteItemImageStyles:{width:150rpx,height:120rpx,border:false},
selectVoteItemFileFunc:function(e,index){console.log(indexindex)console.log(e.tempFilePaths[0])uni.uploadFile({header:{token:uni.getStorageSync(token)},url:getBaseUrl()/vote/uploadVoteItemImage,filePath:e.tempFilePaths[0],name:voteItemImage,success: (res) {let resultJSON.parse(res.data);if(result.code0){this.options[index].imageresult.voteItemImageFileName;}}})},
加个image属性: 提交加上验证
// 验证投票选项如果有名称的必须要上传图片for(var i0;ithis.options.length;i){var optionthis.options[i];if(!isEmpty(option.name)){if(isEmpty(option.image)){console.log(请上传第(i1)个投票选项图片)uni.showToast({icon:error,title:请上传第(i1)个投票选项图片})return;}}} 后端
voteItemImagesFilePath: D://uniapp/voteItemImgs/
Value(${voteItemImagesFilePath})
private String voteItemImagesFilePath;
/*** 上传投票选项图片* param voteItemImage* return* throws Exception*/
RequestMapping(/uploadVoteItemImage)
public MapString,Object uploadVoteItemImage(MultipartFile voteItemImage)throws Exception{System.out.println(filename:voteItemImage.getName());MapString,Object resultMapnew HashMap();if(!voteItemImage.isEmpty()){// 获取文件名String originalFilename voteItemImage.getOriginalFilename();String suffixNameoriginalFilename.substring(originalFilename.lastIndexOf(.));String newFileName DateUtil.getCurrentDateStr()suffixName;FileUtils.copyInputStreamToFile(voteItemImage.getInputStream(),new File(voteItemImagesFilePathnewFileName));resultMap.put(code,0);resultMap.put(msg,上传成功);resultMap.put(voteItemImageFileName,newFileName);}return resultMap;
}