商品类型修改

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

View File

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

View File

@ -90,11 +90,9 @@
<view class='money acea-row row-middle'>
<view>
<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 v-if="goods.productAttr.show_svip_price" class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view> -->
</view>
</view>
<view class='carnum acea-row row-center-wrapper'>
@ -180,8 +178,8 @@
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block>
<!-- 组件 -->
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent"
@ChangeAttr="ChangeAttr" @goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
<Authorize :isShowAuth="isShowAuth"></Authorize>
<!--自定义底部tab栏-->
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
@ -260,7 +258,7 @@
}],
tabsCurr: 1,
subsecCurr: 0,
addcartKey: 0,
addcartKey: 0,
domain: HTTP_REQUEST_URL,
loading: false, //
loadend: false, //
@ -306,7 +304,7 @@
currSku: '',
newData: {},
activeRouter: '',
attrTxt: '',
attrTxt: '',
userInfo: {},
mer_info: {
mer_settlement_agree_status: 0
@ -512,12 +510,12 @@
// //
// that.DefaultSelect(goods)
cartProductAttr(id).then(res => {
if(res.data.attr.length==0)return Toast('此商品为单规格商品');
const sku = {};
res.data.attrValue.forEach((itemn) => {
if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; //
sku[itemn.sku] = itemn;
})
if (res.data.attr.length == 0) return Toast('此商品为单规格商品');
const sku = {};
res.data.attrValue.forEach((itemn) => {
if (this.tabsCurr == 2) itemn.price = itemn.wholesale_price; //
sku[itemn.sku] = itemn;
})
goods.attr = res.data.attr;
goods.attrValue = res.data.attrValue
that.attrValue = goods.productAttr.sku
@ -528,7 +526,7 @@
that.$set(that, 'productValue', sku);
let productSelect = sku[that.attrValue];
that.isOpen = that.attr.cartAttr = true;
this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0];
this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0];
that.DefaultSelect(goods)
}).catch(err => {
return that.$util.Tips({

View File

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

View File

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