Tang 4 anos atrás
pai
commit
741aacc1ec
3 arquivos alterados com 36 adições e 17 exclusões
  1. 1 1
      components/home.vue
  2. 26 11
      pages2/course/detail.vue
  3. 9 5
      pages2/wd/info.vue

+ 1 - 1
components/home.vue

@@ -248,7 +248,7 @@ export default {
 		},
 		jumpDetail(item) {
 			if (this.current == 0) {
-				this.$navTo.togo('/pages2/course/detail', {});
+				this.$navTo.togo('/pages2/course/detail', item);
 				return;
 			}
 			if (this.current == 1) {

+ 26 - 11
pages2/course/detail.vue

@@ -172,9 +172,15 @@ export default {
 			vid: 'd5f6d309fe0b016d3844b194a8b32249_d', // 视频ID
 			sign: '',
 			ts: '',
-			startStatus: false
+			startStatus: false,
+			queryData: {},
+			pageData: {}
 		};
 	},
+	onLoad(options) {
+		this.queryData = options;
+		this.getCourseInfo();
+	},
 	onShow() {
 		let that = this;
 		const query = uni.createSelectorQuery().in(this);
@@ -222,7 +228,7 @@ export default {
 			.exec();
 		this.windowHeight = uni.getSystemInfoSync().windowHeight;
 	},
-	onPageScroll: function(e) {  
+	onPageScroll: function(e) {
 		//防止触发两次跳动
 		if (this.isClick) {
 			return;
@@ -241,6 +247,15 @@ export default {
 		}
 	},
 	methods: {
+		getCourseInfo() {
+			var self = this
+			this.$api.courseInfo(this.queryData.courseId).then(res => {
+				console.log(res.data.data);
+				if (res.data.code === 200) {
+					self.pageData = res.data.data;
+				}
+			});
+		},
 		startVideo() {
 			uni.getStorageSync('union_id');
 			if (!uni.getStorageSync('union_id')) {
@@ -304,15 +319,15 @@ export default {
 			uni.getStorage({
 				key: 'union_id',
 				success: function(res) {
-			// 继续操作
-			self.$api.getInfo().then(result => {
-				console.log(result);
-			});
-			},
-			fail: function(err) {
-				//重新登入
-				self.$navTo.togo('/pages/login/login', {});
-			}
+					// 继续操作
+					self.$api.getInfo().then(result => {
+						console.log(result);
+					});
+				},
+				fail: function(err) {
+					//重新登入
+					self.$navTo.togo('/pages/login/login', {});
+				}
 			});
 		}
 	}

+ 9 - 5
pages2/wd/info.vue

@@ -7,15 +7,15 @@
 				个人职业成长定制服务!
 			</view>
 			<view style="display: flex;align-items: center;">
-				<view class="btn" v-if="form.certified === 0" style="margin-right: 5rpx;" @click="certification">认证</view>
+				<view class="btn" style="margin-right: 5rpx;" :style="form.certified === 1 ? isStatus : ''" @click="form.certified === 0 ? certification() : iscertification()">{{form.certified === 0?'认证':'已认证'}}</view>
 				<view class="btn">编辑</view>
 			</view>
 		</view>
 		<view class="form">
 			<u-form :model="form" ref="uForm">
-				<u-form-item label="姓名" prop="realname"><u-input v-model="form.realname" /></u-form-item>
-				<u-form-item label="手机号码" prop="telphone" :label-width="auto"><u-input v-model="form.telphone" /></u-form-item>
-				<u-form-item label="身份证号" prop="idCard" :label-width="auto"><u-input v-model="form.idCard" /></u-form-item>
+				<u-form-item label="姓名" prop="realname"><u-input :disabled="form.certified === 1" v-model="form.realname" /></u-form-item>
+				<u-form-item label="手机号码" prop="telphone" :label-width="auto"><u-input :disabled="form.certified === 1" v-model="form.telphone" /></u-form-item>
+				<u-form-item label="身份证号" prop="idCard" :label-width="auto"><u-input :disabled="form.certified === 1" v-model="form.idCard" /></u-form-item>
 				<u-form-item label="性别" prop="sex">
 					<picker @change="bindPickerChangeSex" :value="form.sex" :range="array_sex">
 						<view class="picker">{{ array_sex[form.sex] }}</view>
@@ -42,7 +42,7 @@
 					<pick-regions :defaultRegion="defaultRegionCode" @getRegion="handleGetRegion2">
 						<view class="picker">{{ form.province }} {{ form.city }} {{ form.district }}</view>
 					</pick-regions>
-				</u-form-item>
+				</u-form-item> 
 				<u-form-item label="政治面貌" :label-width="auto" prop="politic">
 					<picker @change="bindPickerChangePolitic" :value="form.politic" :range="array_politic">
 						<view class="picker">{{ array_politic[form.politic] }}</view>
@@ -109,6 +109,7 @@
 export default {
 	data() {
 		return {
+			isStatus: 'background-color:#a8a8a8;',
 			BizToken: '',
 			action: '33',
 			fileList: [],
@@ -190,6 +191,9 @@ export default {
 					console.log('验证失败');
 				}
 			});
+		},
+		iscertification(){
+			
 		},
 		async certification() {
 			var self = this;