|
|
@@ -1,39 +1,68 @@
|
|
|
<template>
|
|
|
<view class="box">
|
|
|
- <text v-if="gotList.length>0" style="margin-bottom: 24rpx">我收到的亲情卡</text>
|
|
|
-
|
|
|
- <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 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 class="Lines">
|
|
|
- <text style="float: right;margin:0 10rpx;color:#FFFFFF ">已用额度</text>
|
|
|
- <view style="font-size: 48rpx;font-weight: bold;color: #FFFFFF;text-align: center">{{ item.amount || 0 }}</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 style="display: flex;justify-content:space-between;margin: 32rpx 0;">
|
|
|
- <text>我赠送的亲情卡</text>
|
|
|
- <view style="color: #FFAF36;transform: translateY(-10rpx)" @click="jumpToGive">
|
|
|
- <image style="width: 40rpx;height: 40rpx;transform: translateY(10rpx)"
|
|
|
- src="/static/familyCard/icon-give.png"></image>
|
|
|
- <text>
|
|
|
+ </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>
|
|
|
+ </view>
|
|
|
+ <button class="buttonStyle" @click="jumpToGive" >
|
|
|
+ <text style="font-size: 18px;" >
|
|
|
赠送亲情卡
|
|
|
</text>
|
|
|
- </view>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
|
|
|
- <view class="postCard Card" v-for="item in giveList" @click="jumpToDetail(item.id)">
|
|
|
- <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">
|
|
|
- <text style="float: right;margin:0 10rpx;">已用额度</text>
|
|
|
- <view style="font-size: 48rpx;font-weight: bold;text-align: center">{{ item.amount || 0 }}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -42,12 +71,11 @@ export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
+ choose:false,
|
|
|
giveList: [],
|
|
|
gotList: []
|
|
|
}
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
-
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getGiveList()
|
|
|
@@ -59,11 +87,28 @@ export default {
|
|
|
uni.stopPullDownRefresh()
|
|
|
},
|
|
|
methods: {
|
|
|
- jumpToGive() {
|
|
|
+ changeChoose(){
|
|
|
+ this.choose =!this.choose
|
|
|
+ },
|
|
|
+ // 去协议页面
|
|
|
+ gotoAgreement(type, name) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/myPages/familyCard/giveFamilyCard/giveFamilyCard'
|
|
|
+ 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)
|
|
|
@@ -93,6 +138,7 @@ export default {
|
|
|
this.giveList = res.data.data
|
|
|
this.getImgUrlByOssId(this.giveList, 1)
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
getGotList() {
|
|
|
this.$api.getMyReceiveList().then((res) => {
|
|
|
@@ -102,11 +148,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<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>
|