Files
cashier_weapp/pages/member/list.vue

214 lines
5.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="content">
<view class="onecontentone">
我的会员卡<text v-if="list.length!=0">({{list.length}})</text>
</view>
<view class="flex-colum">
<view class="towcontentitem" v-if="list.length>0" v-for="(item,index) in list" :key="index"
@click="eeInfo(item)">
<image class="towcontentitemimage"
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
<view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
<!-- 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
<text>{{item.shopName}}</text>
</view>
</view>
</view>
<view v-if="list.length <= 0 && is_end" class="flex-colum">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
</view>
</template>
<script>
export default {
data() {
return {
bgnothave: uni.getStorageSync('bgnothave'),
list: [],
is_end: false,
nickname: uni.cache.get('userInfo').nickName,
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
},
userId: uni.cache.get('userInfo').id,
type: null,
}
},
onLoad(e) {
console.log(e)
if ( e.type ) {
this.type = e.type;
}
},
onShow() {
this.list = []
this.form = {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
},
this.paygetShopByMember()
},
onReachBottom() {
this.paygetShopByMember()
},
computed: {},
methods: {
async paygetShopByMember() {
let res = await this.api.paygetShopByMember({
page: this.form.page,
pageSize: this.form.size,
userId: uni.cache.get('userInfo').id,
shopId: ''
})
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
if (this.form.page == 1 && res.data.list == 0) {
this.is_end = true
}
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
},
async eeInfo(item) {
let res = await this.api.shopUserInfo({
"shopId": item.shopId,
"userId": uni.cache.get('userInfo').id,
})
if ( res.code == 0 ) {
uni.cache.set('shopUserInfo',res.data)
uni.cache.set('shopId', item.shopId)
if ( this.type && this.type == 'user_payCode') {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(item)
})
} else if ( this.type && this.type == 'user_recharge') {
uni.pro.navigateTo('member/index', {
shopId: item.shopId,
type: 'index',
})
} else {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: item.shopId
})
}
}
},
}
}
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.content {
border-top: 16rpx solid #f7f7f7;
padding: 28rpx;
padding-bottom: 40rpx;
.flex-colum_image {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
text {
margin-top: 30rpx;
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #666666;
}
}
.onecontentone {
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
}
.flex-colum {
.towcontentitem {
margin-top: 22rpx;
width: 96%;
position: relative;
height: 224rpx;
padding: 32rpx;
border-radius: 12rpx;
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 9;
}
.towcontentitemone {
position: relative;
z-index: 10;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
width: 60%;
margin-left: 16rpx;
font-size: 32rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #422A07;
}
}
.towcontentitemtow {
z-index: 10;
position: absolute;
width: 100%;
left: 0;
bottom: 18rpx;
padding: 0 32rpx;
// margin-top: 52rpx;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
}
</style>