KELECHUAN 3 年之前
父節點
當前提交
7b8c546308
共有 5 個文件被更改,包括 107 次插入63 次删除
  1. 74 41
      components/analysis-box/analysis-box.vue
  2. 24 16
      components/todaydata-box/todaydata-box.vue
  3. 4 1
      information/parent.js
  4. 1 1
      main.js
  5. 4 4
      subpkg/guide/guide.vue

+ 74 - 41
components/analysis-box/analysis-box.vue

@@ -1,49 +1,52 @@
 <template>
-<view>
-	
-	<view class="block" v-if="!subscribe">
-		<view class="item-container" @click="navRoseChart">
-			<view class="analysis-name">
-				<view class="t-icon t-icon-xtubiao-"></view>
-				<text class="analysis-text">优劣科目分析</text>
+	<view>
+
+		<view class="block" v-if="subscribe">
+			<view class="item-container" @click="navRoseChart">
+				<view class="analysis-name">
+					<view class="t-icon t-icon-xtubiao-"></view>
+					<text class="analysis-text">优劣科目分析</text>
+				</view>
 			</view>
-		</view>
-	
-	
-		<view class="item-container" @click="navRadarChart">
-			<view class="analysis-name">
-				<view class="t-icon t-icon-xtubiao-3"></view>
-				<text class="analysis-text">考试能力分析</text>
+
+
+			<view class="item-container" @click="navRadarChart">
+				<view class="analysis-name">
+					<view class="t-icon t-icon-xtubiao-3"></view>
+					<text class="analysis-text">考试能力分析</text>
+				</view>
 			</view>
-		</view>
-	
-	
-		<view class="item-container" @click="navArcbarChart">
-			<view class="analysis-name">
-				<view class="t-icon t-icon-xtubiao-6"></view>
-				<text class="analysis-text">成绩占比分析</text>
+
+
+			<view class="item-container" @click="navArcbarChart">
+				<view class="analysis-name">
+					<view class="t-icon t-icon-xtubiao-6"></view>
+					<text class="analysis-text">成绩占比分析</text>
+				</view>
 			</view>
 		</view>
-	</view>
-	<view class="nosub-box" v-if="subscribe">
-		<view style="display: flex; align-items: center;margin: 30rpx 0 0 15rpx;">
-			<!-- <view class="t-icon t-icon-xtubiao-3" style="width: 50rpx;height: 50rpx;"></view> -->
-			<view class="nosub-text">综合分析模块</view>
+		
+		<view class="nosub-box" v-if="!subscribe" @click="getSubscribe">
+			<view style="display: flex; align-items: center;margin: 30rpx 0 0 15rpx;">
+				<!-- <view class="t-icon t-icon-xtubiao-3" style="width: 50rpx;height: 50rpx;"></view> -->
+				<view class="nosub-text">综合分析模块</view>
+			</view>
+			<view class="nosub-content">孩子成绩综合全面分析</view>
+			<view class="nosub-content">点击订阅</view>
 		</view>
-		<view class="nosub-content">对孩子成绩综合全面分析</view>
-		<view class="nosub-content">点击订阅</view>
+
 	</view>
-	
-</view>
 
 </template>
 
 <script>
-	import {mapState} from 'vuex'
+	import {
+		mapState ,mapMutations
+	} from 'vuex'
 	export default {
 		name: "analysis-box",
-		computed:{
-			...mapState('m_parent',['subscribe'])
+		computed: {
+			...mapState('m_parent', ['subscribe']),
 		},
 		data() {
 			return {
@@ -51,6 +54,29 @@
 			};
 		},
 		methods: {
+			...mapMutations('m_parent',['updateSubscribe']),
+			//获取订阅
+			getSubscribe() {
+				this.updateSubscribe(true)
+				const orderInfo = {
+					order_price: 0.01,
+				}
+				//获取服务供应商
+				// uni.getProvider({
+				// 	service: 'payment',
+				// 	success: function(res) {
+				// 		console.log(res.provider)
+				// 		if (res.provider.indexOf('wxpay')) {
+				// 			//调用客户端支付api
+				// 			uni.requestPayment({
+				// 				provider: res.provider,
+				// 				orderInfo: orderInfo
+				// 			})
+				// 		}
+				// 	}
+				// })
+
+			},
 			//导航玫瑰图页面
 			navRoseChart(e) {
 				console.log(e);
@@ -109,26 +135,33 @@
 			}
 		}
 	}
-	.nosub-box{
+
+	.nosub-box {
 		display: flex;
 		flex-direction: column;
 		border-radius: 16rpx;
 		background: $card-back-base64;
-		background-size: cover;//背景图片自适应
+		background-size: cover; //背景图片自适应
 		box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
 		width: 347rpx;
 		height: 345rpx;
-		.nosub-text{
+
+		.nosub-text {
 			font-size: 40rpx;
 			font-weight: bold;
-			color: #ab725c;
-			margin-left: 10rpx;	
+			margin-left: 10rpx;
+			background-image: linear-gradient(to right, #a56d58, #e8997d);
+			background-clip: text;//裁剪成文字的前景色
+			color: transparent;//文字颜色变成透明
 		}
-		.nosub-content{
-			margin: 25rpx 25rpx 0 25rpx;
+
+		.nosub-content {
+			margin: 25rpx 65rpx 0 25rpx;
 			font-size: 45rpx;
 			font-weight: bold;
-			color: #ab725c;
+			background-image: linear-gradient(to right, #a56d58, #e8997d);
+			background-clip: text;//裁剪成文字的前景色
+			color: transparent;//文字颜色变成透明
 		}
 	}
 </style>

+ 24 - 16
components/todaydata-box/todaydata-box.vue

@@ -1,9 +1,12 @@
 <template>
 	<!-- 今日记录模块 -->
 	<view class="module-container">
-		<u-tabs :list="list" :current="current" @change="change" 
-		:activeStyle="{color: '#303133',fontWeight: 'bold',transform: 'scale(1.05)',}"
-		:inactiveStyle="{color: '#6c6e73'}"></u-tabs>
+		<u-tabs :list="list" :current="current" @change="change"
+			:activeStyle="{color: '#5b7cff',fontWeight: 'bold',transform: 'scale(1.04)',}"
+			:inactiveStyle="{color: '#b0b0b1',fontWeight: 'bold',transform: 'scale(1)'}" lineColor="#5b7cff"
+			lineWidth="60"></u-tabs>
+
+		<!-- 记录模块 -->
 		<view class="module-box" v-if="current == 0">
 			<view class="module-item">
 				<view class="module-item-box">
@@ -49,7 +52,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<!-- 记录表 -->
 		<view class="module-box" v-if="current == 1">
 			<view class="card-item" style="width: 710rpx;">
@@ -62,7 +65,7 @@
 						canvasId='canvans912' :opts="{dataLabel:false, extra:{column: {barBorderCircle:true}}}" />
 				</view>
 			</view>
-			
+
 			<view class="card-item">
 				<view class="card-info">
 					<view class="t-icon t-icon-jiankangshangbao"></view>
@@ -73,7 +76,7 @@
 						canvasId='canvans8121' />
 				</view>
 			</view>
-			
+
 			<view class="card-item">
 				<view class="card-info">
 					<view class="t-icon t-icon-jiankangshangbao"></view>
@@ -85,7 +88,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 
 	</view>
 
@@ -97,17 +100,21 @@
 	} from 'vuex'
 	export default {
 		name: "todaydata-box",
-		computed:{
+		computed: {
 			...mapState('m_chart', ['todayData']),
 		},
 		data() {
 			return {
+				//模块名
 				list: [{
-					name: '今日数据记录'
+					name: '今日数据'
 				}, {
-					name: '历史数据图表'
+					name: '历史数据'
 				}],
+				//当前模块
 				current: 0,
+				//动画
+				transition: true
 
 
 			};
@@ -151,6 +158,7 @@
 				width: 100%;
 				display: flex;
 				flex-direction: column;
+
 				.t-icon {
 					width: 250rpx;
 					height: 250rpx;
@@ -160,6 +168,7 @@
 
 		}
 	}
+
 	.card-item {
 		margin: 10rpx 0;
 		display: flex;
@@ -170,24 +179,25 @@
 		border-radius: 16rpx;
 		width: 347rpx;
 		height: auto;
-	
+
 		.card-info {
 			display: flex;
 			align-items: center;
 			padding: 15rpx;
-	
+
 			.info-text {
 				font-size: 30rpx;
 				font-weight: bold;
 				color: #3B4144;
 				margin-left: 10rpx;
 			}
+
 			.t-icon {
 				width: 40rpx;
 				height: 40rpx;
 			}
 		}
-	
+
 		.card-content {
 			font-size: 35rpx;
 			margin: 10rpx 0 10rpx 25rpx;
@@ -218,12 +228,10 @@
 		.unit {
 			margin-bottom: 15rpx;
 			margin-left: 20rpx;
-			color: #FFFFFF;
+			color: #f5f5f5;
 			font-size: 35rpx;
 			font-weight: bold;
 			z-index: 1;
 		}
 	}
-
-	
 </style>

+ 4 - 1
information/parent.js

@@ -8,7 +8,7 @@ export default {
 
 		token: uni.getStorageSync('token') || '',//openid和session_key
 		//用户订阅信息
-		subscribe: true,
+		subscribe: false,
 
 		parentinfo: JSON.parse(uni.getStorageSync('parentinfo') || '{}'),
 
@@ -71,6 +71,9 @@ export default {
 		//删除我的消息
 		updateMyMsg(state,msgList) {
 			state.msgList = msgList
+		},
+		updateSubscribe(state,subscribe){
+			state.subscribe = subscribe
 		}
 
 

+ 1 - 1
main.js

@@ -39,7 +39,7 @@ $http.afterRequest = function() {
 }
 
 //封装的展示消息提示方法
-uni.$showMsg = function(title = '请求失败', duration = 1500){
+uni.$showMsg = function(title = '请求失败', duration = 500){
 	uni.showToast({
 		title,
 		duration,

+ 4 - 4
subpkg/guide/guide.vue

@@ -3,11 +3,11 @@
 		<!-- 标题 -->
 		<view class="tips">
 			<view class="title">选择您的孩子</view>
-			<button class="detail" plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-show="!show">点击获取您的孩子信息</button>
+			<button class="detail" plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!show">获取您的孩子信息</button>
 		</view>
 		
 		<!-- 孩子选择界面 -->
-		<view class="children-item" v-show="show">
+		<view class="children-item" v-if="show">
 			<view class="com-box">
 				<view class="item" v-for="(item,index) in parentdetail.childrenList" :key="index" @click="chooseChildren(item)">
 					<view class="item-text">{{item.name}}</view>
@@ -110,9 +110,9 @@
 				text-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.05);
 			}
 			.detail{
-				line-height: 100rpx;
+				line-height: 70rpx;
 				font-weight: bold;
-				font-size: 45rpx;
+				font-size: 40rpx;
 				border-radius: 200rpx;
 				position: relative;
 				margin: 180rpx auto;//relative相对定位居中