|
@@ -243,7 +243,7 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
getVoucher().then((res) => { // 获取可选的代金券,用于创建和修改商品时定义代金券的使用规则
|
|
getVoucher().then((res) => { // 获取可选的代金券,用于创建和修改商品时定义代金券的使用规则
|
|
- this.voucherList = res.data
|
|
|
|
|
|
+ this.voucherList = Array.isArray(res.data) ? res.data : typeof res.data === 'number' && res.data ? [ { id: res.data, voucherName: res.data } ] : []
|
|
this.voucherList.push({
|
|
this.voucherList.push({
|
|
voucherName: '不使用代金券',
|
|
voucherName: '不使用代金券',
|
|
updateTime: '123123123123',
|
|
updateTime: '123123123123',
|