|
@@ -39,14 +39,15 @@
|
39
|
39
|
<div class="PhotoInfo">
|
40
|
40
|
<span>彩票照片</span>
|
41
|
41
|
<div v-if="!DetailInfo.bettingDetail.betting.isDrawn && DetailInfo.bettingDetail.betting.status - 0 !== 2">
|
42
|
|
- <a class="Add" @click="$refs.VantFile.click()">
|
|
42
|
+ <van-uploader v-model="VantFileList" :after-read="AfterRead" @delete="ImgDelete" />
|
|
43
|
+ <!-- <a class="Add" @click="$refs.VantFile.click()">
|
43
|
44
|
<i class="iconfont iconjia centerLabel"></i>
|
44
|
45
|
</a>
|
45
|
46
|
<van-uploader style="overflow: hidden;position: absolute;top: 0;left: 0;opacity: 0;" ref="VantFile" :after-read="CpFileChange" v-model="CpImgArr" :preview-image="false"></van-uploader>
|
46
|
47
|
<div v-for="(item, index) in CpImgArr" :key="index">
|
47
|
48
|
<img :src="item.content" class="centerLabel contain" alt="" @click="CheckBigImg(item)">
|
48
|
49
|
<a class="iconfont iconguanbi" @click="DeleteCpImg(index)"></a>
|
49
|
|
- </div>
|
|
50
|
+ </div> -->
|
50
|
51
|
<!-- <input type="file" ref="CpFile" @change="CpFileChange" style="display: none" accept="image/*"> -->
|
51
|
52
|
</div>
|
52
|
53
|
<img v-else v-for="(item, index) in (DetailInfo.bettingDetail.betting.lotteryPicture || '').split(',')" :src="item" :key="index" width="100%" style="margin-top: 0.15rem" alt="">
|
|
@@ -83,6 +84,7 @@ export default {
|
83
|
84
|
name: 'index',
|
84
|
85
|
data () {
|
85
|
86
|
return {
|
|
87
|
+ ResImgArr: [],
|
86
|
88
|
VantFileList: [],
|
87
|
89
|
BigImgUrl: null,
|
88
|
90
|
ShowBigImg: false,
|
|
@@ -126,6 +128,18 @@ export default {
|
126
|
128
|
this.DetailInfo = res.data.data
|
127
|
129
|
})
|
128
|
130
|
},
|
|
131
|
+ ImgDelete (file, target) {
|
|
132
|
+ this.ResImgArr.splice(target.index, 1)
|
|
133
|
+ },
|
|
134
|
+ AfterRead (file) {
|
|
135
|
+ file.status = 'uploading'
|
|
136
|
+ file.message = '上传中...'
|
|
137
|
+
|
|
138
|
+ this.UploadBase64Img({ data: { image: file.content } }).then((res) => {
|
|
139
|
+ this.ResImgArr.push(res.data.data)
|
|
140
|
+ file.status = 'done'
|
|
141
|
+ })
|
|
142
|
+ },
|
129
|
143
|
CheckBigImg (item) {
|
130
|
144
|
this.BigImgUrl = item.content
|
131
|
145
|
this.ShowBigImg = true
|
|
@@ -141,7 +155,7 @@ export default {
|
141
|
155
|
})
|
142
|
156
|
},
|
143
|
157
|
ToProcessOrder () { // 出票
|
144
|
|
- if (!this.CpImgArr.length) {
|
|
158
|
+ if (!this.ResImgArr.length) {
|
145
|
159
|
this.Toast('请先上传出票图片')
|
146
|
160
|
return false
|
147
|
161
|
}
|
|
@@ -151,26 +165,15 @@ export default {
|
151
|
165
|
}).then(() => {
|
152
|
166
|
if (this.DataLock) return
|
153
|
167
|
this.DataLock = true
|
154
|
|
- let Arr = []
|
155
|
|
- this.CpImgArr.map((item) => {
|
156
|
|
- this.UploadBase64Img({ data: { image: item.content } }).then((res) => {
|
157
|
|
- Arr.push(res.data.data)
|
158
|
|
- if (Arr.length === this.CpImgArr.length) {
|
159
|
|
- console.log(`开始出票,时间是${Date.now()}`)
|
160
|
|
- this.ProcessOrder({ data: { lotteryPicture: Arr.length ? Arr.join(',') : null, orderId: this.DetailInfo.orderId } }).then((res) => {
|
161
|
|
- this.Toast('出票成功')
|
162
|
|
- console.log(`出票成功,时间是${Date.now()}`)
|
163
|
|
- this.DetailInfo.status = 1
|
164
|
|
- this.DetailInfo.bettingDetail.betting.isDrawn = true
|
165
|
|
- this.DataLock = false
|
166
|
|
- this.$router.go(-1)
|
167
|
|
- }).catch((res) => {
|
168
|
|
- console.log(`出票失败,时间是${Date.now()}`)
|
169
|
|
- this.Toast(res.data.message)
|
170
|
|
- this.DataLock = false
|
171
|
|
- })
|
172
|
|
- }
|
173
|
|
- })
|
|
168
|
+ this.ProcessOrder({ data: { lotteryPicture: this.ResImgArr.length ? this.ResImgArr.join(',') : null, orderId: this.DetailInfo.orderId } }).then((res) => {
|
|
169
|
+ this.Toast('出票成功')
|
|
170
|
+ this.DetailInfo.status = 1
|
|
171
|
+ this.DetailInfo.bettingDetail.betting.isDrawn = true
|
|
172
|
+ this.DataLock = false
|
|
173
|
+ this.$router.go(-1)
|
|
174
|
+ }).catch((res) => {
|
|
175
|
+ this.Toast(res.data.message)
|
|
176
|
+ this.DataLock = false
|
174
|
177
|
})
|
175
|
178
|
})
|
176
|
179
|
},
|