Commit 924ade73 authored by 王伟's avatar 王伟

外部商品通证列表发布商品

parent f1582a4a
......@@ -65,6 +65,14 @@ export const getGoodList = {
return { goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }
}
}
// 获取商品审核列表
export const getGoodCheckList = {
url: '/goods/goodsList/pagecheck',
method: 'GET',
dealReqData: ({ goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }) => {
return { goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }
}
}
// 上下架商品系列
export const onOffSeries = {
......
......@@ -161,7 +161,8 @@ export default {
expressList: [],
submitLoading: false,
commodityPassId: '',
availableNumber: ''
availableNumber: '',
skuId: ''
}
},
methods: {
......@@ -240,33 +241,36 @@ export default {
} else {
this.form.delayDelivery = true
}
if (auctionVO) {
this.form.buyerDeposit = auctionVO.buyerDeposit
this.form.priceIncrease = auctionVO.priceIncrease
this.form.endTime = formatTime(auctionVO.endTime)
}
this.form.baseInfo = {
name,
description,
coinName: skus[0].coinName,
prop: JSON.parse(prop),
type: type.toString(),
categoryId: this.isAgain ? JSON.parse(categoryIds) : categoryName
}
let newSku = []
skus.forEach((item) => {
let { image, propertyList } = item
let upload = {
imageList: [image],
defaultImgList: [image]
}
let prop = {}
propertyList.forEach((pItem) => {
prop[pItem.propKey] = pItem.propVal
})
newSku.push({ ...item, ...prop, upload })
})
this.form.saleInfo.sku = newSku
// let newSku = []
// skus.forEach((item) => {
// let { image, propertyList } = item
// let upload = {
// imageList: [image],
// defaultImgList: [image]
// }
// let prop = {}
// propertyList.forEach((pItem) => {
// prop[pItem.propKey] = pItem.propVal
// })
// newSku.push({ ...item, ...prop, upload })
// })
// this.form.saleInfo.sku = newSku
this.form.saleInfo = {
originalPrice: skus[0].originalPrice,
weight: skus[0].weight,
nftSalesType: skus[0].nftSalesType,
stock: skus[0].stock
}
this.form.saleInfo.commodityPass = commodityPass
this.skuId = skus[0].skuId
this.form.deciptInfo = {
nftFile,
nftEnclosureList: [nftFile],
......@@ -303,7 +307,6 @@ export default {
this.form.baseInfo.coinName = labelName
this.commodityPassId = commodityPassId
this.availableNumber = availableNumber
this.form.goodsId = goodsId
this.routeName = routeName
if (routeName == 'commodity_update_good' || routeName == 'commodity_good_detail' || routeName == 'commodity_again_good') {
......@@ -329,6 +332,7 @@ export default {
republish: '',
skuId: '',
stock: '',
weight: '',
commodityPassId: ''
}],
packageDTO: {},
......@@ -462,11 +466,12 @@ export default {
form.skuList.forEach(item => {
item.originalPrice = this.form.saleInfo.originalPrice
item.coinName = this.form.baseInfo.coinName
item.republish = false
item.propertyList = [{ propKey: '规格', propVal: form.name }]
item.propertyList = [{ propKey: '规格', propVal: '默认' }]
item.image = form.thumb
item.nftSalesType = this.form.saleInfo.originalPrice
item.nftSalesType = this.form.saleInfo.nftSalesType
item.weight = this.form.saleInfo.weight
item.commodityPassId = this.commodityPassId
item.skuId = this.skuId
item.stock = item.nftSalesType == 1 ? this.availableNumber : this.form.saleInfo.stock
})
}
......@@ -478,21 +483,21 @@ export default {
let apiName = this.isAdd ? 'addGood' : this.isAgain ? 'republishGood' : 'updateGood'
let title = this.isAdd ? '添加成功!' : this.isAgain ? '重新发布成功!' : '编辑成功!'
console.log('form', form)
// this.submitLoading = true
// this.api({
// apiName,
// postdata: form,
// success: (res) => {
// // 关闭当前标签页
// let route = this.$route
// let toRouteName = 'product_list'
// this.closeTag({ route, toRouteName })
// this.$Notice.success({ title })
// },
// complete: () => {
// this.submitLoading = false
// }
// })
this.submitLoading = true
this.api({
apiName,
postdata: form,
success: (res) => {
// 关闭当前标签页
let route = this.$route
let toRouteName = 'product_list'
this.closeTag({ route, toRouteName })
this.$Notice.success({ title })
},
complete: () => {
this.submitLoading = false
}
})
}
},
......
......@@ -2,24 +2,24 @@
<info-con title="销售信息:" class="sale-info-con">
<div class="item">
<label class="label">销售价格:</label>
<Input v-model="data.originalPrice" :readonly='isDetail || isEdit' type="number" style="width: 400px;">
<Input v-model="data.originalPrice" :readonly='isDetail' type="number" style="width: 400px;">
</Input>
</div>
<div class="item">
<label class="label">商品重量:</label>
<Input v-model="data.weight" :readonly='isDetail || isEdit' type="number" style="width: 400px;">
<Input v-model="data.weight" :readonly='isDetail' type="number" style="width: 400px;">
</Input>
</div>
<div class="item">
<label class="label">NFT销售方式:</label>
<RadioGroup v-model="data.nftSalesType">
<Radio :label="1" style="width:200px" :disabled="isDetail || isEdit">原商品销售</Radio>
<Radio :label="2" style="width:200px" :disabled="isDetail || isEdit">使用权销售</Radio>
<Radio :label="1" style="width:200px" :disabled="isDetail || isEdit || isAgain">原商品销售</Radio>
<Radio :label="2" style="width:200px" :disabled="isDetail || isEdit || isAgain">使用权销售</Radio>
</RadioGroup>
</div>
<div class="item" v-if="data.nftSalesType==2">
<label class="label">拷贝数量:</label>
<Input v-model="data.stock" :readonly='isDetail || isEdit' style="width: 400px;">
<Input v-model="data.stock" :readonly='isDetail || isEdit|| isAgain' style="width: 400px;">
</Input>
</div>
</info-con>
......
......@@ -305,7 +305,7 @@ export default {
requestData () {
this.loading = true
this.api({
apiName: 'getGoodList',
apiName: 'getGoodCheckList',
postdata: this.searchContent,
complete: () => {
this.loading = false
......
......@@ -523,19 +523,19 @@ export default {
handleUpdate (row) {
return () => {
let query = { goodsId: row.goodsId }
this.$router.push({ name: 'update_good', query })
this.$router.push({ name: row.commodityPass == 3 ? 'commodity_update_good' : 'update_good', query })
}
},
handleAgain (row) {
return () => {
let query = { goodsId: row.goodsId }
this.$router.push({ name: 'again_good', query })
this.$router.push({ name: row.commodityPass == 3 ? 'commodity_again_good' : 'again_good', query })
}
},
handleDetail (row) {
return () => {
let query = { goodsId: row.goodsId }
this.$router.push({ name: 'good_detail', query })
this.$router.push({ name: row.commodityPass == 3 ? 'commodity_good_detail' : 'good_detail', query })
}
},
handleOffShelf (row) {
......
......@@ -139,7 +139,7 @@ export default {
apiName: 'bannerDetail',
postdata: operationBannerId,
success: (res) => {
console.log(res)
// console.log(res)
let { bannerName, bannerType, bannerImage, displayOrder, number, url, operationBannerId, updateTime } = res.data
this.form.bannerName = bannerName
this.form.bannerType = bannerType
......@@ -214,6 +214,7 @@ export default {
}
if (!errMsg) {
form.bannerType = JSON.parse(form.bannerType)
form.number = form.number.replace(/\s+/g, '')
}
let apiName = this.isAdd ? 'addBanner' : 'updateBanner'
let title = this.isAdd ? '添加成功!' : '编辑成功!'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment