预约记录对接完成
This commit is contained in:
parent
ee3d541592
commit
b38f44530e
@ -68,8 +68,8 @@
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
|
||||
<!-- 签到说明 -->
|
||||
@ -572,15 +572,16 @@
|
||||
position: relative;
|
||||
|
||||
.sign-list {
|
||||
width: 86%;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background: white;
|
||||
margin: 0 7px;
|
||||
border-radius: 18px;
|
||||
|
||||
.new-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.left {
|
||||
@ -612,12 +613,20 @@
|
||||
}
|
||||
|
||||
.new-bottom {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
margin-top: 5px;
|
||||
// grid-template-columns: repeat(auto-fill, 22%);
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-rows: 100px;
|
||||
grid-auto-rows: 100px;
|
||||
justify-content: center;
|
||||
grid-gap: 5px;
|
||||
padding: 5px;
|
||||
|
||||
.new-l {
|
||||
padding: 5px;
|
||||
// padding: 5px;
|
||||
float: left;
|
||||
width: 21.9%;
|
||||
width: 100%;
|
||||
|
||||
.new-list {
|
||||
padding: 5px 5px;
|
||||
@ -680,10 +689,10 @@
|
||||
|
||||
.new-7 {
|
||||
position: relative;
|
||||
width: 134px;
|
||||
width: 178%;
|
||||
padding: 5px 10px;
|
||||
padding-bottom: 0;
|
||||
height: 80px;
|
||||
height: 80%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
|
@ -19,11 +19,11 @@
|
||||
<view class="price-box ss-flex ss-row-between ss-m-b-18">
|
||||
<view class="ss-flex new-ss-flex">
|
||||
<!-- <view class="tig ss-flex ss-col-center">
|
||||
<view class="tig-icon ss-flex ss-col-center ss-row-center">
|
||||
<text class="cicon-alarm"></text>
|
||||
</view>
|
||||
<view class="tig-title">秒杀价</view>
|
||||
</view> -->
|
||||
<view class="tig-icon ss-flex ss-col-center ss-row-center">
|
||||
<text class="cicon-alarm"></text>
|
||||
</view>
|
||||
<view class="tig-title">秒杀价</view>
|
||||
</view> -->
|
||||
<view class="new-tig-title ss-m-r-16">秒杀价</view>
|
||||
<view class="price-text ss-m-r-16">
|
||||
{{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }}
|
||||
|
@ -1,290 +1,326 @@
|
||||
<!-- 收银台 -->
|
||||
<template>
|
||||
<s-layout title="收银台">
|
||||
<view class="bg-white ss-modal-box ss-flex-col">
|
||||
<!-- 订单信息 -->
|
||||
<view class="modal-header ss-flex-col ss-col-center ss-row-center">
|
||||
<view class="money-box ss-m-b-20">
|
||||
<text class="money-text">{{ fen2yuan(state.orderInfo.price) }}</text>
|
||||
</view>
|
||||
<view class="time-text">
|
||||
<text>{{ payDescText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<s-layout title="收银台">
|
||||
<view class="bg-white ss-modal-box ss-flex-col">
|
||||
<!-- 订单信息 -->
|
||||
<view class="modal-header ss-flex-col ss-col-center ss-row-center">
|
||||
<view class="money-box ss-m-b-20">
|
||||
<text class="money-text">{{ fen2yuan(state.orderInfo.price) }}</text>
|
||||
</view>
|
||||
<view class="time-text">
|
||||
<text>{{ payDescText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view class="modal-content ss-flex-1">
|
||||
<view class="pay-title ss-p-l-30 ss-m-y-30">选择支付方式</view>
|
||||
<radio-group @change="onTapPay">
|
||||
<label class="pay-type-item" v-for="item in state.payMethods" :key="item.title">
|
||||
<view
|
||||
class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"
|
||||
:class="{ 'disabled-pay-item': item.disabled }"
|
||||
>
|
||||
<view class="ss-flex ss-col-center">
|
||||
<image
|
||||
class="pay-icon"
|
||||
v-if="item.disabled"
|
||||
:src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
class="pay-icon"
|
||||
v-else
|
||||
:src="sheep.$url.static(item.icon)"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="pay-title">{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
||||
<view class="userInfo-money ss-m-r-10" v-if="item.value === 'wallet'">
|
||||
余额: {{ fen2yuan(userWallet.balance) }}元
|
||||
</view>
|
||||
<radio
|
||||
:value="item.value"
|
||||
color="var(--ui-BG-Main)"
|
||||
style="transform: scale(0.8)"
|
||||
:disabled="item.disabled"
|
||||
:checked="state.payment === item.value"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<!-- 支付方式 -->
|
||||
<view class="modal-content ss-flex-1">
|
||||
<view class="pay-title ss-p-l-30 ss-m-y-30">选择支付方式</view>
|
||||
<radio-group @change="onTapPay">
|
||||
<label class="pay-type-item" v-for="item in state.payMethods" :key="item.title">
|
||||
<view class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"
|
||||
:class="{ 'disabled-pay-item': item.disabled }">
|
||||
<view class="ss-flex ss-col-center">
|
||||
<image class="pay-icon" v-if="item.disabled"
|
||||
:src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')"
|
||||
mode="aspectFit" />
|
||||
<image class="pay-icon" v-else :src="sheep.$url.static(item.icon)" mode="aspectFit" />
|
||||
<text class="pay-title">{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
||||
<view class="userInfo-money ss-m-r-10" v-if="item.value === 'wallet'">
|
||||
余额: {{ fen2yuan(userWallet.balance) }}元
|
||||
</view>
|
||||
<radio :value="item.value" color="var(--ui-BG-Main)" style="transform: scale(0.8)"
|
||||
:disabled="item.disabled" :checked="state.payment === item.value" />
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 工具 -->
|
||||
<view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40">
|
||||
<button v-if="state.payStatus === 0" class="ss-reset-button past-due-btn">
|
||||
检测支付环境中
|
||||
</button>
|
||||
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
||||
支付已过期
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="ss-reset-button save-btn"
|
||||
@tap="onPay"
|
||||
:disabled="state.payStatus !== 1"
|
||||
:class="{ 'disabled-btn': state.payStatus !== 1 }"
|
||||
>
|
||||
立即支付
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</s-layout>
|
||||
<!-- 工具 -->
|
||||
<view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40">
|
||||
<button v-if="state.payStatus === 0" class="ss-reset-button past-due-btn">
|
||||
检测支付环境中
|
||||
</button>
|
||||
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
||||
支付已过期
|
||||
</button>
|
||||
<button v-else class="ss-reset-button save-btn" @tap="onPay" :disabled="state.payStatus !== 1"
|
||||
:class="{ 'disabled-btn': state.payStatus !== 1 }">
|
||||
立即支付
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
||||
import PayOrderApi from '@/sheep/api/pay/order';
|
||||
import PayChannelApi from '@/sheep/api/pay/channel';
|
||||
import { getPayMethods } from '@/sheep/platform/pay';
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
fen2yuan,
|
||||
useDurationTime
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import PayOrderApi from '@/sheep/api/pay/order';
|
||||
import PayChannelApi from '@/sheep/api/pay/channel';
|
||||
import {
|
||||
getPayMethods
|
||||
} from '@/sheep/platform/pay';
|
||||
import request from '@/sheep/request';
|
||||
import {
|
||||
baseUrl,
|
||||
apiPath
|
||||
} from '@/sheep/config';
|
||||
const userWallet = computed(() => sheep.$store('user').userWallet);
|
||||
|
||||
const userWallet = computed(() => sheep.$store('user').userWallet);
|
||||
// 检测支付环境
|
||||
const state = reactive({
|
||||
orderType: 'goods', // 订单类型; goods - 商品订单, recharge - 充值订单
|
||||
orderInfo: {}, // 支付单信息
|
||||
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
|
||||
payMethods: [], // 可选的支付方式
|
||||
payment: '', // 选中的支付方式
|
||||
vip: '' ,//vip卡支付
|
||||
vipid:'',//vip支付id需要
|
||||
cardName:''//vip卡类型
|
||||
});
|
||||
|
||||
// 检测支付环境
|
||||
const state = reactive({
|
||||
orderType: 'goods', // 订单类型; goods - 商品订单, recharge - 充值订单
|
||||
orderInfo: {}, // 支付单信息
|
||||
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
|
||||
payMethods: [], // 可选的支付方式
|
||||
payment: '', // 选中的支付方式
|
||||
});
|
||||
const onPay = () => {
|
||||
if (state.payment === '') {
|
||||
console.log(state.vipid, "sssssssssssss")
|
||||
sheep.$helper.toast('请选择支付方式');
|
||||
return;
|
||||
}
|
||||
if (state.payment === 'wallet') {
|
||||
if (state.vip == "vip") {
|
||||
console.log("-------sssss----")
|
||||
let data = {
|
||||
id: state.vipid,
|
||||
cardName: state.cardName,
|
||||
payChannel: "wallet"
|
||||
}
|
||||
// 定义方法
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/pay/member/update`,
|
||||
method: 'post',
|
||||
data,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log(res, "sss")
|
||||
if(res.data){
|
||||
sheep.$helper.toast('开通成功');
|
||||
setTimeout(()=>{
|
||||
sheep.$router.go('/pages/index/user')
|
||||
},1500)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要支付吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const onPay = () => {
|
||||
if (state.payment === '') {
|
||||
sheep.$helper.toast('请选择支付方式');
|
||||
return;
|
||||
}
|
||||
if (state.payment === 'wallet') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要支付吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
||||
}
|
||||
};
|
||||
|
||||
// 支付文案提示
|
||||
const payDescText = computed(() => {
|
||||
if (state.payStatus === 2) {
|
||||
return '该订单已支付';
|
||||
}
|
||||
if (state.payStatus === 1) {
|
||||
const time = useDurationTime(state.orderInfo.expireTime);
|
||||
if (time.ms <= 0) {
|
||||
state.payStatus = -1;
|
||||
return '';
|
||||
}
|
||||
return `剩余支付时间 ${time.h}:${time.m}:${time.s} `;
|
||||
}
|
||||
if (state.payStatus === -2) {
|
||||
return '未查询到支付单信息';
|
||||
}
|
||||
return '';
|
||||
});
|
||||
// 支付文案提示
|
||||
const payDescText = computed(() => {
|
||||
if (state.payStatus === 2) {
|
||||
return '该订单已支付';
|
||||
}
|
||||
if (state.payStatus === 1) {
|
||||
const time = useDurationTime(state.orderInfo.expireTime);
|
||||
if (time.ms <= 0) {
|
||||
state.payStatus = -1;
|
||||
return '';
|
||||
}
|
||||
return `剩余支付时间 ${time.h}:${time.m}:${time.s} `;
|
||||
}
|
||||
if (state.payStatus === -2) {
|
||||
return '未查询到支付单信息';
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
||||
// 状态转换:payOrder.status => payStatus
|
||||
function checkPayStatus() {
|
||||
if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
|
||||
// 支付成功
|
||||
state.payStatus = 2;
|
||||
return;
|
||||
}
|
||||
if (state.orderInfo.status === 30) {
|
||||
// 支付关闭
|
||||
state.payStatus = -1;
|
||||
return;
|
||||
}
|
||||
state.payStatus = 1; // 待支付
|
||||
}
|
||||
// 状态转换:payOrder.status => payStatus
|
||||
function checkPayStatus() {
|
||||
if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
|
||||
// 支付成功
|
||||
state.payStatus = 2;
|
||||
return;
|
||||
}
|
||||
if (state.orderInfo.status === 30) {
|
||||
// 支付关闭
|
||||
state.payStatus = -1;
|
||||
return;
|
||||
}
|
||||
state.payStatus = 1; // 待支付
|
||||
}
|
||||
|
||||
// 切换支付方式
|
||||
function onTapPay(e) {
|
||||
state.payment = e.detail.value;
|
||||
}
|
||||
// 切换支付方式
|
||||
function onTapPay(e) {
|
||||
state.payment = e.detail.value;
|
||||
}
|
||||
|
||||
// 设置支付订单信息
|
||||
async function setOrder(id) {
|
||||
// 获得支付订单信息
|
||||
const { data, code } = await PayOrderApi.getOrder(id);
|
||||
if (code !== 0 || !data) {
|
||||
state.payStatus = -2;
|
||||
return;
|
||||
}
|
||||
state.orderInfo = data;
|
||||
// 获得支付方式
|
||||
await setPayMethods();
|
||||
// 设置支付状态
|
||||
checkPayStatus();
|
||||
}
|
||||
// 设置支付订单信息
|
||||
async function setOrder(id) {
|
||||
// 获得支付订单信息
|
||||
const {
|
||||
data,
|
||||
code
|
||||
} = await PayOrderApi.getOrder(id);
|
||||
if (code !== 0 || !data) {
|
||||
state.payStatus = -2;
|
||||
return;
|
||||
}
|
||||
state.orderInfo = data;
|
||||
// 获得支付方式
|
||||
await setPayMethods();
|
||||
// 设置支付状态
|
||||
checkPayStatus();
|
||||
}
|
||||
|
||||
// 获得支付方式
|
||||
async function setPayMethods() {
|
||||
const { data, code } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId);
|
||||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
state.payMethods = getPayMethods(data);
|
||||
}
|
||||
// 获得支付方式
|
||||
async function setPayMethods() {
|
||||
const {
|
||||
data,
|
||||
code
|
||||
} = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId);
|
||||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
state.payMethods = getPayMethods(data);
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (
|
||||
sheep.$platform.name === 'WechatOfficialAccount' &&
|
||||
sheep.$platform.os === 'ios' &&
|
||||
!sheep.$platform.landingPage.includes('pages/pay/index')
|
||||
) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
// 获得支付订单信息
|
||||
let id = options.id;
|
||||
if (options.orderType) {
|
||||
state.orderType = options.orderType;
|
||||
}
|
||||
setOrder(id);
|
||||
// 刷新钱包的缓存
|
||||
sheep.$store('user').getWallet();
|
||||
});
|
||||
onLoad((options) => {
|
||||
if (
|
||||
sheep.$platform.name === 'WechatOfficialAccount' &&
|
||||
sheep.$platform.os === 'ios' &&
|
||||
!sheep.$platform.landingPage.includes('pages/pay/index')
|
||||
) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
// 获得支付订单信息
|
||||
let id = options.id;
|
||||
state.vip = options.type
|
||||
state.vipid = options.vipid
|
||||
state.cardName = options.cardName
|
||||
if (options.orderType) {
|
||||
state.orderType = options.orderType;
|
||||
}
|
||||
setOrder(id);
|
||||
// 刷新钱包的缓存
|
||||
sheep.$store('user').getWallet();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pay-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
.pay-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
|
||||
.ss-modal-box {
|
||||
// max-height: 1000rpx;
|
||||
.ss-modal-box {
|
||||
// max-height: 1000rpx;
|
||||
|
||||
.modal-header {
|
||||
position: relative;
|
||||
padding: 60rpx 20rpx 40rpx;
|
||||
.modal-header {
|
||||
position: relative;
|
||||
padding: 60rpx 20rpx 40rpx;
|
||||
|
||||
.money-text {
|
||||
color: $red;
|
||||
font-size: 46rpx;
|
||||
font-weight: bold;
|
||||
font-family: OPPOSANS;
|
||||
.money-text {
|
||||
color: $red;
|
||||
font-size: 46rpx;
|
||||
font-weight: bold;
|
||||
font-family: OPPOSANS;
|
||||
|
||||
&::before {
|
||||
content: '¥';
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
&::before {
|
||||
content: '¥';
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.time-text {
|
||||
font-size: 26rpx;
|
||||
color: $gray-b;
|
||||
}
|
||||
.time-text {
|
||||
font-size: 26rpx;
|
||||
color: $gray-b;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
right: 20rpx;
|
||||
font-size: 46rpx;
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
.close-icon {
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
right: 20rpx;
|
||||
font-size: 46rpx;
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
overflow-y: auto;
|
||||
.modal-content {
|
||||
overflow-y: auto;
|
||||
|
||||
.pay-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.pay-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.pay-tip {
|
||||
font-size: 26rpx;
|
||||
color: #bbbbbb;
|
||||
}
|
||||
.pay-tip {
|
||||
font-size: 26rpx;
|
||||
color: #bbbbbb;
|
||||
}
|
||||
|
||||
.pay-item {
|
||||
height: 86rpx;
|
||||
}
|
||||
.disabled-pay-item {
|
||||
.pay-title {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.pay-item {
|
||||
height: 86rpx;
|
||||
}
|
||||
|
||||
.userInfo-money {
|
||||
font-size: 26rpx;
|
||||
color: #bbbbbb;
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
.disabled-pay-item {
|
||||
.pay-title {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
width: 710rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
||||
color: $white;
|
||||
}
|
||||
.disabled-btn {
|
||||
background: #e5e5e5;
|
||||
color: #999999;
|
||||
}
|
||||
.userInfo-money {
|
||||
font-size: 26rpx;
|
||||
color: #bbbbbb;
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.past-due-btn {
|
||||
width: 710rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color: #999;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.save-btn {
|
||||
width: 710rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
||||
color: $white;
|
||||
}
|
||||
|
||||
.disabled-btn {
|
||||
background: #e5e5e5;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.past-due-btn {
|
||||
width: 710rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color: #999;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -5,17 +5,18 @@
|
||||
<view class="card" v-for="(item, index) in reservationList" :key="index">
|
||||
<view class="card-content">
|
||||
<text class="type">预约信息</text>
|
||||
<text class="time">订单日期:{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd') }}</text>
|
||||
<text class="time">订单日期:{{ sheep.$helper.timeFormat(item.creatTime, 'yyyy-mm-dd') }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="address">预约姓名:<text class="title">{{ item.technicianName }}</text></text>
|
||||
<text class="address">预约电话:<text class="title">{{ item.memberphone }}</text></text>
|
||||
<text class="address">预约姓名:<text class="title">{{ item.name }}</text></text>
|
||||
<text class="address">预约电话:<text class="title">{{ item.phone }}</text></text>
|
||||
<text class="address">预约时间:<text
|
||||
class="title">{{ sheep.$helper.timeFormat(item.reAddTime, 'yyyy-mm-dd') }}</text></text>
|
||||
<text class="address">门店名称:<text class="title">{{ item.brandName }}</text> </text>
|
||||
<div class="address-container">
|
||||
class="title">{{ item.days }}</text></text>
|
||||
<text class="address">项目名称:<text class="title">{{ item.projectName }}</text> </text>
|
||||
<text class="address">项目套餐:<text class="title">{{ item.technicianName }}</text> </text>
|
||||
<!-- <div class="address-container">
|
||||
<text class="address">门店地址:<text class="title">{{ item.brandaddress }}</text></text>
|
||||
</div>
|
||||
</div> -->
|
||||
<text class="address">备注留言:<text class="title">{{ item.remark }}</text></text>
|
||||
</view>
|
||||
<view>
|
||||
@ -68,16 +69,17 @@
|
||||
// 定义方法
|
||||
function getList() {
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/reservation/list`,
|
||||
url: `${baseUrl}${apiPath}/h5/reservation/reservationInfo`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: memberId.value,
|
||||
},
|
||||
// params: {
|
||||
// userId: memberId.value,
|
||||
// },
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
reservationList.value = res.data.list;
|
||||
console.log(res,"-------------")
|
||||
reservationList.value = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -32,46 +32,6 @@
|
||||
<image src="@/static/images/dayu.png" class="img"></image>
|
||||
</view>
|
||||
</picker>
|
||||
<!-- 项目选择列表 -->
|
||||
<view class="new-project">
|
||||
<view class="list" @click="onradio(item)" :class="this.techid == item.id ? 'on': ''"
|
||||
v-for="(item, index) in techList" :key="index">
|
||||
<view class="l">
|
||||
<image
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/e940fb45cc53df01980b7069432d5101e104014fbb3cd24862d08c1ffba9df68.png"
|
||||
class='img'></image>
|
||||
</view>
|
||||
<view class="r">
|
||||
<view class="tt">
|
||||
<image class='img img1'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/d0a91de26065e4753357ed32f301d2ed9c8a9b10e789c9cddf5f5a93903af9da.png">
|
||||
</image>
|
||||
<image class='img img2'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/f9e69fd9b1e60481f3ba926d1942d65e34c90916329823a16ce703f6fe36b2e9.png">
|
||||
</image>
|
||||
关于UI视觉设计方案需求评审
|
||||
</view>
|
||||
<view class="tt ttr">
|
||||
<image class='img img1'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/10b4a5f0abb36bb1a4ef71f36ffc867330d34844abd897a59889dc9a61b9c2af.png">
|
||||
</image>
|
||||
<image class='img img2'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/a4a5541795df5e89912762bfb29900d8ab420abbda2753b2d22741e29e0ea150.png">
|
||||
</image>
|
||||
关于UI视觉设计方案需求评审
|
||||
</view>
|
||||
<view class="tt ttr">
|
||||
<image class='img img1'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/f197edf433c7c80703de38cf49f9bbef64192de14ec284950a023d68bcad792a.png">
|
||||
</image>
|
||||
<image class='img img2'
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/ca834c977ae99a35db90b5cef48c729c9ce953840a86847cb926d9752f58c0d7.png">
|
||||
</image>
|
||||
关于UI视觉设计方案需求评审
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title">
|
||||
<image
|
||||
@ -79,7 +39,7 @@
|
||||
class="img"></image>
|
||||
<text class='text'>套餐选择</text>
|
||||
</view>
|
||||
<picker mode="selector" :range="brandNameList" @change="onClinicChange">
|
||||
<picker mode="selector" :range="brandNameList3" @change="onClinicChange3">
|
||||
<view class="clinic-select-value">
|
||||
<text>{{ll3}}</text>
|
||||
<image src="@/static/images/dayu.png" class="img"></image>
|
||||
@ -96,15 +56,9 @@
|
||||
<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
|
||||
<view class="scroll-view-item_H" v-for="(item, index) in dateList" :key="index"
|
||||
@click="selectDate(index)">
|
||||
<view class="date-item" v-if="addDate==item.addDate"
|
||||
style="background-color: rgba(228,241,255);border: 1px solid rgba(3,150,248);">
|
||||
<text class="date" style="color: black;">{{ item.formattedDate }}</text>
|
||||
<text class="weekday" style="color: rgba(82,82,2,83);">{{ item.weekday }}</text>
|
||||
</view>
|
||||
<view class="date-item" v-if="addDate!=item.addDate">
|
||||
|
||||
<text class="date">{{ item.formattedDate }}</text>
|
||||
<text class="weekday">{{ item.weekday }}</text>
|
||||
<view class="date-item" :class="brandId4 == item.id ? 'on':''">
|
||||
<text class="date" style="color: black;">{{ item.days.slice(5) }}</text>
|
||||
<text class="weekday" style="color: rgba(82,82,2,83);">{{ item.week }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -119,23 +73,13 @@
|
||||
</view>
|
||||
|
||||
<view class="date-list">
|
||||
<view class="new-nei" v-for="(item, index) in serviceTime" :key="index">
|
||||
<view class="date-list-new" @click="selecthsstr(index)" :class="hsstr==item.str ? 'on':''">
|
||||
<view class="date-itemstr" v-if="hsstr==item.str">
|
||||
<text class="weekday">{{ item.str }}</text>
|
||||
</view>
|
||||
<view class="new-nei" v-for="(item, index) in brandList4" :key="index">
|
||||
<view class="date-list-new" @click="selecthsstr(index,item.status)"
|
||||
:class="{'on' : brandId5 == item.id,'hui' : item.status == 0}" v-if="brandList3.length>0">
|
||||
<view class="date-itemstr">
|
||||
<view class="weekday">{{ item.timeQuantum }}</view>
|
||||
|
||||
<view v-if="item.ym==='true'" class="new-jk">
|
||||
<view class="date-itemym" v-if="hsstr!=item.str">
|
||||
<text class="weekdayym">约满</text><br />
|
||||
<text class="weekday">{{ item.str }}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.ym==='false'" class="new-jk">
|
||||
<view class="date-itemstr" v-if="hsstr!=item.str">
|
||||
<text class="weekday">{{ item.str }}</text>
|
||||
</view>
|
||||
<view class="weekday">剩余{{item.residueNumber}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -151,43 +95,20 @@
|
||||
|
||||
<view class="yyxx-input">
|
||||
<view class="name">
|
||||
姓名:<input class="int" placeholder="请输入您的名字" placeholder-style="color:rgba(204,204,204)" />
|
||||
姓名:<input class="int" v-model="name" placeholder="请输入您的名字"
|
||||
placeholder-style="color:rgba(204,204,204)" />
|
||||
</view>
|
||||
<view class="phone">
|
||||
电话:<input class="int" placeholder="请输入您的电话" placeholder-style="color:rgba(204,204,204)" />
|
||||
电话:<input class="int" v-model="phone" placeholder="请输入您的电话"
|
||||
placeholder-style="color:rgba(204,204,204)" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer" @click="handleSubmit">
|
||||
<view class="footer" @click="brandlists9">
|
||||
立即预约
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<radio-group>
|
||||
<view class="doctor-list">
|
||||
<!-- {{techList}} -->
|
||||
<view class="doctor-card" v-for="(item, index) in techList" :key="index">
|
||||
<view class="doctor-info">
|
||||
<image class="doctor-avatar" :src="'https://sfyjk.com/api'+item.photo" mode="aspectFill">
|
||||
</image>
|
||||
<text class="doctor-name">{{ item.technicianName }}</text>
|
||||
<text class="doctor-name" style="float: right;margin-right: 20px;">{{item.typeName}}</text>
|
||||
|
||||
<!-- <text class="doctor-specialty" v-if="item.content">介绍: {{item.content.substr(0, 20)}}...</text> -->
|
||||
</view>
|
||||
<radio style="float: right;" :value="item.id" @click="onradio(item)" :checked="index==0">
|
||||
</radio>
|
||||
<div v-if="techid == item.id">
|
||||
<view class="info-title">服务范围</view>
|
||||
<rich-text style="white-space: pre-wrap;" :nodes="item.serviceScope"></rich-text>
|
||||
<view class="info-title">介绍</view>
|
||||
<rich-text style="white-space: pre-wrap;" :nodes="item.content"></rich-text>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</radio-group>
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
|
||||
@ -234,10 +155,15 @@
|
||||
brandList: [], //门店列表数据
|
||||
brandList2: [], //项目列表数据
|
||||
brandList3: [], //套餐列表数据
|
||||
brandNameList: [],//门店列表
|
||||
brandNameList2: [],//项目列表
|
||||
brandNameList3: [],//套餐列表
|
||||
brandId: "",//门店当前选中id
|
||||
brandList4: [], //时段列表数据
|
||||
brandNameList: [], //门店列表
|
||||
brandNameList2: [], //项目列表
|
||||
brandNameList3: [], //套餐列表
|
||||
brandId: "", //门店当前选中id
|
||||
brandId2: "", //项目当前选中id
|
||||
brandId3: "", //套餐当前选中id
|
||||
brandId4: "", //预约日期当前选中id
|
||||
brandId5: "", //时段当前选中id
|
||||
brandName: "",
|
||||
selectedDayIndex: 0,
|
||||
selecttypeIndex: 0,
|
||||
@ -246,46 +172,63 @@
|
||||
ll: '请选择',
|
||||
ll2: '请选择',
|
||||
ll3: '请选择',
|
||||
gg: '请选择'
|
||||
gg: '请选择',
|
||||
dateIndex: '', //时间的状态
|
||||
name: '',
|
||||
phone: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.isLogin = computed(() => sheep.$store('user').isLogin);
|
||||
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
|
||||
this.brandlists();//调用门店列表
|
||||
// this.brandlists2();//调用项目列表
|
||||
// this.brandlists3();//调用套餐列表
|
||||
this.generateDateList();
|
||||
this.addDate = this.dateList[0].addDate;
|
||||
this.gettypeList();
|
||||
console.log(apiPath, baseUrl, "import.meta.env.SHOPRO_API_PATH")
|
||||
this.brandlists(); //调用门店列表
|
||||
|
||||
},
|
||||
methods: {
|
||||
onClinicChange(event) {
|
||||
|
||||
this.brandId = ''
|
||||
this.brandId2 = ''
|
||||
this.brandId3 = ''
|
||||
this.brandId4 = ''
|
||||
this.brandId5 = ''
|
||||
this.name = ''
|
||||
this.phone = ''
|
||||
this.ll2 = '请选择'
|
||||
this.ll3 = '请选择'
|
||||
this.brandNameList2 = []
|
||||
this.brandNameList3 = []
|
||||
this.dateList = []
|
||||
this.brandList3 = []
|
||||
|
||||
const selectedClinicIndex = event.detail.value;
|
||||
this.selectedClinicIndex = selectedClinicIndex;
|
||||
this.ll = this.brandList[selectedClinicIndex].name
|
||||
// console.log("dddddddddddd")
|
||||
// this.ll = this.brandList.list[selectedClinicIndex].name
|
||||
this.brandId = this.brandList[selectedClinicIndex].id
|
||||
this.brandlists2();
|
||||
},
|
||||
onClinicChange2(event) {
|
||||
|
||||
const selectedClinicIndex = event.detail.value;
|
||||
this.selectedClinicIndex2 = selectedClinicIndex;
|
||||
this.ll2 = this.brandList2[selectedClinicIndex].name
|
||||
// this.brandId = this.brandList.list[selectedClinicIndex].id
|
||||
console.log("------onClinicChange2------")
|
||||
// this.ll = this.brandList.list[selectedClinicIndex].name
|
||||
// this.technicianList();
|
||||
this.brandId2 = this.brandList2[selectedClinicIndex].id
|
||||
this.setDate();
|
||||
this.brandlists3();
|
||||
},
|
||||
onClinicChange3(event) {
|
||||
|
||||
|
||||
const selectedClinicIndex = event.detail.value;
|
||||
this.selectedClinicIndex3 = selectedClinicIndex;
|
||||
this.ll3 = this.brandList3[selectedClinicIndex].name
|
||||
this.brandId3 = this.brandList3[selectedClinicIndex].id
|
||||
},
|
||||
ontype(event) {
|
||||
const selecttypeIndex = event.detail.value;
|
||||
this.selecttypeIndex = selecttypeIndex;
|
||||
this.typename = this.typeList[selecttypeIndex].dictValue
|
||||
this.type = this.typeList[selecttypeIndex].value
|
||||
console.log(this.type, "this.type")
|
||||
this.gg = this.typeList[selecttypeIndex].label
|
||||
this.technicianList();
|
||||
},
|
||||
@ -306,6 +249,8 @@
|
||||
},
|
||||
// 查询项目列表
|
||||
brandlists2() {
|
||||
this.brandNameList2 = [];
|
||||
this.brandList2 = [];
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/project/getProject`,
|
||||
method: 'GET',
|
||||
@ -316,231 +261,134 @@
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
// this.brandList2 = res.data
|
||||
console.log(res,"------brandList2------")
|
||||
// for (var i = 0; i < this.brandList2.length; i++) {
|
||||
// this.brandNameList2.push(this.brandList2[i].name)
|
||||
// }
|
||||
this.brandList2 = res.data
|
||||
for (var i = 0; i < this.brandList2.length; i++) {
|
||||
this.brandNameList2.push(this.brandList2[i].name)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询套餐列表
|
||||
brandlists3() {
|
||||
// 查询日期列表
|
||||
setDate() {
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/technician/getTecchnician`,
|
||||
url: `${baseUrl}${apiPath}/h5/projectday/getProjectday`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: this.brandId2
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
this.dateList = res.data;
|
||||
});
|
||||
},
|
||||
// 查询套餐列表
|
||||
brandlists3() {
|
||||
this.brandList3 = []
|
||||
this.brandNameList3 = []
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/technician/getTechnician`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: this.brandId2
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
if(res){
|
||||
|
||||
}
|
||||
console.log(this.brandList3,"------brandList3---------");
|
||||
console.log(res,"------brandList3---------");
|
||||
this.brandList3 = res.data
|
||||
for (var i = 0; i < this.brandList3.length; i++) {
|
||||
this.brandNameList3.push(this.brandList3[i].name)
|
||||
}
|
||||
});
|
||||
},
|
||||
gettypeList() {
|
||||
// 查询预约时段列表
|
||||
brandlists4() {
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/reservation/type`,
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log(res, "typeListtypeList")
|
||||
this.typeList = res.data
|
||||
for (var i = 0; i < this.typeList.length; i++) {
|
||||
this.typenameList.push(this.typeList[i].label);
|
||||
}
|
||||
console.log(this.typenameList)
|
||||
});
|
||||
},
|
||||
// 查询医生列表
|
||||
technicianList() {
|
||||
console.log("有没有进来technicianList");
|
||||
this.techid = null,
|
||||
this.serviceTime = []
|
||||
this.hsstr = ""
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/technician/list`,
|
||||
url: `${baseUrl}${apiPath}/h5/configuration/getConfiguration`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
type: this.type,
|
||||
brandId: this.brandId
|
||||
projectdayId: this.brandId4,
|
||||
technicianId: this.brandId3
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.techList = res.data.list
|
||||
console.log(this.techList)
|
||||
if (this.techList.length > 0) {
|
||||
this.techid = this.techList[0].id
|
||||
var item = {
|
||||
id: this.techid
|
||||
}
|
||||
this.onradio(item);
|
||||
}
|
||||
|
||||
console.log(this.techList)
|
||||
this.brandList4 = res.data
|
||||
});
|
||||
},
|
||||
|
||||
onradio(item) {
|
||||
this.techid = item.id
|
||||
this.serviceTime = []
|
||||
this.hsstr = ""
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/technician/h5xq`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
addDate: this.addDate,
|
||||
id: this.techid
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
var serviceTime = JSON.parse(res.data.serviceTime)
|
||||
console.log(serviceTime, "serviceTimeserviceTimeserviceTime")
|
||||
if (serviceTime) {
|
||||
for (let i = 0; i < serviceTime.length; i++) {
|
||||
console.log(serviceTime[i].end)
|
||||
console.log(serviceTime[i].start)
|
||||
console.log(serviceTime[i].ym)
|
||||
if (serviceTime[i].end && serviceTime[i].start) {
|
||||
this.sjd = {},
|
||||
this.sjd.str = serviceTime[i].start.toString() + "-" + serviceTime[
|
||||
i].end.toString()
|
||||
this.sjd.ym = serviceTime[i].ym
|
||||
this.serviceTime.push(this.sjd)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.serviceTime, "this.serviceTime")
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
selectDay(index) {
|
||||
this.selectedDayIndex = index;
|
||||
},
|
||||
handleSwiperChange(event) {
|
||||
this.selectedDayIndex = event.mp.detail.current;
|
||||
},
|
||||
formatDate(date) {
|
||||
const options = {
|
||||
month: "2-digit",
|
||||
day: "2-digit"
|
||||
};
|
||||
return date.toLocaleDateString("en-US", options);
|
||||
},
|
||||
handleSubmit() {
|
||||
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
|
||||
if (!this.memberId) {
|
||||
if (sheep.$platform.name === 'WechatMiniProgram') {
|
||||
// showAuthModal('wechatMiniLogin')
|
||||
return;
|
||||
}
|
||||
showAuthModal('accountLogin')
|
||||
// 提交表单接口
|
||||
brandlists9() {
|
||||
if (!this.brandId) {
|
||||
sheep.$helper.toast('请选择门店')
|
||||
} else if (!this.brandId2) {
|
||||
sheep.$helper.toast('请选择项目')
|
||||
} else if (!this.brandId3) {
|
||||
sheep.$helper.toast('请选择套餐')
|
||||
} else if (!this.brandId4) {
|
||||
sheep.$helper.toast('请选择预约日期')
|
||||
} else if (!this.brandId5) {
|
||||
sheep.$helper.toast('请选择预约时段')
|
||||
} else if (!this.name) {
|
||||
sheep.$helper.toast('请填写姓名')
|
||||
} else if (!this.phone) {
|
||||
sheep.$helper.toast('请填写电话')
|
||||
} else {
|
||||
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
|
||||
if (!this.brandId) {
|
||||
sheep.$helper.toast('请选择医馆')
|
||||
} else if (!this.techid) {
|
||||
sheep.$helper.toast('请选择技师')
|
||||
} else if (!this.addDate) {
|
||||
sheep.$helper.toast('请选择预约时间')
|
||||
} else if (!this.hsstr) {
|
||||
sheep.$helper.toast('请选择预约时间段')
|
||||
} else if (this.memberId) {
|
||||
request({
|
||||
url: `${baseUrl}/app-api/h5/reservation/add`,
|
||||
method: 'post',
|
||||
params: {
|
||||
type: this.type,
|
||||
brandId: this.brandId,
|
||||
technicianId: this.techid,
|
||||
reAddTime: this.addDate,
|
||||
hsstr: this.hsstr,
|
||||
userId: this.memberId,
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
uni.showModal({
|
||||
title: '预约提示',
|
||||
content: '预约成功!',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/user'
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/user'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
console.log("立即预约");
|
||||
},
|
||||
|
||||
|
||||
generateDateList() {
|
||||
const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
const today = new Date();
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const date = new Date(today);
|
||||
date.setDate(date.getDate() + i);
|
||||
const formattedDate =
|
||||
// `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||
`${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||
const weekday = weekDays[date.getDay()];
|
||||
const addDate =
|
||||
`${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||
this.dateList.push({
|
||||
date,
|
||||
formattedDate,
|
||||
addDate,
|
||||
weekday
|
||||
request({
|
||||
url: `${baseUrl}${apiPath}/h5/reservation/addReservation`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
brandId: this.brandId,
|
||||
projectId: this.brandId2,
|
||||
technicianId: this.brandId3,
|
||||
projectdayId: this.brandId4,
|
||||
timeId: this.brandId5,
|
||||
name: this.name,
|
||||
phone: this.phone
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
sheep.$helper.toast('提交成功');
|
||||
sheep.$router.go('/pages/index/user')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// 删除前五位数字
|
||||
delete(val) {},
|
||||
//查看时段接口
|
||||
selectDate(index) {
|
||||
this.addDate = this.dateList[index].addDate
|
||||
if (this.techid) {
|
||||
var item = {
|
||||
id: this.techid
|
||||
}
|
||||
this.onradio(item);
|
||||
console.log(this.brandList3, "brandList3")
|
||||
if(this.brandId3 == ''){
|
||||
sheep.$helper.toast('请先选择套餐')
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理选中日期的逻辑,例如触发事件、更新状态等
|
||||
console.log('Selected date:', this.addDate);
|
||||
this.dateIndex = index;
|
||||
this.brandId4 = this.dateList[index].id;
|
||||
this.brandlists4();
|
||||
},
|
||||
selecthsstr(index) {
|
||||
console.log(this.serviceTime[index].str)
|
||||
console.log(this.serviceTime[index].ym)
|
||||
if (this.serviceTime[index].ym === "true") {
|
||||
|
||||
} else if (this.serviceTime[index].ym === "false") {
|
||||
this.hsstr = this.serviceTime[index].str
|
||||
selecthsstr(index, status) {
|
||||
if (status == 0) {
|
||||
this.brandId5 = '';
|
||||
console.log('this.brandId5', this.brandId5);
|
||||
sheep.$helper.toast('该时间段已约满')
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理选中日期的逻辑,例如触发事件、更新状态等
|
||||
console.log('this.serviceTimesss:', this.serviceTime[index].ym);
|
||||
},
|
||||
this.brandId5 = this.brandList4[index].id;
|
||||
console.log('this.brandId5', this.brandId5);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -728,21 +576,27 @@
|
||||
border-radius: 6px;
|
||||
|
||||
&.on {
|
||||
background: rgb(0, 149, 248);
|
||||
background: #e4f1ff;
|
||||
|
||||
.date-itemstr {
|
||||
|
||||
// background-color: #ff5541;
|
||||
.weekday {
|
||||
color: white;
|
||||
}
|
||||
.weekday {}
|
||||
}
|
||||
}
|
||||
|
||||
&.hui {
|
||||
user-select: none;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.date-itemstr {
|
||||
|
||||
// background-color: #ff5541;
|
||||
.weekday {}
|
||||
.weekday {
|
||||
color: black;
|
||||
font-size: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.new-jk {
|
||||
@ -776,17 +630,23 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
|
||||
&:hover {
|
||||
// background-color: #ff5541;
|
||||
}
|
||||
|
||||
&.on {
|
||||
background-color: rgba(228, 241, 255);
|
||||
border: 1px solid rgba(3, 150, 248);
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.weekday {
|
||||
margin-top: 5px;
|
||||
font-size: 10px;
|
||||
font-size: 8px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
<image src="" class="img"></image>
|
||||
</view>
|
||||
<view class="c">您与众悦e家商场的第101天</view>
|
||||
<view class="b">开通即享会员权益</view>
|
||||
<view class="b" v-if="!userInfo.activate">开通即享会员权益</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="r">
|
||||
开通会员
|
||||
<view class="r" v-if="!userInfo.activate">
|
||||
<text>立即开通</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="vipLv" v-if="userInfo.activate">当前卡片:{{userInfo.cardName}}</view>
|
||||
</view>
|
||||
<view class="vip-zxq">
|
||||
<image
|
||||
@ -54,10 +54,10 @@
|
||||
|
||||
<view class="vip-kt">
|
||||
<view class="top">
|
||||
<text class="t1" v-if="userInfo.activate == 1">试用会员</text>
|
||||
<text class="t1" v-if="userInfo.activate == 2">开通会员</text>
|
||||
<text class="t2">有效期至</text>
|
||||
<text class="t3">2024-10-24</text>
|
||||
<!-- <text class="t1" v-if="userInfo.activate == 1">试用会员</text> -->
|
||||
<text class="t1" v-if="!userInfo.activate">开通会员</text>
|
||||
<text class="t2" v-if="userInfo.activate">有效期至</text>
|
||||
<text class="t3" v-if="userInfo.activate">{{userInfo.cardExpirationTime}}</text>
|
||||
</view>
|
||||
<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
|
||||
<view id="demo1" @click="vipFun(index,item.name)" class="scroll-view-item_H uni-bg-red" :class="valVip == index ? 'on' : ''" v-for="(item,index) in vipList" :key="index">
|
||||
@ -72,12 +72,12 @@
|
||||
<view class="vip-text">
|
||||
购买即视为同意《<text class="ts">会员用户协议</text>》
|
||||
</view>
|
||||
<view class="vip-btn" @click="beclick()" v-if="userInfo.activate != 1">
|
||||
<view class="vip-btn" @click="beclick()" v-if="!userInfo.activate">
|
||||
立即试用
|
||||
</view>
|
||||
<view class="vip-btn" @click="beclick()" v-else>
|
||||
<!-- <view class="vip-btn" @click="beclick()" v-else>
|
||||
立即开通
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
@ -99,7 +99,7 @@
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const vipList = ref([]);
|
||||
const vipList2 = ref([]);
|
||||
const valVip = ref([]);
|
||||
const valVip = ref(88888);
|
||||
const nameVip = ref([]);
|
||||
// 定义方法
|
||||
function getList() {
|
||||
@ -124,6 +124,7 @@
|
||||
function vipFun(index,name) {
|
||||
valVip.value = index
|
||||
data.cardName = name
|
||||
console.log(index,name,"name")
|
||||
}
|
||||
|
||||
// beclick
|
||||
@ -138,9 +139,14 @@
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log(res,"-----------试用---------------")
|
||||
if(res.code == 200){
|
||||
sheep.$helper.toast('试用开通成功');
|
||||
sheep.$router.go('/pages/index/user')
|
||||
if(res.code == 0){
|
||||
if(data.cardName == "试用"){
|
||||
sheep.$helper.toast('试用开通成功');
|
||||
sheep.$router.go('/pages/index/user')
|
||||
}else{
|
||||
sheep.$router.go('/pages/pay/index', { id: res.data.payOrderId,type:'vip',vipid: res.data.id,cardName: data.cardName })
|
||||
}
|
||||
|
||||
}else{
|
||||
sheep.$helper.toast(res.msg);
|
||||
}
|
||||
@ -178,7 +184,12 @@
|
||||
height: 200px;
|
||||
// background: rgba(57, 55, 54);
|
||||
position: relative;
|
||||
|
||||
.vipLv{
|
||||
position:absolute;
|
||||
bottom: 93px;
|
||||
right: 10%;
|
||||
color: #8a745c;
|
||||
}
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -1,12 +1,26 @@
|
||||
<!-- 我的积分 -->
|
||||
<template>
|
||||
<s-layout class="wallet-wrap" title="我的积分" navbar="inner">
|
||||
<s-layout class="wallet-wrap" title="我的积分" navbar="inner" :bgStyle="{ backgroundColor: '#fff'}">
|
||||
<view class="header-box ss-flex ss-flex-col ss-row-center ss-col-center" :style="[
|
||||
{
|
||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||
paddingTop: Number(statusBarHeight + 88) + 'rpx',
|
||||
},
|
||||
]">
|
||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between" :style="[{top: Number(statusBarHeight + 88) + 'rpx'}]" v-if="state.isShow == 1">
|
||||
<uni-datetime-picker v-model="state.date" type="daterange" @change="onChangeTime" :end="state.today">
|
||||
<button class="ss-reset-button date-btn">
|
||||
<text>{{ dateFilterText }}</text>
|
||||
<text class="cicon-drop-down ss-seldate-icon"></text>
|
||||
</button>
|
||||
</uni-datetime-picker>
|
||||
|
||||
<!-- TODO 芋艿:优化 -->
|
||||
<!-- <view class="total-box">-->
|
||||
<!-- <view class="ss-m-b-10">总收入¥{{ state.pagination.income }}</view>-->
|
||||
<!-- <view>总支出¥{{ -state.pagination.expense }}</view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<view class="header-bg">
|
||||
<view class="bg" />
|
||||
</view>
|
||||
@ -56,20 +70,7 @@
|
||||
<!-- tab -->
|
||||
<!-- <su-sticky :customNavHeight="sys_navBar"> -->
|
||||
<!-- 统计 -->
|
||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between" v-if="state.isShow == 1">
|
||||
<uni-datetime-picker v-model="state.date" type="daterange" @change="onChangeTime" :end="state.today">
|
||||
<button class="ss-reset-button date-btn">
|
||||
<text>{{ dateFilterText }}</text>
|
||||
<text class="cicon-drop-down ss-seldate-icon"></text>
|
||||
</button>
|
||||
</uni-datetime-picker>
|
||||
|
||||
<!-- TODO 芋艿:优化 -->
|
||||
<!-- <view class="total-box">-->
|
||||
<!-- <view class="ss-m-b-10">总收入¥{{ state.pagination.income }}</view>-->
|
||||
<!-- <view>总支出¥{{ -state.pagination.expense }}</view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<!-- <su-tabs :list="tabMaps" @change="onChange" :scrollable="false" :current="state.currentTab"></su-tabs> -->
|
||||
<!-- </su-sticky> -->
|
||||
<!-- icon -->
|
||||
@ -247,9 +248,9 @@
|
||||
}
|
||||
|
||||
.c {
|
||||
font-size: 18px;
|
||||
font-size: 15px;
|
||||
color: rgba(198, 179, 114);
|
||||
width: 50%;
|
||||
width: 40%;
|
||||
font-weight: 700;
|
||||
line-height: 26px;
|
||||
}
|
||||
@ -270,7 +271,7 @@
|
||||
background-size: 750rpx 100%;
|
||||
padding: 0 0 0 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
position:relative;
|
||||
.new-tab {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -282,7 +283,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 45%;
|
||||
padding: 13px 0;
|
||||
padding: 9px 0;
|
||||
background: rgba(247, 247, 247);
|
||||
border-radius: 10px 0 0 0;
|
||||
|
||||
@ -292,8 +293,8 @@
|
||||
|
||||
.img,
|
||||
.img2 {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
@ -314,8 +315,9 @@
|
||||
}
|
||||
|
||||
.tx {
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color:rgba(187,187,187);
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,7 +379,8 @@
|
||||
height: 114rpx;
|
||||
background-color: $bg-page;
|
||||
background: rgb(193, 145, 81);
|
||||
|
||||
position:absolute;
|
||||
left:-20px;
|
||||
.total-box {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
@ -385,13 +388,13 @@
|
||||
}
|
||||
|
||||
.date-btn {
|
||||
background-color: $white;
|
||||
background-color: rgb(254, 242, 219);
|
||||
line-height: 54rpx;
|
||||
border-radius: 27rpx;
|
||||
border-radius:0 27rpx 27rpx 0;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: $dark-6;
|
||||
color: rgba(137,118,76);
|
||||
|
||||
.ss-seldate-icon {
|
||||
font-size: 50rpx;
|
||||
|
@ -69,7 +69,7 @@
|
||||
sheep.$router.go('/pages/user/user_vip/list')
|
||||
">
|
||||
<view class="new-button" v-if="userInfo.activate == 1">正在试用</view>
|
||||
<view class="new-button" v-if="userInfo.activate == 2">开通</view>
|
||||
<view class="new-button" v-if="userInfo.activate == 2">立即查看</view>
|
||||
<view class="new-button" v-if="userInfo.activate == 3">永久</view>
|
||||
<view class="new-button" v-if="userInfo.activate == 0">立即开通</view>
|
||||
<image class="seckill1" mode="aspectFit"
|
||||
|
Loading…
Reference in New Issue
Block a user