商品发布

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> <template>
<view class='product-bg'> <view class='product-bg'>
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :circular="circular" <swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay"
:interval="interval" :duration="duration" @change="change" v-if="isPlay"> :circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS --> <!-- #ifndef APP-PLUS -->
<swiper-item v-if="videoline && videoline != '' && videoline != 'https:'"> <swiper-item v-if="videoline && videoline != '' && videoline != 'https:'">
<view class="item"> <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" objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
auto-pause-if-navigate @ended="endedFun()"></video> auto-pause-if-navigate @ended="endedFun()"></video>
<view class="poster" v-if="controls"> <view class="poster" v-if="controls">
@ -37,9 +38,11 @@
</swiper> </swiper>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;"> <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" 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> </view>
<!-- #endif --> <!-- #endif -->
@ -119,7 +122,7 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.isPlay = false this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this); this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(()=>{ this.$nextTick(() => {
this.videoContext.play(); this.videoContext.play();
}) })
// #endif // #endif
@ -140,15 +143,18 @@
height: 750rpx; height: 750rpx;
position: relative; position: relative;
} }
.product-bg swiper { .product-bg swiper {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.product-bg .slide-image { .product-bg .slide-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.product-bg .pages { .product-bg .pages {
position: absolute; position: absolute;
background-color: #fff; background-color: #fff;
@ -161,15 +167,18 @@
font-size: 24rpx; font-size: 24rpx;
color: #050505; color: #050505;
} }
#myVideo { #myVideo {
width: 100%; width: 100%;
height: 100% height: 100%
} }
.product-bg .item { .product-bg .item {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.product-bg .item .poster { .product-bg .item .poster {
position: absolute; position: absolute;
top: 0; top: 0;
@ -178,10 +187,12 @@
width: 100%; width: 100%;
z-index: 9; z-index: 9;
} }
.product-bg .item .poster .image { .product-bg .item .poster .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.product-bg .item .stop { .product-bg .item .stop {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -192,6 +203,7 @@
margin-left: -68rpx; margin-left: -68rpx;
z-index: 9; z-index: 9;
} }
.product-bg .item .stop .image { .product-bg .item .stop .image {
width: 100%; width: 100%;
height: 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> <template>
<view class="product-con"> <view class="product-con">
<view v-if="storeInfo && storeInfo.merchant"> <view v-if="storeInfo && storeInfo.merchant">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true" :style='"height:"+height+"px;"' <scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
@scroll="scroll"> :style='"height:"+height+"px;"' @scroll="scroll">
<view id="past0"> <view id="past0">
<productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg" <productConSwiper :imgUrls="imgUrls" :videoCoverImg="videoCoverImg" :videoline="videoline">
:videoline="storeInfo.video_link"></productConSwiper> </productConSwiper>
<!--秒杀--> <!--秒杀-->
<view v-if="storeInfo.product_type == 1" class='nav acea-row row-between-wrapper'> <view v-if="storeInfo.product_type == 1" class='nav acea-row row-between-wrapper'>
<view class='money'><text class='num'>{{storeInfo.price}}</text><text <view class='money'><text class='num'>{{storeInfo.price}}</text><text
@ -13,8 +13,8 @@
<view class='acea-row row-middle'> <view class='acea-row row-middle'>
<view class='time'> <view class='time'>
<view>距秒杀结束仅剩</view> <view>距秒杀结束仅剩</view>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '" <countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '"
:second-text="' '" :datatime="datatime"></countDown> :minute-text="' : '" :second-text="' '" :datatime="datatime"></countDown>
</view> </view>
</view> </view>
</view> </view>
@ -35,7 +35,8 @@
<view class='introduce line2'> <view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" <text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text> 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}} {{storeInfo.store_name}}
</view> </view>
<view class="presell_count"> <view class="presell_count">
@ -51,7 +52,8 @@
</view> </view>
<view v-if="storeInfo.presell_type === 2"> <view v-if="storeInfo.presell_type === 2">
<view>支付尾款时间</view> <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> <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()}} {{ 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> <span class='area_line'>~</span>
@ -81,13 +83,15 @@
<view class='introduce line2'> <view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" <text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text> 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}} {{storeInfo.store_name}}
</view> </view>
<view class='label acea-row row-between-wrapper'> <view class='label acea-row row-between-wrapper'>
<view>类型:{{storeInfo.buying_count_num ? storeInfo.buying_count_num : 0}}人团</view> <view>类型:{{storeInfo.buying_count_num ? storeInfo.buying_count_num : 0}}人团</view>
<view>库存:{{storeInfo.stock ? storeInfo.stock : 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>
</view> </view>
@ -100,8 +104,8 @@
class='line'>|</text> class='line'>|</text>
</view> </view>
<view class='swiper'> <view class='swiper'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500"
vertical="true" circular="true"> duration="500" vertical="true" circular="true">
<block v-for="(item,index) in itemNew" :key='index'> <block v-for="(item,index) in itemNew" :key='index'>
<swiper-item> <swiper-item>
<view class='line1'>{{item.nickname ? item.nickname : ''}}拼团成功</view> <view class='line1'>{{item.nickname ? item.nickname : ''}}拼团成功</view>
@ -115,22 +119,28 @@
v-if="index < AllIndex && pink.length>0"> v-if="index < AllIndex && pink.length>0">
<view class='pictxt acea-row row-between-wrapper'> <view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'> <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>
<view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}</view>
</view> </view>
<view class='right acea-row row-middle'> <view class='right acea-row row-middle'>
<view> <view>
<view class='lack'>还差<text <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'> <view class='time'>
剩余 剩余
<count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '" :day-text="' '" <count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '"
:hour-text="':'" :minute-text="':'" :second-text="' '" :datatime="item.end_time"></count-down> :day-text="' '" :hour-text="':'" :minute-text="':'" :second-text="' '"
:datatime="item.end_time"></count-down>
</view> </view>
</view> </view>
<navigator hover-class='none' <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> <text class='iconfont icon-jiantou'></text>
</navigator> </navigator>
@ -169,7 +179,8 @@
</view> </view>
</view> </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'> class='wrapper'>
<view v-if="storeInfo.product_type != 1" class='share acea-row row-between row-bottom' <view v-if="storeInfo.product_type != 1" class='share acea-row row-between row-bottom'
style="padding: 0;margin: 0;"> style="padding: 0;margin: 0;">
@ -180,15 +191,19 @@
<view class='iconfont icon-fenxiang' v-if="comForm != 'admin'"></view> <view class='iconfont icon-fenxiang' v-if="comForm != 'admin'"></view>
</view> </view>
<view class='introduce line2'> <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" <text v-else-if="storeInfo.merchant.is_trader"
class="font-bg-red bg">自营</text>{{storeInfo.store_name ? storeInfo.store_name : ''}} class="font-bg-red bg">自营</text>{{storeInfo.store_name ? storeInfo.store_name : ''}}
</view> </view>
<view class='label acea-row row-between-wrapper' style="padding-bottom: 10px"> <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 v-if="storeInfo.product_type != 3">
<view>库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}} 原价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view>
库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
</view> </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> </view>
</view> </view>
@ -210,7 +225,8 @@
@click="showGuaranee"> @click="showGuaranee">
<view class="acea-row row-between-wrapper">保障 <view class="acea-row row-between-wrapper">保障
<view class="guaranteeAttr"> <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 : ''}} {{item.guarantee_name ? item.guarantee_name : ''}}
</text> </text>
</view> </view>
@ -219,7 +235,8 @@
<view class='iconfont icon-jiantou'></view> <view class='iconfont icon-jiantou'></view>
</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>流程
<view class='process_count'> <view class='process_count'>
<view class="process_line"></view> <view class="process_line"></view>
@ -274,10 +291,12 @@
v-html="description.content.replace(/<br\/>/ig, '')"></view> v-html="description.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif --> <!-- #endif -->
<view v-else class="product_content"> <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> </view>
<block v-if="description.content && description.content.image"> <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> </image>
</block> </block>
</view> </view>
@ -287,7 +306,8 @@
</view> </view>
<!-- 组件 --> <!-- 组件 -->
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" <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> <guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
</view> </view>
</template> </template>
@ -303,16 +323,25 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; 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 productWindow from '@/components/productWindow';
import productConSwiper from '@/components/productConSwiper'; import productConSwiper from '@/components/productConSwiper/indexNew';
import { mapGetters } from "vuex"; import {
mapGetters
} from "vuex";
import home from '@/components/home'; import home from '@/components/home';
import countDown from '@/components/countDown'; import countDown from '@/components/countDown';
import parser from "@/components/jyf-parser/jyf-parser"; 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 guaranteeTemplate from '@/components/freightGuarantee';
import { configMap } from "@/utils"; import {
configMap
} from "@/utils";
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
@ -326,6 +355,8 @@
data() { data() {
let that = this; let that = this;
return { return {
videoline: [],
vidioTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
statusBarHeight: statusBarHeight, // statusBarHeight: statusBarHeight, //
attrTxt: '请选择', // attrTxt: '请选择', //
attrValue: '', // attrValue: '', //
@ -432,6 +463,17 @@
// this.getConfig() // this.getConfig()
}, },
methods: { 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) { boxStatus(data) {
this.showAnimate = data this.showAnimate = data
}, },
@ -476,7 +518,8 @@
this.$set(this, 'toView', id); this.$set(this, 'toView', id);
this.$set(this, 'navActive', index); this.$set(this, 'navActive', index);
this.$set(this, 'lock', true); 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]); index]);
}, },
scroll: function(e) { scroll: function(e) {
@ -517,7 +560,8 @@
let productSelect = this.productValue[res]; let productSelect = this.productValue[res];
if (productSelect) this.$set(this, "uniqueValue", productSelect.unique); if (productSelect) this.$set(this, "uniqueValue", productSelect.unique);
if (productSelect && productSelect.stock > 0) { 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); .image);
this.$set(this.attr.productSelect, "price", productSelect.price); this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock); this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -555,21 +599,25 @@
mask: true mask: true
}); });
let that = this; 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(); uni.hideLoading();
let storeInfo = res.data; let storeInfo = res.data;
if (storeInfo.video_link && storeInfo.slider_image.length > 1) { if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0] this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1) storeInfo.slider_image.splice(0, 1)
} else if (storeInfo.video_link && storeInfo.slider_image.length === 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, 'storeInfo', storeInfo);
that.$set(that, 'description', storeInfo.content); that.$set(that, 'description', storeInfo.content);
if(typeof that.description.content == 'string'){ if (typeof that.description.content == 'string') {
try{ try {
that.description.content = JSON.parse(that.description.content); that.description.content = JSON.parse(that.description.content);
}catch(e){ } catch (e) {
console.log(e); console.log(e);
} }
} }
@ -593,7 +641,8 @@
that.$set(that, 'PromotionCode', storeInfo.code_base); that.$set(that, 'PromotionCode', storeInfo.code_base);
that.$set(that, 'activity', res.data.activity ? res.data.activity : []); that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
that.$set(that, 'shippingValue', res.data.temp ? res.data.temp.name : ''); 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, 'guarantee', res.data.guaranteeTemplate ? res.data.guaranteeTemplate : []);
that.$set(that, 'shipping', res.data.temp ? res.data.temp.info : ''); that.$set(that, 'shipping', res.data.temp ? res.data.temp.info : '');
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -621,10 +670,28 @@
mask: true mask: true
}); });
let that = this; 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 => { 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(); uni.hideLoading();
let storeInfo = res.data; let storeInfo = res.data;
// console.log(storeInfo, 'sdsdsd')
if (storeInfo.video_link && storeInfo.slider_image.length > 1) { if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0] this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1) storeInfo.slider_image.splice(0, 1)
@ -633,10 +700,10 @@
} }
that.$set(that, 'storeInfo', storeInfo); that.$set(that, 'storeInfo', storeInfo);
that.$set(that, 'description', storeInfo.content); that.$set(that, 'description', storeInfo.content);
if(typeof that.description.content == 'string'){ if (typeof that.description.content == 'string') {
try{ try {
that.description.content = JSON.parse(that.description.content); that.description.content = JSON.parse(that.description.content);
}catch(e){ } catch (e) {
console.log(e); console.log(e);
} }
} }
@ -727,7 +794,8 @@
"store_name", "store_name",
this.storeInfo.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); .image);
this.$set(this.attr.productSelect, "price", productSelect.price); this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock); this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -1634,9 +1702,11 @@
} }
} }
} }
.product_content{
.product_content {
background-color: #fff; background-color: #fff;
&_title{
&_title {
width: 100%; width: 100%;
height: auto; height: auto;
line-height: 50rpx; line-height: 50rpx;
@ -1644,7 +1714,8 @@
word-wrap: break-word; word-wrap: break-word;
text-align: center; text-align: center;
} }
image{
image {
width: 750rpx; width: 750rpx;
// height: 750rpx; // height: 750rpx;
} }

View File

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

View File

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

View File

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

View File

@ -19,7 +19,8 @@
<view class="" style="flex: 1;text-align: center;"> <view class="" style="flex: 1;text-align: center;">
/ /
</view> </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> v-model="item.unit_name"></u--input>
</view> </view>
<view class="" v-if='isWholeSale' <view class="" v-if='isWholeSale'
@ -29,8 +30,8 @@
<view class="" style="flex: 1;text-align: center;"> <view class="" style="flex: 1;text-align: center;">
/ /
</view> </view>
<u--input style=" flex: 2;width:100rpx;background-color: #F6F6F6;" placeholder="请输入计量单位" <u--input style=" flex: 2;width:100rpx;background-color: #F6F6F6;" @focus="unitIptClick(index,true)"
v-model="item.wholesale_unit_name"></u--input> placeholder="请输入计量单位" v-model="item.wholesale_unit_name"></u--input>
</view> </view>
</view> </view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line> <u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
@ -63,6 +64,42 @@
<view class="submit-btn"> <view class="submit-btn">
<u-button type="primary" shape="circle" text="保存" @click="submit"></u-button> <u-button type="primary" shape="circle" text="保存" @click="submit"></u-button>
</view> </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> </view>
</template> </template>
@ -73,8 +110,28 @@
export default { export default {
data() { data() {
return { return {
selfAttr: "",
attrList: ['斤',
"公斤",
"吨",
"升",
"个",
"台",
"瓶",
"桶",
"箱",
"袋",
"包",
"盒",
"件",
"罐"
],
showCustom: false, //
showPouple: false,
unitIndex: 0,
mer_id: "", mer_id: "",
isWholeSale: "", isWholeSale: "",
isWhose: false,
text: "", text: "",
value: "", value: "",
formData: {}, formData: {},
@ -111,6 +168,32 @@
} }
}, },
methods: { 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() { pushFn() {
this.attrValue.push({ this.attrValue.push({
detail: { detail: {
@ -264,4 +347,34 @@
width: 670rpx; 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> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<view> <view style="padding-bottom: 200rpx;">
<view class="order-index" ref="container"> <view class="order-index" ref="container">
<view class="search" style="margin-bottom: 24rpx;"> <view class="search" style="margin-bottom: 24rpx;">
<u-search :showAction="true" actionText="搜索" v-model="keyword" :animation="true" <u-search :showAction="true" actionText="搜索" v-model="keyword" :animation="true"
@ -206,13 +206,13 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="footer-li"> <view class="footer-li" @click="handClick(1)">
搜索入库 搜索入库
</view> </view>
<view class="footer-li"> <view class="footer-li" @click="handClick(2)">
扫码入库 扫码入库
</view> </view>
<view class="footer-li act"> <view class="footer-li act" @click="handClick(3)">
发布商品 发布商品
</view> </view>
</view> </view>
@ -446,6 +446,19 @@
}, },
methods: { 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() { Iknow() {
if (this.where.type == 2) { if (this.where.type == 2) {
this.flag = false this.flag = false

View File

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