zs %!s(int64=2) %!d(string=hai) anos
pai
achega
a34b26fbc1
Modificáronse 2 ficheiros con 64 adicións e 8 borrados
  1. 12 3
      pages/my/index.vue
  2. 52 5
      pagesMy/integral/index.vue

+ 12 - 3
pages/my/index.vue

@@ -44,8 +44,9 @@
 				<view class="two_1" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
 					<view class="title">{{item.title}}</view>
 					<view class="title">
-						<text v-if="user.id&&item.title=='我的尊荣'">{{user.integral||0}}分</text>
-						<text v-if="item.title=='客服电话'" @tap="makePhone(serviceContactInfo.phone)">{{serviceContactInfo.phone||''}}</text>
+						<text v-if="user.id&&item.title=='我的尊荣'">{{integral||0}}分</text>
+						<text v-if="item.title=='客服电话'"
+							@tap="makePhone(serviceContactInfo.phone)">{{serviceContactInfo.phone||''}}</text>
 						<text class="iconfont icon-jiantouyou"></text>
 					</view>
 				</view>
@@ -135,7 +136,9 @@
 				// 收藏商品
 				market_num: '',
 				// 收藏店铺
-				shop_num: ''
+				shop_num: '',
+				// 积分
+				integral:''
 			};
 		},
 		onShow: function() {
@@ -168,6 +171,12 @@
 								customer: user._id
 							})
 							if (arr.errcode == '0') that.$set(that, `shop_num`, arr.total);
+							arr = await that.$api(`/point/computedTotal`, 'GET', {
+								customer: user._id
+							})
+							if (arr.errcode == '0') {
+								if (arr.data > 1) that.$set(that, `integral`, arr.data);
+							}
 						}
 					},
 					fail: (err) => {}

+ 52 - 5
pagesMy/integral/index.vue

@@ -3,7 +3,7 @@
 		<view class="main">
 			<view class="one">
 				<view class="one_1">
-					<text>{{user.integral||0}}</text><text>分</text>
+					<text>{{integral||0}}</text><text>分</text>
 				</view>
 				<view class="one_2" style="display: none;">
 					<button type="default" size="mini">礼品兑换记录</button>
@@ -12,11 +12,16 @@
 			<view class="two">
 				<view class="two_1" v-if="list&&list.length>0">
 					<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
-					<view class="list-scroll-view">
-						<view class="list" v-for="(item, index) in list" :key="index">
-
+						<view class="list-scroll-view">
+							<view class="list" v-for="(item, index) in list" :key="index">
+								<view class="other">
+									<view class="other_1">积分: <text class="integral">{{item.point}}</text></view>
+									<view class="other_1">状态: <text>{{item.zhStatus}}</text></view>
+									<view class="other_1">来源: <text>{{item.zhSource}}</text></view>
+									<view class="other_1">时间: <text>{{item.time}}</text></view>
+								</view>
+							</view>
 						</view>
-					</view>
 					</scroll-view>
 				</view>
 				<view class="two_2" v-else>
@@ -32,6 +37,7 @@
 		data() {
 			return {
 				user: {},
+				integral: '',
 				list: [],
 				total: 0,
 				skip: 0,
@@ -75,9 +81,19 @@
 					})
 					if (res.errcode == '0') {
 						let list = [...that.list, ...res.data];
+						for (let val of list) {
+							let status = that.statusList.find(i => i.value == val.status)
+							if (status) val.zhStatus = status.label;
+							let source = that.sourceList.find(i => i.value == val.source)
+							if (source) val.zhSource = source.label;
+						}
 						that.$set(that, `list`, list);
 						that.$set(that, `total`, res.total)
 					}
+					let arr = await that.$api(`/point/computedTotal`, 'GET', {
+						customer: user._id
+					})
+					if (arr.errcode == '0') that.$set(that, `integral`, arr.data);
 				}
 			},
 			// 查询其他信息
@@ -166,6 +182,37 @@
 		}
 
 		.two {
+			position: relative;
+			flex-grow: 1;
+			padding: 2vw 0 0 0;
+
+			.two_1 {
+				.list {
+					width: 92vw;
+					border: 0.5vw solid var(--f1Color);
+					margin: 2vw 2vw 0 1.5vw;
+					padding: 2vw;
+					border-radius: 5px;
+
+					.other {
+						.other_1 {
+							font-size: var(--font16Size);
+							margin: 0 0 1vw 0;
+
+							.integral {
+								color: #ff0000;
+							}
+
+							text {
+								margin: 0 0 0 2vw;
+								color: var(--f85Color);
+								font-size: var(--font14Size);
+							}
+						}
+					}
+				}
+			}
+
 			.two_2 {
 				text-align: center;
 				color: #858585;