This commit is contained in:
cc_zbp 2023-05-19 18:44:25 +08:00
parent 86868b3957
commit 86f776c449
5 changed files with 28 additions and 16 deletions

View File

@ -9,6 +9,11 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import request from "@/utils/request.js"; import request from "@/utils/request.js";
/**
* 获取商品详情
*/
export const getProductDetailsAPI = (data) => request.get('micro/product_details', data)
/** /**
* 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4 * 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4
*/ */

View File

@ -905,6 +905,13 @@
"navigationBarTitleText": "商户基本设置", "navigationBarTitleText": "商户基本设置",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "addGoods/addMyStore",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
] ]
}, },

View File

@ -9,7 +9,7 @@
</block> </block>
</view> </view>
<view class="goods-wrapper wrapper"> <view class="goods-wrapper wrapper" v-if="goods.length">
<block v-for="(item,index) in goods" :key="index"> <block v-for="(item,index) in goods" :key="index">
<view class="item"> <view class="item">
<view class="l_cont"> <view class="l_cont">
@ -17,6 +17,7 @@
</view> </view>
<view class="r_cont"> <view class="r_cont">
<text>{{item.store_name}}</text> <text>{{item.store_name}}</text>
<view class="addBtn" @click="addGoods(item)">加入仓库</view>
</view> </view>
</view> </view>
</block> </block>
@ -61,6 +62,7 @@
</template> </template>
<script> <script>
import { productCreate } from '@/api/product.js'
import { microSeachBarCode, microEadtProduct } from '@/api/store.js' import { microSeachBarCode, microEadtProduct } from '@/api/store.js'
import { seachBarCodeAPI } from '@/api/api.js' import { seachBarCodeAPI } from '@/api/api.js'
import { Toast } from '@/libs/uniApi' import { Toast } from '@/libs/uniApi'
@ -84,27 +86,30 @@
editGoodsPrice: '', editGoodsPrice: '',
editGoodsStore: '', editGoodsStore: '',
editGoodsShow: false, // editGoodsShow: false, //
mer_id: '', mer_id: 318,
searchGoodsShow: true, searchGoodsShow: false,
searchGoodsName: '', searchGoodsName: '摩托',
goods: [] goods: []
} }
}, },
onLoad(e) { onLoad(e) {
this.mer_id = e.mer_id this.mer_id = e.mer_id
this.searchGoodsClose()
}, },
onShow() {}, onShow() {},
methods: { methods: {
openSearch() { addGoods(item) {
uni.navigateTo({
url: `/pages/product/addGoods/addMyStore?mer_id=${this.mer_id}&product_id=${item.product_id}`
})
}, },
openSearch() {},
async searchGoodsClose() { async searchGoodsClose() {
const rq = { const rq = {
mer_id: this.mer_id, mer_id: this.mer_id,
name: this.searchGoodsName name: this.searchGoodsName
} }
const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err)) const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err))
console.log('data', data);
this.goods = data.list this.goods = data.list
this.searchGoodsShow = false this.searchGoodsShow = false
}, },
@ -122,12 +127,9 @@
Toast("更新失败") Toast("更新失败")
this.editGoodsShow = false this.editGoodsShow = false
} }
}, },
navigato(type) { navigato(type) {
type === 1 ? uni.navigateTo({ type === 1 ? this.searchGoodsShow = true : this.scanCode();
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}`
}) : this.scanCode();
}, },
scanCode() { scanCode() {
const self = this const self = this

View File

@ -382,14 +382,14 @@
}; };
}, },
onLoad(opt) { onLoad(opt) {
this.merId = opt.mer_id; this.merId = Number(opt.mer_id);
this.product_id = opt.product_id; this.product_id = opt.product_id;
if (opt.code) { if (opt.code) {
this.code = opt.code; this.code = opt.code;
this.bar_code_dis = true this.bar_code_dis = true
} }
this.getDeliveryType();
this.initData(); this.initData();
this.getDeliveryType();
if (this.product_id) { if (this.product_id) {
this.initDataEditData(); this.initDataEditData();
} }
@ -499,7 +499,6 @@
temp_id: '', // ID temp_id: '', // ID
tempName: '' // tempName: '' //
}; };
if (getStorage('editGoodsDetils')) { if (getStorage('editGoodsDetils')) {
removeStorage('editGoodsDetils'); removeStorage('editGoodsDetils');
} }

View File

@ -37,7 +37,7 @@
</template> </template>
<script> <script>
import { serialize, Toast } from '../../../libs/uniApi.js'; import { serialize, Toast } from '@/libs/uniApi.js';
export default { export default {
props: { props: {
allReadySelect: { allReadySelect: {
@ -77,7 +77,6 @@
}, },
created() { created() {
this.areaList = serialize(this.classifiedData); this.areaList = serialize(this.classifiedData);
console.log(this.areaList);
}, },
methods: { methods: {