积分商城修改

This commit is contained in:
2025-12-10 15:38:32 +08:00
parent 1447960908
commit d8b2a4763d
4 changed files with 193 additions and 183 deletions

View File

@@ -123,7 +123,7 @@ function toFenxiao() {
function toIntegralMall() { function toIntegralMall() {
uni.navigateTo({ uni.navigateTo({
url: "/scoreShop/index/index", url: "/scoreShop/index/index?shopId="+uni.cache.get("shopId"),
}); });
} }

View File

@@ -153,7 +153,8 @@
page: formData.form.page, page: formData.form.page,
size: formData.form.size, size: formData.form.size,
// status: formData.form.status, // status: formData.form.status,
shopId: formData.shopId shopId: formData.shopId,
id:formData.id
}) })
} }
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) { if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
@@ -215,6 +216,7 @@
console.log('options',options); console.log('options',options);
formData.shopId = options.shopId formData.shopId = options.shopId
formData.active = options.type formData.active = options.type
formData.id=options.id||''
console.log(formData.info) console.log(formData.info)
getlist() getlist()
getShopUserInfo() getShopUserInfo()

View File

@@ -1,185 +1,190 @@
<template> <template>
<view class="min-page bg-f7"> <view class="min-page bg-f7">
<up-navbar <up-navbar title="积分商城" bgColor="transparent" leftIconColor="#333" titleStyle="color:#333"
title="积分商城" @leftClick="back"></up-navbar>
bgColor="transparent" <view :style="{ backgroundImage: 'url(' + imgs.bg + ')' }" class="bg">
leftIconColor="#333" <view class="top">
titleStyle="color:#333" <view>
@leftClick="back" <view class="u-flex">
></up-navbar> <image :src="imgs.wujiaoxing" class="wujiaoxing"></image>
<view :style="{ backgroundImage: 'url(' + imgs.bg + ')' }" class="bg"> <view class="number u-m-l-20 u-m-r-12">{{pointsUser?pointsUser.pointBalance:''}}</view>
<view class="top"> <view class="u-flex">
<view> <up-icon name="arrow-right" size="18" bold color="#9C571F"></up-icon>
<view class="u-flex"> </view>
<image :src="imgs.wujiaoxing" class="wujiaoxing"></image> </view>
<view class="number u-m-l-20 u-m-r-12">73954</view> <view class="u-m-t-10 u-flex color1" style="margin-left: 66rpx">
<view class="u-flex"> <text @click="toPage('/scoreShop/order/index')">积分订单</text>
<up-icon <text class="u-m-l-44" @click="toDetail">积分明细</text>
name="arrow-right" </view>
size="18" </view>
bold <view class="u-flex">
color="#9C571F" <image :src="imgs.huizhang" class="huizhang"></image>
></up-icon> </view>
</view> </view>
</view> </view>
<view class="u-m-t-10 u-flex color1" style="margin-left: 66rpx"> <view class="bottom">
<text @click="toPage('/scoreShop/order/index')">积分订单</text> <view class="tab-box u-flex">
<text class="u-m-l-44">积分明细</text> <view class="tabs u-flex-1 u-flex">
</view> <view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
</view> <view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其他商品</view>
<view class="u-flex"> </view>
<image :src="imgs.huizhang" class="huizhang"></image> <view class="u-flex" @click="toggleLayout">
</view> <image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
</view> </view>
</view> </view>
<view class="bottom"> <goodsList :layout="layout"></goodsList>
<view class="tab-box u-flex"> </view>
<view class="tabs u-flex-1 u-flex"> </view>
<view
class="tab-item"
:class="tabActive === 0 ? 'active' : ''"
@click="tabActive = 0"
>优惠券</view
>
<view
class="tab-item"
:class="tabActive === 1 ? 'active' : ''"
@click="tabActive = 1"
>其他商品</view
>
</view>
<view class="u-flex" @click="toggleLayout">
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
</view>
</view>
<goodsList :layout="layout"></goodsList>
</view>
</view>
</template> </template>
<script setup> <script setup>
import * as pointGoodsApi from "@/common/api/order/pointGoods.js"; import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
import goodsList from "./components/goods-list.vue"; import goodsList from "./components/goods-list.vue";
const imgs = { import {
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3716211a58d84fda9ee596a1882c0704.png", //背景图 onLoad
huizhang: } from "@dcloudio/uni-app";
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/5d07600cc494490aa3adacfe51d8845d.png", //徽章 const imgs = {
wujiaoxing: bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3716211a58d84fda9ee596a1882c0704.png", //背景图
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/d53e8d88462d4d838b12150062644d03.png", //五角星 huizhang: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/5d07600cc494490aa3adacfe51d8845d.png", //徽章
layout: wujiaoxing: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/d53e8d88462d4d838b12150062644d03.png", //五角星
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/cba40ceb38a64bbfbe144f2ab0d6197f.png", //布局 layout: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/cba40ceb38a64bbfbe144f2ab0d6197f.png", //布局
layout_block: layout_block: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/3/57a51ee2c74d4a638db2a81c6f6c8954.png",
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/3/57a51ee2c74d4a638db2a81c6f6c8954.png", };
}; const layout = ref("block");
const layout = ref("block");
function toggleLayout() { function toggleLayout() {
layout.value = layout.value === "block" ? "list" : "block"; layout.value = layout.value === "block" ? "list" : "block";
} }
function back() {
uni.navigateBack({
delta: 1,
});
}
function toPage(url) { function back() {
uni.navigateTo({ uni.navigateBack({
url: url, delta: 1,
}); });
} }
const tabActive = ref(0);
const query = reactive({ function toDetail() {
page: 1, uni.navigateTo({
size: 10, url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value.id ||
shopId: uni.cache.get("shopId"), '')
}); })
const isEnd = ref(false); }
function getList() {
pointGoodsApi.pointGoodsPage(query); function toPage(url) {
} uni.navigateTo({
onShow(() => { url: url,
query.page = 1; });
isEnd.value = false; }
getList(); const tabActive = ref(0);
}); const query = reactive({
page: 1,
size: 10,
shopId: '',
});
const isEnd = ref(false);
const pointsUser = ref(null)
function getList() {
pointGoodsApi.pointGoodsPage(query).then(res => {
pointsUser.value = res.pointsUser
})
}
onLoad((opt) => {
query.shopId = opt.id || ''
})
onShow(() => {
query.page = 1;
isEnd.value = false;
getList();
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.bg { .bg {
background-size: cover; background-size: cover;
min-height: 454rpx; min-height: 454rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
} }
.top {
padding: 138rpx 26rpx 48rpx 42rpx;
display: flex;
justify-content: space-between;
align-items: flex-end;
$color: #9c571f;
.huizhang {
width: 218rpx;
height: 212rpx;
}
.wujiaoxing {
width: 68rpx;
height: 68rpx;
}
.color1 {
color: $color;
}
.number {
color: $color;
font-size: 64rpx;
font-weight: 900;
}
}
.layout {
width: 36rpx;
height: 36rpx;
}
.min-page {
display: flex;
flex-direction: column;
}
.bottom {
width: 750rpx;
flex: 1;
border-radius: 40rpx 40rpx 0 0;
position: relative;
transform: translateY(-32rpx);
z-index: 1;
background: #f7f7f7;
.tab-box { .top {
display: flex; padding: 138rpx 26rpx 48rpx 42rpx;
align-items: center; display: flex;
padding: 36rpx 32rpx 14rpx 0; justify-content: space-between;
align-items: flex-end;
$color: #9c571f;
.tabs { .huizhang {
justify-content: center; width: 218rpx;
gap: 200rpx; height: 212rpx;
.tab-item { }
font-size: 28rpx;
color: #666; .wujiaoxing {
padding: 16rpx 0; width: 68rpx;
position: relative; height: 68rpx;
&::after { }
display: block;
position: absolute; .color1 {
left: 50%; color: $color;
transform: translateX(-50%); }
bottom: 0;
content: ""; .number {
width: 58rpx; color: $color;
height: 6rpx; font-size: 64rpx;
background-color: transparent; font-weight: 900;
transition: all 0.3s; }
} }
&.active::after {
background-color: #ffaa62; .layout {
} width: 36rpx;
} height: 36rpx;
} }
}
} .min-page {
display: flex;
flex-direction: column;
}
.bottom {
width: 750rpx;
flex: 1;
border-radius: 40rpx 40rpx 0 0;
position: relative;
transform: translateY(-32rpx);
z-index: 1;
background: #f7f7f7;
.tab-box {
display: flex;
align-items: center;
padding: 36rpx 32rpx 14rpx 0;
.tabs {
justify-content: center;
gap: 200rpx;
.tab-item {
font-size: 28rpx;
color: #666;
padding: 16rpx 0;
position: relative;
&::after {
display: block;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
content: "";
width: 58rpx;
height: 6rpx;
background-color: transparent;
transition: all 0.3s;
}
&.active::after {
background-color: #ffaa62;
}
}
}
}
}
</style> </style>

View File

@@ -41,16 +41,19 @@
} }
} }
function toDuihuan() { function toDuihuan(item) {
uni.showToast({ // uni.showToast({
title: '待开放!', // title: '待开放!',
icon: 'none' // icon: 'none'
// })
uni.navigateTo({
url:'/scoreShop/index/index?shopId=' + item.shopId+'&id='+item.id
}) })
} }
function toDetail(item) { function toDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/user/member/billDetails?type=2&shopId=' + item.shopId url: '/pages/user/member/billDetails?type=2&shopId=' + item.shopId+'&id='+item.id
}) })
} }
onMounted(getData) onMounted(getData)