|
|
@@ -5,7 +5,7 @@
|
|
|
<view class="login-container">
|
|
|
<view class="login-content">
|
|
|
<text class="login-title">欢迎使用</text>
|
|
|
- <text class="login-subtitle">请先登录以查看您的花店</text>
|
|
|
+ <text class="login-subtitle">登录查看您的花店</text>
|
|
|
<button class="login-btn" @click="pageTo({url:'/pages/login/index?needBack=1'})">立即登录</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -13,47 +13,63 @@
|
|
|
|
|
|
<!-- 已登录状态 -->
|
|
|
<block v-else>
|
|
|
- <view class="main-content" v-if="!$util.isEmpty(list.data)">
|
|
|
+ <view class="main-content">
|
|
|
<!-- 个人中心版块 -->
|
|
|
<view class="profile-section">
|
|
|
- <view class="profile-header" @click="">
|
|
|
+ <view class="profile-header">
|
|
|
<view class="avatar-container">
|
|
|
- <image class="avatar" src="/static/images/default-avatar.png" mode="aspectFill" />
|
|
|
+ <button class="avatar-button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
|
|
+ <image class="avatar" :src="user.smallAvatar" mode="aspectFill" />
|
|
|
+ </button>
|
|
|
</view>
|
|
|
- <view class="user-info">
|
|
|
- <text class="username">刘小明</text>
|
|
|
- <text class="user-id">ID 31548</text>
|
|
|
+ <view class="user-info" @click="goEdit()">
|
|
|
+ <text class="username">{{ user.name }}</text>
|
|
|
+ <text class="user-id">ID {{ user.id }}</text>
|
|
|
</view>
|
|
|
- <view class="arrow-container">
|
|
|
+ <view class="arrow-container" @click="goEdit()">
|
|
|
<text class="arrow-icon">〉</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="function-grid">
|
|
|
- <view class="function-item" @click="">
|
|
|
- <text class="function-icon">📊</text>
|
|
|
- <text class="function-text">统计</text>
|
|
|
- </view>
|
|
|
- <view class="function-item" @click="">
|
|
|
- <text class="function-icon">📍</text>
|
|
|
- <text class="function-text">地址</text>
|
|
|
- </view>
|
|
|
- <view class="function-item message-item" @click="">
|
|
|
- <view class="icon-container">
|
|
|
+ <view class="function-grid">
|
|
|
+ <view class="function-item" @click="">
|
|
|
+ <text class="function-icon">📊</text>
|
|
|
+ <text class="function-text">统计</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item" @click="setAddress">
|
|
|
+ <text class="function-icon">📍</text>
|
|
|
+ <text class="function-text">地址</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item-wrapper">
|
|
|
+ <view class="function-item message-item" @click="">
|
|
|
<text class="function-icon">💬</text>
|
|
|
- <view class="message-dot"></view>
|
|
|
+ <text class="function-text">新消息</text>
|
|
|
</view>
|
|
|
- <text class="function-text">新消息</text>
|
|
|
+ <view class="message-badge">9</view>
|
|
|
</view>
|
|
|
- <view class="function-item" @click="">
|
|
|
- <text class="function-icon">📱</text>
|
|
|
- <text class="function-text">改号码</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view class="function-item" @click="">
|
|
|
+ <text class="function-icon">📱</text>
|
|
|
+ <text class="function-text">改号码</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 生日礼物提示横幅 -->
|
|
|
+ <view class="birthday-banner" @click="goToBirthday" v-if="Number(user.birthdayMonth)==0">
|
|
|
+ <view class="gift-icon-container">
|
|
|
+ <text class="gift-icon">🎁</text>
|
|
|
+ </view>
|
|
|
+ <view class="banner-text">
|
|
|
+ <text class="banner-title">填写生日,有机会领取生日小礼品</text>
|
|
|
+ </view>
|
|
|
+ <view class="banner-button">
|
|
|
+ <text class="button-text">填写</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 花店列表 -->
|
|
|
- <view class="shop-list">
|
|
|
+ <view class="shop-list" v-if="!$util.isEmpty(list.data)">
|
|
|
<view class="shop-card" v-for="(item, index) in list.data" :key="item.id">
|
|
|
<!-- 更多选项按钮 -->
|
|
|
<view class="more-btn" @click.stop="showMoreOptions(index)">
|
|
|
@@ -95,7 +111,7 @@
|
|
|
<view class="balance-item" @click.stop="recharge(item)" v-if="Number(item.balance) < 0">
|
|
|
<text class="balance-label">待结金额</text>
|
|
|
<text class="balance-amount negative">¥{{parseFloat(Math.abs(item.balance))}}</text>
|
|
|
- <text class="balance-action">去结账</text>
|
|
|
+ <text class="balance-action-2">去结账</text>
|
|
|
</view>
|
|
|
<view class="balance-item" @click.stop="recharge(item)" v-if="item.balance > 0">
|
|
|
<text class="balance-label">可用余额</text>
|
|
|
@@ -134,14 +150,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view v-else class="empty-state">
|
|
|
+ <text class="empty-icon">🏪</text>
|
|
|
+ <text class="empty-title">暂无花店</text>
|
|
|
+ <text class="empty-subtitle">您还没有关联花店</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
-
|
|
|
- <!-- 空状态 -->
|
|
|
- <view v-else class="empty-state">
|
|
|
- <text class="empty-icon">🏪</text>
|
|
|
- <text class="empty-title">暂无花店</text>
|
|
|
- <text class="empty-subtitle">您还没有关联任何花店</text>
|
|
|
- </view>
|
|
|
+
|
|
|
</block>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -154,8 +171,9 @@ import { getList } from "@/api/hd";
|
|
|
import { share } from "@/mixins";
|
|
|
import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
import { mapGetters } from 'vuex'
|
|
|
-import { clearLogin } from "@/api/user";
|
|
|
+import { currentInfo } from "@/api/user";
|
|
|
import { list } from "@/mixins";
|
|
|
+import { APIHOST } from '@/config'
|
|
|
export default {
|
|
|
name: "recent",
|
|
|
components: { AppAvatarModule, AppSwiper, TuiListView, TuiListCell, AppActivilyCoupon },
|
|
|
@@ -165,7 +183,8 @@ export default {
|
|
|
//0没有登录 1有登录
|
|
|
loginStyle :0,
|
|
|
activePopupIndex: -1,
|
|
|
- pageAction:{refresh:0}
|
|
|
+ pageAction:{refresh:0},
|
|
|
+ user:{name:'',smallAvatar:'',id:0}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -186,13 +205,10 @@ export default {
|
|
|
}else{
|
|
|
this.loginStyle = 0
|
|
|
}
|
|
|
-
|
|
|
if(this.pageAction.refresh == 1){
|
|
|
- this.resetList()
|
|
|
- this.getMyHdList()
|
|
|
+ this.init()
|
|
|
this.pageAction.refresh == 0
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.resetList()
|
|
|
@@ -220,25 +236,6 @@ export default {
|
|
|
uni.stopPullDownRefresh()
|
|
|
}
|
|
|
},
|
|
|
- logout(){
|
|
|
- let that = this
|
|
|
- that.$util.confirmModal({content:'确认退出?'},() => {
|
|
|
- // #ifdef APP-PLUS
|
|
|
- uni.clearStorage()
|
|
|
- that.$store.commit("setLoginInfo", {})
|
|
|
- plus.runtime.restart()
|
|
|
- // #endif
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- clearLogin().then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- uni.clearStorage()
|
|
|
- that.$store.commit("setLoginInfo", {})
|
|
|
- uni.reLaunch({url:'/pages/home/recent'})
|
|
|
- }
|
|
|
- })
|
|
|
- // #endif
|
|
|
- })
|
|
|
- },
|
|
|
getSettleList(item){
|
|
|
this.pageTo({ url:'/pages/settle/list?id='+item.id+'&account='+item.shopId})
|
|
|
},
|
|
|
@@ -261,9 +258,20 @@ export default {
|
|
|
this.pageTo({ url:'/pages/home/mall?id='+item.id+'&account='+item.shopId})
|
|
|
//this.pageTo({ url:'/pages/goods/picGoods?id='+item.id+'&account='+item.shopId})
|
|
|
},
|
|
|
+ setAddress(){
|
|
|
+ this.pageTo({ url:'/pages/user/address'})
|
|
|
+ },
|
|
|
init () {
|
|
|
+ this.getLoginInfo()
|
|
|
this.getMyHdList()
|
|
|
},
|
|
|
+ getLoginInfo(){
|
|
|
+ currentInfo().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.user = res.data.info?res.data.info:[]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getMyHdList(){
|
|
|
return getList({page: this.list.page}).then(res=>{
|
|
|
this.completes(res);
|
|
|
@@ -289,6 +297,45 @@ export default {
|
|
|
toRechargeClear(item) {
|
|
|
this.hideMoreOptions()
|
|
|
this.recharge(item)
|
|
|
+ },
|
|
|
+ goToBirthday() {
|
|
|
+ this.pageTo({ url: '/pages/user/birthday' })
|
|
|
+ },
|
|
|
+ goEdit(){
|
|
|
+ this.pageTo({ url: '/pages/user/edit' })
|
|
|
+ },
|
|
|
+ onChooseAvatar(e) {
|
|
|
+ if (e.detail.avatarUrl) {
|
|
|
+ this.user.smallAvatar = e.detail.avatarUrl
|
|
|
+ this.updateUserAvatar(e.detail.avatarUrl)
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '获取头像失败',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateUserAvatar(avatarUrl) {
|
|
|
+ let token = uni.getStorageSync('token') || ''
|
|
|
+ let url = APIHOST+'/upload/save-file?actType=saveAvatar'
|
|
|
+ uni.uploadFile({
|
|
|
+ url: url,
|
|
|
+ filePath: avatarUrl,
|
|
|
+ name: 'file',
|
|
|
+ header: {
|
|
|
+ 'token': token
|
|
|
+ },
|
|
|
+ formData: {},
|
|
|
+ success: (res) => {
|
|
|
+ const ret = JSON.parse(res.data);
|
|
|
+ if (ret.code == 1) {
|
|
|
+ //无操作
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: ret.msg, icon: 'none' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => uni.showToast({ title: '上传失败', icon: 'none' })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -309,8 +356,8 @@ page {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- min-height: 100vh;
|
|
|
- padding: 40upx;
|
|
|
+ min-height: 70vh;
|
|
|
+ padding: 0upx 40upx 40upx 40upx;
|
|
|
|
|
|
.login-content {
|
|
|
text-align: center;
|
|
|
@@ -325,24 +372,23 @@ page {
|
|
|
|
|
|
.login-subtitle {
|
|
|
display: block;
|
|
|
- font-size: 28upx;
|
|
|
+ font-size: 34upx;
|
|
|
color: #666;
|
|
|
margin-bottom: 60upx;
|
|
|
}
|
|
|
|
|
|
.login-btn {
|
|
|
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
|
|
|
color: white;
|
|
|
border: none;
|
|
|
border-radius: 50upx;
|
|
|
padding: 24upx 60upx;
|
|
|
font-size: 32upx;
|
|
|
font-weight: 500;
|
|
|
- box-shadow: 0 8upx 20upx rgba(102, 126, 234, 0.3);
|
|
|
+ box-shadow: 0 8upx 20upx rgba(255, 107, 107, 0.3);
|
|
|
|
|
|
&:active {
|
|
|
- transform: translateY(2upx);
|
|
|
- box-shadow: 0 4upx 12upx rgba(102, 126, 234, 0.4);
|
|
|
+ box-shadow: 0 4upx 12upx rgba(255, 107, 107, 0.4);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -366,19 +412,34 @@ page {
|
|
|
justify-content: flex-start;
|
|
|
margin-bottom: 35upx;
|
|
|
padding: 0 10upx;
|
|
|
- cursor: pointer;
|
|
|
- transition: all 0.2s ease;
|
|
|
border-radius: 10upx;
|
|
|
|
|
|
- &:active {
|
|
|
- background: rgba(255, 255, 255, 0.1);
|
|
|
- transform: scale(0.98);
|
|
|
- }
|
|
|
-
|
|
|
.avatar-container {
|
|
|
margin-right: 30upx;
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
+ .avatar-button {
|
|
|
+ background: none !important;
|
|
|
+ border: none !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ line-height: 1;
|
|
|
+ display: block;
|
|
|
+ color: transparent !important;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ border: none !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* &:active {
|
|
|
+ background: none !important;
|
|
|
+ } */
|
|
|
+
|
|
|
+ &:focus {
|
|
|
+ background: none !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.avatar {
|
|
|
width: 110upx;
|
|
|
height: 110upx;
|
|
|
@@ -398,8 +459,8 @@ page {
|
|
|
.username {
|
|
|
display: block;
|
|
|
color: #ffffff;
|
|
|
- font-size: 44upx;
|
|
|
- font-weight: 600;
|
|
|
+ font-size: 45upx;
|
|
|
+ font-weight: bold;
|
|
|
margin-bottom: 8upx;
|
|
|
text-shadow: 0 2upx 4upx rgba(0, 0, 0, 0.1);
|
|
|
line-height: 1.2;
|
|
|
@@ -426,10 +487,9 @@ page {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- &:active .arrow-icon {
|
|
|
+ /* &:active .arrow-icon {
|
|
|
color: #ffffff;
|
|
|
- transform: translateX(4upx);
|
|
|
- }
|
|
|
+ } */
|
|
|
}
|
|
|
|
|
|
.function-grid {
|
|
|
@@ -440,12 +500,38 @@ page {
|
|
|
padding: 0 10upx;
|
|
|
gap: 15upx;
|
|
|
|
|
|
+ .function-item-wrapper {
|
|
|
+ position: relative;
|
|
|
+ width: calc(20% - 6upx);
|
|
|
+
|
|
|
+ .message-badge {
|
|
|
+ position: absolute;
|
|
|
+ top: -15upx;
|
|
|
+ right: -15upx;
|
|
|
+ width: 42upx;
|
|
|
+ height: 42upx;
|
|
|
+ background: #ff4757;
|
|
|
+ border-radius: 21upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 22upx;
|
|
|
+ font-weight: bold;
|
|
|
+ box-shadow: 0 4upx 12upx rgba(255, 56, 56, 0.6);
|
|
|
+ z-index: 10;
|
|
|
+ text-shadow: 0 1upx 2upx rgba(0, 0, 0, 0.3);
|
|
|
+ line-height: 1;
|
|
|
+ min-width: 42upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.function-item {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- width: calc(20% - 6upx);
|
|
|
+ width: 100%;
|
|
|
height: 110upx;
|
|
|
background: rgba(255, 255, 255, 0.15);
|
|
|
border-radius: 15upx;
|
|
|
@@ -454,10 +540,9 @@ page {
|
|
|
transition: all 0.2s ease;
|
|
|
box-shadow: 0 2upx 8upx rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
- &:active {
|
|
|
- transform: scale(0.95);
|
|
|
+ /* &:active {
|
|
|
background: rgba(255, 255, 255, 0.25);
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
.function-icon {
|
|
|
font-size: 44upx;
|
|
|
@@ -480,36 +565,71 @@ page {
|
|
|
margin-top: 0;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ // 对于没有包装器的普通按钮,保持原来的宽度
|
|
|
+ > .function-item {
|
|
|
+ width: calc(20% - 6upx);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生日礼物提示横幅
|
|
|
+ .birthday-banner {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ background: #fff5f5;
|
|
|
+ border-radius: 15upx;
|
|
|
+ padding: 20upx 24upx;
|
|
|
+ margin-top: 20upx;
|
|
|
+ border: 1upx solid #ffe4e4;
|
|
|
+ box-shadow: 0 2upx 8upx rgba(255, 182, 193, 0.2);
|
|
|
+
|
|
|
+ .gift-icon-container {
|
|
|
+ width: 60upx;
|
|
|
+ height: 60upx;
|
|
|
+ background: #ff4757;
|
|
|
+ border-radius: 30upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-right: 20upx;
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
|
- // 新消息按钮特殊样式
|
|
|
- &.message-item {
|
|
|
- .icon-container {
|
|
|
- position: relative;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-bottom: 8upx;
|
|
|
-
|
|
|
- .function-icon {
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .message-dot {
|
|
|
- position: absolute;
|
|
|
- top: -5upx;
|
|
|
- right: -10upx;
|
|
|
- width: 24upx;
|
|
|
- height: 24upx;
|
|
|
- background: #ff3838;
|
|
|
- border-radius: 12upx;
|
|
|
- border: 3upx solid #ffffff;
|
|
|
- box-shadow: 0 4upx 12upx rgba(255, 56, 56, 0.6), 0 0 0 4upx rgba(255, 56, 56, 0.2);
|
|
|
- animation: pulse 1.5s infinite;
|
|
|
- z-index: 10;
|
|
|
- }
|
|
|
- }
|
|
|
+ .gift-icon {
|
|
|
+ font-size: 32upx;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .banner-text {
|
|
|
+ flex: 1;
|
|
|
+ margin-right: 20upx;
|
|
|
+
|
|
|
+ .banner-title {
|
|
|
+ font-size: 28upx;
|
|
|
+ color: #ff4757;
|
|
|
+ font-weight: 500;
|
|
|
+ line-height: 1.4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .banner-button {
|
|
|
+ background: #ff4757;
|
|
|
+ border-radius: 20upx;
|
|
|
+ padding: 12upx 24upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ .button-text {
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #ffffff;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* &:active {
|
|
|
+ background: #fff0f0;
|
|
|
+ } */
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -606,7 +726,7 @@ page {
|
|
|
}
|
|
|
|
|
|
&.positive {
|
|
|
- color: #2ed573;
|
|
|
+ color: #667eea;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -616,6 +736,12 @@ page {
|
|
|
text-decoration: underline;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+ .balance-action-2{
|
|
|
+ font-size: 28upx;
|
|
|
+ color: #ff4757;
|
|
|
+ text-decoration: underline;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -632,10 +758,9 @@ page {
|
|
|
box-shadow: 0 4upx 12upx rgba(0, 0, 0, 0.15);
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
- &:active {
|
|
|
- transform: translateY(2upx);
|
|
|
+ /* &:active {
|
|
|
box-shadow: 0 2upx 8upx rgba(0, 0, 0, 0.2);
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
&.primary {
|
|
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
|
|
|
@@ -672,9 +797,9 @@ page {
|
|
|
text-align: center;
|
|
|
border: 1upx solid #e9ecef;
|
|
|
|
|
|
- &:active {
|
|
|
+ /* &:active {
|
|
|
background: #e9ecef;
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
.record-text {
|
|
|
font-size: 26upx;
|
|
|
@@ -724,9 +849,9 @@ page {
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
|
|
|
- &:active {
|
|
|
+ /* &:active {
|
|
|
background-color: #f8f9fa;
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
&.cancel {
|
|
|
color: #999;
|
|
|
@@ -734,7 +859,7 @@ page {
|
|
|
|
|
|
text {
|
|
|
color: #333;
|
|
|
- font-size: 32upx;
|
|
|
+ font-size: 36upx;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
}
|