国际研讨会照片 ppt的上传
This commit is contained in:
@@ -43,3 +43,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export{
|
||||||
|
baseUrl,
|
||||||
|
URL_CONFIG
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
// components/imageUpload/imageUpload.js
|
// components/imageUpload/imageUpload.js
|
||||||
|
|
||||||
|
import {
|
||||||
|
baseUrl,
|
||||||
|
URL_CONFIG
|
||||||
|
} from "../../assets/js/http/api"
|
||||||
Component({
|
Component({
|
||||||
/**
|
/**
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
@@ -34,6 +39,8 @@ Component({
|
|||||||
let maxSize = this.data.maxSize * 1024 * 1024
|
let maxSize = this.data.maxSize * 1024 * 1024
|
||||||
let flag = true
|
let flag = true
|
||||||
let maxLength = this.data.maxLength
|
let maxLength = this.data.maxLength
|
||||||
|
// 将图片的id抛出
|
||||||
|
let imgids = []
|
||||||
console.log("maxLength", maxLength);
|
console.log("maxLength", maxLength);
|
||||||
wx.chooseImage({
|
wx.chooseImage({
|
||||||
count: maxLength, // 默认9
|
count: maxLength, // 默认9
|
||||||
@@ -63,7 +70,7 @@ Component({
|
|||||||
flag = false
|
flag = false
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '错误提示',
|
title: '错误提示',
|
||||||
content: `图片大于${that.data.maxSize}M`,
|
content: `图片大于${that.data.maxSize}MB`,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
@@ -84,37 +91,40 @@ Component({
|
|||||||
/**
|
/**
|
||||||
* 上传完成后把文件上传到服务器
|
* 上传完成后把文件上传到服务器
|
||||||
*/
|
*/
|
||||||
// if (flag) {
|
|
||||||
// let count = 0;
|
if (flag) {
|
||||||
// for (let i = 0; i < tempFilePaths.length; i++) {
|
let count = 0;
|
||||||
// //上传文件
|
for (let i = 0; i < tempFilePaths.length; i++) {
|
||||||
// wx.uploadFile({
|
//上传文件
|
||||||
// url: 'imgUploadUrl',
|
wx.uploadFile({
|
||||||
// filePath: tempFilePaths[i],
|
url: baseUrl + URL_CONFIG + 'sys/common/upload',
|
||||||
// name: 'uploadfile_ant',
|
filePath: tempFilePaths[i],
|
||||||
// header: {
|
name: "file",
|
||||||
// "Content-Type": "multipart/form-data"
|
formData: {
|
||||||
// },
|
filetype: "image",
|
||||||
// success: function (res) {
|
},
|
||||||
// console.log("上传图片", res);
|
success: function (res) {
|
||||||
// count++;
|
imgids.push(JSON.parse(res.data).result.id)
|
||||||
// //如果是最后一张,则隐藏等待中
|
count++;
|
||||||
// if (count == tempFilePaths.length) {
|
//如果是最后一张,则隐藏等待中
|
||||||
// wx.hideToast();
|
if (count == tempFilePaths.length) {
|
||||||
// }
|
wx.hideToast();
|
||||||
// },
|
that.triggerEvent("getIds",imgids)
|
||||||
// fail: function (res) {
|
}
|
||||||
// wx.hideToast();
|
|
||||||
// wx.showModal({
|
},
|
||||||
// title: '错误提示',
|
fail: function (res) {
|
||||||
// content: '上传图片失败',
|
wx.hideToast();
|
||||||
// showCancel: false,
|
wx.showModal({
|
||||||
// success: function (res) {}
|
title: '错误提示',
|
||||||
// })
|
content: '上传图片失败',
|
||||||
// }
|
showCancel: false,
|
||||||
// });
|
success: function (res) {}
|
||||||
// }
|
})
|
||||||
// }
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fail(err) {
|
fail(err) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// pages/signUpPageGuoji/signUpPageGuoji.js
|
// pages/signUpPageGuoji/signUpPageGuoji.js
|
||||||
import MeetingApi from "../../assets/js/http/meetingApi"
|
import MeetingApi from "../../assets/js/http/meetingApi"
|
||||||
import signUpApi from "../../assets/js/http/signUp"
|
import signUpApi from "../../assets/js/http/signUp"
|
||||||
|
import {baseUrl,URL_CONFIG} from '../../assets/js/http/api'
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,6 +56,12 @@ Page({
|
|||||||
departureTime: '请选择离开时间',
|
departureTime: '请选择离开时间',
|
||||||
// 是否选择发票的选中的索引
|
// 是否选择发票的选中的索引
|
||||||
index: -1,
|
index: -1,
|
||||||
|
// 上传图片的id
|
||||||
|
imageIds:'',
|
||||||
|
// 记录临时的文件名 用于回显 小程序上传后后端的名会乱码
|
||||||
|
tempFiles:'点击上传',
|
||||||
|
// ppt Id
|
||||||
|
speechPpt:'',
|
||||||
// 嘉宾身份
|
// 嘉宾身份
|
||||||
guestType: -1,
|
guestType: -1,
|
||||||
// 缴费方式
|
// 缴费方式
|
||||||
@@ -241,7 +248,59 @@ Page({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取图片的id
|
||||||
|
getImagesId(e) {
|
||||||
|
this.setData({
|
||||||
|
imageIds:e.detail.join(',')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// ppt的上传
|
||||||
|
uploadPPT(){
|
||||||
|
const that = this
|
||||||
|
wx.chooseMessageFile({
|
||||||
|
count: 1, //能选择文件的数量
|
||||||
|
type: 'file', //能选择文件的类型,我这里只允许上传文件.还有视频,图片,或者都可以
|
||||||
|
success(res) {
|
||||||
|
console.log(res);
|
||||||
|
var size = res.tempFiles[0].size;
|
||||||
|
var name = res.tempFiles[0].name;
|
||||||
|
var temporaryPdfArr = [];
|
||||||
|
temporaryPdfArr.push(res.tempFiles[0]);
|
||||||
|
var filePath = res.tempFiles[0].path;
|
||||||
|
if (size > 10485760 ) { //限制了文件的大小和具体文件类型
|
||||||
|
wx.showToast({
|
||||||
|
title: '文件大小不能超过10MB',
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '上传中...',
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
// 如果多个文件 要循环上传
|
||||||
|
wx.uploadFile({
|
||||||
|
url: baseUrl + URL_CONFIG + 'sys/common/upload', //上传的路径
|
||||||
|
filePath: filePath, //刚刚在data保存的文件路径
|
||||||
|
name: 'file', //后台获取的凭据
|
||||||
|
success(res) {
|
||||||
|
var fileBackDa = JSON.parse(res.data);
|
||||||
|
console.log(fileBackDa);
|
||||||
|
var backPdfArr = [];
|
||||||
|
backPdfArr.push(fileBackDa)
|
||||||
|
wx.hideLoading(); //隐藏提示框
|
||||||
|
//上传成功,
|
||||||
|
that.setData({
|
||||||
|
tempFiles:name,
|
||||||
|
speechPpt:fileBackDa.result.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 返回一一个邀请码的数组用于校验输入的邀请码显示不同的字段 1VIP 2演讲嘉宾 3特邀嘉宾 4 合作伙伴
|
// 返回一一个邀请码的数组用于校验输入的邀请码显示不同的字段 1VIP 2演讲嘉宾 3特邀嘉宾 4 合作伙伴
|
||||||
validateCodeArr(obj) {
|
validateCodeArr(obj) {
|
||||||
let {
|
let {
|
||||||
@@ -284,7 +343,7 @@ Page({
|
|||||||
},
|
},
|
||||||
// 确定
|
// 确定
|
||||||
formSubmit(e) {
|
formSubmit(e) {
|
||||||
|
console.log(e);
|
||||||
const formData = Object.assign({}, e.detail.value)
|
const formData = Object.assign({}, e.detail.value)
|
||||||
// 会议id
|
// 会议id
|
||||||
formData.meetingId = '1449638073563172866'
|
formData.meetingId = '1449638073563172866'
|
||||||
@@ -296,6 +355,10 @@ Page({
|
|||||||
formData.companyId = this.data.selectedCompany.id
|
formData.companyId = this.data.selectedCompany.id
|
||||||
// 嘉宾身份类型
|
// 嘉宾身份类型
|
||||||
formData.guestType = this.data.guestType
|
formData.guestType = this.data.guestType
|
||||||
|
// 国际研讨会嘉宾上传的照片id
|
||||||
|
formData.photo = this.data.imageIds
|
||||||
|
// 国际研讨会嘉宾上传的ppt
|
||||||
|
formData.speechPpt = this.data.speechPpt
|
||||||
// 会议类型
|
// 会议类型
|
||||||
// formData.meetingType = this.data.selectedMeeting.meetingType
|
// formData.meetingType = this.data.selectedMeeting.meetingType
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {
|
||||||
|
"image-upload":"../../components/imageUpload/imageUpload"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,14 +5,15 @@
|
|||||||
<!-- 如果是小程序消息进入的报名页面 需要回显企业与参会人 参会企业不可更改 -->
|
<!-- 如果是小程序消息进入的报名页面 需要回显企业与参会人 参会企业不可更改 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1">参会单位:</text>
|
<text class="item-label flex-1">参会单位:</text>
|
||||||
<input placeholder-class="text-right" data-page='guoji' bindtap="selectCompany" name="selectedCompany.companyName"
|
<input placeholder-class="text-right" data-page='guoji' bindtap="selectCompany"
|
||||||
bindinput="bindInputPhone" value="{{selectedCompany.companyName}}" placeholder="请选择参会单位" />
|
name="selectedCompany.companyName" bindinput="bindInputPhone" value="{{selectedCompany.companyName}}"
|
||||||
|
placeholder="请选择参会单位" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1">参会人:</text>
|
<text class="item-label flex-1">参会人:</text>
|
||||||
<input placeholder-class="text-right" data-page='guoji' bindtap="selectPerson" data-selectType='1' bindinput="bindInputPhone"
|
<input placeholder-class="text-right" data-page='guoji' bindtap="selectPerson" data-selectType='1'
|
||||||
value="{{selectedPerson.name}}" placeholder="请选择参会人" />
|
bindinput="bindInputPhone" value="{{selectedPerson.name}}" placeholder="请选择参会人" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
@@ -73,8 +74,8 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">邮寄联系人:</text>
|
<text class="item-label flex-1 validate">邮寄联系人:</text>
|
||||||
<input placeholder-class="text-right" data-page='guoji' data-selectType='2' name="phone" bindtap="selectPerson"
|
<input placeholder-class="text-right" data-page='guoji' data-selectType='2' name="phone"
|
||||||
value="{{selectedPostPerson.name}}" placeholder="请选择邮寄联系人" />
|
bindtap="selectPerson" value="{{selectedPostPerson.name}}" placeholder="请选择邮寄联系人" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
@@ -139,17 +140,15 @@
|
|||||||
<input placeholder-class="text-right" name="speechTopic" placeholder="请输入演讲题目" />
|
<input placeholder-class="text-right" name="speechTopic" placeholder="请输入演讲题目" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item-radio">
|
||||||
<text class="item-label flex-1 validate">演讲PPT:</text>
|
<text class="item-label flex-1 validate">演讲PPT:</text>
|
||||||
<input placeholder-class="text-right" name="postContactAddress" bindinput="bindInputPhone"
|
<view style="margin-top:20rpx" bindtap="uploadPPT">{{tempFiles}} </view>
|
||||||
placeholder="请上传文件" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item-radio">
|
||||||
<text class="item-label flex-1 validate">照片:</text>
|
<text class="item-label flex-1 validate">照片:</text>
|
||||||
<input placeholder-class="text-right" name="postContactAddress" bindinput="bindInputPhone"
|
<image-upload style="margin-top:20rpx" bindgetIds='getImagesId' maxLength='1'></image-upload>
|
||||||
placeholder="请上传" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -218,8 +217,7 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">房型:</text>
|
<text class="item-label flex-1 validate">房型:</text>
|
||||||
<input placeholder-class="text-right" name="roomLayout" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="roomLayout" bindinput="bindInputPhone" placeholder="请输入房型" />
|
||||||
placeholder="请输入房型" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item-radio">
|
<view class="form-item-radio">
|
||||||
@@ -246,14 +244,12 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">到达站:</text>
|
<text class="item-label flex-1 validate">到达站:</text>
|
||||||
<input placeholder-class="text-right" name="destination" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="destination" bindinput="bindInputPhone" placeholder="请输入到达站" />
|
||||||
placeholder="请输入到达站" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">到达班次:</text>
|
<text class="item-label flex-1 validate">到达班次:</text>
|
||||||
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone" placeholder="请输入到达班次" />
|
||||||
placeholder="请输入到达班次" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -293,8 +289,7 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1">同行人:</text>
|
<text class="item-label flex-1">同行人:</text>
|
||||||
<input placeholder-class="text-right" name="peer" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="peer" bindinput="bindInputPhone" placeholder="请输入同行人" />
|
||||||
placeholder="请输入同行人" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item-radio">
|
<view class="form-item-radio">
|
||||||
@@ -316,17 +311,17 @@
|
|||||||
<input placeholder-class="text-right" name="speechTopic" placeholder="请输入演讲题目" />
|
<input placeholder-class="text-right" name="speechTopic" placeholder="请输入演讲题目" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item-radio">
|
||||||
<text class="item-label flex-1 validate">演讲PPT:</text>
|
<text class="item-label flex-1 validate">演讲PPT:</text>
|
||||||
<input placeholder-class="text-right" name="postContactAddress"
|
<view style="margin-top:20rpx" bindtap="uploadPPT">{{tempFiles}} </view>
|
||||||
placeholder="请上传文件" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item-radio">
|
||||||
<text class="item-label flex-1 validate">照片:</text>
|
<text class="item-label flex-1 validate">照片:</text>
|
||||||
<input placeholder-class="text-right" name="postContactAddress" bindinput="bindInputPhone"
|
<!-- <input placeholder-class="text-right" name="postContactAddress" bindinput="bindInputPhone"
|
||||||
placeholder="请上传" />
|
placeholder="请上传" /> -->
|
||||||
|
<image-upload style="margin-top:20rpx" bindgetIds='getImagesId' maxLength='1'></image-upload>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -390,8 +385,7 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">到达班次:</text>
|
<text class="item-label flex-1 validate">到达班次:</text>
|
||||||
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone" placeholder="请输入到达班次" />
|
||||||
placeholder="请输入到达班次" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -495,14 +489,12 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">到达站:</text>
|
<text class="item-label flex-1 validate">到达站:</text>
|
||||||
<input placeholder-class="text-right" name="destination" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="destination" bindinput="bindInputPhone" placeholder="请输入到达站" />
|
||||||
placeholder="请输入到达站" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label flex-1 validate">到达班次:</text>
|
<text class="item-label flex-1 validate">到达班次:</text>
|
||||||
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone"
|
<input placeholder-class="text-right" name="arrivalShift" bindinput="bindInputPhone" placeholder="请输入到达班次" />
|
||||||
placeholder="请输入到达班次" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user