Commit daacd53e by weijiguang

调整 我的,未登录样式

parent 45e25d9d
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
computed: { computed: {
totalNum() { totalNum() {
let totalNum = 0; let totalNum = 0;
this.orderInfo.orderDetails.map(item => { this.orderInfo.orderDetails.forEach(item => {
totalNum += parseInt(item.num); totalNum += parseInt(item.num);
}) })
return totalNum; return totalNum;
......
...@@ -15,13 +15,11 @@ ...@@ -15,13 +15,11 @@
</view> </view>
</view> </view>
<button class="mod11 flex-col" v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立刻登录</button> <button class="mod11 flex-col" v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立刻登录</button>
<view class="contents"> <view class="contents" v-if="userms">
<view class="myOrder" @click="goToPage('order')"> <view class="myOrder" @click="goToPage('order')">
<view class="order1">我的订单</view> <view class="order1">我的订单</view>
<view class="order2">点击查看订单</view> <view class="order2">点击查看订单</view>
<view> <view><image class="orderImg" src="/static/imgs/myOrder.png"></image></view>
<image class="orderImg" src="../../static/imgs/myOrder.png"></image>
</view>
</view> </view>
<view class="right_box"> <view class="right_box">
<view class="box" @click.stop="goToPage('coupon')"> <view class="box" @click.stop="goToPage('coupon')">
...@@ -29,24 +27,41 @@ ...@@ -29,24 +27,41 @@
<h3>HOOLOO券</h3> <h3>HOOLOO券</h3>
<view class="dec">优惠多多不要错过</view> <view class="dec">优惠多多不要错过</view>
</view> </view>
<view class="right"> <view class="right"><image class="right_img" src="/static/imgs/my3.png"></image></view>
<image class="right_img" src="../../static/imgs/my3.png"></image>
</view>
</view> </view>
<view class="box two"> <view class="box two" @click="goToPage('msg')">
<button v-if="!userms" class="payment" open-type="getPhoneNumber" @getphonenumber.stop="goToPage"></button> <view class="left">
<view @click="goToPage('msg')" class="left">
<h3>我的消息</h3> <h3>我的消息</h3>
<view class="dec">点击查看我的消息</view> <view class="dec">点击查看我的消息</view>
</view> </view>
<view @click="goToPage('msg')" class="right msg"> <view class="right"><image class="right_img" src="/static/imgs/myMail.png"></image></view>
<div class="unread_number" v-if="UnreadNumber">{{UnreadNumber}}</div>
<image class="right_img" src="../../static/imgs/myMail.png"></image>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="function"> <view class="contents" v-if="!userms">
<button class="myOrder" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<view class="order3">我的订单</view>
<view class="order4">点击查看订单</view>
<view><image class="orderImg1" src="/static/imgs/myOrder.png"></image></view>
</button>
<view class="right_box">
<button class="box" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<view class="left">
<h3>HOOLOO券</h3>
<view class="dec">优惠多多不要错过</view>
</view>
<view class="right"><image class="right_img" src="/static/imgs/my3.png"></image></view>
</button>
<button class="box two" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<view class="left">
<h3>我的消息</h3>
<view class="dec">点击查看我的消息</view>
</view>
<view class="right"><image class="right_img" src="/static/imgs/myMail.png"></image></view>
</button>
</view>
</view>
<view v-if="userms" class="function">
<h3>常用功能</h3> <h3>常用功能</h3>
<view class="function_item"> <view class="function_item">
<u-icon name="server-fill" color="#000000" size="16"></u-icon> <u-icon name="server-fill" color="#000000" size="16"></u-icon>
...@@ -60,7 +75,6 @@ ...@@ -60,7 +75,6 @@
<script> <script>
import User from '@/request/user' import User from '@/request/user'
import Mine from '@/request/mine'
export default { export default {
onLoad() { onLoad() {
...@@ -70,15 +84,9 @@ export default { ...@@ -70,15 +84,9 @@ export default {
}) })
} }
}, },
onShow() {
if(this.userms){
this.getMessageCount()
}
},
data() { data() {
return { return {
loginInfo:"", loginInfo:""
UnreadNumber:""
} }
}, },
computed: { computed: {
...@@ -94,30 +102,28 @@ export default { ...@@ -94,30 +102,28 @@ export default {
getPhoneNumber(e) { getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') { if (e.detail.errMsg == 'getPhoneNumber:ok') {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e,this.getMessageCount); User.getPhoneNumber(e);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ title: '已拒绝手机号授权', icon: 'error' }) uni.showToast({ title: '已拒绝手机号授权', icon: 'error' })
} }
}, },
goToPage(page) { goToPage(page) {
page == 'coupon' && uni.showToast({ title: '功能未开放!', icon: 'none' });
if (!this.userms) { if (!this.userms) {
this.getPhoneNumber(page) // this.loginByPhoneNumber(page)
return return
} }
page == 'order' && uni.switchTab({ url: '/pages/order/order' }) page == 'order' && uni.switchTab({ url: '/pages/order/order' })
page == 'coupon' && uni.showToast({ title: '功能未开放!', icon: 'none' });
page == 'msg' && uni.navigateTo({ url: '/mineSubPackage/pages/msg/index' }) page == 'msg' && uni.navigateTo({ url: '/mineSubPackage/pages/msg/index' })
},
async getMessageCount() {
const {data} = await Mine.getMessageCount()
const num = data&&Number(data.data)!=0?data.data:''
this.UnreadNumber = num
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
button::after {
border: none;
}
.payment { .payment {
border-radius: 0; border-radius: 0;
display: block; display: block;
...@@ -150,17 +156,13 @@ export default { ...@@ -150,17 +156,13 @@ export default {
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600; font-weight: 600;
color: #FFFFFF; color: #FFFFFF;
} }
} }
image { image {
width: 100%; width: 100%;
height: 376rpx; height: 376rpx;
} }
} }
.mod11 { .mod11 {
...@@ -200,13 +202,13 @@ export default { ...@@ -200,13 +202,13 @@ export default {
margin: 34rpx auto; margin: 34rpx auto;
width: 692rpx; width: 692rpx;
.myOrder { .myOrder {
width: 270rpx; width: 270rpx;
height: 272rpx; height: 272rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
padding: 0 36rpx;
.order1 { .order1 {
font-size: 28rpx; font-size: 28rpx;
...@@ -222,7 +224,6 @@ export default { ...@@ -222,7 +224,6 @@ export default {
font-weight: 400; font-weight: 400;
color: #323232; color: #323232;
margin-top: 10rpx; margin-top: 10rpx;
} }
.orderImg { .orderImg {
...@@ -231,6 +232,29 @@ export default { ...@@ -231,6 +232,29 @@ export default {
margin: 0 auto; margin: 0 auto;
margin-top: 50rpx; margin-top: 50rpx;
} }
.order3 {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
margin-top: 10rpx;
}
.order4 {
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #323232;
margin-top: -20rpx;
}
.orderImg1 {
width: 70rpx;
height: 80rpx;
margin: 0 auto;
margin-top: 20rpx;
}
} }
.right_box { .right_box {
...@@ -250,24 +274,6 @@ export default { ...@@ -250,24 +274,6 @@ export default {
&.two { &.two {
margin-top: 15rpx; margin-top: 15rpx;
.msg{
position: relative;
.unread_number{
background-color: #ff73bf;
width: 25rpx;
height: 25rpx;
font-size: 15rpx;
color: white;
line-height: 25rpx;
text-align: center;
border-radius: 25rpx;
font-weight: bolder;
position: absolute;
right: -10rpx;
top: -10rpx;
}
}
} }
.left { .left {
...@@ -289,14 +295,11 @@ export default { ...@@ -289,14 +295,11 @@ export default {
margin-top: 10rpx margin-top: 10rpx
} }
.right_img { .right_img {
width: 80rpx; width: 80rpx;
height: 55rpx; height: 55rpx;
} }
} }
} }
.function { .function {
...@@ -307,7 +310,6 @@ export default { ...@@ -307,7 +310,6 @@ export default {
padding: 25rpx; padding: 25rpx;
box-sizing: border-box; box-sizing: border-box;
h3 { h3 {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -343,11 +345,9 @@ export default { ...@@ -343,11 +345,9 @@ export default {
border: unset; border: unset;
} }
.function_item_icon { .function_item_icon {
margin-left: auto; margin-left: auto;
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment