兼容非小程序端手机号绑定的功能

This commit is contained in:
Gao xiaosong
2020-09-13 02:28:50 +08:00
parent a190523c10
commit b706b4f104

View File

@ -18,14 +18,17 @@
<text>ID{{ userInfo.uid || 0}}</text>
<text class="iconfont icon-bianji1"></text>
</view>
<button
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
class="binding"
v-else
>
<!-- #ifdef MP-WEIXIN -->
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
<text>绑定手机号</text>
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<button class="binding" @click="goBindPhone()" v-else>
<text>绑定手机号</text>
</button>
<!-- #endif -->
</view>
</view>
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
@ -36,11 +39,7 @@
<text>我的余额</text>
<text class="num">{{ userInfo.nowMoney || 0 }}</text>
</view>
<view
@click="goUserPromotion()"
class="item"
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"
>
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2">
<text>当前佣金</text>
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
</view>
@ -65,50 +64,40 @@
<view @click="goMyOrder(0)" class="item">
<view class="pictrue">
<image src="@/static/images/dfk.png" />
<text
class="order-status-num"
v-if="userInfo.orderStatusNum.unpaidCount > 0"
>{{ userInfo.orderStatusNum.unpaidCount }}</text>
<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="@/static/images/dfh.png" />
<text
class="order-status-num"
v-if="userInfo.orderStatusNum.unshippedCount > 0"
>{{ userInfo.orderStatusNum.unshippedCount }}</text>
<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="@/static/images/dsh.png" />
<text
class="order-status-num"
v-if="userInfo.orderStatusNum.receivedCount > 0"
>{{ userInfo.orderStatusNum.receivedCount }}</text>
<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="@/static/images/dpj.png" />
<text
class="order-status-num"
v-if="userInfo.orderStatusNum.evaluatedCount > 0"
>{{ userInfo.orderStatusNum.evaluatedCount }}</text>
<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="@/static/images/sh.png" />
<text
class="order-status-num"
v-if="userInfo.orderStatusNum.refundCount > 0"
>{{ userInfo.orderStatusNum.refundCount }}</text>
<text class="order-status-num"
v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text>
</view>
<text>售后/退款</text>
</view>
@ -148,9 +137,21 @@
</view>
</template>
<script>
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";
import { getUserInfo, getMenuUser, bindingPhone } from "@/api/user";
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils";
import {
mapState,
mapGetters,
mapMutations,
mapActions
} from "vuex";
import {
getUserInfo,
getMenuUser,
bindingPhone
} from "@/api/user";
import {
isWeixin,
VUE_APP_RESOURCES_URL
} from "@/utils";
import SwitchWindow from "@/components/SwitchWindow";
import Authorization from "@/pages/authorization/index";
@ -184,6 +185,11 @@ export default {
}
});
},
goBindPhone(){
this.$yrouter.push({
path: "/pages/user/BindingPhone/index",
});
},
goUserCoupon() {
this.$yrouter.push("/pages/user/coupon/UserCoupon/index");
},
@ -237,8 +243,7 @@ export default {
thit.$store.dispatch("userInfo", true);
console.log(error);
uni.showToast({
title:
error.msg ||
title: error.msg ||
error.response.data.msg ||
error.response.data.message,
icon: "none",
@ -398,6 +403,7 @@ export default {
text-align: center;
padding: 30rpx 0;
}
.by-text {
text-align: center;
font-size: 24rpx;