gaoxs
5 years ago
47 changed files with 943 additions and 919 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,192 +1,213 @@ |
|||||||
<template> |
<template> |
||||||
<view class="container"> |
<view class="container"> |
||||||
<view v-if="!isAuthorization"> |
<view v-if="!$store.getters.token&&$deviceType=='Weixin'"> |
||||||
<view class="getUserInfo"> |
<view class="getUserInfo"> |
||||||
<text>您还未允许微信登录授权,请点击下方按钮允许微信授权登录。</text> |
<text>您还未允许微信登录授权,请点击下方按钮允许微信授权登录。</text> |
||||||
<view style="height:20rpx"></view> |
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button> |
||||||
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button> |
<view style="height:20rpx"></view> |
||||||
<view style="height:20rpx"></view> |
<button @click="back">取消微信登录授权</button> |
||||||
<button @click="back">取消微信登录授权</button> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
<view v-if="!$store.getters.token&&$deviceType!='Weixin'"> |
||||||
</view> |
<view class="getUserInfo"> |
||||||
|
<text>请先登录</text> |
||||||
|
<button type="primary" @click="this.toLogin">去登录</button> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import { mapState, mapMutations, mapActions } from "vuex"; |
import { |
||||||
// 组件 |
mapState, |
||||||
// import request from "@//api/request"; |
mapMutations, |
||||||
import { wxappAuth, getUser } from "@/api/user"; |
mapActions |
||||||
import dayjs from "dayjs"; |
} from "vuex"; |
||||||
import cookie from "@/utils/store/cookie"; |
// 组件 |
||||||
import { login } from "@/utils"; |
// import request from "@//api/request"; |
||||||
|
import { |
||||||
export default { |
wxappAuth, |
||||||
data() { |
getUser |
||||||
return {}; |
} from "@/api/user"; |
||||||
}, |
import dayjs from "dayjs"; |
||||||
computed: { |
import cookie from "@/utils/store/cookie"; |
||||||
...mapState(["isAuthorization"]) |
import { |
||||||
}, |
login |
||||||
onShow() { |
} from "@/utils"; |
||||||
this.UPDATE_AUTHORIZATIONPAGE(true); |
|
||||||
}, |
export default { |
||||||
onHide() { |
data() { |
||||||
this.UPDATE_AUTHORIZATIONPAGE(false); |
return {}; |
||||||
this.changeAuthorization(false); |
}, |
||||||
}, |
computed: { |
||||||
onUnload() { |
...mapState(["isAuthorization"]) |
||||||
this.UPDATE_AUTHORIZATIONPAGE(false); |
}, |
||||||
this.changeAuthorization(false); |
onShow() { |
||||||
}, |
this.UPDATE_AUTHORIZATIONPAGE(true); |
||||||
methods: { |
}, |
||||||
...mapActions(["changeAuthorization", "setUserInfo"]), |
onHide() { |
||||||
...mapMutations(["UPDATE_AUTHORIZATIONPAGE", "CHANGE_TABTAR"]), |
this.UPDATE_AUTHORIZATIONPAGE(false); |
||||||
back() { |
this.changeAuthorization(false); |
||||||
this.$yrouter.switchTab({ |
}, |
||||||
path: "/pages/home/index", |
onUnload() { |
||||||
query: {} |
this.UPDATE_AUTHORIZATIONPAGE(false); |
||||||
}); |
this.changeAuthorization(false); |
||||||
}, |
}, |
||||||
getUserInfo(data) { |
methods: { |
||||||
if (data.detail.errMsg == "getUserInfo:fail auth deny") { |
...mapActions(["changeAuthorization", "setUserInfo"]), |
||||||
uni.showToast({ |
...mapMutations(["UPDATE_AUTHORIZATIONPAGE", "CHANGE_TABTAR"]), |
||||||
title: "取消授权", |
back() { |
||||||
icon: "none", |
this.$yrouter.switchTab({ |
||||||
duration: 2000 |
path: "/pages/home/index", |
||||||
}); |
query: {} |
||||||
return; |
}); |
||||||
} |
}, |
||||||
uni.showLoading({ |
getUserInfo(data) { |
||||||
title: "登录中" |
if (data.detail.errMsg == "getUserInfo:fail auth deny") { |
||||||
}); |
uni.showToast({ |
||||||
login({ |
title: "取消授权", |
||||||
success: () => {} |
icon: "none", |
||||||
}); |
duration: 2000 |
||||||
} |
}); |
||||||
}, |
return; |
||||||
onUnload() {}, |
} |
||||||
mounted() {} |
uni.showLoading({ |
||||||
}; |
title: "登录中" |
||||||
|
}); |
||||||
|
login({ |
||||||
|
success: () => {} |
||||||
|
}); |
||||||
|
}, |
||||||
|
toLogin() { |
||||||
|
this.$yrouter.push({ |
||||||
|
path: "/pages/user/Login/index", |
||||||
|
query: {} |
||||||
|
}); |
||||||
|
} |
||||||
|
}, |
||||||
|
onUnload() {}, |
||||||
|
mounted() {} |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="less"> |
<style lang="less"> |
||||||
.sp-cell { |
.sp-cell { |
||||||
height: 20rpx; |
height: 20rpx; |
||||||
} |
} |
||||||
|
|
||||||
.getUserInfo { |
.getUserInfo { |
||||||
display: flex; |
display: flex; |
||||||
align-items: center; |
align-items: center; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
padding: 30px; |
padding: 30px; |
||||||
|
|
||||||
p { |
text { |
||||||
margin-bottom: 20px; |
font-size: 30rpx; |
||||||
} |
text-align: center; |
||||||
} |
margin-bottom: 20px; |
||||||
|
} |
||||||
.container { |
} |
||||||
flex: 1; |
|
||||||
display: flex; |
.container { |
||||||
flex-direction: column; |
flex: 1; |
||||||
justify-content: flex-start; |
display: flex; |
||||||
position: relative; |
flex-direction: column; |
||||||
} |
justify-content: flex-start; |
||||||
|
position: relative; |
||||||
.tab-bar { |
} |
||||||
font-size: 0; |
|
||||||
display: flex; |
.tab-bar { |
||||||
align-items: center; |
font-size: 0; |
||||||
background: rgba(255, 255, 255, 0.9); |
display: flex; |
||||||
position: fixed; |
align-items: center; |
||||||
bottom: 0; |
background: rgba(255, 255, 255, 0.9); |
||||||
left: 0; |
position: fixed; |
||||||
right: 0; |
bottom: 0; |
||||||
z-index: 99; |
left: 0; |
||||||
border-top: 1px solid rgba(248, 248, 248, 1); |
right: 0; |
||||||
|
z-index: 99; |
||||||
.tab-bar-item { |
border-top: 1px solid rgba(248, 248, 248, 1); |
||||||
flex: 1; |
|
||||||
height: 49px; |
.tab-bar-item { |
||||||
display: flex; |
flex: 1; |
||||||
justify-content: center; |
height: 49px; |
||||||
align-items: center; |
display: flex; |
||||||
flex-direction: column; |
justify-content: center; |
||||||
|
align-items: center; |
||||||
&.active { |
flex-direction: column; |
||||||
text { |
|
||||||
color: #ee7559; |
&.active { |
||||||
} |
text { |
||||||
|
color: #ee7559; |
||||||
.tab-bar-pic { |
} |
||||||
display: none; |
|
||||||
background: #f9f9f9; |
.tab-bar-pic { |
||||||
|
display: none; |
||||||
&.active { |
background: #f9f9f9; |
||||||
display: block; |
|
||||||
} |
&.active { |
||||||
} |
display: block; |
||||||
} |
} |
||||||
|
} |
||||||
.tab-bar-pic { |
} |
||||||
display: block; |
|
||||||
background: #f9f9f9; |
.tab-bar-pic { |
||||||
|
display: block; |
||||||
&.active { |
background: #f9f9f9; |
||||||
display: none; |
|
||||||
} |
&.active { |
||||||
} |
display: none; |
||||||
} |
} |
||||||
|
} |
||||||
.tab-bar-pic { |
} |
||||||
width: 25px; |
|
||||||
height: 25px; |
.tab-bar-pic { |
||||||
background: #f9f9f9; |
width: 25px; |
||||||
|
height: 25px; |
||||||
image { |
background: #f9f9f9; |
||||||
width: 25px; |
|
||||||
height: 25px; |
image { |
||||||
} |
width: 25px; |
||||||
} |
height: 25px; |
||||||
|
} |
||||||
.tab-bar-pic-active { |
} |
||||||
} |
|
||||||
|
.tab-bar-pic-active {} |
||||||
text { |
|
||||||
font-size: 10px; |
text { |
||||||
color: rgb(160, 160, 160); |
font-size: 10px; |
||||||
line-height: 10px; |
color: rgb(160, 160, 160); |
||||||
margin-top: 5px; |
line-height: 10px; |
||||||
} |
margin-top: 5px; |
||||||
} |
} |
||||||
|
} |
||||||
.tab-bar-bg { |
|
||||||
padding-top: 46px; |
.tab-bar-bg { |
||||||
width: 100%; |
padding-top: 46px; |
||||||
} |
width: 100%; |
||||||
|
} |
||||||
.view-item { |
|
||||||
display: none; |
.view-item { |
||||||
width: 100%; |
display: none; |
||||||
} |
width: 100%; |
||||||
|
} |
||||||
.view-item-active { |
|
||||||
display: block; |
.view-item-active { |
||||||
} |
display: block; |
||||||
|
} |
||||||
.getUserInfo { |
|
||||||
display: flex; |
.getUserInfo { |
||||||
align-items: center; |
display: flex; |
||||||
flex-direction: column; |
align-items: center; |
||||||
padding: 30px; |
flex-direction: column; |
||||||
|
padding: 30px; |
||||||
p { |
|
||||||
margin-bottom: 20px; |
p { |
||||||
} |
margin-bottom: 20px; |
||||||
} |
} |
||||||
|
} |
||||||
._van-dialog { |
|
||||||
z-index: 99999999999; |
._van-dialog { |
||||||
} |
z-index: 99999999999; |
||||||
</style> |
} |
||||||
|
</style> |
||||||
|
@ -1,359 +1,355 @@ |
|||||||
<template> |
<template> |
||||||
<view class="user"> |
<view class="user"> |
||||||
<view v-if="userInfo.uid"> |
<view v-if="userInfo.uid"> |
||||||
<view class="header bg-color-red acea-row row-between-wrapper"> |
<view class="header bg-color-red acea-row row-between-wrapper"> |
||||||
<view class="picTxt acea-row row-between-wrapper"> |
<view class="picTxt acea-row row-between-wrapper"> |
||||||
<view class="pictrue"> |
<view class="pictrue"> |
||||||
<image :src="userInfo.avatar" /> |
<image :src="userInfo.avatar" /> |
||||||
</view> |
</view> |
||||||
<view class="text"> |
<view class="text"> |
||||||
<view class="acea-row row-middle"> |
<view class="acea-row row-middle"> |
||||||
<view class="name line1">{{ userInfo.nickname }}</view> |
<view class="name line1">{{ userInfo.nickname }}</view> |
||||||
<view class="member acea-row row-middle" v-if="userInfo.vip"> |
<view class="member acea-row row-middle" v-if="userInfo.vip"> |
||||||
<image :src="userInfo.vipIcon" /> |
<image :src="userInfo.vipIcon" /> |
||||||
<text>{{ userInfo.vipName }}</text> |
<text>{{ userInfo.vipName }}</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view @click="goPersonalData()" class="id" v-if="userInfo.phone"> |
<view @click="goPersonalData()" class="id" v-if="userInfo.phone"> |
||||||
<text>ID:{{ userInfo.uid || 0}}</text> |
<text>ID:{{ userInfo.uid || 0}}</text> |
||||||
<text class="iconfont icon-bianji1"></text> |
<text class="iconfont icon-bianji1"></text> |
||||||
</view> |
</view> |
||||||
<button |
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else> |
||||||
open-type="getPhoneNumber" |
<text>绑定手机号</text> |
||||||
@getphonenumber="getPhoneNumber" |
</button> |
||||||
class="binding" |
</view> |
||||||
v-else |
</view> |
||||||
> |
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text> |
||||||
<text>绑定手机号</text> |
</view> |
||||||
</button> |
<view class="wrapper"> |
||||||
</view> |
<view class="nav acea-row row-middle"> |
||||||
</view> |
<view @click="goUserAccount()" class="item"> |
||||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text> |
<text>我的余额</text> |
||||||
</view> |
<text class="num">{{ userInfo.nowMoney || 0 }}</text> |
||||||
<view class="wrapper"> |
</view> |
||||||
<view class="nav acea-row row-middle"> |
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"> |
||||||
<view @click="goUserAccount()" class="item"> |
<text>当前佣金</text> |
||||||
<text>我的余额</text> |
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> |
||||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text> |
</view> |
||||||
</view> |
<view @click="goIntegral()" class="item" v-else> |
||||||
<view |
<text>当前积分</text> |
||||||
@click="goUserPromotion()" |
<text class="num">{{ userInfo.integral || 0 }}</text> |
||||||
class="item" |
</view> |
||||||
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2" |
<view @click="goUserCoupon()" class="item"> |
||||||
> |
<text>优惠券</text> |
||||||
<text>当前佣金</text> |
<text class="num">{{ userInfo.couponCount || 0 }}</text> |
||||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> |
</view> |
||||||
</view> |
</view> |
||||||
<view @click="goIntegral()" class="item" v-else> |
<view class="myOrder"> |
||||||
<text>当前积分</text> |
<view class="title acea-row row-between-wrapper"> |
||||||
<text class="num">{{ userInfo.integral || 0 }}</text> |
<text>我的订单</text> |
||||||
</view> |
<text @click="goMyOrder()" class="allOrder"> |
||||||
<view @click="goUserCoupon()" class="item"> |
<text>全部订单</text> |
||||||
<text>优惠券</text> |
<text class="iconfont icon-jiantou"></text> |
||||||
<text class="num">{{ userInfo.couponCount || 0 }}</text> |
</text> |
||||||
</view> |
</view> |
||||||
</view> |
<view class="orderState acea-row row-middle"> |
||||||
<view class="myOrder"> |
<view @click="goMyOrder(0)" class="item"> |
||||||
<view class="title acea-row row-between-wrapper"> |
<view class="pictrue"> |
||||||
<text>我的订单</text> |
<image :src="$VUE_APP_RESOURCES_URL + '/images/dfk.png'" /> |
||||||
<text @click="goMyOrder()" class="allOrder"> |
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text> |
||||||
<text>全部订单</text> |
</view> |
||||||
<text class="iconfont icon-jiantou"></text> |
<view>待付款</view> |
||||||
</text> |
</view> |
||||||
</view> |
<view @click="goMyOrder(1)" class="item"> |
||||||
<view class="orderState acea-row row-middle"> |
<view class="pictrue"> |
||||||
<view @click="goMyOrder(0)" class="item"> |
<image :src="$VUE_APP_RESOURCES_URL+'/images/dfh.png'" /> |
||||||
<view class="pictrue"> |
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text> |
||||||
<image :src="$VUE_APP_RESOURCES_URL + '/images/dfk.png'" /> |
</view> |
||||||
<text |
<view>待发货</view> |
||||||
class="order-status-num" |
</view> |
||||||
v-if="userInfo.orderStatusNum.unpaidCount > 0" |
<view @click="goMyOrder(2)" class="item"> |
||||||
>{{ userInfo.orderStatusNum.unpaidCount }}</text> |
<view class="pictrue"> |
||||||
</view> |
<image :src="$VUE_APP_RESOURCES_URL+'/images/dsh.png'" /> |
||||||
<view>待付款</view> |
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text> |
||||||
</view> |
</view> |
||||||
<view @click="goMyOrder(1)" class="item"> |
<text>待收货</text> |
||||||
<view class="pictrue"> |
</view> |
||||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dfh.png'" /> |
<view @click="goMyOrder(3)" class="item"> |
||||||
<text |
<view class="pictrue"> |
||||||
class="order-status-num" |
<image :src="$VUE_APP_RESOURCES_URL+'/images/dpj.png'" /> |
||||||
v-if="userInfo.orderStatusNum.unshippedCount > 0" |
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text> |
||||||
>{{ userInfo.orderStatusNum.unshippedCount }}</text> |
</view> |
||||||
</view> |
<text>待评价</text> |
||||||
<view>待发货</view> |
</view> |
||||||
</view> |
<view @click="goReturnList()" class="item"> |
||||||
<view @click="goMyOrder(2)" class="item"> |
<view class="pictrue"> |
||||||
<view class="pictrue"> |
<image :src="$VUE_APP_RESOURCES_URL+'/images/sh.png'" /> |
||||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dsh.png'" /> |
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text> |
||||||
<text |
</view> |
||||||
class="order-status-num" |
<text>售后/退款</text> |
||||||
v-if="userInfo.orderStatusNum.receivedCount > 0" |
</view> |
||||||
>{{ userInfo.orderStatusNum.receivedCount }}</text> |
</view> |
||||||
</view> |
</view> |
||||||
<text>待收货</text> |
<view class="myService"> |
||||||
</view> |
<view class="title acea-row row-middle"> |
||||||
<view @click="goMyOrder(3)" class="item"> |
<text>我的服务</text> |
||||||
<view class="pictrue"> |
</view> |
||||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dpj.png'" /> |
<view class="serviceList acea-row row-middle"> |
||||||
<text |
<template v-for="(item, MyMenusIndex) in MyMenus"> |
||||||
class="order-status-num" |
<view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url"> |
||||||
v-if="userInfo.orderStatusNum.evaluatedCount > 0" |
<view class="pictrue"> |
||||||
>{{ userInfo.orderStatusNum.evaluatedCount }}</text> |
<image :src="item.pic" /> |
||||||
</view> |
</view> |
||||||
<text>待评价</text> |
<view>{{ item.name }}</view> |
||||||
</view> |
</view> |
||||||
<view @click="goReturnList()" class="item"> |
</template> |
||||||
<view class="pictrue"> |
</view> |
||||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sh.png'" /> |
</view> |
||||||
<text |
<!--<view --> |
||||||
class="order-status-num" |
<!--class="item"--> |
||||||
v-if="userInfo.orderStatusNum.refundCount > 0" |
<!--@click="changeswitch(true)"--> |
||||||
>{{ userInfo.orderStatusNum.refundCount }}</text> |
<!--v-if="userInfo.phone && isWeixin"--> |
||||||
</view> |
<!-->--> |
||||||
<text>售后/退款</text> |
<!--<view class="pictrue"><image :src="$VUE_APP_RESOURCES_URL+'/images/switch.png'" /></view>--> |
||||||
</view> |
<!--<view>账号切换</!--<view>--> |
||||||
</view> |
<!--</!--<view>--> |
||||||
</view> |
<!-- </view> |
||||||
<view class="myService"> |
|
||||||
<view class="title acea-row row-middle"> |
|
||||||
<text>我的服务</text> |
|
||||||
</view> |
|
||||||
<view class="serviceList acea-row row-middle"> |
|
||||||
<template v-for="(item, MyMenusIndex) in MyMenus"> |
|
||||||
<view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url"> |
|
||||||
<view class="pictrue"> |
|
||||||
<image :src="item.pic" /> |
|
||||||
</view> |
|
||||||
<view>{{ item.name }}</view> |
|
||||||
</view> |
|
||||||
</template> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<!--<view --> |
|
||||||
<!--class="item"--> |
|
||||||
<!--@click="changeswitch(true)"--> |
|
||||||
<!--v-if="userInfo.phone && isWeixin"--> |
|
||||||
<!-->--> |
|
||||||
<!--<view class="pictrue"><image :src="$VUE_APP_RESOURCES_URL+'/images/switch.png'" /></view>--> |
|
||||||
<!--<view>账号切换</!--<view>--> |
|
||||||
<!--</!--<view>--> |
|
||||||
<!-- </view> |
|
||||||
</view>--> |
</view>--> |
||||||
</view> |
</view> |
||||||
<view style="text-align: center;margin-top: 1rem">By@意象</view> |
<view class="by"> |
||||||
<view class="footer-line-height"></view> |
<text class="by-text">By@意象</text> |
||||||
<!-- <SwitchWindow |
</view> |
||||||
|
<view class="footer-line-height"></view> |
||||||
|
<!-- <SwitchWindow |
||||||
v-on:changeswitch="changeswitch" |
v-on:changeswitch="changeswitch" |
||||||
:switchActive="switchActive" |
:switchActive="switchActive" |
||||||
:login_type="userInfo.login_type" |
:login_type="userInfo.login_type" |
||||||
></SwitchWindow> --> |
></SwitchWindow> --> |
||||||
</view> |
</view> |
||||||
<Authorization v-else /> |
<Authorization v-if="!$store.getters.token" /> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import { getUser, getMenuUser, bindingPhone } from "@/api/user"; |
import { |
||||||
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils"; |
getUser, |
||||||
import SwitchWindow from "@/components/SwitchWindow"; |
getMenuUser, |
||||||
import Authorization from "@/pages/authorization/index"; |
bindingPhone |
||||||
import { mapGetters } from "vuex"; |
} from "@/api/user"; |
||||||
|
import { |
||||||
|
isWeixin, |
||||||
|
VUE_APP_RESOURCES_URL |
||||||
|
} from "@/utils"; |
||||||
|
import SwitchWindow from "@/components/SwitchWindow"; |
||||||
|
import Authorization from "@/pages/authorization/index"; |
||||||
|
import { |
||||||
|
mapGetters |
||||||
|
} from "vuex"; |
||||||
|
|
||||||
const NAME = "User"; |
const NAME = "User"; |
||||||
|
|
||||||
export default { |
export default { |
||||||
name: NAME, |
name: NAME, |
||||||
components: { |
components: { |
||||||
SwitchWindow, |
SwitchWindow, |
||||||
Authorization |
Authorization |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
MyMenus: [], |
MyMenus: [], |
||||||
switchActive: false, |
switchActive: false, |
||||||
isWeixin: false |
isWeixin: false |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
computed: mapGetters(["userInfo"]), |
computed: mapGetters(["userInfo"]), |
||||||
methods: { |
methods: { |
||||||
goReturnList() { |
goReturnList() { |
||||||
this.$yrouter.push("/pages/order/ReturnList/index"); |
this.$yrouter.push("/pages/order/ReturnList/index"); |
||||||
}, |
}, |
||||||
goMyOrder(type) { |
goMyOrder(type) { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/order/MyOrder/index", |
path: "/pages/order/MyOrder/index", |
||||||
query: { |
query: { |
||||||
type |
type |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goUserCoupon() { |
goUserCoupon() { |
||||||
this.$yrouter.push("/pages/user/coupon/UserCoupon/index"); |
this.$yrouter.push("/pages/user/coupon/UserCoupon/index"); |
||||||
}, |
}, |
||||||
goIntegral() { |
goIntegral() { |
||||||
this.$yrouter.push("/pages/user/signIn/Integral/index"); |
this.$yrouter.push("/pages/user/signIn/Integral/index"); |
||||||
}, |
}, |
||||||
goUserPromotion() { |
goUserPromotion() { |
||||||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index"); |
this.$yrouter.push("/pages/user/promotion/UserPromotion/index"); |
||||||
}, |
}, |
||||||
goUserAccount() { |
goUserAccount() { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/user/UserAccount/index" |
path: "/pages/user/UserAccount/index" |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goPersonalData() { |
goPersonalData() { |
||||||
this.$yrouter.push("/pages/user/PersonalData/index"); |
this.$yrouter.push("/pages/user/PersonalData/index"); |
||||||
}, |
}, |
||||||
getPhoneNumber: function(e) { |
getPhoneNumber: function(e) { |
||||||
console.log(e.mp.detail); |
console.log(e.mp.detail); |
||||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
||||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") { |
if (e.mp.detail.errMsg == "getPhoneNumber:ok") { |
||||||
uni.showLoading({ |
uni.showLoading({ |
||||||
title: "绑定中" |
title: "绑定中" |
||||||
}); |
}); |
||||||
// 获取当前环境的服务商 |
// 获取当前环境的服务商 |
||||||
uni.getProvider({ |
uni.getProvider({ |
||||||
service: "oauth", |
service: "oauth", |
||||||
success: function(res) { |
success: function(res) { |
||||||
console.log(res.provider); |
console.log(res.provider); |
||||||
// 此处可以排除h5 |
// 此处可以排除h5 |
||||||
if (res.provider) { |
if (res.provider) { |
||||||
uni.login({ |
uni.login({ |
||||||
success: loginRes => { |
success: loginRes => { |
||||||
bindingPhone({ |
bindingPhone({ |
||||||
code: loginRes.code, |
code: loginRes.code, |
||||||
encryptedData: e.mp.detail.encryptedData, |
encryptedData: e.mp.detail.encryptedData, |
||||||
iv: e.mp.detail.iv |
iv: e.mp.detail.iv |
||||||
}) |
}) |
||||||
.then(res => { |
.then(res => { |
||||||
this.User(); |
this.User(); |
||||||
uni.hideLoading(); |
uni.hideLoading(); |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: res.msg, |
title: res.msg, |
||||||
icon: "success", |
icon: "success", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
.catch(error => { |
.catch(error => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: error.msg || error.response.data.msg, |
title: error.msg || error.response.data.msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
} |
} |
||||||
}); |
}); |
||||||
} |
} |
||||||
} |
} |
||||||
}); |
}); |
||||||
} else { |
} else { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "已拒绝授权", |
title: "已拒绝授权", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
} |
} |
||||||
}, |
}, |
||||||
changeswitch: function(data) { |
changeswitch: function(data) { |
||||||
this.switchActive = data; |
this.switchActive = data; |
||||||
}, |
}, |
||||||
User: function() { |
User: function() { |
||||||
let that = this; |
let that = this; |
||||||
// getUser().then(res => { |
// getUser().then(res => { |
||||||
// that.user = res.data; |
// that.user = res.data; |
||||||
// that.orderStatusNum = res.data.orderStatusNum; |
// that.orderStatusNum = res.data.orderStatusNum; |
||||||
// }); |
// }); |
||||||
}, |
}, |
||||||
MenuUser: function() { |
MenuUser: function() { |
||||||
let that = this; |
let that = this; |
||||||
getMenuUser().then(res => { |
getMenuUser().then(res => { |
||||||
that.MyMenus = res.data.routine_my_menus; |
that.MyMenus = res.data.routine_my_menus; |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goPages: function(index) { |
goPages: function(index) { |
||||||
let url = this.MyMenus[index].uniapp_url; |
let url = this.MyMenus[index].uniapp_url; |
||||||
if ( |
if ( |
||||||
url === "/pages/user/promotion/UserPromotion/index" && |
url === "/pages/user/promotion/UserPromotion/index" && |
||||||
this.userInfo.statu === 1 |
this.userInfo.statu === 1 |
||||||
) { |
) { |
||||||
if (!this.userInfo.isPromoter) { |
if (!this.userInfo.isPromoter) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "您还没有推广权限!!", |
title: "您还没有推广权限!!", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
return; |
return; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
if ( |
if ( |
||||||
url === "/pages/orderAdmin/OrderIndex/index" && |
url === "/pages/orderAdmin/OrderIndex/index" && |
||||||
!this.userInfo.adminid |
!this.userInfo.adminid |
||||||
) { |
) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "您还不是管理员!!", |
title: "您还不是管理员!!", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
return; |
return; |
||||||
} |
} |
||||||
|
|
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: this.MyMenus[index].uniapp_url |
path: this.MyMenus[index].uniapp_url |
||||||
}); |
}); |
||||||
} |
} |
||||||
}, |
}, |
||||||
watch: { |
watch: { |
||||||
userInfo() { |
userInfo() { |
||||||
this.MenuUser(); |
this.MenuUser(); |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
console.log(this.userInfo); |
console.log(this.userInfo); |
||||||
if (this.$store.getters.token) { |
if (this.$store.getters.token) { |
||||||
this.User(); |
this.User(); |
||||||
this.MenuUser(); |
this.MenuUser(); |
||||||
this.isWeixin = isWeixin(); |
this.isWeixin = isWeixin(); |
||||||
} |
} |
||||||
} |
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style> |
<style lang="less"> |
||||||
.footer-line-height { |
.footer-line-height { |
||||||
height: 1rem; |
height: 1*100rpx; |
||||||
} |
} |
||||||
|
|
||||||
.order-status-num { |
.order-status-num { |
||||||
min-width: 0.33rem; |
min-width: 0.33*100rpx; |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
color: #73cbb6; |
color: #73cbb6; |
||||||
border-radius: 15px; |
border-radius: 15px; |
||||||
position: absolute; |
position: absolute; |
||||||
right: -0.14rem; |
right: -0.14*100rpx; |
||||||
top: -0.15rem; |
top: -0.15*100rpx; |
||||||
font-size: 0.2rem; |
font-size: 0.2*100rpx; |
||||||
padding: 0 0.08rem; |
padding: 0 0.08*100rpx; |
||||||
border: 1px solid #73cbb6; |
border: 1px solid #73cbb6; |
||||||
} |
} |
||||||
|
|
||||||
.pictrue { |
.pictrue { |
||||||
position: relative; |
position: relative; |
||||||
} |
} |
||||||
|
|
||||||
.switch-h5 { |
.switch-h5 { |
||||||
margin-left: 0.2rem; |
margin-left: 0.2*100rpx; |
||||||
} |
} |
||||||
|
|
||||||
.binding { |
.binding { |
||||||
margin-top: 0.1rem; |
margin-top: 0.1*100rpx; |
||||||
display: inline-block; |
display: inline-block; |
||||||
padding: 0.05rem 0.2rem; |
padding: 0.05*100rpx 0.2*100rpx; |
||||||
background-color: #ca1f10; |
background-color: #ca1f10; |
||||||
border-radius: 50px; |
border-radius: 50px; |
||||||
font-size: 0.22rem; |
font-size: 0.22*100rpx; |
||||||
line-height: 1.5; |
line-height: 1.5; |
||||||
border: 1px solid #e8695e; |
border: 1px solid #e8695e; |
||||||
color: #ffffff; |
color: #ffffff; |
||||||
} |
} |
||||||
</style> |
|
||||||
|
.by{ |
||||||
|
text-align:center; |
||||||
|
margin-top: 30rpx |
||||||
|
} |
||||||
|
.by-text{ |
||||||
|
text-align:center; |
||||||
|
font-size: 30rpx; |
||||||
|
} |
||||||
|
</style> |
||||||
|
Loading…
Reference in new issue