| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <template>
- <view class="population">
- <view class="integral-left border-index">
- <view class="integral-title">
- <text>{{hasLogin?'亲爱的会员':'游客'}}</text>
- </view>
- <view class="integral-content">
- <view class="mark">
- </view>
- <view class="int-item" @click="loadMore('/user/page/scoreAccumulate')">
- <text class="tit">积分</text>
- <view class="val">{{ userInfo.integral*1 || '0' }}</view>
- <view class="look-more">立即查看</view>
- </view>
-
- <view class="int-item" @click="loadMore('/pages/product/discount')">
- <text class="tit">优惠券</text>
- <view class="val">{{couponNum || 0}}</view>
- <view class="look-more">立即查看</view>
- </view>
- <view class="int-item item-bt" @click="loadMore('/user/page/myex')">
- <text class="tit">兑换券</text>
- <view class="val">{{userInfo.uid ? ett : 0}}</view>
- <view class="look-more">立即查看</view>
- </view>
- <view class="int-item item-bt" @click="loadMore('/pages/money/wallet')">
- <text class="tit">余额</text>
- <view class="val ">{{getMoney(userInfo.now_money) || '0'}}</view>
- <view class="look-more">立即查看</view>
- </view>
- </view>
- </view>
- <view class="integral-right">
- <view class="own border-index" @click="load(1)">
- <view><image src="../../../static/img/take-from-oneself.png"></image></view>
- <view class="one">
- <b>门店自取</b><br/><text>下单免排队</text>
- </view>
- </view>
- <view class="takeaway border-index" @click="load(2)">
- <image src="../../../static/img/Takeaway.png"></image>
- <view class="one">
- <b>外送到家</b><br/><text>上门配送到家</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { saveUrl, interceptor } from '@/utils/loginUtils.js';
- import { mapState, mapMutations } from 'vuex';
- import { getMoneyStyle } from '@/utils/rocessor.js';
- export default {
- filters: {
- getMoneyStyle,
- },
- data() {
- return {
-
- }
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- props: ["dhqList","couponNum",'ett'],
- methods: {
- ...mapMutations('user', ['setDistribution']),
- loadMore(url) {
- if(this.hasLogin) {
- uni.navigateTo({
- url:url
- })
- }else {
- saveUrl();
- // 登录拦截
- interceptor();
- }
-
- },
- load(url) {
- this.setDistribution(url)
- uni.switchTab({
- url: '/pages/menu/menu'
- });
- },
- getMoney(value) {
- if (typeof value == 'string') {
- value = (+value).toFixed(2)
- }
- if (typeof value == 'number') {
- value = value.toFixed(2)
- }
- if(value*1 > 1000 && value*1 <= 10000) {
- value = (value*1).toFixed(0)
- }
- if(value*1 > 10000 && value*1 <= 100000) {
- value = value*1/10000
- value = (value*1).toFixed(2) + '万'
- }
- if(value*1 > 100000 && value*1 < 984900) {
- value = value*1/10000
- value = (value*1).toFixed(1) + '万'
- }
- if(value*1 > 984900) {
- value = value*1/10000
- value = (value*1).toFixed(0) + '万'
- }
- return value;
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .population {
- display: flex;
- }
- .integral-left {
- margin: 27rpx;
- flex: 1;
- height: 423rpx;
- position: relative;
- }
-
- .integral-right {
- flex: 1;
- height: 423rpx;
- margin: 27rpx;
- margin-left: 0;
- display: grid;
-
- image {
- float: left;
- margin: 55rpx 5rpx 0 45rpx;
- }
-
- .one {
- text-align: center;
- margin: 55rpx 10rpx 0 0;
-
- text {
- color: #989B9F;
- font-size: 22rpx;
- margin-top: 4rpx;
- }
-
- b {
- color: #333333;
- font-family: PingFang-SC-Bold;
- font-size: 39rpx;
- }
- }
- view {
- // display: flex;
- }
-
- .own {
- margin-bottom: 14rpx;
-
- image {
- width: 75rpx;
- height: 83rpx;
- }
- }
-
- .takeaway {
- margin-top: 14rpx;
-
- image {
- width: 83rpx;
- height: 75rpx;
- }
- }
- }
- .integral-title {
- margin-top: 30rpx;
- text-align: center;
- height: 100rpx;
- color: #901B21;
- font-family: PingFang-SC-Bold;
- }
-
- .integral-content {
- width: 264rpx;
- height: 264rpx;
-
- background-color: #ecd49e;
- position: absolute;
- bottom: 34rpx;
- left: 0;
- right: 0;
- margin: auto;
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- // align-items: ;
- .int-item {
- width: 49.6%;
- height: 49.6%;
- background-color: #fff;
- text-align: center;
- display: flex;
- flex-direction: column;
- // flex-wrap: nowrap;
- justify-content: space-around;
- .tit {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .val {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .look-more {
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #989B9F;
- }
- }
- .item-bt {
- align-self: flex-end;
- }
- .mark {
- width: 24rpx;
- height: 38rpx;
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- margin: auto;
- background-color: #fff;
- }
- // // margin-top: -25rpx;
- // text-align: center;
- // // display: grid;
- // // grid-template-columns: 50% 50%;
- // // grid-template-rows: 60% 60%;
- // width: 100%;
- // display: flex;
- // flex-wrap: wrap;
- // position: relative;
-
- // .lines {
- // width: 2rpx;
- // height: 120rpx;
- // background: #DCB876;
- // position: absolute;
- // left: 0;
- // right: 0;
- // margin: auto;
- // }
- // .lineh {
- // width: 120rpx;
- // height: 2rpx;
- // background: #DCB876;
- // position: absolute;
- // top: 0;
- // bottom: 0;
- // margin: auto;
- // }
- // .line1 {
- // top: 0;
- // }
- // .line4 {
- // bottom: 0;
- // }
- // .line2 {
- // left: 35rpx;
- // }
- // .line3 {
- // right: 35rpx;
- // }
- // .int-item {
- // width: 50%;
- // height: 50%;
- // padding: 20rpx 0;
- // .val {
- // padding: 5rpx 0;
- // }
- // }
- // .int-item-t {
- // padding-top: 0;
- // }
- // view {
- // text-align: center;
- // }
-
- // text {
- // color: #333333;
- // font-size: 30rpx;
- // font-family: PingFang-SC-Medium;
- // }
- // .exchangeOsee {
- // color: #989B9F;
- // font-size: 20rpx;
- // }
-
- // $integral-border: solid 2rpx #DCB876;
-
- // .integral {
-
- // }
-
- // .exchange-certificate {
-
- // }
-
- // .extension {
-
- // }
-
- // .balance {
-
- // }
-
-
- }
- </style>
|