Browse Source

上传

master
linyumoya 6 months ago
parent
commit
1123c48574
2 changed files with 119 additions and 70 deletions
  1. +109
    -32
      pages_order/mine/volunteer.vue
  2. +10
    -38
      pages_order/service/help.vue

+ 109
- 32
pages_order/mine/volunteer.vue View File

@ -7,55 +7,80 @@
<view>志愿者信息</view>
</view>
<view class="volunteer-form-sheet">
<view>
<uv-input placeholder="请输入您的姓名" border="none" fontSize="28rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<view style="background-color: #FCFAF3;">
<uv-text size="28rpx" margin="30rpx 50rpx 30rpx 0rpx" text="姓名" />
</view>
</template>
</uv-input>
<view class="volunteer-form-sheet-cell">
<view>
姓名
</view>
<input v-model="volunteerName" placeholder="请输入您的姓名" />
</view>
<view>
<uv-picker ref="picker" :columns="columns" @confirm="confirm"></uv-picker>
<view class="volunteer-form-sheet-cell">
<view @click="openPicker">
证件类型
</view>
<uv-cell :border="false" title="选择证件类型" :isLink="true" arrow-direction="right"
@click="openPicker" />
</view>
</view>
<view>
<uv-input placeholder="请输入证件号码" border="none" fontSize="28rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<view style="background-color: #FCFAF3;">
<uv-text size="28rpx" margin="30rpx 30rpx 30rpx 0rpx" text="证件号码" />
</view>
</template>
</uv-input>
<view class="volunteer-form-sheet-cell">
<view>
证件号码
</view>
<input placeholder="请输入证件号码" v-model="volunteerCerNo" />
</view>
<view>
<uv-input placeholder="请输入手机号码" border="none" fontSize="28rpx"
<view class="volunteer-form-sheet-cell">
<view>
手机号码
</view>
<uv-input placeholder="请输入手机号码" fontSize="24rpx" border="none"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<view style="background-color: #FCFAF3;">
<uv-text size="28rpx" margin="30rpx 50rpx 30rpx 0rpx" text="手机号码" />
<template #suffix>
<view>
<text class="yzm">获取验证码</text>
</view>
</template>
</uv-input>
</view>
<view class="volunteer-form-sheet-cell">
<view>
验证码
</view>
<input placeholder="请输入验证码" />
</view>
</view>
<view class="submit">
<view>
<uv-input placeholder="请输入验证码" border="none" fontSize="28rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<view style="background-color: #FCFAF3;">
<uv-text size="28rpx" margin="30rpx 50rpx 30rpx 0rpx" text="姓名" />
</view>
</template>
</uv-input>
提交
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
columns: [
['中国', '美国', '日本']
],
volunteerCerNo: "",
volunteerName: "",
volunteerPhone: ""
}
},
methods: {
openPicker() {
this.$refs.picker.open();
},
confirm(e) {
console.log('confirm', e);
}
}
}
</script>
<style scoped lang="scss">
@ -65,6 +90,7 @@
margin-top: 40rpx;
margin-left: 3%;
.volunteer-form-title {
color: #333;
font-size: 36rpx;
@ -78,6 +104,57 @@
height: 500rpx;
flex-direction: column;
justify-content: space-around;
.volunteer-form-sheet-cell {
display: flex;
font-size: 28rpx;
align-items: center;
.yzm {
display: inline-block;
font-size: 22rpx;
padding: 6rpx;
border-radius: 20rpx;
background-color: #ff0829;
color: #fff;
}
/deep/ .uv-cell__title-text {
font-size: 24rpx;
}
/deep/ .uv-cell__body {
padding: 0;
}
/deep/ .uv-cell {
flex: 1;
}
view {
width: 140rpx;
padding: 20rpx 0;
}
input {
flex: 1;
height: 100%;
color: rgb(192, 196, 204);
background-color: #fff;
font-size: 24rpx;
}
}
}
.submit{
position: fixed;
bottom: 5%;
background-color: #b12026;
color: #fff;
width: 94%;
padding: 20rpx 0;
text-align: center;
border-radius: 40rpx;
}
}
}

+ 10
- 38
pages_order/service/help.vue View File

@ -66,49 +66,21 @@
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
deletePic(e) {
this.fileList.splice(e.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url=>{
self.fileList.pust({
url
})
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://127.0.0.1/upload', //
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)
}, 1000)
}
});
})
}
}
}
</script>


Loading…
Cancel
Save