|
@@ -62,6 +62,7 @@
|
|
|
@change="changeShop"
|
|
|
:value="shopIndex"
|
|
|
:range="shopList"
|
|
|
+ :disabled="nameDisabled"
|
|
|
range-key="name"
|
|
|
class="selectlist"
|
|
|
>
|
|
@@ -335,7 +336,7 @@
|
|
|
<editor
|
|
|
id="editor"
|
|
|
class="ql-container"
|
|
|
- :placeholder="placeholder"
|
|
|
+ :placeholder="placeholderContent"
|
|
|
@input="saveTxt"
|
|
|
@ready="onEditorReady"
|
|
|
></editor>
|
|
@@ -360,21 +361,20 @@ import Header from '../components/header.vue';
|
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
|
import moment from '@/common/moment';
|
|
|
import indexConfig from '@/config/index.config';
|
|
|
-console.log(indexConfig.uploadUrl)
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
Header,
|
|
|
uniCalendar,
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
loading: false,
|
|
|
scenicId: uni.getStorageSync('scenicId'),
|
|
|
title: '商品详情',
|
|
|
showoperat: false,
|
|
|
|
|
|
- placeholder: '请输入内容...',
|
|
|
+ placeholderContent: '请输入内容...',
|
|
|
mastKnow: '',
|
|
|
|
|
|
storeList: [{ name: '所属店铺', id: '', type: '' }],
|
|
@@ -392,6 +392,7 @@ export default {
|
|
|
shopIndex: 0,
|
|
|
shopId: '',
|
|
|
shopname: '',
|
|
|
+ nameDisabled: true,
|
|
|
|
|
|
hasNameList: 0, // 判断是否有商品名称列表
|
|
|
|
|
@@ -405,6 +406,7 @@ export default {
|
|
|
progress: 0,
|
|
|
iconurl: '',
|
|
|
pickList: [],
|
|
|
+
|
|
|
Icon: '',
|
|
|
Imglist: [],
|
|
|
|
|
@@ -434,11 +436,7 @@ export default {
|
|
|
|
|
|
// 商品库存
|
|
|
shopNumList: [
|
|
|
- {
|
|
|
- id: '0',
|
|
|
- name: '无限库存模式',
|
|
|
- know: '售卖商品不计算库存,无限售卖。',
|
|
|
- },
|
|
|
+ {id: '0',name: '无限库存模式',know: '售卖商品不计算库存,无限售卖。'},
|
|
|
{ id: '1', name: '限日库存模式', know: '每日固定库存售卖。' },
|
|
|
{ id: '2', name: '限总库存模式', know: '总库存限制,卖完为止。' },
|
|
|
],
|
|
@@ -475,106 +473,111 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- onUnload() {
|
|
|
+ onUnload () {
|
|
|
uni.removeStorageSync('Id');
|
|
|
},
|
|
|
- onShow() {
|
|
|
- // if (this.storeId != '') {
|
|
|
- // this.getLine(this.storeId)
|
|
|
- // }
|
|
|
+ onShow () {
|
|
|
+ if (this.storeId != '') {
|
|
|
+ this.getLine(this.storeId)
|
|
|
+ }
|
|
|
},
|
|
|
- onReady() {
|
|
|
+ onReady () {
|
|
|
myCloud = uniCloud.init({
|
|
|
provider: 'aliyun',
|
|
|
spaceId: 'db8671a1-69bd-470d-ad59-ba927c88f4a4',
|
|
|
clientSecret: '8nOzV70edtpCd0El6qce3g==',
|
|
|
});
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- console.log(options)
|
|
|
- this.SHOPID = options.id
|
|
|
-
|
|
|
- if (this.SHOPID) {
|
|
|
- this.getShopBuyId(this.SHOPID).then( () => {
|
|
|
- this.getShopList().then(()=>{
|
|
|
+ onLoad ( option ) {
|
|
|
+ if (option.id != 'undefined') {
|
|
|
+ this.SHOPID = option.id
|
|
|
+ this.getShopBuyId(option.id).then(() => {
|
|
|
+ this.getShopList().then(() => {
|
|
|
this.getShopName(this.typeId, this.storeId);
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
- // 判断返回的是否是自营商品
|
|
|
- this.price = this.shopData.salePrice / 100;
|
|
|
- this.rateprice = this.shopData.price / 100;
|
|
|
+ // 数据回显
|
|
|
+ this.price = this.shopData.salePrice / 100;
|
|
|
+ this.rateprice = this.shopData.price / 100;
|
|
|
|
|
|
- if (this.shopData.expiredTime) {
|
|
|
- this.expirationDate = this.shopData.expiredTime.slice(0, 10)
|
|
|
- ? this.shopData.expiredTime.slice(0, 10)
|
|
|
- : '请选择商品过期日期';
|
|
|
- }
|
|
|
+ if (this.shopData.expiredTime) {
|
|
|
+ this.expirationDate = this.shopData.expiredTime.slice(0, 10)
|
|
|
+ ? this.shopData.expiredTime.slice(0, 10)
|
|
|
+ : '请选择商品过期日期';
|
|
|
+ }
|
|
|
|
|
|
- let rule = JSON.parse(this.shopData.saleRuleJson);
|
|
|
+ // 图标回显
|
|
|
+ if (this.shopData.icon) {
|
|
|
+ this.Icon = this.shopData.icon
|
|
|
+ this.iconurl = this.shopData.icon;
|
|
|
+ }
|
|
|
|
|
|
- if (rule) {
|
|
|
- this.astrictDate.data.saleDay = rule.data.saleDay
|
|
|
- ? rule.data.saleDay
|
|
|
- : 0;
|
|
|
- this.astrictDate.data.saleNum = rule.data.saleNum
|
|
|
- ? rule.data.saleNum
|
|
|
- : 0;
|
|
|
- // 有效期模式
|
|
|
- this.astrictDate.dateSetting = rule.data.dateSetting;
|
|
|
- this.patterIndex = +rule.data.dateSetting;
|
|
|
- // 库存模式
|
|
|
- this.astrictDate.goodsStockFlag = rule.data.goodsStockFlag;
|
|
|
- this.shopNumIndex = +rule.data.goodsStockFlag;
|
|
|
+ // 图册回显
|
|
|
+ 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) {
|
|
|
+ this.astrictDate.data.saleDay = rule.data.saleDay
|
|
|
+ ? rule.data.saleDay
|
|
|
+ : 0;
|
|
|
+ this.astrictDate.data.saleNum = rule.data.saleNum
|
|
|
+ ? rule.data.saleNum
|
|
|
+ : 0;
|
|
|
+ // 有效期模式
|
|
|
+ this.astrictDate.dateSetting = rule.data.dateSetting;
|
|
|
+ this.patterIndex = +rule.data.dateSetting;
|
|
|
+ // 库存模式
|
|
|
+ this.astrictDate.goodsStockFlag = rule.data.goodsStockFlag;
|
|
|
+ this.shopNumIndex = +rule.data.goodsStockFlag;
|
|
|
|
|
|
- if (this.shopNumIndex === 1) {
|
|
|
- this.dateInventory = this.shopData.inventory;
|
|
|
- } else if (this.shopNumIndex === 2) {
|
|
|
- this.sunInventory = this.shopData.inventory;
|
|
|
- }
|
|
|
- // 预订数量
|
|
|
- this.astrictDate.data.bookRule = rule.data.bookRule;
|
|
|
- // 实名制
|
|
|
- if (rule.data.isRealName === '0') {
|
|
|
- this.trueNme = true;
|
|
|
- } else {
|
|
|
- this.trueNme = false;
|
|
|
- }
|
|
|
- this.astrictDate.data.isRealName = rule.data.isRealName;
|
|
|
- // 可退规则
|
|
|
- this.bookingIndex = +rule.data.usubscribeRule;
|
|
|
- this.astrictDate.usubscribeRule = rule.data.usubscribeRule;
|
|
|
- // 二维码
|
|
|
- if (rule.data.isShowQrcode === '0') {
|
|
|
- this.codeShow = true;
|
|
|
- } else {
|
|
|
- this.codeShow = false;
|
|
|
- }
|
|
|
- this.astrictDate.data.isShowQrcode = rule.data.isShowQrcode;
|
|
|
+ if (this.shopNumIndex === 1) {
|
|
|
+ this.dateInventory = this.shopData.inventory;
|
|
|
+ } else if (this.shopNumIndex === 2) {
|
|
|
+ this.sunInventory = this.shopData.inventory;
|
|
|
}
|
|
|
- // 限制购票回显
|
|
|
- if (this.shopData.saleRule === '1') {
|
|
|
- this.showoperat = true;
|
|
|
+ // 预订数量
|
|
|
+ this.astrictDate.data.bookRule = rule.data.bookRule;
|
|
|
+ // 实名制
|
|
|
+ if (rule.data.isRealName === '0') {
|
|
|
+ this.trueNme = true;
|
|
|
} else {
|
|
|
- this.showoperat = false;
|
|
|
+ this.trueNme = false;
|
|
|
}
|
|
|
-
|
|
|
- // 图标回显
|
|
|
- if (this.shopData.icon) {
|
|
|
- this.iconurl = this.shopData.icon;
|
|
|
+ this.astrictDate.data.isRealName = rule.data.isRealName;
|
|
|
+ // 可退规则
|
|
|
+ this.bookingIndex = +rule.data.usubscribeRule;
|
|
|
+ this.astrictDate.usubscribeRule = rule.data.usubscribeRule;
|
|
|
+ // 二维码
|
|
|
+ if (rule.data.isShowQrcode === '0') {
|
|
|
+ this.codeShow = true;
|
|
|
} else {
|
|
|
- this.iconurl = '';
|
|
|
+ this.codeShow = false;
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
- }, 1);
|
|
|
- })
|
|
|
+ this.astrictDate.data.isShowQrcode = rule.data.isShowQrcode;
|
|
|
+ }
|
|
|
+ // 限制购票回显
|
|
|
+ if (this.shopData.saleRule === '1') {
|
|
|
+ this.showoperat = true;
|
|
|
+ } else {
|
|
|
+ this.showoperat = false;
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.getShopList()
|
|
|
}
|
|
|
-
|
|
|
- // this.getShopList();
|
|
|
},
|
|
|
+ // onPageScroll (option) {
|
|
|
+ // console.log(option);
|
|
|
+ // },
|
|
|
methods: {
|
|
|
// 获取单个商品信息
|
|
|
- async getShopBuyId(id) {
|
|
|
+ async getShopBuyId (id) {
|
|
|
this.loading = true;
|
|
|
await this.$http.get('/goods/getById/' + id).then((res) => {
|
|
|
if (res.code === 200 && res.msg === 'OK') {
|
|
@@ -582,84 +585,18 @@ export default {
|
|
|
this.storeId = res.data.shopId;
|
|
|
this.typeId = res.data.typeId;
|
|
|
this.loading = false;
|
|
|
- // setTimeout(() => {
|
|
|
- // this.price = this.shopData.salePrice / 100;
|
|
|
- // this.rateprice = this.shopData.price / 100;
|
|
|
-
|
|
|
- // if (this.shopData.expiredTime) {
|
|
|
- // this.expirationDate = this.shopData.expiredTime.slice(0, 10)
|
|
|
- // ? this.shopData.expiredTime.slice(0, 10)
|
|
|
- // : '请选择商品过期日期';
|
|
|
- // }
|
|
|
-
|
|
|
- // let rule = JSON.parse(this.shopData.saleRuleJson);
|
|
|
-
|
|
|
- // if (rule) {
|
|
|
- // this.astrictDate.data.saleDay = rule.data.saleDay
|
|
|
- // ? rule.data.saleDay
|
|
|
- // : 0;
|
|
|
- // this.astrictDate.data.saleNum = rule.data.saleNum
|
|
|
- // ? rule.data.saleNum
|
|
|
- // : 0;
|
|
|
- // // 有效期模式
|
|
|
- // this.astrictDate.dateSetting = rule.data.dateSetting;
|
|
|
- // this.patterIndex = +rule.data.dateSetting;
|
|
|
- // // 库存模式
|
|
|
- // this.astrictDate.goodsStockFlag = rule.data.goodsStockFlag;
|
|
|
- // this.shopNumIndex = +rule.data.goodsStockFlag;
|
|
|
-
|
|
|
- // if (this.shopNumIndex === 1) {
|
|
|
- // this.dateInventory = this.shopData.inventory;
|
|
|
- // } else if (this.shopNumIndex === 2) {
|
|
|
- // this.sunInventory = this.shopData.inventory;
|
|
|
- // }
|
|
|
- // // 预订数量
|
|
|
- // this.astrictDate.data.bookRule = rule.data.bookRule;
|
|
|
- // // 实名制
|
|
|
- // if (rule.data.isRealName === '0') {
|
|
|
- // this.trueNme = true;
|
|
|
- // } else {
|
|
|
- // this.trueNme = false;
|
|
|
- // }
|
|
|
- // this.astrictDate.data.isRealName = rule.data.isRealName;
|
|
|
- // // 可退规则
|
|
|
- // this.bookingIndex = +rule.data.usubscribeRule;
|
|
|
- // this.astrictDate.usubscribeRule = rule.data.usubscribeRule;
|
|
|
- // // 二维码
|
|
|
- // if (rule.data.isShowQrcode === '0') {
|
|
|
- // this.codeShow = true;
|
|
|
- // } else {
|
|
|
- // this.codeShow = false;
|
|
|
- // }
|
|
|
- // this.astrictDate.data.isShowQrcode = rule.data.isShowQrcode;
|
|
|
- // }
|
|
|
- // // 限制购票回显
|
|
|
- // if (this.shopData.saleRule === '1') {
|
|
|
- // this.showoperat = true;
|
|
|
- // } else {
|
|
|
- // this.showoperat = false;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 图标回显
|
|
|
- // if (this.shopData.icon) {
|
|
|
- // this.iconurl = this.shopData.icon;
|
|
|
- // } else {
|
|
|
- // this.iconurl = '';
|
|
|
- // }
|
|
|
- // this.loading = false;
|
|
|
- // }, 500);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 打开日历
|
|
|
- openTime() {
|
|
|
+ openTime () {
|
|
|
this.$refs.calendar.open();
|
|
|
},
|
|
|
- confirm(e) {
|
|
|
+ confirm (e) {
|
|
|
this.expirationDate = e.fulldate;
|
|
|
},
|
|
|
// 自定义属性
|
|
|
- radioChange(evt) {
|
|
|
+ radioChange (evt) {
|
|
|
for (let i = 0; i < this.patterList.length; i++) {
|
|
|
if (this.patterList[i].id === evt.target.value) {
|
|
|
this.patterIndex = i;
|
|
@@ -669,7 +606,7 @@ export default {
|
|
|
this.astrictDate.data.dateSetting = evt.detail.value;
|
|
|
},
|
|
|
// 库存模式
|
|
|
- shopNumChange(e) {
|
|
|
+ shopNumChange (e) {
|
|
|
for (let i = 0; i < this.shopNumList.length; i++) {
|
|
|
if (this.shopNumList[i].id === e.target.value) {
|
|
|
this.shopNumIndex = i;
|
|
@@ -683,10 +620,11 @@ export default {
|
|
|
if (e.detail.value === '2') {
|
|
|
this.dateInventory = 0;
|
|
|
}
|
|
|
+
|
|
|
this.astrictDate.data.goodsStockFlag = e.detail.value;
|
|
|
},
|
|
|
// 可退模式
|
|
|
- bookingChange(e) {
|
|
|
+ bookingChange (e) {
|
|
|
for (let i = 0; i < this.bookingList.length; i++) {
|
|
|
if (this.bookingList[i].id === e.target.value) {
|
|
|
this.bookingIndex = i;
|
|
@@ -696,7 +634,7 @@ export default {
|
|
|
this.astrictDate.data.usubscribeRule = e.detail.value;
|
|
|
},
|
|
|
// 实名制
|
|
|
- trueNmeChange(e) {
|
|
|
+ trueNmeChange (e) {
|
|
|
if (e.detail.value) {
|
|
|
this.astrictDate.data.isRealName = '0';
|
|
|
} else {
|
|
@@ -704,7 +642,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 显示二维码
|
|
|
- codeShowChange(e) {
|
|
|
+ codeShowChange (e) {
|
|
|
if (e.detail.value) {
|
|
|
this.astrictDate.data.isShowQrcode = '0';
|
|
|
} else {
|
|
@@ -712,7 +650,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 初始化编辑器
|
|
|
- onEditorReady() {
|
|
|
+ onEditorReady () {
|
|
|
+ // this.placeholderContent = this.shopData.describ
|
|
|
uni
|
|
|
.createSelectorQuery()
|
|
|
.select('#editor')
|
|
@@ -722,11 +661,11 @@ export default {
|
|
|
html: this.shopData.describ, //this.EditGoodsDetail.content为赋值内容。
|
|
|
});
|
|
|
})
|
|
|
- .exec();
|
|
|
+ .exec(-1000)
|
|
|
},
|
|
|
// -----------------------------------------------------------------
|
|
|
// 跳转到管理分类页面
|
|
|
- toClassify() {
|
|
|
+ toClassify () {
|
|
|
if (this.storeId) {
|
|
|
uni.setStorageSync('shopid', this.storeId);
|
|
|
this.$mRouter.push({ route: '/pages/shop/classify' });
|
|
@@ -735,28 +674,36 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 选择店铺
|
|
|
- changeStore(e) {
|
|
|
+ changeStore (e) {
|
|
|
this.storeIndex = e.detail.value;
|
|
|
this.storeId = this.storeList[this.storeIndex].id;
|
|
|
this.typeProperty = this.storeList[this.storeIndex].type;
|
|
|
+
|
|
|
+ if (!this.SHOPID) {
|
|
|
+ this.getType(this.storeId)
|
|
|
+ this.getLine(this.storeId)
|
|
|
+ }
|
|
|
},
|
|
|
// 选择商品类型
|
|
|
- changeType(e) {
|
|
|
+ changeType (e) {
|
|
|
this.typeIndex = e.detail.value;
|
|
|
this.typeId = this.typeList[this.typeIndex].id;
|
|
|
+ if (!this.SHOPID) {
|
|
|
+ this.getShopName(this.typeId, this.storeId);
|
|
|
+ }
|
|
|
},
|
|
|
// 商品名称选择
|
|
|
- changeShop(e) {
|
|
|
+ changeShop (e) {
|
|
|
this.shopIndex = e.detail.value;
|
|
|
this.shopId = this.shopList[this.shopIndex].id;
|
|
|
},
|
|
|
// 分类
|
|
|
- changeClassify(e) {
|
|
|
+ changeClassify (e) {
|
|
|
this.lineIndex = e.detail.value;
|
|
|
this.lineId = this.lineList[this.lineIndex].id;
|
|
|
},
|
|
|
// 所属店铺
|
|
|
- async getShopList() {
|
|
|
+ async getShopList () {
|
|
|
this.storeList = [{ name: '所属店铺', id: '', type: '' }];
|
|
|
await this.$http
|
|
|
.get('/shop/getList', { mid: this.scenicId })
|
|
@@ -790,7 +737,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 商品类型
|
|
|
- async getType(storeId) {
|
|
|
+ async getType (storeId) {
|
|
|
this.typeList = [{ name: '商品类型(请先选择所属店铺)', id: '' }];
|
|
|
this.$http
|
|
|
.get('/type/getTypeListByShopId', {
|
|
@@ -818,8 +765,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 商品名称
|
|
|
- async getShopName(typeId, storeId) {
|
|
|
- this.loading = true
|
|
|
+ async getShopName (typeId, storeId) {
|
|
|
this.shopList = [{ name: '商品名称(请先选择商品类型)', id: '' }];
|
|
|
await this.$http
|
|
|
.get('/goods/getTicketGoods', {
|
|
@@ -829,42 +775,32 @@ export default {
|
|
|
.then(async (res) => {
|
|
|
if (res.code === 200) {
|
|
|
let arr = [];
|
|
|
- res.data.forEach((element) => {
|
|
|
- arr.push({ name: element.ticket_name, id: element.ticket_no });
|
|
|
- });
|
|
|
+ res.data.forEach(element => arr.push({ name: element.ticket_name, id: element.ticket_no }));
|
|
|
this.shopList = this.shopList.concat(arr);
|
|
|
- this.loading = false
|
|
|
+ this.nameDisabled = false
|
|
|
|
|
|
// 回显名称
|
|
|
if (this.shopData.name) {
|
|
|
- this.loading = true
|
|
|
- if (this.shopData.ticketNo) {
|
|
|
- // 分销没有ticketNo
|
|
|
- this.shopList[0] = {
|
|
|
- name: this.shopData.name,
|
|
|
- id: this.shopData.ticketNo,
|
|
|
- };
|
|
|
+ this.loading = true;
|
|
|
+ if (this.typeProperty != 0) {
|
|
|
+ this.shopList[0] = { name: this.shopData.name, id: '' };
|
|
|
+ this.shopIndex = 0
|
|
|
+ this.shopId = this.shopList[this.shopIndex].id;
|
|
|
+ if (this.shopList[0].name === this.shopList[1].name) {
|
|
|
+ this.shopList.length = 1
|
|
|
+ }
|
|
|
} else {
|
|
|
// 自营商品直接赋值
|
|
|
- this.shopname = this.shopname.name;
|
|
|
+ this.shopname = this.shopData.name;
|
|
|
}
|
|
|
- this.shopList.forEach((item, index) => {
|
|
|
- if (this.shopData.name === item.name) {
|
|
|
- // this.shopList[0] = { name: '商品名称(请先选择商品类型)', id: '' }
|
|
|
- this.shopIndex = index;
|
|
|
- } else {
|
|
|
- this.shopIndex = 0;
|
|
|
- }
|
|
|
- });
|
|
|
- this.shopId = this.shopList[this.shopIndex].id;
|
|
|
- this.loading = false
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 线路分配
|
|
|
- async getLine(storeId) {
|
|
|
- this.loading = true
|
|
|
+ async getLine (storeId) {
|
|
|
this.lineList = [{ name: '分类(请先选择所属商品)', id: '' }];
|
|
|
await this.$http
|
|
|
.get('/goods/getCustomGroupList', {
|
|
@@ -878,26 +814,25 @@ export default {
|
|
|
});
|
|
|
this.lineList = this.lineList.concat(arr);
|
|
|
this.lineDidsable = false;
|
|
|
- this.loading = false
|
|
|
|
|
|
// 分类回显
|
|
|
if (this.shopData.customGroupId) {
|
|
|
- this.loading = true
|
|
|
+ this.loading = true;
|
|
|
this.lineList.forEach((item, index) => {
|
|
|
if (this.shopData.customGroupId === item.id) {
|
|
|
this.lineIndex = index;
|
|
|
}
|
|
|
});
|
|
|
this.lineId = this.lineList[this.lineIndex].id;
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 账号限制
|
|
|
- Change(e) {
|
|
|
+ Change (e) {
|
|
|
this.showoperat = e.detail.value;
|
|
|
},
|
|
|
- subtractUser() {
|
|
|
+ subtractUser () {
|
|
|
if (this.astrictDate.data.saleDay <= 1) {
|
|
|
this.$mHelper.toast('最少一天');
|
|
|
return;
|
|
@@ -905,10 +840,10 @@ export default {
|
|
|
this.astrictDate.data.saleDay--;
|
|
|
}
|
|
|
},
|
|
|
- addUser() {
|
|
|
+ addUser () {
|
|
|
this.astrictDate.data.saleDay++;
|
|
|
},
|
|
|
- subtractDate() {
|
|
|
+ subtractDate () {
|
|
|
if (this.astrictDate.data.saleNum <= 1) {
|
|
|
this.$mHelper.toast('最少一张票');
|
|
|
return;
|
|
@@ -916,11 +851,11 @@ export default {
|
|
|
this.astrictDate.data.saleNum--;
|
|
|
}
|
|
|
},
|
|
|
- addDate() {
|
|
|
+ addDate () {
|
|
|
this.astrictDate.data.saleNum++;
|
|
|
},
|
|
|
// 图标上传
|
|
|
- uploadImg() {
|
|
|
+ uploadImg () {
|
|
|
let _self = this;
|
|
|
_self.uploadtxt = '上传中...';
|
|
|
_self.progress = 0;
|
|
@@ -941,7 +876,7 @@ export default {
|
|
|
_self.Icon = res.fileID;
|
|
|
}
|
|
|
},
|
|
|
- fail: function (msg) {},
|
|
|
+ fail: function (msg) { },
|
|
|
onUploadProgress: function (progressEvent) {
|
|
|
_self.progress = Math.round(
|
|
|
(progressEvent.loaded * 100) / progressEvent.total
|
|
@@ -958,7 +893,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 图册上传
|
|
|
- uploadList() {
|
|
|
+ uploadList () {
|
|
|
let _self = this;
|
|
|
uni.chooseImage({
|
|
|
count: 6,
|
|
@@ -970,6 +905,7 @@ export default {
|
|
|
_self.$mHelper.toast('最多只可上传6张图片');
|
|
|
} else {
|
|
|
_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({
|
|
@@ -979,12 +915,10 @@ export default {
|
|
|
name: 'file',
|
|
|
onUploadProgress: function (progressEvent) {
|
|
|
// 上传进度回调
|
|
|
- let percentCompleted = Math.round(
|
|
|
- (progressEvent.loaded * 100) / progressEvent.total
|
|
|
- );
|
|
|
+ let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log(res)
|
|
|
+ _self.Imglist.push({url:res.fileID,uid:res.filePath})
|
|
|
},
|
|
|
});
|
|
|
}
|
|
@@ -993,16 +927,22 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 删除图册中的图片
|
|
|
- deleteThisImg(index) {
|
|
|
+ deleteThisImg (index) {
|
|
|
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) {
|
|
|
this.mastKnow = e.detail.html;
|
|
|
},
|
|
|
// 内容提交
|
|
|
- submitMesage() {
|
|
|
+ submitMesage () {
|
|
|
let _this = this;
|
|
|
+
|
|
|
// 判断是否限制账号购买
|
|
|
if (this.showoperat) {
|
|
|
this.showoperat = '1';
|
|
@@ -1011,19 +951,12 @@ export default {
|
|
|
this.astrictDate.data.saleDay = 0;
|
|
|
this.astrictDate.data.saleNum = 0;
|
|
|
}
|
|
|
-
|
|
|
let name = '';
|
|
|
- console.log('是否自营');
|
|
|
- console.log(this.typeProperty);
|
|
|
if (this.typeProperty === 1) {
|
|
|
- name = this.shopList[this.shopIndex].id;
|
|
|
+ name = this.shopList[this.shopIndex].name;
|
|
|
} else if (this.typeProperty === 0) {
|
|
|
name = this.shopname;
|
|
|
}
|
|
|
-
|
|
|
- console.log(name);
|
|
|
-
|
|
|
- return;
|
|
|
if (!this.storeId) {
|
|
|
this.$mHelper.toast('请选择所属商铺!');
|
|
|
return;
|
|
@@ -1032,17 +965,16 @@ export default {
|
|
|
this.$mHelper.toast('请选择商品类型!');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
if (!name) {
|
|
|
this.$mHelper.toast('请选择商品名称或者输入商品名称!');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- if (this.typeProperty === '0') {
|
|
|
+ if (this.typeProperty === 0) {
|
|
|
if (!this.lineId) {
|
|
|
this.$mHelper.toast('请选择商品分类!');
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (!this.price) {
|
|
|
this.$mHelper.toast('请输入商品卖价!');
|
|
|
return;
|
|
@@ -1077,6 +1009,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
this.loading = true;
|
|
|
this.$http
|
|
|
.post('/goods/add', {
|
|
@@ -1087,6 +1020,7 @@ export default {
|
|
|
customGroupId: this.lineId,
|
|
|
describ: this.mastKnow,
|
|
|
icon: this.Icon || '',
|
|
|
+ imges: JSON.stringify(this.Imglist) || '',
|
|
|
del: this.shopData.del || '',
|
|
|
upDown: this.shopData.upDown || '',
|
|
|
saleRule: this.showoperat, // 限制购票
|