lhl 1 năm trước cách đây
mục cha
commit
06a7900b0f
1 tập tin đã thay đổi với 100 bổ sung12 xóa
  1. 100 12
      pages/user/model/model.vue

+ 100 - 12
pages/user/model/model.vue

@@ -8,7 +8,7 @@
 				<image :src="baseURL + '/resource/icon/model1/jpfw.png'" mode="" class="gp"></image>
 			</view>
 			<view class="user-name">
-				{{cardInfo.name || '詹继红'}}
+				{{cardInfo.name || '暂无'}}
 			</view>
 			<!-- <button type="default" class="fx-btn">
 				<image :src="baseURL + '/resource/icon/model1/fx.png'" mode=""></image>
@@ -139,22 +139,28 @@
 		</view>
 		<view class="create-model-ts">
 		</view>
-		<button type="default" class="fxmp" open-type="share" v-if="!shareId && modelInfo.is_use== 1">
+		<button type="default" class="fxmp" open-type="share" v-if="!shareId && modelInfo.is_use== 1 && !is_yl && userInfo.info_audit_status == 1">
 			<view class="">
 				分享名片
 			</view>
 		</button>
-		<view class="create-model flex" v-if="!shareId && modelInfo.is_use== 0">
+		<view class="ljrz" v-if="userInfo.info_audit_status != 1" @click="navto('/pages/user/model/modelrz')">
+			立即认证
+		</view>
+		<view class="create-model flex" v-if="!shareId && modelInfo.is_use== 0 && !is_yl && userInfo.info_audit_status == 1">
 			<view class="price-show">
 				模板费用:<text>{{modelInfo.price*1}}</text>
 			</view>
-			<view class="to-show">
+			<view class="to-show" @click="is_yl = true">
 				模板预览
 			</view>
 			<view class="by-now" @click="gobuy">
 				购买使用
 			</view>
 		</view>
+		<view class="yl" v-if="is_yl" @click="is_yl = false">
+			结束预览
+		</view>
 	</view>
 </template>
 
@@ -169,6 +175,9 @@
 		getShowTemplateItem,
 		subShowTemplateOrder
 	} from '@/api/model.js'
+	import {
+		getUser
+	} from '@/api/user.js';
 	export default {
 		data() {
 			return {
@@ -176,7 +185,8 @@
 				shareId: '',
 				cardInfo: {},
 				modelInfo: {},
-				payType: 'wxpay'
+				payType: 'wxpay',
+				is_yl: false
 			}
 		},
 		computed: {
@@ -186,17 +196,17 @@
 		onLoad(opt) {
 			// this.getUserCardInfo()
 			this.mtype = opt.mtype
+			
 			if (opt.uid) {
 				this.shareId = opt.uid
 				this.getCommonUserCardInfo(opt.uid)
 			} else {
-				this.getUserCardInfo()
 				this.getShowTemplateItem()
 			}
 
 		},
 		onShow() {
-
+			this.getUser()
 		},
 		onShareAppMessage(options) {
 			// 设置菜单中的转发按钮触发转发事件时的转发内容
@@ -225,7 +235,68 @@
 			console.log(shareObj)
 			return shareObj;
 		},
+		onUnload() {
+			let pages = getCurrentPages(); //获取加载的页面
+			let currentPage = pages[pages.length - 2]; //获取当前页面的对象
+			// console.log(currentPage.route)
+			if(currentPage.route == 'pages/public/wxLogin') {
+				uni.switchTab({
+					url:'/pages/index/index'
+				})
+			}
+		},
 		methods: {
+			...mapMutations('user',['setUserInfo']),
+			navto(url) {
+				uni.navigateTo({
+					url
+				})
+			},
+			getUser() {
+				const that = this;
+				getUser({}).then((e) => {
+					that.setUserInfo(e.data)
+					if(e.data.info_audit_status == 1 && that.shareId == '') {
+						that.getUserCardInfo()
+					}else {
+						that.cardInfo = {
+							name: '佚名',
+							avatar: 'https://api.myjie.cn/resource/icon/base/f.png',
+							age: '41',
+							twelve: '鼠',
+							work_year: '10',
+							constellation: '处女座',
+							ancestral_place: '浙江',
+							minority: '汉族',
+							education: '本科',
+							service_area_all: ['浙江省台州市路桥区'],
+							service_min_price: 100,
+							service_max_price: 200,
+							service_time_type_title: '每小时',
+							service_intro_content: '高级育婴师证|高级催乳师证|早产儿护理师母婴护理证|金牌月嫂证|产后恢复师证|公共营养师证|月子药膳调理师证|国际宝宝睡眠咨询师证|普通话二级甲等|中央广播电视大学学历|学前教育专业,深耕幼教十年,技能全面,性格活泼,有亲和力,做事干净利落,有很强的责任心。对宝宝有爱心,体贴新手妈妈。专业技能熟练。应急能力强。让家人放心、产妇舒心的坐好月子。',
+							service_intro_imgs: ['https://api.myjie.cn/resource/icon/base/pj1.png','https://api.myjie.cn/resource/icon/base/pj2.png','https://api.myjie.cn/resource/icon/base/pj3.png','https://api.myjie.cn/resource/icon/base/pj4.png'],
+							service_audit_imgs: ['https://api.myjie.cn/resource/icon/base/zs1.png','https://api.myjie.cn/resource/icon/base/zs2.png','https://api.myjie.cn/resource/icon/base/zs3.png','https://api.myjie.cn/resource/icon/base/zs4.png'],
+							service_project_ar: [{
+								title: '婴幼儿睡眠管理',
+								content: '如:日夜颠倒、睡眠不规律、乳头混淆、奶睡、抱睡等问题,帮助宝爸宝妈规律孩子作息、解决婴幼儿喂养困扰,培养良好的生活、学习习惯。'
+							},{
+								title: '特色月子餐',
+								content: '套用客户的一句话“养眼、养心更养胃”!家常菜、面食、点心、甜品、靓汤、五谷杂粮粥、婴幼儿花样辅食等。'
+							},
+							{
+								title: '早产儿特殊护理',
+								content: '包括早产儿基础护理、安全喂养方法、追赶性生长、消化与免疫系统等技能,根据宝宝具体情况给予早产儿家长的科学入户指导。'
+							},
+							{
+								title: '0-6岁早期教育',
+								content: '在婴孩最敏感最能接受的时期进行事半功倍的适时教育,针对不同年龄段的孩子,开发婴幼儿潜能的教育,为孩子多元化和健康人格打下良好基础。'
+							}
+							]
+						}
+					}
+				}).catch((e) => {
+				})
+			},
 			gobuy() {
 				let that = this
 				subShowTemplateOrder({
@@ -262,10 +333,6 @@
 					if (that.payType == 'wxpay') {
 						console.log('到这里')
 						wx.requestPayment(data)
-						
-
-
-
 					}
 				})
 			},
@@ -752,7 +819,6 @@
 		font-weight: 500;
 		text-align: center;
 		line-height: 98rpx;
-
 		.price-show {
 			font-size: 32rpx;
 			font-weight: 500;
@@ -781,4 +847,26 @@
 			background: #f65486;
 		}
 	}
+	.yl {
+		width: 750rpx;
+		font-size: 32rpx;
+		font-weight: 500;
+		text-align: center;
+		line-height: 98rpx;
+		color: #fff;
+		text-align: center;
+		font-size: 34rpx;
+		background-color: #f65486;
+	}
+	.ljrz {
+		position: fixed;
+		width: 750rpx;
+		bottom: 0;
+		font-size: 32rpx;
+		font-weight: 500;
+		text-align: center;
+		line-height: 98rpx;
+		background-color: #f65486;
+		color: #fff;
+	}
 </style>