|
|
@@ -150,7 +150,7 @@
|
|
|
<view class="tips">
|
|
|
支持jpg,png格式,最多上传5张,每张图片大小不得超过5M。
|
|
|
</view>
|
|
|
- <view class="grid col-4 grid-square flex-sub booder-top">
|
|
|
+ <!-- <view class="grid col-4 grid-square flex-sub booder-top">
|
|
|
<view class="bg-img" v-for="(item, index) in headPhotoImg" :key="index" @tap="ViewImage"
|
|
|
:data-url="headPhotoImg[index]">
|
|
|
<image :src="headPhotoImg[index]" mode="aspectFill"></image>
|
|
|
@@ -163,7 +163,9 @@
|
|
|
mode="aspectFill"></image>
|
|
|
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+ <u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
|
|
|
+ @on-remove="detailsRemove" max-count="5" width="140rpx" height="140rpx"></u-upload>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
@@ -191,6 +193,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ action: configService.apiUrl + '/sys/common/upload', //图片上传地址
|
|
|
+ xqImage: [], //详情图回显
|
|
|
voucherWayInfo1:'',
|
|
|
voucherWayInfo2:'',
|
|
|
headPhotoImg: [],
|
|
|
@@ -224,6 +228,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //上传详情图
|
|
|
+ detailsSuccess(res, index, lists) {
|
|
|
+ this.xqImage = lists
|
|
|
+
|
|
|
+ },
|
|
|
+ detailsRemove(index, lists) {
|
|
|
+ this.xqImage = lists
|
|
|
+ },
|
|
|
groupChange(e){
|
|
|
// e=='1'?this.voucherWayInfo2='':this.voucherWayInfo1=''
|
|
|
this.form.voucherWay=e=='1'?'1':'2'
|
|
|
@@ -415,12 +427,20 @@ export default {
|
|
|
});
|
|
|
return
|
|
|
} else {
|
|
|
+ let temp = []
|
|
|
+ console.log(this.xqImage)
|
|
|
+ if ( this.xqImage.length > 0) {
|
|
|
+ this.xqImage.forEach((item => {
|
|
|
+ temp.push( configService.apiUrl +'/'+item.response.message)
|
|
|
+ }))
|
|
|
+ }
|
|
|
|
|
|
let data={
|
|
|
voucherWayInfo:this.form.voucherWay=='1'?this.voucherWayInfo1:this.voucherWayInfo2,
|
|
|
conditions : this.form.conditionsUse == '2' ? this.form.conditions : '0',
|
|
|
voucherRangeInfo : this.form.voucherRangeInfo.length > 0 ? this.form.voucherRangeInfo.join(',') : null,
|
|
|
- voucherPhoto : this.form.voucherPhoto.length > 0 ? this.form.voucherPhoto.join(',') : null
|
|
|
+ // voucherPhoto : this.form.voucherPhoto.length > 0 ? this.form.voucherPhoto.join(',') : null
|
|
|
+ voucherPhoto:temp.length > 0 ? temp.join(',') : null
|
|
|
}
|
|
|
if (this.productId == '') {
|
|
|
this.$http.post("/merchant/localVoucherInfo/add", { ...this.form,...data, merchantId: uni.getStorageSync(USER_INFO).merchantId }).then(res => {
|
|
|
@@ -459,7 +479,16 @@ export default {
|
|
|
this.$http.get("/merchant/localVoucherInfo/queryById?id="+this.productId ).then(res => {
|
|
|
if(res.data.success){
|
|
|
res.data.result.voucherRangeInfo=res.data.result.voucherRangeInfo?res.data.result.voucherRangeInfo.split(',').filter(id => id ):[]
|
|
|
- res.data.result.voucherPhoto=res.data.result.voucherPhoto!==null && res.data.result.voucherPhoto.length>0?res.data.result.voucherPhoto.split(',').filter(id => id ):[]
|
|
|
+ // res.data.result.voucherPhoto=res.data.result.voucherPhoto!==null && res.data.result.voucherPhoto.length>0?res.data.result.voucherPhoto.split(',').filter(id => id ):[]
|
|
|
+ if(res.data.result.voucherPhoto){
|
|
|
+ let xqtemp = []
|
|
|
+ xqtemp = res.data.result.voucherPhoto.split(',')
|
|
|
+ xqtemp.map(item => {
|
|
|
+ this.xqImage.push({
|
|
|
+ url: item
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
res.data.result.conditionsUse = res.data.result.conditions == '0' ? '1' : '2'
|
|
|
res.data.result.voucherWay = res.data.result.voucherWay? res.data.result.voucherWay+'':''
|
|
|
this.voucherWayInfo1=res.data.result.voucherWay=='1'?res.data.result.voucherWayInfo:''
|