فهرست منبع

refactor:我的权益卡

zhanghui 2 سال پیش
والد
کامیت
5cfed36012
4فایلهای تغییر یافته به همراه276 افزوده شده و 4 حذف شده
  1. 7 0
      pages.json
  2. 12 4
      pages/my/index.vue
  3. 180 0
      storePages/myRights/index.rpx.scss
  4. 77 0
      storePages/myRights/index.vue

+ 7 - 0
pages.json

@@ -347,6 +347,13 @@
 		{
 			"root": "storePages",
 			"pages": [
+				{
+					"path": "myRights/index",
+					"style": {
+						"navigationBarTitleText": "我的权益卡",
+						"enablePullDownRefresh": false
+					}
+				},
 				{
 					"path": "rights/index",
 					"style": {

+ 12 - 4
pages/my/index.vue

@@ -65,15 +65,15 @@
 								<text>{{userInfo.coupon || 0}}</text>
 							</view>
 						</view>
-						<view class="balanceItem">
+						<view class="balanceItem" @click="navigateToPage('/storePages/myRights/index')">
 							<view class="icon flex-row justify-center">
 								<u-icon name="/static/me/u694.png" color="red" size="30"></u-icon>
 							</view>
 							<view class="name">
-								权益卡
+								我的权益卡
 							</view>
 							<view class="num">
-								<text>0</text>
+								<text>{{userInfo.equityCardTotal || 0}}</text>
 							</view>
 						</view>
 					</view>
@@ -153,11 +153,19 @@ export default {
 		if (this.userInfo.selfPhoto){
 			this.getImgUrlByOssId(this.userInfo.selfPhoto)
 		}
-
+		this.getUserInfo()
 	},
 
 	methods: {
 
+		getUserInfo(){
+			this.$api.getUserInfo().then(res=>{
+				console.log('++++++++++++获取用户信息++++++++++++++++++',res)
+				uni.setStorageSync('userInfo',res.data.data)
+				this.userInfo = res.data.data
+			})
+		},
+
 		getImgUrlByOssId(Id){
 		  if (Id) {
         this.$api.getImage(Id).then(res=>{

+ 180 - 0
storePages/myRights/index.rpx.scss

@@ -0,0 +1,180 @@
+
+.page{
+  background: #F7F7F7;
+  padding: 0 32rpx;
+  border-top: 1px solid #F7F7F7 ;
+}
+.btn{
+  height: 84rpx;
+  background: #FFE05C;
+  border-radius: 54rpx;
+  margin: 32rpx 0;
+
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 84rpx;
+  text-align: center;
+}
+.noUse{
+  margin: 32rpx 0;
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 40rpx;
+}
+
+
+.row-list{
+  width: 686rpx;
+  height: 188rpx;
+  margin-top: 24rpx;
+  background-image: url('/static/coupon/u210.png');
+  background-repeat: no-repeat;
+  background-size: cover;
+}
+
+
+.h-text{
+  width: 200rpx;
+  height: 188rpx;
+}
+.h-center-content{
+  width: 298rpx;
+  height: 188rpx;
+}
+.h-right-content{
+  width: 188rpx;
+  height: 188rpx;
+}
+.money{
+  height: 52rpx;
+  font-size: 36rpx;
+  font-family: DINAlternate-Bold, DINAlternate;
+  font-weight: bold;
+  color: #333333;
+  line-height: 52rpx;
+  text-align: center;
+}
+.desc{
+  height: 36rpx;
+  font-size: 20rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 36rpx;
+  text-align: center;
+}
+.h-value{
+  font-size: 28rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bold;
+  color: #333333;
+  line-height: 44rpx;
+  margin-top: 24rpx;
+  margin-left: 24rpx;
+}
+.title{
+  font-size: 20rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  line-height: 36rpx;
+  margin-left: 24rpx;
+}
+.h-btn-value-use{
+  width: 156rpx;
+  height: 64rpx;
+  background: #93D21A;
+  border-radius: 32rpx;
+
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 64rpx;
+  text-align: center;
+}
+.h-btn-img{
+  width: 136rpx;
+  height: 136rpx;
+}
+.row-list:first-child{
+  margin-top: 0;
+}
+.btn{
+  width: 156rpx;
+  height: 64rpx;
+  background: #93D21A;
+  border-radius: 32rpx;
+
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 64rpx;
+  text-align: center;
+}
+
+
+
+.payView{
+  height: 638rpx;
+  background: #FFFFFF;
+  box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0,0,0,0.03);
+  border-radius: 24rpx 24rpx 0rpx 0rpx;
+  padding: 24rpx 32rpx;
+  z-index: 100;
+}
+.payType{
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bord;
+  color: #111111;
+  line-height: 48rpx;
+}
+.x{
+  width: 35rpx;
+  height: 35rpx;
+  border-radius: 18rpx;
+}
+.payTitle{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+  margin-top: 8rpx;
+}
+.payItem{
+  background: #FAFAFA;
+  border-radius: 20rpx;
+  padding: 34rpx 32rpx;
+  margin-top: 32rpx;
+}
+.payName{
+  margin-left: 24rpx;
+}
+.balance{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  line-height: 40rpx;
+}
+.commitBtn{
+  width: 686rpx;
+  height: 108rpx;
+  background: #FFE05C;
+  border-radius: 60rpx;
+  margin-top: 32rpx;
+
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bold;
+  color: #111111;
+  line-height: 108rpx;
+  text-align: center;
+}

+ 77 - 0
storePages/myRights/index.vue

@@ -0,0 +1,77 @@
+<template>
+	<view class="page" :style="{'height':windowHeight}">
+
+		<scroll-view scroll-y :style="{'height':windowHeight}">
+			<view  class="row-list flex-row justify-start" v-for="(item,index) in equityList" :key="index">
+				<view class="h-text flex-col justify-center ">
+					<view class="money">
+						<text>¥{{item.faceValue}}</text>
+					</view>
+					<!--				<view class="desc">-->
+					<!--					<text>{{item.title}}</text>-->
+					<!--				</view>-->
+				</view>
+
+				<view class="h-center-content flex-col justify-around">
+					<view class="h-value">
+						<text>{{item.description}}</text>
+					</view>
+					<view class="title">
+						使用项目:{{item.serviceProjectName || ''}}
+					</view>
+					<view class="title">
+						绑定对象:{{item.serviceObjectName}}
+					</view>
+					<view class="title">
+						结束期限:{{item.effectiveEndTime.substring(0,10)}}
+					</view>
+
+				</view>
+
+<!--				<view class="h-right-content flex-col justify-center ">-->
+<!--					<view class="btn" @click="payRights(item)">-->
+<!--						<text>购买</text>-->
+<!--					</view>-->
+<!--				</view>-->
+
+			</view>
+		</scroll-view>
+
+
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				windowHeight:'',
+				userInfo:{},
+				equityList:[],
+			};
+		},
+		onLoad(option) {
+			let sysInfo = uni.getSystemInfoSync()
+			this.windowHeight =sysInfo.windowHeight - 44 +'px'//除标题栏栏外的屏幕可用高度
+			this.userInfo = uni.getStorageSync('userInfo')
+
+			this.myEquityCardList()
+		},
+
+		methods: {
+
+			myEquityCardList(){
+				this.$api.myEquityCardList().then(res=>{
+					console.log(res)
+					this.equityList = res.data.data
+				})
+			},
+
+		},
+	};
+</script>
+<style lang="scss" scoped>
+
+	@import '/common/css/common.css';
+	@import './index.rpx.scss';
+
+</style>