tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷
This commit is contained in:
@@ -68,6 +68,17 @@
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="other-info">
|
||||
<view class="other-info-box" v-for="(i, t) in imgList" :key="t">
|
||||
<image :src="$util.img(i)" mode="aspectFill" @click="preview(i)"></image>
|
||||
<view class="imgDel" @click="deleteImg(i, t)"><text class=" icon iconfont icon-delete"></text></view>
|
||||
</view>
|
||||
<view class="other-info-box active" @click="addImg()" v-if="imgList.length < 5 || imgList.length == undefined">
|
||||
<text class="icon iconfont icon-zhaoxiangji"></text>
|
||||
<text>{{ imgList.length ? 5 - imgList.length : 0 }}/5</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
|
||||
@@ -116,6 +127,7 @@ export default {
|
||||
refund_type: '',
|
||||
refund_reason: '',
|
||||
refund_remark: '',
|
||||
imgList: [],
|
||||
isIphoneX: false,
|
||||
refund_data: {
|
||||
refund_type: [],
|
||||
@@ -139,6 +151,32 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//添加图片
|
||||
addImg(e) {
|
||||
let size = this.imgList.length ? this.imgList.length : 0
|
||||
this.$util.upload(5 - size, {
|
||||
path: 'refundimg'
|
||||
}, res => {
|
||||
let arr = this.imgList
|
||||
arr = arr.concat(res);
|
||||
this.imgList = arr;
|
||||
});
|
||||
},
|
||||
//删除图片
|
||||
deleteImg(i, j) {
|
||||
this.imgList.splice(j, 1);
|
||||
},
|
||||
// 图片预览
|
||||
preview(i) {
|
||||
let urls = this.imgList;
|
||||
for (let k = 0; k < urls.length; k++) {
|
||||
urls[k] = this.$util.img(urls[k])
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: i
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 显示弹出层
|
||||
* @param {Object} ref
|
||||
@@ -201,7 +239,8 @@ export default {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
refund_remark: this.refund_remark,
|
||||
refund_images: this.imgList.toString()
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
@@ -225,7 +264,8 @@ export default {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
refund_remark: this.refund_remark,
|
||||
refund_images: this.imgList.toString()
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
@@ -259,30 +299,7 @@ export default {
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: (res) => {
|
||||
console.log('fail', res)
|
||||
},
|
||||
complete: ()=> {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
this.$util.subscribeMessage('ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE', callback);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user