This commit is contained in:
cc_zbp 2023-05-19 15:07:35 +08:00
parent 1539e07755
commit 03529f2da5
9 changed files with 772 additions and 689 deletions

View File

@ -78,7 +78,14 @@
}
},
computed: mapGetters(['location']),
watch: {},
watch: {
location: {
handler(newVal, oldVal) {
this.street = newVal.address_component.street
},
immediate: true
}
},
created() {
this.getBanner()
this.Area()

View File

@ -43,7 +43,8 @@
<view class="special_work com">
<view class="title">我的店铺</view>
<view class="content ">
<view class="examine" @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1`)">
<view class="examine"
@click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98`)">
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
<text class="text">供货采购</text>
</view>
@ -104,7 +105,8 @@
<view class="special_work com">
<view class="title">里海云仓</view>
<view class="content ">
<view class="examine" @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1`)">
<view class="examine"
@click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98`)">
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
<text class="text">供货采购</text>
</view>

View File

@ -1,392 +1,416 @@
<template>
<view :style="viewColor">
<view class="product-con">
<!-- #ifdef H5 -->
<view class="head-wrapper" :style="'top:'+statusBarHeight">
<view class="head-menu">
<view class='iconfont icon-xiangzuo' @click="returns"></view>
<view class="iconfont icon-shouye4" @click="goHome"></view>
</view>
</view>
<!-- #endif -->
<view v-if="storeInfo && storeInfo.merchant">
<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>
<!--有氛围图-->
<view v-if="storeInfo.atmosphere_pic" :style="{ backgroundImage: `url(${storeInfo.atmosphere_pic})` }" class='nav acea-row row-between-wrapper'>
<view class='money skeleton-rect'><text class='num'>{{storeInfo.price}}</text>
<text v-if="!svipData" class='y-money'>{{storeInfo.ot_price}}</text>
<view class="atmosphere" v-if="svipData && svipData.show_svip_price && svipData.show_svip" style="display: inline-block;">
<text class="vip-money">{{storeInfo.svip_price}}</text>
<image class="vip-image" src="/static/images/svip.png"></image>
</view>
</view>
</view>
<view class='wrapper'>
<view v-if="storeInfo.atmosphere_pic" class='introduce skeleton-rect acea-row row-between row-bottom atmosphere'>
<view>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red bt-color">自营</text>
{{storeInfo.store_name}}
</view>
<view class="fenxiang_btn" @click="listenerActionSheet">
<view class='iconfont icon-fenxiang'></view>
分享
</view>
</view>
<view v-if="storeInfo.atmosphere_pic" class='integral_count skeleton-rect'>
<text v-if="storeInfo.max_integral > 0" class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
<text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text>
</view>
<!--无氛围图-->
<view v-else class='share acea-row row-between row-bottom'>
<view class='money p-color skeleton-rect' style="min-width: 70rpx;">
<text class='num'>{{storeInfo.price}}</text>
<view v-if="svipData && svipData.show_svip_price && svipData.show_svip" style="display: inline-block;">
<text class="vip-money">{{storeInfo.svip_price}}</text>
<image class="vip-image" src="/static/images/svip.png"></image>
</view>
</view>
<view @click="listenerActionSheet" class="fenxiang_btn">
<view class='iconfont icon-fenxiang'></view>
分享
</view>
</view>
<view
v-if="svipData && !svipData.is_svip && svipData.show_svip"
class="svipCon acea-row row-between-wrapper skeleton-rect" style="margin-top: 20rpx;">
<view class="acea-row row-between-wrapper">
<image src="/static/images/svip_user.png"></image>
<view class="">开通 SVIP会员 立省<text>{{svipData.save_money}}</text></view>
</view>
<navigator class="svipBtn" url="/pages/annex/vip_paid/index">
立即开通
<text class="iconfont icon-jiantou"></text>
</navigator>
</view>
<view v-if="!storeInfo.atmosphere_pic" class='integral_count skeleton-rect'>
<text v-if="storeInfo.max_integral > 0" class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
<text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text>
</view>
<view v-if="!storeInfo.atmosphere_pic" class='introduce skeleton-rect'>
<text v-if="storeInfo.merchant.type_name" class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red bt-color">自营</text>
{{storeInfo.store_name || ''}}
</view>
<view class='label acea-row row-between-wrapper' :style="{'padding-bottom':coupon.list.length || storeInfo.top_pid?0 :10+'px;'}">
<view class="skeleton-rect">市场价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view class="skeleton-rect">库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}</view>
<view class="skeleton-rect">销量:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}</view>
</view>
<navigator v-if="storeInfo.top_pid" hover-class='none' :url="`/pages/activity/rank/index?cate_id=${storeInfo.top_pid}`" class='label' style="padding-bottom: 10px;">
<view class="rank_list acea-row row-between-wrapper">
<view class="acea-row row-between-wrapper">
<text class="rank_title"></text>
<view>{{ storeInfo.top_name }} · {{ storeInfo.top_num }}</view>
</view>
<text class="iconfont icon-xiala1"></text>
</view>
</navigator>
<view class='coupon acea-row row-between-wrapper skeleton-rect' @click='couponTap' style="margin-top: 20rpx;" v-if="coupon.list.length > 0">
<view class='hide line1 acea-row'>
优惠券
<view class='activity' v-for="(item,index) in coupon.list" :key="index">{{item.use_min_price}}{{item.coupon_price}}</view>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
</view>
<view class='attribute acea-row row-between-wrapper skeleton-rect' @click="selecAttr">
<view class="acea-row row-between-wrapper">{{attrTxt}}
<text class='atterTxt'>{{attrValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<view v-if="specsInfo.params && specsInfo.params.length>0" class="attribute acea-row row-between-wrapper" @click="seeSpecs">
<view class="acea-row row-middle">
参数
<view class="list line1">
<text class="item params" v-for="(item,index) in specsInfo.params" :key="index"
v-if="index<2">{{item.name}}</text>
<text>...</text>
</view>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
<!--运费-->
<view v-if="shipping || shippingValue" class='attribute acea-row row-between-wrapper' @click="showShip">
<view class="acea-row row-between-wrapper">运费
<text class='atterTxt'>{{shippingValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<!--保障-->
<view v-if="guarantee && guarantee.length" class='attribute acea-row row-between-wrapper' @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">
{{item.guarantee_name ? item.guarantee_name : ''}}
</text>
</view>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
</view>
<!--优惠套餐-->
<view class='combo' v-if="comboList && comboList.length>0">
<view class='title acea-row row-between-wrapper'>
<view>优惠套餐({{comboTotal}}) </view>
<view class='praise' @click="openCombo">
查看全部
<text class='iconfont icon-jiantou'></text>
</view>
</view>
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;height: 180rpx;" show-scrollbar="false">
<view class="img-box">
<view class="combo_item" v-for="(item,index) in comboList" :key="index">
<view class="img-item" v-for="(itemn,indexn) in item.discountsProduct" :key="indexn">
<image :src="itemn.image" mode="" @click="openCombo"></image>
<text v-if="indexn != item.count-1" class="iconfont icon-jiahao2"></text>
</view>
<view class="list_total">
<view class="list_num">{{item.count}}</view>
<view class="list_price p-color"> ¥{{item.max_price}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class='userEvaluation' id="past1" v-if="replyCount && replyCount>0">
<view class='title acea-row row-between-wrapper skeleton-rect'>
<view>用户评价({{replyCount}})</view>
<navigator class='praise' hover-class='none' :url='"/pages/users/goods_comment_list/index?product_id="+id'>
<text class='t-color'>{{replyChance}}</text>好评率
<text class='iconfont icon-jiantou'></text>
</navigator>
</view>
<block v-if="replyCount && replyCount>0">
<userEvaluation :reply="reply"></userEvaluation>
</block>
</view>
<!-- 种草秀 -->
<view class='userPlant' v-if="storeInfo.community && storeInfo.community.length>0">
<view class='title acea-row row-between-wrapper'>
<view>种草秀 </view>
<navigator class='praise' hover-class='none' :url="'/pages/plantGrass/plant_show/index?spu_id='+storeInfo.spu_id">
查看全部
<text class='iconfont icon-jiantou'></text>
</navigator>
</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(item, index) in storeInfo.community" :key="index" v-if="index<=2"
@click="goPlant(item)">
<image :src="item.image[0]" class="image"></image>
<image v-if="item.is_type == 2" class="video_img" src="@/static/images/stop.png" mode=""></image>
</view>
</view>
</view>
<!-- 商铺信息 -->
<view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-hd skeleton-rect">
<view class="store-info">
<view class="logo">
<image :src="storeInfo.merchant.mer_avatar" mode=""></image>
</view>
<view class="info">
<view class="name line1">
<text>{{storeInfo.merchant.mer_name ? storeInfo.merchant.mer_name : ''}}</text>
<image v-if="margin_ico_switch==1 && margin_ico && storeInfo.merchant.is_margin == 10" :src="margin_ico" class="store-margin"></image>
<text v-if="storeInfo.merchant.type_name" class="font-bg-red ml8 bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red ml8 bt-color">自营</text>
</view>
<view v-if="storeInfo.merchant.care_count" class="txt">
{{storeInfo.merchant.care_count < 10000 ? storeInfo.merchant.care_count : (storeInfo.merchant.care_count/10000).toFixed(2)+'万'}}人关注
</view>
<view v-else class="txt">0人关注</view>
</view>
<navigator v-if="hide_mer_status != 1" :url="'/pages/store/home/index?id='+storeInfo.merchant.mer_id" class="link"
hover-class="none">进店</navigator>
</view>
<view class="score-wrapper">
<view class="item">
商品描述<text>{{storeInfo.merchant.product_score}}</text>
</view>
<view class="item">
卖家服务<text>{{storeInfo.merchant.service_score}}</text>
</view>
<view class="item">
物流服务<text>{{storeInfo.merchant.postage_score}}</text>
</view>
</view>
</view>
<view v-if="storeInfo.merchant.recommend && storeInfo.merchant.recommend.length > 0" class="con-box">
<view class="title">店铺推荐</view>
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
<view class="img-box">
<view class="img-item" v-for="(item,index) in storeInfo.merchant.recommend" :key="index" @click="goProDetail(item)">
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
<!-- <image :src="item.image"></image> -->
<view class="txt">
<view class="title line1">{{item.store_name}}</view>
<view class="price">
<text></text>{{item.price}}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class='product-intro' id="past3">
<view class='title'>产品介绍</view>
<view class='conter' v-if="description" style="min-height:50rpx;">
<!-- #ifndef APP-PLUS -->
<jyf-parser v-if="description.type == 0" :domain='domain' :html="description.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view v-if="description.type == 0" class="description" v-html="description.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
<view v-else class="product_content">
<view v-if="description.content && description.content.title" class="title">{{description.content.title}}</view>
<view v-if="description.content && description.content.image" class="pictures">
<image v-for="(item,index) in description.content.image" :key="index" :src="item"></image>
</view>
</view>
</view>
<!-- 价格说明 -->
<view v-if="priceRule.content" class="price-info">
<view class="price-title">{{priceRule.rule_name}}</view>
<!-- #ifndef APP-PLUS -->
<jyf-parser :domain='domain' :html="priceRule.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="description" v-html="priceRule.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
</view>
</view>
<view style='height:120rpx;'></view>
</scroll-view>
</view>
<view class='footer acea-row row-between-wrapper'>
<view v-if="storeInfo.merchant && storeInfo.merchant.services_type == 1" class="item skeleton-rect" @click="call">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>
<view v-else class="item skeleton-rect" @click="couponTap2">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>
<view @click="setCollect" class='item skeleton-rect'>
<view class='iconfont icon-shoucang1' v-if="storeInfo.isRelation"></view>
<view class='iconfont icon-shoucang' v-else></view>
<view>收藏</view>
</view>
<navigator open-type='navigate' class="animated item skeleton-rect" :class="animated==true?'bounceIn':''" url='/pages/order_addcart/order_addcart'
hover-class="none">
<view class='iconfont icon-gouwuche1'>
<text v-if="CartCount>0" class='num'>{{CartCount || 0}}</text>
</view>
<view>购物车</view>
</navigator>
<view v-if="attr.productSelect.stock != 0" class='bnt acea-row skeleton-rect'>
<form @submit="joinCart" report-submit='true'>
<button v-if="storeInfo.type != 1" class='joinCart bnts' form-type="submit">加入购物车</button>
</form>
<form @submit="goBuy" report-submit='true' v-if="attr.productSelect">
<button class='buy bnts' :class="storeInfo.type == 1 ? 'virtual_buy' : ''" form-type="submit" :disabled="attr.productSelect.stock == 0">立即购买</button>
</form>
</view>
<view v-else class='bnt acea-row skeleton-rect'>
<form report-submit='true'>
<button v-if="arrival_notice" class='buy bnts sold_out' form-type="submit" @click="arrivalNotice">到货通知</button>
<button v-else class='buy bnts sold_out' form-type="submit" disabled>商品已售罄</button>
</form>
</view>
</view>
<block v-if="sharePacket.max&&sharePacket.max>0">
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"
:showAnimate="showAnimate" @boxStatus="boxStatus"></shareRedPackets>
</block>
<!-- 组件 -->
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
@attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window' :maxCount="max_count" :minCount="min_count" :svipPrice="svipPrice" :image="storeInfo.image"></productWindow>
<block v-if="coupon.coupon">
<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block>
<specs :specsInfo="specsInfo" @myevent="mySpecs"></specs>
<!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP -->
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
<view class="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view>
</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="item" :class="weixinStatus ? 'item3' : ''" open-type="share" hover-class='none' @click="goFriend">
<view class="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view>
</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="item" @click="appShare('WXSceneSession')">
<view class="iconfont icon-weixin3"></view>
<view class="">分享给好友</view>
</view>
<!-- #endif -->
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="goPoster">
<view class="iconfont icon-haibao"></view>
<view class="">生成海报</view>
</button>
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="copyPwd">
<view class="iconfont icon-fuzhikouling1"></view>
<view>生成口令</view>
</button>
</view>
<view class="mask" v-if="posters" @click="listenerActionClose"></view>
<!--口令复制结果-->
<copyPassword :isCopy='isCopy' :copyUrl='copyUrl' @close="closeCopy"></copyPassword>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- 海报展示 -->
<view class='poster-pop' v-if="posterImageStatus">
<image src='../../static/images/poster-close.png' class='close' @click="posterImageClose"></image>
<image :src='posterImage'></image>
<!-- #ifndef H5 -->
<view class='save-poster' @click="savePosterPath">保存到手机</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="keep">长按图片可以保存到手机</view>
<!-- #endif -->
</view>
<view class='mask' v-if="posterImageStatus"></view>
<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
<!-- 发送给朋友图片 -->
<view class="share-box" v-if="H5ShareBox">
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
</view>
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
<!-- #ifndef H5 -->
<passwordPopup></passwordPopup>
<!-- #endif -->
<!--套餐产品弹窗-->
<discounts-goods ref="discounts" :id="id" :uid="uid"></discounts-goods>
</view>
</view>
<view :style="viewColor">
<view class="product-con">
<!-- #ifdef H5 -->
<view class="head-wrapper" :style="'top:'+statusBarHeight">
<view class="head-menu">
<view class='iconfont icon-xiangzuo' @click="returns"></view>
<view class="iconfont icon-shouye4" @click="goHome"></view>
</view>
</view>
<!-- #endif -->
<view v-if="storeInfo && storeInfo.merchant">
<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>
<!--有氛围图-->
<view v-if="storeInfo.atmosphere_pic" :style="{ backgroundImage: `url(${storeInfo.atmosphere_pic})` }"
class='nav acea-row row-between-wrapper'>
<view class='money skeleton-rect'><text class='num'>{{storeInfo.price}}</text>
<text v-if="!svipData" class='y-money'>{{storeInfo.ot_price}}</text>
<view class="atmosphere" v-if="svipData && svipData.show_svip_price && svipData.show_svip"
style="display: inline-block;">
<text class="vip-money">{{storeInfo.svip_price}}</text>
<image class="vip-image" src="/static/images/svip.png"></image>
</view>
</view>
</view>
<view class='wrapper'>
<view v-if="storeInfo.atmosphere_pic"
class='introduce skeleton-rect acea-row row-between row-bottom atmosphere'>
<view>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)"
class="font-bg-red bt-color">自营</text>
{{storeInfo.store_name}}
</view>
<view class="fenxiang_btn" @click="listenerActionSheet">
<view class='iconfont icon-fenxiang'></view>
分享
</view>
</view>
<view v-if="storeInfo.atmosphere_pic" class='integral_count skeleton-rect'>
<text v-if="storeInfo.max_integral > 0" class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
<text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text>
</view>
<!--无氛围图-->
<view v-else class='share acea-row row-between row-bottom'>
<view class='money p-color skeleton-rect' style="min-width: 70rpx;">
<text class='num'>{{storeInfo.price}}</text>
<view v-if="svipData && svipData.show_svip_price && svipData.show_svip"
style="display: inline-block;">
<text class="vip-money">{{storeInfo.svip_price}}</text>
<image class="vip-image" src="/static/images/svip.png"></image>
</view>
</view>
<view @click="listenerActionSheet" class="fenxiang_btn">
<view class='iconfont icon-fenxiang'></view>
分享
</view>
</view>
<view v-if="svipData && !svipData.is_svip && svipData.show_svip"
class="svipCon acea-row row-between-wrapper skeleton-rect" style="margin-top: 20rpx;">
<view class="acea-row row-between-wrapper">
<image src="/static/images/svip_user.png"></image>
<view class="">开通 SVIP会员 立省<text>{{svipData.save_money}}</text></view>
</view>
<navigator class="svipBtn" url="/pages/annex/vip_paid/index">
立即开通
<text class="iconfont icon-jiantou"></text>
</navigator>
</view>
<view v-if="!storeInfo.atmosphere_pic" class='integral_count skeleton-rect'>
<text v-if="storeInfo.max_integral > 0" class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
<text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text>
</view>
<view v-if="!storeInfo.atmosphere_pic" class='introduce skeleton-rect'>
<text v-if="storeInfo.merchant.type_name"
class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red bt-color">自营</text>
{{storeInfo.store_name || ''}}
</view>
<view class='label acea-row row-between-wrapper'
:style="{'padding-bottom':coupon.list.length || storeInfo.top_pid?0 :10+'px;'}">
<view class="skeleton-rect">市场价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view class="skeleton-rect">
库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}</view>
<view class="skeleton-rect">
销量:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}</view>
</view>
<navigator v-if="storeInfo.top_pid" hover-class='none'
:url="`/pages/activity/rank/index?cate_id=${storeInfo.top_pid}`" class='label'
style="padding-bottom: 10px;">
<view class="rank_list acea-row row-between-wrapper">
<view class="acea-row row-between-wrapper">
<text class="rank_title"></text>
<view>{{ storeInfo.top_name }} · {{ storeInfo.top_num }}</view>
</view>
<text class="iconfont icon-xiala1"></text>
</view>
</navigator>
<view class='coupon acea-row row-between-wrapper skeleton-rect' @click='couponTap'
style="margin-top: 20rpx;" v-if="coupon.list.length > 0">
<view class='hide line1 acea-row'>
优惠券
<view class='activity' v-for="(item,index) in coupon.list" :key="index">
{{item.use_min_price}}{{item.coupon_price}}</view>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
</view>
<view class='attribute acea-row row-between-wrapper skeleton-rect' @click="selecAttr">
<view class="acea-row row-between-wrapper">{{attrTxt}}
<text class='atterTxt'>{{attrValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<view v-if="specsInfo.params && specsInfo.params.length>0" class="attribute acea-row row-between-wrapper"
@click="seeSpecs">
<view class="acea-row row-middle">
参数
<view class="list line1">
<text class="item params" v-for="(item,index) in specsInfo.params" :key="index"
v-if="index<2">{{item.name}}</text>
<text>...</text>
</view>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
<!--运费-->
<view v-if="shipping || shippingValue" class='attribute acea-row row-between-wrapper' @click="showShip">
<view class="acea-row row-between-wrapper">运费
<text class='atterTxt'>{{shippingValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<!--保障-->
<view v-if="guarantee && guarantee.length" class='attribute acea-row row-between-wrapper'
@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">
{{item.guarantee_name ? item.guarantee_name : ''}}
</text>
</view>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
</view>
<!--优惠套餐-->
<view class='combo' v-if="comboList && comboList.length>0">
<view class='title acea-row row-between-wrapper'>
<view>优惠套餐({{comboTotal}}) </view>
<view class='praise' @click="openCombo">
查看全部
<text class='iconfont icon-jiantou'></text>
</view>
</view>
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;height: 180rpx;"
show-scrollbar="false">
<view class="img-box">
<view class="combo_item" v-for="(item,index) in comboList" :key="index">
<view class="img-item" v-for="(itemn,indexn) in item.discountsProduct" :key="indexn">
<image :src="itemn.image" mode="" @click="openCombo"></image>
<text v-if="indexn != item.count-1" class="iconfont icon-jiahao2"></text>
</view>
<view class="list_total">
<view class="list_num">{{item.count}}</view>
<view class="list_price p-color"> ¥{{item.max_price}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class='userEvaluation' id="past1" v-if="replyCount && replyCount>0">
<view class='title acea-row row-between-wrapper skeleton-rect'>
<view>用户评价({{replyCount}})</view>
<navigator class='praise' hover-class='none'
:url='"/pages/users/goods_comment_list/index?product_id="+id'>
<text class='t-color'>{{replyChance}}</text>好评率
<text class='iconfont icon-jiantou'></text>
</navigator>
</view>
<block v-if="replyCount && replyCount>0">
<userEvaluation :reply="reply"></userEvaluation>
</block>
</view>
<!-- 种草秀 -->
<view class='userPlant' v-if="storeInfo.community && storeInfo.community.length>0">
<view class='title acea-row row-between-wrapper'>
<view>种草秀 </view>
<navigator class='praise' hover-class='none'
:url="'/pages/plantGrass/plant_show/index?spu_id='+storeInfo.spu_id">
查看全部
<text class='iconfont icon-jiantou'></text>
</navigator>
</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(item, index) in storeInfo.community" :key="index" v-if="index<=2"
@click="goPlant(item)">
<image :src="item.image[0]" class="image"></image>
<image v-if="item.is_type == 2" class="video_img" src="@/static/images/stop.png" mode=""></image>
</view>
</view>
</view>
<!-- 商铺信息 -->
<view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-hd skeleton-rect">
<view class="store-info">
<view class="logo">
<image :src="storeInfo.merchant.mer_avatar" mode=""></image>
</view>
<view class="info">
<view class="name line1">
<text>{{storeInfo.merchant.mer_name ? storeInfo.merchant.mer_name : ''}}</text>
<image v-if="margin_ico_switch==1 && margin_ico && storeInfo.merchant.is_margin == 10"
:src="margin_ico" class="store-margin"></image>
<text v-if="storeInfo.merchant.type_name"
class="font-bg-red ml8 bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red ml8 bt-color">自营</text>
</view>
<view v-if="storeInfo.merchant.care_count" class="txt">
{{storeInfo.merchant.care_count < 10000 ? storeInfo.merchant.care_count : (storeInfo.merchant.care_count/10000).toFixed(2)+'万'}}人关注
</view>
<view v-else class="txt">0人关注</view>
</view>
<navigator v-if="hide_mer_status != 1" :url="'/pages/store/home/index?id='+storeInfo.merchant.mer_id"
class="link" hover-class="none">进店</navigator>
</view>
<view class="score-wrapper">
<view class="item">
商品描述<text>{{storeInfo.merchant.product_score}}</text>
</view>
<view class="item">
卖家服务<text>{{storeInfo.merchant.service_score}}</text>
</view>
<view class="item">
物流服务<text>{{storeInfo.merchant.postage_score}}</text>
</view>
</view>
</view>
<view v-if="storeInfo.merchant.recommend && storeInfo.merchant.recommend.length > 0" class="con-box">
<view class="title">店铺推荐</view>
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
<view class="img-box">
<view class="img-item" v-for="(item,index) in storeInfo.merchant.recommend" :key="index"
@click="goProDetail(item)">
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
<!-- <image :src="item.image"></image> -->
<view class="txt">
<view class="title line1">{{item.store_name}}</view>
<view class="price">
<text></text>{{item.price}}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class='product-intro' id="past3">
<view class='title'>产品介绍</view>
<view class='conter' v-if="description" style="min-height:50rpx;">
<!-- #ifndef APP-PLUS -->
<jyf-parser v-if="description.type == 0" :domain='domain'
:html="description.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view v-if="description.type == 0" class="description"
v-html="description.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
<view v-else class="product_content">
<view v-if="description.content && description.content.title" class="title">
{{description.content.title}}</view>
<view v-if="description.content && description.content.image" class="pictures">
<image v-for="(item,index) in description.content.image" :key="index" :src="item"></image>
</view>
</view>
</view>
<!-- 价格说明 -->
<view v-if="priceRule.content" class="price-info">
<view class="price-title">{{priceRule.rule_name}}</view>
<!-- #ifndef APP-PLUS -->
<jyf-parser :domain='domain' :html="priceRule.content.replace(/<br\/>/ig, '')" ref="article"
:tag-style="tagStyle"></jyf-parser>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="description" v-html="priceRule.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
</view>
</view>
<view style='height:120rpx;'></view>
</scroll-view>
</view>
<view class='footer acea-row row-between-wrapper'>
<view v-if="storeInfo.merchant && storeInfo.merchant.services_type == 1" class="item skeleton-rect"
@click="call">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>
<view v-else class="item skeleton-rect" @click="couponTap2">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>
<view @click="setCollect" class='item skeleton-rect'>
<view class='iconfont icon-shoucang1' v-if="storeInfo.isRelation"></view>
<view class='iconfont icon-shoucang' v-else></view>
<view>收藏</view>
</view>
<navigator open-type='navigate' class="animated item skeleton-rect" :class="animated==true?'bounceIn':''"
url='/pages/order_addcart/order_addcart' hover-class="none">
<view class='iconfont icon-gouwuche1'>
<text v-if="CartCount>0" class='num'>{{CartCount || 0}}</text>
</view>
<view>购物车</view>
</navigator>
<view v-if="attr.productSelect.stock != 0" class='bnt acea-row skeleton-rect'>
<form @submit="joinCart" report-submit='true'>
<button v-if="storeInfo.type != 1" class='joinCart bnts' form-type="submit">加入购物车</button>
</form>
<form @submit="goBuy" report-submit='true' v-if="attr.productSelect">
<button class='buy bnts' :class="storeInfo.type == 1 ? 'virtual_buy' : ''" form-type="submit"
:disabled="attr.productSelect.stock == 0">立即购买</button>
</form>
</view>
<view v-else class='bnt acea-row skeleton-rect'>
<form report-submit='true'>
<button v-if="arrival_notice" class='buy bnts sold_out' form-type="submit"
@click="arrivalNotice">到货通知</button>
<button v-else class='buy bnts sold_out' form-type="submit" disabled>商品已售罄</button>
</form>
</view>
</view>
<block v-if="sharePacket.max&&sharePacket.max>0">
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet"
@closeChange="closeChange" :showAnimate="showAnimate" @boxStatus="boxStatus"></shareRedPackets>
</block>
<!-- 组件 -->
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'
:maxCount="max_count" :minCount="min_count" :svipPrice="svipPrice" :image="storeInfo.image"></productWindow>
<block v-if="coupon.coupon">
<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block>
<specs :specsInfo="specsInfo" @myevent="mySpecs"></specs>
<!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP -->
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' v-if="weixinStatus === true"
@click="H5ShareBox = true">
<view class="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view>
</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="item" :class="weixinStatus ? 'item3' : ''" open-type="share" hover-class='none'
@click="goFriend">
<view class="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view>
</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="item" @click="appShare('WXSceneSession')">
<view class="iconfont icon-weixin3"></view>
<view class="">分享给好友</view>
</view>
<!-- #endif -->
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="goPoster">
<view class="iconfont icon-haibao"></view>
<view class="">生成海报</view>
</button>
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="copyPwd">
<view class="iconfont icon-fuzhikouling1"></view>
<view>生成口令</view>
</button>
</view>
<view class="mask" v-if="posters" @click="listenerActionClose"></view>
<!--口令复制结果-->
<copyPassword :isCopy='isCopy' :copyUrl='copyUrl' @close="closeCopy"></copyPassword>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- 海报展示 -->
<view class='poster-pop' v-if="posterImageStatus">
<image src='../../static/images/poster-close.png' class='close' @click="posterImageClose"></image>
<image :src='posterImage'></image>
<!-- #ifndef H5 -->
<view class='save-poster' @click="savePosterPath">保存到手机</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="keep">长按图片可以保存到手机</view>
<!-- #endif -->
</view>
<view class='mask' v-if="posterImageStatus"></view>
<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
<!-- 发送给朋友图片 -->
<view class="share-box" v-if="H5ShareBox">
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
</view>
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
<!-- #ifndef H5 -->
<passwordPopup></passwordPopup>
<!-- #endif -->
<!--套餐产品弹窗-->
<discounts-goods ref="discounts" :id="id" :uid="uid"></discounts-goods>
</view>
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import { getconfig } from '@/api/public.js';
import { arrivalSubscribe } from '@/utils/SubscribeMessage.js';
@ -951,6 +975,7 @@
});
let that = this;
const data = { product_type: this.product_type }
console.log('data', data);
getProductDetail(that.id, data).then(res => {
uni.hideLoading();
let storeInfo = res.data;

View File

@ -219,10 +219,7 @@
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
getGeocoder({ lat: latitude, long: longitude }).then(res => {
this.$store.commit('setLocation', res.data)
this.street = res.data.address_component.street
}).catch(err => {

View File

@ -9,6 +9,19 @@
</block>
</view>
<view class="goods-wrapper wrapper">
<block v-for="(item,index) in goods" :key="index">
<view class="item">
<view class="l_cont">
<image :src="item.image" mode="aspectFill"></image>
</view>
<view class="r_cont">
<text>{{item.store_name}}</text>
</view>
</view>
</block>
</view>
<u-popup :show="editGoodsShow" @close="editGoodsClose" :round="18" mode="center">
<view class="edit_goods_box">
<view class="edit_name flex_a_c edit_name_no">
@ -38,7 +51,7 @@
<view class="edit_goods_btn">
<u-button type="error" text="取消" class="edit_btn" @click="searchGoodsShow=false">
</u-button>
<u-button type="primary" text="保存" class="edit_btn" @click="searchGoodsClose">
<u-button type="primary" text="搜索" class="edit_btn" @click="searchGoodsClose">
</u-button>
</view>
</view>
@ -73,7 +86,8 @@
editGoodsShow: false, //
mer_id: '',
searchGoodsShow: true,
searchGoodsName: ''
searchGoodsName: '',
goods: []
}
},
onLoad(e) {
@ -91,6 +105,7 @@
}
const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err))
console.log('data', data);
this.goods = data.list
this.searchGoodsShow = false
},
async editGoodsClose() {
@ -161,6 +176,30 @@
margin: 0 auto;
}
.goods-wrapper {
.item {
display: flex;
height: 175.44rpx;
width: 100%;
background-color: #fff;
margin-top: 21.05rpx;
border-radius: 8px;
padding: 12px;
.l_cont {
image {
width: 133.33rpx;
height: 133.33rpx;
border-radius: 8px;
}
}
.r_cont {
margin-left: 17.54rpx;
}
}
}
.select_item {
width: 336.84rpx;
height: 189.47rpx;

View File

@ -72,8 +72,8 @@
</view>
</view>
<view class="pro-box" :class="'styleType'+store_street_theme">
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}&product_type=98`" hover-class="none"
class="pro-item" v-for="(itemn,indexn) in item.recommend.slice(0,3)" :key='indexn'>
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}&product_type=${product_type}`"
hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend.slice(0,3)" :key='indexn'>
<view class="picture">
<easy-loadimage mode="widthFix" :image-src="itemn.image"></easy-loadimage>
<view v-if="itemn.border_pic" :style="{ backgroundImage: `url(${itemn.border_pic})` }"
@ -269,9 +269,11 @@
count: 0,
storeTypeArr: [], //
merList: [], //
product_type: 0
};
},
onLoad(options) {
this.product_type = options.product_type ?? 0
this.sotreParam.street_id = options.street_id
this.sotreParam.type_id = options.type_id
this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || ''

View File

@ -1,293 +1,307 @@
<template>
<view class="area_container">
<view class="area_container_title">
<navigator :url="`/pages/product/storeClassification/index?mer_id=${mer_id}`" hover-class="none" class="manage_btn">管理</navigator>
<view class="area_container_title_name">选择店铺分类</view>
<view class="area_container_title_close" @click="close"><text class="iconfont" >&#xe62f;</text></view>
</view>
<view class="area_container_content">
<view class="selectList_con">
<view class="selectList_con_item" v-for="(item, index) in selectList" :key="index">
<text>{{ item.label }}</text>
<text class="iconfont" @click="delSelectItem(item, index)">&#xe62f;</text>
</view>
</view>
<view class="selectList_tap">
<view class="selectList_tap_item" v-for="(item, index) in tapList" :key="index" @click="selectTapItem(item, index)" :class="{ selectTap: selectTap == item.value }">
{{ item.label }}
</view>
<view class="selectList_tap_item" @click="selectTapLastItem(-1)" v-if="isShowLastItem" :class="{ selectTap: selectTap == -1 }">请选择</view>
</view>
<view class="selectList_area">
<scroll-view scroll-y="true" class="scroll">
<view v-for="(item, index) in areaList" :key="index" class="selectList_area_item">
<view class="selectList_area_item_name" @click="selectArea(item)">{{ item.label }}</view>
<view @click="handlyAddSelect(item)" v-if="!item.children"><text class="iconfont">&#xe70e;</text></view>
</view>
</scroll-view>
</view>
<view class="handle"><view class="handle_button" @click="handleGetSelectArea">确定</view></view>
</view>
</view>
<view class="area_container">
<view class="area_container_title">
<navigator :url="`/pages/product/storeClassification/index?mer_id=${mer_id}`" hover-class="none"
class="manage_btn">管理</navigator>
<view class="area_container_title_name">选择店铺分类</view>
<view class="area_container_title_close" @click="close"><text class="iconfont">&#xe62f;</text></view>
</view>
<view class="area_container_content">
<view class="selectList_con">
<view class="selectList_con_item" v-for="(item, index) in selectList" :key="index">
<text>{{ item.label }}</text>
<text class="iconfont" @click="delSelectItem(item, index)">&#xe62f;</text>
</view>
</view>
<view class="selectList_tap">
<view class="selectList_tap_item" v-for="(item, index) in tapList" :key="index"
@click="selectTapItem(item, index)" :class="{ selectTap: selectTap == item.value }">
{{ item.label }}
</view>
<view class="selectList_tap_item" @click="selectTapLastItem(-1)" v-if="isShowLastItem"
:class="{ selectTap: selectTap == -1 }">请选择</view>
</view>
<view class="selectList_area">
<scroll-view scroll-y="true" class="scroll">
<view v-for="(item, index) in areaList" :key="index" class="selectList_area_item">
<view class="selectList_area_item_name" @click="selectArea(item)">{{ item.label }}</view>
<view @click="handlyAddSelect(item)" v-if="!item.children"><text class="iconfont">&#xe70e;</text></view>
</view>
</scroll-view>
</view>
<view class="handle">
<view class="handle_button" @click="handleGetSelectArea">确定</view>
</view>
</view>
</view>
</template>
<script>
import { serialize, Toast } from '../../../libs/uniApi.js';
export default {
props:{
allReadySelect: {
type: Array,
default:() => {
return []
}
},
classifiedData: {
type: Array,
default:() => {
return []
}
},
mer_id: {
type: Number,
default: 0
}
},
data() {
return {
selectList: [],
selectTap: -1,
selectTapIndex: -1, //
tapList: [],
isShowLastItem: true, //
areaList: []
};
},
watch: {
classifiedData: {
handler(val) {
this.areaList = this.classifiedData
},
deep: true
}
},
created() {
this.areaList = serialize(this.classifiedData);
console.log(this.areaList);
},
methods: {
import { serialize, Toast } from '../../../libs/uniApi.js';
export default {
props: {
allReadySelect: {
type: Array,
default: () => {
return []
}
},
classifiedData: {
type: Array,
default: () => {
return []
}
},
mer_id: {
type: Number || String,
default: 0
}
},
data() {
return {
selectList: [],
selectTap: -1,
selectTapIndex: -1, //
tapList: [],
isShowLastItem: true, //
areaList: []
};
},
watch: {
classifiedData: {
handler(val) {
this.areaList = this.classifiedData
},
deep: true
}
},
created() {
this.areaList = serialize(this.classifiedData);
console.log(this.areaList);
},
methods: {
//
async selectArea(item) {
//
if (!(item.children && item.children.length)) {
// Toast('');
return;
if (this.isShowLastItem) {
this.tapList.push(item);
} else {
this.tapList.splice(this.tapList.length - 1, 1, item);
}
this.isShowLastItem = false;
return;
}
console.log(item);
// titletitleitem
if (this.selectTapIndex > -1) {
this.tapList.splice(this.selectTapIndex, 999);
this.areaList = item.children;
this.tapList.push(item);
this.isShowLastItem = true;
this.selectTap = -1;
this.selectTapIndex = -1;
return;
}
//
async selectArea(item) {
//
if (item.children && item.children.length) {
this.areaList = item.children;
this.tapList.push(item);
this.isShowLastItem = true;
this.selectTap = -1;
return;
}
//
if (!(item.children && item.children.length)) {
// Toast('');
return;
if (this.isShowLastItem) {
this.tapList.push(item);
} else {
this.tapList.splice(this.tapList.length - 1, 1, item);
}
this.isShowLastItem = false;
return;
}
console.log(item);
// titletitleitem
if (this.selectTapIndex > -1) {
this.tapList.splice(this.selectTapIndex, 999);
this.areaList = item.children;
this.tapList.push(item);
this.isShowLastItem = true;
this.selectTap = -1;
this.selectTapIndex = -1;
return;
}
//
if (item.children && item.children.length) {
this.areaList = item.children;
this.tapList.push(item);
this.isShowLastItem = true;
this.selectTap = -1;
return;
}
},
// tap
async selectTapItem(item, index) {
if(index == 0) {
this.areaList = serialize(this.classifiedData);
this.selectTap = item.value; //
this.selectTapIndex = index; //
return;
}
this.selectTap = item.value;
this.areaList = item.children;
},
//
selectTapLastItem(val) {
this.selectTap = -1;
if (!this.tapList.length) {
// this.areaList = val.children;
this.areaList = serialize(this.classifiedData);
return;
}
},
// tap
async selectTapItem(item, index) {
if (index == 0) {
this.areaList = serialize(this.classifiedData);
this.selectTap = item.value; //
this.selectTapIndex = index; //
return;
}
this.selectTap = item.value;
this.areaList = item.children;
},
//
selectTapLastItem(val) {
this.selectTap = -1;
if (!this.tapList.length) {
// this.areaList = val.children;
this.areaList = serialize(this.classifiedData);
return;
}
this.areaList = this.tapList[this.tapList.length - 1].children;
},
this.areaList = this.tapList[this.tapList.length - 1].children;
},
//
handlyAddSelect(item) {
if (this.selectList.some(val => val.value == item.value)) {
Toast('已经选择过了')
return
}
if (this.selectTapIndex > -1) {
this.tapList.splice(this.selectTapIndex, 999);
}
if (!item.parent_id) {
this.selectList.push(item);
return;
}
let str = '';
str =
serialize(this.tapList)
.map(val => val.name)
.join('/') +
'/' +
item.name;
this.selectList.push({ ...item, name: str });
},
//
delSelectItem(item, index) {
this.selectList.splice(index, 1);
},
//
handleGetSelectArea() {
this.$emit('handleGetSelectArea', this.selectList);
},
close() {
this.$emit('close');
},
//
handlyAddSelect(item) {
if (this.selectList.some(val => val.value == item.value)) {
Toast('已经选择过了')
return
}
//
unique(arr) {
var obj = {};
return arr.filter(ele => {
if (!obj[ele]) {
obj[ele] = true;
return true;
}
});
}
}
};
if (this.selectTapIndex > -1) {
this.tapList.splice(this.selectTapIndex, 999);
}
if (!item.parent_id) {
this.selectList.push(item);
return;
}
let str = '';
str =
serialize(this.tapList)
.map(val => val.name)
.join('/') +
'/' +
item.name;
this.selectList.push({ ...item, name: str });
},
//
delSelectItem(item, index) {
this.selectList.splice(index, 1);
},
//
handleGetSelectArea() {
this.$emit('handleGetSelectArea', this.selectList);
},
close() {
this.$emit('close');
},
//
unique(arr) {
var obj = {};
return arr.filter(ele => {
if (!obj[ele]) {
obj[ele] = true;
return true;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.area_container {
background: #fff;
border-radius: 16px 16px 0px 0px;
.area_container {
background: #fff;
border-radius: 16px 16px 0px 0px;
&_title {
text-align: center;
padding: 36rpx 30rpx 46rpx 0;
position: relative;
&_close {
position: absolute;
top: 20rpx;
right: 20rpx;
}
.manage_btn{
font-weight: normal;
color: #e93323;
font-size: 24rpx;
position: absolute;
left: 30rpx;
top: 40rpx;
}
}
&_content {
padding: 0 30rpx;
&_title {
text-align: center;
padding: 36rpx 30rpx 46rpx 0;
position: relative;
.selectList_con {
display: flex;
flex-wrap: wrap;
margin-bottom: 50rpx;
&_item {
padding: 3rpx 10rpx;
background: #fff6f5;
color: #e93323;
margin-right: 20rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
font-size: 22rpx;
> span:nth-child(1) {
display: inline-block;
margin-right: 14rpx;
white-space: nowrap;
}
.iconfont {
font-size: 24rpx;
}
}
}
&_close {
position: absolute;
top: 20rpx;
right: 20rpx;
}
.selectList_tap {
border-bottom: 1px solid #eeeeee;
display: flex;
&_item {
font-size: 28rpx;
margin-right: 60rpx;
white-space: nowrap;
}
.selectTap {
color: #e93323;
border-bottom: 3rpx solid #e93323;
padding-bottom: 21rpx;
}
}
.manage_btn {
font-weight: normal;
color: #e93323;
font-size: 24rpx;
position: absolute;
left: 30rpx;
top: 40rpx;
}
}
.selectList_area {
.scroll {
height: 597rpx;
}
&_content {
padding: 0 30rpx;
.selectList_area_item {
padding: 40rpx 0;
display: flex;
justify-content: space-between;
font-size: 28rpx;
.iconfont {
color: #e93323;
font-size: 40rpx;
}
.selectList_con {
display: flex;
flex-wrap: wrap;
margin-bottom: 50rpx;
.selectList_area_item_name {
flex: 0.7;
}
}
}
&_item {
padding: 3rpx 10rpx;
background: #fff6f5;
color: #e93323;
margin-right: 20rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
font-size: 22rpx;
.handle {
height: 126rpx;
&_button {
width: 690rpx;
height: 86rpx;
background: #e93323;
border-radius: 43rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #fff;
}
}
}
}
</style>
>span:nth-child(1) {
display: inline-block;
margin-right: 14rpx;
white-space: nowrap;
}
.iconfont {
font-size: 24rpx;
}
}
}
.selectList_tap {
border-bottom: 1px solid #eeeeee;
display: flex;
&_item {
font-size: 28rpx;
margin-right: 60rpx;
white-space: nowrap;
}
.selectTap {
color: #e93323;
border-bottom: 3rpx solid #e93323;
padding-bottom: 21rpx;
}
}
.selectList_area {
.scroll {
height: 597rpx;
}
.selectList_area_item {
padding: 40rpx 0;
display: flex;
justify-content: space-between;
font-size: 28rpx;
.iconfont {
color: #e93323;
font-size: 40rpx;
}
.selectList_area_item_name {
flex: 0.7;
}
}
}
.handle {
height: 126rpx;
&_button {
width: 690rpx;
height: 86rpx;
background: #e93323;
border-radius: 43rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #fff;
}
}
}
}
</style>

View File

@ -119,25 +119,29 @@
getArticleList(19).then(res => {
this.recoList = res.data.list
})
console.log("位置", JSON.parse(this.location));
const LOCA = JSON.parse(this.location)
this.street_id = LOCA.address_reference.town.id
this.getCloudShopMerId(this.street_id)
this.town = LOCA.address_component.street ?? ''
this.getTownAndStoreId()
},
onShow() {},
computed: mapGetters(['location']),
watch: {
location(newVal, oldVal) {
console.log('newVal', newVal);
return newVal
location: {
handler(newVal, oldVal) {
this.street_id = newVal.address_reference.town.id
this.getCloudShopMerId(this.street_id)
this.town = newVal.address_component.street ?? ''
},
immediate: true
}
},
methods: {
getTownAndStoreId() {
const LOCA = JSON.parse(this.location)
this.street_id = LOCA.address_reference.town.id
this.getCloudShopMerId(this.street_id)
this.town = LOCA.address_component.street ?? ''
},
selectPlce(e) {
console.log("e", e);
this.street_id = e.value[1].code
this.store_id = e.value[1].id
this.town = e.value[1].name
this.getCloudShopMerId(e.value[1].code)
},

View File

@ -7,17 +7,10 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
getUserInfo
} from "../../api/user.js";
import {
LOGIN_STATUS,
UID
} from '../../config/cache';
import { getUserInfo } from "../../api/user.js";
import { LOGIN_STATUS, UID } from '../../config/cache';
import Cache from '../../utils/cache';
import {
USER_INFO
} from '../../config/cache';
import { USER_INFO } from '../../config/cache';
const state = {
location: Cache.get('LOCATION_DATA') || {},
@ -36,7 +29,7 @@ const state = {
const mutations = {
setLocation(state, data) {
state.loca = data
state.location = data
Cache.set('LOCATION_DATA', data);
},
LOGIN(state, opt) {