优化首页商品卡片的瀑布流样式问题。解决vip页面试用开通后,其他卡片第一个还是显示试用一天问题。

This commit is contained in:
77 2024-11-05 15:57:31 +08:00
parent 9173f8c347
commit 4c2de20b28
15 changed files with 723 additions and 722 deletions

View File

@ -1,6 +1,7 @@
<!-- 订单详情 -->
<template>
<s-layout title="订单详情" class="index-wrap" navbar="normal">
<s-layout title="订单详情" navbar="normal">
<view class="new-overflow">
<!-- 订单状态 TODO -->
<!-- <view class="state-box ss-col-center new-class" :style="[
{
@ -21,11 +22,13 @@
</image>
<!-- 待评价 -->
<image v-if=" state.orderInfo.status === 30 && state.orderInfo.buttons?.includes('comment')" class="state-img"
<image v-if=" state.orderInfo.status === 30 && state.orderInfo.buttons?.includes('comment')"
class="state-img"
src="https://zysc.fjptzykj.com:3000/shangcheng/b729e67ba7b6039676a43b28ca855228ed82914f7669482b938e9696ed9cc798.png">
</image>
<!-- 已完成 -->
<image v-if=" state.orderInfo.status === 30 && !state.orderInfo.buttons?.includes('comment')" class="state-img"
<image v-if=" state.orderInfo.status === 30 && !state.orderInfo.buttons?.includes('comment')"
class="state-img"
src="https://zysc.fjptzykj.com:3000/shangcheng/7b1b2022173b3b6812ad256c836b4c5c67b6aa63a203c7d142ae90802a416e7b.png">
</image>
@ -81,8 +84,8 @@
<view class="order-list" v-for="item in state.orderInfo.items" :key="item.goods_id">
<view class="order-card">
<s-goods-item @tap="onGoodsDetail(item.spuId)" :img="item.picUrl" :title="item.spuName"
:skuText="item.properties.map((property) => property.valueName).join(' ')" :price="item.price"
:num="item.count">
:skuText="item.properties.map((property) => property.valueName).join(' ')"
:price="item.price" :num="item.count">
<template #tool>
<view class="ss-flex">
<button class="ss-reset-button apply-btn"
@ -95,14 +98,16 @@
">
申请售后
</button>
<button class="ss-reset-button apply-btn" v-if="item.afterSaleStatus === 10" @tap.stop="
<button class="ss-reset-button apply-btn" v-if="item.afterSaleStatus === 10"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', {
id: item.afterSaleId,
})
">
退款中
</button>
<button class="ss-reset-button apply-btn" v-if="item.afterSaleStatus === 20" @tap.stop="
<button class="ss-reset-button apply-btn" v-if="item.afterSaleStatus === 20"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', {
id: item.afterSaleId,
})
@ -204,7 +209,8 @@
v-if="state.orderInfo.buttons?.includes('pay')" @tap="onPay(state.orderInfo.payOrderId)">
继续支付
</button>
<button class="ss-reset-button cancel-btn" v-if="state.orderInfo.buttons?.includes('combination')" @tap="
<button class="ss-reset-button cancel-btn" v-if="state.orderInfo.buttons?.includes('combination')"
@tap="
sheep.$router.go('/pages/activity/groupon/detail', {
id: state.orderInfo.combinationRecordId,
})
@ -225,6 +231,8 @@
</button>
</view>
</su-fixed>
</view>
</s-layout>
</template>
@ -263,11 +271,9 @@
title: '待发货'
}, {
title: '待收货'
}
, {
}, {
title: '待评价'
}
, {
}, {
title: '已完成'
}], //
active: 0
@ -458,11 +464,15 @@
</script>
<style lang="scss" scoped>
.new-overflow{
overflow: hidden;
}
.new-class {
display: flex;
// justify-content: center;
padding: 11px 29px;
}
.new-address {
padding-top: 30px;
padding-left: 15px;
@ -486,7 +496,7 @@
.state-box {
color: rgba(#fff, 0.9);
width: 100%;
// width: 100%;
// background: v-bind(headerBg) no-repeat,
// linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
background: rgba(214, 68, 49);

View File

@ -2,21 +2,12 @@
<template>
<s-layout title="我的订单">
<su-sticky bgColor="#fff">
<su-tabs
:list="tabMaps"
:scrollable="false"
@change="onTabsChange"
:current="state.currentTab"
/>
<su-tabs :list="tabMaps" :scrollable="false" @change="onTabsChange" :current="state.currentTab" />
</su-sticky>
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" />
<view v-if="state.pagination.total > 0">
<view
class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20"
v-for="order in state.pagination.list"
:key="order.id"
@tap="onOrderDetail(order.id)"
>
<view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" v-for="order in state.pagination.list"
:key="order.id" @tap="onOrderDetail(order.id)">
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
<view class="order-no">订单号{{ order.no }}</view>
<view class="order-state ss-font-26" :class="formatOrderColor(order)">
@ -24,81 +15,49 @@
</view>
</view>
<view class="border-bottom" v-for="item in order.items" :key="item.id">
<s-goods-item
:img="item.picUrl"
:title="item.spuName"
:skuText="item.properties.map((property) => property.valueName).join(' ')"
:price="item.price"
:num="item.count"
/>
<s-goods-item :img="item.picUrl" :title="item.spuName"
:skuText="item.properties.map((property) => property.valueName).join(' ')" :price="item.price"
:num="item.count" />
</view>
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
<view class="ss-flex ss-col-center">
<view class="discounts-title pay-color"
> {{ order.productCount }} 件商品,总金额:</view
>
<view class="discounts-title pay-color"> {{ order.productCount }} 件商品,总金额:</view>
<view class="discounts-money pay-color"> {{ fen2yuan(order.payPrice) }} </view>
</view>
</view>
<view
class="order-card-footer ss-flex ss-col-center ss-p-x-20"
:class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'"
>
<view class="order-card-footer ss-flex ss-col-center ss-p-x-20"
:class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'">
<view class="ss-flex ss-col-center">
<button
v-if="order.buttons.includes('combination')"
class="tool-btn ss-reset-button"
@tap.stop="onOrderGroupon(order)"
>
<button v-if="order.buttons.includes('combination')" class="tool-btn ss-reset-button"
@tap.stop="onOrderGroupon(order)">
拼团详情
</button>
<button
v-if="order.buttons.length === 0"
class="tool-btn ss-reset-button"
@tap.stop="onOrderDetail(order.id)"
>
<button v-if="order.buttons.length === 0" class="tool-btn ss-reset-button"
@tap.stop="onOrderDetail(order.id)">
查看详情
</button>
<button
v-if="order.buttons.includes('confirm')"
class="tool-btn ss-reset-button"
@tap.stop="onConfirm(order)"
>
<button v-if="order.buttons.includes('confirm')" class="tool-btn ss-reset-button"
@tap.stop="onConfirm(order)">
确认收货
</button>
<button
v-if="order.buttons.includes('express')"
class="tool-btn ss-reset-button"
@tap.stop="onExpress(order.id)"
>
<button v-if="order.buttons.includes('express')" class="tool-btn ss-reset-button"
@tap.stop="onExpress(order.id)">
查看物流
</button>
<button
v-if="order.buttons.includes('cancel')"
class="tool-btn ss-reset-button"
@tap.stop="onCancel(order.id)"
>
<button v-if="order.buttons.includes('cancel')" class="tool-btn ss-reset-button"
@tap.stop="onCancel(order.id)">
取消订单
</button>
<button
v-if="order.buttons.includes('comment')"
class="tool-btn ss-reset-button"
@tap.stop="onComment(order.id)"
>
<button v-if="order.buttons.includes('comment')" class="tool-btn ss-reset-button"
@tap.stop="onComment(order.id)">
评价
</button>
<button
v-if="order.buttons.includes('delete')"
class="delete-btn ss-reset-button"
@tap.stop="onDelete(order.id)"
>
<button v-if="order.buttons.includes('delete')" class="delete-btn ss-reset-button"
@tap.stop="onDelete(order.id)">
删除订单
</button>
<button
v-if="order.buttons.includes('pay')"
class="tool-btn ss-reset-button ui-BG-Main-Gradient"
@tap.stop="onPay(order.payOrderId)"
>
<button v-if="order.buttons.includes('pay')"
class="tool-btn ss-reset-button ui-BG-Main-Gradient" @tap.stop="onPay(order.payOrderId)">
继续支付
</button>
</view>
@ -107,20 +66,21 @@
</view>
<!-- 加载更多 -->
<uni-load-more
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
contentdown: '上拉加载更多',
}"
@tap="loadMore"
/>
}" @tap="loadMore" />
</s-layout>
</template>
<script setup>
import { reactive } from 'vue';
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import {
reactive
} from 'vue';
import {
onLoad,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import {
fen2yuan,
formatOrderColor,
@ -129,9 +89,13 @@
} from '@/sheep/hooks/useGoods';
import sheep from '@/sheep';
import _ from 'lodash';
import { isEmpty } from 'lodash';
import {
isEmpty
} from 'lodash';
import OrderApi from '@/sheep/api/trade/order';
import { resetPagination } from '@/sheep/util';
import {
resetPagination
} from '@/sheep/util';
//
const state = reactive({
@ -145,8 +109,7 @@
loadStatus: '',
});
const tabMaps = [
{
const tabMaps = [{
name: '全部',
},
{
@ -224,7 +187,9 @@
}
//
const { code } = await OrderApi.receiveOrder(order.id);
const {
code
} = await OrderApi.receiveOrder(order.id);
if (code === 0) {
resetPagination(state.pagination);
await getOrderList();
@ -279,7 +244,9 @@
if (!res.confirm) {
return;
}
const { code } = await OrderApi.cancelOrder(orderId);
const {
code
} = await OrderApi.cancelOrder(orderId);
if (code === 0) {
//
let index = state.pagination.list.findIndex((order) => order.id === orderId);
@ -298,7 +265,9 @@
content: '确定要删除订单吗?',
success: async function(res) {
if (res.confirm) {
const { code } = await OrderApi.deleteOrder(orderId);
const {
code
} = await OrderApi.deleteOrder(orderId);
if (code === 0) {
//
let index = state.pagination.list.findIndex((order) => order.id === orderId);
@ -312,7 +281,10 @@
//
async function getOrderList() {
state.loadStatus = 'loading';
let { code, data } = await OrderApi.getOrderPage({
let {
code,
data
} = await OrderApi.getOrderPage({
pageNo: state.pagination.pageNo,
pageSize: state.pagination.pageSize,
status: tabMaps[state.currentTab].value,
@ -421,8 +393,7 @@
font-weight: 500;
}
.order-state {
}
.order-state {}
}
.pay-box {

View File

@ -51,7 +51,7 @@
<image @tap.stop="showMaoLocation(item)" style="margin-right:10px;"
src="https://zysc.fjptzykj.com:3000/shangcheng/c7362f85726ef0030b407f1c3749c710ca0caa51fee5cc8ffbb64e11226354a8.png"
class="img"></image>
<image @click="call(item.phone)"
<image @click.stop="call(item.phone)"
src="https://zysc.fjptzykj.com:3000/shangcheng/535ee6f79e04d4b6e46fcfa59ed052f214ad6ab756c340c0c040e68357f68e9a.png"
class="img"></image>
</view>

View File

@ -134,6 +134,7 @@
</view>
</view>
<!-- <navigator class="button" hover-class="none" open-type='switchTab'>去获取</navigator> -->
<view class="button" @click="sheep.$router.redirect('/pages/index/category')">去获取</view>
</view>
</view>
</view>

View File

@ -67,7 +67,7 @@
:class="valVip == index ? 'on' : ''" v-for="(item,index) in vipList" :key="index">
<view class="t">{{item.name}}</view>
<view class="c"><text class="tx">{{item.specialPrice}}</text></view>
<view class="b" v-if="index==0">试用1天</view>
<view class="b" v-if="item.name=='试用'">试用1天</view>
<view class="b sc" v-else>{{item.originalPrice}}</view>
</view>
</scroll-view>

View File

@ -70,8 +70,8 @@
<view v-if="type === 'UserOrder'" class="new-huiy" @click="
sheep.$router.go('/pages/user/user_vip/list')
">
<view class="new-button" v-if="userInfo.activate">已开通</view>
<view class="new-button" v-if="userInfo.activate == 0">立即开通</view>
<view class="new-button" v-if="userInfo.activate && userInfo.activate != 4">已开通</view>
<view class="new-button" v-if="userInfo.activate == 0 || userInfo.activate == 4">立即开通</view>
<image class="seckill1" mode="aspectFit"
src="https://zysc.fjptzykj.com:3000/shangcheng/64776e2edc3c2f15295e7c3976ba301e08f9170f99a2e845d8f33bd65179b177.png" />
</view>

View File

@ -43,16 +43,16 @@
<view v-if="layoutType === LayoutTypeEnum.TWO_COL && state.goodsList.length"
class="goods-md-wrap ss-flex ss-flex-wrap ss-col-top">
<view class="goods-list-box">
<!-- <view class="left-list" :style="[{ paddingRight: data.space + 'rpx', marginBottom: data.space + 'px' }]"
v-for="item in state.leftGoodsList" :key="item.id"> -->
<view class="left-list" :style="[{ paddingRight: data.space + 'rpx', marginBottom: data.space + 'px' }]"
v-for="item in state.goodsList" :key="item.id">
v-for="item in state.leftGoodsList" :key="item.id">
<!-- <view class="left-list" :style="[{ paddingRight: data.space + 'rpx', marginBottom: data.space + 'px' }]"
v-for="item in state.goodsList" :key="item.id"> -->
<s-goods-column class="goods-md-box" size="md" :goodsFields="data.fields" :tagStyle="data.badge"
:data="item" :titleColor="data.fields.name?.color"
:subTitleColor="data.fields.introduction.color" :topRadius="data.borderRadiusTop"
:bottomRadius="data.borderRadiusBottom" :titleWidth="330 - marginLeft - marginRight"
@click="sheep.$router.go('/pages/goods/index', { id: item.id })"
@getHeight="calculateGoodsColumn($event, 'left')">
>
<!-- 购买按钮 -->
<template v-slot:cart>
<button class="ss-reset-button cart-btn" :style="[buyStyle]">
@ -62,7 +62,7 @@
</s-goods-column>
</view>
</view>
<!-- <view class="goods-list-box">
<view class="goods-list-box">
<view class="right-list" :style="[{ paddingLeft: data.space + 'rpx', marginBottom: data.space + 'px' }]"
v-for="item in state.rightGoodsList" :key="item.id">
<s-goods-column class="goods-md-box" size="md" :goodsFields="data.fields" :tagStyle="data.badge"
@ -70,7 +70,7 @@
:subTitleColor="data.fields.introduction.color" :topRadius="data.borderRadiusTop"
:bottomRadius="data.borderRadiusBottom" :titleWidth="330 - marginLeft - marginRight"
@click="sheep.$router.go('/pages/goods/index', { id: item.id })"
@getHeight="calculateGoodsColumn($event, 'right')">
>
<template v-slot:cart>
<button class="ss-reset-button cart-btn" :style="[buyStyle]">
{{ btnBuy.type === 'text' ? btnBuy.text : '' }}
@ -78,7 +78,7 @@
</template>
</s-goods-column>
</view>
</view> -->
</view>
</view>
<!-- 布局3. 单列小图左图右内容 -->
@ -135,7 +135,8 @@
goodsList: [],
leftGoodsList: [],
rightGoodsList: [],
isShow:'recommendNew'
isShow:'recommendNew',
count:0
});
const props = defineProps({
data: {
@ -183,7 +184,7 @@
//region
//
let count = 3;
// let count = 0;
//
let leftHeight = 0;
//
@ -194,20 +195,22 @@
* @param height 商品的高度
* @param where 添加到哪一列
*/
function calculateGoodsColumn(height = 0, where = 'left') {
function calculateGoodsColumn() {
//
if (!state.goodsList[count]) return;
// if (!state.goodsList[state.count]) return;
//
if (where === 'left') leftHeight += height;
if (where === 'right') rightHeight += height;
// if (where === 'left') leftHeight += height;
// if (where === 'right') rightHeight += height;
//
if (leftHeight <= rightHeight) {
state.leftGoodsList.push(state.goodsList[count]);
if (state.count % 2 == 0) {
state.leftGoodsList.push(state.goodsList[state.count]);
} else {
state.rightGoodsList.push(state.goodsList[count]);
state.rightGoodsList.push(state.goodsList[state.count]);
}
// console.log();
//
count++;
state.count++;
}
//endregion
@ -240,20 +243,25 @@
},
}).then((res) => {
//
count=0;
leftHeight = 0;
rightHeight = 0;
state.goodsList = [];
// state.goodsList = [];
state.goodsList = res.data;
state.count = 0
// console.log(state.goodsList,"-----state.goodsList")
state.leftGoodsList = []
state.rightGoodsList = []
//
res.data.forEach((item) => {
calculateGoodsColumn();
});
});
}
//
onMounted(async () => {
if(props.fl){
classValue("recommendNew");
}
//
if(!props.fl){
@ -263,9 +271,12 @@
//
calculateGoodsColumn();
}
}else{
classValue("recommendNew");
}
});
</script>
@ -305,18 +316,16 @@
}
}
.goods-md-wrap {
width: 100%;
}
// .goods-md-wrap {
// width: 100%;
// }
.goods-list-box {
width: 100%;
width: 50%;
box-sizing: border-box;
::v-deep &{
display:flex;
flex-wrap:wrap;
.left-list{
width:48%;
.left-list, .right-list{
// width:48%;
}
.left-list:nth-child(3n+2){
margin-right:0;

View File

@ -369,7 +369,7 @@
import {
PromotionActivityTypeEnum
} from '@/sheep/util/const';
console.log(PromotionActivityTypeEnum,"PromotionActivityTypeEnum")
// console.log(PromotionActivityTypeEnum,"PromotionActivityTypeEnum")
//
const props = defineProps({
goodsFields: {

View File

@ -147,7 +147,7 @@
data: activity
} = await CombinationApi.getCombinationActivity(props.data.activityId);
const ss = await SpuApi.getSpulist();
console.log(ss, "getSpuListByIds")
// console.log(ss, "getSpuListByIds")
productList.value = ss.data;
});
</script>

View File

@ -211,7 +211,7 @@
// const { data: activity } = await SeckillApi.getSeckillActivity(props.data.activityId);
// const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
const data = await SpuApi.getSpuSeckilllist();
console.log(data,"datadatadatadatadatadatadatadata")
// console.log(data,"datadatadatadatadatadatadatadata")
productList.value = data.data;
});

View File

@ -1,15 +1,16 @@
<!-- 海报弹窗 -->
<template>
<su-popup :show="show" round="10" @close="onClosePoster" type="center" class="popup-box">
<view class="ss-flex-col ss-col-center ss-row-center">
<view class="ss-flex-col ss-col-center ss-row-center"
:style="{
height: poster.css.height + 'px',
width: poster.css.width + 'px',
}">
<image
v-if="!!painterImageUrl"
class="poster-img"
:src="painterImageUrl"
:style="{
height: poster.css.height + 'px',
width: poster.css.width + 'px',
}"
:show-menu-by-longpress="true"
/>
</view>
@ -17,7 +18,6 @@
class="poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center"
v-if="!!painterImageUrl"
>
<button class="cancel-btn ss-reset-button" @tap="onClosePoster">取消</button>
<button class="save-btn ss-reset-button ui-BG-Main" @tap="onSavePoster">
{{
['wechatOfficialAccount', 'H5'].includes(sheep.$platform.name)
@ -25,6 +25,7 @@
: '保存图片'
}}
</button>
<button class="cancel-btn ss-reset-button" @tap="onClosePoster">取消</button>
</view>
<!-- 海报画板默认隐藏只用来生成海报生成方式为主动调用 -->
<l-painter
@ -65,6 +66,7 @@
css: {
//
width: sheep.$platform.device.windowWidth * 0.9,
// width: 1 * 0.9,
height: 550,
},
views: [],
@ -137,10 +139,11 @@
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: -80rpx;
bottom: -172rpx;
flex-wrap: wrap;
.cancel-btn {
width: 240rpx;
width: 100%;
height: 70rpx;
line-height: 70rpx;
background: $white;
@ -148,10 +151,11 @@
font-size: 28rpx;
font-weight: 500;
color: $dark-9;
margin-top:10px;
}
.save-btn {
width: 240rpx;
width: 100%;
height: 70rpx;
line-height: 70rpx;
border-radius: 35rpx;
@ -162,5 +166,7 @@
.poster-img {
border-radius: 20rpx;
width: 100%;
height:100%;
}
</style>

View File

@ -10,14 +10,14 @@
? sheep.$url.cdn(userInfo.avatar)
: defaultAvatar
" mode="aspectFill" @tap="sheep.$router.go('/pages/user/info')"></image>
<image v-if="userInfo.activate" class="vipCard"
<image v-if="userInfo.activate && userInfo.activate != 4" class="vipCard"
src="https://zysc.fjptzykj.com:3000/shangcheng/8064149c53fe05f8d20263fba31992da2d24a751877a4ddcc696d7f53b5cc771.png">
</image>
</view>
<view style="z-index:22222;">
<view class="nickname-box ss-flex ss-col-center">
<view class="nick-name ss-m-r-20">{{ userInfo?.nickname || nickname }}</view>
<view class="vipImg" v-if="userInfo.activate">
<view class="vipImg" v-if="userInfo.activate && userInfo.activate != 4">
<image class="img"
src="https://zysc.fjptzykj.com:3000/shangcheng/0419db3d6a991486176256374c05c2834006fd42b3f5f80e3ff385b027b7c34f.png" />
</view>
@ -37,13 +37,13 @@
</view>
</view>
<!-- 提示绑定手机号 先隐藏 yudao 需要再修改 -->
<view class="bind-mobile-box ss-flex ss-row-between ss-col-center" v-if="isLogin && !userInfo.mobile">
<!-- <view class="bind-mobile-box ss-flex ss-row-between ss-col-center" v-if="isLogin && !userInfo.mobile">
<view class="ss-flex">
<text class="cicon-mobile-o" />
<view class="mobile-title ss-m-l-20"> 点击绑定手机号确保账户安全 </view>
</view>
<button class="ss-reset-button bind-btn" @tap="onBind">去绑定</button>
</view>
</view> -->
</view>
</template>

View File

@ -74,7 +74,7 @@ const app = defineStore({
methods: ['poster', 'link'],
linkAddress: 'http://127.0.0.1:3000', // TODO 芋艿:可以考虑改到 .env 那
posterInfo: {
user_bg: '/shangcheng/user-poster-bg.png',
user_bg: '/shangcheng/baa4f41883b4bb8880ff83281f258418281ea0383c505001300ca2953299db8a.png',
goods_bg: '/shangcheng/goods-poster-bg.png',
groupon_bg: '/shangcheng/groupon-poster-bg.png',
},

View File

@ -339,7 +339,11 @@ by ZXLee
</script>
<script src="./js/z-paging-main.js" />
<style scoped>
<style scoped lang="scss">
@import "./css/z-paging-main.css";
@import "./css/z-paging-static.css";
.zp-list-cell{
padding: 0 15px;
}
</style>