提交 83b90639 authored 作者: 潘鹏's avatar 潘鹏

修复图片排序异常问题,添加移动端网站商品预览

上级 d7d75a08
......@@ -538,7 +538,10 @@
<Card v-show="!showList">
<div class="flot-button">
<i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId"
@click="preview(tbCfStationItem.itemId)" type="primary">预览
@click="preview(tbCfStationItem.itemId,'pc')" type="primary">PC预览
</i-button>
<i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId"
@click="preview(tbCfStationItem.itemId,'m')" type="primary">Mobile预览
</i-button>
<i-button class="fixed-submit" type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button class="fixed-back" type="primary" @click="back()"/>
......
......@@ -98,8 +98,12 @@ let vm = new Vue({
},
methods: {
//预览
preview(e) {
window.open(`https://www.afrieshop.com/product_detail?pid=${e}&from=backstage management system&from_fullPath=${window.location.herf}`, '_blank');
preview(e,to) {
if(to === 'pc'){
window.open(`https://www.afrieshop.com/product_detail?pid=${e}&from=backstage management system&from_fullPath=${window.location.herf}`, '_blank');
}else{
window.open(`https://m.afrieshop.com/#/home/product?id=${e}`, '_blank');
}
},
cancelSelectImg() {
this.prevItem[this.skuListsIndex].skuImg = null;
......@@ -336,7 +340,12 @@ let vm = new Vue({
vm.tbCfStationItem.prevItem = resArr
vm.tbCfStationItem.putaway = this.putaway
this.$set(vm.tbCfStationItem, 'tree', this.attrItem)
let _this = this
let _this = this;
let _temArr = [];
$('#imgWrapper').children().each((item,element)=>{
_temArr.push($(element).attr('data-img-path'))
})
vm.uploadList = _temArr;
vm.tbCfStationItem.itemImg = vm.uploadList.map(res => res).join(';');
vm.tbCfStationItem.itemDesc = encodeURI(UE.getEditor('itemDesc').getContent()); // 富文本取值
vm.tbCfStationItem.itemDesc = vm.tbCfStationItem.itemDesc.replace(/&nbsp;/g, " ");
......@@ -881,13 +890,6 @@ let vm = new Vue({
new Sortable(imgWrapper, {
swapThreshold: 1,
animation: 150,
onEnd(evt){
let _temArr = [];
$('#imgWrapper').children().each((item,element)=>{
_temArr.push($(element).attr('data-img-path'))
})
this.uploadList = _temArr;
}
});
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论