|
@@ -6,7 +6,19 @@
|
|
<view class="padding-lr-sm text-sm text-gray margin-top-sm margin-bottom-sm">
|
|
<view class="padding-lr-sm text-sm text-gray margin-top-sm margin-bottom-sm">
|
|
办理家医计划业务需上传被保人清晰证件照片(身份证正反面,护照,户口簿选择其中一种即可)
|
|
办理家医计划业务需上传被保人清晰证件照片(身份证正反面,护照,户口簿选择其中一种即可)
|
|
</view>
|
|
</view>
|
|
- <u-upload ref="uUpload" :action="action" max-count="2"></u-upload>
|
|
|
|
|
|
+ <view class="cu-form-group">
|
|
|
|
+ <view class="grid col-4 grid-square flex-sub">
|
|
|
|
+ <view class="bg-img" v-for="(item,index) in imgListpoint" :key="index" :data-url="imgListpoint[index]">
|
|
|
|
+ <image :src="imgListpoint[index].url" mode='aspectFill'></image>
|
|
|
|
+ <view class="cu-tag bg-red" @click="DelImg" :data-index="index">
|
|
|
|
+ <text class="cuIcon-close"></text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="solids" @click="ChooseImage" v-if="imgListpoint.length<2">
|
|
|
|
+ <text class="cuIcon-cameraadd"></text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
<view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
|
|
<view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
|
|
<view class="submit" style="background-color: #0B73B9;color: white;" @click="upcard">
|
|
<view class="submit" style="background-color: #0B73B9;color: white;" @click="upcard">
|
|
提交审核
|
|
提交审核
|
|
@@ -18,8 +30,12 @@
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
- if (options.id) {
|
|
|
|
|
|
+ if (options.id != undefined) {
|
|
this.archivesId = options.id
|
|
this.archivesId = options.id
|
|
|
|
+ if (JSON.parse(options.data)[0].url != "" && JSON.parse(options.data)[1].url != "") {
|
|
|
|
+ this.imgListpoint = JSON.parse(options.data)
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
@@ -27,28 +43,53 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- action: "https://t5.9026.com/api/v1/common/uploadFile",
|
|
|
|
- filesArr: [],
|
|
|
|
- archivesId: ""
|
|
|
|
|
|
+ archivesId: "",
|
|
|
|
+ imgListpoint: [],
|
|
|
|
+ imgList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- upcard: async function() {
|
|
|
|
- let files = [];
|
|
|
|
- // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
|
|
|
|
- files = this.$refs.uUpload.lists.filter(val => {
|
|
|
|
- return val.progress == 100;
|
|
|
|
- })
|
|
|
|
- files = files.map(item => {
|
|
|
|
- return item.response.data.url
|
|
|
|
|
|
+ ChooseImage() {
|
|
|
|
+ uni.chooseImage({
|
|
|
|
+ count: 2, //默认9
|
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
+ sourceType: ['album', 'camera'], //从相册选择
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (this.imgList.length != 0) {
|
|
|
|
+ this.imgList = this.imgList.concat(res.tempFilePaths)
|
|
|
|
+ this.$request.upload("/api/v1/common/uploadFile", this.imgList[this.imgList.length - 1], {}).then(data => {
|
|
|
|
+ this.imgListpoint.push(JSON.parse(data).data)
|
|
|
|
+ console.log(this.imgListpoint)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.imgList = res.tempFilePaths
|
|
|
|
+ this.$request.upload("/api/v1/common/uploadFile", this.imgList[0], {}).then(data => {
|
|
|
|
+ this.imgListpoint.push(JSON.parse(data).data)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ DelImg(e) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定要删除吗?',
|
|
|
|
+ cancelText: '再想想',
|
|
|
|
+ confirmText: '删除',
|
|
|
|
+ success: res => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.imgListpoint.splice(e.currentTarget.dataset.index, 1);
|
|
|
|
+ this.imgListpoint = this.imgListpoint
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- // 如果您不需要进行太多的处理,直接如下即可
|
|
|
|
- // files = this.$refs.uUpload.lists;
|
|
|
|
- if (files.length != 0) {
|
|
|
|
|
|
+ },
|
|
|
|
+ upcard: async function() {
|
|
|
|
+ if (this.imgListpoint.length != 0) {
|
|
let res = await this.$request.post("/api/v1/patient/submitCardImg", {
|
|
let res = await this.$request.post("/api/v1/patient/submitCardImg", {
|
|
id: this.archivesId,
|
|
id: this.archivesId,
|
|
- card_img_url: files[0],
|
|
|
|
- card_back_img_url:files[1]
|
|
|
|
|
|
+ card_img_url: this.imgListpoint[0].url,
|
|
|
|
+ card_back_img_url: this.imgListpoint[1].url
|
|
})
|
|
})
|
|
if (res.status == 0) {
|
|
if (res.status == 0) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -68,6 +109,9 @@
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
- .main {}
|
|
|
|
|
|
+<style lang="scss">
|
|
|
|
+ page {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|