Files
lucky_shop/pages_tool/member/invite_friends.vue
ZF sun 2d8846c64c feat: 新增多语言文案、优化导航及工具函数,修复部分业务逻辑
1. 新增多语言资源文件,覆盖文章、预约日期、会员信息、优惠券、表单、购物车、积分商城、分销、AI聊天等多个模块
2. 优化底部导航组件,使用多语言配置替代硬编码文案
3. 重构工具函数,新增从后端数据提取多语言文案的工具方法
4. 修复邀请好友页面的保存提示文案,替换为多语言版本
5. 修复商品SKU组件的提示文案,使用多语言配置
6. 重构AI聊天页面的帮助文档和回复模板,使用多语言配置
7. 优化空状态组件,支持多语言默认文案
8. 修复跳转逻辑,补全参数传递
9. 新增本地开发环境配置
2026-06-25 18:15:31 +08:00

279 lines
9.8 KiB
Vue

<template>
<view :style="themeColor">
<view v-if="info" style="background-color: #fff;">
<view class="invite_adv">
<image :src="$util.img('public/uniapp/member/invite/top_bg.png')" mode="widthFix"></image>
<view class="desc" @click="openRulePopup" v-if="info.remark != ''">
<text class="iconfont icon-bangzhu"></text>
{{ $lang('activityDescription') }}
</view>
<image class="font" :src="$util.img('public/uniapp/member/invite/top_font.png')" mode="widthFix" show-menu-by-longpress />
<view class="time">
{{ $lang('activityTime', { startTime: $util.timeStampTurnTime(info.start_time, 1), endTime: $util.timeStampTurnTime(info.end_time, 1) }) }}
</view>
<view class="btn" :style="{ 'background-image': 'url(' + $util.img('public/uniapp/member/invite/top_btn.png') + ')' }" @click="openSharePopup">{{ $lang('inviteNow') }}</view>
</view>
<view class="content invite-list">
<view class="title">{{ $lang('myFriends') }}</view>
<block v-if="inviteList.length > 0">
<view class="invitelist_block">
<view class="invitelist">
<view class="list-item" v-for="(item, index) in inviteList" :key="index">
<view class="img color-base-border">
<image mode="aspectFit" :src="item.headimg == '' ? $util.img($util.getDefaultImage().head) : $util.img(item.headimg)" show-menu-by-longpress />
</view>
<view class="list-left">
<view class="info">
<view class="name font-size-tag">{{ item.source_member_nickname }}</view>
<view class="time font-size-activity-tag color-tip">
{{ $util.timeStampTurnTime(item.create_time) }}
</view>
</view>
<view class="prize color-base-text font-size-activity-tag">
<block v-if="item.balance > 0">{{ $lang('cashRedPacketAmount', { amount: item.balance }) }}</block>
<block v-if="(item.point > 0 || item.coupon_num) && item.balance > 0">+</block>
<block v-if="item.point > 0">{{ $lang('pointsAmount', { amount: parseInt(item.point) }) }}</block>
<block v-if="item.point > 0 && item.balance > 0 && item.coupon_num > 0">+
</block>
<block v-if="item.coupon_num > 0">{{ $lang('couponsAmount', { count: item.coupon_num }) }}</block>
</view>
</view>
</view>
</view>
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="isClick && total_num > page">
{{ $lang('viewMore') }}
<text class="iconfont icon-iconangledown"></text>
</view>
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="!isClick && inviteList.length > 5 && total_num <= page">{{ $lang('noMoreData') }}</view>
</view>
</block>
<block v-else>
<view class="empty">
<view class="tip">{{ $lang('noInvitedFriendsTip') }}</view>
<view class="tip">{{ $lang('inviteTip') }}</view>
</view>
</block>
</view>
<view class="content">
<view class="title">{{ $lang('inviteRewards') }}</view>
<view class="invite_active">
<view class="list">
<view class="item" v-if="$util.inArray('balance', info.type) != -1">
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
<view class="desc">
<view class="price">
<text class="font-size-base">{{ $lang('common.currencySymbol') }}</text>
<text>{{ info.balance }}</text>
</view>
<view class="type">{{ $lang('cashRedPacket') }}</view>
</view>
</view>
<view class="item" v-if="$util.inArray('point', info.type) != -1">
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
<view class="desc">
<view class="price">
<text>{{ parseInt(info.point) }}</text>
</view>
<view class="type">{{ $lang('points') }}</view>
</view>
</view>
<view class="item margin_right_none" v-if="$util.inArray('coupon', info.type) != -1">
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill">
</image>
<view class="desc">
<view class="price">
<text>{{ info.coupon.split(',').length }}</text>
{{ $lang('couponUnit') }}
</view>
<view class="type">{{ $lang('coupon') }}</view>
</view>
</view>
</view>
<view class="desc">
<view class="title_desc color-tip">{{ $lang('shareDesc') }}</view>
<view class="desc_list">
<view class="" v-if="$util.inArray('balance', info.type) != -1">
<text>●</text>
{{ $lang('balanceReward', { amount: info.balance }) }}
</view>
<view class="" v-if="$util.inArray('point', info.type) != -1">
<text>●</text>
{{ $lang('pointReward', { amount: info.point }) }}
</view>
<view class="" v-if="$util.inArray('coupon', info.type) != -1">
<text>●</text>
{{ $lang('couponReward', { count: info.coupon.split(',').length }) }}
</view>
<view class="" v-if="info.max_fetch == 0">
<text>●</text>
{{ $lang('unlimitedReward') }}
</view>
<view class="" v-else>
<text>●</text>
{{ $lang('rewardLimit', { max: info.max_fetch }) }}
</view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="title">{{ $lang('howToInvite') }}</view>
<view class="invite_active">
<view class="step">
<view>
<view class="img">
<image :src="$util.img('public/uniapp/member/invite/fenxiang.png')" mode="aspectFit" show-menu-by-longpress />
</view>
<view class="text">{{ $lang('stepShareLink') }}</view>
</view>
<view>
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
</view>
<view>
<view class="img">
<image :src="$util.img('public/uniapp/member/invite/shouji.png')" mode="aspectFit" show-menu-by-longpress />
</view>
<view class="text">{{ $lang('stepFriendEnter') }}</view>
</view>
<view>
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
</view>
<view>
<view class="img">
<image :src="$util.img('public/uniapp/member/invite/hongbao.png')" mode="aspectFit" show-menu-by-longpress />
</view>
<view class="text">{{ $lang('stepFriendRegister') }}</view>
</view>
</view>
</view>
</view>
<!-- 海报 -->
<view @touchmove.prevent.stop>
<uni-popup ref="posterPopup" type="bottom" class="poster-layer">
<template v-if="poster != '-1'">
<view>
<view class="image-wrap">
<image :src="$util.img(poster)" mode="widthFix" show-menu-by-longpress />
</view>
<!-- #ifdef MP || APP-PLUS -->
<view class="save" @click="savePoster()">{{ $lang('saveImage') }}</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="save">{{ $lang('longPressSaveImage') }}</view>
<!-- #endif -->
</view>
<view class="close iconfont icon-close" @click="closePosterPopup()"></view>
</template>
<view v-else class="msg">{{ posterMsg }}</view>
</uni-popup>
</view>
<!-- 分享弹窗 -->
<view @touchmove.prevent.stop>
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
<view>
<view class="share-title">{{ $lang('share') }}</view>
<view class="share-content">
<!-- #ifdef MP -->
<view class="share-box">
<button class="share-btn" :plain="true" open-type="share">
<view class="iconfont icon-share-friend"></view>
<text>{{ $lang('shareToFriends') }}</text>
</button>
</view>
<!-- #endif -->
<view class="share-box" @click="openPosterPopup">
<button class="share-btn" :plain="true">
<view class="iconfont icon-pengyouquan"></view>
<text>{{ $lang('generatePoster') }}</text>
</button>
</view>
<!-- #ifdef H5 -->
<view class="share-box" @click="copyUrl">
<button class="share-btn" :plain="true">
<view class="iconfont icon-fuzhilianjie"></view>
<text>{{ $lang('copyLink') }}</text>
</button>
</view>
<!-- #endif -->
</view>
<view class="share-footer" @click="closeSharePopup"><text>{{ $lang('cancelShare') }}</text></view>
</view>
</uni-popup>
</view>
<!-- 弹出规则 -->
<view @touchmove.prevent.stop>
<uni-popup ref="rulePopup" type="bottom">
<view class="tips-layer">
<view class="head" @click="closeRulePopup()">
<view class="title">{{ $lang('activityDescription') }}</view>
<text class="iconfont icon-close"></text>
</view>
<view class="body">
<view class="detail margin-bottom">{{ info.remark }}</view>
</view>
</view>
</uni-popup>
</view>
</view>
<ns-empty v-else :text="$lang('noData')"></ns-empty>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import inviteFriends from './public/js/invite_friends.js';
export default {
data() {
return {
inviteList: [],
info: null,
page: 1,
page_size: 5,
total_num: 0,
isClick: true,
poster: '-1', //海报
posterMsg: '' //海报错误信息
};
},
onLoad(option) {
this.getBaseInfo();
if (this.storeToken) {
this.getList();
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages_tool/member/invite_friends');
});
}
},
onShow() {},
mixins: [inviteFriends],
onReady() {}
};
</script>
<style lang="scss">
@import './public/css/invite_friends.scss';
</style>
<style lang="scss" scoped>
::v-deep .uni-popup__wrapper.bottom {
border-radius: 24rpx 24rpx 0 0;
}
</style>
<style scoped>
.poster-layer>>>.uni-popup__wrapper-box {
max-height: initial !important;
}
</style>