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