This commit is contained in:
zmj 2024-05-20 16:01:11 +08:00
parent b7be7ef93e
commit 04abb8b1b9
2 changed files with 13 additions and 7 deletions

View File

@ -320,12 +320,10 @@
url: '/pages/product/list/index'
})
},
addGoods(item = {}) {
item = (JSON.stringify(item));
addGoods(item) {
uni.navigateTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfoId=${item.id}&&name=${this.searchGoodsName}`
})
return
},
initShop(item) {
if (item.spec == '' || item.spec == undefined || item.spec == null) {

View File

@ -271,6 +271,9 @@
</template>
<script>
import {
seachBarCodeAPI
} from '@/api/api.js'
import {
Toast,
Modal
@ -732,14 +735,19 @@
},
initFormData(option) {
async initFormData(option) {
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
this.mer_id = option.mer_id
if (option.formData) {
this.formData = JSON.parse(option.formData)
}
if (option.goodsInfo) {
let goods = JSON.parse(option.goodsInfo)
if (option.goodsInfoId) {
let res = await await seachBarCodeAPI({
id: option.goodsInfoId,
name: option.name
})
let goods = res.data.list[0]
console.log(goods)
this.formData.store_name = goods.store_name
this.formData.imageList = [goods.image, ...goods.slider_image]