|
@@ -1,169 +1,197 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="box">
|
|
|
|
|
- <view v-if="giveList.length>0 || gotList.length > 0 ">
|
|
|
|
|
- <view style="margin: 32rpx 0;">
|
|
|
|
|
- <text v-if="giveList.length>0" >我收到的亲情卡</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="getCard Card" v-for="item in gotList" @click="jumpToDetail(item)">
|
|
|
|
|
- <view style="display: flex;align-items: center">
|
|
|
|
|
- <u-avatar :src="item.url || '/static/me/ud4.png'"></u-avatar>
|
|
|
|
|
- <text style="margin:0 10rpx;color:#FFFFFF ">{{ item.presentUserName }}{{ item.presentUserNo }}送的亲情卡</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="Lines">
|
|
|
|
|
- <view style="float: contour;margin:0 10rpx;color:#FFFFFF;text-align: center">
|
|
|
|
|
- <text >可用额度</text>
|
|
|
|
|
- <view style="font-size: 48rpx;font-weight: bold">{{ item.totalBalance || 0 }}</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view style="float: contour;margin:0 10rpx;color:#FFFFFF;text-align: center">
|
|
|
|
|
- <text >已用额度</text>
|
|
|
|
|
- <view style="font-size: 48rpx;font-weight: bold">{{ item.amount || 0 }}</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view style="margin: 32rpx 0;">
|
|
|
|
|
- <text v-if="giveList.length>0" >我赠送的亲情卡</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="postCard Card" v-for="item in giveList" @click="jumpToDetail(item)">
|
|
|
|
|
- <view style="display: flex;align-items: center">
|
|
|
|
|
- <u-avatar :src="item.url || '/static/me/ud4.png'"></u-avatar>
|
|
|
|
|
- <text style="margin:0 10rpx;">{{ item.userName }}{{ item.userNo }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="Lines">
|
|
|
|
|
- <view style="text-align: center">
|
|
|
|
|
- <text >可用额度</text>
|
|
|
|
|
- <view style="font-size: 48rpx;font-weight: bold;text-align: center">{{ item.totalBalance || 0 }}</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view>
|
|
|
|
|
- <text >已用额度</text>
|
|
|
|
|
- <view style="font-size: 48rpx;font-weight: bold;text-align: center">{{ item.amount || 0 }}</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-if="giveList.length == 0 && gotList.length == 0 " style="text-align: center" >
|
|
|
|
|
- <image style="transform: scale(0.5)" src="../../static/logo.png" ></image>
|
|
|
|
|
- <h1 style="font-size: 28px;margin: 15px">亲情卡</h1>
|
|
|
|
|
- <p>让支付更简单</p>
|
|
|
|
|
- <p style="color: #b4b4b4">暂无亲情卡</p>
|
|
|
|
|
|
|
+ <view class="page">
|
|
|
|
|
+ <view class="scroll-y">
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="bottonStyle">
|
|
|
|
|
- <view class="agreement-content">
|
|
|
|
|
- <u-icon v-if="choose" name="/static/order/isCheck.png" color="#2979ff" size="20" @click="changeChoose"></u-icon>
|
|
|
|
|
- <u-icon v-else name="/static/order/notCheck.png" color="#01a520" size="20" @click="changeChoose"></u-icon>
|
|
|
|
|
- <view class="agreement">
|
|
|
|
|
- <text>我已阅读并同意</text>
|
|
|
|
|
- <text @click="gotoAgreement('1','会员须知')" class="text-color">使用说明</text>
|
|
|
|
|
|
|
+ <view class="title">
|
|
|
|
|
+ <text>我收到的亲情卡</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="loveCard" v-if="gotList.length === 0">
|
|
|
|
|
+ <view class="flex-row justify-center">
|
|
|
|
|
+ <image src="/static/me/zhanwu.png" class="nullIcon"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-row justify-center nullMsg">
|
|
|
|
|
+ <text>暂无收到的亲情卡</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view v-else>
|
|
|
|
|
+ <view class="loveCard" v-for="(item,index) in gotList" :key="index" @click="jumpToDetail(item)">
|
|
|
|
|
+ <image src="/static/familyCard/shoudaoLove.png" class="imgBack"></image>
|
|
|
|
|
+ <view class="loveCardMsg">
|
|
|
|
|
+ <view class="flex-row">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <image :src="item.url || '/static/me/ud4.png'" class="avatar"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-col">
|
|
|
|
|
+ <text class="name">{{item.presentUserName}}</text>
|
|
|
|
|
+ <text class="vipNo">{{item.presentUserNo}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-row justify-between">
|
|
|
|
|
+ <view class="flex-col priceView">
|
|
|
|
|
+ <text class="priceTitle">可用额度</text>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <!--<text class="priceSymbol">¥</text>-->
|
|
|
|
|
+ <text class="price">{{item.totalBalance || 0}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-col priceView borderRight1">
|
|
|
|
|
+ <text class="priceTitle">已用额度</text>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <!--<text class="priceSymbol">¥</text>-->
|
|
|
|
|
+ <text class="price">{{item.amount || 0}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="title">
|
|
|
|
|
+ <text>我赠送的亲情卡</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="loveCard" v-if="giveList.length === 0">
|
|
|
|
|
+ <view class="flex-row justify-center">
|
|
|
|
|
+ <image src="/static/me/zhanwu.png" class="nullIcon"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-row justify-center nullMsg">
|
|
|
|
|
+ <text>暂无赠送的亲情卡</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view v-else>
|
|
|
|
|
+ <view class="loveCard" v-for="(item, index) in giveList" :key="index" @click="jumpToDetail(item)">
|
|
|
|
|
+ <image src="/static/familyCard/zengsLove.png" class="imgBack"></image>
|
|
|
|
|
+ <view class="loveCardMsg">
|
|
|
|
|
+ <view class="flex-row">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <image :src="item.url || '/static/me/ud4.png'" class="avatar"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-col">
|
|
|
|
|
+ <text class="name">{{item.userName}}</text>
|
|
|
|
|
+ <text class="vipNo">{{item.userNo}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-row justify-between">
|
|
|
|
|
+ <view class="flex-col priceView">
|
|
|
|
|
+ <text class="priceTitle">可用额度</text>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <!--<text class="priceSymbol">¥</text>-->
|
|
|
|
|
+ <text class="price">{{item.totalBalance || 0}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-col priceView borderRight2">
|
|
|
|
|
+ <text class="priceTitle">已用额度</text>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <!--<text class="priceSymbol">¥</text>-->
|
|
|
|
|
+ <text class="price">{{item.amount || 0}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="bottom">
|
|
|
|
|
+ <view class="flex-row justify-center agreementView">
|
|
|
|
|
+ <u-icon name="/static/me/o1.png" size="20" v-if="choose" @click="changeChoose"></u-icon>
|
|
|
|
|
+ <u-icon name="/static/me/o.png" size="20" v-else @click="changeChoose"></u-icon>
|
|
|
|
|
+ <text class="read">我已阅读并同意</text>
|
|
|
|
|
+ <text class="agreement" @click="gotoAgreement">使用说明</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="zsBtn" @click="jumpToGive">赠送亲情卡</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- <button class="buttonStyle" @click="jumpToGive" >
|
|
|
|
|
- <text style="font-size: 18px;" >
|
|
|
|
|
- 赠送亲情卡
|
|
|
|
|
- </text>
|
|
|
|
|
- </button>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- </view>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-export default {
|
|
|
|
|
- name: "index",
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ name: "index",
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
|
|
|
- choose:false,
|
|
|
|
|
- giveList: [],
|
|
|
|
|
- gotList: []
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- onShow() {
|
|
|
|
|
- this.getGiveList()
|
|
|
|
|
- this.getGotList()
|
|
|
|
|
- },
|
|
|
|
|
- onPullDownRefresh(){
|
|
|
|
|
- this.getGiveList()
|
|
|
|
|
- this.getGotList()
|
|
|
|
|
- uni.stopPullDownRefresh()
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- changeChoose(){
|
|
|
|
|
- this.choose =!this.choose
|
|
|
|
|
- },
|
|
|
|
|
- // 去协议页面
|
|
|
|
|
- gotoAgreement(type, name) {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/myPages/TermsOfService/index?name=' + name + '&type=' + type,
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- jumpToGive() {
|
|
|
|
|
- if(!this.choose){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 3000,
|
|
|
|
|
- title: '请勾选使用说明'
|
|
|
|
|
- });
|
|
|
|
|
- }else {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/myPages/familyCard/giveFamilyCard/giveFamilyCard'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- jumpToDetail(item) {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/myPages/familyCard/unbindFamilyCard/unbindFamilyCard?data=' + JSON.stringify(item)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- getImgUrlByOssId(list, number) {
|
|
|
|
|
- if (list) {
|
|
|
|
|
- list.forEach((e) => {
|
|
|
|
|
- let data = null
|
|
|
|
|
- if (number == 1) {
|
|
|
|
|
- data = e.presentUserPhoto
|
|
|
|
|
|
|
+ choose: false,
|
|
|
|
|
+ giveList: [],
|
|
|
|
|
+ gotList: []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ this.getGiveList()
|
|
|
|
|
+ this.getGotList()
|
|
|
|
|
+ },
|
|
|
|
|
+ onPullDownRefresh() {
|
|
|
|
|
+ this.getGiveList()
|
|
|
|
|
+ this.getGotList()
|
|
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ changeChoose() {
|
|
|
|
|
+ this.choose = !this.choose
|
|
|
|
|
+ },
|
|
|
|
|
+ // 去协议页面
|
|
|
|
|
+ gotoAgreement(type, name) {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/myPages/TermsOfService/index?name=' + name + '&type=' + type,
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ jumpToGive() {
|
|
|
|
|
+ if (!this.choose) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 3000,
|
|
|
|
|
+ title: '请勾选使用说明'
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/myPages/familyCard/giveFamilyCard/giveFamilyCard'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ jumpToDetail(item) {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/myPages/familyCard/unbindFamilyCard/unbindFamilyCard?data=' + JSON.stringify(item)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getImgUrlByOssId(list, number) {
|
|
|
|
|
+ if (list) {
|
|
|
|
|
+ list.forEach((e) => {
|
|
|
|
|
+ let data = null
|
|
|
|
|
+ if (number == 1) {
|
|
|
|
|
+ data = e.presentUserPhoto
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
|
- data = e.userPhoto
|
|
|
|
|
- }
|
|
|
|
|
- if (data) {
|
|
|
|
|
- this.$api.getImage(data).then(res => {
|
|
|
|
|
- e.url = res.data.data[0].url.replace(/^http:/, "https:")
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- this.$forceUpdate()
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getGiveList() {
|
|
|
|
|
- this.$api.getMyPresentList().then((res) => {
|
|
|
|
|
- this.giveList = res.data.data
|
|
|
|
|
- this.getImgUrlByOssId(this.giveList, 1)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data = e.userPhoto
|
|
|
|
|
+ }
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ this.$api.getImage(data).then(res => {
|
|
|
|
|
+ e.url = res.data.data[0].url.replace(/^http:/, "https:")
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getGiveList() {
|
|
|
|
|
+ this.$api.getMyPresentList().then((res) => {
|
|
|
|
|
+ this.giveList = res.data.data
|
|
|
|
|
+ this.getImgUrlByOssId(this.giveList, 1)
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
- getGotList() {
|
|
|
|
|
- this.$api.getMyReceiveList().then((res) => {
|
|
|
|
|
- this.gotList = res.data.data
|
|
|
|
|
- this.getImgUrlByOssId(this.giveList, 2)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ getGotList() {
|
|
|
|
|
+ this.$api.getMyReceiveList().then((res) => {
|
|
|
|
|
+ this.gotList = res.data.data
|
|
|
|
|
+ this.getImgUrlByOssId(this.giveList, 2)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style scoped >
|
|
|
|
|
-@import "/myPages/familyCard/index.scss";
|
|
|
|
|
-.agreement-content {
|
|
|
|
|
- margin: 18px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- color: #999999;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-}
|
|
|
|
|
-.text-color {
|
|
|
|
|
- color: #032574;
|
|
|
|
|
-}
|
|
|
|
|
-.agreement {
|
|
|
|
|
- color: rgb(96, 98, 102);
|
|
|
|
|
- padding: 0 20rpx;
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+ @import "../familyCard/index.scss";
|
|
|
</style>
|
|
</style>
|