|
@@ -410,7 +410,7 @@ export default {
|
|
SHOPID: 0,
|
|
SHOPID: 0,
|
|
shopData: {},
|
|
shopData: {},
|
|
|
|
|
|
- expirationDate: '请选择过商品期日期',
|
|
|
|
|
|
+ expirationDate: '请选择商品过期日期',
|
|
// 销售属性
|
|
// 销售属性
|
|
patterList: [
|
|
patterList: [
|
|
{
|
|
{
|
|
@@ -473,21 +473,27 @@ export default {
|
|
uni.removeStorageSync('Id');
|
|
uni.removeStorageSync('Id');
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- this.getShopList();
|
|
|
|
-
|
|
|
|
- // ---------------------------------------------------
|
|
|
|
- this.SHOPID = uni.getStorageSync('Id');
|
|
|
|
- if (this.SHOPID) {
|
|
|
|
- this.getShopBuyId();
|
|
|
|
|
|
+ if (this.storeId != '') {
|
|
|
|
+ this.getLine()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onLoad() {
|
|
|
|
|
|
+ onReady (){
|
|
myCloud = uniCloud.init({
|
|
myCloud = uniCloud.init({
|
|
provider: 'aliyun',
|
|
provider: 'aliyun',
|
|
spaceId: 'db8671a1-69bd-470d-ad59-ba927c88f4a4',
|
|
spaceId: 'db8671a1-69bd-470d-ad59-ba927c88f4a4',
|
|
clientSecret: '8nOzV70edtpCd0El6qce3g==',
|
|
clientSecret: '8nOzV70edtpCd0El6qce3g==',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ onLoad() {
|
|
|
|
+ this.getShopList();
|
|
|
|
+
|
|
|
|
+ // ---------------------------------------------------
|
|
|
|
+ this.SHOPID = uni.getStorageSync('Id');
|
|
|
|
+ if (this.SHOPID) {
|
|
|
|
+ this.getShopBuyId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 打开日历
|
|
// 打开日历
|
|
openTime() {
|
|
openTime() {
|
|
@@ -557,8 +563,8 @@ export default {
|
|
.get('/goods/getById/' + this.SHOPID)
|
|
.get('/goods/getById/' + this.SHOPID)
|
|
.then(async (res) => {
|
|
.then(async (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;
|
|
|
|
+ console.log(this.shopData);
|
|
|
|
|
|
this.getShopList();
|
|
this.getShopList();
|
|
|
|
|
|
@@ -766,6 +772,19 @@ export default {
|
|
arr.push({ name: element.ticket_name, id: element.ticket_no });
|
|
arr.push({ name: element.ticket_name, id: element.ticket_no });
|
|
});
|
|
});
|
|
this.shopList = this.shopList.concat(arr);
|
|
this.shopList = this.shopList.concat(arr);
|
|
|
|
+
|
|
|
|
+ // 回显名称
|
|
|
|
+ if (this.shopData.name) {
|
|
|
|
+ this.shopList.forEach((item, index) => {
|
|
|
|
+ if (this.shopData.name === item.name) {
|
|
|
|
+ this.shopIndex = index;
|
|
|
|
+ } else {
|
|
|
|
+ this.shopIndex = 0
|
|
|
|
+ this.shopList[0].name = this.shopData.name
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.shopId = this.shopList[this.shopIndex].id;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 线路分配
|
|
// 线路分配
|
|
@@ -787,15 +806,6 @@ export default {
|
|
// 可选择商品名称回显
|
|
// 可选择商品名称回显
|
|
if (this.shopData.name) {
|
|
if (this.shopData.name) {
|
|
this.getShopName();
|
|
this.getShopName();
|
|
- this.shopList.forEach((item, index) => {
|
|
|
|
- if (this.shopData.name === item.name) {
|
|
|
|
- this.shopIndex = index;
|
|
|
|
- } else {
|
|
|
|
- this.shopIndex = 0;
|
|
|
|
- this.shopList[0].name = this.shopData.name
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.shopId = this.shopList[this.shopIndex].id;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 分类回显
|
|
// 分类回显
|
|
@@ -838,6 +848,8 @@ export default {
|
|
// 图标上传
|
|
// 图标上传
|
|
uploadImg() {
|
|
uploadImg() {
|
|
let _self = this;
|
|
let _self = this;
|
|
|
|
+ _self.uploadtxt = '上传中...'
|
|
|
|
+ _self.progress = 0
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
count: 1,
|
|
count: 1,
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
@@ -845,7 +857,6 @@ export default {
|
|
success: function (res) {
|
|
success: function (res) {
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
- _self.uploadtxt = '上传中...'
|
|
|
|
myCloud.uploadFile({
|
|
myCloud.uploadFile({
|
|
url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
|
|
url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
@@ -856,16 +867,21 @@ export default {
|
|
_self.Icon = res.fileID;
|
|
_self.Icon = res.fileID;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ fail: function (msg) {
|
|
|
|
+ console.log(msg);
|
|
|
|
+ },
|
|
onUploadProgress: function (progressEvent) {
|
|
onUploadProgress: function (progressEvent) {
|
|
- _self.progress = Math.round(
|
|
|
|
- (progressEvent.loaded * 100) / progressEvent.total
|
|
|
|
- );
|
|
|
|
|
|
+ _self.progress = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
if ( _self.progress === 100) {
|
|
if ( _self.progress === 100) {
|
|
_self.uploadtxt = '上传成功'
|
|
_self.uploadtxt = '上传成功'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ fail: function (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ _self.uploadtxt = '已取消上传'
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 图册上传
|
|
// 图册上传
|
|
@@ -925,10 +941,16 @@ export default {
|
|
}
|
|
}
|
|
// 判断是否可以自定义商品名称
|
|
// 判断是否可以自定义商品名称
|
|
let name = '';
|
|
let name = '';
|
|
|
|
+ console.log(this.shopList.length);
|
|
if (this.shopList.length === 1) {
|
|
if (this.shopList.length === 1) {
|
|
name = this.shopname;
|
|
name = this.shopname;
|
|
- } else {
|
|
|
|
- name = this.shopList[this.shopIndex].id;
|
|
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (this.shopList[0].name != '商品名称(请先选择商品类型)') {
|
|
|
|
+ name = this.shopList[this.shopIndex].name;
|
|
|
|
+ } else {
|
|
|
|
+ name = this.shopList[this.shopIndex].id;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (!this.storeId) {
|
|
if (!this.storeId) {
|
|
this.$mHelper.toast('请选择所属商铺!');
|
|
this.$mHelper.toast('请选择所属商铺!');
|
|
@@ -961,7 +983,6 @@ export default {
|
|
this.$mHelper.toast('请选择商品过期日期');
|
|
this.$mHelper.toast('请选择商品过期日期');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
if (this.shopIndex === 0) {
|
|
if (this.shopIndex === 0) {
|
|
this.inventory = '';
|
|
this.inventory = '';
|
|
}
|
|
}
|
|
@@ -979,7 +1000,6 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
if (!this.astrictDate.data.bookRule) {
|
|
if (!this.astrictDate.data.bookRule) {
|
|
this.$mHelper.toast('请输入预订数量!');
|
|
this.$mHelper.toast('请输入预订数量!');
|
|
return;
|
|
return;
|
|
@@ -1001,10 +1021,9 @@ export default {
|
|
saleRuleJson: JSON.stringify(this.astrictDate),
|
|
saleRuleJson: JSON.stringify(this.astrictDate),
|
|
// 自营
|
|
// 自营
|
|
name: name,
|
|
name: name,
|
|
- salePrice: this.price * 100 || '',
|
|
|
|
- price: this.rateprice * 100 || '',
|
|
|
|
- expiredTime:
|
|
|
|
- this.expirationDate === '商品过期日期' ? '' : this.expirationDate,
|
|
|
|
|
|
+ salePrice: this.price * 100 || null,
|
|
|
|
+ price: this.rateprice * 100 || null,
|
|
|
|
+ expiredTime: this.expirationDate === '请选择商品过期日期' ? '' : this.expirationDate,
|
|
inventory: this.inventory,
|
|
inventory: this.inventory,
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|