商品发布

This commit is contained in:
zmj 2024-04-24 18:11:06 +08:00
parent 5b7783d015
commit 6dff85d544
9 changed files with 2149 additions and 1731 deletions

View File

@ -1,13 +1,14 @@
<template>
<view class='product-bg'>
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :circular="circular"
:interval="interval" :duration="duration" @change="change" v-if="isPlay">
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay"
:circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS -->
<swiper-item v-if="videoline && videoline != '' && videoline != 'https:'">
<view class="item">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
auto-pause-if-navigate @ended="endedFun()"></video>
<video id="myVideo"
:src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
auto-pause-if-navigate @ended="endedFun()"></video>
<view class="poster" v-if="controls">
<image class="image" :src="videoCoverImg"></image>
</view>
@ -37,9 +38,11 @@
</swiper>
<!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline'
objectFit="cover" controls style="width:100%;height:100% " show-center-play-btn show-mute-btn="true"
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video>
<video id="myVideo"
:src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline'
objectFit="cover" controls style="width:100%;height:100% " show-center-play-btn show-mute-btn="true"
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause"
@ended="endedFun()"></video>
</view>
<!-- #endif -->
@ -119,7 +122,7 @@
// #ifdef APP-PLUS
this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(()=>{
this.$nextTick(() => {
this.videoContext.play();
})
// #endif
@ -140,15 +143,18 @@
height: 750rpx;
position: relative;
}
.product-bg swiper {
width: 100%;
height: 100%;
position: relative;
}
.product-bg .slide-image {
width: 100%;
height: 100%;
}
.product-bg .pages {
position: absolute;
background-color: #fff;
@ -161,15 +167,18 @@
font-size: 24rpx;
color: #050505;
}
#myVideo {
width: 100%;
height: 100%
}
.product-bg .item {
position: relative;
width: 100%;
height: 100%;
}
.product-bg .item .poster {
position: absolute;
top: 0;
@ -178,10 +187,12 @@
width: 100%;
z-index: 9;
}
.product-bg .item .poster .image {
width: 100%;
height: 100%;
}
.product-bg .item .stop {
position: absolute;
top: 50%;
@ -192,6 +203,7 @@
margin-left: -68rpx;
z-index: 9;
}
.product-bg .item .stop .image {
width: 100%;
height: 100%;

View File

@ -0,0 +1,210 @@
<template>
<view class='product-bg'>
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :current='current'
:circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS -->
<swiper-item v-if="videoline && videoline != '' && videoline != 'https:'" v-for="(item,index) in videoline">
<view class="item">
<video id="myVideo" :src='item' objectFit="cover" style="width:100%;height:100% "
show-mute-btn="true" auto-pause-if-navigate @ended="endedFun()"></video>
<view class="poster" v-if="controls">
<image class="image" :src="videoCoverImg"></image>
</view>
<view class="stop" v-if="controls" @tap="bindPause" style="width: 100rpx;height: 100rpx;">
<!-- <image class="image" src="../../static/images/stop.png"></image> -->
</view>
</view>
</swiper-item>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<swiper-item v-if="videoline">
<!-- <view class="item">
<view class="poster" v-show="controls">
<image class="image" :src="videoCoverImg"></image>
</view>
<view class="stop" v-show="controls" @tap="bindPause">
<image class="image" src="../../static/images/stop.png"></image>
</view>
</view> -->
</swiper-item>
<!-- #endif -->
<block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' />
</swiper-item>
</block>
</swiper>
<!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;">
<!-- <!-- <video id="myVideo" :src='videoline[current]' objectFit="cover" controls style="width:100%;height:100% "
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :enable-progress-gesture="false"
:poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video> -->
<video id="myVideo1" :src='videoline[current]' objectFit="cover" controls style="width:100%;height:100% "
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :enable-progress-gesture="false"
:poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video> -->
</view>
<!-- #endif -->
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
export default {
props: {
imgUrls: {
type: Array,
default: function() {
return [];
}
},
videoline: {
type: Array,
value: ""
},
videoCoverImg: {
type: String,
}
},
data() {
return {
current: "",
indicatorDots: true,
circular: true,
autoplay: true,
interval: 5000,
duration: 500,
currents: "1",
controls: true,
isPlay: true,
videoContext: ''
};
},
created() {
},
watch: {
},
mounted() {
// #ifndef APP-PLUS
this.videoContext = uni.createVideoContext('myVideo', this);
// #endif
},
methods: {
getpreviewImage: function(item) {
uni.previewImage({
urls: this.imgUrls,
current: item
});
},
videoPause(e) {
// #ifdef APP-PLUS
this.isPlay = true
this.autoplay = true
// #endif
},
bindPause: function() {
// #ifndef APP-PLUS
this.videoContext.play();
this.$set(this, 'controls', false)
this.autoplay = false
// #endif
// #ifdef APP-PLUS
this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(() => {
this.videoContext.play();
})
// #endif
},
change: function(e) {
this.$set(this, 'currents', e.detail.current + 1);
},
endedFun() {
this.controls = true
}
}
}
</script>
<style scoped lang="scss">
.product-bg {
width: 100%;
height: 750rpx;
position: relative;
}
.product-bg swiper {
width: 100%;
height: 100%;
position: relative;
}
.product-bg .slide-image {
width: 100%;
height: 100%;
}
.product-bg .pages {
position: absolute;
background-color: #fff;
height: 34rpx;
padding: 0 10rpx;
border-radius: 3rpx;
right: 30rpx;
bottom: 30rpx;
line-height: 34rpx;
font-size: 24rpx;
color: #050505;
}
#myVideo {
width: 100%;
height: 100%
}
.product-bg .item {
position: relative;
width: 100%;
height: 100%;
}
.product-bg .item .poster {
position: absolute;
top: 0;
left: 0;
height: 750rpx;
width: 100%;
z-index: 9;
}
.product-bg .item .poster .image {
width: 100%;
height: 100%;
}
.product-bg .item .stop {
position: absolute;
top: 50%;
left: 50%;
width: 136rpx;
height: 136rpx;
margin-top: -68rpx;
margin-left: -68rpx;
z-index: 9;
}
.product-bg .item .stop .image {
width: 100%;
height: 100%;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
<template>
<view class="select_warehouse">
<view class="wrapper flex_a_c_j_sb">
<!-- <view class="wrapper flex_a_c_j_sb">
<block v-for="item in goodsData" :key="item.name">
<view class="select_item select_item1" @click="navigato(item.type)" :class="'select_item'+item.type">
<view class="title">{{ item.name }}</view>
<!-- <view class="iconfont icon-jiantou"></view> -->
{{item.type}}
<image class="img" :src="item.src"></image>
</view>
</block>
</view>
</view> -->
<view v-if="pageType==1" class="list-box-put">
<view class="item" v-for="(item, index) in goods" :key="index">
<view class="top">
@ -217,19 +217,16 @@
goodsData: [{
name: '搜索名称入库',
type: 1,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/mingcheng.png'
src: '/static/images/SMRK/name.png'
},
{
name: '标品扫码入库',
type: 2,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/saoma.png'
src: '/static/images/SMRK/bar.png'
},
{
name: '非标手动入库',
type: 3,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/saoma.png'
src: '/static/images/SMRK/img.png'
}
],
@ -295,6 +292,9 @@
this.mer_id = e.mer_id
this.userInfo = this.$store.state.app.userInfo;
if (typeof this.userInfo == 'string') this.userInfo = JSON.parse(this.userInfo);
if (e.type) {
this.navigato(e.type)
}
// if(this.userInfo.mer_info.type_code=='PersonalStore'){
// this.goodsData = [{
// name: '',
@ -624,7 +624,7 @@
}
},
navigato(type) {
if (type === 1) {
if (type == 1) {
this.searchGoodsName = '';
this.searchGoodsShow = true;
this.pageType = 1;

View File

@ -67,17 +67,17 @@
</view>
</u-form-item>
<u-form-item label="零售价格" prop="userInfo.name" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 220rpx;"
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入零售价" type='number' v-model="formData.attrValue[0].price"
slot='right'></u--input>
</u-form-item>
<u-form-item v-if='isWholeSale' label="批发价格" prop="userInfo.name" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 250rpx;"
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入批发价格" type='number' v-model="formData.attrValue[0].wholesale_price"
slot='right'></u--input>
</u-form-item>
<u-form-item label="商品库存" prop="userInfo.name" ref="item1">
<u--input inputAlign='right' type='number' placeholderStyle="color:#777777" style="width: 220rpx;"
<u--input inputAlign='right' type='number' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入库存" v-model="formData.attrValue[0].stock" slot='right'></u--input>
</u-form-item>
</view>
@ -97,6 +97,7 @@
<u-button text="立即发布获取订单" color="#33BB3C" class="custom-style"></u-button>
</view>
</u--form>
<u-popup :show="showPouple" @close="showPouple=false" @open="showPouple=true" :round="10">
<view class="RegularFont" style="padding: 42rpx 40rpx">
<view class="pop-head">
@ -129,6 +130,10 @@
</view>
</view>
</u-popup>
<u-picker :show="show" :columns="columns" confirmColor='#33BB3C' @close='show=false' @confirm='choseMedia'
@cancel='show=false'></u-picker>
@ -202,7 +207,7 @@
}, ],
"attrValue": [{
detail: {
规格名: 'attr[index]value',
规格名: '',
},
"price": "",
"unit_name": "",
@ -415,27 +420,19 @@
let that = this
uni.previewImage({
urls: [url],
// longPressActions: {
// itemList: ['', '', ''],
// success: function(data) {
// console.log('' + (data.tapIndex + 1) + ',' + (data.index + 1) + '');
// },
// fail: function(err) {
// console.log(err.errMsg);
// }
// }
});
},
handAdd() {
let data = uni.$u.deepClone(this.formData)
data.image = data.imageList[0]
data.slider_image = data.imageList.splice(0, 1)
data.image = data.imageList.find(item => {
return !this.vidioTypeList.includes(this.getSuffix(item))
})
data.slider_image = this.formData.imageList.filter((item, index) => index != 0)
data.store_name = data.cate_name
productCreate(this.mer_id, data)
.then(res => {
console.log("提交成功")
// hideLoading();
Modal('提交成功', '点击确定,前往商品列表页面').then(() => {
if (this.import == 1) {
uni.$emit('importAttrValueOK', this.setFormData.import_id);
@ -457,6 +454,7 @@
this.$refs.formData.validate().then(res => {
this.handAdd()
}).catch(errors => {
console.log(errors)
uni.$u.toast(errors[0].message)
})

View File

@ -14,16 +14,15 @@
<u-form-item label="商品主图" prop="formData.imageList" ref="item1" required>
<text style="color: #E18C34;font-size: 24rpx">上传时应注重真实性清晰度</text>
<!-- {{formData.imageList}}
{{formData.content.image}} -->
</u-form-item>
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
<view class="" style="display: flex;flex-wrap: wrap;">
<view v-for="(item,index) in formData.imageList"
style="margin-right: 20rpx;margin-bottom: 20rpx;">
<view class="video_list" v-if='vidioTypeList.includes(getSuffix(item))'>
<view class="video_list_item photo" style="position: relative;">
<view class="jiao" @click="formData.imageList.splice(index,1)">
<view class="jiao">
<!-- video标签在app端层级过高 -->
<!--#ifndef APP-PLUS-->
<video :src="item"></video>
@ -32,7 +31,8 @@
<img src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/3/video_bg.png"
style=" width:150rpx"></img>
<!--#endif-->
<image src="@/static/images/gban.png" mode="widthFix"></image>
<image @click="formData.imageList.splice(index,1)"
src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<view style="position: absolute;top: 20rpx;z-index: 99;width: 140rpx;height: 100%;"
@click="videoshow(index)">
@ -43,13 +43,18 @@
</view>
<view class="" style="position: relative;" v-else>
<view class="jiao" @click="formData.imageList.splice(index,1)">
<!-- <view class="jiao" @click="test(index)"> -->
<image src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<u--image @click="preViewImg(item)" :src="item" :fade="true" duration="450"
width='140rpx' height='140rpx'></u--image>
</view>
</view>
<view class='uploadimg' @click="show=true,isDetail=false">
<!-- <view class='uploadimg'> -->
<u-icon name="plus" color="#777777"></u-icon>
<view class="" style="color: #777777;font-size: 20rpx;">
上传图片/视频
@ -143,30 +148,22 @@
<view class="" v-if="showSet">
<view class="" v-for="(item,index) in formData.attrValue.filter(item=> item.is_use==0)">
<view class="" v-if='formData.attrValue.filter(item=> item.is_use==0).length==1'>
<u-line color="#CECECE" style="margin: 30rpx 0;"></u-line>
<view class="" style="display: flex;justify-content: space-around;">
<view class=""
style="display: flex;justify-content: space-around;flex: 1;border-right: 1px solid #CECECE;">
<text>零售价格</text>
<text>{{item.price}}/{{item.unit_name}}</text>
<u-form-item label="零售价格" label-width="auto" labelPosition="left" border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.price}}/{{item.unit_name}}
</view>
<view class="" style="display: flex;justify-content: space-around;flex: 1;">
<text>商品库存</text>
<text>{{item.stock}}</text>
</u-form-item>
<u-form-item v-if='isWholeSale' label="批发价格" label-width="auto" labelPosition="left"
border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.wholesale_price}}/{{item.wholesale_unit_name}}
</view>
</view>
<u-line color="#CECECE" style="margin: 30rpx 0;" v-if='isWholeSale'></u-line>
<view class="" style="display: flex;justify-content: space-around;" v-if='isWholeSale'>
<view class=""
style="display: flex;justify-content: space-around;flex: 1;border-right: 1px solid #CECECE;">
<text>批发价格</text>
<text>{{item.wholesale_price}}/{{item.wholesale_unit_name}}</text>
</u-form-item>
<u-form-item label="商品库存" label-width="auto" labelPosition="left" border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.stock}}
</view>
<view class="" style="display: flex;justify-content: space-around;flex: 1;">
<text>批发单位</text>
<text>{{item.stock}}</text>
</view>
</view>
</u-form-item>
</view>
<view class="" v-else>
<u-form-item :label="formData.attr[index].value" label-width="350rpx" prop="userInfo.name"
@ -313,7 +310,6 @@
uploadUrl: `${HTTP_REQUEST_URL}/api/upload/video`,
show: false, //
showSet: false,
vidioTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
delivery_way: [],
isWholeSale: false,
formData: {
@ -328,7 +324,7 @@
}, ],
"attrValue": [{
detail: {
规格名: 'attr[index]value',
规格名: '',
},
"price": "",
"unit_name": "",
@ -336,7 +332,7 @@
"wholesale_price": '',
"cost": "",
"stock": "",
sku: 'attr[index]value',
sku: '',
"ot_price": "",
"procure_price": "",
"bar_code": "",
@ -457,7 +453,6 @@
}
}
})
console.log(errList, 'err')
return errList.length == 0
},
message: '请填写完整商品规格',
@ -500,7 +495,10 @@
};
},
methods: {
test(index) {
// this.formData.imageList.splice(index, 1)
console.log(this.formData, index)
},
preViewImg(url) {
let that = this
uni.previewImage({
@ -665,10 +663,10 @@
async handAdd() {
let that = this
let data = uni.$u.deepClone(this.formData)
data.image = data.imageList[0]
data.slider_image = data.imageList.splice(0, 1)
data.store_name = data.cate_name
data.image = data.imageList.find(item => {
return !this.vidioTypeList.includes(this.getSuffix(item))
})
data.slider_image = this.formData.imageList.filter((item, index) => index != 0)
that.formData.product_id ?
productUpdate(that.mer_id, that.formData.product_id, data)
.then(res => {
@ -677,7 +675,7 @@
uni.$emit('importAttrValueOK', this.setFormData.import_id);
uni.navigateBack();
} else uni.redirectTo({
url: `/pages/product/goodsOnSale/index?mer_id=${that.mer_id}&type=6`
url: `/pages/product/list/index?mer_id=${that.mer_id}&type=6`
})
}).catch(() => {
uni.navigateBack()
@ -698,7 +696,9 @@
url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
})
}).catch(() => {
uni.navigateBack()
uni.redirectTo({
url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
})
})
})
.catch(rej => {
@ -706,9 +706,11 @@
})
},
submit() {
// console.log(this.formData)
this.$refs.formData.validate().then(res => {
this.handAdd()
}).catch(errors => {
// console.log(errors)
uni.$u.toast(errors[0].message)
})
@ -724,28 +726,27 @@
onLoad(option) {
// let that = this
this.initFormData(option)
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
let that = this
this.isSet2()
that.formData.delivery_way = that.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
if (option.product_id) {
that.formData.product_id = option.product_id
this.formData.product_id = option.product_id
this.mode = 'edit'
this.showSet = true
productDetail(option.mer_id, option.product_id).then(res => {
this.formData = res.data
//
console.log(res.data)
Object.assign(this.formData, res.data)
this.$set(this.formData, "imageList", res.data.image_list)
this.formData.product_attribute = JSON.parse(this.formData.product_attribute)
this.formData.cate_name = this.formData.storeCategory.cate_name
this.formData.cate_id = this.formData.storeCategory.store_category_id
this.formData.imageList = this.formData.image_list
if (!that.formData.imageList) that.formData.imageList = []
delete this.formData.image_list
if (!this.formData.imageList) this.formData.imageList = []
console.log(this.formData)
})
}
},
onBackPress: function(e) {
this.showlay = true

View File

@ -19,7 +19,8 @@
<view class="" style="flex: 1;text-align: center;">
/
</view>
<u--input style=" flex: 2;width:100rpx;background-color: #F6F6F6;" placeholder="请输入计量单位"
<u--input @focus="unitIptClick(index,false)"
style=" flex: 2;width:100rpx;background-color: #F6F6F6;" placeholder="请输入计量单位"
v-model="item.unit_name"></u--input>
</view>
<view class="" v-if='isWholeSale'
@ -29,8 +30,8 @@
<view class="" style="flex: 1;text-align: center;">
/
</view>
<u--input style=" flex: 2;width:100rpx;background-color: #F6F6F6;" placeholder="请输入计量单位"
v-model="item.wholesale_unit_name"></u--input>
<u--input style=" flex: 2;width:100rpx;background-color: #F6F6F6;" @focus="unitIptClick(index,true)"
placeholder="请输入计量单位" v-model="item.wholesale_unit_name"></u--input>
</view>
</view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
@ -63,6 +64,42 @@
<view class="submit-btn">
<u-button type="primary" shape="circle" text="保存" @click="submit"></u-button>
</view>
<u-popup :show="showPouple" @close="showPouple=false" @open="showPouple=true" :round="10">
<view class="RegularFont" style="padding: 42rpx 40rpx">
<view class="pop-head">
<text v-if='!showCustom' @click='showPouple=false'>取消</text>
<text v-else @click='showCustom=false'>
<u-icon name="arrow-left" size="20"></u-icon>
</text>
<text style="font-size:32rpx ;color:#333333 ;">计量单位</text>
<text v-if='showCustom' @click='addAttr'>确定</text>
<text v-else></text>
</view>
<view style="height: 500rpx;">
<u-transition :show="!showCustom" mode="slide-right">
<view class="goods-leval">
<view class="goods-leval-li" v-for='(item,index) in attrList' :key='index'
@click='choseAttr(item)'>
{{item}}
</view>
<view class="goods-leval-li " style="display: flex;color:#38BE41 ;"
@click="showCustom=true">
<u-icon name="plus" color="#38BE41" style='margin-right: 8rpx;'></u-icon>
</view>
</view>
</u-transition>
<u-transition :show="showCustom" mode="slide-left">
<view class="transition">
<u--textarea v-model="selfAttr" placeholder="请输入计量单位"></u--textarea>
</view>
</u-transition>
</view>
</view>
</u-popup>
</view>
</template>
@ -73,8 +110,28 @@
export default {
data() {
return {
selfAttr: "",
attrList: ['斤',
"公斤",
"吨",
"升",
"个",
"台",
"瓶",
"桶",
"箱",
"袋",
"包",
"盒",
"件",
"罐"
],
showCustom: false, //
showPouple: false,
unitIndex: 0,
mer_id: "",
isWholeSale: "",
isWhose: false,
text: "",
value: "",
formData: {},
@ -111,6 +168,32 @@
}
},
methods: {
choseAttr(name) {
this.isWhose ?
this.attrValue[this.unitIndex].wholesale_unit_name = name :
this.attrValue[this.unitIndex].unit_name = name;
this.showPouple = false
},
addAttr() {
if (!this.selfAttr) return;
this.attrList.push(this.selfAttr)
this.isWhose ?
this.attrValue[this.unitIndex].wholesale_unit_name = this.attrList[this.attrList.length - 1] :
this.attrValue[this.unitIndex].unit_name = this.attrList[this.attrList.length - 1];
// this.attrValue[this.unitIndex].unit_name = this.attrList[this.attrList.length - 1]
// this.attrValue[this.unitIndex].wholesale_unit_name = this.attrList[this.attrList.length - 1]
this.selfAttr = ''
this.showCustom = false
this.showPouple = false
},
unitIptClick(index, type) {
this.isWhose = type
console.log(index)
this.unitIndex = index
this.showPouple = true
},
pushFn() {
this.attrValue.push({
detail: {
@ -264,4 +347,34 @@
width: 670rpx;
}
}
.pop-head {
display: flex;
justify-content: space-between;
color: #20B128;
margin-bottom: 42rpx;
}
.goods-leval {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
.goods-leval-li {
margin-right: 20rpx;
padding: 10rpx 40rpx;
height: 60rpx;
margin-bottom: 20rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-color: #F1F1F1;
}
.act {
color: #20B128;
background-color: #E8F7E9;
border: 1px solid #20B128;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<view>
<view style="padding-bottom: 200rpx;">
<view class="order-index" ref="container">
<view class="search" style="margin-bottom: 24rpx;">
<u-search :showAction="true" actionText="搜索" v-model="keyword" :animation="true"
@ -206,13 +206,13 @@
</view>
<view class="footer">
<view class="footer-li">
<view class="footer-li" @click="handClick(1)">
搜索入库
</view>
<view class="footer-li">
<view class="footer-li" @click="handClick(2)">
扫码入库
</view>
<view class="footer-li act">
<view class="footer-li act" @click="handClick(3)">
发布商品
</view>
</view>
@ -446,6 +446,19 @@
},
methods: {
handClick(type) {
// console.log(type)
if (type == 3) {
uni.navigateTo({
url: `/pages/product/addGood/addGood?mer_id=${this.mer_id}`
})
} else {
uni.navigateTo({
url: `/pages/nongKe/gather/select_warehouse?mer_id=${this.mer_id}&&type=${type}`
})
}
},
Iknow() {
if (this.where.type == 2) {
this.flag = false

View File

@ -12,10 +12,10 @@
<view class="right">
<view class="">
<view class="" style="font-size: 32rpx;color: #444444;">
打扫房间好看
{{short.store_name||short.storeCategory.cate_name}}
</view>
<view class="" style="font-size: 24rpx;color: #989898;margin-top: 10rpx;">
库存 100
库存 {{short.attrValue[0].stock}}
</view>
</view>
<view class="" style="color: #FC452F;font-size: 24rpx;">
@ -25,7 +25,7 @@
</view>
<view class="attr" v-for="(item,index) in short.attrValue" :key="index">
<view class="attr-tit">
{{item.sku}}
{{item.sku||'单规格'}}
</view>
<u-line color="#CECECE" style="margin: 30rpx 0 28rpx 0"></u-line>
<view class="" style="display: flex;justify-content: space-between;font-size: 32rpx;">