1116 lines
33 KiB
Vue
1116 lines
33 KiB
Vue
<template>
|
||
<view class="user">
|
||
<hx-navbar
|
||
title="云南香道滇官方商城"
|
||
:fixed="true"
|
||
:back="false"
|
||
:left-slot="false"
|
||
:right-slot="false"
|
||
statusBarFontColor="#ffffff"
|
||
color="#333333"
|
||
:bgImgHeight="bgImgHeight"
|
||
:background-color="[246,246,246]"
|
||
/>
|
||
|
||
<view v-if="$store.getters.token||userInfo.uid" class="acea-row row-column" style="background: #f6f6f6;">
|
||
|
||
<view class="header acea-row row-column"
|
||
style="flex-wrap: nowrap;background: #fff !important;margin: 0 30rpx;border-radius: 16rpx;box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.1);">
|
||
<view v-if="userInfo.hotel != null && userInfo.hotel.checkState=='C1'"
|
||
class="innTag acea-row row-middle row-center align-left" @click="innTagClick">
|
||
<image style="width: 36rpx;height: 36rpx;" :src="webUrl+'/20230304133702462853.png'" mode=""></image>
|
||
<text style="font-size: 24rpx;color: #ffffff;">店铺主页</text>
|
||
</view>
|
||
<view class="acea-row row-between-wrapper"
|
||
style="margin-top: 40rpx;background: #0DC5C5 !important;border-top-left-radius: 16rpx;border-top-right-radius: 16rpx;padding: 30rpx;">
|
||
<view class="picTxt acea-row" style="flex-wrap: nowrap;flex: 1;">
|
||
<view class="pictrue">
|
||
<image :src="userInfo.avatar"/>
|
||
</view>
|
||
<view class="text acea-row row-column-between">
|
||
<view class="acea-row row-middle">
|
||
<view class="name line1"
|
||
style="color: #000000 !important;font-size: 28rpx !important;font-weight: 500;">
|
||
{{ userInfo.nickname }}
|
||
</view>
|
||
<view class="member acea-row row-middle" v-if="userInfo.vip">
|
||
<image :src="userInfo.vipIcon"/>
|
||
<text>{{ userInfo.vipName }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-middle" style="margin-top: 8rpx;">
|
||
<view class="vip-box acea-row row-center row-middle">
|
||
|
||
<text class="vip-title">{{ userInfo.levelName }}</text>
|
||
|
||
</view>
|
||
<view v-if="userLevelInfo && userLevelInfo.idcardOne && userLevelInfo.checkState!=3"
|
||
class="protocol-state-box">
|
||
{{ protocolCheckState(userLevelInfo.checkState) }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-column row-middle" style="flex-shrink: 0;">
|
||
<view class="promotion-code-box acea-row row-center row-middle" @click="goPromotionPoster()">
|
||
<image style="width: 48rpx;height: 48rpx;" :src="webUrl+'/20210819110607117638.png'" mode=""></image>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-middle row-around"
|
||
style="padding:0 30rpx 30rpx 30rpx;margin-bottom: 20rpx;background: #0DC5C5 !important;border-bottom-left-radius: 16rpx;border-bottom-right-radius: 16rpx">
|
||
<view class="acea-row row-middle" @click="goBindParent()">
|
||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20210515195227226132.png'"
|
||
mode=""></image>
|
||
<text style="font-size: 24rpx;color: #fff;">扫一扫</text>
|
||
</view>
|
||
<view class="vline"></view>
|
||
<view class="acea-row row-middle" @click="goLikeList()">
|
||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20230304134637330341.png'"
|
||
mode=""></image>
|
||
<text style="font-size: 24rpx;color: #fff;">收藏</text>
|
||
</view>
|
||
<view class="vline"></view>
|
||
<view class="acea-row row-middle" style="position: relative;" @click="goMessageData()">
|
||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20230304135730954990.png'"
|
||
mode=""></image>
|
||
<text style="font-size: 24rpx;color: #fff;">消息</text>
|
||
<view v-if="unreadMsgList.length>0" class="unread-dot"></view>
|
||
</view>
|
||
<view class="vline"></view>
|
||
<view class="acea-row row-middle" @click="goPersonalData()">
|
||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20230304203605140668.png'"
|
||
mode=""></image>
|
||
<text style="font-size: 24rpx;color: #fff;">设置</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-column" style="border-bottom-left-radius: 16rpx;border-bottom-right-radius: 16rpx;">
|
||
<view class="title acea-row row-middle" style="border-bottom: 1px solid #f6f6f6;padding: 10rpx 0;">
|
||
<text style="width: 6rpx;background: #FF564A;height: 28rpx;border-radius: 3rpx;margin-right:10rpx;"></text>
|
||
<text style="font-size: 26rpx;color: #333333;font-weight: 400;">我的账户</text>
|
||
</view>
|
||
|
||
<view class="nav acea-row row-column" style="padding: 25rpx;">
|
||
<view class="acea-row row-middle row-between"
|
||
style="padding-bottom: 30rpx;margin-bottom: 20rpx;border-bottom: 1px solid #f6f6f6;">
|
||
<view @click="goUserAccount()" class="acea-row row-middle" style="flex-grow: 1;">
|
||
<view class="acea-row row-middle" style="margin-right: 20rpx;">
|
||
<image style="width: 40rpx;height: 40rpx;" :src="webUrl+'/20210807160248159814.png'" mode=""></image>
|
||
</view>
|
||
<view class="acea-row row-column">
|
||
<text style="color: #999999;font-size: 20rpx;font-weight: 400;">余额</text>
|
||
<text class="num" style="color: #000000;font-size: 28rpx;font-weight: 500;">
|
||
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
||
</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-middle" style="color: #fff;font-size: 24rpx;flex-shrink: 0;">
|
||
<view @click="goWithdrawl()" class="withdrawBtn" style="margin-right: 10rpx;">提现</view>
|
||
<view @click="goAccountDetail()" class="accountDetailBtn">账户明细</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="acea-row row-middle row-between">
|
||
<view class="acea-row row-middle">
|
||
|
||
<view class="acea-row row-middle" style="margin-right: 20rpx;">
|
||
<image style="width: 40rpx;height: 40rpx;" :src="webUrl+'/20210807160409159991.png'" mode=""></image>
|
||
</view>
|
||
<view class="acea-row row-column">
|
||
<text style="color: #999999;font-size: 20rpx;font-weight: 400;">恭喜你成为了{{ userInfo.levelName }}
|
||
</text>
|
||
<text class="num" style="color: #000000;font-size: 28rpx;font-weight: 500;">
|
||
当前等级:{{ userInfo.level }}
|
||
</text>
|
||
</view>
|
||
</view>
|
||
<view class="acea-row row-middle" style="color: #fff;font-size: 24rpx;">
|
||
<view @click="showUpgradeIntro()" class="benifitIntroBtn">权益说明</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="wrapper" style="margin-top: 20rpx !important;margin-bottom: 30rpx !important;">
|
||
<view class="myOrder">
|
||
<view class="title acea-row row-between-wrapper">
|
||
<view class="acea-row row-middle">
|
||
<text
|
||
style="width: 6rpx;background: #FF564A;height: 28rpx;border-radius: 3rpx;margin-right:10rpx;"></text>
|
||
<text style="font-size: 26rpx;color: #333333;font-weight: 400;">我的订单</text>
|
||
</view>
|
||
<text @click="goMyOrder(0)" class="allOrder">
|
||
<text>全部订单</text>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</text>
|
||
</view>
|
||
<view class="orderState acea-row row-middle">
|
||
<view @click="goMyOrder(1)" class="item">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20230526120059732570.png'"/>
|
||
<text
|
||
class="order-status-num"
|
||
v-if="orderStatusNum.unpaidCount > 0"
|
||
>{{ orderStatusNum.unpaidCount }}
|
||
</text>
|
||
</view>
|
||
<view>待付款</view>
|
||
</view>
|
||
<view @click="goMyOrder(2)" class="item">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20230526120053924703.png'"/>
|
||
<text
|
||
class="order-status-num"
|
||
v-if="orderStatusNum.unshippedCount > 0"
|
||
>{{ orderStatusNum.unshippedCount }}
|
||
</text>
|
||
</view>
|
||
<view>待发货</view>
|
||
</view>
|
||
<view @click="goMyOrder(3)" class="item">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20230526120107983364.png'"/>
|
||
<text
|
||
class="order-status-num"
|
||
v-if="orderStatusNum.receivedCount > 0"
|
||
>{{ orderStatusNum.receivedCount }}
|
||
</text>
|
||
</view>
|
||
<text>待收货/核销</text>
|
||
</view>
|
||
<view @click="goMyOrder(4)" class="item">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20230526114414134581.png'"/>
|
||
<text
|
||
class="order-status-num"
|
||
v-if="orderStatusNum.evaluatedCount > 0"
|
||
>{{ orderStatusNum.evaluatedCount }}
|
||
</text>
|
||
</view>
|
||
<text>待评价</text>
|
||
</view>
|
||
<view @click="goReturnList()" class="item">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20230304203355905710.png'"/>
|
||
<text
|
||
class="order-status-num"
|
||
v-if="orderStatusNum.refundCount > 0"
|
||
>{{ orderStatusNum.refundCount }}
|
||
</text>
|
||
</view>
|
||
<text>售后/退款</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 我的服务开始 -->
|
||
<view class="myService" style="margin-top: 30rpx !important;">
|
||
<view class="title acea-row row-middle" style="border-bottom: 1px solid #f6f6f6;padding: 10rpx 0;">
|
||
<text
|
||
style="width: 6rpx;background: #FF564A;height: 28rpx;border-radius: 3rpx;margin-right:10rpx;margin-left: 30rpx;"></text>
|
||
<text style="font-size: 26rpx;color:#333333;font-weight: 400;">所有功能</text>
|
||
</view>
|
||
<view class="serviceList acea-row row-middle">
|
||
|
||
<view class="item" @click="goGroupManage()">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20221010165555111608.png'"/>
|
||
</view>
|
||
<view class="cell">团队管理</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
|
||
<view class="item" @click="goAddressManage()">
|
||
<view class="pictrue" style="margin-left: -6rpx;">
|
||
<image :src="webUrl+'/20221010165951067571.png'"/>
|
||
</view>
|
||
<view class="cell">物流地址管理</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
|
||
<view class="item" @click="goBankcardManage()">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20221010165555111608.png'"/>
|
||
</view>
|
||
<view class="cell">银行卡管理</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
|
||
<view v-if="userInfo.hotel==null || userInfo.hotel.checkState!='C1'" class="item" @click="goInnApply()">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20221010170138874734.png'"/>
|
||
</view>
|
||
<view class="cell acea-row row-between row-middle" style="flex-wrap: nowrap;">
|
||
<view class="" style="flex-shrink: 0;margin-right: 10rpx;">申请我的店铺</view>
|
||
<view v-if="userInfo.hotel!=null" class="acea-row row-column row-right" style="text-align: right;">
|
||
<view class="" style="font-size: 24rpx;color: #0DC5C5;">
|
||
{{ checkStateStr(userInfo.hotel.checkState) }}
|
||
</view>
|
||
|
||
<block v-if="userInfo.hotel.checkState=='C2' && userInfo.hotel.checkMsg.length>0">
|
||
<text style="font-size: 24rpx;color: #aaa;">驳回原因:{{ userInfo.hotel.checkMsg }}</text>
|
||
</block>
|
||
</view>
|
||
|
||
</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
|
||
<view v-if="userInfo.hotel != null && userInfo.hotel.checkState=='C1'" class="item"
|
||
@click="goInnInfoEdit()">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20221010170138874734.png'"/>
|
||
</view>
|
||
<view class="cell">
|
||
<view class="">修改店铺信息</view>
|
||
</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
|
||
<view class="item" @click="goRoomLogs()">
|
||
<view class="pictrue">
|
||
<image :src="webUrl+'/20221010170316834157.png'"/>
|
||
</view>
|
||
<view class="cell">客服历史会话</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
<!-- <template v-for="(item, MyMenusIndex) in MyMenus">
|
||
<view
|
||
class="item"
|
||
:key="MyMenusIndex"
|
||
@click="goPages(MyMenusIndex)"
|
||
>
|
||
<view class="pictrue">
|
||
<image :src="item.pic" />
|
||
</view>
|
||
<view class="cell">{{ item.name }}</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view>
|
||
</template> -->
|
||
|
||
|
||
<!-- <view class="item" @click="goPages2()">
|
||
<view class="pictrue"></view>
|
||
<view class="cell">hexiao</view>
|
||
<text class="iconfont icon-jiantou"></text>
|
||
</view> -->
|
||
</view>
|
||
</view>
|
||
<!-- 我的服务结束 -->
|
||
|
||
</view>
|
||
<!-- <view class="by">
|
||
<view>
|
||
<text class="by-text">www.yixiang.co提供技术支持</text>
|
||
</view>
|
||
</view> -->
|
||
</view>
|
||
<uni-popup ref="popup" type="center">
|
||
<!-- <view class="acea-row row-column row-middle" style="position: relative;background-color: #fff;width: 440rpx;border-radius: 20rpx;"> -->
|
||
<view class="acea-row row-column row-middle"
|
||
style="position: relative;background-color: #fff;border-radius: 20rpx;">
|
||
<view class="acea-row row-center" style="border-radius: 50%;margin-top: -52rpx;background-color: #fff;">
|
||
<image :src="userInfo.avatar" mode=""
|
||
style="width: 96rpx;height: 96rpx;border-radius: 50%;margin: 8rpx;"></image>
|
||
</view>
|
||
<view class="acea-row row-column row-center" style="margin-top: 20rpx;margin-bottom: 40rpx;">
|
||
<text style="text-align: center;">{{ userInfo.nickname }}</text>
|
||
<image :src="spreadPoster.wap_poster" mode="" style="width: 512rpx;height: 512rpx;"></image>
|
||
</view>
|
||
</view>
|
||
|
||
</uni-popup>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import {mapGetters, mapMutations} from "vuex";
|
||
import {
|
||
bindingPhone,
|
||
getMenuUser,
|
||
getSpreadImg,
|
||
getUserInfo,
|
||
getUserLevelInfo,
|
||
noticeList,
|
||
userBindParent
|
||
} from "@/api/user";
|
||
import {isWeixin} from "@/utils";
|
||
import cookie from "@/utils/store/cookie";
|
||
|
||
const NAME = "User";
|
||
var that;
|
||
export default {
|
||
name: NAME,
|
||
props: {},
|
||
data: function () {
|
||
return {
|
||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||
MyMenus: [],
|
||
switchActive: false,
|
||
isWeixin: false,
|
||
isInnOwer: false,//是否是客栈主
|
||
bgImgHeight: '20px',
|
||
userLevelInfo: null,
|
||
unreadMsgList: [],
|
||
orderStatusNum: {
|
||
"completeCount": 0,
|
||
"evaluatedCount": 0,
|
||
"orderCount": 0,
|
||
"receivedCount": 0,
|
||
"refundCount": 0,
|
||
"sumPrice": 0,
|
||
"unpaidCount": 0,
|
||
"unshippedCount": 0
|
||
},
|
||
spreadPoster: {}
|
||
};
|
||
},
|
||
computed: mapGetters(["userInfo"]),
|
||
onLoad: function (e) {
|
||
that = this;
|
||
uni.getSystemInfo({
|
||
success: (e) => {
|
||
// this.compareVersion(e.SDKVersion, '2.5.0')
|
||
let statusBar = 0;
|
||
let customBar = 0;
|
||
|
||
// #ifdef MP
|
||
statusBar = e.statusBarHeight
|
||
customBar = e.statusBarHeight + 45
|
||
if (e.platform === 'android') {
|
||
//this.$store.commit('SET_SYSTEM_IOSANDROID', false)
|
||
customBar = e.statusBarHeight + 50
|
||
}
|
||
// #endif
|
||
|
||
|
||
// #ifdef MP-WEIXIN
|
||
statusBar = e.statusBarHeight
|
||
// @ts-ignore
|
||
//uni.getMenuButtonBoundingClientRect();
|
||
const custom = uni.getMenuButtonBoundingClientRect()
|
||
customBar = custom.bottom + custom.top - e.statusBarHeight
|
||
// #endif
|
||
|
||
|
||
// #ifdef MP-ALIPAY
|
||
statusBar = e.statusBarHeight
|
||
customBar = e.statusBarHeight + e.titleBarHeight
|
||
// #endif
|
||
|
||
|
||
// #ifdef APP-PLUS
|
||
console.log('app-plus', e)
|
||
statusBar = e.statusBarHeight
|
||
customBar = e.statusBarHeight + 45
|
||
// #endif
|
||
|
||
|
||
// #ifdef H5
|
||
statusBar = 0
|
||
customBar = e.statusBarHeight + 45
|
||
// #endif
|
||
|
||
//状态栏图片高度
|
||
that.bgImgHeight = statusBar + 'px';
|
||
|
||
}
|
||
});
|
||
},
|
||
onShow() {
|
||
if (this.$store.getters.token) {
|
||
uni.showLoading({
|
||
title: "加载中"
|
||
});
|
||
this.$store.dispatch("getUser", true);
|
||
this.getUserLevelInfo();//获取用户等级信息
|
||
//this.User();
|
||
this.MenuUser();
|
||
this.isWeixin = isWeixin();
|
||
this.getUnreadMsgList();
|
||
} else {
|
||
cookie.set("redirect", "/pages/user/User/index");
|
||
|
||
uni.reLaunch({
|
||
url: "/pages/authorization/index"
|
||
})
|
||
}
|
||
},
|
||
onHide() {
|
||
console.log("离开用户中心");
|
||
this.updateAuthorizationPage(false);
|
||
},
|
||
methods: {
|
||
...mapMutations(["updateAuthorizationPage"]),
|
||
queryURLparams: function (url) {
|
||
let obj = {}
|
||
if (url.indexOf('?') < 0) return obj
|
||
let arr = url.split('?')
|
||
url = arr[1]
|
||
let array = url.split('&')
|
||
for (let i = 0; i < array.length; i++) {
|
||
let arr2 = array[i]
|
||
let arr3 = arr2.split('=')
|
||
obj[arr3[0]] = arr3[1]
|
||
}
|
||
return obj
|
||
|
||
},
|
||
|
||
goRoomLogs() {
|
||
uni.navigateTo({
|
||
url: "/pkg_common/views/roomLogs"
|
||
})
|
||
},
|
||
|
||
goBindParent: function () {
|
||
|
||
uni.scanCode({
|
||
success: function (res) {
|
||
console.log('条码类型:' + res.scanType);
|
||
console.log('条码内容:' + res.result);
|
||
|
||
uni.showLoading();
|
||
if (res.result.length > 0) {
|
||
|
||
var query = that.queryURLparams(res.result);
|
||
if (query.spread != null) {
|
||
//绑定上级
|
||
userBindParent({
|
||
spread: query.spread
|
||
}).then((res1) => {
|
||
uni.showToast({
|
||
title: res1.msg || '绑定成功!',
|
||
icon: "success"
|
||
})
|
||
}).catch((err) => {
|
||
uni.showToast({
|
||
title: err.msg,
|
||
icon: "none"
|
||
})
|
||
})
|
||
|
||
} else {
|
||
uni.showToast({
|
||
title: "未获取到上级id",
|
||
icon: "none"
|
||
})
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
})
|
||
},
|
||
checkStateStr: function (state) {
|
||
var str = '';
|
||
switch (state) {
|
||
case 'C0':
|
||
str = '待审核';
|
||
break;
|
||
case 'C1':
|
||
str = '已通过';
|
||
break;
|
||
case 'C2':
|
||
str = '已驳回';
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return str;
|
||
},
|
||
goInnApply: function () {
|
||
//跳转到客栈申请界面
|
||
//根据提交状态判断type(0-提交申请 1-修改申请)
|
||
//hotel.checkState = C0 待审核 C1审核通过 C2 被驳回
|
||
|
||
if (this.userInfo.hotel != null) {
|
||
|
||
if (this.userInfo.hotel.checkState == 'C2') {
|
||
|
||
this.$yrouter.push("/pagesInn/inn/innApply?type=1&hotel=" + JSON.stringify(this.userInfo.hotel));
|
||
}
|
||
|
||
} else {
|
||
this.$yrouter.push("/pagesInn/inn/innApply?type=0");
|
||
}
|
||
|
||
|
||
},
|
||
goInnInfoEdit: function () {
|
||
//修改客栈信息
|
||
this.$yrouter.push("/pagesInn/inn/innProfileEdit?hotel=" + encodeURIComponent(JSON.stringify(this.userInfo.hotel)));
|
||
},
|
||
force2Decimal(v) {
|
||
return this.$force2Decimal(v);
|
||
},
|
||
protocolCheckState(state) {
|
||
var stateStr = '';
|
||
switch (state) {
|
||
case 1:
|
||
stateStr = '群主资料新增'
|
||
break;
|
||
case 2:
|
||
stateStr = '群主资料待审核'
|
||
break;
|
||
case 3:
|
||
stateStr = '群主资料审核通过'
|
||
break;
|
||
case 4:
|
||
stateStr = '群主资料被驳回'
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return stateStr;
|
||
},
|
||
innTagClick() {
|
||
//跳转到客栈主页
|
||
this.$yrouter.push({
|
||
path: "/pagesInn/inn/innHome",
|
||
query: {
|
||
id: this.userInfo.hotel.id,
|
||
isMyInn: true
|
||
}
|
||
});
|
||
},
|
||
getSpreadPoster() {
|
||
var that = this;
|
||
if (!this.spreadPoster.wap_poster) {
|
||
uni.showLoading();
|
||
getSpreadImg({}).then(
|
||
res => {
|
||
uni.hideLoading();
|
||
that.spreadPoster = res.data[0];
|
||
that.$refs.popup.open();
|
||
},
|
||
err => {
|
||
uni.hideLoading();
|
||
uni.showToast({
|
||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
}
|
||
);
|
||
} else {
|
||
that.$refs.popup.open();
|
||
}
|
||
|
||
|
||
},
|
||
goReturnList() {
|
||
this.$yrouter.push("/pages/order/ReturnList/index");
|
||
},
|
||
goMessageData() {
|
||
this.$yrouter.push("/pages/user/Message/Message");
|
||
},
|
||
goPromotionPoster() {
|
||
this.getSpreadPoster();
|
||
// this.$yrouter.push("/pages/user/promotion/Poster/index");
|
||
},
|
||
goRecharge() {
|
||
this.$yrouter.push("/pages/user/Recharge/index");
|
||
},
|
||
goAccountDetail() {
|
||
this.$yrouter.push("/pages/user/UserBill/index");
|
||
// this.$yrouter.push({
|
||
// path: "/pages/user/UserBill/index",
|
||
// query: {
|
||
// types:0
|
||
// }
|
||
// })
|
||
},
|
||
goGroupManage() {
|
||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index");
|
||
},
|
||
goAddressManage() {
|
||
this.$yrouter.push("/pages/user/address/AddressManagement/index");
|
||
},
|
||
goBankcardManage() {
|
||
uni.navigateTo({
|
||
url: "/pkg_user/views/bankCardList"
|
||
})
|
||
},
|
||
goWithdrawl() {
|
||
uni.navigateTo({
|
||
url: "/pkg_user/views/withdrawal"
|
||
})
|
||
},
|
||
goMyOrder(type) {
|
||
this.$yrouter.push({
|
||
path: "/pages/order/MyOrder/index",
|
||
query: {
|
||
type
|
||
}
|
||
});
|
||
},
|
||
goUserCoupon() {
|
||
this.$yrouter.push("/pages/user/coupon/UserCoupon/index");
|
||
},
|
||
goIntegral() {
|
||
this.$yrouter.push("/pages/user/signIn/Integral/index");
|
||
},
|
||
goUserPromotion() {
|
||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index");
|
||
},
|
||
goUserAccount() {
|
||
this.$yrouter.push({
|
||
path: "/pages/user/UserAccount/index"
|
||
});
|
||
},
|
||
goPersonalData() {
|
||
this.$yrouter.push("/pkg_user/views/personalData");
|
||
},
|
||
goLikeList() {
|
||
//跳转到我的喜欢列表
|
||
this.$yrouter.push("/pages/user/UserFavorite/UserFavorite");
|
||
},
|
||
getPhoneNumber: function (e) {
|
||
let thit = this;
|
||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
|
||
uni.showLoading({
|
||
title: "绑定中"
|
||
});
|
||
// 获取当前环境的服务商
|
||
uni.getProvider({
|
||
service: "oauth",
|
||
success: function (res) {
|
||
// 此处可以排除h5
|
||
if (res.provider) {
|
||
uni.login({
|
||
success: loginRes => {
|
||
bindingPhone({
|
||
code: loginRes.code,
|
||
encryptedData: e.mp.detail.encryptedData,
|
||
iv: e.mp.detail.iv
|
||
})
|
||
.then(res => {
|
||
console.log(res);
|
||
// this.User();
|
||
thit.$store.dispatch("userInfo", true);
|
||
uni.hideLoading();
|
||
uni.showToast({
|
||
title: res.msg,
|
||
icon: "success",
|
||
duration: 2000
|
||
});
|
||
})
|
||
.catch(error => {
|
||
uni.hideLoading();
|
||
thit.$store.dispatch("userInfo", true);
|
||
console.log(error);
|
||
uni.showToast({
|
||
title:
|
||
error.msg ||
|
||
error.response.data.msg ||
|
||
error.response.data.message,
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
});
|
||
},
|
||
fail() {
|
||
reject("绑定失败");
|
||
}
|
||
});
|
||
}
|
||
},
|
||
fail() {
|
||
reject("获取环境服务商失败");
|
||
}
|
||
});
|
||
} else {
|
||
uni.showToast({
|
||
title: "已拒绝授权",
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
}
|
||
},
|
||
// 获取用户等级信息
|
||
getUserLevelInfo: function () {
|
||
var that = this;
|
||
getUserLevelInfo().then((res) => {
|
||
if (res.data) {
|
||
that.userLevelInfo = res.data;
|
||
}
|
||
}).catch(err => {
|
||
|
||
}).finally(() => {
|
||
|
||
});
|
||
},
|
||
//升级群主
|
||
goUpgradeProtocol: function () {
|
||
this.$yrouter.push('/pages/user/UpgradeElectronicProtocol/UpgradeElectronicProtocol');
|
||
},
|
||
//升级说明
|
||
showUpgradeIntro: function () {
|
||
// var intro = '';
|
||
// if(this.userInfo && this.userInfo.levelExplain){
|
||
// intro = this.userInfo.levelExplain;
|
||
// }
|
||
this.$yrouter.push('/pages/user/MemberUpgradeIntro/MemberUpgradeIntro');
|
||
},
|
||
changeswitch: function (data) {
|
||
this.switchActive = data;
|
||
},
|
||
User: function () {
|
||
let that = this;
|
||
debugger
|
||
getUserInfo().then(res => {
|
||
|
||
if (res.data) {
|
||
//that.user = res.data;
|
||
that.$set(that, 'orderStatusNum', res.data.orderStatusNum);
|
||
that.$forceUpdate();
|
||
console.log('orderStatusNum:' + JSON.stringify(res.data.orderStatusNum));
|
||
}
|
||
|
||
});
|
||
},
|
||
MenuUser: function () {
|
||
let that = this;
|
||
getMenuUser()
|
||
.then(res => {
|
||
uni.hideLoading();
|
||
that.MyMenus = res.data.routine_my_menus;
|
||
})
|
||
.catch(error => {
|
||
uni.hideLoading();
|
||
console.log(error);
|
||
});
|
||
},
|
||
goPages: function (index) {
|
||
let url = this.MyMenus[index].uniapp_url;
|
||
if (
|
||
url === "/pages/user/promotion/UserPromotion/index" &&
|
||
this.userInfo.statu === 1
|
||
) {
|
||
if (!this.userInfo.isPromoter) {
|
||
uni.showToast({
|
||
title: "您还没有推广权限!!",
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
return;
|
||
}
|
||
}
|
||
|
||
if (
|
||
url === "/pages/orderAdmin/OrderIndex/index" &&
|
||
!this.userInfo.adminid
|
||
) {
|
||
uni.showToast({
|
||
title: "您还不是管理员!!",
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
return;
|
||
}
|
||
console.log(this.userInfo)
|
||
if (url === "/pages/orderAdmin/OrderCancellation/index" && !this.userInfo.checkStatus) {
|
||
uni.showToast({
|
||
title: "您没有核销权限,请后台店员设置!!",
|
||
icon: "none",
|
||
duration: 2000
|
||
});
|
||
return;
|
||
}
|
||
|
||
this.$yrouter.push({
|
||
path: this.MyMenus[index].uniapp_url
|
||
});
|
||
},
|
||
goPages2: function () {
|
||
this.$yrouter.push({
|
||
path: "/pages/orderAdmin/OrderCancellation/index"
|
||
});
|
||
},
|
||
getUnreadMsgList: function () {
|
||
var params = {
|
||
limit: 99999,
|
||
page: 1,
|
||
readFlag: 'RF0'
|
||
}
|
||
// mescroll.endByPage(0, 0);
|
||
// return;
|
||
let that = this;
|
||
noticeList(params)
|
||
.then(res => {
|
||
|
||
that.unreadMsgList = res.data;
|
||
|
||
})
|
||
.catch(err => {
|
||
uni.showToast({
|
||
title: err + '',
|
||
icon: 'none',
|
||
mask: false,
|
||
duration: 1500
|
||
});
|
||
})
|
||
}
|
||
},
|
||
watch: {
|
||
userInfo(newVal) {
|
||
this.MenuUser();
|
||
|
||
that.$set(that, 'orderStatusNum', newVal.orderStatusNum);
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="less">
|
||
page {
|
||
background-color: #FFF;
|
||
}
|
||
|
||
.user .header .picTxt .pictrue {
|
||
width: 76rpx !important;
|
||
height: 76rpx !important;
|
||
}
|
||
|
||
.footer-line-height {
|
||
height: 1 * 100rpx;
|
||
}
|
||
|
||
.innTag {
|
||
margin-left: -30rpx;
|
||
width: 196rpx;
|
||
height: 64rpx;
|
||
border-radius: 0px 32rpx 32rpx 0px;
|
||
background: #0DC5C5;
|
||
}
|
||
|
||
.order-status-num {
|
||
min-width: 0.33 * 100rpx;
|
||
background-color: #fff;
|
||
color: #FE5261;
|
||
border-radius: 15px;
|
||
position: absolute;
|
||
right: -0.14 * 100rpx;
|
||
top: -0.15 * 100rpx;
|
||
font-size: 0.2 * 100rpx;
|
||
// padding: 0 0.08 * 100rpx;
|
||
border: 1px solid #FE5261;
|
||
}
|
||
|
||
.pictrue {
|
||
position: relative;
|
||
}
|
||
|
||
.switch-h5 {
|
||
margin-left: 0.2 * 100rpx;
|
||
}
|
||
|
||
.binding {
|
||
margin-top: 0.1 * 100rpx;
|
||
display: inline-block;
|
||
padding: 0.05 * 100rpx 0.2 * 100rpx;
|
||
background-color: #ca1f10;
|
||
border-radius: 50px;
|
||
font-size: 0.22 * 100rpx;
|
||
line-height: 1.5;
|
||
border: 1px solid #e8695e;
|
||
color: #ffffff;
|
||
}
|
||
|
||
.by {
|
||
text-align: center;
|
||
padding: 30rpx 0;
|
||
}
|
||
|
||
.by-text {
|
||
text-align: center;
|
||
font-size: 24rpx;
|
||
}
|
||
|
||
.header {
|
||
background: linear-gradient(90deg, rgba(254, 150, 107, 1) 0%, rgba(255, 88, 75, 1) 100%);
|
||
}
|
||
|
||
.promotion-code-box {
|
||
position: relative;
|
||
padding: 8rpx 8rpx 16rpx 8rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.user .header .picTxt .text {
|
||
width: auto !important;
|
||
}
|
||
|
||
.vip-box {
|
||
background: linear-gradient(to right, #FFECC2, #E8CE87);
|
||
border-radius: 8rpx;
|
||
padding: 4rpx 8rpx;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.vip-box .diamond-img {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
margin-right: 4rpx;
|
||
}
|
||
|
||
.vip-box .vip-title {
|
||
font-size: 20rpx;
|
||
// color:rgba(67,47,39,1);
|
||
color: #6F644A;
|
||
}
|
||
|
||
.user .header .picTxt .text .id {
|
||
margin-top: inherit !important;
|
||
color: #fff !important;
|
||
}
|
||
|
||
.promotion-text {
|
||
font-size: 24rpx;
|
||
color: #8C2A03;
|
||
position: relative;
|
||
z-index: 1;
|
||
margin-bottom: 8rpx;
|
||
}
|
||
|
||
.promotion-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
position: absolute;
|
||
}
|
||
|
||
.member-box {
|
||
margin-top: 32rpx;
|
||
padding: 26rpx 40rpx;
|
||
margin-bottom: 40rpx;
|
||
|
||
}
|
||
|
||
.cur-member-title {
|
||
font-size: 28rpx;
|
||
font-weight: bold;
|
||
color: rgba(255, 233, 202, 1);
|
||
}
|
||
|
||
.cur-member-desc {
|
||
font-size: 22rpx;
|
||
color: #C3B2A0;
|
||
}
|
||
|
||
.upgrade-btn {
|
||
font-size: 24rpx;
|
||
color: #483123;
|
||
z-index: 1;
|
||
padding: 8rpx 20rpx;
|
||
background: rgba(255, 207, 126, 1);
|
||
border-radius: 24px;
|
||
}
|
||
|
||
.item-img {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
}
|
||
|
||
.wrapper {
|
||
// background-color: #FFF;
|
||
margin: 0 30rpx;
|
||
z-index: 1;
|
||
border-radius: 0 0 16rpx 16rpx;
|
||
}
|
||
|
||
.user .wrapper {
|
||
padding: 0 !important;
|
||
}
|
||
|
||
.wrapper .nav {
|
||
position: relative;
|
||
margin-top: 40rpx;
|
||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.1);
|
||
border-radius: 16rpx;
|
||
}
|
||
|
||
.myOrder {
|
||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.1);
|
||
border-radius: 16rpx;
|
||
}
|
||
|
||
.myService {
|
||
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.1);
|
||
border-radius: 16rpx;
|
||
}
|
||
|
||
.user .wrapper .nav {
|
||
// min-height: 140rpx;
|
||
height: auto;
|
||
padding-top: 20rpx;
|
||
padding-bottom: 20rpx;
|
||
}
|
||
|
||
.protocol-state-box {
|
||
font-size: 24rpx;
|
||
color: #FFF2D5;
|
||
padding: 6rpx 14rpx;
|
||
border: 1px solid #FFF0CD;
|
||
border-radius: 4rpx;
|
||
}
|
||
|
||
.unread-dot {
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
flex-shrink: 0;
|
||
width: 0.16*100rpx;
|
||
height: 0.16*100rpx;
|
||
background: #fff;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.vline {
|
||
color: #fff;
|
||
background: #fff;
|
||
width: 1px;
|
||
height: 30rpx;
|
||
}
|
||
|
||
.withdrawBtn {
|
||
background: #593D13;
|
||
color: #fff;
|
||
font-size: 24rpx;
|
||
width: 132rpx;
|
||
height: 48rpx;
|
||
line-height: 48rpx;
|
||
text-align: center;
|
||
border-radius: 24rpx;
|
||
}
|
||
|
||
.accountDetailBtn {
|
||
background: #FF564A;
|
||
color: #fff;
|
||
font-size: 24rpx;
|
||
width: 132rpx;
|
||
height: 48rpx;
|
||
line-height: 48rpx;
|
||
text-align: center;
|
||
border-radius: 24rpx;
|
||
}
|
||
|
||
.benifitIntroBtn {
|
||
background: #0DC5C5;
|
||
color: #fff;
|
||
font-size: 24rpx;
|
||
width: 132rpx;
|
||
height: 48rpx;
|
||
line-height: 48rpx;
|
||
text-align: center;
|
||
border-radius: 24rpx;
|
||
}
|
||
|
||
</style>
|