123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <template>
- <view class="container">
- <!--用户信息-->
- <view class="header main-between cross-center">
- <view class="user-box main-left cross-center">
- <view class="head-img">
- <image src="@/static/image/default-head-img.png" />
- </view>
- <view class="nickname cross-center">未授权登陆</view>
- </view>
- <button open-type="getUserInfo" class="refresh" @click="handleGetUserInfo">刷新</button>
- </view>
- <!--充值-->
- <view class="recharge main-between cross-center">
- <view class="static-box main-left cross-center">
- <view class="icon">
- <image src="/static/image/gold-bag.png" mode="aspectFill" />
- </view>
- <view class="overage">3金币</view>
- </view>
- <view class="recharge-btn">充值</view>
- </view>
- <!--历史-->
- <view class="history" @click="$u.route('/pages/my/history')">
- <view class="header main-between cross-center">
- <text>历史观看记录</text>
- <u-icon name="arrow-right" :color="$colors.infoColor" bold />
- </view>
- <view class="content main-between cross-center">
- <view
- v-for="(item,index) in history"
- :key="index"
- class="episode"
- >
- <view class="cover-image">
- <image src="@/static/image/default-movie.png" mode="aspectFill" />
- </view>
- </view>
- </view>
- </view>
- <!--菜单-->
- <view class="menu-group">
- <button
- v-for="(menu,index) in menus"
- :key="index"
- class="menu-item main-between cross-center"
- :open-type="menu.type ? menu.type : ''"
- @click="handleMenu(menu)"
- >
- <view class="left-box dir-left-nowrap cross-center">
- <view class="icon">
- <image :src="menu.icon" />
- </view>
- <text>{{ menu.name }}</text>
- </view>
- <u-icon name="arrow-right" :color="$colors.infoColor" bold />
- </button>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'My',
- data() {
- return {
- history: [1, 2, 3, 4],
- menus: [
- { icon: '/static/image/my-page/order.png', name: '消费记录', href: '/pages/my/consume' },
- { icon: '/static/image/my-page/recharge.png', name: '充值记录', href: '/pages/my/recharge' },
- { icon: '/static/image/my-page/share.png', name: '分享好友', type: 'share' },
- { icon: '/static/image/my-page/contact.png', name: '联系客服', type: 'contact' },
- { icon: '/static/image/my-page/protocol.png', name: '用户协议', href: '/pages/my/protocol' }
- ]
- }
- },
- computed: {},
- methods: {
- handleMenu(menu) {
- if (menu.href) {
- this.$u.route(menu.href)
- }
- },
- handleGetUserInfo(detail) {
- uni.login({
- success: function(loginRes) {
- console.log(loginRes.authResult)
- // 获取用户信息
- uni.getUserInfo({
- success: function(infoRes) {
- console.log('-->data', infoRes)
- }
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- padding: 20px 20rpx 0;
- font-size: 30rpx;
- >.header{
- .user-box{
- .head-img{
- image{
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- }
- .nickname{
- color: $primary-color;
- margin-left: 30rpx;
- }
- }
- .refresh{
- background: $primary-color;
- color: #fff;
- border-radius: 30rpx;
- padding: 10rpx 0;
- width: 140rpx;
- text-align: center;
- letter-spacing: .1rem;
- line-height: initial;
- }
- }
- .recharge{
- background: url("/static/image/my-recharge-bg.png") no-repeat center;
- background-size: 100%;
- height: 200rpx;
- margin-top: 20rpx;
- margin-bottom: 10rpx;
- .static-box{
- margin-left: 30rpx;
- .icon{
- border-radius: 20rpx;
- image{
- width: 100rpx;
- height: 100rpx;
- }
- }
- .overage{
- font-weight: 800;
- margin-left: 20rpx;
- font-size: 32rpx;
- }
- }
- .recharge-btn{
- border: 1rpx solid #fff;
- padding: 10rpx 0 ;
- text-align: center;
- width: 140rpx;
- margin-right: 20rpx;
- border-radius: 30rpx;
- color: #ffffff;
- }
- }
- .history{
- background: #1B203C;
- height: 300rpx;
- border-radius: 15rpx;
- padding: 20rpx 30rpx;
- margin-bottom: 40rpx;
- >.header{
- text{
- color: $info-color;
- font-weight: 600;
- }
- }
- .content{
- margin-top: 20rpx;
- .episode{
- flex: 1;
- margin-left: 20rpx;
- &:first-child{
- margin-left: 0;
- }
- .cover-image{
- image{
- width: 100%;
- height: 200rpx;
- }
- }
- }
- }
- }
- .menu-group{
- .menu-item{
- padding: 20rpx 0;
- background: transparent;
- border: none;
- text-align: unset;
- width: 100%;
- line-height: initial;
- font-size: initial;
- justify-content: space-between;
- &:after{
- content: unset;
- }
- .left-box{
- flex: 1;
- .icon{
- transform: translateY(4rpx);
- image{
- width: 55rpx;
- height: 55rpx;
- }
- }
- text{
- color: #fff;
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- </style>
|