优惠卷和商品卷

This commit is contained in:
wwz
2025-03-10 16:33:43 +08:00
parent 70edc6756d
commit 5342133cbd
30 changed files with 2820 additions and 3338 deletions

View File

@@ -23,6 +23,15 @@ export const APIshopUserInfo = (data) => {
})
}
// 加入会员
export const APIshopUser = (data) => {
return request({
url: urlAccount + '/user/shopUser',
method: 'post',
data: data
})
}
// 获取动态会员码 3分钟内可用
export const APIusershopUsercode = (data) => {
return request({
@@ -51,7 +60,7 @@ export const APIusershopInfodetail = (data) => {
})
}
//桌码换取详细店铺信息
//通过用户Id 查找优惠券
export const APIcouponfindByUserId = (data) => {
return request({
url: urlAccount + '/user/coupon/findByUserId',
@@ -59,6 +68,14 @@ export const APIcouponfindByUserId = (data) => {
data: data
})
}
//生成订单后使用
export const APIfindCoupon = (data) => {
return request({
url: urlAccount + '/user/coupon/findCoupon',
method: 'get',
data: data
})
}
//桌码换取详细店铺信息
export const APIuseractivate = (data) => {
@@ -69,3 +86,29 @@ export const APIuseractivate = (data) => {
})
}
//获取余额余额明细
export const APIshopUsermoneyRecord = (data) => {
return request({
url: urlAccount + '/user/shopUser/moneyRecord',
method: 'get',
data: data
})
}
//获取积分明细
export const APIshopUserpointsRecord = (data) => {
return request({
url: urlAccount + '/user/shopUser/pointsRecord',
method: 'get',
data: data
})
}
//获取动态会员码
export const APIshopUsercode = (data) => {
return request({
url: urlAccount + '/user/shopUser/code',
method: 'get',
data: data
})
}

14
common/api/shop/index.js Normal file
View File

@@ -0,0 +1,14 @@
// 引入 request 文件
import request from '@/common/api/request.js'
const urlAccount = '/account'
const urlProduct = '/product'
const urlOrder = '/order'
//商品列表
export const APIgeocodelocation = (data) => {
return request({
url: urlAccount + '/user/points/mall/goods/page',
method: 'get',
data: data
})
}

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,15 @@ const useWebSocket = (options = {}) => {
// 连接 WebSocket
const connect = () => {
if (!isNetworkConnected.value) {
uni.showToast({
title: '网络未连接...',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1000)
console.log('网络未连接,暂不尝试连接 WebSocket');
return;
}
@@ -70,7 +78,7 @@ const useWebSocket = (options = {}) => {
isConnected.value = true;
reconnectAttempts.value = 0;
// 监听初始化成功在开启心跳
// startHeartbeat();
startHeartbeat();
},
fail: () => {
console.error('WebSocket 连接失败,尝试重连');
@@ -104,6 +112,7 @@ const useWebSocket = (options = {}) => {
clearTimeout(reconnectTimer.value); // 清除重连定时器
if (res.code == '1006') {
console.log('服务器正常关闭,停止重连');
uni.navigateBack()
autoReconnect.value = false;
return false;
}
@@ -129,6 +138,13 @@ const useWebSocket = (options = {}) => {
const startHeartbeat = () => {
if (!isNetworkConnected.value) {
console.log('网络未连接,暂停心跳');
uni.showToast({
title: '网络未连接...',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1000)
return;
}
heartbeatTimer.value = setInterval(() => {
@@ -168,6 +184,7 @@ const useWebSocket = (options = {}) => {
// 手动关闭连接
const closeSocket = () => {
isManuallyClosed.value = true;
uni.navigateBack()
closeExistingConnection();
};
@@ -213,6 +230,7 @@ const useWebSocket = (options = {}) => {
title: '重连次数达到上限,停止重连',
icon: 'none'
});
uni.navigateBack()
}
};