This commit is contained in:
cc_zbp 2023-06-01 09:41:14 +08:00
commit 87092eb46f
10 changed files with 94 additions and 59 deletions

View File

@ -26,8 +26,8 @@ export function seachBarCodeAPI(data) {
* 获取里海云仓商品 * 获取里海云仓商品
* *
*/ */
export function getProductSpuAPI(id) { export function getProductSpuAPI(id, param) {
return request.get(`product/spu/cloud_merchant/${id}`, {}, { noAuth: true }); return request.get(`product/spu/cloud_merchant/${id}`, param, { noAuth: true });
} }
//获取云仓库店铺id //获取云仓库店铺id
export function get_cloud_shop(street_code) { export function get_cloud_shop(street_code) {

View File

@ -652,6 +652,7 @@
"path": "index", "path": "index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true,
"navigationBarTitleText": "店铺diy首页" "navigationBarTitleText": "店铺diy首页"
// #ifdef MP // #ifdef MP
, ,
@ -662,9 +663,10 @@
"path": "home/index", "path": "home/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "店铺首页" "navigationBarTitleText": "店铺首页",
"enablePullDownRefresh": true
// #ifdef MP // #ifdef MP
, ,
"navigationBarTextStyle": "#FFFFFF" "navigationBarTextStyle": "#FFFFFF"
// #endif // #endif
} }
@ -672,6 +674,7 @@
{ {
"path": "detail/index", "path": "detail/index",
"style": { "style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "店铺详情" "navigationBarTitleText": "店铺详情"
} }
}, },

View File

@ -107,7 +107,6 @@
onLoad(e) { onLoad(e) {
this.mer_id = e.mer_id this.mer_id = e.mer_id
this.stype = e.stype this.stype = e.stype
console.log(this.stype);
if (this.stype == 1) { if (this.stype == 1) {
return this.goodsData[0].name = '商品添加' return this.goodsData[0].name = '商品添加'
} }
@ -126,7 +125,6 @@
addGoodsopen() { addGoodsopen() {
if (this.item) { if (this.item) {
post_product_import(this.item.product_id).then(e => { post_product_import(this.item.product_id).then(e => {
console.log(e)
if (e.status == 200) { if (e.status == 200) {
Toast(e.data.msg) Toast(e.data.msg)
this.addGoodsShow = false this.addGoodsShow = false
@ -140,7 +138,6 @@
Toast('已经导入过该商品了') Toast('已经导入过该商品了')
this.addGoodsShow = false this.addGoodsShow = false
} }
console.log(err);
}) })
} }
this.item = [] this.item = []
@ -186,14 +183,30 @@
} }
}, },
navigato(type) { navigato(type) {
type === 1 ? this.searchGoodsShow = true : this.scanCode(); if (type === 1) {
if (this.stype == 1) {
uni.navigateTo({
url: '/pages/product/addGoods/index'
});
return;
}
this.searchGoodsShow = true
} else {
this.scanCode();
}
}, },
scanCode() { scanCode() {
const self = this const self = this
uni.scanCode({ uni.scanCode({
scanType: ["qrCode", "barCode", "datamatrix", "pdf417"], scanType: ["qrCode", "barCode", "datamatrix", "pdf417"],
success(res) { success(res) {
self.seachBarCode(res.result) if (self.stype == 1) {
uni.navigateTo({
url: `/pages/product/addGoods/index?mer_id=${self.mer_id}&code=${res.result}`
})
} else {
self.seachBarCode(res.result)
}
}, },
fail(res) { fail(res) {
@ -202,7 +215,6 @@
}) })
}, },
async seachBarCode(code) { async seachBarCode(code) {
console.log(code);
const { const {
data data
} = await seachBarCodeAPI({ } = await seachBarCodeAPI({
@ -215,25 +227,7 @@
}) })
return return
} }
console.log(data.list[0]); this.goods = data.list
post_product_import(data.list[0].product_id).then(e => {
console.log(e)
if (e.status == 200) {
Toast(e.data.msg)
this.addGoodsShow = false
if (e.status == 400) {
Toast(e.message)
this.addGoodsShow = false
}
}
}).catch(err => {
if (err == "已经导入过该商品了") {
Toast('已经导入过该商品了')
this.addGoodsShow = false
}
console.log(err);
})
// this.goods = data.list
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {

View File

@ -411,6 +411,7 @@
if (this.step == 2) { if (this.step == 2) {
this.secoundModel = !this.secoundModel; this.secoundModel = !this.secoundModel;
} }
this.initClasiffy();
}, },
watch: { watch: {
@ -431,6 +432,10 @@
}, },
methods: { methods: {
// //
async initClasiffy() {
//
this.merchantClassification = (await storeClassifyLst(this.merId)).data;
},
async initData() { async initData() {
if (getStorage('addGoodsFormData')) { if (getStorage('addGoodsFormData')) {
this.setFormData = getStorage('addGoodsFormData'); this.setFormData = getStorage('addGoodsFormData');
@ -438,9 +443,6 @@
} }
// //
this.brand = (await categoryBrandlist(this.merId)).data; this.brand = (await categoryBrandlist(this.merId)).data;
//
this.merchantClassification = (await storeClassifyLst(this.merId)).data;
console.log( this.merchantClassification = (await storeClassifyLst(this.merId)).data);
// //
this.platformClassificationData = (await categoryList(this.merId)).data; this.platformClassificationData = (await categoryList(this.merId)).data;
// //
@ -610,8 +612,7 @@
// //
handleGetSelectStore(item) { handleGetSelectStore(item) {
this.setFormData.mer_cate_id = item.map(val => val.value); this.setFormData.mer_cate_id = item.map(val => val.store_category_id);
console.log(item);
this.setFormData.mer_cate_name = item.map(val => val.cate_name).join(','); this.setFormData.mer_cate_name = item.map(val => val.cate_name).join(',');
this.$refs.select_store.close(); this.$refs.select_store.close();
}, },
@ -772,6 +773,7 @@
// //
handleNextStep() { handleNextStep() {
console.log(this.setFormData.setSpecificaValue)
let canJumpFlag = true; let canJumpFlag = true;
let requireData = { let requireData = {
image: '请选择主图', image: '请选择主图',

View File

@ -39,28 +39,28 @@
{ {
id: 1, id: 1,
label: '售价', label: '售价',
type: 'input', type: 'digit',
model: 'price', model: 'price',
holder: '请填写售价' holder: '请填写售价'
}, },
{ {
id: 2, id: 2,
label: '成本价', label: '成本价',
type: 'input', type: 'digit',
holder: '请填写成本价', holder: '请填写成本价',
model: 'cost' model: 'cost'
}, },
{ {
id: 3, id: 3,
label: '原价', label: '原价',
type: 'input', type: 'digit',
holder: '请填写原价', holder: '请填写原价',
model: 'ot_price' model: 'ot_price'
}, },
{ {
id: 4, id: 4,
label: '库存', label: '库存',
type: 'input', type: 'number',
holder: '请填写库存', holder: '请填写库存',
model: 'stock' model: 'stock'
} }
@ -76,28 +76,28 @@
{ {
id: 6, id: 6,
label: '重量', label: '重量',
type: 'input', type: 'digit',
holder: '请输入重量', holder: '请输入重量',
model: 'weight' model: 'weight'
}, },
{ {
id: 7, id: 7,
label: '体积', label: '体积',
type: 'input', type: 'digit',
holder: '请输入体积', holder: '请输入体积',
model: 'volume' model: 'volume'
}, },
{ {
id: 8, id: 8,
label: '佣金(一级)', label: '佣金(一级)',
type: 'input', type: 'digit',
holder: '请输入一级佣金', holder: '请输入一级佣金',
model: 'extension_one' model: 'extension_one'
}, },
{ {
id: 8, id: 8,
label: '佣金(二级)', label: '佣金(二级)',
type: 'input', type: 'digit',
holder: '请输入二级佣金', holder: '请输入二级佣金',
model: 'extension_two' model: 'extension_two'
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container_input"> <view class="container_input">
<view class="container_input_item" v-for="(item, index) in platformClassification" :key="index" @click="selectItem(item)" v-if="!item.DoNotShow"> <view class="container_input_item" v-for="(item, index) in platformClassification" :key="index" @click="selectItem(item)" v-if="!item.DoNotShow">
<view class="select_and_input" v-if="item.type == 'select' || item.type == 'input' || item.type == 'switch'"> <view class="select_and_input" v-if="item.type == 'select' || item.type == 'input' || item.type == 'switch' || item.type == 'number'">
<view class="container_input_item_label"> <view class="container_input_item_label">
<text class="select_check" :class="{ select: item.select }" @click.stop="selectRadio(item)" v-if="Object.keys(item).indexOf('select') != -1"> <text class="select_check" :class="{ select: item.select }" @click.stop="selectRadio(item)" v-if="Object.keys(item).indexOf('select') != -1">
<text v-if="item.select" class="iconfont">&#xe646;</text> <text v-if="item.select" class="iconfont">&#xe646;</text>
@ -13,6 +13,12 @@
<text v-else>{{ item.holder }}</text> <text v-else>{{ item.holder }}</text>
<text class="iconfont">&#xe6bd;</text> <text class="iconfont">&#xe6bd;</text>
</view> </view>
<view class="container_input_item_value" v-if="item.type == 'number'">
<input v-model="formData[item.model]" type="number" value="" :placeholder="item.holder" placeholder-class="inputPlaceHolder" />
</view>
<view class="container_input_item_value" v-if="item.type == 'digit'">
<input v-model="formData[item.model]" type="digit" value="" :placeholder="item.holder" placeholder-class="inputPlaceHolder" />
</view>
<view class="container_input_item_value" v-if="item.type == 'input'"> <view class="container_input_item_value" v-if="item.type == 'input'">
<input v-model="formData[item.model]" type="text" value="" :placeholder="item.holder" placeholder-class="inputPlaceHolder" /> <input v-model="formData[item.model]" type="text" value="" :placeholder="item.holder" placeholder-class="inputPlaceHolder" />
</view> </view>

View File

@ -16,7 +16,7 @@
<view class="selectList_tap"> <view class="selectList_tap">
<view class="selectList_tap_item" v-for="(item, index) in tapList" :key="index" <view class="selectList_tap_item" v-for="(item, index) in tapList" :key="index"
@click="selectTapItem(item, index)" :class="{ selectTap: selectTap == item.value }"> @click="selectTapItem(item, index)" :class="{ selectTap: selectTap == item.value }">
{{ item.label }} {{ item.cate_name }}
</view> </view>
<view class="selectList_tap_item" @click="selectTapLastItem(-1)" v-if="isShowLastItem" <view class="selectList_tap_item" @click="selectTapLastItem(-1)" v-if="isShowLastItem"
:class="{ selectTap: selectTap == -1 }">请选择</view> :class="{ selectTap: selectTap == -1 }">请选择</view>

View File

@ -41,10 +41,9 @@ export default {
}, },
onLoad(options) { onLoad(options) {
this.mer_id = options.mer_id this.mer_id = options.mer_id
this.getStoreClassification()
}, },
onShow: function() { onShow: function() {
this.getStoreClassification()
}, },
methods: { methods: {
deleteItem(item,index) { deleteItem(item,index) {
@ -80,7 +79,6 @@ export default {
}); });
storeClassifyLst(this.mer_id).then( storeClassifyLst(this.mer_id).then(
res => { res => {
console.log(res);
uni.hideLoading(); uni.hideLoading();
that.storeClassList = res.data; that.storeClassList = res.data;
}, },

View File

@ -525,7 +525,7 @@
order: '', order: '',
keyword: '', keyword: '',
page: 1, page: 1,
limit: 30 limit: 10
}, },
// //
select: { select: {
@ -723,6 +723,7 @@
// #endif // #endif
} }
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
}, },
onShow() { onShow() {
@ -730,6 +731,7 @@
onReady: function() { onReady: function() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
@ -766,11 +768,34 @@
}).exec(); }).exec();
}, },
methods: { methods: {
async getProductSpu() { getProductSpu() {
console.log('获取云仓商品', this.id); let that = this;
const { data } = await getProductSpuAPI(this.id) if (that.loadend) return;
this.goods = data.list if (that.loading) return;
console.log('data', data); if (that.goodsLoading) return;
that.goodsLoading = true;
that.loadTitle = '';
getProductSpuAPI(that.id, that.where).then(res => {
that.goodsLoading = false;
let list = res.data.list;
let goodsList = that.$util.SplitArray(list, that.goods);
let loadend = list.length < that.where.limit;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
that.$set(that, 'goods', goodsList);
that.$set(that.where, 'page', that.where.page + 1);
}).catch(err => {
that.loading = false;
that.goodsLoading = false;
uni.showToast({
title: err,
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000);
});
}, },
//#ifndef H5 //#ifndef H5
call: function() { call: function() {
@ -786,7 +811,11 @@
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query.select('#goods').boundingClientRect(data => { query.select('#goods').boundingClientRect(data => {
if (data.bottom < 1500 && data.top < 0) { if (data.bottom < 1500 && data.top < 0) {
this.getGoods(); if (this.tabActive == 7) {
this.getProductSpu()
} else {
this.getGoods();
}
} }
}).exec(); }).exec();
// //
@ -1164,10 +1193,13 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('123');
// //
setTimeout(() => { setTimeout(() => {
const newList = this.goods.reverse(); const newList = this.goods.reverse();
this.goods = newList; this.goods = newList;
this.getProductSpu()
// uni.startPullDownRefresh();
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 500) }, 500)
} }

View File

@ -102,12 +102,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="item"> <!-- <view class="item">
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<text class="item-name">是否农贸市场</text> <text class="item-name">是否农贸市场</text>
<u-switch v-model="isnm" @change="change" activeColor="#42CA4C"></u-switch> <u-switch v-model="isnm" @change="change" activeColor="#42CA4C"></u-switch>
</view> </view>
</view> </view> -->
<view class="item no-border"> <view class="item no-border">
<view class='acea-row row-middle'> <view class='acea-row row-middle'>
<text class="item-title">请上传营业执照及行业相关资质证明图片</text> <text class="item-title">请上传营业执照及行业相关资质证明图片</text>
@ -302,9 +302,9 @@
onReady() {}, onReady() {},
methods: { methods: {
// //
change(e) { // change(e) {
this.isnum = (e === true ? 1 : 0) // this.isnum = (e === true ? 1 : 0)
}, // },
// //
getVillage(e) { getVillage(e) {
const self = this; const self = this;