重构会员卡数据库

This commit is contained in:
2024-07-13 13:46:11 +08:00
parent e8b3a99607
commit f3c18408d3
55 changed files with 3802 additions and 272 deletions
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
</script>
<template>
<uni-card title="游泳馆" :border="false" :is-shadow="false">
<view class="flex justify-between">
<text>今日销量 0</text>
<text>今日出售 0</text>
<text>今日退票 0</text>
</view>
</uni-card>
</template>
<style scoped lang="scss">
</style>
+23 -14
View File
@@ -1,6 +1,6 @@
<template>
<view class="container">
<ws-select-merchant :merchantList="merchantList" :merchantId="merchantId" @done="reload" />
<!-- <ws-select-merchant :merchantList="merchantList" :merchantId="merchantId" @done="reload" />-->
<uv-tabs
:list="next7day"
:itemStyle="{ height: '58px' }"
@@ -9,9 +9,10 @@
:inactiveStyle="{ color: '#808080' }"
@change="onDateTime"
></uv-tabs>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-padding-wrap uni-common-mt relative">
<uni-segmented-control :current="current" :values="items" activeColor="#2ba91c" inActiveColor="#ff0000" @clickItem="onType" />
</view>
<uni-data-select :clear="false" style="background-color: #fff; width: 330rpx; position: absolute; right: 16rpx; top: 120rpx;" v-model="value" :localdata="merchantList" @change="change"></uni-data-select>
<!-- 状态说明 -->
<view class="uni-badge-wrap">
<view class="badge-item">
@@ -103,7 +104,6 @@
</uni-card>
<uv-gap height="70"></uv-gap>
</uni-popup>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
</template>
@@ -120,6 +120,7 @@ import { getWeek, getKey } from '@/utils/common';
const carStore = useCarStore();
const { orderInfo, totalPrice, carNum, merchant, type, dateTime, childrenPrice } = storeToRefs(carStore);
const value = uni.getStorageSync('currentId')
export default {
data() {
return {
@@ -161,7 +162,8 @@ export default {
// 是否同意协议
disabled: false,
// 购物车信息
showCarInfo: false
showCarInfo: false,
value
};
},
onLoad() {
@@ -331,7 +333,8 @@ export default {
isStatus: 0,
week,
dateTime: `${this.dateTime}`,
half: this.isHalf
half: this.isHalf,
admin: true
})
.then((list) => {
this.periodList = list;
@@ -344,13 +347,13 @@ export default {
icon: 'none'
});
uni.hideLoading();
if (err.message === '您还有未支付订单,请先支付') {
setTimeout(() => {
return uni.switchTab({
url: '/pages/order/order'
});
}, 1000);
}
// if (err.message === '您还有未支付订单,请先支付') {
// setTimeout(() => {
// return uni.switchTab({
// url: '/pages/order/order'
// });
// }, 1000);
// }
});
},
callPhone(phone) {
@@ -358,6 +361,11 @@ export default {
phoneNumber: phone
});
},
change(index) {
console.log('index>>: ',index);
uni.setStorageSync('currentId', index);
this.reload()
},
openCarInfo() {
// this.showCarInfo = !this.showCarInfo;
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
@@ -386,6 +394,7 @@ export default {
onField(item, period) {
// 已被预定
if (item.sold) {
uni.navigateTo({url: `/package/admin/order-detail?id=${item.orderInfoList[0].orderId}`})
return;
}
const app = this;
@@ -568,7 +577,7 @@ page {
.uni-padding-wrap {
width: 180rpx;
margin: 20rpx auto;
margin: 20rpx;
}
.uni-badge-wrap {
@@ -657,7 +666,7 @@ page {
justify-content: center;
align-items: center;
border-radius: 16rpx;
line-height: 1.3rem;
line-height: 1rem;
position: relative;
color: #333333;
background-color: #ffffff;
+454
View File
@@ -0,0 +1,454 @@
<template>
<view class="order" v-if="form.orderId">
<uni-card title="预定信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
<uv-cell :title="`${form.merchantName}`" :label="` `" :cellStyle="{ padding: '0', paddingBottom: '5px' }"
:border="false"/>
<block v-for="(item, index) in form.orderInfo" :key="index">
<uv-cell
:title="`${item.fieldName}`"
:label="`${item.comments}`"
:cellStyle="{ padding: '0', paddingBottom: '5px' }"
:value="`¥${item.price}`"
:border="item.isChildren"
/>
<uv-cell :label="`成人票 ¥50`" :value="`x ${item.adultNum}`" v-if="item.isChildren"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
<uv-cell :label="`儿童票 ¥35`" :value="`x ${item.childrenNum}`" v-if="item.isChildren"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
</block>
</uv-cell-group>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="web-text-heading">合计:¥{{ form.totalPrice }}</view>
<view class="web-text-danger">实付:¥{{ form.payPrice }}</view>
</view>
</uni-card>
<block v-if="form.orderNo">
<uni-card :border="false" :is-shadow="false" :padding="0">
<view class="web-cell web-cell-align-top">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff', padding: '8px 0' }" :border="false">
<uv-cell :title="`姓名`" :value="`${form.realName}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`手机号码`" :value="`${form.phone}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单号`" :value="`${form.orderId}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单编号`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<uv-parse :content="form.orderNo" :selectable="true"></uv-parse>
</template>
</uv-cell>
<uv-cell :title="`订单状态`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<view v-if="form.payStatus == 0">
<!-- <uv-count-down :time="form.timestamp" format="mm:ss"></uv-count-down> -->
<span style="color: #ff0000">未支付</span>
</view>
<view v-else>{{ orderStatus[form.orderStatus] }}</view>
</template>
</uv-cell>
<uv-cell :title="`下单时间`" :value="`${form.createTime}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`支付方式`" :value="`${payType[form.payType]}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`优惠说明`" :value="`${form.couponDesc ? form.couponDesc : '无'}`"
:cellStyle="{ padding: '8px' }" :border="false"/>
</uv-cell-group>
</view>
</uni-card>
</block>
<uv-gap height="50"></uv-gap>
<view class="checkout-car">
<!-- <uv-button-->
<!-- text="取消订单"-->
<!-- ></uv-button>-->
<uv-button
text="更换场地"
@click="openPicker"
></uv-button>
<!-- <uv-button-->
<!-- text="同意退款"-->
<!-- ></uv-button>-->
<!-- <uv-button-->
<!-- text="不同意退款"-->
<!-- ></uv-button>-->
</view>
<uv-picker ref="picker" :columns="fieldList" keyName="label" @confirm="confirm"></uv-picker>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
</template>
<script>
import * as OrderApi from '@/api/shop/order';
import {pageWechatDeposit} from '@/api/shop/wechatDeposit';
import * as PeriodApi from "@/api/booking/period";
import * as FieldApi from "@/api/booking/field";
import * as Api from "@/api/layout";
export default {
components: {},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['全部订单', '未支付', '已支付', '已完成', '押金'],
orderStatus: ['未使用', '已完成', '已取消', '取消中', '退款申请中', '退款被拒绝', '退款成功', '客户端申请退款'],
payType: [
'余额支付',
'微信支付',
'会员卡支付',
'支付宝',
'现金',
'POS机',
'VIP月卡',
'VIP年卡',
'VIP次卡',
'IC月卡',
'IC年卡',
'IC次卡',
'免费',
'VIP充值卡',
'IC充值卡',
'积分支付',
'VIP季卡',
'IC季卡'
],
orderList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
h5_url: '',
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
fieldList: [],
// 服务器时间
serverTime: {},
dateTime: ''
};
},
async onLoad(option) {
this.orderId = option.id;
// 判断是否登录
await this.openLogin();
// 加载数据
await this.reload();
},
onShow() {
// 判断是否登录
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
async reload() {
const app = this;
const {where, userId, orderId} = this;
if (userId === 0) {
app.openLogin();
return;
}
where.userId = userId;
uni.showLoading({
title: '数据读取中.'
});
await OrderApi.getOrder(orderId).then((data) => {
console.log('data: ', data);
app.form = data;
if(data){
this.getServerTime()
}
// 页面标题
if (data.orderStatus == 1) {
uni.setNavigationBarTitle({
title: '订单详情(已完成)'
});
}
uni.hideLoading();
});
// H5版网址
const h5_url = uni.getStorageSync('h5_url');
const tid = uni.getStorageSync('TenantId');
if (h5_url) {
app.h5_url = h5_url;
} else {
app.h5_url = `http://${tid}.h5.wsdns.cn`;
}
},
async openPicker() {
this.getBookingEmptyField()
this.$refs.picker.open();
},
confirm(e) {
console.log('confirm', e.value[0]);
console.log(this.form.orderId);
},
getBookingEmptyField(dateTime) {
const app = this
const { serverTime,merchantId,isHalf } = this;
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const startTime = serverTime.today === dateTime ? String(hours) + String(minutes) : undefined;
const week = this.week === 0 ? 7 : this.week;
app.fieldList = []
FieldApi.listField({
merchantId,
isStatus: 0,
week,
dateTime,
startTime,
half: isHalf
})
.then((list) => {
const arr = list.map(d => {
return {
label: d.fieldName,
// 其他属性值
id: d.fieldId
}
});
app.fieldList.push(arr);
uni.hideLoading();
})
.catch((err) => {
app.fieldList = [];
uni.showToast({
title: err.message,
icon: 'none'
});
uni.hideLoading();
});
},
getServerTime() {
const app = this
Api.getServerTime()
.then((result) => {
app.serverTime = result
app.form.orderInfo.map((d,i) => {
if(i === 0){
app.dateTime = d.dateTime
app.merchantId = d.merchantId
}
})
console.log(app.merchantId)
console.log(app.dateTime)
})
.catch();
},
navTo(url) {
uni.navigateTo({
url
});
},
onClickItem(e) {
const app = this;
const {where, userId} = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
if (userId == 0) {
app.openLogin();
return;
}
// 全部
if (index == 0) {
where.payStatus = undefined;
where.orderStatus = undefined;
}
// 未支付
if (index == 1) {
where.payStatus = 2;
}
// 已支付
if (index == 2) {
where.payStatus = 1;
}
// 已完成
if (index == 3) {
where.orderStatus = 1;
}
// 押金
if (index == 4) {
pageWechatDeposit({
uid: uni.getStorageSync('user_id')
}).then((res) => {
console.log('res: ', res);
app.orderList = res.list;
});
return false;
}
this.reload();
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
}
.content-text {
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
}
.order {
.order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-name {
// padding-left: 12rpx;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
.web-text-heading {
font-size: 30rpx;
font-weight: 500;
}
.web-text-danger {
font-size: 30rpx;
font-weight: 500;
}
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
.close {
top: 60rpx !important;
}
.qrcode {
margin-top: 30rpx;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.checkout-car {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-around;
border-radius: 100px;
align-items: center;
.car-selected {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.car-total {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
.save-btn {
}
}
}
</style>
+1
View File
@@ -1,5 +1,6 @@
<template>
<view class="order" v-if="isLogin">
orderNo: {{ orderNo }}
<uni-card title="预定信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
+465
View File
@@ -0,0 +1,465 @@
<template>
<view class="admin-order-detail">
<view>
<uni-search-bar placeholder="订单号" @confirm="reload" :focus="true" v-model="orderId" />
</view>
<view class="order" v-if="form.orderId">
<uni-card title="预定信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
<uv-cell :title="`${form.merchantName}`" :label="` `" :cellStyle="{ padding: '0', paddingBottom: '5px' }"
:border="false"/>
<block v-for="(item, index) in form.orderInfo" :key="index">
<uv-cell
:title="`${item.fieldName}`"
:label="`${item.comments}`"
:cellStyle="{ padding: '0', paddingBottom: '5px' }"
:value="`¥${item.price}`"
:border="item.isChildren"
/>
<uv-cell :label="`成人票 ¥50`" :value="`x ${item.adultNum}`" v-if="item.isChildren"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
<uv-cell :label="`儿童票 ¥35`" :value="`x ${item.childrenNum}`" v-if="item.isChildren"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
</block>
</uv-cell-group>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="web-text-heading">合计:¥{{ form.totalPrice }}</view>
<view class="web-text-danger">实付:¥{{ form.payPrice }}</view>
</view>
</uni-card>
<block v-if="form.orderNo">
<uni-card :border="false" :is-shadow="false" :padding="0">
<view class="web-cell web-cell-align-top">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff', padding: '8px 0' }" :border="false">
<uv-cell :title="`姓名`" :value="`${form.realName}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`手机号码`" :value="`${form.phone}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单号`" :value="`${form.orderId}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单编号`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<uv-parse :content="form.orderNo" :selectable="true"></uv-parse>
</template>
</uv-cell>
<uv-cell :title="`订单状态`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<view v-if="form.payStatus == 0">
<!-- <uv-count-down :time="form.timestamp" format="mm:ss"></uv-count-down> -->
<span style="color: #ff0000">未支付</span>
</view>
<view v-else>{{ orderStatus[form.orderStatus] }}</view>
</template>
</uv-cell>
<uv-cell :title="`下单时间`" :value="`${form.createTime}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`支付方式`" :value="`${payType[form.payType]}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`优惠说明`" :value="`${form.couponDesc ? form.couponDesc : '无'}`"
:cellStyle="{ padding: '8px' }" :border="false"/>
</uv-cell-group>
</view>
</uni-card>
</block>
<uv-gap height="50"></uv-gap>
<view class="checkout-car">
<!-- <uv-button-->
<!-- text="取消订单"-->
<!-- ></uv-button>-->
<uv-button
text="更换场地"
@click="openPicker"
></uv-button>
<!-- <uv-button-->
<!-- text="同意退款"-->
<!-- ></uv-button>-->
<!-- <uv-button-->
<!-- text="不同意退款"-->
<!-- ></uv-button>-->
</view>
<uv-picker ref="picker" :columns="fieldList" keyName="label" @confirm="confirm"></uv-picker>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
</view>
</template>
<script>
import * as OrderApi from '@/api/shop/order';
import {pageWechatDeposit} from '@/api/shop/wechatDeposit';
import * as PeriodApi from "@/api/booking/period";
import * as FieldApi from "@/api/booking/field";
import * as Api from "@/api/layout";
export default {
components: {},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['全部订单', '未支付', '已支付', '已完成', '押金'],
orderStatus: ['未使用', '已完成', '已取消', '取消中', '退款申请中', '退款被拒绝', '退款成功', '客户端申请退款'],
payType: [
'余额支付',
'微信支付',
'会员卡支付',
'支付宝',
'现金',
'POS机',
'VIP月卡',
'VIP年卡',
'VIP次卡',
'IC月卡',
'IC年卡',
'IC次卡',
'免费',
'VIP充值卡',
'IC充值卡',
'积分支付',
'VIP季卡',
'IC季卡'
],
orderList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
h5_url: '',
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
fieldList: [],
// 服务器时间
serverTime: {},
dateTime: ''
};
},
async onLoad(option) {
this.orderId = option.id;
// 判断是否登录
await this.openLogin();
// 加载数据
// await this.reload();
},
onShow() {
// 判断是否登录
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
async reload() {
const app = this;
const {where, userId, orderId} = this;
if (userId === 0) {
app.openLogin();
return;
}
where.userId = userId;
uni.showLoading({
title: '数据读取中.'
});
await OrderApi.getOrder(orderId).then((data) => {
app.form = data;
if(data){
this.getServerTime()
}
// 页面标题
if (data.orderStatus == 1) {
uni.setNavigationBarTitle({
title: '订单详情'
});
}
uni.hideLoading();
}).catch(err => {
console.log(err)
uni.showToast({
title: '订单不存在',
icon: 'none'
})
uni.hideLoading();
});
// H5版网址
const h5_url = uni.getStorageSync('h5_url');
const tid = uni.getStorageSync('TenantId');
if (h5_url) {
app.h5_url = h5_url;
} else {
app.h5_url = `http://${tid}.h5.wsdns.cn`;
}
},
async openPicker() {
this.getBookingEmptyField()
this.$refs.picker.open();
},
confirm(e) {
console.log('confirm', e.value[0]);
console.log(this.form.orderId);
},
getBookingEmptyField(dateTime) {
const app = this
const { serverTime,merchantId,isHalf } = this;
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const startTime = serverTime.today === dateTime ? String(hours) + String(minutes) : undefined;
const week = this.week === 0 ? 7 : this.week;
app.fieldList = []
FieldApi.listField({
merchantId,
isStatus: 0,
week,
dateTime,
startTime,
half: isHalf
})
.then((list) => {
const arr = list.map(d => {
return {
label: d.fieldName,
// 其他属性值
id: d.fieldId
}
});
app.fieldList.push(arr);
uni.hideLoading();
})
.catch((err) => {
app.fieldList = [];
uni.showToast({
title: err.message,
icon: 'none'
});
uni.hideLoading();
});
},
getServerTime() {
const app = this
Api.getServerTime()
.then((result) => {
app.serverTime = result
app.form.orderInfo.map((d,i) => {
if(i === 0){
app.dateTime = d.dateTime
app.merchantId = d.merchantId
}
})
console.log(app.merchantId)
console.log(app.dateTime)
})
.catch();
},
navTo(url) {
uni.navigateTo({
url
});
},
onClickItem(e) {
const app = this;
const {where, userId} = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
if (userId == 0) {
app.openLogin();
return;
}
// 全部
if (index == 0) {
where.payStatus = undefined;
where.orderStatus = undefined;
}
// 未支付
if (index == 1) {
where.payStatus = 2;
}
// 已支付
if (index == 2) {
where.payStatus = 1;
}
// 已完成
if (index == 3) {
where.orderStatus = 1;
}
// 押金
if (index == 4) {
pageWechatDeposit({
uid: uni.getStorageSync('user_id')
}).then((res) => {
console.log('res: ', res);
app.orderList = res.list;
});
return false;
}
this.reload();
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
}
.content-text {
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
}
.order {
.order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-name {
// padding-left: 12rpx;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
.web-text-heading {
font-size: 30rpx;
font-weight: 500;
}
.web-text-danger {
font-size: 30rpx;
font-weight: 500;
}
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
.close {
top: 60rpx !important;
}
.qrcode {
margin-top: 30rpx;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.checkout-car {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-around;
border-radius: 100px;
align-items: center;
.car-selected {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.car-total {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
.save-btn {
}
}
}
</style>
+23 -16
View File
@@ -2,9 +2,9 @@
<view class="container">
<!-- deBug信息 -->
<view v-if="merchant" class="web-debug web-text-success" style="display: none;">
场馆ID:{{ merchant.merchantId }} 场馆编号:{{ merchant.merchantCode }} 场馆名称:{{ merchant.merchantName }}
日期:{{ dateTime }}
星期:{{ week }}
场馆ID:{{ merchant.merchantId }} 场馆编号:{{ merchant.merchantCode }} 场馆名称:{{ merchant.merchantName }}
日期:{{ dateTime }}
星期:{{ week }}
订单总金额:{{ totalPrice }}
类型:{{ type }}
场地信息:{{ orderInfo }}
@@ -233,7 +233,7 @@
// 加载预定日期
app.next7day = next7day.map((d, i) => {
if (!app.dateTime && i == 0) {
if (!app.dateTime && i === 0) {
app.dateTime = d.dateTime
app.week = d.week
carStore.dateTime = d.dateTime
@@ -273,11 +273,11 @@
},
onType(e) {
const index = e.currentIndex
if (index == 0) {
if (index === 0) {
this.type = 0;
this.isHalf = 0;
}
if (index == 1) {
if (index === 1) {
this.type = 1;
this.isHalf = 1;
}
@@ -320,13 +320,20 @@
// },
getBookingPeriod() {
const {
serverTime
serverTime,
merchantId
} = this
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes()
const startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : undefined
const week = this.week == 0 ? 7 : this.week
let startTime;
startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : undefined
// 游泳馆当前21:30前都可以预定
if(merchantId === '3028' && Number(startTime) < 2130){
startTime = undefined
}
PeriodApi.listPeriod({
merchantId: this.merchantId,
isStatus: 0,
@@ -344,7 +351,7 @@
icon: 'none'
})
uni.hideLoading()
if(err.message == '您还有未支付订单,请先支付'){
if(err.message === '您还有未支付订单,请先支付'){
setTimeout(() => {
return uni.switchTab({
url: '/pages/order/order'
@@ -395,7 +402,7 @@
// 场地
// const f = this.fieldList[i2]
const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`)
const index = app.selection.findIndex(d => d.key == key)
const index = app.selection.findIndex(d => d.key === key)
if (index >= 0) {
app.selection.splice(index, 1)
} else {
@@ -457,7 +464,7 @@
console.log('period: ',period);
// 是否支持儿童票
console.log('item.isChildren: ',item.isChildren);
if(item.isChildren == 1){
if(item.isChildren === 1){
console.log('item.isChildren2: ',item.isChildren);
carStore.childrenPrice = period.childrenPrice
}else{
@@ -477,11 +484,11 @@
const startTime = new Date(`${this.dateTime} ${timeText}:00`).getTime()
return startTime / 1000 || 0;
},
isActive(item) {
const index = this.selection.find(d => d.key == getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`))
const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`))
if(item.sold){
if(item.isHalf == 1){
if(item.isHalf === 1){
return 'web-bg-warning'
}
return 'web-bg-info'
@@ -504,7 +511,7 @@
// }
// },
remove(item) {
const index = this.selection.findIndex(d => d.key == item.key)
const index = this.selection.findIndex(d => d.key === item.key)
this.selection.splice(index, 1)
carStore.orderInfo = this.selection
},
@@ -698,4 +705,4 @@
}
}
}
</style>
</style>
+10 -5
View File
@@ -277,6 +277,8 @@ export default {
}).then((data) => {
if (data) {
app.hideUser = false;
app.userInfo.money = data.money;
console.log('money',app.userInfo.money)
app.userInfo.ouid = data.userId;
app.userInfo = Object.assign({}, app.userInfo, data);
}
@@ -321,12 +323,13 @@ export default {
Promise.all([app.getUserCard(), app.getPayment()]).then((res) => {
const userCard = res[0];
const payment = res[1];
// 当前可用会员卡
app.userCard = userCard;
// 支付方式列表
app.payment = payment.map((d) => {
if (d.type == 0) {
d.name = `${d.name} (余额¥${app.userInfo.balance})`;
d.name = `${d.name} (余额¥${app.userInfo.money || 0})`;
}
if (d.type == 2 && userCard) {
d.name = `${userCard.name}(¥${userCard.remainingMoney})`;
@@ -381,10 +384,12 @@ export default {
// 读取可用的会员卡
async getUserCard() {
const app = this;
const { payPrice } = this
return new Promise((resolve, reject) => {
const { merchantId } = this;
UserCardApi.findUseCard({
sid: merchantId
sid: merchantId,
payPrice
})
.then((result) => {
resolve(result);
@@ -590,7 +595,7 @@ export default {
const orderInfo = data;
// 调起微信支付
if (form.payType == 1) {
if (form.payType === 1) {
// #ifdef MP-WEIXIN
uni.requestPayment({
provider: orderInfo.provider, // 服务提供商
@@ -636,7 +641,7 @@ export default {
// #endif
}
// 使用余额支付
if (form.payType == 0) {
if (form.payType === 0) {
if (!orderInfo) {
return uni.showToast({
title: '支付失败',
@@ -664,7 +669,7 @@ export default {
}
// 使用会员卡支付
if (form.payType == 2) {
if (form.payType === 2) {
if (!orderInfo) {
return uni.showToast({
title: '支付失败',
+48 -26
View File
@@ -2,24 +2,37 @@
<view>
<view class="coupon">
<block v-for="(item,index) in list" :key="index">
<view class="coupon-item web-cell">
<view class="coupon-item web-cell" v-if="item.type === 10">
<view class="coupon-bg">
<view class="title"><span class="price">8</span><span class="unit">元</span></view>
<view class="title"><span class="price">{{ item.reducePrice }}</span><span class="unit">元</span></view>
<view class="desc">满减劵</view>
</view>
<view class="coupon-info web-cell web-cell-content">
<view class="coupon-content">
<view class="title">优惠券名称</view>
<view class="desc web-text-secondary">有效期至:2024-05-29</view>
<view class="title">{{ item.name }}</view>
<view class="desc web-text-secondary text-xs">有效期至:{{ item.endTime }}</view>
</view>
<uv-button class="save-btn" size="mini"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',color: '#ffffff', border: 'none'}"
:text="item.disabled ? '已领取': '领取'" :disabled="item.disabled" @click="save(item,index)"></uv-button>
</view>
</view>
<view class="coupon-item web-cell" v-if="item.type === 20">
<view class="coupon-bg2" v-if="item.type === 20">
<view class="title"><span class="price">{{ item.discount * 0.1 }}</span><span class="unit">折</span></view>
<view class="desc">折扣劵</view>
</view>
<view class="coupon-info web-cell web-cell-content">
<view class="coupon-content">
<view class="title">{{ item.name }}</view>
<view class="desc web-text-secondary text-xs">有效期至:{{ item.endTime }}</view>
</view>
<uv-button class="save-btn" size="mini"
:customStyle="{background: 'linear-gradient(to right, #ffd87b, #f8a900)',color: '#ffffff', border: 'none'}"
:text="item.disabled ? '已领取': '领取'" :disabled="item.disabled" @click="save(item,index)"></uv-button>
</view>
</view>
</block>
<!-- <uv-empty mode="order" v-if="list.length == 0"
icon="https://cdn.uviewui.com/uview/empty/data.png"></uv-empty> -->
<uni-load-more v-if="list.length > 0" :status="loadMore"></uni-load-more>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
@@ -109,22 +122,9 @@
title: '数据读取中.'
})
app.loadMore = 'loading'
const userCouponIds = []
const userCoupons = await app.getUserCoupon({
userId: uni.getStorageSync('user_id')
}).then(list => {
list.map(d => {
userCouponIds.push(d.couponId)
})
})
console.log('userCoupons: ',userCouponIds);
CouponApi.pageCoupon(where).then(res => {
const list = res.list.map(d => {
if(userCouponIds.indexOf(d.id) == 0){
d.disabled = true
}
return d;
});
const list = res.list;
if (app.list.length < res.count) {
app.list = app.list.concat(list)
app.canReset = true
@@ -133,7 +133,7 @@
app.canReset = false;
app.loadMore = 'no-more'
}
console.log('app.list: ',app.list);
uni.hideLoading()
app.isRefresh = false
}).catch(() => {
@@ -222,7 +222,7 @@
const app = this
item.couponId = item.id
app.list[index].disabled = true
UserCouponApi.addUserCoupon(item).then(msg => {
uni.showToast({
title: '领取成功',
@@ -231,7 +231,7 @@
setTimeout(() => {
app.reload()
},2000)
})
}
}
@@ -270,6 +270,7 @@
.coupon {
.coupon-item {
width: 700rpx;
height: 140rpx;
margin: 20rpx auto;
border-radius: 12rpx;
border-bottom: 1px #eee solid;
@@ -292,6 +293,24 @@
}
}
.coupon-bg2{
width: 140rpx;
height: 140rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #fff;
border-radius: 12rpx 0 0 12rpx;
background: linear-gradient(to right, #ffd87b, #f8a900);
.price {
font-size: 50rpx;
}
}
.coupon-info {
padding: 20rpx;
display: flex;
@@ -300,7 +319,7 @@
line-height: 2rem;
}
}
.save-btn{
// margin-right: 20rpx;
}
@@ -367,4 +386,7 @@
font-size: 30rpx !important;
}
}
</style>
.text-xs{
font-size: 25rpx;
}
</style>
+2 -2
View File
@@ -121,7 +121,7 @@
// 获取收货地址列表
MerchantApi.pageMerchant({
merchantIds: app.sid
merchantCodes: app.sid
}).then(res => {
app.list = res.list;
})
@@ -281,4 +281,4 @@
margin-right: 20rpx;
}
}
</style>
</style>
+5 -5
View File
@@ -3,7 +3,7 @@
<!-- 其他功能 -->
<block v-for="(item, index) in list" :key="index">
<uni-card :border="false" :is-shadow="false" :padding="0">
<uv-cell :title="item.comments" :label="item.createTime" :value="`-${item.money}`" :cellStyle="{ padding: '10px 0' }" :border="false"></uv-cell>
<uv-cell :title="item.comments" :label="item.createTime" :value="`${item.price}`" :cellStyle="{ padding: '10px 0' }" :border="false"></uv-cell>
</uni-card>
</block>
<!-- 登录组件 -->
@@ -21,20 +21,20 @@ const userStore = useUserStore();
export default {
data() {
return {
userCardId: 0,
cardId: 0,
list: [],
isLogin: false,
logo: uni.getStorageSync('app_logo'),
};
},
onLoad(o) {
this.userCardId = o.id;
this.cardId = o.id;
this.reload();
},
methods: {
async reload(e) {
const app = this;
const { userCardId } = this;
const { cardId } = this;
// 当前登录用户信息
const userInfo = await userStore.fetchUserInfo();
if (Object.keys(userInfo).length > 0) {
@@ -47,7 +47,7 @@ export default {
}
// 获取会员卡使用记录
Api.pageUserCardLog({userCardId}).then((res) => {
Api.pageUserCardLog({cardId}).then((res) => {
app.list = res.list;
});
},
+2 -1
View File
@@ -142,7 +142,8 @@ export default {
return;
}
where.userId = userId;
where.payStatus = 1;
where.status = 1;
where.sceneType = 'myCardAll';
app.loadMore = 'loading';
Api.pageUserCard(where)
.then((res) => {
+57 -15
View File
@@ -6,21 +6,36 @@
</view>
<view class="coupon">
<block v-for="(item,index) in list" :key="index">
<view class="coupon-item web-cell">
<view class="coupon-bg">
<view class="title"><span class="price">8</span><span class="unit">元</span></view>
<view class="desc">满减劵</view>
</view>
<view class="coupon-info web-cell web-cell-content">
<view class="coupon-content">
<view class="title">优惠券名称</view>
<view class="desc web-text-secondary">有效期至:2024-05-29</view>
</view>
<uv-button class="save-btn" size="mini"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',color: '#ffffff', border: 'none'}"
text="去使用" @click="save"></uv-button>
</view>
</view>
<view class="coupon-item web-cell" v-if="item.type === 10">
<view class="coupon-bg">
<view class="title"><span class="price">{{ item.reducePrice }}</span><span class="unit">元</span></view>
<view class="desc">满减劵</view>
</view>
<view class="coupon-info web-cell web-cell-content">
<view class="coupon-content">
<view class="title">{{ item.name }}</view>
<view class="desc web-text-secondary text-xs">有效期至:{{ item.endTime }}</view>
</view>
<uv-button class="save-btn" size="mini"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',color: '#ffffff', border: 'none'}"
text="去使用" :disabled="item.disabled" @click="toUse(`/pages/shop/shop`)"></uv-button>
</view>
</view>
<view class="coupon-item web-cell" v-if="item.type === 20">
<view class="coupon-bg2" v-if="item.type === 20">
<view class="title"><span class="price">{{ item.discount * 0.1 }}</span><span class="unit">折</span></view>
<view class="desc">折扣劵</view>
</view>
<view class="coupon-info web-cell web-cell-content">
<view class="coupon-content">
<view class="title">{{ item.name }}</view>
<view class="desc web-text-secondary text-xs">有效期至:{{ item.endTime }}</view>
</view>
<uv-button class="save-btn" size="mini"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',color: '#ffffff', border: 'none'}"
text="去使用" :disabled="item.disabled" @click="toUse(`/pages/shop/shop`)"></uv-button>
</view>
</view>
</block>
<!-- <uv-empty mode="order" v-if="list.length == 0"
icon="https://cdn.uviewui.com/uview/empty/data.png"></uv-empty> -->
@@ -172,6 +187,11 @@
url
})
},
toUse(url){
uni.switchTab({
url
})
},
toPay(orderId) {
uni.navigateTo({
url: '/package/booking/confirm?id=' + orderId
@@ -246,6 +266,7 @@
.coupon {
.coupon-item {
width: 700rpx;
height: 140rpx;
margin: 20rpx auto;
border-radius: 12rpx;
border-bottom: 1px #eee solid;
@@ -268,6 +289,23 @@
}
}
.coupon-bg2{
width: 140rpx;
height: 140rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #fff;
border-radius: 12rpx 0 0 12rpx;
background: linear-gradient(to right, #ffd87b, #f8a900);
.price {
font-size: 50rpx;
}
}
.coupon-info {
padding: 20rpx;
display: flex;
@@ -343,4 +381,8 @@
font-size: 30rpx !important;
}
}
.text-xs{
font-size: 25rpx;
}
</style>
+22 -14
View File
@@ -6,12 +6,12 @@
<view class="web-cell-content">
<view class="integral-bar web-cell web-cell-content">
<text class="web-text-placeholder">当前积分</text>
<text class="integral web-text-heading">{{ userInfo.points }}</text>
<text class="integral web-text-heading">{{ Math.floor(userInfo.users.integral) }}</text>
</view>
<view class="sign-in-btn">
<uv-button class="btn" :disabled="todaySign"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',borderRadius: '30px',color: '#ffffff'}"
text="签到" @click="onSign"></uv-button>
:text="`${todaySign ? '今日已签到' : '签到'}`" @click="onSign"></uv-button>
</view>
</view>
</view>
@@ -22,7 +22,7 @@
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
</view>
</template>
@@ -31,15 +31,11 @@
useUserStore
} from '@/store/modules/user';
import * as Api from '@/api/booking/integral';
import {
getWxOpenId
} from '@/api/passport/login';
import * as UserApi from '@/api/booking/users';
import {
openUrl
} from '@/utils/common';
import * as UserApi from '@/api/system/user'
import {
useTenantStore
} from '@/store/modules/tenant';
@@ -93,6 +89,16 @@
if (Object.keys(userInfo).length > 0) {
app.isLogin = true
app.userInfo = userInfo
// 获取用户副表信息
UserApi.getByPhone({
phone: userInfo.phone
}).then((data) => {
if (data) {
app.userInfo.users = data;
app.userInfo.ouid = data.uid;
uni.setStorageSync('ouid',data.uid);
}
});
} else {
app.isLogin = false
}
@@ -102,7 +108,7 @@
dateTime
}).then(res => {
uni.hideLoading()
if (res.message == '您今天已经签到过了') {
if (res.message === '您今天已经签到过了') {
app.todaySign = true
}
app.selected = []
@@ -132,9 +138,11 @@
const app = this
app.openLogin()
app.todaySign = true
Api.addIntegral({}).then(res => {
UserApi.updatePointsBySign()
app.userInfo.points++
Api.addIntegral({
id: app.userInfo.users.id
}).then(res => {
// UserApi.updatePointsBySign()
// app.userInfo.points++
uni.showToast({
title: '签到成功',
icon: 'success'
@@ -168,7 +176,7 @@
}
</style>
<style lang="scss">
.integral-bar {
flex-direction: column;
@@ -189,4 +197,4 @@
margin-bottom: 50rpx;
}
}
</style>
</style>
+33 -16
View File
@@ -1,10 +1,10 @@
<template>
<view class="page" v-if="form">
<view class="flex justify-center"></view>
<button open-type="chooseAvatar" @chooseavatar="chooseAvatar" class="btn">
<uv-avatar :src="form.avatarUrl" size="100"></uv-avatar>
<text class="web-text-placeholder">更换头像</text>
</button>
<!-- <button open-type="chooseAvatar" @chooseavatar="chooseAvatar" class="btn">-->
<!-- <uv-avatar :src="form.avatarUrl" size="100"></uv-avatar>-->
<!-- <text class="web-text-placeholder">更换头像</text>-->
<!-- </button>-->
<!-- 其他功能 -->
<uni-card :border="false" :is-shadow="false" :padding="0">
@@ -25,22 +25,38 @@
</uv-cell>
</uv-form-item>
<uv-form-item prop="form.idCard" borderBottom>
<uv-cell title="身份证号码" :value="form.idCard">
<uv-cell title="证件号码" :value="form.idCard">
<template v-slot:value>
<uv-input placeholder="请输入身份证号" v-model="form.idCard" maxlength="18"></uv-input>
<uv-input placeholder="请输入证件号码" v-model="form.idCard"></uv-input>
</template>
<!-- <template v-slot:right-icon>
<uv-icon size="40rpx" name="camera" @click="onIdCard(item)"></uv-icon>
</template> -->
</uv-cell>
</uv-form-item>
<uv-form-item prop="form.idCard" borderBottom>
<uv-cell title="上传证件">
<template v-slot:right-icon>
<uv-icon size="40rpx" name="camera" @click="onIdCard(item)"></uv-icon>
</template>
</uv-cell>
</uv-form-item>
<uv-form-item prop="form.idCard" borderBottom>
<uv-cell>
<template v-slot:label>
<image src="https://oss.wsdns.cn/20240502/ec8c13037e7d4d40931b49fd45b23c61.png?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90" style="width: 80rpx" mode="widthFix" />
</template>
</uv-cell>
<uv-cell>
<template v-slot:label>
<image src="https://oss.wsdns.cn/20240502/ec8c13037e7d4d40931b49fd45b23c61.png?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90" style="width: 80rpx" mode="widthFix" />
</template>
</uv-cell>
</uv-form-item>
</uv-form>
</view>
</uni-card>
<view class="btn-bar">
<uv-button class="save-user-profile"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',borderRadius: '30px',color: '#ffffff'}"
text="保存" @click="save"></uv-button>
text="提交审核" @click="save"></uv-button>
</view>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
@@ -130,14 +146,14 @@
const url = detail.avatarUrl
this.form.avatarUrl = await uploadOssByPath(url)
UserApi.updateUsers({
uid: this.form.uid,
id: this.form.id,
avatarUrl: `${this.form.avatarUrl}`
})
},
save() {
const app = this
const { form } = this
if(!uni.$uv.test.idCard(form.idCard)){
uni.showToast({
title: '请填写真实身份证号',
@@ -145,12 +161,13 @@
})
return false
}
UserApi.updateUsers({
phone: form.phone,
username: form.username,
realName: form.realName,
idCard: form.idCard,
uid: form.uid
id: form.id
}).then(res => {
uni.showToast({
title: '保存成功',
@@ -198,8 +215,8 @@
flex-direction: column;
padding: 20rpx 0;
}
.btn::after {
border: none;
}
</style>
</style>