|
|
|
@ -32,8 +32,8 @@ |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="商品分类" name="editTitle"> |
|
|
|
<view style="border: 4rpx solid #eee;display: flex;flex: 1;border-radius: 10rpx;"> |
|
|
|
<text @click="goGategoryLow" placeholder="请选择商品分类" |
|
|
|
class="content-input" style="border: 0;flex: 1;">{{typeItem.categoryName}}</text> |
|
|
|
<input type="text" placeholder="请选择商品分类" disabled v-model="typeItem.categoryName" |
|
|
|
class="content-input" @tap="goGategoryLow" style="border: 0;"> |
|
|
|
<uni-icons type="right" size="16" |
|
|
|
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
@ -117,7 +117,7 @@ |
|
|
|
<uni-forms-item label="详细图文" name="startPayNum"> |
|
|
|
<view class="xiangxi-box"> |
|
|
|
<sp-editor |
|
|
|
|
|
|
|
:keys="keys" |
|
|
|
@init="initEditor" |
|
|
|
@input="inputOver" |
|
|
|
@upinImage="upinImage" |
|
|
|
@ -168,7 +168,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<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 { |
|
|
|
components: { |
|
|
|
@ -239,7 +239,18 @@ |
|
|
|
onShow() { |
|
|
|
this.attrId = uni.getStorageSync('attrId'); |
|
|
|
this.shopMerchantType = uni.getStorageSync('shopMerchantType'); |
|
|
|
uni.authorize({ |
|
|
|
scope: 'scope.writePhotosAlbum', |
|
|
|
success() { |
|
|
|
|
|
|
|
}, |
|
|
|
fail() { |
|
|
|
uni.showToast({ |
|
|
|
title: "您未授权,图片上传功能可能会出现错误", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (this.hasSelectedTypeItem(this.typeItem)) { |
|
|
|
this.typeItem = JSON.parse(JSON.stringify(this.typeItem)) |
|
|
|
this.formData.categoryId = this.typeItem.id |
|
|
|
@ -374,14 +385,13 @@ |
|
|
|
}, |
|
|
|
//跳转分类页 |
|
|
|
goGategoryLow() { |
|
|
|
console.log("111111111111") |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/shop/addType' |
|
|
|
url: '/package2/myCenter/addType' |
|
|
|
}) |
|
|
|
}, |
|
|
|
//初始化获取分类列表 |
|
|
|
getGategoryList() { |
|
|
|
this.NB.sendRequest("/app/productCategory/list", { |
|
|
|
this.NB.sendRequest("/auth/getShopByUser", { |
|
|
|
shopId:uni.getStorageSync('shopId') |
|
|
|
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -433,6 +443,7 @@ |
|
|
|
submit() { |
|
|
|
let that = this; |
|
|
|
this.syncLunchBoxByMoreBuy() |
|
|
|
this.normalizeGroupBuyPrices() |
|
|
|
if (!this.validateProductSpecs()) { |
|
|
|
return |
|
|
|
} |
|
|
|
@ -517,7 +528,6 @@ |
|
|
|
} |
|
|
|
const startPayNum = String(this.formData.startPayNum).trim() |
|
|
|
if (startPayNum !== '' && !this.isValidInteger(startPayNum)) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
title: '起售数量只能输入整数', |
|
|
|
icon: 'none' |
|
|
|
@ -555,6 +565,17 @@ |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
normalizeGroupBuyPrices() { |
|
|
|
if (!Array.isArray(this.formData.productGroupBuyPrices)) { |
|
|
|
this.formData.productGroupBuyPrices = [] |
|
|
|
return |
|
|
|
} |
|
|
|
this.formData.productGroupBuyPrices = this.formData.productGroupBuyPrices.filter((item) => { |
|
|
|
const groupCount = item && item.groupCount !== undefined && item.groupCount !== null ? String(item.groupCount).trim() : '' |
|
|
|
const groupPrice = item && item.groupPrice !== undefined && item.groupPrice !== null ? String(item.groupPrice).trim() : '' |
|
|
|
return groupCount !== '' || groupPrice !== '' |
|
|
|
}) |
|
|
|
}, |
|
|
|
isValidPrice(value) { |
|
|
|
return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0 |
|
|
|
}, |
|
|
|
@ -845,7 +866,9 @@ |
|
|
|
}, |
|
|
|
getCateGorySon(id){ |
|
|
|
let that = this |
|
|
|
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", { |
|
|
|
id: id, |
|
|
|
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
that.categorySonData = res.result |
|
|
|
for (var i = 0; i < that.categorySonData.length; i++) { |
|
|
|
@ -918,7 +941,7 @@ |
|
|
|
goAttributeList(){ |
|
|
|
this.$refs.addTypeDialog.close() |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/shop/attributeList?from=addGoods' |
|
|
|
url: '/package2/myCenter/attributeList?from=addGoods' |
|
|
|
}) |
|
|
|
}, |
|
|
|
async upLoadFile(path) { |
|
|
|
@ -989,7 +1012,9 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.back-btn { |
|
|
|
padding-top: 110rpx; |
|
|
|
position: absolute; |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.title-name { |
|
|
|
|