|
|
@@ -1,810 +1,858 @@
|
|
|
-<template>
|
|
|
- <view class="page-container">
|
|
|
- <!-- 未登录状态 -->
|
|
|
- <block v-if="loginStyle == 0">
|
|
|
- <!-- 无网络提示条 -->
|
|
|
- <no-network-bar></no-network-bar>
|
|
|
- <view class="login-container">
|
|
|
- <view class="login-content">
|
|
|
- <text class="login-title">欢迎使用</text>
|
|
|
- <text class="login-subtitle">登录查看您的花店</text>
|
|
|
- <button class="login-btn" @click="pageTo({ url: '/pages/login/index?needBack=1' })"> 立即登录 </button>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
-
|
|
|
- <!-- 已登录状态 -->
|
|
|
- <block v-else>
|
|
|
- <view class="main-content">
|
|
|
- <!-- 无网络提示条 -->
|
|
|
- <no-network-bar></no-network-bar>
|
|
|
-
|
|
|
- <!-- 花店列表 -->
|
|
|
- <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)">
|
|
|
- <text class="more-icon">...</text>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 更多选项弹出菜单 -->
|
|
|
- <view
|
|
|
- class="options-popup"
|
|
|
- v-if="activePopupIndex === index"
|
|
|
- @click.stop
|
|
|
- >
|
|
|
- <view class="popup-overlay" @click="hideMoreOptions"></view>
|
|
|
- <view class="popup-content">
|
|
|
- <view class="popup-item" @click="getLevelChange(item)">
|
|
|
- <text>等级变动</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="toRechargeClear(item)">
|
|
|
- <text>充值</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="toPay(item)">
|
|
|
- <text>付款</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="getRechargeList(item)">
|
|
|
- <text>充值记录</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="toGrowth(item)">
|
|
|
- <text>成长值记录</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="toIntegral(item)">
|
|
|
- <text>积分记录</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item" @click="delMyHd(item)">
|
|
|
- <text>删除</text>
|
|
|
- </view>
|
|
|
- <view class="popup-item cancel" @click="hideMoreOptions()">
|
|
|
- <text>取消</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 店铺基本信息 -->
|
|
|
- <view class="shop-header">
|
|
|
- <view class="shop-avatar">
|
|
|
- <image
|
|
|
- class="shop-logo"
|
|
|
- :src="item.smallAvatar"
|
|
|
- mode="aspectFill"
|
|
|
- />
|
|
|
- </view>
|
|
|
- <view class="shop-info">
|
|
|
- <view class="shop-name-row">
|
|
|
- <text class="shop-name">{{ item.name }}</text>
|
|
|
- <view class="member-tag">
|
|
|
- <sprite-icon name="huangguan" :size="21" custom-class="member-crown-icon" />
|
|
|
- <text class="member-tag-text">{{ getMemberLevelText(item) }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <text class="shop-address">{{ item.dist }}{{ item.address }}{{ item.floor }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 余额 / 进入店铺 -->
|
|
|
- <view class="shop-main-actions">
|
|
|
- <view class="balance-btn" @click.stop="recharge(item)">
|
|
|
- <sprite-icon name="huashu" :size="40" custom-class="action-icon-slot" />
|
|
|
- <view class="balance-btn-content">
|
|
|
- <text class="balance-btn-label">{{ getBalanceLabel(item) }}</text>
|
|
|
- <text class="balance-btn-value" :class="{ negative: Number(item.balance) < 0 }">{{ formatBalanceAmount(item) }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view
|
|
|
- class="enter-btn"
|
|
|
- :class="{ disabled: item.openShop === 0 }"
|
|
|
- @click.stop="enterShop(item)"
|
|
|
- >
|
|
|
- <sprite-icon name="hua" :size="40" custom-class="action-icon-slot" />
|
|
|
- <text class="enter-btn-text">进入店铺</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 底部快捷操作:2×2 网格,图标+文字横向排列 -->
|
|
|
- <view class="shop-util-actions">
|
|
|
- <view class="util-btn" @click.stop="goMyDividend(item)">
|
|
|
- <sprite-icon name="dengji-biandong" :size="32" custom-class="util-btn-icon" />
|
|
|
- <text class="util-btn-text">我的分红</text>
|
|
|
- </view>
|
|
|
- <view class="util-btn" @click.stop="getBalanceChange(item)">
|
|
|
- <sprite-icon name="yue-biandong" :size="32" custom-class="util-btn-icon" />
|
|
|
- <text class="util-btn-text">余额变动</text>
|
|
|
- </view>
|
|
|
- <view class="util-btn" @click.stop="goMemberBenefits(item)">
|
|
|
- <sprite-icon name="huiyuan-quanyi" :size="32" custom-class="util-btn-icon" />
|
|
|
- <text class="util-btn-text">会员权益</text>
|
|
|
- </view>
|
|
|
- <view class="util-btn" @click.stop="contactService(item)">
|
|
|
- <sprite-icon name="lianxikefu" :size="32" custom-class="util-btn-icon" />
|
|
|
- <text class="util-btn-text">联系客服</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view v-else class="empty-state">
|
|
|
- <text class="empty-icon">🏪</text>
|
|
|
- <text class="empty-title">暂无花店</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
-import AppSwiper from "@/components/app-swiper";
|
|
|
-import TuiListCell from "@/components/plugin/list-cell";
|
|
|
-import TuiListView from "@/components/plugin/list-view";
|
|
|
-import AppActivilyCoupon from "@/components/module/app-activily-coupon";
|
|
|
-import { getList, delHd } from "@/api/hd";
|
|
|
-import { share } from "@/mixins";
|
|
|
-import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
-import NoNetworkBar from "@/components/no-network-bar.vue";
|
|
|
-import SpriteIcon from "@/components/sprite-icon/index.vue";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
-import { currentInfo } from "@/api/user";
|
|
|
-import { list } from "@/mixins";
|
|
|
-import { TOKEN_STORAGE_KEY } from "@/constant/storageKeys";
|
|
|
-export default {
|
|
|
- name: "recent",
|
|
|
- components: {
|
|
|
- AppAvatarModule,
|
|
|
- AppSwiper,
|
|
|
- TuiListView,
|
|
|
- TuiListCell,
|
|
|
- AppActivilyCoupon,
|
|
|
- NoNetworkBar,
|
|
|
- SpriteIcon,
|
|
|
- },
|
|
|
- mixins: [share, list],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- //0没有登录 1有登录
|
|
|
- loginStyle: 0,
|
|
|
- activePopupIndex: -1,
|
|
|
- pageAction: { refresh: 0 },
|
|
|
- user: { name: "", smallAvatar: "", id: 0 },
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters({ userInfo: "getUser", loginInfo: "getLoginInfo" }),
|
|
|
- },
|
|
|
- watch: {
|
|
|
- loginInfo(newVal) {
|
|
|
- if (!this.$util.isEmpty(newVal)) {
|
|
|
- this.loginStyle = 1;
|
|
|
- } else {
|
|
|
- this.loginStyle = 0;
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- if (!this.$util.isEmpty(this.loginInfo)) {
|
|
|
- this.loginStyle = 1;
|
|
|
- } else {
|
|
|
- this.loginStyle = 0;
|
|
|
- }
|
|
|
- if (this.pageAction.refresh == 1) {
|
|
|
- this.resetList();
|
|
|
- this.init();
|
|
|
- this.pageAction.refresh = 0;
|
|
|
- }
|
|
|
- },
|
|
|
- onPullDownRefresh() {
|
|
|
- this.resetList();
|
|
|
- // 重新获取数据
|
|
|
- this.getMyHdList()
|
|
|
- .then(() => {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- });
|
|
|
- },
|
|
|
- onReachBottom() {
|
|
|
- // 滚动到底部加载更多
|
|
|
- this.toBottom();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- recharge(item) {
|
|
|
- this.pageTo({
|
|
|
- url:
|
|
|
- "/pages/member/recharge?hdId=" + item.id + "&account=" + item.shopId,
|
|
|
- });
|
|
|
- },
|
|
|
- toBottom() {
|
|
|
- if (!this.list.finished) {
|
|
|
- this.getMyHdList().then((res) => {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- }
|
|
|
- },
|
|
|
- getSettleList(item) {
|
|
|
- this.pageTo({ url: "/pages/settle/list?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
- },
|
|
|
- getLevelChange(item) {
|
|
|
- this.hideMoreOptions();
|
|
|
- this.pageTo({ url: "/pages/custom/levelChange?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
- },
|
|
|
- /** 我的分红 */
|
|
|
- goMyDividend(item) {
|
|
|
- this.pageTo({
|
|
|
- url: "/pages/custom/myDividend?account=" + item.shopId + "&hdId=" + item.id + "&hdName=" + encodeURIComponent(item.name || "")
|
|
|
- });
|
|
|
- },
|
|
|
- getBalanceChange(item) {
|
|
|
- this.pageTo({ url: "/pages/balance/changeList?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
- },
|
|
|
- getBuyList(item) {
|
|
|
- this.pageTo({
|
|
|
- url: "/pages/home/order",
|
|
|
- type: 4,
|
|
|
- query: { id: item.id, account: item.shopId, hdId: item.id }
|
|
|
- });
|
|
|
- },
|
|
|
- bug(item) {
|
|
|
- if(item.openShop == 0){
|
|
|
- this.$msg('已休店')
|
|
|
- return
|
|
|
- }
|
|
|
- // 进入店铺改为跳转可配置的店铺首页(原花材选购页改由首页内链接进入)
|
|
|
- this.pageTo({ url: "/pages/home/index?account=" + item.shopId + "&hdId=" + item.id, })
|
|
|
- },
|
|
|
- hs(item) {
|
|
|
- if(item.openShop == 0){
|
|
|
- this.$msg('已休店')
|
|
|
- return
|
|
|
- }
|
|
|
- this.pageTo({ url: "/pages/home/category?id=" + item.id + "&account=" + item.shopId, })
|
|
|
- },
|
|
|
- tj(item) {
|
|
|
- this.pageTo({
|
|
|
- url: "/pages/home/mall?id=" + item.id + "&account=" + item.shopId,
|
|
|
- })
|
|
|
- },
|
|
|
- hasDelHd(){
|
|
|
- this.pageTo({ url: "/pages/hd/hasDel" });
|
|
|
- },
|
|
|
- init() {
|
|
|
- this.getLoginInfo()
|
|
|
- this.getMyHdList()
|
|
|
- },
|
|
|
- getLoginInfo() {
|
|
|
- currentInfo().then((res) => {
|
|
|
- if (res.code == 1) {
|
|
|
- if (res.data.info) {
|
|
|
- this.user = res.data.info;
|
|
|
- } else {
|
|
|
- this.user = { name: "", smallAvatar: "", id: 0 };
|
|
|
- this.loginStyle = 0;
|
|
|
- this.$store.commit("setLoginInfo", {});
|
|
|
- uni.removeStorageSync(TOKEN_STORAGE_KEY);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- getMyHdList() {
|
|
|
- return getList({ page: this.list.page }).then((res) => {
|
|
|
- this.completes(res);
|
|
|
- if (this.$util.isEmpty(res.data)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- showMoreOptions(index) {
|
|
|
- this.activePopupIndex = index;
|
|
|
- },
|
|
|
- hideMoreOptions() {
|
|
|
- this.activePopupIndex = -1;
|
|
|
- },
|
|
|
- toPay(item) {
|
|
|
- this.hideMoreOptions();
|
|
|
- this.pageTo({
|
|
|
- url:
|
|
|
- "/pages/pay/index?account=" +
|
|
|
- item.shopId +
|
|
|
- "&hdId=" +
|
|
|
- item.id +
|
|
|
- "&hdName=" +
|
|
|
- item.name +
|
|
|
- "&store=0&fromType=3",
|
|
|
- });
|
|
|
- },
|
|
|
- getRechargeList(item) {
|
|
|
- this.hideMoreOptions();
|
|
|
- this.pageTo({
|
|
|
- url:
|
|
|
- "/pages/recharge/list?account=" +
|
|
|
- item.shopId +
|
|
|
- "&hdId=" +
|
|
|
- item.id +
|
|
|
- "&hdName=" +
|
|
|
- item.name,
|
|
|
- });
|
|
|
- },
|
|
|
- toRechargeClear(item) {
|
|
|
- this.hideMoreOptions();
|
|
|
- this.recharge(item);
|
|
|
- },
|
|
|
- toGrowth(item) {
|
|
|
- this.pageTo({
|
|
|
- url:
|
|
|
- "/pages/user/growthList?account=" +
|
|
|
- item.shopId +
|
|
|
- "&hdId=" +
|
|
|
- item.id +
|
|
|
- "&hdName=" +
|
|
|
- item.name,
|
|
|
- });
|
|
|
- },
|
|
|
- toIntegral(item) {
|
|
|
- this.pageTo({
|
|
|
- url:
|
|
|
- "/pages/user/integralList?account=" +
|
|
|
- item.shopId +
|
|
|
- "&hdId=" +
|
|
|
- item.id +
|
|
|
- "&hdName=" +
|
|
|
- item.name,
|
|
|
- });
|
|
|
- },
|
|
|
- delMyHd(item) {
|
|
|
- this.hideMoreOptions();
|
|
|
- this.$util.confirmModal({content:'确认删除该花店?'},() => {
|
|
|
- delHd({ id: item.id }).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.$msg("删除成功")
|
|
|
- this.resetList()
|
|
|
- this.getMyHdList()
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 会员等级文案,接口无字段时默认普通会员
|
|
|
- */
|
|
|
- getMemberLevelText(item) {
|
|
|
- return item.levelName || item.memberName || item.memberLevel || "普通会员";
|
|
|
- },
|
|
|
- /**
|
|
|
- * 余额按钮标签:负数为待结,其余为余额
|
|
|
- */
|
|
|
- getBalanceLabel(item) {
|
|
|
- return Number(item.balance) < 0 ? "待结" : "余额";
|
|
|
- },
|
|
|
- /**
|
|
|
- * 余额展示数值
|
|
|
- */
|
|
|
- formatBalanceAmount(item) {
|
|
|
- const balance = Number(item.balance || 0);
|
|
|
- return parseFloat(Math.abs(balance));
|
|
|
- },
|
|
|
- /**
|
|
|
- * 进入店铺:跳转可配置的店铺首页
|
|
|
- */
|
|
|
- enterShop(item) {
|
|
|
- if (item.openShop == 0) {
|
|
|
- this.$msg("已休店");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.bug(item);
|
|
|
- },
|
|
|
- /**
|
|
|
- * 会员权益
|
|
|
- */
|
|
|
- goMemberBenefits(item) {
|
|
|
- this.pageTo({
|
|
|
- url: "/pages/interest/level?account=" + item.shopId + "&hdId=" + item.id
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 联系客服:打开对应门店聊天
|
|
|
- */
|
|
|
- contactService(item) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/chat/chatPage",
|
|
|
- success: (res) => {
|
|
|
- res.eventChannel.emit("acceptDataFromOpenerPage", {
|
|
|
- shopId: item.shopId,
|
|
|
- customId: item.customId || "",
|
|
|
- name: this.user.name || "",
|
|
|
- avatar: this.user.smallAvatar || "",
|
|
|
- chatPerson: item.name
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
-page {
|
|
|
- height: 100%;
|
|
|
- background-color: #f3f4f6;
|
|
|
-}
|
|
|
-
|
|
|
-.page-container {
|
|
|
- min-height: 100vh;
|
|
|
- background-color: #f3f4f6;
|
|
|
- padding-bottom: calc(20upx + env(safe-area-inset-bottom));
|
|
|
-}
|
|
|
-
|
|
|
-// 登录页面样式
|
|
|
-.login-container {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- min-height: 70vh;
|
|
|
- padding: 0upx 40upx 40upx 40upx;
|
|
|
-
|
|
|
- .login-content {
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .login-title {
|
|
|
- display: block;
|
|
|
- font-size: 48upx;
|
|
|
- font-weight: 600;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 16upx;
|
|
|
- }
|
|
|
-
|
|
|
- .login-subtitle {
|
|
|
- display: block;
|
|
|
- font-size: 34upx;
|
|
|
- color: #666;
|
|
|
- margin-top:50upx;
|
|
|
- margin-bottom: 60upx;
|
|
|
- }
|
|
|
-
|
|
|
- .login-btn {
|
|
|
- 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(255, 107, 107, 0.3);
|
|
|
-
|
|
|
- &:active {
|
|
|
- box-shadow: 0 4upx 12upx rgba(255, 107, 107, 0.4);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 主要内容区域
|
|
|
-.main-content {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-
|
|
|
-// 花店列表
|
|
|
-.shop-list {
|
|
|
- padding: 20upx 24upx 40upx;
|
|
|
-}
|
|
|
-
|
|
|
-// 花店卡片
|
|
|
-.shop-card {
|
|
|
- background: #ffffff;
|
|
|
- border-radius: 24upx;
|
|
|
- margin-bottom: 24upx;
|
|
|
- padding: 28upx 28upx 24upx;
|
|
|
- position: relative;
|
|
|
- box-shadow: 0 8upx 24upx rgba(15, 23, 42, 0.06);
|
|
|
-
|
|
|
- .more-btn {
|
|
|
- position: absolute;
|
|
|
- top: 24upx;
|
|
|
- right: 24upx;
|
|
|
- width: 48upx;
|
|
|
- height: 48upx;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- border-radius: 24upx;
|
|
|
- background: #f3f4f6;
|
|
|
- z-index: 2;
|
|
|
-
|
|
|
- .more-icon {
|
|
|
- font-size: 32upx;
|
|
|
- color: #9ca3af;
|
|
|
- font-weight: bold;
|
|
|
- line-height: 1;
|
|
|
- letter-spacing: 2upx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .shop-header {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding-right: 56upx;
|
|
|
- margin-bottom: 24upx;
|
|
|
-
|
|
|
- .shop-avatar {
|
|
|
- margin-right: 20upx;
|
|
|
- flex-shrink: 0;
|
|
|
-
|
|
|
- .shop-logo {
|
|
|
- width: 96upx;
|
|
|
- height: 96upx;
|
|
|
- border-radius: 48upx;
|
|
|
- background-color: #f5f5f5;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .shop-info {
|
|
|
- flex: 1;
|
|
|
- min-width: 0;
|
|
|
-
|
|
|
- .shop-name-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 10upx;
|
|
|
- }
|
|
|
-
|
|
|
- /* custom-class 在子组件根节点,需 deep 才能写间距 */
|
|
|
- .shop-name-row ::v-deep .shop-name-icon {
|
|
|
- margin-right: 8upx;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .member-tag ::v-deep .member-crown-icon {
|
|
|
- margin-right: 4upx;
|
|
|
- margin-botom: 14upx;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .shop-name {
|
|
|
- max-width: 280upx;
|
|
|
- color: #111827;
|
|
|
- font-size: 34upx;
|
|
|
- font-weight: 700;
|
|
|
- line-height: 1.2;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- }
|
|
|
-
|
|
|
- .member-tag {
|
|
|
- margin-left: 12upx;
|
|
|
- padding: 4upx 14upx;
|
|
|
- border-radius: 20upx;
|
|
|
- background: #eef9f0;
|
|
|
- flex-shrink: 0;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
-
|
|
|
- .member-tag-text {
|
|
|
- color: #1f7a3d;
|
|
|
- font-size: 22upx;
|
|
|
- font-weight: 600;
|
|
|
- line-height: 1.2;
|
|
|
- }
|
|
|
-
|
|
|
- .shop-address {
|
|
|
- display: block;
|
|
|
- color: #9ca3af;
|
|
|
- font-size: 24upx;
|
|
|
- line-height: 1.4;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .shop-main-actions {
|
|
|
- display: flex;
|
|
|
- margin-bottom: 20upx;
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn,
|
|
|
- .enter-btn {
|
|
|
- flex: 1;
|
|
|
- min-height: 96upx;
|
|
|
- border-radius: 16upx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn {
|
|
|
- margin-right: 16upx;
|
|
|
- background: #ffeef5;
|
|
|
- }
|
|
|
-
|
|
|
- .enter-btn {
|
|
|
- background: #eef9f0;
|
|
|
-
|
|
|
- &.disabled {
|
|
|
- opacity: 0.55;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn ::v-deep .action-icon-slot,
|
|
|
- .enter-btn ::v-deep .action-icon-slot {
|
|
|
- margin-right: 10upx;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn-content {
|
|
|
- display: flex;
|
|
|
- align-items: baseline;
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn-label {
|
|
|
- color: #374151;
|
|
|
- font-size: 28upx;
|
|
|
- font-weight: 600;
|
|
|
- margin-right: 8upx;
|
|
|
- }
|
|
|
-
|
|
|
- .balance-btn-value {
|
|
|
- color: #d63384;
|
|
|
- font-size: 34upx;
|
|
|
- font-weight: 700;
|
|
|
- line-height: 1;
|
|
|
-
|
|
|
- &.negative {
|
|
|
- color: #ef4444;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .enter-btn-text {
|
|
|
- color: #1f7a3d;
|
|
|
- font-size: 30upx;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
-
|
|
|
- .shop-util-actions {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- flex-wrap: nowrap;
|
|
|
- }
|
|
|
-
|
|
|
- /* 快捷按钮:同一排,图标左、文字右 */
|
|
|
- .util-btn {
|
|
|
- flex: 1;
|
|
|
- min-width: 0;
|
|
|
- margin-right: 12upx;
|
|
|
- padding: 14upx 8upx;
|
|
|
- box-sizing: border-box;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- background: #f5f6f8;
|
|
|
- border: 1upx solid #e5e7eb;
|
|
|
- border-radius: 12upx;
|
|
|
-
|
|
|
- &:last-child {
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .util-btn ::v-deep .util-btn-icon {
|
|
|
- margin-right: 6upx;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .util-btn-text {
|
|
|
- flex-shrink: 1;
|
|
|
- min-width: 0;
|
|
|
- color: #6b7280;
|
|
|
- font-size: 20upx;
|
|
|
- line-height: 1.2;
|
|
|
- text-align: left;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 弹出菜单
|
|
|
-.options-popup {
|
|
|
- position: fixed;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
- z-index: 1000;
|
|
|
-
|
|
|
- .popup-overlay {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- background-color: rgba(0, 0, 0, 0.4);
|
|
|
- }
|
|
|
-
|
|
|
- .popup-content {
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- background-color: white;
|
|
|
- border-radius: 20upx;
|
|
|
- padding: 0;
|
|
|
- min-width: 500upx;
|
|
|
- box-shadow: 0 20upx 40upx rgba(0, 0, 0, 0.3);
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .popup-item {
|
|
|
- padding: 40upx 50upx;
|
|
|
- border-bottom: 1upx solid #f0f0f0;
|
|
|
- text-align: center;
|
|
|
- transition: all 0.2s ease;
|
|
|
-
|
|
|
- &:last-child {
|
|
|
- border-bottom: none;
|
|
|
- }
|
|
|
-
|
|
|
- /* &:active {
|
|
|
- background-color: #f8f9fa;
|
|
|
- } */
|
|
|
-
|
|
|
- &.cancel {
|
|
|
- color: #999;
|
|
|
- }
|
|
|
-
|
|
|
- text {
|
|
|
- color: #333;
|
|
|
- font-size: 36upx;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 空状态
|
|
|
-.empty-state {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- padding: 100upx 40upx;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .empty-icon {
|
|
|
- font-size: 120upx;
|
|
|
- margin-bottom: 30upx;
|
|
|
- }
|
|
|
-
|
|
|
- .empty-title {
|
|
|
- font-size: 36upx;
|
|
|
- font-weight: 600;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 12upx;
|
|
|
- }
|
|
|
-
|
|
|
- .empty-subtitle {
|
|
|
- font-size: 28upx;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 动画效果
|
|
|
-@keyframes pulse {
|
|
|
- 0% {
|
|
|
- transform: scale(1);
|
|
|
- opacity: 1;
|
|
|
- }
|
|
|
- 50% {
|
|
|
- transform: scale(1.2);
|
|
|
- opacity: 0.8;
|
|
|
- }
|
|
|
- 100% {
|
|
|
- transform: scale(1);
|
|
|
- opacity: 1;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
+<!--
|
|
|
+ 个人首页
|
|
|
+ 已登录用户在这里管理花店,并在花店列表加载后接收尚未通知的红包到账提醒。
|
|
|
+-->
|
|
|
+<template>
|
|
|
+ <view class="page-container">
|
|
|
+ <!-- 未登录状态 -->
|
|
|
+ <block v-if="loginStyle == 0">
|
|
|
+ <!-- 无网络提示条 -->
|
|
|
+ <no-network-bar></no-network-bar>
|
|
|
+ <view class="login-container">
|
|
|
+ <view class="login-content">
|
|
|
+ <text class="login-title">欢迎使用</text>
|
|
|
+ <text class="login-subtitle">登录查看您的花店</text>
|
|
|
+ <button class="login-btn" @click="pageTo({ url: '/pages/login/index?needBack=1' })"> 立即登录 </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+
|
|
|
+ <!-- 已登录状态 -->
|
|
|
+ <block v-else>
|
|
|
+ <view class="main-content">
|
|
|
+ <!-- 无网络提示条 -->
|
|
|
+ <no-network-bar></no-network-bar>
|
|
|
+
|
|
|
+ <!-- 花店列表 -->
|
|
|
+ <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)">
|
|
|
+ <text class="more-icon">...</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 更多选项弹出菜单 -->
|
|
|
+ <view
|
|
|
+ class="options-popup"
|
|
|
+ v-if="activePopupIndex === index"
|
|
|
+ @click.stop
|
|
|
+ >
|
|
|
+ <view class="popup-overlay" @click="hideMoreOptions"></view>
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="popup-item" @click="getLevelChange(item)">
|
|
|
+ <text>等级变动</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="toRechargeClear(item)">
|
|
|
+ <text>充值</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="toPay(item)">
|
|
|
+ <text>付款</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="getRechargeList(item)">
|
|
|
+ <text>充值记录</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="toGrowth(item)">
|
|
|
+ <text>成长值记录</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="toIntegral(item)">
|
|
|
+ <text>积分记录</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item" @click="delMyHd(item)">
|
|
|
+ <text>删除</text>
|
|
|
+ </view>
|
|
|
+ <view class="popup-item cancel" @click="hideMoreOptions()">
|
|
|
+ <text>取消</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 店铺基本信息 -->
|
|
|
+ <view class="shop-header">
|
|
|
+ <view class="shop-avatar">
|
|
|
+ <image
|
|
|
+ class="shop-logo"
|
|
|
+ :src="item.smallAvatar"
|
|
|
+ mode="aspectFill"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <view class="shop-info">
|
|
|
+ <view class="shop-name-row">
|
|
|
+ <text class="shop-name">{{ item.name }}</text>
|
|
|
+ <view class="member-tag">
|
|
|
+ <sprite-icon name="huangguan" :size="21" custom-class="member-crown-icon" />
|
|
|
+ <text class="member-tag-text">{{ getMemberLevelText(item) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <text class="shop-address">{{ item.dist }}{{ item.address }}{{ item.floor }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 余额 / 进入店铺 -->
|
|
|
+ <view class="shop-main-actions">
|
|
|
+ <view class="balance-btn" @click.stop="recharge(item)">
|
|
|
+ <sprite-icon name="huashu" :size="40" custom-class="action-icon-slot" />
|
|
|
+ <view class="balance-btn-content">
|
|
|
+ <text class="balance-btn-label">{{ getBalanceLabel(item) }}</text>
|
|
|
+ <text class="balance-btn-value" :class="{ negative: Number(item.balance) < 0 }">{{ formatBalanceAmount(item) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ class="enter-btn"
|
|
|
+ :class="{ disabled: item.openShop === 0 }"
|
|
|
+ @click.stop="enterShop(item)"
|
|
|
+ >
|
|
|
+ <sprite-icon name="hua" :size="40" custom-class="action-icon-slot" />
|
|
|
+ <text class="enter-btn-text">进入店铺</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 底部快捷操作:2×2 网格,图标+文字横向排列 -->
|
|
|
+ <view class="shop-util-actions">
|
|
|
+ <view class="util-btn" @click.stop="goMyDividend(item)">
|
|
|
+ <sprite-icon name="dengji-biandong" :size="32" custom-class="util-btn-icon" />
|
|
|
+ <text class="util-btn-text">我的分红</text>
|
|
|
+ </view>
|
|
|
+ <view class="util-btn" @click.stop="getBalanceChange(item)">
|
|
|
+ <sprite-icon name="yue-biandong" :size="32" custom-class="util-btn-icon" />
|
|
|
+ <text class="util-btn-text">余额变动</text>
|
|
|
+ </view>
|
|
|
+ <view class="util-btn" @click.stop="goMemberBenefits(item)">
|
|
|
+ <sprite-icon name="huiyuan-quanyi" :size="32" custom-class="util-btn-icon" />
|
|
|
+ <text class="util-btn-text">会员权益</text>
|
|
|
+ </view>
|
|
|
+ <view class="util-btn" @click.stop="contactService(item)">
|
|
|
+ <sprite-icon name="lianxikefu" :size="32" custom-class="util-btn-icon" />
|
|
|
+ <text class="util-btn-text">联系客服</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view v-else class="empty-state">
|
|
|
+ <text class="empty-icon">🏪</text>
|
|
|
+ <text class="empty-title">暂无花店</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <!-- 个人首页未固定门店,由后端按当前用户上下文返回待提醒红包 -->
|
|
|
+ <app-hb-arrival
|
|
|
+ :show.sync="hbArrivalShow"
|
|
|
+ :info="hbArrivalInfo"
|
|
|
+ :hb-ids="hbArrivalIds"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import AppSwiper from "@/components/app-swiper";
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import TuiListView from "@/components/plugin/list-view";
|
|
|
+import AppHbArrival from "@/components/module/app-hb-arrival.vue";
|
|
|
+import { getList, delHd } from "@/api/hd";
|
|
|
+import { checkArrival } from "@/api/hb";
|
|
|
+import { share } from "@/mixins";
|
|
|
+import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
+import NoNetworkBar from "@/components/no-network-bar.vue";
|
|
|
+import SpriteIcon from "@/components/sprite-icon/index.vue";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+import { currentInfo } from "@/api/user";
|
|
|
+import { list } from "@/mixins";
|
|
|
+import { TOKEN_STORAGE_KEY } from "@/constant/storageKeys";
|
|
|
+export default {
|
|
|
+ name: "recent",
|
|
|
+ components: {
|
|
|
+ AppAvatarModule,
|
|
|
+ AppSwiper,
|
|
|
+ TuiListView,
|
|
|
+ TuiListCell,
|
|
|
+ AppHbArrival,
|
|
|
+ NoNetworkBar,
|
|
|
+ SpriteIcon,
|
|
|
+ },
|
|
|
+ mixins: [share, list],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ //0没有登录 1有登录
|
|
|
+ loginStyle: 0,
|
|
|
+ activePopupIndex: -1,
|
|
|
+ pageAction: { refresh: 0 },
|
|
|
+ user: { name: "", smallAvatar: "", id: 0 },
|
|
|
+ /** 新到账红包提醒状态,用户操作后由弹框组件标记已通知 */
|
|
|
+ hbArrivalShow: false,
|
|
|
+ hbArrivalInfo: {},
|
|
|
+ hbArrivalIds: [],
|
|
|
+ hbArrivalLoading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({ userInfo: "getUser", loginInfo: "getLoginInfo" }),
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ loginInfo(newVal) {
|
|
|
+ if (!this.$util.isEmpty(newVal)) {
|
|
|
+ this.loginStyle = 1;
|
|
|
+ } else {
|
|
|
+ this.loginStyle = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ if (!this.$util.isEmpty(this.loginInfo)) {
|
|
|
+ this.loginStyle = 1;
|
|
|
+ } else {
|
|
|
+ this.loginStyle = 0;
|
|
|
+ }
|
|
|
+ if (this.pageAction.refresh == 1) {
|
|
|
+ this.resetList();
|
|
|
+ this.init();
|
|
|
+ this.pageAction.refresh = 0;
|
|
|
+ }
|
|
|
+ if (this.loginStyle == 1 && !this.$util.isEmpty(this.list.data)) {
|
|
|
+ this.checkHbArrival();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.resetList();
|
|
|
+ // 重新获取数据
|
|
|
+ this.getMyHdList()
|
|
|
+ .then(() => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ // 滚动到底部加载更多
|
|
|
+ this.toBottom();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ recharge(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url:
|
|
|
+ "/pages/member/recharge?hdId=" + item.id + "&account=" + item.shopId,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toBottom() {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getMyHdList().then((res) => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getSettleList(item) {
|
|
|
+ this.pageTo({ url: "/pages/settle/list?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
+ },
|
|
|
+ getLevelChange(item) {
|
|
|
+ this.hideMoreOptions();
|
|
|
+ this.pageTo({ url: "/pages/custom/levelChange?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
+ },
|
|
|
+ /** 我的分红 */
|
|
|
+ goMyDividend(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url: "/pages/custom/myDividend?account=" + item.shopId + "&hdId=" + item.id + "&hdName=" + encodeURIComponent(item.name || "")
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getBalanceChange(item) {
|
|
|
+ this.pageTo({ url: "/pages/balance/changeList?id=" + item.id + "&account=" + item.shopId+"&hdId="+item.id, })
|
|
|
+ },
|
|
|
+ getBuyList(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url: "/pages/home/order",
|
|
|
+ type: 4,
|
|
|
+ query: { id: item.id, account: item.shopId, hdId: item.id }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ bug(item) {
|
|
|
+ if(item.openShop == 0){
|
|
|
+ this.$msg('已休店')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 进入店铺改为跳转可配置的店铺首页(原花材选购页改由首页内链接进入)
|
|
|
+ this.pageTo({ url: "/pages/home/index?account=" + item.shopId + "&hdId=" + item.id, })
|
|
|
+ },
|
|
|
+ hs(item) {
|
|
|
+ if(item.openShop == 0){
|
|
|
+ this.$msg('已休店')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.pageTo({ url: "/pages/home/category?id=" + item.id + "&account=" + item.shopId, })
|
|
|
+ },
|
|
|
+ tj(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url: "/pages/home/mall?id=" + item.id + "&account=" + item.shopId,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ hasDelHd(){
|
|
|
+ this.pageTo({ url: "/pages/hd/hasDel" });
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ this.getLoginInfo()
|
|
|
+ this.getMyHdList()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 刷新登录用户信息。
|
|
|
+ * 用户接口和花店列表并行返回时,在两者都就绪后补触发红包检测,避免竞态漏掉提醒。
|
|
|
+ */
|
|
|
+ getLoginInfo() {
|
|
|
+ return currentInfo().then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ if (res.data.info) {
|
|
|
+ this.user = res.data.info;
|
|
|
+ this.loginStyle = 1;
|
|
|
+ if (!this.$util.isEmpty(this.list.data)) {
|
|
|
+ this.checkHbArrival();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.user = { name: "", smallAvatar: "", id: 0 };
|
|
|
+ this.loginStyle = 0;
|
|
|
+ this.$store.commit("setLoginInfo", {});
|
|
|
+ uni.removeStorageSync(TOKEN_STORAGE_KEY);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getMyHdList() {
|
|
|
+ return getList({ page: this.list.page }).then((res) => {
|
|
|
+ this.completes(res);
|
|
|
+ if (this.$util.isEmpty(res.data)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.checkHbArrival();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 花店列表加载完成后查询新红包。
|
|
|
+ * 个人首页没有唯一当前门店,因此不传 shopId,由后端选择当前用户待提醒记录。
|
|
|
+ */
|
|
|
+ checkHbArrival() {
|
|
|
+ if (this.loginStyle != 1 || this.hbArrivalLoading) {
|
|
|
+ return Promise.resolve();
|
|
|
+ }
|
|
|
+ this.hbArrivalLoading = true;
|
|
|
+ return checkArrival({}).then((res) => {
|
|
|
+ const data = res && res.code == 1 ? (res.data || {}) : {};
|
|
|
+ if (Number(data.has) === 1) {
|
|
|
+ this.hbArrivalInfo = data.hb || {};
|
|
|
+ this.hbArrivalIds = Array.isArray(data.hbIds) ? data.hbIds : [];
|
|
|
+ this.hbArrivalShow = true;
|
|
|
+ }
|
|
|
+ }).catch(() => {}).finally(() => {
|
|
|
+ this.hbArrivalLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showMoreOptions(index) {
|
|
|
+ this.activePopupIndex = index;
|
|
|
+ },
|
|
|
+ hideMoreOptions() {
|
|
|
+ this.activePopupIndex = -1;
|
|
|
+ },
|
|
|
+ toPay(item) {
|
|
|
+ this.hideMoreOptions();
|
|
|
+ this.pageTo({
|
|
|
+ url:
|
|
|
+ "/pages/pay/index?account=" +
|
|
|
+ item.shopId +
|
|
|
+ "&hdId=" +
|
|
|
+ item.id +
|
|
|
+ "&hdName=" +
|
|
|
+ item.name +
|
|
|
+ "&store=0&fromType=3",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getRechargeList(item) {
|
|
|
+ this.hideMoreOptions();
|
|
|
+ this.pageTo({
|
|
|
+ url:
|
|
|
+ "/pages/recharge/list?account=" +
|
|
|
+ item.shopId +
|
|
|
+ "&hdId=" +
|
|
|
+ item.id +
|
|
|
+ "&hdName=" +
|
|
|
+ item.name,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toRechargeClear(item) {
|
|
|
+ this.hideMoreOptions();
|
|
|
+ this.recharge(item);
|
|
|
+ },
|
|
|
+ toGrowth(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url:
|
|
|
+ "/pages/user/growthList?account=" +
|
|
|
+ item.shopId +
|
|
|
+ "&hdId=" +
|
|
|
+ item.id +
|
|
|
+ "&hdName=" +
|
|
|
+ item.name,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toIntegral(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url:
|
|
|
+ "/pages/user/integralList?account=" +
|
|
|
+ item.shopId +
|
|
|
+ "&hdId=" +
|
|
|
+ item.id +
|
|
|
+ "&hdName=" +
|
|
|
+ item.name,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ delMyHd(item) {
|
|
|
+ this.hideMoreOptions();
|
|
|
+ this.$util.confirmModal({content:'确认删除该花店?'},() => {
|
|
|
+ delHd({ id: item.id }).then(res => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.$msg("删除成功")
|
|
|
+ this.resetList()
|
|
|
+ this.getMyHdList()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 会员等级文案,接口无字段时默认普通会员
|
|
|
+ */
|
|
|
+ getMemberLevelText(item) {
|
|
|
+ return item.levelName || item.memberName || item.memberLevel || "普通会员";
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 余额按钮标签:负数为待结,其余为余额
|
|
|
+ */
|
|
|
+ getBalanceLabel(item) {
|
|
|
+ return Number(item.balance) < 0 ? "待结" : "余额";
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 余额展示数值
|
|
|
+ */
|
|
|
+ formatBalanceAmount(item) {
|
|
|
+ const balance = Number(item.balance || 0);
|
|
|
+ return parseFloat(Math.abs(balance));
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 进入店铺:跳转可配置的店铺首页
|
|
|
+ */
|
|
|
+ enterShop(item) {
|
|
|
+ if (item.openShop == 0) {
|
|
|
+ this.$msg("已休店");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.bug(item);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 会员权益
|
|
|
+ */
|
|
|
+ goMemberBenefits(item) {
|
|
|
+ this.pageTo({
|
|
|
+ url: "/pages/interest/level?account=" + item.shopId + "&hdId=" + item.id
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 联系客服:打开对应门店聊天
|
|
|
+ */
|
|
|
+ contactService(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/chat/chatPage",
|
|
|
+ success: (res) => {
|
|
|
+ res.eventChannel.emit("acceptDataFromOpenerPage", {
|
|
|
+ shopId: item.shopId,
|
|
|
+ customId: item.customId || "",
|
|
|
+ name: this.user.name || "",
|
|
|
+ avatar: this.user.smallAvatar || "",
|
|
|
+ chatPerson: item.name
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+page {
|
|
|
+ height: 100%;
|
|
|
+ background-color: #f3f4f6;
|
|
|
+}
|
|
|
+
|
|
|
+.page-container {
|
|
|
+ min-height: 100vh;
|
|
|
+ background-color: #f3f4f6;
|
|
|
+ padding-bottom: calc(20upx + env(safe-area-inset-bottom));
|
|
|
+}
|
|
|
+
|
|
|
+// 登录页面样式
|
|
|
+.login-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ min-height: 70vh;
|
|
|
+ padding: 0upx 40upx 40upx 40upx;
|
|
|
+
|
|
|
+ .login-content {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .login-title {
|
|
|
+ display: block;
|
|
|
+ font-size: 48upx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 16upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .login-subtitle {
|
|
|
+ display: block;
|
|
|
+ font-size: 34upx;
|
|
|
+ color: #666;
|
|
|
+ margin-top:50upx;
|
|
|
+ margin-bottom: 60upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .login-btn {
|
|
|
+ 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(255, 107, 107, 0.3);
|
|
|
+
|
|
|
+ &:active {
|
|
|
+ box-shadow: 0 4upx 12upx rgba(255, 107, 107, 0.4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 主要内容区域
|
|
|
+.main-content {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+// 花店列表
|
|
|
+.shop-list {
|
|
|
+ padding: 20upx 24upx 40upx;
|
|
|
+}
|
|
|
+
|
|
|
+// 花店卡片
|
|
|
+.shop-card {
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 24upx;
|
|
|
+ margin-bottom: 24upx;
|
|
|
+ padding: 28upx 28upx 24upx;
|
|
|
+ position: relative;
|
|
|
+ box-shadow: 0 8upx 24upx rgba(15, 23, 42, 0.06);
|
|
|
+
|
|
|
+ .more-btn {
|
|
|
+ position: absolute;
|
|
|
+ top: 24upx;
|
|
|
+ right: 24upx;
|
|
|
+ width: 48upx;
|
|
|
+ height: 48upx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 24upx;
|
|
|
+ background: #f3f4f6;
|
|
|
+ z-index: 2;
|
|
|
+
|
|
|
+ .more-icon {
|
|
|
+ font-size: 32upx;
|
|
|
+ color: #9ca3af;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 1;
|
|
|
+ letter-spacing: 2upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-right: 56upx;
|
|
|
+ margin-bottom: 24upx;
|
|
|
+
|
|
|
+ .shop-avatar {
|
|
|
+ margin-right: 20upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ .shop-logo {
|
|
|
+ width: 96upx;
|
|
|
+ height: 96upx;
|
|
|
+ border-radius: 48upx;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-info {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+
|
|
|
+ .shop-name-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* custom-class 在子组件根节点,需 deep 才能写间距 */
|
|
|
+ .shop-name-row ::v-deep .shop-name-icon {
|
|
|
+ margin-right: 8upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .member-tag ::v-deep .member-crown-icon {
|
|
|
+ margin-right: 4upx;
|
|
|
+ margin-botom: 14upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-name {
|
|
|
+ max-width: 280upx;
|
|
|
+ color: #111827;
|
|
|
+ font-size: 34upx;
|
|
|
+ font-weight: 700;
|
|
|
+ line-height: 1.2;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .member-tag {
|
|
|
+ margin-left: 12upx;
|
|
|
+ padding: 4upx 14upx;
|
|
|
+ border-radius: 20upx;
|
|
|
+ background: #eef9f0;
|
|
|
+ flex-shrink: 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .member-tag-text {
|
|
|
+ color: #1f7a3d;
|
|
|
+ font-size: 22upx;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 1.2;
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-address {
|
|
|
+ display: block;
|
|
|
+ color: #9ca3af;
|
|
|
+ font-size: 24upx;
|
|
|
+ line-height: 1.4;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-main-actions {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn,
|
|
|
+ .enter-btn {
|
|
|
+ flex: 1;
|
|
|
+ min-height: 96upx;
|
|
|
+ border-radius: 16upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn {
|
|
|
+ margin-right: 16upx;
|
|
|
+ background: #ffeef5;
|
|
|
+ }
|
|
|
+
|
|
|
+ .enter-btn {
|
|
|
+ background: #eef9f0;
|
|
|
+
|
|
|
+ &.disabled {
|
|
|
+ opacity: 0.55;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn ::v-deep .action-icon-slot,
|
|
|
+ .enter-btn ::v-deep .action-icon-slot {
|
|
|
+ margin-right: 10upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: baseline;
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn-label {
|
|
|
+ color: #374151;
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-right: 8upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .balance-btn-value {
|
|
|
+ color: #d63384;
|
|
|
+ font-size: 34upx;
|
|
|
+ font-weight: 700;
|
|
|
+ line-height: 1;
|
|
|
+
|
|
|
+ &.negative {
|
|
|
+ color: #ef4444;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .enter-btn-text {
|
|
|
+ color: #1f7a3d;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
+
|
|
|
+ .shop-util-actions {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 快捷按钮:同一排,图标左、文字右 */
|
|
|
+ .util-btn {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ margin-right: 12upx;
|
|
|
+ padding: 14upx 8upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: #f5f6f8;
|
|
|
+ border: 1upx solid #e5e7eb;
|
|
|
+ border-radius: 12upx;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .util-btn ::v-deep .util-btn-icon {
|
|
|
+ margin-right: 6upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .util-btn-text {
|
|
|
+ flex-shrink: 1;
|
|
|
+ min-width: 0;
|
|
|
+ color: #6b7280;
|
|
|
+ font-size: 20upx;
|
|
|
+ line-height: 1.2;
|
|
|
+ text-align: left;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 弹出菜单
|
|
|
+.options-popup {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ z-index: 1000;
|
|
|
+
|
|
|
+ .popup-overlay {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-content {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ background-color: white;
|
|
|
+ border-radius: 20upx;
|
|
|
+ padding: 0;
|
|
|
+ min-width: 500upx;
|
|
|
+ box-shadow: 0 20upx 40upx rgba(0, 0, 0, 0.3);
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ .popup-item {
|
|
|
+ padding: 40upx 50upx;
|
|
|
+ border-bottom: 1upx solid #f0f0f0;
|
|
|
+ text-align: center;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* &:active {
|
|
|
+ background-color: #f8f9fa;
|
|
|
+ } */
|
|
|
+
|
|
|
+ &.cancel {
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ color: #333;
|
|
|
+ font-size: 36upx;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 空状态
|
|
|
+.empty-state {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 100upx 40upx;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .empty-icon {
|
|
|
+ font-size: 120upx;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .empty-title {
|
|
|
+ font-size: 36upx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 12upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .empty-subtitle {
|
|
|
+ font-size: 28upx;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 动画效果
|
|
|
+@keyframes pulse {
|
|
|
+ 0% {
|
|
|
+ transform: scale(1);
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ transform: scale(1.2);
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ transform: scale(1);
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|