Commit 880faecd authored by sheng du's avatar sheng du
Browse files

接口调试完成

parent 676d4a1e
......@@ -15,4 +15,14 @@ export default {
userAgreement(params : any) {
return http.get('/prod-api/biz/user_agreement', { params });
},
// 文件上传
uploadFile(data: any) {
return http.post('/prod-api/resource/oss/upload', data, {
headers: {
isEncrypt: false
}
});
},
}
\ No newline at end of file
......@@ -61,20 +61,24 @@ export function fetch(url : string, options : ParameterType) {
res.statusCode > 300 ||
Number(res.data.code) !== 200
) {
if (!options.holdTip) {
if (res.data.code == 401) {
uni.showToast({
title: res.data.msg || '服务器异常',
title: '请先登陆',
icon: 'none',
})
hasError = true
}
if (res.data.code == 401) {
userStore.clearUsers()
setTimeout(() => {
uni.navigateTo({
url: '/pages/login/index',
})
}, 800)
}, 1200)
return
} else if (!options.holdTip) {
uni.showToast({
title: res.data.msg || '服务器异常!',
icon: 'none',
})
hasError = true
}
return reject(res.data || {})
}
......
......@@ -44,4 +44,29 @@ export default {
return http.get(`/prod-api/yimei/brand/${params.id}`, { params });
},
// 新增预约记录
appointmentAdd(data : any) {
return http.post('/prod-api/yimei/appointment', data);
},
// 预约记录列表
appointmentList(params : any) {
return http.get('/prod-api/yimei/appointment/list', { params });
},
// 编辑预约记录
appointmentPut(data : any) {
return http.put('/prod-api/yimei/appointment', data);
},
// 订单列表
pageOrder(params : any) {
return http.get('/prod-api/yimei/order/list', { params });
},
// 订单详情
infoOrder(data : any) {
return http.get(`/prod-api/yimei/order/${data.id}`);
},
}
\ No newline at end of file
......@@ -21,5 +21,14 @@ export default {
},
editAddress(data: any) {
return http.put('/prod-api/yimei/customer/editAddress',data);
},
},
customerEdit(data : any) {
return http.put('/prod-api/yimei/customer',data);
},
profileAvatar(data : any) {
return http.post('/prod-api/system/user/profile/avatar', data)
},
}
......@@ -78,16 +78,19 @@
},
})
const emit = defineEmits(['update:value']);
const emit = defineEmits(['update:value', 'change']);
onMounted(() => {
const length = (props.value instanceof Array) ? props.value.length : 0;
if (props.isMultiple && !length) {
emit('update:value', [])
emit('change', [])
// props.value
}
if (props.isAgreement && !props.value) {
emit('update:value', false)
emit('change', false)
}
})
......@@ -101,14 +104,18 @@
oldValue = [...oldValue, item.value]
}
emit('update:value', oldValue)
emit('change', oldValue)
} else {
// console.log(item.value);
emit('update:value', item.value)
emit('change', item.value)
}
}
const changeCheckAgreement = () => {
console.log(!props.value, props.value, props.value.value);
emit('update:value', !props.value)
emit('change', !props.value)
}
</script>
......
......@@ -28,7 +28,7 @@
</view>
<view class="menus">
<view class="list">
<view class="item" v-for="(item, index) in menuList" :key="index">
<view class="item" v-for="(item, index) in menuList" :key="index" @click="navJump(item)">
<!-- <image :src="'../../static/images/' + item.icon" mode="" class="menu-icon"></image> -->
<image v-if="item.icon == 'all'" src="../../static/images/menu-icon10.png" mode=""
......@@ -190,6 +190,7 @@
}
menuList.value = [...mapList, {
name: '全部商品',
id: -1,
icon: 'all'
}]
console.log(menuList.value);
......@@ -197,6 +198,12 @@
// res.rows
}
const navJump = (item : any) => {
uni.setStorageSync('navClassId', item.id)
uni.switchTab({
url: `/pages/shop/index`
})
}
//通知列表
const noticeList = ref<any>([])
const getNoticeList = async () => {
......
......@@ -3,19 +3,25 @@
<view class="flex align-center between">
<view class="search flex align-center">
<image src="../../static/icons/search-gray.png" style="width: 32rpx;height: 32rpx;" mode=""></image>
<input type="text" v-model="keywords" @confirm="search" placeholder="输入关键词搜索商品" />
<input type="text" v-model="keywords" @confirm="search" @input="changeInput" placeholder="输入关键词搜索商品" />
</view>
<text @click="search">搜索</text>
</view>
<template v-if="projectList.length">
<template v-if="isSearch">
<view class="projects">
<view class="projects-item" v-for="(item,index) in projectList" :key="index">
<image :src="'../../static/images/'+item.imgUrl" mode="" class="projects-item_img"></image>
<view class="empty flex center align-center column" v-if="!projectList.length">
<image src="../../static/images/empty.png" class="empty-icon" mode=""></image>
<text>暂无数据</text>
</view>
<view class="projects-item mb-30" v-for="(item,index) in projectList" :key="index"
@click="toProjectDetail(item)">
<image :src="item.imgUrl" mode="" class="projects-item_img"></image>
<view class="projects-item_msgs">
<view class="projects-item_msgs_name">{{item.name}}</view>
<view class="projects-item_msgs_sell">已售{{item.sell}}</view>
<view class="projects-item_msgs_price"><text></text>{{item.price}}</view>
<view class="projects-item_msgs_name">{{item.goodsName}}</view>
<view class="projects-item_msgs_sell">已售{{item.salesQty}}</view>
<view class="projects-item_msgs_price"><text></text>{{item.sellPriceRange}}</view>
</view>
</view>
</view>
......@@ -23,11 +29,12 @@
<template v-else>
<view class="flex between search-text">
<text class="">搜索历史</text>
<image src="../../static/icons/trash.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
<image src="../../static/icons/trash.png" style="width: 36rpx;height: 36rpx;" mode=""
@click="clearHistory"></image>
</view>
<view class="history-list">
<view class="item flex center align-center" v-for="(item,index) in historyList" :key="index"
@click="historySearch(item)">{{item}}
<view class="item flex center align-center history-item" v-for="(item,index) in searchHistory"
:key="index" @click="historySearch(item)">{{item}}
</view>
</view>
</template>
......@@ -36,30 +43,87 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import config from '@/config'
import api from '@/api'
import { ref, getCurrentInstance } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const proxy = getCurrentInstance()?.proxy;
const keywords = ref('')
const isSearch = ref(false)
const projectList = ref<any>([])
const historyList = ref<any>(['改善细纹'])
// const historyList = ref<any>(['改善细纹'])
const historySearch = (item : any) => {
keywords.value = item
search()
}
//获取商品/套餐列表
const getCashierList = async () => {
if (!keywords.value) {
proxy?.$modal.toast('请输入搜索关键词')
return
}
let res = await api.project.cashierList({
// recommendIndex: 1,
queryName: keywords.value
// storeId: nearStore.value.id || ''
})
isSearch.value = true
console.log(res);
addHistory(keywords.value)
projectList.value = []
if (res.length) {
projectList.value = res.map((item : any) => {
let imgUrl = item.goodsLogoAbsUrl.length ? item.goodsLogoAbsUrl[0] : ''
return {
...item,
imgUrl: `${config.imageView}${imgUrl}`,
sellPriceRange: item.sellPriceRange.split('~')[0]
}
})
}
}
const searchHistory = ref<any[]>([])
const addHistory = (val : any) => {
let copy = [...searchHistory.value]
if (copy.includes(val)) {
copy = copy.filter((item : any) => item != val)
}
copy.unshift(val)
searchHistory.value = [...copy]
uni.setStorageSync('searchHistory', copy)
}
const search = () => {
projectList.value = [
{
name: '膨体鼻综合:美植挺垫鼻背+取耳软骨+耳软骨垫鼻',
sell: '2589',
imgUrl: 'goods1.png',
price: '29800.00'
}, {
name: '双效瘦脸:瘦咬肌+消脂肪',
sell: '2589',
imgUrl: 'goods2.png',
price: '29800.00'
}
]
getCashierList()
}
const changeInput = () => {
if (keywords.value == '') {
isSearch.value = false
}
}
const clearHistory = () => {
searchHistory.value = []
uni.setStorageSync('searchHistory', [])
}
const toProjectDetail = (item : any) => {
uni.navigateTo({
url: `/pages/shop/projectDetail?id=${item.goodsId}&goodType=${item.goodType}`
})
}
onLoad(() => {
const historyStorage = uni.getStorageSync('searchHistory')
searchHistory.value = historyStorage || []
})
</script>
<style lang="less" scoped>
......@@ -98,6 +162,7 @@
border-radius: 38rpx;
background: #E5E5E5;
padding: 0 56rpx;
margin-right: 20rpx;
}
}
......
......@@ -11,6 +11,11 @@
<button type="" class="pub-btn plain" @click="cancelLogin">取消登陆</button>
</view>
<view class="flex agreement">
<PubCheckBox :isAgreement="true" v-model:value="agreement">
<view class="agreement-text">我已阅读并同意<text @click="viewProtocol">《韩秀仙颜小程序用户协议》</text></view>
</PubCheckBox>
</view>
</view>
</template>
......@@ -110,6 +115,11 @@
const cancelLogin = () => {
uni.navigateBack()
}
const viewProtocol = () => {
uni.navigateTo({
url:'/pages/user/protocol'
})
}
// const submit = () => {
// if (!username.value) {
......@@ -165,4 +175,19 @@
}
}
.agreement {
width: 690rpx;
padding-top: 28rpx;
}
.agreement-text {
padding-left: 12rpx;
font-size: 28rpx;
color: #333333;
text {
color: #FFB580;
}
}
</style>
\ No newline at end of file
<template>
<view class="pub-page flex">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view class="nav-item flex center align-center" :class="navCurrent == item.value ? 'active' : ''"
@click="changeNavCurrent(item)" v-for="(item, index) in navList" :key='index'>
{{ item.name }}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right">
<view class="project-row-item mt-30" v-for="(item, index) in Array(20)" :key="index">
<!-- {{item}} -->
<image src="../../static/images/goods1.png" mode="" class="project-row-item_img"></image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">膨体鼻综合:美植挺垫鼻背+取耳软骨+耳软骨垫鼻</view>
<view class="project-row-item_info_sell">已售2589</view>
<view class="project-row-item_info_price"><text></text>29800.00</view>
</view>
</view>
<view class="project-row-item" style="background: transparent;"></view>
</scroll-view>
</view>
</view>
<view class="pub-page flex">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view class="nav-item flex center align-center" :class="navCurrent == item.id ? 'active' : ''"
@click="changeNavCurrent(item)" v-for="(item, index) in menuList" :key='index'>
{{ item.name }}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right">
<view class="project-row-item mt-30" v-for="(item, index) in projectList" :key="index"
@click="toProjectDetail(item)">
<!-- {{item}} -->
<image :src="item.imgUrl" mode="" class="project-row-item_img"></image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">{{item.goodsName}}</view>
<view class="project-row-item_info_sell">已售{{item.salesQty}}</view>
<view class="project-row-item_info_price"><text></text>{{item.sellPriceRange}}</view>
<!-- <view class="project-row-item_info_name">{{item.name}}</view> -->
<!-- <view class="project-row-item_info_sell">已售2589</view> -->
<!-- <view class="project-row-item_info_price"><text></text>29800.00</view> -->
</view>
</view>
<view class="project-row-item" style="background: transparent;"></view>
</scroll-view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const navCurrent = ref<any>('');
// 美眼翘鼻 玻尿酸 美体塑形 补水美白 瘦脸除皱 口腔管理 私密护理 纹绣/植发
const navList = ref([{
name: '全部',
value: '',
}, {
name: '美眼翘鼻',
value: '1',
}, {
name: '玻尿酸',
value: '2',
}, {
name: '美体塑形',
value: '3',
}, {
name: '补水美白',
value: '4',
}])
const changeNavCurrent = (item: any) => {
navCurrent.value = item.value
}
import { ref } from 'vue';
import api from '@/api'
import config from '@/config'
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
const navCurrent = ref<any>(-1);
//菜单列表
const menuList = ref<any[]>([])
const getNavList = async () => {
// console.log(api);
menuList.value = []
let res = await api.project.classList()
let mapList : any = [];
if (res.rows?.length) {
// console.log(res.rows);
mapList = res.rows.map((item : any) => {
return {
...item,
icon: `${config.imageView}${item.logoAbsUrl}`
}
})
mapList = mapList.filter((item : any, index : number) => item && index <= 8)
console.log(mapList);
}
menuList.value = [{
name: '全部',
id: -1
}, ...mapList]
getCashierList()
// console.log(menuList.value);
// res.rows
}
const projectList = ref<any[]>([])
//获取商品/套餐列表
const getCashierList = async () => {
let res = await api.project.cashierList({
// recommendIndex: 1,
// storeId: nearStore.value.id || ''
goodsClassId: navCurrent.value == -1 ? '' : navCurrent.value
})
console.log(res);
projectList.value = []
if (res.length) {
projectList.value = res.map((item : any) => {
let imgUrl = item.goodsLogoAbsUrl.length ? item.goodsLogoAbsUrl[0] : ''
return {
...item,
imgUrl: `${config.imageView}${imgUrl}`,
sellPriceRange: item.sellPriceRange.split('~')[0]
}
})
}
}
const toProjectDetail = (item : any) => {
uni.navigateTo({
url: `/pages/shop/projectDetail?id=${item.goodsId}&goodType=${item.goodType}`
})
}
const changeNavCurrent = (item : any) => {
navCurrent.value = item.id
getCashierList()
}
onShow(() => {
const navClassId = uni.getStorageSync('navClassId')
console.log(navClassId);
if (navClassId || navClassId === -1) {
changeNavCurrent({ id: navClassId })
uni.removeStorageSync('navClassId')
}
})
onLoad(() => {
getNavList()
})
</script>
<style lang="less" scoped>
.left {
width: 202rpx;
flex-shrink: 0;
background-color: #f0f0f0;
height: 100vh;
.nav-item {
width: 100%;
height: 94rpx;
color: #333;
font-size: 28rpx;
&.active {
background-color: #fff;
color: #252525;
font-weight: bold;
}
}
}
.scroll-view-left {
width: 100%;
height: 100%;
}
.right {
width: 100%;
height: 100vh;
}
.scroll-view-right {
width: 100%;
height: 100%;
padding: 0 16rpx;
box-sizing: border-box;
// padding-top: 28rpx;
}
.left {
width: 202rpx;
flex-shrink: 0;
background-color: #f0f0f0;
height: 100vh;
.nav-item {
width: 100%;
height: 94rpx;
color: #333;
font-size: 28rpx;
&.active {
background-color: #fff;
color: #252525;
font-weight: bold;
}
}
}
.scroll-view-left {
width: 100%;
height: 100%;
}
.right {
width: 100%;
height: 100vh;
}
.scroll-view-right {
width: 100%;
height: 100%;
padding: 0 16rpx;
box-sizing: border-box;
// padding-top: 28rpx;
}
</style>
\ No newline at end of file
......@@ -2,7 +2,8 @@
<view class="pub-page">
<view class="project">
<view class="project-row-item">
<image :src="skuInfo.skuImg || content.imgUrls[0]" mode="" class="project-row-item_img"></image>
<image v-if="content.imgUrls" :src="skuInfo.skuImg || content.imgUrls[0]" mode=""
class="project-row-item_img"></image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">{{content.name}}</view>
<view class="project-row-item_info_sell">
......@@ -39,10 +40,15 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ref, getCurrentInstance } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app'
import config from '@/config'
import api from '@/api'
import utils from '@/utils'
import { useUserStore } from '@/stores/modules/user'
const proxy = getCurrentInstance()?.proxy;
const userStore = useUserStore()
......@@ -118,10 +124,47 @@
// storeIndex.value = e.detail.value
// }
const confirmSubmit = () => {
uni.navigateTo({
url: "/pages/shop/makeSuccess"
if (!datetimesingle.value) {
proxy?.$modal.toast('请选择到店时间')
return
}
// const storeInfo : any = uni.getStorageSync('store')
const appointmentItemBoList = [
{
goodsId: projectId.value,
skuId: projectGoodType.value == 2 ? '' : goodsSkuId.value,
goodsType: projectGoodType.value
}
]
const datas = {
storeId: storeInfo.value.id,
customerType: '2',
appointmentTime: datetimesingle.value,
customerId: userStore.userInfo.customerVo.id,
customerName: userStore.userInfo.customerVo.name,
customerPhone: userStore.userInfo.customerVo.phoneNumber,
appointmentItemBoList: appointmentItemBoList,
status: '1'
}
console.log(datas);
api.project.appointmentAdd(datas).then((res : any) => {
console.log(res);
if (res.code == 200) {
const appointmentInfo = {
storeInfo: storeInfo.value,
content: content.value,
appointmentTime: datetimesingle.value,
createTime: utils.formatDate()
}
uni.setStorageSync('appointmentInfo', appointmentInfo)
uni.navigateTo({
url: "/pages/shop/makeSuccess"
})
}
})
}
</script>
......
......@@ -3,10 +3,10 @@
<view class="top flex column align-center">
<image src="../../static/images/success.png" style="width: 160rpx; height: 160rpx;" mode=""></image>
<view class="top-title">提交成功!</view>
<view class="top-info">提交时间:2023-11-25 12:12:25</view>
<view class="top-info">提交时间:{{appointmentInfo.createTime}}</view>
<view class="btns-box flex center">
<view class="pub-btn plain info">返回</view>
<view class="pub-btn">预约詳情</view>
<view class="pub-btn plain info" @click="pageBack">返回</view>
<view class="pub-btn" @click="toMyAppointment">预约詳情</view>
</view>
</view>
......@@ -14,25 +14,43 @@
<view class="card-title">预约信息</view>
<view class="card-content">
<view class="label">预约项目:</view>
<view class="content">嗨体2.5补水:保湿补水,改善细纹</view>
<view class="content" v-if="appointmentInfo.content">{{appointmentInfo.content.name}}</view>
</view>
<view class="card-content">
<view class="label">预约门店:</view>
<view class="content">XXXX门店</view>
<view class="content" v-if="appointmentInfo.storeInfo">{{appointmentInfo.storeInfo.name}}</view>
</view>
<view class="card-content">
<view class="label">到店时间:</view>
<view class="content">2024-04-04 10:00</view>
<view class="content">{{appointmentInfo.appointmentTime}}</view>
</view>
<view class="card-content">
<view class="label">提交时间:</view>
<view class="content">2024-04-03 15:00:00</view>
<view class="content">{{appointmentInfo.createTime}}</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
const appointmentInfo = ref<any>({})
onLoad(() => {
let appointmentInfoStorage = uni.getStorageSync('appointmentInfo')
appointmentInfo.value = { ...appointmentInfoStorage }
})
const pageBack = () => {
uni.navigateBack({
delta: 2
})
}
const toMyAppointment = () => {
uni.redirectTo({
url: "/pages/user/appointment"
})
}
</script>
<style lang="less" scoped>
......@@ -125,5 +143,4 @@
}
}
}
</style>
\ No newline at end of file
......@@ -105,6 +105,8 @@
import api from '@/api'
import config from '@/config'
import { onLoad } from '@dcloudio/uni-app'
import { useUserStore } from '@/stores/modules/user'
const userStore = useUserStore()
......@@ -278,6 +280,10 @@
}
const makeOrder = () => {
if(!userStore.access_token){
userStore.updateUsersInfo()
return
}
uni.navigateTo({
......
<template>
<view class="pub-page pd-30-x">
<view class="order-list">
<view class="empty flex center align-center column" v-if="!list.length">
<image src="../../static/images/empty.png" class="empty-icon" mode=""></image>
<text>暂无数据</text>
</view>
<view class="item" v-for="(item,index) in list" :key="index">
<view class="card-head flex between align-center bd-bt">
<text>订单编号:20240508004</text>
<text>订单编号:{{item.id}}</text>
<view class="status" :class="item.status == 1 ?'green-text' : ''">{{formatStatus(item.status)}}
</view>
</view>
<view class="content " :class="item.status == 1 ? 'bd-bt' : ''">
<view class="time">到店时间:2024-04-04 10:00</view>
<view class="info">预约项目:嗨体2.5补水:保湿补水,改善细纹</view>
<view class="info">预约门店:XXX门店</view>
<view class="info">提交时间:2024-04-03 15:00:00</view>
<view class="time">到店时间:{{item.appointmentTime}}</view>
<view class="info" v-if="item.goodsVo">预约项目:{{item.goodsVo.name}}</view>
<view class="info">预约门店:{{storeInfo.name}}</view>
<view class="info">提交时间:{{item.createTime}}</view>
</view>
<view class="bottom flex end align-center" v-if="item.status == 1">
<view class="pub-btn plain">取消预约</view>
<view class="pub-btn plain" @click="cancelData(item)">取消预约</view>
</view>
</view>
</view>
......@@ -22,7 +26,16 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ref, getCurrentInstance } from 'vue';
import api from '@/api'
import { useUserStore } from '@/stores/modules/user'
import { onLoad } from '@dcloudio/uni-app';
const storeInfo = ref<any>({})
const proxy = getCurrentInstance()?.proxy;
const userStore = useUserStore()
const list = ref([{
id: 1,
status: 1
......@@ -56,6 +69,74 @@
return ''
}
}
//
const getAppointmentList = async () => {
list.value = []
let res = await api.project.appointmentList({
customerId: userStore.userInfo.customerVo.id
})
list.value = res.rows.map((item : any) => {
let goodsVo : any;
let skuVo : any;
try {
if (item.appointmentItemVoList[0].goodsType == 1) {
goodsVo = item.appointmentItemVoList[0].appointmentItemGoodsVo[0].goodsVo;
} else {
goodsVo = item.appointmentItemVoList[0].bizGoodsPackageVo;
}
} catch (error) {
goodsVo = {};
}
try {
skuVo = item.appointmentItemVoList[0].appointmentItemGoodsVo[0].skuVo;
skuVo.allSpecName =
skuVo && skuVo.goodsAttribute.length ? skuVo.goodsAttribute.map((item : any) => item.specValue).join('/') : '';
} catch (error) {
skuVo = {};
}
return {
...item,
goodsVo: goodsVo,
skuVo: skuVo
};
});
console.log(list.value);
}
// 删除
const cancelData = (record : any) => {
uni.showModal({
title: '提示',
content: '确认取消预约?',
success: function (res) {
if (res.confirm) {
api.project
.appointmentPut({
...record,
status: 5
})
.then((res : any) => {
proxy?.$modal.toastSuccess(res.msg);
setTimeout(() => {
getAppointmentList();
}, 1000)
// statisStatus();
});
} else if (res.cancel) {
}
}
});
};
onLoad(() => {
storeInfo.value = uni.getStorageSync('store')
console.log(storeInfo.value);
getAppointmentList()
})
</script>
<style lang="less" scoped>
......
......@@ -6,10 +6,11 @@
<view class="custom-back"></view>
<view class="user-box flex align-center">
<view class="avatar center align-center">
<image src="../../static/logo.png" mode="" class="avatar-img"></image>
<image v-if="avatarUrl" :src="avatarUrl" mode="" class="avatar-img"></image>
<image v-else src="../../static/logo.png" mode="" class="avatar-img"></image>
</view>
<view class="user-info flex between align-center">
<template v-if="userInfo">
<template v-if="userInfo && userInfo.id">
<view class="left">
<view class="user-name">{{userInfo.name}}</view>
<view class="integral">
......@@ -20,7 +21,7 @@
</view>
<navigator url="/pages/user/userInfo" hover-class="none">
<view class="right flex align-center" @click="editUserInfo">
<view class="right flex align-center">
<image src="../../static/images/editor.png" mode="" style="width: 26rpx;height: 26rpx;">
</image>
<text>编辑资料</text>
......@@ -36,27 +37,28 @@
</view>
<view class="vip">
<image src="../../static/images/vip.png" mode=""></image>
<view class="vip-name">{{userInfo.gradeName || '普通会员'}}</view>
<!-- <image src="../../static/images/vvip.png" mode=""></image> -->
</view>
<view class="flex between">
<navigator url="/pages/user/order" hover-class="none">
<view class="entrance-item">
<image src="../../static/images/order.png" mode="" style="width: 60rpx;height: 70rpx;"></image>
<view class="entrance-item_text">
<view>我的订单</view>
<view class="english">My order</view>
</view>
<!-- <navigator url="/pages/user/order" hover-class="none"> -->
<view class="entrance-item" @click="navigatorUrl('/pages/user/order')">
<image src="../../static/images/order.png" mode="" style="width: 60rpx;height: 70rpx;"></image>
<view class="entrance-item_text">
<view>我的订单</view>
<view class="english">My order</view>
</view>
</navigator>
<navigator url="/pages/user/appointment" hover-class="none">
<view class="entrance-item">
<image src="../../static/images/pre-book.png" mode="" style="width: 68rpx;height: 68rpx;"></image>
<view class="entrance-item_text">
<view>我的预约</view>
<view class="english">My appointment</view>
</view>
</view>
<!-- </navigator> -->
<!-- <navigator url="/pages/user/appointment" hover-class="none"> -->
<view class="entrance-item" @click="navigatorUrl('/pages/user/appointment')">
<image src="../../static/images/pre-book.png" mode="" style="width: 68rpx;height: 68rpx;"></image>
<view class="entrance-item_text">
<view>我的预约</view>
<view class="english">My appointment</view>
</view>
</navigator>
</view>
<!-- </navigator> -->
</view>
<view class="pub-form">
<navigator url="/pages/user/address" hover-class="none">
......@@ -98,6 +100,7 @@
<script setup lang="ts">
import api from '@/api'
import { ref } from 'vue';
import config from '@/config'
import { onShow } from '@dcloudio/uni-app';
import { useUserStore } from '@/stores/modules/user'
const userStore = useUserStore()
......@@ -105,16 +108,23 @@
const userInfo = ref<any>({})
onShow(() => {
if (!userStore.access_token) {
avatarUrl.value = ''
userInfo.value = {}
} else {
getUserInfo()
}
// userInfo.value = userStore.$state
// console.log(userInfo.value);
getUserInfo()
})
const avatarUrl = ref<any>('')
const getUserInfo = async () => {
userStore.updateUsersInfo().then((res : any) => {
// console.log();
userInfo.value = { ...res.customerVo }
avatarUrl.value = `${config.imageView}${res.avatar}`
console.log(userInfo.value);
})
}
......@@ -124,6 +134,16 @@
url: "/pages/login/index"
})
}
const navigatorUrl = (url : any) => {
if (!userStore.access_token) {
getUserInfo()
} else {
uni.navigateTo({
url: url
})
}
}
const editUserInfo = () => {
uni.navigateTo({
url: '/pages/user/userInfo'
......@@ -239,6 +259,19 @@
width: 100%;
height: 160rpx;
}
.vip-name {
position: absolute;
z-index: 2;
left: 48rpx;
top: 20rpx;
font-size: 40rpx;
font-weight: 700;
line-height: 57.92rpx;
color: rgba(235, 223, 183, 1);
}
}
.entrance-item {
......
<template>
<view class="pub-page pd-30-x">
<view class="order-list">
<view class="item" v-for="(item,index) in list" :key="index" @click="toDetail">
<view class="header flex between align-center" :class="item.status == 1 ? 'active' : ''">
<view class="empty flex center align-center column" v-if="!list.length">
<image src="../../static/images/empty.png" class="empty-icon" mode=""></image>
<text>暂无数据</text>
</view>
<view class="item" v-for="(item,index) in list" :key="index" @click="toDetail(item)">
<view class="header flex between align-center" :class="item.status == 3 ? 'active' : ''">
<text>订单编号:20240508004</text>
<view class="header-right flex align-center end">
<view class="tag" v-if="item.status == 1">有欠费</view>
<view class="status " :class="item.status == 1 ? 'active' : ''">
{{item.status == 1 ? '已付款' :'已完成'}}
<view class="tag" v-if="item.status == 3">有欠费</view>
<view class="status " :class="item.status == 3 ? 'active' : ''">
{{formatStatus(item.status) }}
</view>
</view>
</view>
<view class="goodsInfo">
<view class="project-row-item mt-30" v-for="(goods, index) in item.goodsList" :key="index">
<image src="../../static/images/goods1.png" mode="" class="project-row-item_img"></image>
<view class="project-row-item mt-30" v-for="(goods, index) in item.orderItemVoList" :key="index">
<image v-if="goods.goodsVo && goods.goodsVo.imgOssUrl"
:src="config.imageView+goods.goodsVo.imgOssUrl[0]" mode="" class="project-row-item_img">
</image>
<image v-else src="" mode="" class="project-row-item_img">
</image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">膨体鼻综合:美植挺垫鼻背+取耳软骨+耳软骨垫鼻</view>
<view class="project-row-item_info_sell">已选:500ml</view>
<view class="project-row-item_info_name">{{goods.goodsVo && goods.goodsVo.name}}</view>
<view class="project-row-item_info_sell"
v-if="goods.goodsType == 1 && goods.goodsVo && goods.goodsVo.skuType == 2">
已选:{{ goods.skuName }}</view>
<view class="project-row-item_info_price flex between">
<view class="left"><text></text>29800.00</view><text class="number">X1</text>
<view class="left"><text></text>{{ goods.unitPrice }}</view><text
class="number">X{{ goods.buyTotal }}</text>
</view>
</view>
</view>
</view>
<view class="bottom flex end align-center">
<text>2件商品</text>
<text>{{item.orderItemVoList && item.orderItemVoList.length}}件商品</text>
<view class="total-price flex end align-center">
实付款:<text>59600.00</text>
实付款:<text>{{item.realAmount || 0}}</text>
</view>
</view>
</view>
......@@ -39,19 +51,91 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
const list = ref([{
id: 1,
status: 1,
goodsList: [{}, {}],
}, {
id: 2,
status: 2,
goodsList: [{}],
}])
const toDetail = () => {
import { ref, getCurrentInstance } from 'vue';
import api from '@/api'
import config from '@/config'
import { useUserStore } from '@/stores/modules/user'
import { onLoad } from '@dcloudio/uni-app';
const storeInfo = ref<any>({})
const proxy = getCurrentInstance()?.proxy;
const userStore = useUserStore()
const list = ref([])
const formatStatus = (status : any) => {
switch (parseInt(status)) {
case 1:
return '待付款'
case 4:
return '已付款'
case 3:
return '有欠款'
case 2:
return '已取消'
case 5:
return '已完成'
default:
return ''
}
}
//
const getPageOrder = async () => {
list.value = []
let res = await api.project.pageOrder({
customerId: userStore.userInfo.customerVo.id
})
res.rows.forEach((item : any) => {
item.orderItemVoList.forEach((m : any) => {
if (m.goodsType == 1 && m.goodsVo.skuType == 2) {
const obj = m.goodsVo.skuList.find((k : any) => k.id == m.skuId);
const str : any = [];
obj.goodsAttribute.forEach((m : any) => {
str.push(`${m.specName}:${m.specValue}`);
});
m.skuName = str.join('/');
}
});
// 支付方式
if (item.orderPaymentVoList) {
const paymentMethod : string[] = [];
item.orderPaymentVoList.forEach((m : any) => {
m.realPayAmountList.forEach((k : any) => {
paymentMethod.push(k.paymentName);
});
});
item.paymentMethod = Array.from(new Set(paymentMethod)).join('+');
}
});
list.value = res.rows.map((item : any) => {
return {
...item,
};
});
console.log(list.value);
}
onLoad(() => {
storeInfo.value = uni.getStorageSync('store')
console.log(storeInfo.value);
getPageOrder()
})
// const list = ref([{
// id: 1,
// status: 1,
// goodsList: [{}, {}],
// }, {
// id: 2,
// status: 2,
// goodsList: [{}],
// }])
const toDetail = (item : any) => {
uni.navigateTo({
url: "/pages/user/orderDetail"
url: `/pages/user/orderDetail?id=${item.id}`
})
}
</script>
......
<template>
<view class="pub-page">
<view class="header flex between align-center" :class="orderInfo.status == 1 ? 'active' : ''">
<view class="header flex between align-center" :class="info.status == 3 ? 'active' : ''">
<view class="flex align-center">
<image src="../../static/images/order-status1.png" v-if="orderInfo.status == 1"
<image src="../../static/images/order-status1.png" v-if="info.status == 3"
style="width: 35rpx;height: 28rpx;" mode=""></image>
<image src="../../static/images/order-status2.png" v-else mode="" style="width: 35rpx;height: 35rpx;">
</image>
<view class="status" :class="orderInfo.status == 1 ? 'active' : ''">
{{orderInfo.status == 1 ? '已付款' :'已完成'}}
<view class="status" :class="info.status == 3 ? 'active' : ''">
{{formatStatus(info.status)}}
</view>
</view>
<view class="tag" v-if="orderInfo.status == 1">有欠费</view>
<view class="tag" v-if="info.status == 3">有欠费</view>
</view>
<view class="pd-30-x">
<view class="pub-card pb-30 mt-30">
<view class="pub-card-header bd-bt">商品信息</view>
<view class="goodsInfo">
<view class="project-row-item mt-30" v-for="(goods, index) in Array(2)" :key="index">
<image src="../../static/images/goods1.png" mode="" class="project-row-item_img"></image>
<view class="project-row-item mt-30" v-for="(item, index) in dataSource" :key="index">
<image :src="item.goodImg" v-if="item && item.goodImg" mode="" class="project-row-item_img">
</image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">膨体鼻综合:美植挺垫鼻背+取耳软骨+耳软骨垫鼻</view>
<view class="project-row-item_info_sell">已选:500ml</view>
<view class="project-row-item_info_name">{{item.goodName}}</view>
<view class="project-row-item_info_sell">已选:{{item.skuName}} </view>
<!-- <view class="project-row-item_info_sell">数量:{{item.buyTotal}} </view> -->
<view class="project-row-item_info_price flex between">
<view class="left"><text></text>29800.00</view>
<view class="left">
<text></text>{{item.totalPrice}}
</view>
</view>
</view>
</view>
......@@ -31,41 +35,45 @@
<view class="bottom flex end align-center">
<text>商品合计总额:</text>
<view class="total-price flex end align-center">
<text>59600.00</text>
<text>{{info.goodsAmountTotal}}</text>
</view>
</view>
<view class="bottom flex end align-center">
<text>优惠金额:</text>
<view class="total-price flex end align-center">
<text>0.00</text>
<text>{{info.totalDiscountAmount}}</text>
</view>
</view>
<view class="bottom flex end align-center">
<text>2件商品</text>
<text>{{dataSource.length}}件商品</text>
<view class="total-price flex end align-center">
实付款:<text>39600.00</text>
实付款:<text>{{info.realAmount}}</text>
</view>
</view>
<view class="bottom flex end align-center active-price">
<view class="total-price flex end align-center">
应付欠款:<text>39600.00</text>
应付欠款:<text>{{info.arrearsAmount}}</text>
</view>
</view>
</view>
<view class="pub-card pb-30 mt-30">
<view class="pub-card pb-30 mt-30" v-if="dataSource_a && dataSource_a.length">
<view class="pub-card-header bd-bt">赠品信息</view>
<view class="goodsInfo">
<view class="project-row-item mt-30" v-for="(goods, index) in Array(1)" :key="index">
<image src="../../static/images/goods1.png" mode="" class="project-row-item_img"></image>
<view class="project-row-item mt-30" v-for="(item, index) in dataSource_a" :key="index">
<image :src="item.goodImg" v-if="item && item.goodImg" mode="" class="project-row-item_img">
</image>
<view class="project-row-item_info">
<view class="project-row-item_info_name">膨体鼻综合:美植挺垫鼻背+取耳软骨+耳软骨垫鼻</view>
<view class="project-row-item_info_sell">已选:500ml</view>
<view class="project-row-item_info_name">{{item.goodName}}</view>
<view class="project-row-item_info_sell">已选:{{item.skuName}} </view>
<!-- <view class="project-row-item_info_sell">数量:{{item.buyTotal}} </view> -->
<view class="project-row-item_info_price flex between">
<view class="left"><text></text>29800.00</view><text class="number">X1</text>
<view class="left">
<text></text>{{item.totalPrice}}
</view>
</view>
</view>
</view>
......@@ -77,32 +85,38 @@
<view class="pub-card-content_item">
<text>订单编号</text>
<text>157498789798</text>
<text>{{info.code}}</text>
</view>
<view class="pub-card-content_item">
<text>下单时间</text>
<text>2019-12-16 12:30</text>
<text>{{info.createTime}}</text>
</view>
<view class="pub-card-content_item">
<text>订单备注</text>
<text>文字文字文字文字文字文字文字文</text>
<text>{{info.receivableAmountRemark}}</text>
</view>
</view>
</view>
<view class="pub-card pb-30 mt-30">
<view class="pub-card pb-30 mt-30" v-for="(item,index) in dataSource_payment" :key="index">
<view class="pub-card-header bd-bt">付款信息</view>
<view class="pub-card-content">
<view class="pub-card-content_item">
<text>付款时间</text>
<text>2024年5月14日16:45:31</text>
<text>{{item.createTime}}</text>
</view>
<view class="pub-card-content_item">
<text>付款明细</text>
<text>微信支付:25000.00 \n 银联支付:4600.00</text>
<text v-for="(payItem,payIndex) in item.realPayAmountList " :key="payIndex">
{{payItem.paymentName}}{{payItem.amount}} \n</text>
</view>
<view class="pub-card-content_item">
<text>付款凭证</text>
<image src="../../static/images/bill.png" mode="widthFix"></image>
<template v-for="(imgItem, imgIndex) in item.realPayCertificateOssUrl" :key="imgIndex">
<view class="">
<image :src="`${config.imageView}${imgItem}`" mode="widthFix"></image>
</view>
</template>
</view>
</view>
</view>
......@@ -113,11 +127,100 @@
</template>
<script setup lang="ts">
import api from '@/api'
import config from '@/config'
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
const orderInfo = ref({
id: 1,
status: 1,
})
const formatStatus = (status : any) => {
switch (parseInt(status)) {
case 1:
return '待付款'
case 4:
return '已付款'
case 3:
return '有欠款'
case 2:
return '已取消'
case 5:
return '已完成'
default:
return ''
}
}
const funId = ref('')
const info = ref<any>({})
const dataSource = ref<any>([])
const dataSource_a = ref<any>([])
const dataSource_buckle = ref<any>([])
const dataSource_payment = ref<any>([])
const getInfo = async () => {
const res = await api.project.infoOrder({ id: funId.value });
if (res) {
info.value = res.data;
//优惠金额
const num = info.value.goodsOriginAmountTotal * 1 - info.value.goodsAmountTotal * 1;
info.value.totalDiscountAmount = Math.round(num * 100) / 100;
info.value.orderItemVoList.forEach((m : any) => {
if (m.goodsType == 1 && m.goodsVo.skuType == 2) {
const obj = m.goodsVo.skuList.find((k : any) => k.id == m.skuId);
const str : any = [];
obj.goodsAttribute.forEach((k : any) => {
str.push(`${k.specName}:${k.specValue}`);
});
m.skuName = str.join('/');
}
m.goodImg = `${config.imageView}${m.goodsVo.imgOssUrl[0]}`;
m.goodName = m.goodsVo.name;
m.goodsClassName = m.goodsVo.goodsClassName;
m.serviceTotal = m.orderItemSkuVoList[0].serviceTotal;
m.servedTotal = m.orderItemSkuVoList[0].servedTotal;
m.remainServiceTotal = m.orderItemSkuVoList[0].remainServiceTotal;
if (m.isGift == 0) {
dataSource.value.push(m);
} else {
dataSource_a.value.push(m);
}
});
// 付款信息
dataSource_payment.value = res.data.orderPaymentVoList;
// 划扣信息
dataSource_buckle.value = res.data.serviceRecordVoList;
dataSource_buckle.value.forEach((m : any) => {
const str : any = [];
m.consumablesVoList.forEach((k : any) => {
k.skuName = '';
if (k.skuVo.goodsAttribute.length > 0) {
const spec : any = [];
k.skuVo.goodsAttribute.forEach((n : any) => {
spec.push(`${n.specName}:${n.specValue}`);
});
k.skuName = `(${spec.join('/')})`;
}
str.push(`${k.consumablesVo.name}${k.skuName}X${k.total}`);
});
m.material = str;
// 项目
const project : any = [];
m.goodsVoList.forEach((k : any) => {
project.push(k.goodsVo.name);
});
m.materialProject = project;
});
}
};
onLoad((options : any) => {
const { id } = options
if (id) {
funId.value = id
getInfo()
}
})
</script>
......
......@@ -25,6 +25,9 @@
</script>
<style lang="less" scoped>
.pub-page{
padding-bottom: 120rpx;
}
.title {
padding-top: 46rpx;
line-height: 48rpx;
......
......@@ -15,12 +15,26 @@
</view>
</navigator>
</view>
<view class="pub-btn plain">退出登陆</view>
<view class="pub-btn plain" @click="loginOut()">退出登陆</view>
</view>
</template>
<script setup lang="ts">
import { useUserStore } from '@/stores/modules/user'
const userStore = useUserStore()
const loginOut = () => {
uni.showModal({
title: '提示',
content: '确认退出登陆?',
success: function (res) {
userStore.clearUsers()
uni.switchTab({
url: '/pages/index/index'
})
}
});
}
</script>
<style lang="less" scoped>
......
<template>
<view class="pub-page">
<view class="pub-form">
<view class="pub-form-item" style="margin-top: 18rpx;">
<button class="pub-form-item" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<!-- <view class="pub-form-item" style="margin-top: 18rpx;"> -->
<view class="label">头像</view>
<view class="pub-form-item_right" style="padding: 20rpx 0;">
<image src="../../static/logo.png" style="width: 120rpx;height: 120rpx;" mode=""></image>
<image v-if="avatarUrl" :src="avatarUrl" style="width: 120rpx;height: 120rpx;border-radius: 50%;"
mode=""></image>
<image v-else src="../../static/logo.png" style="width: 120rpx;height: 120rpx;border-radius: 50%;"
mode=""></image>
<image src="../../static/icons/right.png" class="pub-form-item_right_icon" mode=""></image>
</view>
</view>
<!-- </view> -->
</button>
</view>
<view class="pub-form" style="margin-top: 26rpx;">
<view class="pub-form-item bd-bt">
<view class="label">昵称</view>
<view class="pub-form-item_right" style="padding: 20rpx 0;">
<text>Advens</text>
<image src="../../static/icons/right.png" class="pub-form-item_right_icon" mode=""></image>
<!-- <text>{{customerVo.name}}</text> -->
<input type="nickname" v-model="formData.name" @change="confirmName" />
<!-- <image src="../../static/icons/right.png" class="pub-form-item_right_icon" mode=""></image> -->
</view>
</view>
<view class="pub-form-item bd-bt">
<view class="label">手机号</view>
<text class="pub-form-item_right">17784242356</text>
<text class="pub-form-item_right">{{customerVo.phoneNumber}}</text>
</view>
<view class="pub-form-item bd-bt">
<view class="label">塑身内衣尺码</view>
<view class="pub-form-item_right" style="padding: 20rpx 0;">
<text>L</text>
<image src="../../static/icons/right.png" class="pub-form-item_right_icon" mode=""></image>
<!-- <text>L</text> -->
<input v-model="formData.size" @change="changeSize" />
<!-- <image src="../../static/icons/right.png" class="pub-form-item_right_icon" mode=""></image> -->
</view>
</view>
<view class="pub-form-item bd-bt">
<view class="label">会员等级</view>
<text class="pub-form-item_right">普通会员</text>
<text class="pub-form-item_right">{{customerVo.gradeName || '普通会员'}}</text>
</view>
<view class="pub-form-item bd-bt">
<view class="label">性别</view>
<view class="pub-form-item_right flex" style="padding: 20rpx 0;">
<PubCheckBox v-model:value="sex" :options="options.sex">
<PubCheckBox v-model:value="formData.gender" @change="changeUserInfo('gender',formData.gender)" :options="options.sex">
<!-- <template #default="data">
<image v-if="data.value == 1" src="" mode=""></image>
</template> -->
......@@ -48,10 +56,13 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import api from '@/api'
import config from '@/config'
import { reactive, ref, getCurrentInstance } from 'vue';
import { useUserStore } from '@/stores/modules/user'
import { onLoad } from '@dcloudio/uni-app';
const userStore = useUserStore()
const proxy = getCurrentInstance()?.proxy;
onLoad(() => {
// userInfo.value = userStore.$state
......@@ -59,14 +70,71 @@
getUserInfo()
})
const customerVo = ref({})
const customerVo = ref<any>({})
const avatarUrl = ref<any>('')
const formData = reactive({
name: '',
size: '',
gender: '',
})
const getUserInfo = async () => {
userStore.updateUsersInfo().then((res : any) => {
customerVo.value = res.customerVo
avatarUrl.value = `${config.imageView}${res.avatar}`
console.log(customerVo.value);
formData.name = customerVo.value.name || ''
formData.size = customerVo.value.size || ''
formData.gender = customerVo.value.gender || ''
// console.log(customerVo.value);
})
}
const onChooseAvatar = (e : any) => {
console.log(e.detail.avatarUrl);
// const newFormData = new FormData();
// newFormData.append('file', e.detail.avatarUrl);
// api.common.uploadFile({ 'file': e.detail.avatarUrl })
const storeInfo : any = uni.getStorageSync('store')
uni.uploadFile({
url: `${config.baseUrl}/prod-api/system/user/profile/avatar`,
filePath: e.detail.avatarUrl,
name: 'avatarfile',
formData: {
},
header: {
Authorization: userStore.access_token ? 'Bearer ' + userStore.access_token : '',
Clientid: userStore.client_id || '',
Storeid: storeInfo.id
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
let fileInfo;
try {
fileInfo = JSON.parse(uploadFileRes.data)
// changeAvatar('logoOssId', fileInfo.data.ossId)
console.log(fileInfo.data);
if (fileInfo.code == 200) {
proxy?.$modal.toastSuccess('修改成功')
setTimeout(() => {
getUserInfo()
}, 1200)
} else {
proxy?.$modal.toast('上传图片失败')
}
} catch (e) {
proxy?.$modal.toast('上传图片失败')
fileInfo = {}
//TODO handle the exception
}
}
});
}
// const changeAvatar = () => {
// api.user.profileAvatar()
// }
const options = ref({
sex: [{
label: '',
......@@ -76,6 +144,37 @@
value: '2'
}]
})
const confirmName = (e : any) => {
if (e.type == 'change') {
formData.name = e.detail.value
}
changeUserInfo('name', formData.name)
}
const changeSize = (e : any) => {
if (e.type == 'change') {
formData.size = e.detail.value
}
changeUserInfo('size', formData.size)
}
const timer = ref<any>(null)
const changeUserInfo = (key : any, value : any) => {
clearTimeout(timer.value)
timer.value = setTimeout(() => {
let datas : any = {
...customerVo.value
}
datas[key] = value
api.user.customerEdit(datas).then((res : any) => {
// console.log(res);
proxy?.$modal.toastSuccess('修改成功')
setTimeout(() => {
getUserInfo()
}, 1200)
})
}, 500)
}
const sex = ref('1')
</script>
......@@ -93,4 +192,12 @@
}
}
.pub-form-item {
background-color: transparent;
&::after {
display: none;
}
}
</style>
\ No newline at end of file
src/static/images/vip.png

29.5 KB | W: 0px | H: 0px

src/static/images/vip.png

22.1 KB | W: 0px | H: 0px

src/static/images/vip.png
src/static/images/vip.png
src/static/images/vip.png
src/static/images/vip.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment