优化功能

This commit is contained in:
wangxiaowei
2026-01-25 00:00:14 +08:00
parent cab8d5a1ab
commit fdc80c876f
12 changed files with 160 additions and 128 deletions

View File

@ -14,4 +14,4 @@ VITE_UPLOAD_BASEURL = 'https://76458.com/upload'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://76458.com/'
VITE_UPLOAD_IMAGE_URL = 'https://chaz.oss-cn-shanghai.aliyuncs.com/'

2
env/.env.production vendored
View File

@ -14,4 +14,4 @@ VITE_UPLOAD_BASEURL = 'https://76458.com/upload'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://76458.com/'
VITE_UPLOAD_IMAGE_URL = 'https://chaz.oss-cn-shanghai.aliyuncs.com/'

View File

@ -56,7 +56,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 }
})
}
/**
@ -70,7 +72,9 @@ export interface IResetPasswordParams {
}
export function resetPassword(data: IResetPasswordParams) {
return http.Post('/storeapi/storeLogin/resetPassword', data)
return http.Post('/storeapi/storeLogin/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">
@ -39,7 +39,7 @@
import { router } from '@/utils/tools'
// 读取仓库
const OSS = inject('OSS')
const useStore = useStoreStore()
// 店铺列表

View File

@ -17,7 +17,16 @@
<view class="mx-48rpx flex items-center">
<view class="rounded-4rpx w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx" v-if="isGroupBuy">团购</view>
<view class="rounded-4rpx w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx" v-if="isDirectSale">直营</view>
<view class="w-600rpx line-2 ml-20rpx font-bold text-30rpx text-[#303133] leading-42rpx text-left">{{ bill?.room?.title }}{{ bill?.order?.group?.title || '' }}</view>
<template v-if="isRecharge">
<view class="w-600rpx line-2 ml-20rpx font-bold text-30rpx text-[#303133] leading-42rpx text-center">
门店余额充值
</view>
</template>
<template v-else>
<view class="w-600rpx line-2 ml-20rpx font-bold text-30rpx text-[#303133] leading-42rpx text-left">
{{ bill?.room?.title }}{{ bill?.order?.group?.title || '' }}
</view>
</template>
</view>
</view>
@ -64,6 +73,23 @@
</view>
</view>
<view v-if="isRecharge">
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>充值金额</view>
<view>{{ bill?.order?.recharge_price }}</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>赠送金额</view>
<view>{{ bill?.order?.gift_price }}</view>
</view>
<view class="mt-20rpx">
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
</view>
</view>
<!-- 直营和团购都显示 -->
<view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
@ -71,7 +97,8 @@
<view>{{ bill?.order?.order_amount }}</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="bill.change_type != 9">
<view>优惠券</view>
<view>-{{ bill?.order?.coupon_price }}</view>
</view>
@ -82,6 +109,11 @@
</view>
<view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>用户手机号</view>
<view>{{ bill?.order.mobile }}</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>订单编号</view>
<view>
@ -97,6 +129,12 @@
<view>{{ bill?.order?.pay_way_title }}</view>
</view>
<!-- 充值的支付方式 -->
<view v-if="isRecharge" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>支付方式</view>
<view>{{ bill?.order?.pay_way_title }}</view>
</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>创建时间</view>
<view>{{ bill?.order?.dtime }}</view>
@ -125,6 +163,12 @@
<view>付款时间</view>
<view>{{ bill?.order?.dtime }}</view>
</view>
<!-- 充值 -->
<view v-if="isRecharge" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>付款时间</view>
<view>{{ bill?.order?.pay_time }}</view>
</view>
</view>
</view>
</view>
@ -156,6 +200,11 @@
const isDirectSale = computed(() => {
return bill.value.change_type === 1 || bill.value.change_type === 2
})
// 充值
const isRecharge = computed(() => {
return bill.value.change_type === 9
})
</script>
<style lang="scss">

View File

@ -50,7 +50,12 @@
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="Finance.upCallback" :down="downOption" :up="upOption">
<view class="bg-white rounded-16rpx px-16rpx py-28rpx mb-20rpx" v-for="item in list" :key="item.id" @click="router.navigateTo(`/bundle/finance/detail?id=${item.id}`)">
<view class="flex items-center justify-between">
<view class="line-1 w-480rpx font-bold text-30rpx text-[#303133] leading-42rpx">{{ item?.room?.title }}{{ item?.group?.title || '' }}</view>
<view class="line-1 w-480rpx font-bold text-30rpx text-[#303133] leading-42rpx">
<template v-if="item.change_type == 9">门店余额充值</template>
<template v-else>
{{ item?.room?.title }}{{ item?.group?.title || '' }}
</template>
</view>
<view class="flex items-center">
<view class="text-[#FF5951] font-bold text-30rpx leading-42rpx">
<text v-if="item.change_type == 1 || item.change_type == 2 || item.change_type == 4 || item.change_type == 9"> + </text>
@ -63,7 +68,7 @@
<view class="mt-12rpx">
<view class="flex items-center">
<view class="rounded-4rpx min-w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx" v-if="item.change_type == 1 || item.change_type == 2 ||item.change_type == 4">
<view class="rounded-4rpx min-w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx" v-if="item.change_type == 1 || item.change_type == 2 ||item.change_type == 4 || item.change_type == 9">
<text v-if="item.change_type == 1">预定</text>
<text v-if="item.change_type == 2">续单</text>
<text v-if="item.change_type == 4">核销</text>

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

@ -80,6 +80,8 @@
import {mobile as testMobile} from '@/utils/test'
import { useToast } from 'wot-design-uni'
import { router } from '@/utils/tools'
import { getVerificationCode } from '@/api/user'
import { SMS_ENUM } from '@/enum/sms'
const OSS = inject('OSS')
const toast = useToast()
@ -129,7 +131,7 @@
},
// 发送验证码
handleCountDown: () => {
handleCountDown: async () => {
if (disabled.value) {
toast.show({
iconClass: 'info-circle',
@ -139,6 +141,7 @@
return
}
await getVerificationCode({ scene: SMS_ENUM.BANK, mobile: String(model.mobile) })
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
@ -174,7 +177,7 @@
return
}
router.navigateTo('/pages/login/set-password')
router.navigateTo(`/pages/login/set-password?mobile=${model.mobile}&code=${model.code}`)
},
// 获取手机号

View File

@ -20,37 +20,35 @@
<view class="font-400 text-30rpx text-[#606266] leading-44rpx">密码</view>
<view class="mt-20rpx">
<wd-input
v-model="model.mobile"
v-model="model.password"
type="text"
placeholder="请输入密码"
inputmode="numeric"
no-border
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
custom-input-class="!px-32rpx !h-104rpx"
@input="mobile.handleInputMobile"
/>
</view>
</view>
<view>
<view class="mt-40rpx">
<view class="font-400 text-30rpx text-[#606266] leading-44rpx">再次确认</view>
<view class="mt-20rpx">
<wd-input
v-model="model.mobile"
v-model="model.password_confirm"
type="text"
placeholder="再次确认新的密码"
inputmode="numeric"
no-border
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
custom-input-class="!px-32rpx !h-104rpx"
@input="mobile.handleInputMobile"
/>
</view>
</view>
</wd-form>
</view>
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="mobile.handleToLogin">确定</view>
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" @click="SetPassword.handleToConfirm">确定</view>
<!-- 手机号修改成功 -->
<wd-popup v-model="showEditSuccessPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
@ -62,7 +60,7 @@
</view>
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">密码修改成功</view>
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">请记住你的登录密码</view>
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="mobile.handleToBack">好的</view>
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="router.switchTab('/pages/my/my')">好的</view>
</view>
</wd-popup>
</view>
@ -71,134 +69,92 @@
<script lang="ts" setup>
import {mobile as testMobile} from '@/utils/test'
import { resetPassword } from '@/api/user'
import { useToast } from 'wot-design-uni'
import { useUserStore } from '@/store'
import { router } from '@/utils/tools'
const OSS = inject('OSS')
const toast = useToast()
const disabled = ref<boolean>(true)
/** 页面 **/
let pageType = 'login' // 页面类型 login:登录 edit:修改手机号
const page = ref<{title: string, desc: string}>({title: '其他手机号登录', desc: '请输入你要登录的手机号'})
// 弹窗
const showEditSuccessPopup = ref<boolean>(false) // 显示手机号修改成功弹窗
const userId = ref<number>(0) // 用户ID修改手机号时需要传
/** 验证码倒计时 **/
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
const startCountDown = ref<boolean>(false) // 是否开始倒计时
const countDown = ref<any>(null) // 倒计时组件
/** 表单相关 **/
// 表单相关
const model = reactive<{
mobile: string
code: string
password: string
password_confirm: string
}>({
mobile: '',
code: ''
password: '',
password_confirm: ''
})
/** 结束 **/
/** 服务协议和隐私政策 **/
const agree = ref<boolean>(false)
/** 结束 **/
// 手机和验证码
const mobile = ref<string>('')
const code = ref<string>('')
onLoad((args) => {
// 从个人登录页面进入
if (args.type === 'edit') {
userId.value = Number(args.userId) || 0 // userId仅做测试使用实际请传真实用户ID
page.value.title = '修改手机号'
page.value.desc = '手机号一年内可修改2次'
pageType = 'edit'
}
mobile.value = args.mobile || ''
code.value = args.code || ''
})
const mobile = {
// 验证手机号
handleInputMobile: (e: {value: string}) => {
model.mobile = e.value
disabled.value = !testMobile(model.mobile)
},
// 发送验证码
handleCountDown: () => {
if (disabled.value) {
const SetPassword = {
/**
* 确认密码
*/
handleToConfirm: async () => {
if (!mobile) {
toast.show({
iconClass: 'info-circle',
msg: '手机号码错误请重新输入',
msg: '手机号异常,请重新操作',
direction: 'vertical'
})
return
}
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
// 发送验证码请求
})
},
// 验证码倒计时结束
handleFinishCountDown: () => {
startCountDown.value = false
},
// 登录
handleToLogin: () => {
// TODO 如果是edit的话就是修改手机号
if (pageType === 'login' && !agree.value) {
if (!code) {
toast.show({
iconClass: 'info-circle',
msg: '请同意服务协议和隐私政策',
msg: '验证码异常,请重新操作',
direction: 'vertical'
})
return
}
if (!testMobile(model.mobile)) {
if (!model.password) {
toast.show({
iconClass: 'info-circle',
msg: '手机号码错误请重新输入',
msg: '请输入密码',
direction: 'vertical'
})
return
}
if (!model.code) {
if (model.password !== model.password_confirm) {
toast.show({
iconClass: 'info-circle',
msg: '验证码错误',
msg: '两次输入的密码不一致',
direction: 'vertical'
})
return
}
},
// 获取手机号
handleGetPhoneNumber: (e: object) => {
console.log("🚀 ~ e:", e)
},
await resetPassword({
mobile: mobile.value,
code: code.value,
password: model.password,
password_confirm: model.password_confirm
})
handleAgree: (e: any) => {
console.log('e', e)
},
showEditSuccessPopup.value = true
// 跳转到服务协议页面
handleToService: () => {
disabled.value = !disabled.value
console.log("🚀 ~ disabled:", disabled)
},
// 跳转到隐私政策页面
handleToPrivacy: () => {
},
// 修改手机成功后返回
handleToBack: () => {
uni.navigateBack()
// const userStore = useUserStore()
// await userStore.logout()
// if (!userStore.isLoggedIn) {
// toast.info('退出成功')
// router.redirectTo('/pages/login/login')
// }
}
}
</script>

View File

@ -162,7 +162,19 @@
</view>
</view>
<wd-input v-model="form.people_number" no-border placeholder="推荐人数1-5人" :maxlength="10"
<wd-input v-model="form.people_number" no-border placeholder="推荐人数1-5人"
custom-class="!bg-[#F6F7F8] !rounded-16rpx !px-28rpx !py-20rpx" />
</view>
<!-- 销量设置 -->
<view class="mt-28rpx add-textarea">
<view class="flex items-center justify-between mb-20rpx">
<view class="mr-10rpx text-32rpx text-[#303133] font-bold leading-44rpx">
销量设置
</view>
</view>
<wd-input v-model="form.sold" no-border placeholder="请输入销量"
custom-class="!bg-[#F6F7F8] !rounded-16rpx !px-28rpx !py-20rpx" />
</view>
</view>
@ -422,7 +434,6 @@
</view>
</template>
<script lang="ts" setup>
import { getRoomDetails, getRoomLabelList, handleCreateTag, handleDeleteTag, editRoom } from '@/api/store'
import { updateUserInfo } from '@/api/user'
@ -468,7 +479,8 @@
video: null as any,
other_describe: '',
weight: 0,
people_number: ''
people_number: '',
sold: ''
})
const tags = ref<Array<{ id: number, label_name: string, index: number }>>([])
const roomLabelId = ref<string>('')
@ -500,6 +512,7 @@
form.other_describe = res.details.room.other_describe || ''
form.weight = res.details.room.weight || 0
form.people_number = res.details.room.people_number || ''
form.sold = res.details.room.sold || ''
},
/**
@ -755,7 +768,8 @@
hours: Number(form.hours),
other_describe: form.other_describe,
weight: Number(form.weight),
people_number: form.people_number
people_number: form.people_number,
sold: form.sold
}
uni.showLoading({

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/';