修改积分相关接口

This commit is contained in:
2025-12-10 15:15:35 +08:00
parent a95fa69c62
commit 1447960908
12 changed files with 378 additions and 254 deletions

View File

@@ -32,7 +32,7 @@ export const userdict = (data) => {
// 获取当前店铺会员开通配置信息 // 获取当前店铺会员开通配置信息
export const getMemberConfig = (data) => { export const getMemberConfig = (data) => {
return request({ return request({
url: '/market/user/member/config', url: '/account/user/member/config',
method: 'GET', method: 'GET',
data: data, data: data,
toast: false toast: false

View File

@@ -4,7 +4,7 @@ import {prveUrl} from './config.js'
export const pointsShopList = (data) => { export const pointsShopList = (data) => {
return request({ return request({
url: prveUrl + '/user/shopUser/pointsShopList', url: prveUrl + '/user/point/shopList',
method: 'get', method: 'get',
data: data data: data
}) })

View File

@@ -99,7 +99,7 @@ export const APIshopUsermoneyRecord = (data) => {
//获取积分明细 //获取积分明细
export const APIshopUserpointsRecord = (data) => { export const APIshopUserpointsRecord = (data) => {
return request({ return request({
url: urlAccount + '/user/shopUser/pointsRecord', url: urlMarket + '/user/point/userRecord',
method: 'get', method: 'get',
data: data data: data
}) })

View File

@@ -0,0 +1,24 @@
// 引入 request 文件
import request from '@/common/api/request.js'
const url = '/order'
let platformType = '';
let payType='';
// #ifdef MP-WEIXIN
platformType = 'wechat'
payType='wechatPay'
// #endif
// #ifdef MP-ALIPAY
platformType = 'alipay'
payType='aliPay'
// #endif
//订单列表
export const pointGoodsPage = (data) => {
return request({
url: url + '/user/pointGoods/page',
method: 'get',
data: data
})
}

View File

@@ -1,315 +1,385 @@
<template> <template>
<view class="content"> <view class="content min-page bg-f7">
<view class="contentbox"> <view class="contentbox">
<template v-if="shopExtend.length"> <template v-if="shopExtend.length">
<image class="bg" :src="shopExtend[0].value" mode="aspectFill" v-if="!isJsonArrayString(shopExtend[0].value)"></image> <image
<swiper class="swiper" autoplay circular v-else> class="bg"
<swiper-item class="swiper-item" v-for="item in JSON.parse(shopExtend[0].value)"> :src="shopExtend[0].value"
<image class="swiper-bg" :src="item"></image> mode="aspectFill"
</swiper-item> v-if="!isJsonArrayString(shopExtend[0].value)"
</swiper> ></image>
</template> <swiper class="swiper" autoplay circular v-else>
<view class="contentboxitem flex-between"> <swiper-item
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)"> class="swiper-item"
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill"></image> v-for="item in JSON.parse(shopExtend[0].value)"
<text class="contentboxitemlefttextone">点餐</text> >
<text class="contentboxitemlefttexttow">在线点不排队</text> <image class="swiper-bg" :src="item"></image>
</view> </swiper-item>
<view class="contentboxitemright"> </swiper>
<!-- <view class="contentboxitemright_item flex-between" </template>
<view class="contentboxitem flex-between">
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
<image
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png"
mode="aspectFill"
></image>
<text class="contentboxitemlefttextone">点餐</text>
<text class="contentboxitemlefttexttow">在线点不排队</text>
</view>
<view class="contentboxitemright">
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/memberdetails')"> --> @click="memberindex('user/member/memberdetails')"> -->
<view class="contentboxitemright_item flex-between" @click="tomember"> <view class="contentboxitemright_item flex-between" @click="tomember">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill"></image> <image
<view class="contentboxitemright_itembox flex-colum"> src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png"
<text>会员</text> mode="aspectFill"
<text>入会享权益</text> ></image>
</view> <view class="contentboxitemright_itembox flex-colum">
</view> <text>会员</text>
<!-- <view class="contentboxitemright_item flex-between" <text>入会享权益</text>
</view>
</view>
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/index')" @click="memberindex('user/member/index')"
> --> > -->
<view class="contentboxitemright_item flex-between" @click="toCharge"> <view class="contentboxitemright_item flex-between" @click="toCharge">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png" mode="aspectFill"></image> <image
<view class="contentboxitemright_itembox flex-colum"> src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
<text>充值</text> mode="aspectFill"
<text>充值享更多优惠</text> ></image>
</view> <view class="contentboxitemright_itembox flex-colum">
</view> <text>充值</text>
</view> <text>充值享更多优惠</text>
</view> </view>
</view> </view>
<u-popup :show="popupShow" :safe-area-inset-bottom="false" mode="center" @close="popupShow = false"> </view>
<view class="popup-content"> </view>
<view class="header-wrap"> </view>
<text class="t">请选择</text>
<view class="close" @click="popupShow = false"> <view class="u-flex menus u-font-32 color-333">
<u-icon name="close" size="16" color="#666"></u-icon> <view class="menu-item" @click="toIntegralMall">
</view> <view>积分商城</view>
</view> <view class="u-font-24 color-999">攒积分兑换更多优惠</view>
<view class="btn-content"> </view>
<view class="btn"> <view class="menu-item" @click="toFenxiao">
<u-button color="#E8AD7B" plain="" shape="circle" @click="beforehandOrderHandle">预点单</u-button> <view>分销</view>
</view> <view class="u-font-24 color-999">邀请好友获得佣金</view>
<view class="btn"> </view>
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle">扫码点单</u-button> </view>
</view> <u-popup
</view> :show="popupShow"
</view> :safe-area-inset-bottom="false"
</u-popup> mode="center"
</view> @close="popupShow = false"
>
<view class="popup-content">
<view class="header-wrap">
<text class="t">请选择</text>
<view class="close" @click="popupShow = false">
<u-icon name="close" size="16" color="#666"></u-icon>
</view>
</view>
<view class="btn-content">
<view class="btn">
<u-button
color="#E8AD7B"
plain=""
shape="circle"
@click="beforehandOrderHandle"
>预点单</u-button
>
</view>
<view class="btn">
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle"
>扫码点单</u-button
>
</view>
</view>
</view>
</u-popup>
</view>
</template> </template>
<script setup> <script setup>
import { getMemberConfig, getRechargeConfig } from '@/common/api/index/index.js'; import {
import { ref, reactive, defineProps, defineEmits, onMounted } from 'vue'; getMemberConfig,
import { isJsonArrayString } from '@/utils/util.js'; getRechargeConfig,
} from "@/common/api/index/index.js";
import { ref, reactive, defineProps, defineEmits, onMounted } from "vue";
import { isJsonArrayString } from "@/utils/util.js";
// 定义接收的属性 // 定义接收的属性
const props = defineProps({ const props = defineProps({
shopExtend: { shopExtend: {
type: Array, type: Array,
default: [] default: [],
} },
}); });
function toFenxiao() {
uni.navigateTo({
url: "/distribution/shop-detail/index?shopId="+uni.cache.get("shopId"),
});
}
import { productStore } from '@/stores/user.js'; function toIntegralMall() {
uni.navigateTo({
url: "/scoreShop/index/index",
});
}
import { productStore } from "@/stores/user.js";
// 显示弹窗 // 显示弹窗
const popupShow = ref(false); const popupShow = ref(false);
const scanCodehandle = (i) => { const scanCodehandle = (i) => {
popupShow.value = true; popupShow.value = true;
}; };
// 预点单 // 预点单
function beforehandOrderHandle() { function beforehandOrderHandle() {
popupShow.value = false; popupShow.value = false;
let shopUserInfo = uni.cache.get('shopUserInfo'); let shopUserInfo = uni.cache.get("shopUserInfo");
uni.cache.set('dinersNum', 1); uni.cache.set("dinersNum", 1);
uni.cache.set('tableCode', shopUserInfo.id); uni.cache.set("tableCode", shopUserInfo.id);
uni.navigateTo({ uni.navigateTo({
url: '/pages/product/index?type=beforehand' url: "/pages/product/index?type=beforehand",
}); });
} }
// 扫码点餐 // 扫码点餐
async function scanOrderHandle() { async function scanOrderHandle() {
popupShow.value = false; popupShow.value = false;
const store = productStore(); const store = productStore();
await store.scanCodeactions(); await store.scanCodeactions();
} }
const memberindex = (url) => { const memberindex = (url) => {
uni.pro.navigateTo(url, { uni.pro.navigateTo(url, {
shopId: uni.cache.get('shopId'), shopId: uni.cache.get("shopId"),
type: 'index' type: "index",
}); });
}; };
function tomember() { function tomember() {
if (isMember.value) { if (isMember.value) {
const shopUserInfo = uni.cache.get('shopUserInfo') || {}; const shopUserInfo = uni.cache.get("shopUserInfo") || {};
const shopId = uni.cache.get('shopId'); const shopId = uni.cache.get("shopId");
if (!shopUserInfo.isVip) { if (!shopUserInfo.isVip) {
uni.navigateTo({ uni.navigateTo({
url: '/user/vip/buy-vip?shopId=' + shopId url: "/user/vip/buy-vip?shopId=" + shopId,
}); });
return; return;
} }
uni.navigateTo({ uni.navigateTo({
url: '/user/vip/vip?shopId=' + shopId url: "/user/vip/vip?shopId=" + shopId,
}); });
} else { } else {
uni.showToast({ uni.showToast({
title: '暂未开放', title: "暂未开放",
icon: 'none' icon: "none",
}); });
} }
} }
function toCharge() { function toCharge() {
if (isCharge.value) { if (isCharge.value) {
const shopId = uni.cache.get('shopId'); const shopId = uni.cache.get("shopId");
uni.navigateTo({ uni.navigateTo({
url: '/pages/user/member/czzx?shopId=' + shopId url: "/pages/user/member/czzx?shopId=" + shopId,
}); });
} else { } else {
uni.showToast({ uni.showToast({
title: '暂未开放', title: "暂未开放",
icon: 'none' icon: "none",
}); });
} }
} }
const getQueryString = (url, name) => { const getQueryString = (url, name) => {
//解码 //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i'); var reg = new RegExp("(^|&|/?)" + name + "=([^&|/?]*)(&|/?|$)", "i");
var r = url.substr(1).match(reg); var r = url.substr(1).match(reg);
if (r != null) { if (r != null) {
return r[2]; return r[2];
} }
return null; return null;
}; };
// 获取会员配置 // 获取会员配置
const isMember = ref(0); const isMember = ref(0);
const isCharge = ref(0); const isCharge = ref(0);
async function getVipConfig() { async function getVipConfig() {
try { try {
const res1 = await getMemberConfig({ shopId: uni.cache.get('shopId') }); const res1 = await getMemberConfig({ shopId: uni.cache.get("shopId") });
const res2 = await getRechargeConfig({ shopId: uni.cache.get('shopId') }); const res2 = await getRechargeConfig({ shopId: uni.cache.get("shopId") });
isMember.value = +res1.memberConfig.isOpen; isMember.value = +res1.memberConfig.isOpen;
isCharge.value = +res2.isEnable; isCharge.value = +res2.isEnable;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
} }
onMounted(() => { onMounted(() => {
getVipConfig(); getVipConfig();
}); });
defineExpose({ defineExpose({
getVipConfig getVipConfig,
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page { page {
background: #f6f8fa; background: #f6f8fa;
} }
.swiper { .swiper {
width: 100%; width: 100%;
height: 100%; height: 100%;
.swiper-item { .swiper-item {
width: 100%; width: 100%;
height: 100%; height: 100%;
.swiper-bg { .swiper-bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
} }
.content { .content {
.contentbox { .contentbox {
position: relative; position: relative;
width: 100%; width: 100%;
height: 1046rpx; height: 1046rpx;
.bg { .bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: -1; z-index: -1;
} }
.contentboxitem { .contentboxitem {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 90%; width: 90%;
left: 50%; left: 50%;
transform: translate(-50%, 50%); transform: translate(-50%, 50%);
padding: 38rpx 0 26rpx 0; padding: 38rpx 0 26rpx 0;
background: rgba(255, 255, 255, 0.98); background: rgba(255, 255, 255, 0.98);
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16); box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
.contentboxitemleft { .contentboxitemleft {
width: 50%; width: 50%;
border-right: 2rpx solid #623618; border-right: 2rpx solid #623618;
image { image {
width: 134rpx; width: 134rpx;
height: 134rpx; height: 134rpx;
} }
.contentboxitemlefttextone { .contentboxitemlefttextone {
margin-top: 10rpx; margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
} }
.contentboxitemlefttexttow { .contentboxitemlefttexttow {
margin-top: 2rpx; margin-top: 2rpx;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
} }
.contentboxitemright { .contentboxitemright {
width: 50%; width: 50%;
padding: 0 34rpx; padding: 0 34rpx;
.contentboxitemright_item:nth-child(2) { .contentboxitemright_item:nth-child(2) {
margin-top: 30rpx; margin-top: 30rpx;
} }
.contentboxitemright_item { .contentboxitemright_item {
image { image {
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
} }
.contentboxitemright_itembox { .contentboxitemright_itembox {
width: 170rpx; width: 170rpx;
text:nth-child(1) { text:nth-child(1) {
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
} }
text:nth-child(2) { text:nth-child(2) {
margin-top: 2rpx; margin-top: 2rpx;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
} }
} }
} }
} }
} }
} }
.popup-content { .popup-content {
width: 90vw; width: 90vw;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
.header-wrap { .header-wrap {
height: 64px; height: 64px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #ececec; border-bottom: 1px solid #ececec;
padding: 0 28upx; padding: 0 28upx;
.t { .t {
font-size: 32upx; font-size: 32upx;
color: #333; color: #333;
} }
.close { .close {
$size: 60upx; $size: 60upx;
width: $size; width: $size;
height: $size; height: $size;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
.btn-content { .btn-content {
height: 86px; height: 86px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 60upx; gap: 60upx;
.btn { .btn {
width: 248upx; width: 248upx;
} }
} }
}
.menus {
display: flex;
padding: 32rpx 40rpx;
margin-top: 150rpx;
gap: 20rpx;
.menu-item {
background-color: #fff;
border-radius: 16rpx;
text-align: center;
padding: 32rpx 28rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
flex: 1;
}
} }
</style> </style>

View File

@@ -41,7 +41,7 @@
import { import {
APIusershopUservipCard APIusershopUservipCard
} from '@/common/api/member.js' } from '@/common/api/member.js'
import * as vipApi from '@/common/api/market/vip.js' import * as vipApi from '@/common/api/account/vip.js'
const orderForm = reactive({ const orderForm = reactive({

View File

@@ -255,9 +255,11 @@ import devetools from "@/components/devetools.vue";
import { ref, computed, onMounted, reactive, watch } from "vue"; import { ref, computed, onMounted, reactive, watch } from "vue";
import { onLoad, onReady, onShow } from "@dcloudio/uni-app"; import { onLoad, onReady, onShow } from "@dcloudio/uni-app";
import { productStore } from "@/stores/user.js"; import { productStore } from "@/stores/user.js";
import * as vipApi from "@/common/api/market/vip.js"; import * as vipApi from "@/common/api/account/vip.js";
import * as rechargeApi from "@/common/api/market/recharge.js"; import * as rechargeApi from "@/common/api/market/recharge.js";
import { pointsShopList } from "@/common/api/account/points.js"; import { pointsShopList } from '@/common/api/market/points.js'
function qrcodeResult(res) { function qrcodeResult(res) {
qrcode.value = res; qrcode.value = res;

View File

@@ -5,6 +5,7 @@
bgColor="transparent" bgColor="transparent"
leftIconColor="#333" leftIconColor="#333"
titleStyle="color:#333" titleStyle="color:#333"
@leftClick="back"
></up-navbar> ></up-navbar>
<view :style="{ backgroundImage: 'url(' + imgs.bg + ')' }" class="bg"> <view :style="{ backgroundImage: 'url(' + imgs.bg + ')' }" class="bg">
<view class="top"> <view class="top">
@@ -22,7 +23,7 @@
</view> </view>
</view> </view>
<view class="u-m-t-10 u-flex color1" style="margin-left: 66rpx"> <view class="u-m-t-10 u-flex color1" style="margin-left: 66rpx">
<text>积分订单</text> <text @click="toPage('/scoreShop/order/index')">积分订单</text>
<text class="u-m-l-44">积分明细</text> <text class="u-m-l-44">积分明细</text>
</view> </view>
</view> </view>
@@ -48,7 +49,7 @@
> >
</view> </view>
<view class="u-flex" @click="toggleLayout"> <view class="u-flex" @click="toggleLayout">
<image :src="imgs.layout" class="layout" /> <image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
</view> </view>
</view> </view>
<goodsList :layout="layout"></goodsList> <goodsList :layout="layout"></goodsList>
@@ -56,6 +57,7 @@
</view> </view>
</template> </template>
<script setup> <script setup>
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 = { const imgs = {
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3716211a58d84fda9ee596a1882c0704.png", //背景图 bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3716211a58d84fda9ee596a1882c0704.png", //背景图
@@ -65,14 +67,40 @@ const imgs = {
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/d53e8d88462d4d838b12150062644d03.png", //五角星 "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/d53e8d88462d4d838b12150062644d03.png", //五角星
layout: layout:
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/cba40ceb38a64bbfbe144f2ab0d6197f.png", //布局 "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"); 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) {
uni.navigateTo({
url: url,
});
}
const tabActive = ref(0); 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();
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.bg { .bg {

View File

@@ -23,7 +23,7 @@
<script setup> <script setup>
import { import {
pointsShopList pointsShopList
} from '@/common/api/account/points.js' } from '@/common/api/market/points.js'
import { import {
onMounted, onMounted,
reactive, reactive,

View File

@@ -153,7 +153,7 @@
joinMember, joinMember,
ltPayMember ltPayMember
} from '@/common/api/order/index.js' } from '@/common/api/order/index.js'
import * as vipApi from '@/common/api/market/vip.js' import * as vipApi from '@/common/api/account/vip.js'
import {pay} from '@/utils/pay.js' import {pay} from '@/utils/pay.js'
import { import {
APIusershopInfodetail,APIshopUserInfo APIusershopInfodetail,APIshopUserInfo

View File

@@ -83,7 +83,7 @@
import { import {
onLoad onLoad
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
import * as vipApi from '@/common/api/market/vip.js'; import * as vipApi from '@/common/api/account/vip.js';
import { import {
APIusershopInfodetail, APIusershopInfodetail,
APIshopUserInfo APIshopUserInfo