完善茶艺师接口对接

This commit is contained in:
wangxiaowei
2026-01-25 00:00:44 +08:00
parent 6289a502f5
commit 103a591421
14 changed files with 116 additions and 31 deletions

10
env/.env vendored
View File

@ -1,5 +1,5 @@
VITE_APP_TITLE = '茶艺师管理端'
VITE_APP_PORT = 9002
VITE_APP_PORT = 9003
VITE_UNI_APPID = '__UNI__932EB7D'
VITE_WX_APPID = 'wx1a89a1b47d08b83e'
@ -9,16 +9,10 @@ VITE_APP_PUBLIC_BASE=/
# 登录页面
VITE_LOGIN_URL = '/pages/login/login'
# 第一个请求地址
VITE_SERVER_BASEURL = 'https://76458.com'
# h5是否需要配置代理
VITE_APP_PROXY=true
VITE_APP_PROXY_PREFIX = '/storeapi'
# 第二个请求地址 (目前alova中可以使用)
VITE_SERVER_BASEURL = 'https://76458.com'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://76458.com/teamapi/Upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://76458.com/'
# VITE_SERVER_BASEURL = 'https://76458.com'

11
env/.env.development vendored
View File

@ -1,6 +1,17 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_NODE_ENV = 'development'
# 是否去除console 和 debugger
VITE_DELETE_CONSOLE = false
# 是否开启sourcemap
VITE_SHOW_SOURCEMAP = true
# 请求地址
VITE_SERVER_BASEURL = 'https://76458.com'
# 图片上传路径
VITE_UPLOAD_BASEURL = 'https://76458.com/upload'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://76458.com/teamapi/upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://chaz.oss-cn-shanghai.aliyuncs.com/'

13
env/.env.production vendored
View File

@ -1,6 +1,17 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
NODE_ENV = 'production'
VITE_NODE_ENV = 'production'
# 是否去除console 和 debugger
VITE_DELETE_CONSOLE = true
# 是否开启sourcemap
VITE_SHOW_SOURCEMAP = false
# 请求地址
VITE_SERVER_BASEURL = 'https://76458.com'
# 图片上传路径
VITE_UPLOAD_BASEURL = 'https://76458.com/upload'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://76458.com/teamapi/Upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://chaz.oss-cn-shanghai.aliyuncs.com/'

View File

@ -68,7 +68,9 @@ export interface IGetStoreVerificationCodeParams {
}
export function getVerificationCode(data: IGetStoreVerificationCodeParams) {
return http.Post('/storeapi/sms/sendCode', data)
return http.Post('/storeapi/sms/sendCode', data, {
meta: { ignoreAuth: true }
})
}
/**
@ -82,7 +84,9 @@ export interface IResetPasswordParams {
}
export function resetPassword(data: IResetPasswordParams) {
return http.Post('/storeapi/storeLogin/resetPassword', data)
return http.Post('/teamapi/teamLogin/resetPassword', data, {
meta: { ignoreAuth: true }
})
}
/**

View File

@ -14,7 +14,7 @@
class="bg-white rounded-16rpx px-30rpx py-36rpx flex justify-between items-center mb-20rpx"
v-for="(item, index) in useStore.storeList" :key="item.id">
<view class="flex items-center">
<wd-img width="70rpx" height="70rpx" round src="https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/icon/icon_avatar.png" mode="aspectFit" />
<wd-img width="70rpx" height="70rpx" round :src="`${OSS}icon/icon_avatar.png`" mode="aspectFit" />
<view class="w-360rpx line-1 ml-24rpx">{{ item.name }}</view>
</view>
<view class="flex-1 flex justify-end">
@ -36,10 +36,9 @@
<script lang="ts" setup>
import { useStoreStore } from '@/store'
import { switchStore } from '@/api/store'
import { router } from '@/utils/tools'
// 读取仓库
const OSS = inject('OSS')
const useStore = useStoreStore()
// 店铺列表

View File

@ -65,7 +65,7 @@
<view class="bg-white rounded-16rpx mt-20rpx mx-30rpx px-30rpx py-32rpx">
<!-- 头像 -->
<view class="flex justify-between items-center mb-54rpx">
<!-- <view class="flex justify-between items-center mb-54rpx">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">头像</view>
<view class="flex justify-end">
<view class="flex items-center">
@ -83,7 +83,7 @@
<wd-icon name="arrow-right" size="32rpx" color="#C0C4CC" />
</view>
</view>
</view>
</view> -->
<!-- 姓名 -->
<view class="flex justify-between items-center mb-54rpx" @click="showEditNicknamePopup = true">

View File

@ -17,7 +17,7 @@
<view class="mb-22rpx" v-for="item in list" :key="item.id">
<view class="mx-64rpx flex justify-between items-center mb-10rpx">
<view class="flex items-center" @click="UserList.handleToDetail(item?.user?.id)">
<wd-img width="100rpx" height='100rpx' src="https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/icon/icon_avatar.png" :round="true"></wd-img>
<wd-img width="100rpx" height='100rpx' :src="`${OSS}icon/icon_avatar.png`" :round="true"></wd-img>
<view class="ml-20rpx">
<view class="flex items-center">
<view class="font-bold text-28rpx text-[#303133] leading-40rpx mr-12rpx">{{ item?.user?.nickname }}</view>

View File

@ -22,7 +22,7 @@ export function createApp() {
app.use(routeInterceptor)
app.use(requestInterceptor)
app.use(VueQueryPlugin)
app.provide('OSS', 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/')
app.provide('OSS', 'https://chaz.oss-cn-shanghai.aliyuncs.com/fronted/')
app.provide('navbarHeight', getNavBarHeight())
app.provide('capsuleOffset', getCapsuleOffset())

View File

@ -158,7 +158,7 @@
<view class="schedule-content">
<view class="schedule-header-row">
<text class="schedule-type">预约单</text>
<text class="schedule-status">{{ order.status || '待服务' }}</text>
<text class="schedule-status">{{ TeaSpecialistManageStatusTextValue[order.order_status].title }}</text>
</view>
<view class="schedule-location-row">
<text class="schedule-location">{{ order.location || order.store_name }}</text>

View File

@ -42,6 +42,15 @@
<wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleToLogin">立即登录</wd-button>
</view>
<view class="flex items-center mt-64rpx">
<view class="w-32rpx h-32rpx">
<wd-checkbox v-model="agree" checked-color="#4C9F44" size="large"> </wd-checkbox>
</view>
<view class="font-400 text-26rpx leading-40rpx text-[#8F959E] ml-14rpx flex-1" @click="agree = !agree">
我已阅读并同意 <text class="text-[#4C9F44]" @click.stop="Login.handleToService">服务协议</text> <text class="text-[#4C9F44]" @click.stop="Login.handleToPrivacy">隐私政策</text>未注册手机号登录后将自动你为您创建账号
</view>
</view>
<view class="mt-44rpx font-400 text-28rpx text-[#4C9F44] leading-40rpx" @click="router.navigateTo('/pages/login/password')">
忘记密码
</view>
@ -59,16 +68,18 @@
const OSS = inject('OSS')
const toast = useToast()
/** 表单相关 **/
// 服务协议条款
const agree = ref<boolean>(false)
// 表单相关
const model = reactive<{
mobile: string
passowrd: string
}>({
mobile: '', // 18857339563
mobile: '', // 13011223344
passowrd: ''
})
onLoad((args) => {
// 读取缓存的账号密码
const savedMobile = uni.getStorageSync('loginMobile')
@ -80,12 +91,18 @@
if (savedPassword) {
model.passowrd = savedPassword
}
if (savedMobile && savedPassword) {
// 自动登录
agree.value = true
}
})
const Login = {
// 登录
/**
* 登录
*/
handleToLogin: async () => {
// TODO 如果是edit的话就是修改手机号
if (!testMobile(model.mobile)) {
toast.info('请输入正确的账号')
return
@ -96,6 +113,11 @@
return
}
if (!agree.value) {
toast.info('请同意服务协议和隐私政策')
return
}
uni.showLoading({
title: '登录中...'
})
@ -114,12 +136,20 @@
router.reLaunch('/pages/index/index')
}, 1000)
} catch (error) {
toast.info('登录失败,请稍后重试')
uni.hideLoading()
return
}
},
}
// 跳转到服务协议页面
handleToService: () => {
router.navigateTo('/pages/webview/webview?type=service')
},
// 跳转到隐私政策页面
handleToPrivacy: () => {
router.navigateTo('/pages/webview/webview?type=privacy')
},
}
</script>

View File

@ -50,8 +50,8 @@
<view class="form-item mb-24rpx">
<text class="label-text mb-12rpx block text-28rpx text-[#303133] leading-40rpx">出生年月</text>
<view class="date-select rounded-16rpx bg-[#F5F7FA]">
<wd-datetime-picker v-model="formData.both" type="year-month" placeholder="请选择出生年月" :min-date="new Date(1970, 0, 1).getTime()" :max-date="Date.now()"
custom-class="!bg-transparent" @confirm="ProfileEdit.handleDateConfirm">
<wd-datetime-picker v-model="formData.both" type="date" placeholder="请选择出生年月"
custom-class="!bg-transparent" @confirm="ProfileEdit.handleDateConfirm" :minDate="new Date(1970, 0, 1).getTime()" :maxDate="new Date().getTime()">
<wd-input v-model="both" readonly no-border
custom-class="!bg-transparent" custom-input-class="!h-88rpx !px-24rpx !text-28rpx">
<template #suffix>
@ -258,7 +258,7 @@
const d = new Date(value)
const year = d.getFullYear()
const month = d.getMonth() + 1
const day = d.getDay()
const day = d.getDate()
both.value = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
formData.value.both = value / 1000 // 转为秒
},

View File

@ -0,0 +1,35 @@
<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page -->
<route lang="jsonc" type="page">{
"style": {
// 'custom' 表示开启自定义导航栏,默认 'default'
"navigationStyle": "custom"
}
}</route>
<template>
<view class="">
<web-view :src="src"></web-view>
</view>
</template>
<script lang="ts" setup>
const src = ref<string>('')
onLoad((args) => {
switch (args.type) {
case 'service':
// 服务协议
src.value = 'https://76458.com/yhxy.html'
break
case 'privacy':
// 隐私政策
src.value = 'https://76458.com/yszc.html'
break
default:
break
}
// if (options.type) {
// src.value = decodeURIComponent(options.url as string)
// }
})
</script>

View File

@ -11,7 +11,8 @@ import {
} from '@/api/login'
import { toast } from '@/utils/toast'
const defaultAvatar = 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/icon/icon_avatar.png'
const OSS = inject('OSS')
const defaultAvatar = `${OSS}icon/icon_avatar.png`
// 初始化状态
const userInfoState: IUserInfoVo = {

View File

@ -79,4 +79,4 @@ $uni-font-size-paragraph: 15px;
/* chazhi 自定义 */
$cz-page-background: #F6F7F9; // 页面背景色
$cz-theme-color: #4C9F44; // 页面背景色
$OSS: 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/';
$OSS: 'https://chaz.oss-cn-shanghai.aliyuncs.com/fronted/';