修改.vue中的 rem为rpx,修改部分页面错误样式,授权页增加微信和app的判断
This commit is contained in:
@ -24,9 +24,9 @@
|
||||
<view class="confirmBnt bg-color-red" @click="confirm">确认修改</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.ChangePassword .phone input {
|
||||
width: 2rem;
|
||||
width: 2*100rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
@ -41,24 +41,24 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.CustomerList {
|
||||
margin-top: 0.13rem;
|
||||
margin-top: 0.13*100rpx;
|
||||
}
|
||||
.CustomerList .item {
|
||||
height: 1.38rem;
|
||||
height: 1.38*100rpx;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 0 0.24rem;
|
||||
padding: 0 0.24*100rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.CustomerList .item .pictrue {
|
||||
width: 0.9rem;
|
||||
height: 0.9rem;
|
||||
width: 0.9*100rpx;
|
||||
height: 0.9*100rpx;
|
||||
border-radius: 50%;
|
||||
border: 0.03rem solid #fff;
|
||||
box-shadow: 0 0 0.1rem 0.05rem #f3f3f3;
|
||||
-webkit-box-shadow: 0 0 0.1rem 0.05rem #f3f3f3;
|
||||
-moz-box-shadow: 0 0 0.1rem 0.05rem #f3f3f3;
|
||||
border: 0.03*100rpx solid #fff;
|
||||
box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
-webkit-box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
-moz-box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
}
|
||||
.CustomerList .item .pictrue image{
|
||||
width: 100%;
|
||||
@ -66,8 +66,8 @@ export default {
|
||||
border-radius: 50%;
|
||||
}
|
||||
.CustomerList .item .text {
|
||||
width: 5.82rem;
|
||||
font-size: 0.32rem;
|
||||
width: 5.82*100rpx;
|
||||
font-size: 0.32*100rpx;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
|
@ -184,51 +184,51 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
#iframe {
|
||||
display: none;
|
||||
}
|
||||
.recharge {
|
||||
width: 7.03rem;
|
||||
padding: 0.5rem 0.63rem 0.45rem;
|
||||
width: 7.03*100rpx;
|
||||
padding: 0.5*100rpx 0.63*100rpx 0.45*100rpx;
|
||||
background-color: #fff;
|
||||
margin: 0.2rem auto 0 auto;
|
||||
border-radius: 0.1rem;
|
||||
margin: 0.2*100rpx auto 0 auto;
|
||||
border-radius: 0.1*100rpx;
|
||||
}
|
||||
.recharge .nav {
|
||||
height: 0.75rem;
|
||||
line-height: 0.75rem;
|
||||
padding: 0 1rem;
|
||||
height: 0.75*100rpx;
|
||||
line-height: 0.75*100rpx;
|
||||
padding: 0 1*100rpx;
|
||||
}
|
||||
.recharge .nav .item {
|
||||
font-size: 0.3rem;
|
||||
font-size: 0.3*100rpx;
|
||||
color: #333;
|
||||
}
|
||||
.recharge .nav .item.on {
|
||||
font-weight: bold;
|
||||
border-bottom: 0.04rem solid #e83323;
|
||||
border-bottom: 0.04*100rpx solid #e83323;
|
||||
}
|
||||
.recharge .info-wrapper {
|
||||
text-align: center;
|
||||
}
|
||||
.recharge .info-wrapper .money {
|
||||
margin-top: 0.6rem;
|
||||
padding-bottom: 0.2rem;
|
||||
margin-top: 0.6*100rpx;
|
||||
padding-bottom: 0.2*100rpx;
|
||||
border-bottom: 1px dashed #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .money text {
|
||||
font-size: 0.56rem;
|
||||
font-size: 0.56*100rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
.recharge .info-wrapper .money input {
|
||||
display: inline-block;
|
||||
width: 3rem;
|
||||
font-size: 0.84rem;
|
||||
width: 3*100rpx;
|
||||
font-size: 0.84*100rpx;
|
||||
text-align: center;
|
||||
color: #282828;
|
||||
font-weight: bold;
|
||||
padding-right: 0.7rem;
|
||||
padding-right: 0.7*100rpx;
|
||||
}
|
||||
.recharge .info-wrapper .money input::placeholder {
|
||||
color: #ddd;
|
||||
@ -246,25 +246,25 @@ export default {
|
||||
color: #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .tips {
|
||||
font-size: 0.26rem;
|
||||
font-size: 0.26*100rpx;
|
||||
color: #888;
|
||||
margin: 0.25rem auto 0 auto;
|
||||
margin: 0.25*100rpx auto 0 auto;
|
||||
line-height: 1.5;
|
||||
padding: 0 0.3rem;
|
||||
padding: 0 0.3*100rpx;
|
||||
}
|
||||
.recharge .info-wrapper .tips text {
|
||||
color: #ef4a49;
|
||||
}
|
||||
.recharge .info-wrapper .pay-btn {
|
||||
display: block;
|
||||
width: 5.5rem;
|
||||
height: 0.86rem;
|
||||
margin: 0.5rem auto 0 auto;
|
||||
line-height: 0.86rem;
|
||||
width: 5.5*100rpx;
|
||||
height: 0.86*100rpx;
|
||||
margin: 0.5*100rpx auto 0 auto;
|
||||
line-height: 0.86*100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.3rem;
|
||||
border-radius: 0.5*100rpx;
|
||||
font-size: 0.3*100rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,359 +1,355 @@
|
||||
<template>
|
||||
<view class="user">
|
||||
<view v-if="userInfo.uid">
|
||||
<view class="header bg-color-red acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ 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 @click="goPersonalData()" class="id" v-if="userInfo.phone">
|
||||
<text>ID:{{ userInfo.uid || 0}}</text>
|
||||
<text class="iconfont icon-bianji1"></text>
|
||||
</view>
|
||||
<button
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
class="binding"
|
||||
v-else
|
||||
>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="nav acea-row row-middle">
|
||||
<view @click="goUserAccount()" class="item">
|
||||
<text>我的余额</text>
|
||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text>
|
||||
</view>
|
||||
<view
|
||||
@click="goUserPromotion()"
|
||||
class="item"
|
||||
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"
|
||||
>
|
||||
<text>当前佣金</text>
|
||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goIntegral()" class="item" v-else>
|
||||
<text>当前积分</text>
|
||||
<text class="num">{{ userInfo.integral || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserCoupon()" class="item">
|
||||
<text>优惠券</text>
|
||||
<text class="num">{{ userInfo.couponCount || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myOrder">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<text>我的订单</text>
|
||||
<text @click="goMyOrder()" class="allOrder">
|
||||
<text>全部订单</text>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL + '/images/dfk.png'" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.unpaidCount > 0"
|
||||
>{{ userInfo.orderStatusNum.unpaidCount }}</text>
|
||||
</view>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(1)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dfh.png'" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.unshippedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.unshippedCount }}</text>
|
||||
</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(2)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dsh.png'" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.receivedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.receivedCount }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view @click="goMyOrder(3)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dpj.png'" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.evaluatedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.evaluatedCount }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view @click="goReturnList()" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sh.png'" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.refundCount > 0"
|
||||
>{{ userInfo.orderStatusNum.refundCount }}</text>
|
||||
</view>
|
||||
<text>售后/退款</text>
|
||||
</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 class="user">
|
||||
<view v-if="userInfo.uid">
|
||||
<view class="header bg-color-red acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ 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 @click="goPersonalData()" class="id" v-if="userInfo.phone">
|
||||
<text>ID:{{ userInfo.uid || 0}}</text>
|
||||
<text class="iconfont icon-bianji1"></text>
|
||||
</view>
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="nav acea-row row-middle">
|
||||
<view @click="goUserAccount()" class="item">
|
||||
<text>我的余额</text>
|
||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2">
|
||||
<text>当前佣金</text>
|
||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goIntegral()" class="item" v-else>
|
||||
<text>当前积分</text>
|
||||
<text class="num">{{ userInfo.integral || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserCoupon()" class="item">
|
||||
<text>优惠券</text>
|
||||
<text class="num">{{ userInfo.couponCount || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myOrder">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<text>我的订单</text>
|
||||
<text @click="goMyOrder()" class="allOrder">
|
||||
<text>全部订单</text>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL + '/images/dfk.png'" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text>
|
||||
</view>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(1)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dfh.png'" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text>
|
||||
</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(2)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dsh.png'" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view @click="goMyOrder(3)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/dpj.png'" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view @click="goReturnList()" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/sh.png'" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text>
|
||||
</view>
|
||||
<text>售后/退款</text>
|
||||
</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 style="text-align: center;margin-top: 1rem">By@意象</view>
|
||||
<view class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
</view>
|
||||
<view class="by">
|
||||
<text class="by-text">By@意象</text>
|
||||
</view>
|
||||
<view class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
v-on:changeswitch="changeswitch"
|
||||
:switchActive="switchActive"
|
||||
:login_type="userInfo.login_type"
|
||||
></SwitchWindow> -->
|
||||
</view>
|
||||
<Authorization v-else />
|
||||
</view>
|
||||
</view>
|
||||
<Authorization v-if="!$store.getters.token" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getUser, getMenuUser, bindingPhone } 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";
|
||||
import {
|
||||
getUser,
|
||||
getMenuUser,
|
||||
bindingPhone
|
||||
} 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 {
|
||||
name: NAME,
|
||||
components: {
|
||||
SwitchWindow,
|
||||
Authorization
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
methods: {
|
||||
goReturnList() {
|
||||
this.$yrouter.push("/pages/order/ReturnList/index");
|
||||
},
|
||||
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("/pages/user/PersonalData/index");
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
console.log(e.mp.detail);
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
|
||||
uni.showLoading({
|
||||
title: "绑定中"
|
||||
});
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
success: function(res) {
|
||||
console.log(res.provider);
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
uni.login({
|
||||
success: loginRes => {
|
||||
bindingPhone({
|
||||
code: loginRes.code,
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
this.User();
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已拒绝授权",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
changeswitch: function(data) {
|
||||
this.switchActive = data;
|
||||
},
|
||||
User: function() {
|
||||
let that = this;
|
||||
// getUser().then(res => {
|
||||
// that.user = res.data;
|
||||
// that.orderStatusNum = res.data.orderStatusNum;
|
||||
// });
|
||||
},
|
||||
MenuUser: function() {
|
||||
let that = this;
|
||||
getMenuUser().then(res => {
|
||||
that.MyMenus = res.data.routine_my_menus;
|
||||
});
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
SwitchWindow,
|
||||
Authorization
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
methods: {
|
||||
goReturnList() {
|
||||
this.$yrouter.push("/pages/order/ReturnList/index");
|
||||
},
|
||||
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("/pages/user/PersonalData/index");
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
console.log(e.mp.detail);
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
|
||||
uni.showLoading({
|
||||
title: "绑定中"
|
||||
});
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
success: function(res) {
|
||||
console.log(res.provider);
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
uni.login({
|
||||
success: loginRes => {
|
||||
bindingPhone({
|
||||
code: loginRes.code,
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
this.User();
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已拒绝授权",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
changeswitch: function(data) {
|
||||
this.switchActive = data;
|
||||
},
|
||||
User: function() {
|
||||
let that = this;
|
||||
// getUser().then(res => {
|
||||
// that.user = res.data;
|
||||
// that.orderStatusNum = res.data.orderStatusNum;
|
||||
// });
|
||||
},
|
||||
MenuUser: function() {
|
||||
let that = this;
|
||||
getMenuUser().then(res => {
|
||||
that.MyMenus = res.data.routine_my_menus;
|
||||
});
|
||||
},
|
||||
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;
|
||||
}
|
||||
if (
|
||||
url === "/pages/orderAdmin/OrderIndex/index" &&
|
||||
!this.userInfo.adminid
|
||||
) {
|
||||
uni.showToast({
|
||||
title: "您还不是管理员!!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$yrouter.push({
|
||||
path: this.MyMenus[index].uniapp_url
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userInfo() {
|
||||
this.MenuUser();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
this.MenuUser();
|
||||
this.isWeixin = isWeixin();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$yrouter.push({
|
||||
path: this.MyMenus[index].uniapp_url
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userInfo() {
|
||||
this.MenuUser();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
this.MenuUser();
|
||||
this.isWeixin = isWeixin();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.footer-line-height {
|
||||
height: 1rem;
|
||||
}
|
||||
<style lang="less">
|
||||
.footer-line-height {
|
||||
height: 1*100rpx;
|
||||
}
|
||||
|
||||
.order-status-num {
|
||||
min-width: 0.33rem;
|
||||
background-color: #fff;
|
||||
color: #73cbb6;
|
||||
border-radius: 15px;
|
||||
position: absolute;
|
||||
right: -0.14rem;
|
||||
top: -0.15rem;
|
||||
font-size: 0.2rem;
|
||||
padding: 0 0.08rem;
|
||||
border: 1px solid #73cbb6;
|
||||
}
|
||||
.order-status-num {
|
||||
min-width: 0.33*100rpx;
|
||||
background-color: #fff;
|
||||
color: #73cbb6;
|
||||
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 #73cbb6;
|
||||
}
|
||||
|
||||
.pictrue {
|
||||
position: relative;
|
||||
}
|
||||
.pictrue {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.switch-h5 {
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
.switch-h5 {
|
||||
margin-left: 0.2*100rpx;
|
||||
}
|
||||
|
||||
.binding {
|
||||
margin-top: 0.1rem;
|
||||
display: inline-block;
|
||||
padding: 0.05rem 0.2rem;
|
||||
background-color: #ca1f10;
|
||||
border-radius: 50px;
|
||||
font-size: 0.22rem;
|
||||
line-height: 1.5;
|
||||
border: 1px solid #e8695e;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
.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;
|
||||
margin-top: 30rpx
|
||||
}
|
||||
.by-text{
|
||||
text-align:center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
@ -197,7 +197,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="less">
|
||||
.banner swiper {
|
||||
height: 328rpx;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.address-management.on {
|
||||
background-color: #fff;
|
||||
height: 100vh;
|
||||
|
@ -128,7 +128,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
@ -99,5 +99,5 @@ export default {
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
<style lang="less">
|
||||
</style>
|
||||
|
@ -160,7 +160,7 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style lang="less">
|
||||
.list {
|
||||
}
|
||||
</style>
|
||||
|
@ -97,10 +97,10 @@
|
||||
<view class="mask" @touchmove.prevent :hidden="active === false"></view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.Loads .iconfont {
|
||||
font-size: 0.25rem;
|
||||
margin: 0.02rem 0 0 0.1rem;
|
||||
font-size: 0.25*100rpx;
|
||||
margin: 0.02*100rpx 0 0 0.1*100rpx;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user