商品类型修改

This commit is contained in:
1154079537 2024-05-10 15:13:22 +08:00
parent 1b75268986
commit 7e746654fc
5 changed files with 158 additions and 94 deletions

View File

@ -1,9 +1,11 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')"> <view class="product-window"
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')">
<view class="textpic acea-row row-between-wrapper"> <view class="textpic acea-row row-between-wrapper">
<view class="pictrue"> <view class="pictrue">
<image :src="(attr.productSelect&&attr.productSelect.image) ? attr.productSelect.image : ''" @click="loookImg"></image> <image :src="(attr.productSelect&&attr.productSelect.image) ? attr.productSelect.image : ''"
@click="loookImg"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="line1"> <view class="line1">
@ -13,7 +15,8 @@
<view> <view>
预售价 预售价
<text class="num">{{ attr.productSelect.price }}</text> <text class="num">{{ attr.productSelect.price }}</text>
<text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></text> <text v-if="presell_type === 2">定金<text
class="num">{{ attr.productSelect.down_price }}</text></text>
</view> </view>
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text> <text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text> <text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
@ -22,11 +25,12 @@
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<text></text><text class="num">{{ attr.productSelect.price }}</text> <text></text><text class="num">{{ attr.productSelect.price }}</text>
<view v-if="attr.productSelect && attr.productSelect.svip_price" class="acea-row row-middle"> <view v-if="attr.productSelect && attr.productSelect.svip_price"
<text class='vip-money'>{{attr.productSelect.svip_price}}</text> class="acea-row row-middle">
<!-- <text class='vip-money'>{{attr.productSelect.svip_price}}</text>
<view class="vipImg"> <view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image> <image :src="`${domain}/static/images/svip.png`"></image>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@ -42,8 +46,8 @@
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw"> <view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
<view class="title">{{ item.attr_name }}</view> <view class="title">{{ item.attr_name }}</view>
<view class="listn acea-row row-middle"> <view class="listn acea-row row-middle">
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value" <view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
@click="tapAttr(indexw, indexn)" :key="indexn"> v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn">
{{ itemn.attr }} {{ itemn.attr }}
</view> </view>
</view> </view>
@ -67,8 +71,12 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { mapGetters } from "vuex"; import {
import { HTTP_REQUEST_URL } from '@/config/app'; mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
props: { props: {
@ -114,11 +122,10 @@
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
} }
}, },
mounted(){ mounted() {},
},
methods: { methods: {
// //
loookImg(){ loookImg() {
let self = this let self = this
let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image] let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image]
uni.previewImage({ uni.previewImage({
@ -172,72 +179,89 @@
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); /// IOS>11.2/ padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9); transition: all .3s cubic-bezier(.25, .5, .5, .9);
&.presell-window { &.presell-window {
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
} }
.product-window.on { .product-window.on {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
.product-window.join { .product-window.join {
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.product-window .textpic { .product-window .textpic {
padding: 0 80rpx 0 30rpx; padding: 0 80rpx 0 30rpx;
margin-top: 29rpx; margin-top: 29rpx;
position: relative; position: relative;
} }
.product-window .textpic .pictrue { .product-window .textpic .pictrue {
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.product-window .textpic .pictrue image { .product-window .textpic .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx; border-radius: 10rpx;
} }
.product-window .textpic .text { .product-window .textpic .text {
width: 460rpx; width: 460rpx;
font-size: 32rpx; font-size: 32rpx;
color: #202020; color: #202020;
} }
.product-window .textpic .text .money { .product-window .textpic .text .money {
font-size: 24rpx; font-size: 24rpx;
margin-top: 40rpx; margin-top: 40rpx;
color: var(--view-priceColor); color: var(--view-priceColor);
} }
.product-window .textpic .text .money .num { .product-window .textpic .text .money .num {
font-size: 36rpx; font-size: 36rpx;
} }
.product-window .textpic .text .money .stock { .product-window .textpic .text .money .stock {
color: #999; color: #999;
margin-left: 18rpx; margin-left: 18rpx;
} }
.vip-money { .vip-money {
color: #282828; color: #282828;
font-size: 22rpx; font-size: 22rpx;
margin-left: 6rpx; margin-left: 6rpx;
} }
.vipImg { .vipImg {
width: 65rpx; width: 65rpx;
height: 28rpx; height: 28rpx;
margin-left: 4rpx; margin-left: 4rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
} }
.product-window .textpic .text .presell_price { .product-window .textpic .text .presell_price {
color: #FF7F00; color: #FF7F00;
.num { .num {
display: inline-block; display: inline-block;
margin-right: 20rpx; margin-right: 20rpx;
} }
.stock { .stock {
margin-left: 0; margin-left: 0;
} }
} }
.product-window .textpic .iconfont { .product-window .textpic .iconfont {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
@ -245,22 +269,27 @@
font-size: 35rpx; font-size: 35rpx;
color: #8a8a8a; color: #8a8a8a;
} }
.product-window .productWinList { .product-window .productWinList {
max-height: 395rpx; max-height: 395rpx;
overflow: auto; overflow: auto;
margin-top: 36rpx; margin-top: 36rpx;
} }
.product-window .productWinList .item~.item { .product-window .productWinList .item~.item {
margin-top: 36rpx; margin-top: 36rpx;
} }
.product-window .productWinList .item .title { .product-window .productWinList .item .title {
font-size: 30rpx; font-size: 30rpx;
color: #999; color: #999;
padding: 0 30rpx; padding: 0 30rpx;
} }
.product-window .productWinList .item .listn { .product-window .productWinList .item .listn {
padding: 0 30rpx 0 16rpx; padding: 0 30rpx 0 16rpx;
} }
.product-window .productWinList .item .listn .itemn { .product-window .productWinList .item .listn .itemn {
border: 1px solid #bbb; border: 1px solid #bbb;
font-size: 26rpx; font-size: 26rpx;
@ -269,11 +298,13 @@
border-radius: 6rpx; border-radius: 6rpx;
margin: 14rpx 0 0 14rpx; margin: 14rpx 0 0 14rpx;
} }
.product-window .productWinList .item .listn .itemn.on { .product-window .productWinList .item .listn .itemn.on {
color: #fff; color: #fff;
background-color: var(--view-theme); background-color: var(--view-theme);
border-color: var(--view-theme); border-color: var(--view-theme);
} }
.product-window .cart { .product-window .cart {
margin-top: 36rpx; margin-top: 36rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -286,14 +317,17 @@
-ms-flex-pack: justify; -ms-flex-pack: justify;
justify-content: space-between; justify-content: space-between;
} }
.product-window .cart .title { .product-window .cart .title {
font-size: 30rpx; font-size: 30rpx;
color: #999; color: #999;
line-height: 54rpx; line-height: 54rpx;
} }
.product-window .cart .carnum { .product-window .cart .carnum {
height: 54rpx; height: 54rpx;
} }
.product-window .cart .carnum view { .product-window .cart .carnum view {
border: 1px solid #a4a4a4; border: 1px solid #a4a4a4;
width: 84rpx; width: 84rpx;
@ -303,28 +337,34 @@
color: #a4a4a4; color: #a4a4a4;
font-size: 45rpx; font-size: 45rpx;
} }
.product-window .cart .carnum .reduce { .product-window .cart .carnum .reduce {
border-right: 0; border-right: 0;
border-radius: 6rpx 0 0 6rpx; border-radius: 6rpx 0 0 6rpx;
line-height: 48rpx; line-height: 48rpx;
} }
.product-window .cart .carnum .reduce.on { .product-window .cart .carnum .reduce.on {
border-color: #e3e3e3; border-color: #e3e3e3;
color: #dedede; color: #dedede;
} }
.product-window .cart .carnum .plus { .product-window .cart .carnum .plus {
border-left: 0; border-left: 0;
border-radius: 0 6rpx 6rpx 0; border-radius: 0 6rpx 6rpx 0;
line-height: 46rpx; line-height: 46rpx;
} }
.product-window .cart .carnum .plus.on { .product-window .cart .carnum .plus.on {
border-color: #e3e3e3; border-color: #e3e3e3;
color: #dedede; color: #dedede;
} }
.product-window .cart .carnum .num { .product-window .cart .carnum .num {
color: #282828; color: #282828;
font-size: 28rpx; font-size: 28rpx;
} }
.product-window .joinBnt { .product-window .joinBnt {
font-size: 30rpx; font-size: 30rpx;
width: 620rpx; width: 620rpx;
@ -334,10 +374,12 @@
line-height: 86rpx; line-height: 86rpx;
color: #fff; color: #fff;
margin: 100rpx auto 0 auto; margin: 100rpx auto 0 auto;
&.b-color{
&.b-color {
background-color: var(--view-theme); background-color: var(--view-theme);
} }
} }
.product-window .joinBnt.on { .product-window .joinBnt.on {
background-color: #bbb; background-color: #bbb;
color: #fff; color: #fff;

View File

@ -285,7 +285,7 @@
backColor: 'rgba(252, 252, 252, 0)', backColor: 'rgba(252, 252, 252, 0)',
newData: {}, newData: {},
activeRouter: '', activeRouter: '',
userInfo: {}, // userInfo: {},
}; };
}, },
computed: { computed: {

View File

@ -90,11 +90,9 @@
<view class='money acea-row row-middle'> <view class='money acea-row row-middle'>
<view> <view>
<text class="money-price">{{goods.productAttr.price}}</text> <text class="money-price">{{goods.productAttr.price}}</text>
<text class="money-unit">/</text> <text
class="money-unit">/{{goods.productAttr.sku || goods.product.unit_name}}</text>
</view> </view>
<!-- <view v-if="goods.productAttr.show_svip_price" class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view> -->
</view> </view>
</view> </view>
<view class='carnum acea-row row-center-wrapper'> <view class='carnum acea-row row-center-wrapper'>
@ -180,8 +178,8 @@
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow> @ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block> </block>
<!-- 组件 --> <!-- 组件 -->
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" <addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent"
@goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow> @ChangeAttr="ChangeAttr" @goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
<Authorize :isShowAuth="isShowAuth"></Authorize> <Authorize :isShowAuth="isShowAuth"></Authorize>
<!--自定义底部tab栏--> <!--自定义底部tab栏-->
<customTab :newData="newData" :activeRouter="activeRouter"></customTab> <customTab :newData="newData" :activeRouter="activeRouter"></customTab>
@ -512,10 +510,10 @@
// // // //
// that.DefaultSelect(goods) // that.DefaultSelect(goods)
cartProductAttr(id).then(res => { cartProductAttr(id).then(res => {
if(res.data.attr.length==0)return Toast('此商品为单规格商品'); if (res.data.attr.length == 0) return Toast('此商品为单规格商品');
const sku = {}; const sku = {};
res.data.attrValue.forEach((itemn) => { res.data.attrValue.forEach((itemn) => {
if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; // if (this.tabsCurr == 2) itemn.price = itemn.wholesale_price; //
sku[itemn.sku] = itemn; sku[itemn.sku] = itemn;
}) })
goods.attr = res.data.attr; goods.attr = res.data.attr;

View File

@ -110,17 +110,19 @@
<block v-if="orderStatus == 0"> <block v-if="orderStatus == 0">
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
<view @click='goOrderDetails(item.group_order_id)'> <view @click='goOrderDetails(item.group_order_id)'>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j">
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper"> <view class="acea-row row-middle left-wrapper">
<text class="iconfont icon-shangjiadingdan"></text> <text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name line1">{{item.orderList[0].merchant.mer_name}}</view> <view class="store-name line1">{{order.merchant.mer_name}}
</view>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
<view class='t-color'> <view class='t-color'>
{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }} {{ order.activity_type === 2 && order.orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view> </view>
</view> </view>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j">
<!--预售--> <!--预售-->
<view v-if="order.activity_type === 2"> <view v-if="order.activity_type === 2">
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">

View File

@ -20,7 +20,6 @@
</view> </view>
<view class="wholeSale-header-search-wrap"> <view class="wholeSale-header-search-wrap">
<u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr" <u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr"
mode="subsection" activeColor="#40ae36" fontSize="14" style="margin-bottom: 24rpx;"></u-subsection> mode="subsection" activeColor="#40ae36" fontSize="14" style="margin-bottom: 24rpx;"></u-subsection>
@ -35,11 +34,11 @@
:value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" disabled :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" disabled
style="pointer-events: none;"> style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> -->
</view> </view>
</view> </view>
<!-- 商品大分类 --> <!-- 商品大分类 -->
<view class="category_wrap" :style="{height:categoryWrapHeight+'px'}">
<view class="category"> <view class="category">
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="category-wrap"> <view class="category-wrap">
@ -83,6 +82,7 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
<!-- 综合查询 --> <!-- 综合查询 -->
<view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)"> <view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
@ -107,6 +107,7 @@
<image class="loudou" src="@/static/new_define/loudou.png"></image> <image class="loudou" src="@/static/new_define/loudou.png"></image>
</view> </view>
</view> </view>
<!-- 综合查询 --> <!-- 综合查询 -->
<view class="comprehensive" v-if="deduction_rate && tabsCurr==1"> <view class="comprehensive" v-if="deduction_rate && tabsCurr==1">
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate==''}" <view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate==''}"
@ -144,8 +145,6 @@
<view class="goods_list" v-else> <view class="goods_list" v-else>
<view class="goods" v-for="(item, index) in shopList" :key="index" @click="goStore(item.mer_id)"> <view class="goods" v-for="(item, index) in shopList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar"> <view class="avatar">
<!-- <image style="width: 100%;height: 100%;" :src="item.mer_avatar" mode="aspectFill" lazy-load>
</image> -->
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill"> <u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading> <template v-slot:loading>
<u-loading-icon color="#999" size="15" /> <u-loading-icon color="#999" size="15" />
@ -267,14 +266,17 @@
limit: 20, limit: 20,
sale_type: 2, //1, 2 sale_type: 2, //1, 2
mer_type: 1, mer_type: 1,
mer_cate_id: '', // mer_cate_pid: '', //
cate_id: '', cate_id: '',
keyword: '', keyword: '',
deduction_rate: '', // deduction_rate: '', //
order: '', // sales, price_asc, price_desc order: '', // sales, price_asc, price_desc
rand: 1, rand: 1,
}, },
isIndexClick: true isIndexClick: true,
bigTypeDomInfo: null,
smallTypeDomInfo: null,
categoryWrapHeight: 0,
} }
}, },
computed: { computed: {
@ -300,7 +302,6 @@
}, },
onShow() { onShow() {
console.log(this.isIndexClick)
this.isIndexClick = false; this.isIndexClick = false;
}, },
@ -327,6 +328,13 @@
onReachBottom() { onReachBottom() {
this.initData(false, true); this.initData(false, true);
}, },
onReady() {
// dom
this.$util.getDom(this, '.category', (res) => {
this.bigTypeDomInfo = res;
this.categoryWrapHeight = res.height;
});
},
methods: { methods: {
initData(re = false, stop = false) { initData(re = false, stop = false) {
if (!stop) this.getStoreCategory(); if (!stop) this.getStoreCategory();
@ -407,22 +415,29 @@
this.where.merchant_category_id = this.store_category[e].merchant_category_id; this.where.merchant_category_id = this.store_category[e].merchant_category_id;
return this.storeMerchantList(true); return this.storeMerchantList(true);
} }
if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children]; if (this.store_category[e].children) this.store_category_children = [...this.store_category[e]
.children
];
this.store_category_children.unshift({ this.store_category_children.unshift({
cate_name: '全部', cate_name: '全部',
store_category_id: '' store_category_id: ''
}) })
this.cate_change_children = 0; this.cate_change_children = 0;
if (this.tabsCurr == 1) this.where.mer_cate_id = this.store_category[e].store_category_id; if (this.tabsCurr == 1) this.where.mer_cate_pid = this.store_category[e].store_category_id;
else { else {
this.where.cate_pid = this.store_category[e].store_category_id; this.where.cate_pid = this.store_category[e].store_category_id;
this.where.cate_id = ""; this.where.cate_id = "";
} }
this.getProductslist(true); this.getProductslist(true);
//
this.$util.getDom(this, '.cate', (res) => {
if (res) this.smallTypeDomInfo = res.data;
})
}, },
changeChildrenCate(e) { changeChildrenCate(e) {
this.cate_change_children = e; this.cate_change_children = e;
let key = 'mer_cate_id'; let key = 'mer_cate_pid';
if (this.tabsCurr != 1) key = 'cate_id'; if (this.tabsCurr != 1) key = 'cate_id';
this.where[key] = this.store_category_children[e].store_category_id; this.where[key] = this.store_category_children[e].store_category_id;
if (e == 0) this.where[key] = this.store_category[this.cate_change].store_category_id; // , id if (e == 0) this.where[key] = this.store_category[this.cate_change].store_category_id; // , id
@ -430,7 +445,9 @@
}, },
getStoreCategory() { getStoreCategory() {
this.store_category = []; this.store_category = [];
if (this.tabsCurr == 1) getStoreCategory(259).then(res => { if (this.tabsCurr == 1) getStoreCategory(259, {
sale_type: 2
}).then(res => {
this.initStoreCate(res); this.initStoreCate(res);
}) })
else if (this.tabsCurr == 2 && this.subCurr == 1) merClassifly().then(res => { else if (this.tabsCurr == 2 && this.subCurr == 1) merClassifly().then(res => {
@ -619,6 +636,11 @@
} }
} }
.category_wrap {
overflow: hidden;
// transition: height 1s;
}
.category { .category {
width: 100%; width: 100%;
overflow: auto; overflow: auto;