优化:总平台商品在商品详情、下单确认页面显示内容优化,不显示店铺信息

添加:下单时多个提货点选择切换兼容
This commit is contained in:
wuhui_zzw 2024-04-11 15:09:37 +08:00
parent e20fc95141
commit ad021f07ff
3 changed files with 275 additions and 155 deletions

View File

@ -38,7 +38,7 @@
<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}}
{{storeInfo.store_name || ''}}
</view>
<view class="fenxiang_btn" @click="listenerActionSheet">
<view class='iconfont icon-fenxiang'></view>
@ -200,7 +200,7 @@
</view>
</view>
<!-- 商铺信息 -->
<view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-wrapper" v-if="Object.values(storeInfo.merchant).length > 0 && hide_mer_status !=1">
<view class="store-hd skeleton-rect">
<view v-if="hide_mer_status != 1" class="store-info">
<navigator :url="'/pages/store/home/index?id='+storeInfo.merchant.mer_id" hover-class="none" class="logo">
@ -282,7 +282,7 @@
</scroll-view>
</view>
<view class='footer acea-row row-between-wrapper'>
<block v-if="storeInfo.merchant">
<block v-if="storeInfo && storeInfo.merchant">
<view v-if="storeInfo.merchant.services_type== 0" class="item skeleton-rect" @click="goCustomer">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
@ -1074,7 +1074,8 @@
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1)
} else if (storeInfo.video_link && storeInfo.slider_image.length === 1) {
}
else if (storeInfo.video_link && storeInfo.slider_image.length === 1) {
this.videoCoverImg = storeInfo.slider_image[0]
}
that.$set(that, 'storeInfo', storeInfo);
@ -1117,21 +1118,33 @@
}
that.$set(that, 'guarantee', res.data.guaranteeTemplate ? res.data.guaranteeTemplate : []);
that.$set(that, 'shippingValue', res.data.temp ? res.data.temp.name : '');
that.$set(that.specsInfo, 'params', res.data.params);
that.$set(that.storeInfo, 'merchant', res.data.merchant);
that.$set(that.specsInfo, 'params', res.data.params);
that.$set(that.storeInfo, 'spu_id', res.data.spu_id);
that.$set(that.storeInfo, 'community', res.data.community);
that.$set(that.storeInfo, 'top_name', res.data.top_name);
that.$set(that.storeInfo, 'atmosphere_pic', res.data.atmosphere_pic);
//
let merchant = res.data.merchant || {};
let merId = Number(merchant.mer_id) || 0;
console.log("相关商户信息")
console.log(merId)
that.$set(that.storeInfo, 'merchant', (Number(merId) > 0 ? merchant : {}));
console.log("商户信息");
console.log(that.storeInfo.merchant);
//
that.$set(that, 'buy_agreement', res.data.buy_agreement ? (res.data.buy_agreement.content || '') : '');
if(that.buy_agreement) that.is_agree = false;
that.$set(that, 'countdown', res.data.countdown ? (Number(res.data.countdown) > 0 ? Number(res.data.countdown) : 10) : 10);
})
if (that.isLogin) {
that.downloadFilePromotionCode();
that.getCartCount();
};
if (that.isLogin) {
that.downloadFilePromotionCode();
that.getCartCount();
}
// #ifdef H5
that.ShareInfo();
// #endif

View File

@ -54,7 +54,7 @@
<text v-else-if="item.is_trader" class="font-bg-red ml8">自营</text>
</view>
<view class="mer-btn">
<view class="">
<view v-if="sotreParam.merchant_type != 2">
{{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+''}}人关注
</view>
<view class="line" v-if="item.distance"></view>
@ -69,7 +69,7 @@
</view>
</view>
<view class="pro-box" :class="'styleType'+store_street_theme">
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<view @click="goProduct(itemn)" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<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})` }" class="border-picture"></view>
@ -77,7 +77,7 @@
<view class="price">
<text></text>{{itemn.price}}
</view>
</navigator>
</view>
</view>
</view>
</block>
@ -93,7 +93,7 @@
<text v-else-if="item.is_trader" class="font-bg-red ml8">自营</text>
</view>
<view class="mer-btn">
<view class="">
<view v-if="sotreParam.merchant_type != 2">
{{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+''}}人关注
</view>
<view class="line" v-if="item.distance"></view>
@ -106,7 +106,7 @@
</view>
</view>
<view class="pro-box">
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<view @click="goProduct(itemn)" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<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})` }" class="border-picture"></view>
@ -114,7 +114,7 @@
<view class="price">
<text></text>{{itemn.price}}
</view>
</navigator>
</view>
</view>
</view>
</view>
@ -132,7 +132,7 @@
<text v-else-if="item.is_trader" class="font-bg-red ml8">自营</text>
</view>
<view class="mer-btn">
<view class="">
<view v-if="sotreParam.merchant_type != 2">
{{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+''}}人关注
</view>
<view class="line" v-if="item.distance"></view>
@ -147,7 +147,7 @@
</view>
</view>
<view class="pro-box" :class="'styleType'+store_street_theme">
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<view @click="goProduct(itemn)" class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn' v-if="item.recommend.length<=3">
<view class="picture">
<image :src="itemn.image"></image>
<view v-if="itemn.border_pic" :style="{ backgroundImage: `url(${itemn.border_pic})` }" class="border-picture"></view>
@ -155,7 +155,7 @@
<view class="price">
<text></text>{{itemn.price}}
</view>
</navigator>
</view>
</view>
</view>
</block>
@ -488,7 +488,7 @@
},
//
goStore(id) {
if (this.hide_mer_status != 1) {
if (this.hide_mer_status != 1 && this.sotreParam.merchant_type != 2) {
uni.navigateTo({
url: `/pages/store/home/index?id=${id}`
})
@ -557,6 +557,17 @@
}
})
},
//
goProduct(product){
if (this.sotreParam.merchant_type != 2) {
uni.navigateTo({
url: `/pages/goods_details/index?id=${product.product_id}`
})
}
}
},
//
onPullDownRefresh() {},

View File

@ -24,10 +24,10 @@
<!-- 商品信息 -->
<view class="storeinfo-wrapper">
<view class="store-item" v-for="(item,index) in cartInfo" :key="index">
<view class="store-title">
<view class="store-title" v-if="Number(item.mer_id) > 0">
<text class="iconfont icon-shangjiadingdan"></text>
<view class="txt" @click="goStore(item.mer_id)">{{item.mer_name}}</view>
<text class="iconfont icon-xiangyou"></text>
<view class="txt" @click="goStore(item.mer_id)">{{item.mer_name}}</view>
<text class="iconfont icon-xiangyou"></text>
</view>
<view v-for="(goods,j) in item.list" :key="j">
<view v-if="goods.product_type == 2">
@ -114,24 +114,63 @@
</view>
</view>
<view class="wrapper">
<!-- 配送方式 -->
<view class="boxs">
<view class='item acea-row row-between-wrapper'>
<view>配送方式</view>
<view v-if="item.delivery_way.length == 2 && (item.order.allow_delivery && item.order.allow_take)" class='discount' @tap="openShowBox(item,index)">
<view
v-if="item.delivery_way.length == 2 && (item.order.allow_delivery && item.order.allow_take)"
class='discount'
@tap="openShowBox(item,index)">
{{item.order.isTake==0 ? deliveryName :'到店核销'}}
<text v-if="order_model != 2" class='iconfont icon-jiantou'></text>
</view>
<view v-else class='discount'>
{{item.order.isTake==0 ? deliveryName :'到店核销'}}
</view>
<view v-else class='discount'>{{item.order.isTake==0 ? deliveryName :'到店核销'}}</view>
</view>
<view class="store-address" v-if="item.order.isTake">
<view class="name line2">{{item.take.mer_take_name}}</view>
<view class="info line2">{{item.take.mer_take_address}}</view>
<view class="map" @click="goMap(item)">
<text class="iconfont icon-chakanditu"></text>
<view class="map_text">查看地图</view>
</view>
<!--多个提货点处理-->
<picker
v-if="Object.values((item.delivery_way_list || {})).length > 1"
class="picker-content"
@change="pointChange($event, item)"
:range="Object.values(item.delivery_way_list || {})"
range-key="mer_take_name">
<view class="point-content point-multiple">
<block v-if="!item.take.mer_take_name">
<view class="left">请选择提货点</view>
<view class="right">
<text class="iconfont icon-xiangxia" v-if="Object.values((item.delivery_way_list || {})).length > 1"></text>
</view>
</block>
<block v-else>
<view class="left">
<view class="mer_take_name">{{item.take.mer_take_name || ''}}</view>
<view class="mer_take_address">{{item.take.mer_take_address || ''}}</view>
</view>
<view class="right">
<view class="map" @click="goMap(item)">
<text class="iconfont icon-chakanditu"></text>
<view class="map_text">查看地图</view>
</view>
<text class="iconfont icon-xiangxia" v-if="Object.values((item.delivery_way_list || {})).length > 1"></text>
</view>
</block>
</view>
</picker>
<!--单个提货点-->
<view v-else class="point-content">
<view class="left">
<view class="mer_take_name">{{item.take.mer_take_name || ''}}</view>
<view class="mer_take_address">{{item.take.mer_take_address || ''}}</view>
</view>
<view class="right">
<view class="map" @click="goMap(item)">
<text class="iconfont icon-chakanditu"></text>
<view class="map_text">查看地图</view>
</view>
<text class="iconfont icon-xiangxia" v-if="Object.values((item.delivery_way_list || {})).length > 1"></text>
</view>
</view>
</view>
</view>
<!--<view class="boxs" v-if="item.order.total_integral > 0">
@ -430,13 +469,13 @@
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<block v-if="isShowBox">
<checkDelivery :deliveryName="deliveryName" :isShowBox="isShowBox" :activeObj="activeObj" :radioList="radioList" @close="boxClose" @confirmBtn="getData">
</checkDelivery>
<checkDelivery :deliveryName="deliveryName" :isShowBox="isShowBox" :activeObj="activeObj" :radioList="radioList" @close="boxClose" @confirmBtn="getData"></checkDelivery>
</block>
<!--优惠明细弹窗-->
<discountDetails :isShowDiscount="isShowDiscount" @close="closeDiscount" :couponData="couponData"></discountDetails>
</view>
</template>
<script>
import Cache from "../../../utils/cache";
@ -649,6 +688,9 @@
//
is_with_goods: 0,// 0=1=
withGoodsMerInfo: {},
//
points: {},
};
},
computed: {
@ -1026,6 +1068,7 @@
cart_id: that.cartId.split(","),
address_id: address_id,
takes: that.take,
points: that.points || {},
use_coupon: that.subCoupon,
use_integral: that.use_integral,
// use_mer_integral: that.use_mer_integral,
@ -1460,126 +1503,105 @@
this.virtualIndex = index;
},
SubOrder: function(e) {
let that = this,
data = {};
if (!that.payType) return that.$util.Tips({
title: '请选择支付方式'
});
if (that.orderStatus == 'noAddress') return that.$util.Tips({
title: '请选择收货地址'
});
if (that.orderStatus != 'finish' && that.order_model == 0) {
return that.$util.Tips({
title: '收货地址不在配送区域'
});
}
if (that.orderStatus == 'noDeliver') {
return that.$util.Tips({
title: '暂不发货'
});
}
if (that.order_type == 2 && !that.isAgree && that.cartInfo[0].list[0].productPresell.presell_type ==
2) {
return that.$util.Tips({
title: '请阅读并勾选协议,否则无法进行操作'
});
}
if(that.order_model == 1 && that.order_extend.length > 0){
for(var i=0; i<that.order_extend.length; i++){
let el = that.order_extend[i]
if (el.require) {
if(!el.value || el.value.length == 0){
return that.$util.Tips({
title: '请填写'+el.title
});
}else if(el.key == 'mobile' && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}else if(el.key == 'email' && !/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}else if(el.key == 'idCard' && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}
}else if(el.value){
if(el.key == 'mobile' && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}if(el.key == 'email' && !/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}if(el.key == 'idCard' && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/.test(el.value)){
return that.$util.Tips({
title: '请输入正确的'+el.title
});
}
}
that.extend[i] = {title: el.title,value: el.value}
}
}
if (that.is_take) {
if(!that.post.real_name){
return that.$util.Tips({
title: '请填写收货人姓名'
});
}
if(!that.post.phone){
return that.$util.Tips({
title: '请填写收货人电话'
});
}
if(that.post.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.post.phone)){
return that.$util.Tips({
title: '收货人电话格式不正确'
});
}
}
data = {
cart_id: this.cartId.split(","),
address_id: this.addressId,
use_coupon: this.subCoupon,
pay_type: this.payType,
mark: this.msgObj,
order_type: this.order_type,
key: this.order_key,
takes: this.take,
use_integral: this.use_integral,
let that = this, data = {};
if (!that.payType) return that.$util.Tips({title: '请选择支付方式'});
if (that.orderStatus == 'noAddress') return that.$util.Tips({title: '请选择收货地址'});
if (that.orderStatus != 'finish' && that.order_model == 0) return that.$util.Tips({title: '收货地址不在配送区域'});
if (that.orderStatus == 'noDeliver') return that.$util.Tips({title: '暂不发货'});
if (that.order_type == 2 && !that.isAgree && that.cartInfo[0].list[0].productPresell.presell_type == 2) return that.$util.Tips({title: '请阅读并勾选协议,否则无法进行操作'});
if (that.order_model == 1 && that.order_extend.length > 0) {
for (var i = 0; i < that.order_extend.length; i++) {
let el = that.order_extend[i]
if (el.require) {
if (!el.value || el.value.length == 0) {
return that.$util.Tips({
title: '请填写' + el.title
});
}
else if (el.key == 'mobile' && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
else if (el.key == 'email' && !/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
else if (el.key == 'idCard' && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
} else if (el.value) {
if (el.key == 'mobile' && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
if (el.key == 'email' && !/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
if (el.key == 'idCard' && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/.test(el.value)) {
return that.$util.Tips({
title: '请输入正确的' + el.title
});
}
}
that.extend[i] = {title: el.title, value: el.value}
}
}
if (that.is_take) {
if (!that.post.real_name) {
return that.$util.Tips({
title: '请填写收货人姓名'
});
}
if (!that.post.phone) {
return that.$util.Tips({
title: '请填写收货人电话'
});
}
if (that.post.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.post.phone)) {
return that.$util.Tips({
title: '收货人电话格式不正确'
});
}
}
data = {
cart_id: this.cartId.split(","),
address_id: this.addressId,
use_coupon: this.subCoupon,
pay_type: this.payType,
mark: this.msgObj,
order_type: this.order_type,
key: this.order_key,
takes: this.take,
use_integral: this.use_integral,
// use_mer_integral: this.use_mer_integral,
// use_platform_integral: this.use_platform_integral,
receipt_data: this.invoiceData,
extend: this.extend,
post: this.post,
// #ifdef H5
return_url: 'http://' + window.location.host + '/pages/users/order_list/index',
// #endif
};
if (data.mark && this.isEmojiCharacter(data.mark[Object.keys(data.mark)[0]])) {
that.$util.Tips({
title: '备注不允许输入表情!'
});
return;
}
data.takes=[]
this.cartInfo.map(el => {
if (el.isTake == 1 || el.order.isTake) {
data.takes.push(el.mer_id)
}
})
if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
return that.$util
.Tips({
title: '余额不足!'
});
uni.showLoading({
title: '订单支付中',
mask: true
});
receipt_data: this.invoiceData,
extend: this.extend,
post: this.post,
// #ifdef H5
return_url: 'http://' + window.location.host + '/pages/users/order_list/index',
// #endif
};
if (data.mark && this.isEmojiCharacter(data.mark[Object.keys(data.mark)[0]])) return that.$util.Tips({title: '备注不允许输入表情!'});
data.takes = []
this.cartInfo.map(el => {
if (el.isTake == 1 || el.order.isTake) {
data.takes.push(el.mer_id)
}
})
if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice)) return that.$util.Tips({title: '余额不足!'});
uni.showLoading({
title: '订单支付中',
mask: true
});
// #ifdef MP
openPaySubscribe().then(() => {
that.payment(data);
@ -1672,7 +1694,19 @@
// #ifdef H5
}
//#endif
}
},
//
pointChange(event, item){
let index = event.detail.value || event.target.value;
let pointList = Object.assign({}, Object.values(item.delivery_way_list || {}));
let usePoint = pointList[index] || {};
// console.log(' ',index)
// console.log('使', usePoint)
this.points[item.mer_id] = usePoint.id;
this.getConfirm(this.addressId);
}
}
}
</script>
@ -1714,6 +1748,68 @@
text-align: right;
}
}
.store-address{
.picker-content{
width: 100% !important;
}
.point-content{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.left{
width: calc(100% - 130rpx);
.mer_take_name{
width: 100%;
font-size: 30rpx;
height: 45rpx;
line-height: 45rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mer_take_address{
width: 100%;
font-size: 26rpx;
height: 35rpx;
line-height: 35rpx;
color: #aaaaaa;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.right{
width: 130rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-end;
align-items: center;
.map{
.icon-chakanditu{}
.map_text{}
}
.icon-xiangxia{
width: 60rpx;
text-align: right;
font-size: 35rpx;
cursor: pointer;
}
}
}
.point-multiple{
.left{
width: calc(100% - 200rpx) !important;
}
.right{
width: 200rpx !important;
}
}
}
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
@ -2373,7 +2469,7 @@
}
.map {
text-align: center;
padding-left: 40rpx;
padding-left: 25rpx;
position: relative;
&::before {
content: '';