123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705 |
- <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
- <member-base :show="true"><view class="div container">
- <title-header />
- <view class="div top-wrapper">
- <view class="nav-bg">
- <image mode="aspectFit" src="../../../static/image/member/bg_wode_com.png" class="img nav-bg-img"></image>
- </view>
- <view class="div nav-item left-nav-item" @click="goSetting()">
- <image mode="aspectFit" src="../../../static/image/member/icon_setting_nor.png" class="img nav-icon">
- </view>
- <view class="div nav-item right-nav-item" @click="goNews()">
- <image mode="aspectFit" src="../../../static/image/member/icon_news_nor.png" class="img nav-icon">
- <text class="span" v-if="0"></text>
- </view>
- <view class="div top-info-wrapper">
- <view class="div avatar-wrapper" @click="goProfileInfo">
- <image mode="aspectFit"
- class="img avatar"
- v-bind:src="user.member_avatar+'?'+time"
- v-if="isOnline && user && user.member_avatar"
- />
- </view>
- <view
- class="p nickname"
- @click="goProfileInfo"
- >{{ nickname }}</view
- >
- <view class="p level_name_wrapper" >
- <view class='level_name'><image mode="aspectFit" src="../../../static/image/member/usertopicon.png" class="img levelname-icon">{{ getlevelname }}</view>
- </view>
- </view>
- <view class="div info-wrapper">
- <view class="div info-item" @click="goPredeposit">
- <view class="div item">预存款</view>
- <view class="div item price">¥{{ getAvailablePredeposit }}</view>
- </view>
- <view class="div info-item" @click="goScoreList">
- <view class="div item">积分</view>
- <view class="div item price">{{ getScore }}</view>
- </view>
- </view>
- </view>
- <flex-line class="order-header" :is-link="true" style="padding-top:2.5rem;margin-top:0;" @click.native="goOrder">
- <text class="span">我的订单</text>
- <text class="span" slot="right">查看全部订单</text>
- </flex-line>
- <view class="div order-wrapper">
- <index-order-item
- class="order-item"
- testAttr="/pages/member/order/OrderList"
- state="state_new"
- :src="require('../../../static/image/member/icon_pay_nor.png')"
- title="待付款"
- :orderNumber="user.order_nopay_count"
- >
- </index-order-item>
- <index-order-item
- class="order-item"
- testAttr="/pages/member/order/OrderList"
- state="state_pay"
- :src="require('../../../static/image/member/icon_goods_nor.png')"
- title="待发货"
- :orderNumber="user.order_noship_count"
- >
- </index-order-item>
- <index-order-item
- class="order-item"
- testAttr="/pages/member/order/OrderList"
- state="state_send"
- :src="require('../../../static/image/member/icon_consignee_nor.png')"
- title="待收货"
- :orderNumber="user.order_noreceipt_count"
- >
- </index-order-item>
- <index-order-item
- class="order-item"
- testAttr="/pages/member/order/OrderList"
- state="state_noeval"
- :src="require('../../../static/image/member/icon_prices_nor.png')"
- title="待评价"
- :orderNumber="user.order_noeval_count"
- >
- </index-order-item>
- </view>
- <flex-line class="order-header">
- <text class="span">常用工具</text>
- </flex-line>
- <view class="div manage-wrapper">
- <index-manage-item
- v-on:onclick="goAccount"
- :src="require('../../../static/image/member/icon_purse_pre.png')"
- title="我的钱包"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goVrOrder"
- :src="require('../../../static/image/member/icon_order_pre.png')"
- title="虚拟订单"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goReturn"
- :src="require('../../../static/image/member/icon_refund_pre.png')"
- title="退款管理"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goFriendList"
- :src="require('../../../static/image/member/icon_friend_pre.png')"
- title="我的好友"
- >
- </index-manage-item>
- <index-manage-item
- v-if="config && config.instant_message_open == '1' && config.instant_message_gateway_url"
- v-on:onclick="goMemberChatList"
- :src="require('../../../static/image/member/icon_list_pre.png')"
- title="聊天列表"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goNavigate('/pages/member/auth/Auth')"
- :src="require('../../../static/image/member/icon_testimony_pre.png')"
- title="实名认证"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goFavourite()"
- :src="require('../../../static/image/member/icon_collect_pre.png')"
- title="我的收藏"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goNavigate('/pages/member/consult/ConsultList')"
- :src="require('../../../static/image/member/icon_consult_pre.png')"
- title="咨询管理"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goNavigate('/pages/member/inform/InformList')"
- :src="require('../../../static/image/member/icon_offence_pre.png')"
- title="举报管理"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goNavigate('/pages/member/complaint/ComplaintList')"
- :src="require('../../../static/image/member/icon_propose_pre.png')"
- title="投诉管理"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goInvoice"
- :src="require('../../../static/image/member/icon_invoice_pre.png')"
- title="发票管理"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goAddress"
- :src="require('../../../static/image/member/icon_address_pre.png')"
- title="收货地址"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goEvaluateList()"
- :src="require('../../../static/image/member/icon_judgea_pre.png')"
- title="我的评价"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goArrivalnotice()"
- :src="require('../../../static/image/member/icon_notify_pre.png')"
- title="到货通知"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goBrowse()"
- :src="require('../../../static/image/member/icon_footprint_pre.png')"
- title="浏览记录"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="goMemberFeedback()"
- :src="require('../../../static/image/member/icon_feedback_pre.png')"
- title="反馈意见"
- >
- </index-manage-item>
- </view>
- <flex-line class="order-header">
- <text class="span">我的活动</text>
- </flex-line>
- <view class="div manage-wrapper">
- <index-manage-item
- v-on:onclick="goMarketmanagelog()"
- :src="require('../../../static/image/member/icon_exercise_pre.png')"
- title="活动记录"
- >
- </index-manage-item>
- <index-manage-item
- v-on:onclick="gBargain()"
- :src="require('../../../static/image/member/icon_bargain_pre.png')"
- title="砍价活动"
- >
- </index-manage-item>
- <index-manage-item
- v-if="config.points_isuse === '1' && config.points_signin_isuse === '1'"
- v-on:onclick="goNavigate('/pages/member/point/PointSignin')"
- :src="require('../../../static/image/member/icon_signin_pre.png')"
- title="我要签到"
- >
- </index-manage-item>
- <index-manage-item
- v-if="config.inviter_open === '1'"
- v-on:onclick="goMemberInviterManage()"
- :src="require('../../../static/image/member/icon_popularize_pre.png')"
- title="推广管理"
- >
- </index-manage-item>
- </view>
- <view class="div bottom-wrapper" v-if="!user.store_id && config && config.store_joinin_open!=0">
- <flex-line
- @click.native="goSellerJoinin"
- :is-link="true"
- >
- <image mode="aspectFit" class="img item-icon" src="../../../static/image/member/icon_shop_seller_nor.png" />
- <text class="span">商家入驻</text>
- </flex-line>
- </view>
- <view class="block-wrapper">
- <guess-like></guess-like>
- </view>
- </view></member-base>
- </template>
- <script>
- import {getFontSize} from '@/util/common'
- import TitleHeader from '../../TitleHeader'
- import { urlencode } from '@/util/common'
- import MemberBase from '../MemberBase'
- import IndexOrderItem from './IndexOrderItem'
- import IndexManageItem from './IndexManageItem'
- import flexLine from '../../flexLine'
- import GuessLike from '../../GuessLike'
- import { mapState, mapActions , mapMutations} from 'vuex'
- import { getMemberIndex } from '../../../api/member'
- import { checkInviter } from '../../../api/memberInviter'
- export default {
- name:'MemberIndex',
- data () {
- return {
- user: {},
- time: '',
- orderCount: {},
- isShow: true
- }
- },
- components:{
- TitleHeader,
- MemberBase,
- flexLine,
- IndexOrderItem,
- IndexManageItem,
- GuessLike
- },
- created: function () {
- this.time = new Date().getTime()
- this.fetchConfig({}).then(
- response => {
- },
- error => {
- uni.showToast({icon:'none',title: error.message})
- }
- )
- if (this.isOnline) {
- getMemberIndex().then(
- response => {
- if (response && response.result.member_info) {
- this.user = response.result.member_info
- // 更新用户信息缓存
- this.memberUpdate({info:response.result.member_info})
- }
- },
- error => {}
- )
- }
- },
- computed:{
- fontSize(){
- return getFontSize()
- },
- ...mapState({
- isOnline: state => state.member.isOnline,
- config: state => state.config.config
- }),
- nickname () {
- let title = '登录/注册'
- if (this.isOnline) {
- if (
- this.user &&
- typeof this.user !== 'undefined' &&
- JSON.stringify(this.user) !== '{}'
- ) {
- title = this.user.member_nickname
- }
- }
- return title
- },
- getScore () {
- let score = '0'
- if (this.isOnline && this.user.member_points) {
- score = this.user.member_points
- }
- return score
- },
- // 预存款可用金额 通过store 进行获取
- getAvailablePredeposit () {
- let availablePredeposit = '0.00'
- if (this.isOnline && this.user.available_predeposit) {
- availablePredeposit = this.user.available_predeposit
- }
- return availablePredeposit
- },
- getlevelname () {
- let levelname = ''
- if (this.isOnline && this.user.level_name) {
- levelname = this.user.level_name
- }
- return levelname
- }
- },
- methods:{
- ...mapMutations({
- memberUpdate: 'memberUpdate',
- }),
- goNavigate(path,query=false){
- uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
- },
- ...mapActions({
- fetchConfig: 'fetchConfig'
- }),
- showLogin () {
- uni.navigateTo({ url: '/pages/home/memberlogin/Login' })
- },
- goScoreList () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/point/PointList'+'?'+urlencode( { index: 0 } )})
- } else {
- this.showLogin()
- }
- },
- goOrder () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/order/OrderList'
- })
- } else {
- this.showLogin()
- }
- },
- goProfileInfo () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/profile/ProfileSet' })
- } else {
- this.showLogin()
- }
- },
- goSetting () {
- uni.navigateTo({ url: '/pages/member/setting/AccountSet' })
- },
- // 消息通知
- goNews () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/notice/NoticeList' })
- } else {
- this.showLogin()
- }
- },
- // 我的关注
- goFavourite () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/favorite/Favorite' })
- } else {
- this.showLogin()
- }
- },
- // 我的地址
- goAddress () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/address/AddressList' })
- } else {
- this.showLogin()
- }
- },
- // 我的退款
- goReturn () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/orderreturn/Orderreturn' })
- } else {
- this.showLogin()
- }
- },
- goAccount () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/account/Account' })
- } else {
- this.showLogin()
- }
- },
- goPredeposit () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/predeposit/PredepositList' })
- } else {
- this.showLogin()
- }
- },
- // 我的好友列表
- goFriendList () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/friend/FriendList' })
- } else {
- this.showLogin()
- }
- },
- // 商家入驻
- goSellerJoinin () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/sellerjoinin/Step1' })
- } else {
- this.showLogin()
- }
- },
- // 聊天列表
- goMemberChatList () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/chat/ChatList' })
- } else {
- this.showLogin()
- }
- },
- // 我的订单评价
- goEvaluateList () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/evaluate/EvaluateList' })
- } else {
- this.showLogin()
- }
- },
- // 发票管理
- goInvoice () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/invoice/InvoiceList' })
- } else {
- this.showLogin()
- }
- },
- // 跳转卖家管理中心
- goSellerInfo () {
- if (this.isOnline) {
- uni.navigateTo({ url: 'SellerIndex' })
- } else {
- this.showLogin()
- }
- },
- // 分销管理中心
- goMemberInviterManage () {
- if (this.isOnline) {
- checkInviter().then(res => {
- uni.navigateTo({ url: '/pages/member/inviter/InviterManage' })
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- } else {
- this.showLogin()
- }
- },
- // 意见反馈
- goMemberFeedback () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/feedback/Feedback' })
- } else {
- this.showLogin()
- }
- },
- // 虚拟订单
- goVrOrder () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/vrorder/OrderList' })
- } else {
- this.showLogin()
- }
- },
- // 活动记录
- goMarketmanagelog () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/marketmanagelog/Marketmanagelog' })
- } else {
- this.showLogin()
- }
- },
- // 砍价活动
- gBargain () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/bargain/Bargainlist' })
- } else {
- this.showLogin()
- }
- },
- // 到货通知
- goArrivalnotice () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/arrivalnotice/Arrivalnotice' })
- } else {
- this.showLogin()
- }
- },
- // 浏览历史
- goBrowse () {
- if (this.isOnline) {
- uni.navigateTo({ url: '/pages/member/browse/BrowseList' })
- } else {
- this.showLogin()
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .container {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: stretch;
- background-color: #f0f2f5;
- .top-wrapper {
- position:relative;
- height: 11.5rem;
- .nav-bg{
- width: 100%;
- height: 11.5rem;
- position: absolute;
- overflow: hidden;
- .nav-bg-img{
- width: 100%;
- height: 14.3rem;
- }
- }
- .top-info-wrapper {
- flex: 1;
- width: 100%;
- text-align: center;
- }
- }
- .nav-item {
- position: absolute;
- display: flex;
- justify-content: center;
- align-items: center;
- top:0.5rem;
- .span {
- width: 0.4rem;
- height: 0.4rem;
- background-color: #f0f2f5;
- border-radius: 50%;
- position: absolute;
- top: 0.5rem;
- right: 0.5rem;
- }
- }
- .left-nav-item {
- left: 0.5rem;
- }
- .right-nav-item {
- right: 0.5rem;
- }
- .nav-icon {
- width: 1.3rem;
- height: 1.3rem;
- text-align: center;
- color: #fff;
- }
- .avatar-wrapper {
- position:relative;
- width: 4.4rem;
- height: 4.4rem;
- border-radius: 50%;
- background-color: #fff;
- margin:0 auto;
- margin-top: 1rem;
- .avatar {
- width: 4rem;
- height: 4rem;
- border-radius: 50%;
- position:absolute;
- top:.2rem;
- left:.2rem;
- }
- }
- .nickname {
- width: 100%;
- margin-top: 0.75rem;
- font-size: $subFontSize;
- color: rgba(255, 255, 255, 1);
- text-align: center;
- margin-left: 0;
- margin-right: 0;
- }
- .level_name_wrapper{
- font-size: .6rem;
- color: rgba(255, 255, 255, 1);
- text-align: center;
- margin-left: 0;
- margin-right: 0;
- border-radius: .2rem;
- border: 1px solid #fff;
- display: inline-block;
- padding: 0.1rem .2rem;
- }
- .level_name{
- display: flex;
- align-items: center;
- }
- .levelname-icon{
- width: 1rem;
- height: .6rem;
- padding-right: .2rem;
- }
- .info-wrapper {
- position: absolute;
- bottom:-2rem;
- left:1.5rem;
- right:1.5rem;
- display: inline-flex;
- flex-direction: row;
- justify-content: flex-start;
- align-content: stretch;
- background-color: #fff;
- border-radius: .4rem;
- box-shadow: 0px 4px 4px #f7f7f7;
- z-index: 2;
- }
- .info-item {
- flex: 1;
- text-align: center;
- font-size: $h2;
- color:$formInputColor;
- position: relative;
- &:first-child::after{content:'';position: absolute;top:.5rem;bottom:.5rem;right:0;border-right: 1px dashed #eee;}
- .item{padding-top:.5rem;}
- .price{color:$primaryColor;padding-bottom:.5rem;font-size: 1.1rem;}
- }
- .order-header {
- background-color: #fff;
- padding:0 $pageSpace;
- margin-top:$modelSpace;
- }
- .item-title {
- font-size: $subFontSize;
- color: $formInputColor;
- font-weight:700;
- }
- .order-subtitle {
- font-size: $fontSize;
- color: $descTextColor;
- }
- .order-wrapper {
- height: 4rem;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: stretch;
- background-color: #fff;
- }
- .order-item {
- flex: 1;
- }
- .block-wrapper{
- margin-top:$modelSpace;
- }
- .bottom-wrapper {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: stretch;
- margin-top:$modelSpace;
- background: #fff;
- padding:0 $pageSpace;
- .item-icon{
- width:1.2rem;
- height:1.2rem;
- margin-right: .4rem;
- }
- }
- .manage-wrapper {
- background: #fff;
- }
- }
- </style>
|