zyejMAll-mobile/pages/subscribe/subscribe.vue

1053 lines
27 KiB
Vue
Raw Normal View History

2024-09-26 19:21:16 +08:00
<template>
2024-10-21 17:47:58 +08:00
<s-layout color="white" :bgStyle="{ color: '#fff'}" opacityBgUi="" navbarbackgroundColor="transparent">
<view class="new-main">
<view class="top-img">
<image class="img"
src="https://zysc.fjptzykj.com:3000/shangcheng/3148160e2dcb79f1a494ad59229976e31bc9f8e1f13b8da073ad3bcd95a36801.png">
</image>
</view>
<!-- <view class="new-all new-top">
<image class="new-img" :src="brandList.list[selectedClinicIndex].picUrl" mode="aspectFill">
</image>
<view class='new-title'>
<view class='t' v-html="brandList.list[selectedClinicIndex].depict"></view>
<view class='b'>{{ brandList.list[selectedClinicIndex].address }}</view>
</view>
<view class="new-bottom">
<view class="l">
<view class="t">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/0f3417cd9adec5b7fce6ac74a4525a3b44803137decbf83bb1608f8723f423e8.png"
class="img"></image>
莆田市城厢区万达广场对面
</view>
<view class="t">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/3160a894c5c816f62574dd66eed01930eaa5c28126c3170eab0f622c3ab88115.png"
class="img"></image>
每周二至周日
</view>
</view>
<view class="r">
<image class="img"
src="https://zysc.fjptzykj.com:3000/shangcheng/a0661763abe4539e376cc22eaf79a6de1e99a253c37281d3d3944abcd81a7227.png">
</image>
</view>
</view>
</view> -->
<view class="new-all">
<view class="title">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>门店选择</text>
</view>
<picker mode="selector" :range="brandNameList" @change="onClinicChange">
<view class="clinic-select-value">
<text>{{ ll}}</text>
<image src="@/static/images/dayu.png" class="img"></image>
</view>
</picker>
<view class="title">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>项目选择</text>
</view>
<picker mode="selector" :range="brandNameList" @change="onClinicChange">
<view class="clinic-select-value">
<text>{{ ll}}</text>
<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
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>套餐选择</text>
</view>
<picker mode="selector" :range="brandNameList" @change="onClinicChange">
<view class="clinic-select-value">
<text>{{ ll}}</text>
<image src="@/static/images/dayu.png" class="img"></image>
</view>
</picker>
<view class="title">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>预约日期</text>
</view>
<view class="date-list">
<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>
</view>
</scroll-view>
</view>
<view class="title" style="margin-top:10px;">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>预约时段</text>
</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 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>
</view>
</view>
</view>
<view class="title" style="margin-top:10px;">
<image
src="https://zysc.fjptzykj.com:3000/shangcheng/617bb18286a76a4c8bfc377bf69f7436c478252e419f04cdd9a6070dd352d00f.png"
class="img"></image>
<text class='text'>预约信息</text>
</view>
<view class="yyxx-input">
<view class="name">
姓名:<input class="int" placeholder="请输入您的名字" placeholder-style="color:rgba(204,204,204)" />
</view>
<view class="phone">
电话:<input class="int" placeholder="请输入您的电话" placeholder-style="color:rgba(204,204,204)" />
</view>
</view>
</view>
<view class="footer" @click="handleSubmit">
立即预约
</view>
</view>
2024-09-26 19:21:16 +08:00
<view class="container">
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
<!-- <view class="doctor-list">
2024-09-27 18:36:26 +08:00
<view class="doctor-cards">
2024-10-21 17:47:58 +08:00
<image class="doctor-avatars" :src="brandList.list[selectedClinicIndex].picUrl" mode="aspectFill">
</image><br /><br />
2024-09-26 19:21:16 +08:00
<view class="brandr-info">
<text class="doctor-names">
2024-09-27 18:36:26 +08:00
<text class="ygcontent">医馆地址</text>
{{ brandList.list[selectedClinicIndex].address }}</text><br /><br />
2024-10-21 17:47:58 +08:00
<rich-text class="doctor-specialtys"
:nodes="brandList.list[selectedClinicIndex].depict"></rich-text>
2024-09-27 18:36:26 +08:00
</view>
2024-09-26 19:21:16 +08:00
</view>
2024-10-21 17:47:58 +08:00
</view> -->
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
<!-- <view class="clinic-select">
2024-09-26 19:21:16 +08:00
<text class="clinic-select-label">医馆选择</text>
2024-09-27 18:36:26 +08:00
<picker mode="selector" :range="brandNameList" @change="onClinicChange">
2024-09-26 19:21:16 +08:00
<view class="clinic-select-value">
2024-10-14 19:12:22 +08:00
<text>{{ ll}}</text>
2024-09-26 19:21:16 +08:00
</view>
</picker>
</view>
<view class="clinic-select">
<text class="clinic-select-label">预约类型</text>
2024-09-27 18:36:26 +08:00
<picker mode="selector" :range="typenameList" @change="ontype">
2024-09-26 19:21:16 +08:00
<view class="clinic-select-value">
2024-10-14 19:12:22 +08:00
<text>{{ gg }}</text>
2024-09-26 19:21:16 +08:00
</view>
</picker>
2024-10-21 17:47:58 +08:00
</view> -->
2024-09-26 19:21:16 +08:00
<!-- <text class="clinic-select-label">套餐选择</text><br>
<image class="doctor-avatar" src="/static/avatar-doctor.png" mode="aspectFill"></image> -->
<!-- <view class="date-card">
<view class="weekdays">
<text v-for="(day, index) in weekdays" :key="index" :class="['weekday', index === selectedDayIndex ? 'active' : '']"
@click="selectDay(index)">{{ day }}</text>
</view>
<swiper class="date-swiper" :current="selectedDayIndex" @change="handleSwiperChange">
<swiper-item v-for="(date, index) in dateList" :key="index">
<view class="date-item" :class="index === selectedDayIndex ? 'active' : ''">
<text class="date">{{ formatDate(date.date) }}</text>
</view>
</swiper-item>
</swiper>
</view> -->
2024-10-21 17:47:58 +08:00
<!-- <radio-group>
2024-09-26 19:21:16 +08:00
<view class="date-list">
<view v-for="(item, index) in dateList" :key="index" @click="selectDate(index)">
<view class="date-item" v-if="addDate==item.addDate" style="background-color: #ff5541;">
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
<text class="date" style="color: #FFFFFF;">{{ item.formattedDate }}</text>
<text class="weekday" style="color: #FFFFFF;">{{ item.weekday }}</text>
</view>
<view class="date-item" v-if="addDate!=item.addDate">
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
<text class="date">{{ item.formattedDate }}</text>
<text class="weekday">{{ item.weekday }}</text>
</view>
</view>
</view>
2024-10-21 17:47:58 +08:00
</radio-group> -->
2024-09-26 19:21:16 +08:00
<!-- <view @click="showTime = true"><text v-if="goTime" style="color: #000;">{{goTime }}</text><text v-else>请选择返程时间</text></view> -->
<!-- //通过控制showTime来判断组件是否显示 -->
<!-- <pickerTime :startH="8" :lateH="19" :step="32" v-if="showTime" @close="showTime=false" @chooseTime="bindTime"></pickerTime> -->
<radio-group>
<view class="doctor-list">
<!-- {{techList}} -->
<view class="doctor-card" v-for="(item, index) in techList" :key="index">
<view class="doctor-info">
2024-09-27 18:36:26 +08:00
<image class="doctor-avatar" :src="'https://sfyjk.com/api'+item.photo" mode="aspectFill">
</image>
2024-09-26 19:21:16 +08:00
<text class="doctor-name">{{ item.technicianName }}</text>
<text class="doctor-name" style="float: right;margin-right: 20px;">{{item.typeName}}</text>
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
<!-- <text class="doctor-specialty" v-if="item.content">介绍: {{item.content.substr(0, 20)}}...</text> -->
</view>
2024-09-27 18:36:26 +08:00
<radio style="float: right;" :value="item.id" @click="onradio(item)" :checked="index==0">
</radio>
2024-09-26 19:21:16 +08:00
<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>
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
</view>
</radio-group>
2024-10-21 17:47:58 +08:00
<!-- <radio-group>
2024-09-26 19:21:16 +08:00
<view class="date-list">
<view v-for="(item, index) in serviceTime" :key="index" @click="selecthsstr(index)">
<view class="date-itemstr" v-if="hsstr==item.str" style="background-color: #ff5541;">
<text class="weekday">{{ item.str }}</text>
</view>
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
<view v-if="item.ym==='true'">
2024-09-27 18:36:26 +08:00
<view class="date-itemym" v-if="hsstr!=item.str">
<text class="weekdayym">约满</text><br />
<text class="weekday">{{ item.str }}</text>
2024-09-26 19:21:16 +08:00
</view>
</view>
<view v-if="item.ym==='false'">
2024-09-27 18:36:26 +08:00
<view class="date-itemstr" v-if="hsstr!=item.str">
<text class="weekday">{{ item.str }}</text>
2024-09-26 19:21:16 +08:00
</view>
</view>
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
</view>
</view>
2024-10-21 17:47:58 +08:00
</radio-group> -->
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
<!-- <view class="footer">
2024-09-26 19:21:16 +08:00
<button class="appointment-btn" @click="handleSubmit">立即预约</button>
2024-10-21 17:47:58 +08:00
</view> -->
2024-09-26 19:21:16 +08:00
</view>
</s-layout>
</template>
<script>
2024-09-27 18:36:26 +08:00
import request from '@/sheep/request';
import {
baseUrl,
apiPath
} from '@/sheep/config';
import {
computed
} from 'vue';
2024-09-26 19:21:16 +08:00
import sheep from '@/sheep';
2024-09-27 18:36:26 +08:00
import {
showShareModal,
showAuthModal
} from '@/sheep/hooks/useModal';
2024-09-26 19:21:16 +08:00
// import pickerTime from "@/pages/commission/pickerTime.vue"
2024-09-27 18:36:26 +08:00
// 用户信息
2024-09-26 19:21:16 +08:00
export default {
// components: {
// pickerTime
// },
data() {
return {
2024-09-27 18:36:26 +08:00
isLogin: null,
memberId: null,
2024-09-26 19:21:16 +08:00
// showTime: false,
2024-09-27 18:36:26 +08:00
serviceTime: [],
sjd: {},
ym: [],
2024-09-26 19:21:16 +08:00
// starhour: 8,
// starminute: 0,
// endhour: 18,
// endminute: 0,
// timejg: 70,
hsstr: "",
dateList: [],
2024-09-27 18:36:26 +08:00
typeList: [{
dictValue: 0,
dictLabel: "调理预约"
},
{
dictValue: 1,
dictLabel: "教培预约"
}
2024-09-26 19:21:16 +08:00
],
2024-09-27 18:36:26 +08:00
typenameList: [],
2024-09-26 19:21:16 +08:00
addDate: "",
techList: [], // 技师列表
//医馆信息
selectedClinicIndex: 0, // 当前选中的医馆索引
brandList: [{
2024-09-27 18:36:26 +08:00
name: ""
2024-09-26 19:21:16 +08:00
}],
brandNameList: [],
brandId: "",
brandName: "",
selectedDayIndex: 0,
2024-09-27 18:36:26 +08:00
selecttypeIndex: 0,
2024-09-26 19:21:16 +08:00
techid: 0,
type: 0,
2024-10-21 17:47:58 +08:00
ll: '请选择',
gg: '请选择'
2024-09-26 19:21:16 +08:00
};
},
created() {
this.isLogin = computed(() => sheep.$store('user').isLogin);
2024-09-27 18:36:26 +08:00
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
this.brandlists();
2024-09-26 19:21:16 +08:00
this.generateDateList();
2024-09-27 18:36:26 +08:00
this.addDate = this.dateList[0].addDate;
2024-09-26 19:21:16 +08:00
this.gettypeList();
2024-09-27 18:36:26 +08:00
console.log(apiPath, baseUrl, "import.meta.env.SHOPRO_API_PATH")
2024-09-26 19:21:16 +08:00
},
methods: {
onClinicChange(event) {
const selectedClinicIndex = event.detail.value;
this.selectedClinicIndex = selectedClinicIndex;
2024-09-27 18:36:26 +08:00
this.brandName = this.brandList.list[selectedClinicIndex].name
this.brandId = this.brandList.list[selectedClinicIndex].id
console.log("dddddddddddd")
2024-10-14 19:12:22 +08:00
this.ll = this.brandList.list[selectedClinicIndex].name
2024-09-26 19:21:16 +08:00
this.technicianList();
},
2024-09-27 18:36:26 +08:00
ontype(event) {
2024-09-26 19:21:16 +08:00
const selecttypeIndex = event.detail.value;
this.selecttypeIndex = selecttypeIndex;
this.typename = this.typeList[selecttypeIndex].dictValue
2024-10-14 19:12:22 +08:00
this.type = this.typeList[selecttypeIndex].value
2024-10-21 17:47:58 +08:00
console.log(this.type, "this.type")
2024-10-14 19:12:22 +08:00
this.gg = this.typeList[selecttypeIndex].label
2024-09-26 19:21:16 +08:00
this.technicianList();
},
// 查询医馆列表
2024-09-27 18:36:26 +08:00
brandlists() {
request({
url: `${baseUrl}${apiPath}/h5/brand/list`,
method: 'GET',
custom: {
showLoading: false,
},
}).then((res) => {
this.brandList = res.data
2024-10-21 17:47:58 +08:00
console.log(this.brandList, "this.brandList")
2024-09-27 18:36:26 +08:00
for (var i = 0; i < this.brandList.list.length; i++) {
2024-09-26 19:21:16 +08:00
// this.brandList[i].depict=(this.brandList[i].depict).replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
2024-09-27 18:36:26 +08:00
this.brandNameList.push(this.brandList.list[i].name)
}
2024-10-21 17:47:58 +08:00
2024-09-27 18:36:26 +08:00
this.brandId = this.brandList[0].id
this.technicianList();
});
// uni.request({
// url: `${baseUrl}/api/h5/brand/list`,
// success: (res) => {
// this.brandList = res.data
// for (var i = 0; i < this.brandList.length; i++) {
// // this.brandList[i].depict=(this.brandList[i].depict).replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
// this.brandNameList.push(this.brandList[i].name)
// }
// this.brandId = this.brandList[0].id
// this.technicianList();
// },
// fail: (error) => {
// console.log(error)
// }
// })
},
gettypeList() {
request({
url: `${baseUrl}${apiPath}/h5/reservation/type`,
method: 'GET',
custom: {
showLoading: false,
2024-09-26 19:21:16 +08:00
},
2024-09-27 18:36:26 +08:00
}).then((res) => {
2024-10-21 17:47:58 +08:00
console.log(res, "typeListtypeList")
2024-09-27 18:36:26 +08:00
this.typeList = res.data
// this.typeList.depict=this.typeList.depict.replace(/\<img/gi, '<img style="max-width:100%;float:left; height:auto" ')
for (var i = 0; i < this.typeList.length; i++) {
this.typenameList.push(this.typeList[i].label);
2024-09-26 19:21:16 +08:00
}
2024-09-27 18:36:26 +08:00
console.log(this.typenameList)
});
// uni.request({
// url: `${baseUrl}/api/h5/reservation/type`,
// success: (res) => {
// this.typeList = res.data.data
// // this.typeList.depict=this.typeList.depict.replace(/\<img/gi, '<img style="max-width:100%;float:left; height:auto" ')
// for (var i = 0; i < this.typeList.length; i++) {
// this.typenameList.push(this.typeList[i].dictLabel);
// }
// console.log(this.typenameList)
// },
// fail: (error) => {
// console.log(error)
// }
// })
2024-09-26 19:21:16 +08:00
},
// 查询医生列表
technicianList() {
2024-09-27 18:36:26 +08:00
console.log("有没有进来technicianList");
2024-09-26 19:21:16 +08:00
this.techid = null,
2024-10-21 17:47:58 +08:00
this.serviceTime = []
2024-09-27 18:36:26 +08:00
this.hsstr = ""
request({
url: `${baseUrl}${apiPath}/h5/technician/list`,
method: 'GET',
2024-10-21 17:47:58 +08:00
params: {
2024-09-26 19:21:16 +08:00
type: this.type,
// addDate:this.addDate,
2024-09-27 18:36:26 +08:00
brandId: this.brandId
2024-09-26 19:21:16 +08:00
},
2024-09-27 18:36:26 +08:00
custom: {
showLoading: false,
2024-09-26 19:21:16 +08:00
},
2024-09-27 18:36:26 +08:00
}).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);
2024-09-26 19:21:16 +08:00
}
2024-10-21 17:47:58 +08:00
2024-09-27 18:36:26 +08:00
console.log(this.techList)
});
// uni.request({
// // url: 'https://sfyjk.com/api/h5/technician/list',
// url: `${baseUrl}/app-api/h5/technician/list`,
// data: {
// type: this.type,
// // addDate:this.addDate,
// brandId: this.brandId
// },
// success: (res) => {
// console.log(res)
// this.techList = res.data.rows
// 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)
// },
// fail: (error) => {
// console.log(error)
// }
// })
2024-09-26 19:21:16 +08:00
},
onradio(item) {
this.techid = item.id
2024-09-27 18:36:26 +08:00
this.serviceTime = []
this.hsstr = ""
request({
url: `${baseUrl}${apiPath}/h5/technician/h5xq`,
method: 'GET',
2024-10-21 17:47:58 +08:00
params: {
2024-09-27 18:36:26 +08:00
addDate: this.addDate,
id: this.techid
2024-09-26 19:21:16 +08:00
},
2024-09-27 18:36:26 +08:00
custom: {
showLoading: false,
2024-09-26 19:21:16 +08:00
},
2024-09-27 18:36:26 +08:00
}).then((res) => {
console.log(res);
var serviceTime = JSON.parse(res.data.serviceTime)
2024-10-21 17:47:58 +08:00
console.log(serviceTime, "serviceTimeserviceTimeserviceTime")
2024-09-27 18:36:26 +08:00
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)
}
}
2024-09-26 19:21:16 +08:00
}
2024-10-21 17:47:58 +08:00
console.log(this.serviceTime, "this.serviceTime")
2024-09-27 18:36:26 +08:00
});
2024-09-26 19:21:16 +08:00
},
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() {
2024-09-27 18:36:26 +08:00
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
if (!this.memberId) {
if (sheep.$platform.name === 'WechatMiniProgram') {
2024-10-14 19:12:22 +08:00
// showAuthModal('wechatMiniLogin')
2024-09-27 18:36:26 +08:00
return;
}
showAuthModal('accountLogin')
} else {
this.memberId = computed(() => sheep.$store('user').userInfo).value.id
if (!this.brandId) {
2024-09-26 19:21:16 +08:00
sheep.$helper.toast('请选择医馆')
2024-09-27 18:36:26 +08:00
} else if (!this.techid) {
2024-09-26 19:21:16 +08:00
sheep.$helper.toast('请选择技师')
2024-09-27 18:36:26 +08:00
} else if (!this.addDate) {
2024-09-26 19:21:16 +08:00
sheep.$helper.toast('请选择预约时间')
2024-09-27 18:36:26 +08:00
} else if (!this.hsstr) {
2024-09-26 19:21:16 +08:00
sheep.$helper.toast('请选择预约时间段')
2024-09-27 18:36:26 +08:00
} else if (this.memberId) {
request({
2024-10-14 19:12:22 +08:00
url: `${baseUrl}/app-api/h5/reservation/add`,
2024-09-27 18:36:26 +08:00
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'
});
}
2024-09-26 19:21:16 +08:00
}
2024-09-27 18:36:26 +08:00
});
});
2024-10-21 17:47:58 +08:00
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
}
}
2024-09-27 18:36:26 +08:00
console.log("立即预约");
2024-09-26 19:21:16 +08:00
},
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
});
}
},
selectDate(index) {
this.addDate = this.dateList[index].addDate
2024-09-27 18:36:26 +08:00
if (this.techid) {
var item = {
id: this.techid
}
2024-09-26 19:21:16 +08:00
this.onradio(item);
}
2024-09-27 18:36:26 +08:00
2024-09-26 19:21:16 +08:00
// 处理选中日期的逻辑,例如触发事件、更新状态等
console.log('Selected date:', this.addDate);
},
2024-09-27 18:36:26 +08:00
selecthsstr(index) {
console.log(this.serviceTime[index].str)
console.log(this.serviceTime[index].ym)
if (this.serviceTime[index].ym === "true") {
2024-10-21 17:47:58 +08:00
2024-09-27 18:36:26 +08:00
} else if (this.serviceTime[index].ym === "false") {
this.hsstr = this.serviceTime[index].str
}
2024-09-26 19:21:16 +08:00
// 处理选中日期的逻辑,例如触发事件、更新状态等
2024-09-27 18:36:26 +08:00
console.log('this.serviceTimesss:', this.serviceTime[index].ym);
2024-09-26 19:21:16 +08:00
},
},
};
</script>
2024-10-21 17:47:58 +08:00
<style scope lang="scss">
.new-main {
width: 100%;
margin-top: -3rem;
background-color: rgba(237, 249, 254);
.top-img {
.img {
width: 100%;
height: 153px;
}
}
.new-all {
width: 93%;
margin: 15px auto;
background: white;
padding: 10px 0;
border-radius: 9px;
.yyxx-input {
padding: 10px;
&>view {
padding: 15px 0;
display: flex;
align-items: center;
font-size: 16px;
font-weight: 700;
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.name {
border-bottom: 1px solid rgba(229, 229, 229);
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.int {
padding-left: 15px;
}
}
.new-project {
.list {
padding: 10px 20px;
background: rgba(246, 247, 251);
display: flex;
margin: 10px 10px;
border-radius: 5px;
align-items: center;
&.on {
background: rgb(0, 149, 248);
.r {
.tt {
color: white;
.img2 {
display: block;
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.img1 {
display: none;
}
}
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.l {
width: 50px;
height: 50px;
margin-right: 10px;
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.img {
width: 100%;
height: 100%;
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.r {
padding-left: 15px;
position: relative;
&::after {
position: absolute;
content: '';
height: 100%;
width: 1px;
background: #c4c4c4;
top: 50%;
left: 0;
transform: translateY(-50%);
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.tt {
display: flex;
align-items: center;
margin-bottom: 8px;
2024-09-26 19:21:16 +08:00
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.img {
width: 20px;
height: 20px;
margin-right: 10px;
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.img2 {
display: none;
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.ttr {
font-size: 13px;
}
}
}
}
.clinic-select-value {
margin: 10px 10px;
border: 1px solid #efefef;
padding: 10px 20px;
border-radius: 26px;
display: flex;
align-items: center;
justify-content: space-between;
.img {
width: 25px;
height: 25px;
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.title {
display: flex;
align-items: center;
margin: 0 10px;
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.img {
width: 8px;
height: 20px;
margin-right: 10px;
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.text {
font-size: 17px;
font-weight: 700;
}
}
.date-list {
// display: flex;
// flex-wrap: wrap;
// justify-content: center;
margin-top: 10px;
padding: 0 5px;
min-height: 53px;
.scroll-view_H {
white-space: nowrap;
width: 100%;
.scroll-view-item_H {
display: inline-block;
// width: 100%;
// height: 300rpx;
// line-height: 300rpx;
// text-align: center;
// font-size: 36rpx;
}
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.new-nei {
padding: 5px;
width: 30%;
float: left;
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date-list-new {
border: 1px solid #efefef;
text-align: center;
padding: 10px 0;
border-radius: 6px;
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
&.on {
background: rgb(0, 149, 248);
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date-itemstr {
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
// background-color: #ff5541;
.weekday {
color: white;
}
}
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date-itemstr {
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
// background-color: #ff5541;
.weekday {}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.new-jk {
.date-itemym {
.weekdayym {}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.weekday {}
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date-itemstr {
.weekday {}
}
}
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date-item {
border-radius: 8px;
float: left;
margin: 5px;
padding: 5px;
width: 26px;
height: 30px;
border: 1px solid rgba(229, 229, 229);
cursor: pointer;
display: flex;
background-color: white;
flex-direction: column;
align-items: center;
&:hover {
background-color: #ff5541;
}
2024-09-27 18:36:26 +08:00
2024-10-21 17:47:58 +08:00
.date {
font-size: 8px;
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.weekday {
margin-top: 5px;
font-size: 10px;
color: #666;
}
}
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.new-top {
padding: 0 0;
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.new-img {
width: 100%;
height: 150px;
border-radius: 9px 9px 0 0;
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.new-title {
padding: 10px;
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.t {
width: 100%;
font-size: 20px;
color: black;
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.b {
width: 100%;
font-size: 15px;
color: rgba(154, 154, 154);
position: relative;
padding-bottom: 15px;
&::after {
position: absolute;
content: '';
bottom: 0;
height: 1px;
width: 100%;
background: #e8e3e3;
left: 50%;
transform: translateX(-50%);
}
}
}
.new-bottom {
padding: 10px;
padding-top: 0;
display: flex;
justify-content: space-between;
align-items: center;
.l {
.t {
display: flex;
align-items: center;
margin-bottom: 10px;
.img {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.r {
position: relative;
width: 40px;
padding-left: 14px;
&::after {
position: absolute;
content: '';
left: 0;
height: 35px;
width: 1px;
background: #e8e3e3;
top: 50%;
transform: translateY(-50%);
}
2024-09-26 19:21:16 +08:00
2024-10-21 17:47:58 +08:00
.img {
width: 20px;
height: 20px;
display: block;
margin: 0 auto;
}
}
}
}
2024-09-26 19:21:16 +08:00
}
2024-10-21 17:47:58 +08:00
.footer {
padding: 10px 0;
border-radius: 15px;
background: rgb(0, 149, 248);
margin: 0 10px;
text-align: center;
color: white;
2024-09-26 19:21:16 +08:00
}
2024-09-27 18:36:26 +08:00
</style>