|
|
@ -117,6 +117,7 @@ |
|
|
<uni-forms-item label="详细图文" name="startPayNum"> |
|
|
<uni-forms-item label="详细图文" name="startPayNum"> |
|
|
<view class="xiangxi-box"> |
|
|
<view class="xiangxi-box"> |
|
|
<sp-editor |
|
|
<sp-editor |
|
|
|
|
|
:keys="keys" |
|
|
@init="initEditor" |
|
|
@init="initEditor" |
|
|
@input="inputOver" |
|
|
@input="inputOver" |
|
|
@upinImage="upinImage" |
|
|
@upinImage="upinImage" |
|
|
@ -167,7 +168,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import SpEditor from '@/pages/sp-editor/components/sp-editor/sp-editor.vue' |
|
|
import SpEditor from '@/package2/components/sp-editor/components/sp-editor/sp-editor.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
@ -238,12 +239,25 @@ |
|
|
onShow() { |
|
|
onShow() { |
|
|
this.attrId = uni.getStorageSync('attrId'); |
|
|
this.attrId = uni.getStorageSync('attrId'); |
|
|
this.shopMerchantType = uni.getStorageSync('shopMerchantType'); |
|
|
this.shopMerchantType = uni.getStorageSync('shopMerchantType'); |
|
|
|
|
|
uni.authorize({ |
|
|
|
|
|
scope: 'scope.writePhotosAlbum', |
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
fail() { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "您未授权,图片上传功能可能会出现错误", |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
if (this.hasSelectedTypeItem(this.typeItem)) { |
|
|
if (this.hasSelectedTypeItem(this.typeItem)) { |
|
|
this.typeItem = JSON.parse(JSON.stringify(this.typeItem)) |
|
|
this.typeItem = JSON.parse(JSON.stringify(this.typeItem)) |
|
|
this.formData.categoryId = this.typeItem.id |
|
|
this.formData.categoryId = this.typeItem.id |
|
|
this.formData.categoryName = this.typeItem.categoryName |
|
|
this.formData.categoryName = this.typeItem.categoryName |
|
|
this.syncSelectedCategory() |
|
|
this.syncSelectedCategory() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.syncSelectedCategory() |
|
|
} |
|
|
} |
|
|
this.formData.shopId = uni.getStorageSync('shopId') |
|
|
this.formData.shopId = uni.getStorageSync('shopId') |
|
|
}, |
|
|
}, |
|
|
@ -253,7 +267,7 @@ |
|
|
this.dataList = JSON.parse(option.dataList) |
|
|
this.dataList = JSON.parse(option.dataList) |
|
|
this.NB.sendRequest("/app/product/getById/" + this.dataList.id, { |
|
|
this.NB.sendRequest("/app/product/getById/" + this.dataList.id, { |
|
|
|
|
|
|
|
|
}, false, 'POST', 'application/x-www-form-urlencoded').then((res) => { |
|
|
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
this.modalType = 1 |
|
|
this.modalType = 1 |
|
|
this.formData.id = res.result.id |
|
|
this.formData.id = res.result.id |
|
|
@ -372,7 +386,7 @@ |
|
|
//跳转分类页 |
|
|
//跳转分类页 |
|
|
goGategoryLow() { |
|
|
goGategoryLow() { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: '/pages/shop/addType' |
|
|
url: '/package2/myCenter/addType' |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//初始化获取分类列表 |
|
|
//初始化获取分类列表 |
|
|
@ -395,7 +409,7 @@ |
|
|
return value !== '' && value !== undefined && value !== null |
|
|
return value !== '' && value !== undefined && value !== null |
|
|
}, |
|
|
}, |
|
|
hasSelectedTypeItem(item) { |
|
|
hasSelectedTypeItem(item) { |
|
|
return item && this.hasCategoryValue(item.id) |
|
|
return item && this.hasCategoryValue(item.id) && this.hasCategoryValue(item.categoryName) |
|
|
}, |
|
|
}, |
|
|
syncSelectedCategory() { |
|
|
syncSelectedCategory() { |
|
|
if (this.hasCategoryValue(this.formData.categoryId)) { |
|
|
if (this.hasCategoryValue(this.formData.categoryId)) { |
|
|
@ -457,13 +471,8 @@ |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
}else{ |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message, |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}).catch(() => {}); |
|
|
}) |
|
|
} else if (this.modalType == 1) { |
|
|
} else if (this.modalType == 1) { |
|
|
// 编辑 |
|
|
// 编辑 |
|
|
this.formData.attributeListPrice = JSON.stringify(this.formData.attributeListPrice) |
|
|
this.formData.attributeListPrice = JSON.stringify(this.formData.attributeListPrice) |
|
|
@ -477,13 +486,8 @@ |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
}else{ |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message, |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}).catch(() => {}); |
|
|
}) |
|
|
} |
|
|
} |
|
|
// } |
|
|
// } |
|
|
// }); |
|
|
// }); |
|
|
@ -523,6 +527,7 @@ |
|
|
} |
|
|
} |
|
|
const startPayNum = String(this.formData.startPayNum).trim() |
|
|
const startPayNum = String(this.formData.startPayNum).trim() |
|
|
if (startPayNum !== '' && !this.isValidInteger(startPayNum)) { |
|
|
if (startPayNum !== '' && !this.isValidInteger(startPayNum)) { |
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '起售数量只能输入整数', |
|
|
title: '起售数量只能输入整数', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
@ -820,9 +825,7 @@ |
|
|
let that = this |
|
|
let that = this |
|
|
this.$refs.addTypeDialog.open() |
|
|
this.$refs.addTypeDialog.open() |
|
|
this.modalclassType = type |
|
|
this.modalclassType = type |
|
|
this.NB.sendRequest("/app/productAttribute/selectByCategoryId", { |
|
|
this.NB.sendRequest("/app/productAttribute/selectByCategoryId", {categoryId:that.attrId}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
categoryId:that.attrId, |
|
|
|
|
|
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
that.categoryData = res.result |
|
|
that.categoryData = res.result |
|
|
if (that.categoryData.length == 0) { |
|
|
if (that.categoryData.length == 0) { |
|
|
@ -848,13 +851,11 @@ |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}).catch(() => {}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getCateGorySon(id){ |
|
|
getCateGorySon(id){ |
|
|
let that = this |
|
|
let that = this |
|
|
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", { |
|
|
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
id: id, |
|
|
|
|
|
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
that.categorySonData = res.result |
|
|
that.categorySonData = res.result |
|
|
for (var i = 0; i < that.categorySonData.length; i++) { |
|
|
for (var i = 0; i < that.categorySonData.length; i++) { |
|
|
@ -927,7 +928,7 @@ |
|
|
goAttributeList(){ |
|
|
goAttributeList(){ |
|
|
this.$refs.addTypeDialog.close() |
|
|
this.$refs.addTypeDialog.close() |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: '/pages/shop/attributeList' |
|
|
url: '/package2/myCenter/attributeList?from=addGoods' |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
async upLoadFile(path) { |
|
|
async upLoadFile(path) { |
|
|
|