|
|
@@ -1,68 +1,178 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <view class="top-menu">
|
|
|
- <view class="">
|
|
|
- <text>1600</text>
|
|
|
- <text>会员数量</text>
|
|
|
- </view>
|
|
|
+ <view class="empty-page" v-if="!isOpenMember">
|
|
|
+ <image src="../../static/icon/vip.png" mode=""></image>
|
|
|
+ <text>没有会员中心信息</text>
|
|
|
|
|
|
- <view class="">
|
|
|
- <text>1600.00</text>
|
|
|
- <text>积分总价值</text>
|
|
|
+ <view class="cu-btn btn-bg-color round" style="width: 48%;height: 80rpx;position: fixed;bottom: 20%;">
|
|
|
+ <u-icon name="plus-circle" size="40"></u-icon>
|
|
|
+ <text class="margin-left-10 text-lg">创建会员中心</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="padding-20 text-bold text-xl">
|
|
|
- <text>会员列表</text>
|
|
|
- </view>
|
|
|
|
|
|
- <view class="card">
|
|
|
- <view class="flex">
|
|
|
- <view class="area1 title">
|
|
|
- 会员名称
|
|
|
+ <block v-else>
|
|
|
+ <view class="top-menu">
|
|
|
+ <view class="">
|
|
|
+ <text>{{detail.memberCount}}</text>
|
|
|
+ <text>会员数量</text>
|
|
|
</view>
|
|
|
- <view class="area2 title">
|
|
|
- 积分数
|
|
|
- </view>
|
|
|
- <view class="area3 title">
|
|
|
- 价值
|
|
|
+
|
|
|
+ <view class="">
|
|
|
+ <text>{{detail.totalPointValue}}</text>
|
|
|
+ <text>积分总价值</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="padding-20 text-bold text-xl">
|
|
|
+ <text>会员列表</text>
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="item" v-for="(item,index) in 4" :key="index">
|
|
|
- <view class="area1 flex text-bold">
|
|
|
- <image class="img-avatar" src="https://thirdwx.qlogo.cn/mmopen/vi_32/q6EwR5U6zFp8bYbUWb9HmFc5Q3R88x13Q0ZtOcVK5lO8AmtibQDRcuMA2Y7CmyuMCr6icceM3QibIKN2icAAxSvjpA/132"></image>
|
|
|
- <view class="center padding-left-10">
|
|
|
- <text>会员 123456</text>
|
|
|
+ <view class="card">
|
|
|
+ <view class="flex">
|
|
|
+ <view class="area1 title">
|
|
|
+ 会员名称
|
|
|
+ </view>
|
|
|
+ <view class="area2 title">
|
|
|
+ 积分数
|
|
|
+ </view>
|
|
|
+ <view class="area3 title">
|
|
|
+ 价值
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="area2 center text-bold text-lg" style="justify-content: flex-start;margin-left: 10rpx;color: #F37A1E;">
|
|
|
- <image class="img-points" src="../../static/icon/points-value.png"></image>
|
|
|
- <text class="margin-left-10">-100</text>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="area3 center text-lg" >
|
|
|
- <text class="text-price text-bold">10</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
|
|
|
- </view>
|
|
|
+ <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
|
|
+ :down="downOption" :up="upOption">
|
|
|
+ <view class="item" v-for="(item,index) in dataList" :key="index">
|
|
|
+ <view class="area1 flex text-bold">
|
|
|
+ <image class="img-avatar" :src="item.avatar">
|
|
|
+ </image>
|
|
|
+ <view class="center padding-left-10">
|
|
|
+ <text>{{item.nickName}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="area2 center text-bold text-lg"
|
|
|
+ style="justify-content: flex-start;margin-left: 10rpx;color: #F37A1E;">
|
|
|
+ <image class="img-points" src="../../static/icon/points-value.png"></image>
|
|
|
+ <text class="margin-left-10">{{item.pointTotal | numFilter}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="area3 center text-lg">
|
|
|
+ <text class="text-price text-bold">{{item.pointValue | numFilter}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mescroll-body>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
|
|
|
export default {
|
|
|
+ mixins: [MescrollMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ isOpenMember: false,
|
|
|
+ detail: {},
|
|
|
+ dataList: [],
|
|
|
+
|
|
|
+ downOption: {
|
|
|
+ use: false,
|
|
|
+ auto: false // 不自动加载
|
|
|
+ },
|
|
|
+ upOption: {
|
|
|
+ use: false,
|
|
|
+ auto: false // 不自动加载
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
+ onLoad() {
|
|
|
+ this.fetchShopDetail()
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ numFilter(value) {
|
|
|
+ let realVal = "";
|
|
|
+ if (!isNaN(value) && value !== "") {
|
|
|
+ // 截取当前数据到小数点后两位,改变toFixed的值即可截取你想要的数值
|
|
|
+ realVal = parseFloat(value).toFixed(2);
|
|
|
+ } else {
|
|
|
+ realVal = "--";
|
|
|
+ }
|
|
|
+ return realVal;
|
|
|
+ },
|
|
|
+ },
|
|
|
|
|
|
+ methods: {
|
|
|
+ fetchShopDetail() {
|
|
|
+ let params = {
|
|
|
+ id: this.vuex_mallId
|
|
|
+ }
|
|
|
+ this.$api.mall.detail(params).then(res => {
|
|
|
+ if (res.data.isOpenMember == 1) {
|
|
|
+ this.isOpenMember = true
|
|
|
+ this.detail = res.data
|
|
|
+ //加载会员中心
|
|
|
+ this.useOption()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ downCallback() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.mescroll.resetUpScroll();
|
|
|
+ }, 800)
|
|
|
+ },
|
|
|
+ useOption() {
|
|
|
+ this.downOption = {
|
|
|
+ use: true,
|
|
|
+ auto: true
|
|
|
+ }
|
|
|
+ this.upOption = {
|
|
|
+ use: true,
|
|
|
+ auto: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ upCallback(mescroll) {
|
|
|
+ let params = {
|
|
|
+ mallId: this.vuex_mallId,
|
|
|
+ current: mescroll.num,
|
|
|
+ size: mescroll.size,
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.$api.memberCenter.list(params).then(res => {
|
|
|
+ let data = res.data.records
|
|
|
+ let total = res.data.total
|
|
|
+ mescroll.endBySize(data.length, total);
|
|
|
+ if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
|
|
+ this.dataList = this.dataList.concat(data); //追加新数据
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ this.mescroll.endErr()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ .btn-bg-color {
|
|
|
+ background-color: #EE9230;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .empty-page {
|
|
|
+ height: 50vh;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ color: #CCCCCC;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.top-menu {
|
|
|
border-radius: 20rpx;
|
|
|
margin: 30rpx 20rpx;
|