商品发布

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,11 +1,12 @@
<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)'
<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">
@ -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'
<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>
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause"
@ended="endedFun()"></video>
</view>
<!-- #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>

View File

@ -1,11 +1,11 @@
<template>
<view class="product-con">
<view v-if="storeInfo && storeInfo.merchant">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true" :style='"height:"+height+"px;"'
@scroll="scroll">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
:style='"height:"+height+"px;"' @scroll="scroll">
<view id="past0">
<productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg"
:videoline="storeInfo.video_link"></productConSwiper>
<productConSwiper :imgUrls="imgUrls" :videoCoverImg="videoCoverImg" :videoline="videoline">
</productConSwiper>
<!--秒杀-->
<view v-if="storeInfo.product_type == 1" class='nav acea-row row-between-wrapper'>
<view class='money'><text class='num'>{{storeInfo.price}}</text><text
@ -13,8 +13,8 @@
<view class='acea-row row-middle'>
<view class='time'>
<view>距秒杀结束仅剩</view>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '"
:second-text="' '" :datatime="datatime"></countDown>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '"
:minute-text="' : '" :second-text="' '" :datatime="datatime"></countDown>
</view>
</view>
</view>
@ -35,7 +35,8 @@
<view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)"
class="font-bg-red">自营</text>
{{storeInfo.store_name}}
</view>
<view class="presell_count">
@ -51,7 +52,8 @@
</view>
<view v-if="storeInfo.presell_type === 2">
<view>支付尾款时间</view>
<view v-if="storeInfo.final_start_time && storeInfo.final_end_time" class="presell_time">
<view v-if="storeInfo.final_start_time && storeInfo.final_end_time"
class="presell_time">
<view class='iconfont icon-shijian1'></view>
{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getMonth()+1 }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getDate() }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getHours() }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getMinutes()}}
<span class='area_line'>~</span>
@ -81,13 +83,15 @@
<view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)"
class="font-bg-red">自营</text>
{{storeInfo.store_name}}
</view>
<view class='label acea-row row-between-wrapper'>
<view>类型:{{storeInfo.buying_count_num ? storeInfo.buying_count_num : 0}}人团</view>
<view>库存:{{storeInfo.stock ? storeInfo.stock : 0}}</view>
<view>已拼:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view>
已拼:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
</view>
</view>
@ -100,8 +104,8 @@
class='line'>|</text>
</view>
<view class='swiper'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
vertical="true" circular="true">
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500"
duration="500" vertical="true" circular="true">
<block v-for="(item,index) in itemNew" :key='index'>
<swiper-item>
<view class='line1'>{{item.nickname ? item.nickname : ''}}拼团成功</view>
@ -115,22 +119,28 @@
v-if="index < AllIndex && pink.length>0">
<view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'>
<image :src='item.initiator.avatar ? item.initiator.avatar : "/static/images/f.png"'></image>
<image
:src='item.initiator.avatar ? item.initiator.avatar : "/static/images/f.png"'>
</image>
</view>
<view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}
</view>
<view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}</view>
</view>
<view class='right acea-row row-middle'>
<view>
<view class='lack'>还差<text
class='font-color'>{{item.buying_count_num - item.yet_buying_num}}</text>人成团</view>
class='font-color'>{{item.buying_count_num - item.yet_buying_num}}</text>人成团
</view>
<view class='time'>
剩余
<count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '" :day-text="' '"
:hour-text="':'" :minute-text="':'" :second-text="' '" :datatime="item.end_time"></count-down>
<count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '"
:day-text="' '" :hour-text="':'" :minute-text="':'" :second-text="' '"
:datatime="item.end_time"></count-down>
</view>
</view>
<navigator hover-class='none'
:url="'/pages/activity/combination_status/index?id='+item.group_buying_id" class='spellBnt'>
:url="'/pages/activity/combination_status/index?id='+item.group_buying_id"
class='spellBnt'>
去拼单
<text class='iconfont icon-jiantou'></text>
</navigator>
@ -169,7 +179,8 @@
</view>
</view>
</view>
<view v-if="storeInfo.product_type == 0 || storeInfo.product_type == 3 || storeInfo.product_type == 1"
<view
v-if="storeInfo.product_type == 0 || storeInfo.product_type == 3 || storeInfo.product_type == 1"
class='wrapper'>
<view v-if="storeInfo.product_type != 1" class='share acea-row row-between row-bottom'
style="padding: 0;margin: 0;">
@ -180,15 +191,19 @@
<view class='iconfont icon-fenxiang' v-if="comForm != 'admin'"></view>
</view>
<view class='introduce line2'>
<text v-if="storeInfo.merchant.type_name" class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-if="storeInfo.merchant.type_name"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader"
class="font-bg-red bg">自营</text>{{storeInfo.store_name ? storeInfo.store_name : ''}}
</view>
<view class='label acea-row row-between-wrapper' style="padding-bottom: 10px">
<view v-if="storeInfo.product_type != 3">原价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view>库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view v-if="storeInfo.product_type != 3">
原价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view>
库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
</view>
<view>销量:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view>
销量:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
</view>
</view>
</view>
@ -210,7 +225,8 @@
@click="showGuaranee">
<view class="acea-row row-between-wrapper">保障
<view class="guaranteeAttr">
<text class='atterTxt1' :class="item.guarantee_name ? 'hasAttr' : ''" v-for="(item,index) in guarantee">
<text class='atterTxt1' :class="item.guarantee_name ? 'hasAttr' : ''"
v-for="(item,index) in guarantee">
{{item.guarantee_name ? item.guarantee_name : ''}}
</text>
</view>
@ -219,7 +235,8 @@
<view class='iconfont icon-jiantou'></view>
</view>
<!--定金预售流程-->
<view v-if="storeInfo.presell_type === 2" class='acea-row row-between-wrapper wrapper presell_process'>
<view v-if="storeInfo.presell_type === 2"
class='acea-row row-between-wrapper wrapper presell_process'>
<view>流程
<view class='process_count'>
<view class="process_line"></view>
@ -274,10 +291,12 @@
v-html="description.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
<view v-else class="product_content">
<view v-if="description.content && description.content.title" class="product_content_title">{{description.content.title}}
<view v-if="description.content && description.content.title" class="product_content_title">
{{description.content.title}}
</view>
<block v-if="description.content && description.content.image">
<image v-for="(item,index) in description.content.image" :key="index" :src="item" mode="widthFix" style="background-color: #fff;width: 100vw;">
<image v-for="(item,index) in description.content.image" :key="index" :src="item"
mode="widthFix" style="background-color: #fff;width: 100vw;">
</image>
</block>
</view>
@ -287,7 +306,8 @@
</view>
<!-- 组件 -->
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'></productWindow>
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'>
</productWindow>
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
</view>
</template>
@ -303,16 +323,25 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import { getProductDetail, getPreviewProDetail } from '@/api/store.js';
import {
getProductDetail,
getPreviewProDetail
} from '@/api/store.js';
import productWindow from '@/components/productWindow';
import productConSwiper from '@/components/productConSwiper';
import { mapGetters } from "vuex";
import productConSwiper from '@/components/productConSwiper/indexNew';
import {
mapGetters
} from "vuex";
import home from '@/components/home';
import countDown from '@/components/countDown';
import parser from "@/components/jyf-parser/jyf-parser";
import { HTTP_REQUEST_URL } from '@/config/app';
import {
HTTP_REQUEST_URL
} from '@/config/app';
import guaranteeTemplate from '@/components/freightGuarantee';
import { configMap } from "@/utils";
import {
configMap
} from "@/utils";
let app = getApp();
export default {
components: {
@ -326,6 +355,8 @@
data() {
let that = this;
return {
videoline: [],
vidioTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
statusBarHeight: statusBarHeight, //
attrTxt: '请选择', //
attrValue: '', //
@ -432,6 +463,17 @@
// this.getConfig()
},
methods: {
//
getSuffix(url) {
const str = url;
const lastIndex = str.lastIndexOf(".");
if (lastIndex !== -1) {
const extension = str.substring(lastIndex + 1);
return extension
} else {
console.log("字符串中没有找到点号。");
}
},
boxStatus(data) {
this.showAnimate = data
},
@ -476,7 +518,8 @@
this.$set(this, 'toView', id);
this.$set(this, 'navActive', index);
this.$set(this, 'lock', true);
this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[
this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that
.topArr[
index]);
},
scroll: function(e) {
@ -517,7 +560,8 @@
let productSelect = this.productValue[res];
if (productSelect) this.$set(this, "uniqueValue", productSelect.unique);
if (productSelect && productSelect.stock > 0) {
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this
.storeInfo
.image);
this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -555,14 +599,18 @@
mask: true
});
let that = this;
getProductDetail({ id: that.id, product_type: that.product_type }).then(res => {
getProductDetail({
id: that.id,
product_type: that.product_type
}).then(res => {
uni.hideLoading();
let storeInfo = res.data;
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1)
} else if (storeInfo.video_link && storeInfo.slider_image.length === 1) {
this.videoCoverImg = storeInfo.slider_image[0]
}
that.$set(that, 'storeInfo', storeInfo);
that.$set(that, 'description', storeInfo.content);
@ -593,7 +641,8 @@
that.$set(that, 'PromotionCode', storeInfo.code_base);
that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
that.$set(that, 'shippingValue', res.data.temp ? res.data.temp.name : '');
that.$set(that, 'guaranteeValue', res.data.guarantee ? res.data.guarantee.template_name : '');
that.$set(that, 'guaranteeValue', res.data.guarantee ? res.data.guarantee.template_name :
'');
that.$set(that, 'guarantee', res.data.guaranteeTemplate ? res.data.guaranteeTemplate : []);
that.$set(that, 'shipping', res.data.temp ? res.data.temp.info : '');
uni.setNavigationBarTitle({
@ -621,10 +670,28 @@
mask: true
});
let that = this;
let params = that.preview_key ? { key: that.preview_key } : { id: that.id, product_type: that.product_type }
let params = that.preview_key ? {
key: that.preview_key
} : {
id: that.id,
product_type: that.product_type
}
getPreviewProDetail(params).then(res => {
this.videoline = []
this.imgUrls = []
res.data.slider_image.forEach(item => {
if (this.vidioTypeList.includes(this.getSuffix(item))) {
this.videoline.push(item.replace(/\\/g, ""))
} else {
this.imgUrls.push(item.replace(/\\/g, ""))
}
})
// storeInfo.slider_image.filter(item=> !vidioTypeList.includes(getSuffix(item)))
uni.hideLoading();
let storeInfo = res.data;
// console.log(storeInfo, 'sdsdsd')
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1)
@ -727,7 +794,8 @@
"store_name",
this.storeInfo.store_name
);
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this
.storeInfo
.image);
this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -1634,8 +1702,10 @@
}
}
}
.product_content {
background-color: #fff;
&_title {
width: 100%;
height: auto;
@ -1644,6 +1714,7 @@
word-wrap: break-word;
text-align: center;
}
image {
width: 750rpx;
// height: 750rpx;

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>
</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>
</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>
</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>
</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;">