|
@@ -336,7 +336,7 @@
|
|
<editor
|
|
<editor
|
|
id="editor"
|
|
id="editor"
|
|
class="ql-container"
|
|
class="ql-container"
|
|
- :placeholder="placeholder"
|
|
|
|
|
|
+ :placeholder="placeholderContent"
|
|
@input="saveTxt"
|
|
@input="saveTxt"
|
|
@ready="onEditorReady"
|
|
@ready="onEditorReady"
|
|
></editor>
|
|
></editor>
|
|
@@ -360,6 +360,8 @@ let _self;
|
|
import Header from '../components/header.vue';
|
|
import Header from '../components/header.vue';
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
import moment from '@/common/moment';
|
|
import moment from '@/common/moment';
|
|
|
|
+import indexConfig from '@/config/index.config';
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
Header,
|
|
Header,
|
|
@@ -372,7 +374,7 @@ export default {
|
|
title: '商品详情',
|
|
title: '商品详情',
|
|
showoperat: false,
|
|
showoperat: false,
|
|
|
|
|
|
- placeholder: '请输入内容...',
|
|
|
|
|
|
+ placeholderContent: '请输入内容...',
|
|
mastKnow: '',
|
|
mastKnow: '',
|
|
|
|
|
|
storeList: [{ name: '所属店铺', id: '', type: '' }],
|
|
storeList: [{ name: '所属店铺', id: '', type: '' }],
|
|
@@ -404,6 +406,7 @@ export default {
|
|
progress: 0,
|
|
progress: 0,
|
|
iconurl: '',
|
|
iconurl: '',
|
|
pickList: [],
|
|
pickList: [],
|
|
|
|
+
|
|
Icon: '',
|
|
Icon: '',
|
|
Imglist: [],
|
|
Imglist: [],
|
|
|
|
|
|
@@ -486,7 +489,6 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
onLoad ( option ) {
|
|
onLoad ( option ) {
|
|
-
|
|
|
|
if (option.id != 'undefined') {
|
|
if (option.id != 'undefined') {
|
|
this.SHOPID = option.id
|
|
this.SHOPID = option.id
|
|
this.getShopBuyId(option.id).then(() => {
|
|
this.getShopBuyId(option.id).then(() => {
|
|
@@ -494,7 +496,7 @@ export default {
|
|
this.getShopName(this.typeId, this.storeId);
|
|
this.getShopName(this.typeId, this.storeId);
|
|
});
|
|
});
|
|
|
|
|
|
- // 判断返回的是否是自营商品
|
|
|
|
|
|
+ // 数据回显
|
|
this.price = this.shopData.salePrice / 100;
|
|
this.price = this.shopData.salePrice / 100;
|
|
this.rateprice = this.shopData.price / 100;
|
|
this.rateprice = this.shopData.price / 100;
|
|
|
|
|
|
@@ -504,8 +506,21 @@ export default {
|
|
: '请选择商品过期日期';
|
|
: '请选择商品过期日期';
|
|
}
|
|
}
|
|
|
|
|
|
- let rule = JSON.parse(this.shopData.saleRuleJson);
|
|
|
|
|
|
+ // 图标回显
|
|
|
|
+ if (this.shopData.icon) {
|
|
|
|
+ this.Icon = this.shopData.icon
|
|
|
|
+ this.iconurl = this.shopData.icon;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // 图册回显
|
|
|
|
+ if (this.shopData.imges) {
|
|
|
|
+ this.Imglist = JSON.parse(this.shopData.imges)
|
|
|
|
+ let urllist = JSON.parse(this.shopData.imges)
|
|
|
|
+ urllist.forEach(element => {
|
|
|
|
+ this.pickList.push(element.url)
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ let rule = JSON.parse(this.shopData.saleRuleJson);
|
|
if (rule) {
|
|
if (rule) {
|
|
this.astrictDate.data.saleDay = rule.data.saleDay
|
|
this.astrictDate.data.saleDay = rule.data.saleDay
|
|
? rule.data.saleDay
|
|
? rule.data.saleDay
|
|
@@ -551,26 +566,21 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.showoperat = false;
|
|
this.showoperat = false;
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 图标回显
|
|
|
|
- if (this.shopData.icon) {
|
|
|
|
- this.iconurl = this.shopData.icon;
|
|
|
|
- } else {
|
|
|
|
- this.iconurl = '';
|
|
|
|
- }
|
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.getShopList()
|
|
this.getShopList()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // onPageScroll (option) {
|
|
|
|
+ // console.log(option);
|
|
|
|
+ // },
|
|
methods: {
|
|
methods: {
|
|
// 获取单个商品信息
|
|
// 获取单个商品信息
|
|
async getShopBuyId (id) {
|
|
async getShopBuyId (id) {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
await this.$http.get('/goods/getById/' + id).then((res) => {
|
|
await this.$http.get('/goods/getById/' + id).then((res) => {
|
|
if (res.code === 200 && res.msg === 'OK') {
|
|
if (res.code === 200 && res.msg === 'OK') {
|
|
- console.log(res);
|
|
|
|
this.shopData = res.data;
|
|
this.shopData = res.data;
|
|
this.storeId = res.data.shopId;
|
|
this.storeId = res.data.shopId;
|
|
this.typeId = res.data.typeId;
|
|
this.typeId = res.data.typeId;
|
|
@@ -597,7 +607,6 @@ export default {
|
|
},
|
|
},
|
|
// 库存模式
|
|
// 库存模式
|
|
shopNumChange (e) {
|
|
shopNumChange (e) {
|
|
- console.log(e);
|
|
|
|
for (let i = 0; i < this.shopNumList.length; i++) {
|
|
for (let i = 0; i < this.shopNumList.length; i++) {
|
|
if (this.shopNumList[i].id === e.target.value) {
|
|
if (this.shopNumList[i].id === e.target.value) {
|
|
this.shopNumIndex = i;
|
|
this.shopNumIndex = i;
|
|
@@ -642,6 +651,7 @@ export default {
|
|
},
|
|
},
|
|
// 初始化编辑器
|
|
// 初始化编辑器
|
|
onEditorReady () {
|
|
onEditorReady () {
|
|
|
|
+ // this.placeholderContent = this.shopData.describ
|
|
uni
|
|
uni
|
|
.createSelectorQuery()
|
|
.createSelectorQuery()
|
|
.select('#editor')
|
|
.select('#editor')
|
|
@@ -651,6 +661,7 @@ export default {
|
|
html: this.shopData.describ, //this.EditGoodsDetail.content为赋值内容。
|
|
html: this.shopData.describ, //this.EditGoodsDetail.content为赋值内容。
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
+ .exec(-1000)
|
|
},
|
|
},
|
|
// -----------------------------------------------------------------
|
|
// -----------------------------------------------------------------
|
|
// 跳转到管理分类页面
|
|
// 跳转到管理分类页面
|
|
@@ -856,7 +867,7 @@ export default {
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
myCloud.uploadFile({
|
|
myCloud.uploadFile({
|
|
- url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
|
|
|
|
|
|
+ url: indexConfig.uploadUrl,
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
cloudPath: _self.iconurl, // 要上传的文件对象
|
|
cloudPath: _self.iconurl, // 要上传的文件对象
|
|
name: 'file',
|
|
name: 'file',
|
|
@@ -890,31 +901,27 @@ export default {
|
|
sourceType: ['album'], // camera 使用相机 album 从相册中选
|
|
sourceType: ['album'], // camera 使用相机 album 从相册中选
|
|
success: function (res) {
|
|
success: function (res) {
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
- let img = [];
|
|
|
|
- img.push(res.tempFilePaths);
|
|
|
|
if (_self.pickList.length >= 6) {
|
|
if (_self.pickList.length >= 6) {
|
|
_self.$mHelper.toast('最多只可上传6张图片');
|
|
_self.$mHelper.toast('最多只可上传6张图片');
|
|
} else {
|
|
} else {
|
|
- _self.pickList = _self.pickList.concat(img);
|
|
|
|
-
|
|
|
|
- // for (let i = 0; i < _self.pickList.length; i++) {
|
|
|
|
- // let element = _self.pickList[i];
|
|
|
|
- // myCloud.uploadFile({
|
|
|
|
- // url: 'http://192.168.100.135:83/merch/common/upload/oss',
|
|
|
|
- // filePath: element, // 要上传的文件对象
|
|
|
|
- // cloudPath: element,
|
|
|
|
- // name: 'file',
|
|
|
|
- // onUploadProgress: function (progressEvent) {
|
|
|
|
- // // 上传进度回调
|
|
|
|
- // let percentCompleted = Math.round(
|
|
|
|
- // (progressEvent.loaded * 100) / progressEvent.total
|
|
|
|
- // );
|
|
|
|
- // },
|
|
|
|
- // success: (res) => {
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
|
|
+ _self.pickList = _self.pickList.concat(res.tempFilePaths).slice(0,6);
|
|
|
|
+ _self.Imglist = []
|
|
|
|
+ for (let i = 0; i < _self.pickList.length; i++) {
|
|
|
|
+ let element = _self.pickList[i];
|
|
|
|
+ myCloud.uploadFile({
|
|
|
|
+ url: indexConfig.uploadUrl,
|
|
|
|
+ filePath: element, // 要上传的文件对象
|
|
|
|
+ cloudPath: element,
|
|
|
|
+ name: 'file',
|
|
|
|
+ onUploadProgress: function (progressEvent) {
|
|
|
|
+ // 上传进度回调
|
|
|
|
+ let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
|
|
+ },
|
|
|
|
+ success: (res) => {
|
|
|
|
+ _self.Imglist.push({url:res.fileID,uid:res.filePath})
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -922,6 +929,11 @@ export default {
|
|
// 删除图册中的图片
|
|
// 删除图册中的图片
|
|
deleteThisImg (index) {
|
|
deleteThisImg (index) {
|
|
this.pickList.splice(index, 1);
|
|
this.pickList.splice(index, 1);
|
|
|
|
+ this.Imglist.forEach( (element,i) => {
|
|
|
|
+ if (element.uid === this.pickList[index]) {
|
|
|
|
+ this.Imglist.splice(i,1)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 富文本失去焦点保存内容
|
|
// 富文本失去焦点保存内容
|
|
saveTxt (e) {
|
|
saveTxt (e) {
|
|
@@ -997,6 +1009,7 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$http
|
|
this.$http
|
|
.post('/goods/add', {
|
|
.post('/goods/add', {
|
|
@@ -1007,6 +1020,7 @@ export default {
|
|
customGroupId: this.lineId,
|
|
customGroupId: this.lineId,
|
|
describ: this.mastKnow,
|
|
describ: this.mastKnow,
|
|
icon: this.Icon || '',
|
|
icon: this.Icon || '',
|
|
|
|
+ imges: JSON.stringify(this.Imglist) || '',
|
|
del: this.shopData.del || '',
|
|
del: this.shopData.del || '',
|
|
upDown: this.shopData.upDown || '',
|
|
upDown: this.shopData.upDown || '',
|
|
saleRule: this.showoperat, // 限制购票
|
|
saleRule: this.showoperat, // 限制购票
|