.
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<block v-if="modelValue.favorite">
|
<block v-if="modelValue.favorite">
|
||||||
<image
|
<image
|
||||||
class="item-icon"
|
class="item-icon"
|
||||||
:src="sheep.$url.static('/static/img/shop/goods/collect_1.gif')"
|
:src="sheep.$url.static('https://puton.huimeimeta.com/imgs/collect_1.gif')"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view class="item-title">已收藏</view>
|
<view class="item-title">已收藏</view>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<image
|
<image
|
||||||
class="item-icon"
|
class="item-icon"
|
||||||
:src="sheep.$url.static('/static/img/shop/goods/collect_0.png')"
|
:src="sheep.$url.static('https://puton.huimeimeta.com/imgs/collect_0.png')"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view class="item-title">收藏</view>
|
<view class="item-title">收藏</view>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="item-icon"
|
class="item-icon"
|
||||||
:src="sheep.$url.static('/static/img/shop/goods/message.png')"
|
:src="sheep.$url.static('https://puton.huimeimeta.com/imgs/message.png')"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view class="item-title">客服</view>
|
<view class="item-title">客服</view>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="item-icon"
|
class="item-icon"
|
||||||
:src="sheep.$url.static('/static/img/shop/goods/share.png')"
|
:src="sheep.$url.static('https://puton.huimeimeta.com/imgs/share.png')"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view class="item-title">分享</view>
|
<view class="item-title">分享</view>
|
||||||
@@ -119,15 +119,15 @@
|
|||||||
if (props.modelValue.favorite) {
|
if (props.modelValue.favorite) {
|
||||||
const { code } = await FavoriteApi.deleteFavorite(props.modelValue.id);
|
const { code } = await FavoriteApi.deleteFavorite(props.modelValue.id);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
sheep.$helper.toast('取消收藏');
|
sheep.$helper.toast('取消收藏');
|
||||||
props.modelValue.favorite = false;
|
props.modelValue.favorite = false;
|
||||||
// 情况二:添加收藏
|
// 情况二:添加收藏
|
||||||
} else {
|
} else {
|
||||||
const { code } = await FavoriteApi.createFavorite(props.modelValue.id);
|
const { code } = await FavoriteApi.createFavorite(props.modelValue.id);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
sheep.$helper.toast('收藏成功');
|
sheep.$helper.toast('收藏成功');
|
||||||
props.modelValue.favorite = true;
|
props.modelValue.favorite = true;
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
<view style="font-size: 36rpx; margin-right: 12rpx">{{
|
<view style="font-size: 36rpx; margin-right: 12rpx">{{
|
||||||
userInfo?.nickname || nickname
|
userInfo?.nickname || nickname
|
||||||
}}</view>
|
}}</view>
|
||||||
<view style="color: #999999; font-size: 24rpx">检测时间:2024-08-09 15:51</view>
|
<view style="color: #999999; font-size: 24rpx">检测时间:</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex user-info-block">
|
<view class="ss-flex user-info-block">
|
||||||
<view class="user-info-item">女</view>
|
<view class="user-info-item">{{ userFormData.sex }}</view>
|
||||||
<view class="user-info-item">31岁</view>
|
<view class="user-info-item">{{ userFormData.age }}岁</view>
|
||||||
<view class="user-info-item">168cm</view>
|
<view class="user-info-item">{{ userFormData.height }}cm</view>
|
||||||
<view class="user-info-item">50kg</view>
|
<view class="user-info-item">{{ userFormData.weight }}kg</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-box">
|
<view class="right-box">
|
||||||
@@ -59,6 +59,13 @@
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
userFormData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// 是否登录
|
// 是否登录
|
||||||
const isLogin = computed(() => sheep.$store('user').isLogin);
|
const isLogin = computed(() => sheep.$store('user').isLogin);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="tryOn-ctn">
|
<view class="tryOn-ctn">
|
||||||
<view class="title">试戴记录</view>
|
<view class="title">试穿记录</view>
|
||||||
<ul class="record-ul">
|
<ul class="record-ul">
|
||||||
<li
|
<li
|
||||||
class="record-li"
|
class="record-li"
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
:key="item.id"
|
:key="item.id"
|
||||||
@click="sheep.$router.go('/pages/user/tryOnPreview', {})"
|
@click="sheep.$router.go('/pages/user/tryOnPreview', {})"
|
||||||
>
|
>
|
||||||
<!-- <image class="record-img" mode="aspectFill" /> -->
|
<image :src="item.tryOnResultUrl" mode="widthFix" style="width: 100%" />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</view>
|
</view>
|
||||||
@@ -18,7 +18,12 @@
|
|||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
const recordList = ref([]);
|
const props = defineProps({
|
||||||
|
recordList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -48,7 +53,8 @@
|
|||||||
.record-li {
|
.record-li {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
aspect-ratio: 1/1.4;
|
aspect-ratio: 1/1.4;
|
||||||
border: 1rpx solid #000;
|
border: 1px solid #000;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+76
-3
@@ -8,7 +8,8 @@
|
|||||||
:navbarStyle="template.navigationBar"
|
:navbarStyle="template.navigationBar"
|
||||||
onShareAppMessage
|
onShareAppMessage
|
||||||
>
|
>
|
||||||
<userAvatarCard />
|
<userAvatarCard :userFormData="userFormData" />
|
||||||
|
|
||||||
<s-block
|
<s-block
|
||||||
v-for="(item, index) in template.components"
|
v-for="(item, index) in template.components"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -16,7 +17,17 @@
|
|||||||
>
|
>
|
||||||
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
||||||
</s-block>
|
</s-block>
|
||||||
<userTryOn />
|
|
||||||
|
<userTryOn :recordList="dataState.pagination.list" />
|
||||||
|
|
||||||
|
<uni-load-more
|
||||||
|
v-if="dataState.pagination.total > 0"
|
||||||
|
:status="dataState.loadStatus"
|
||||||
|
:content-text="{
|
||||||
|
contentdown: '上拉加载更多',
|
||||||
|
}"
|
||||||
|
@tap="loadMore"
|
||||||
|
/>
|
||||||
|
|
||||||
<view class="logout-box" v-if="isLogin">
|
<view class="logout-box" v-if="isLogin">
|
||||||
<button class="ss-rest-button logout-btn" @click="handleLayout">退出登录</button>
|
<button class="ss-rest-button logout-btn" @click="handleLayout">退出登录</button>
|
||||||
@@ -31,11 +42,19 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, ref } from 'vue';
|
import { computed, reactive, ref } from 'vue';
|
||||||
import { onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
|
import {
|
||||||
|
onShow,
|
||||||
|
onPageScroll,
|
||||||
|
onPullDownRefresh,
|
||||||
|
onReachBottom,
|
||||||
|
onLoad,
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
import _ from 'lodash-es';
|
||||||
import userAvatarCard from './components/user-avatar-card.vue';
|
import userAvatarCard from './components/user-avatar-card.vue';
|
||||||
import userTryOn from './components/user-tryOn.vue';
|
import userTryOn from './components/user-tryOn.vue';
|
||||||
import AuthUtil from '@/sheep/api/member/auth';
|
import AuthUtil from '@/sheep/api/member/auth';
|
||||||
|
import UserApi from '@/sheep/api/member/user';
|
||||||
|
|
||||||
// 隐藏原生tabBar
|
// 隐藏原生tabBar
|
||||||
uni.hideTabBar({
|
uni.hideTabBar({
|
||||||
@@ -47,8 +66,23 @@
|
|||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
sheep.$store('user').updateUserData();
|
sheep.$store('user').updateUserData();
|
||||||
|
|
||||||
|
getInfo();
|
||||||
|
getTryOnList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const userFormData = ref({});
|
||||||
|
async function getInfo() {
|
||||||
|
const { data } = await UserApi.getInfoByUser();
|
||||||
|
try {
|
||||||
|
const { dataJson } = data;
|
||||||
|
userFormData.value = dataJson ? JSON.parse(dataJson) : {};
|
||||||
|
} catch (err) {
|
||||||
|
userFormData.value = {};
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
sheep.$store('user').updateUserData();
|
sheep.$store('user').updateUserData();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
@@ -79,6 +113,45 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const dataState = reactive({
|
||||||
|
pagination: {
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
loadStatus: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getTryOnList() {
|
||||||
|
dataState.loadStatus = 'loading';
|
||||||
|
const { code, data } = await UserApi.getTryOnList({
|
||||||
|
pageNo: dataState.pagination.pageNo,
|
||||||
|
pageSize: dataState.pagination.pageSize,
|
||||||
|
});
|
||||||
|
if (code !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dataState.pagination.list = _.concat(dataState.pagination.list, data.list);
|
||||||
|
dataState.pagination.total = data.total;
|
||||||
|
dataState.loadStatus =
|
||||||
|
dataState.pagination.list.length < dataState.pagination.total ? 'more' : 'noMore';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载更多
|
||||||
|
function loadMore() {
|
||||||
|
if (dataState.loadStatus === 'noMore') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dataState.pagination.pageNo++;
|
||||||
|
getTryOnList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上拉加载更多
|
||||||
|
onReachBottom(() => {
|
||||||
|
loadMore();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -79,7 +79,29 @@ const UserApi = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 获取h5填写的表单信息
|
||||||
|
getInfoByUser: () => {
|
||||||
|
return request({
|
||||||
|
url: '/digital/records/get-by-user-id',
|
||||||
|
method: 'GET',
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
auth: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取试穿记录
|
||||||
|
getTryOnList: (params = {}) => {
|
||||||
|
return request({
|
||||||
|
url: '/digital/on-record/page',
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
auth: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default UserApi;
|
export default UserApi;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 装修用户组件:用户卡片 -->
|
<!-- 装修用户组件:用户卡片 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="ss-user-info-wrap ss-p-t-50" :style="[bgStyle, { marginLeft: `${data.space}px` }]">
|
<view class="ss-user-info-wrap ss-p-t-50" :style="[bgStyle, { marginLeft: `${data.space}px` }]">
|
||||||
<view class="ss-flex ss-col-center ss-row-between ss-m-b-20">
|
<!-- <view class="ss-flex ss-col-center ss-row-between ss-m-b-20">
|
||||||
<view class="left-box ss-flex ss-col-center ss-m-l-36">
|
<view class="left-box ss-flex ss-col-center ss-m-l-36">
|
||||||
<view class="avatar-box ss-m-r-24">
|
<view class="avatar-box ss-m-r-24">
|
||||||
<image
|
<image
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<text class="sicon-qrcode"></text>
|
<text class="sicon-qrcode"></text>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 提示绑定手机号 先隐藏 yudao 需要再修改 -->
|
<!-- 提示绑定手机号 先隐藏 yudao 需要再修改 -->
|
||||||
<view
|
<view
|
||||||
|
|||||||
Reference in New Issue
Block a user