|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<view class="content mone" v-if="baseURL">
|
|
|
- <model :modelId='mtype' :templateData='templateData' :isShare='isShare' :isLook='isLook'></model>
|
|
|
+ <model :modelId='mtype' :templateData='userTemplate' :isShare='isShare' :isLook='isLook' :isDefault='isDefault'
|
|
|
+ :share-number='shareNumber'></model>
|
|
|
<view class="bottom_padding" v-if="type!=1">
|
|
|
|
|
|
</view>
|
|
@@ -54,6 +55,10 @@
|
|
|
import {
|
|
|
getUser
|
|
|
} from '@/api/user.js';
|
|
|
+ import {
|
|
|
+ saveUrl,
|
|
|
+ interceptor
|
|
|
+ } from '@/utils/loginUtils.js';
|
|
|
import model from '@/pages/modelData/index.vue';
|
|
|
export default {
|
|
|
components: {
|
|
@@ -64,56 +69,11 @@
|
|
|
mtype: 1, //modelid
|
|
|
shareId: '', //保存分享uid
|
|
|
// 默认显示数据
|
|
|
- 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_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_project_ar: [{
|
|
|
- title: '婴幼儿睡眠管理',
|
|
|
- content: '如:日夜颠倒、睡眠不规律、乳头混淆、奶睡、抱睡等问题,帮助宝爸宝妈规律孩子作息、解决婴幼儿喂养困扰,培养良好的生活、学习习惯。'
|
|
|
- }, {
|
|
|
- title: '特色月子餐',
|
|
|
- content: '套用客户的一句话“养眼、养心更养胃”!家常菜、面食、点心、甜品、靓汤、五谷杂粮粥、婴幼儿花样辅食等。'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '早产儿特殊护理',
|
|
|
- content: '包括早产儿基础护理、安全喂养方法、追赶性生长、消化与免疫系统等技能,根据宝宝具体情况给予早产儿家长的科学入户指导。'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '0-6岁早期教育',
|
|
|
- content: '在婴孩最敏感最能接受的时期进行事半功倍的适时教育,针对不同年龄段的孩子,开发婴幼儿潜能的教育,为孩子多元化和健康人格打下良好基础。'
|
|
|
- }
|
|
|
- ],
|
|
|
- is_type_audit: 1
|
|
|
- },
|
|
|
+ cardInfo: {},
|
|
|
+ // 是否显示默认
|
|
|
+ isDefault: false,
|
|
|
+ shareNumber: 0, //浏览量
|
|
|
userTemplate: {}, //用户展示数据
|
|
|
- templateData: {}, //模板查看数据
|
|
|
modelInfo: {}, //当前模板信息
|
|
|
payType: 'wxpay',
|
|
|
type: 0, //0为商品页面进入1为个人中心进入修改预览2为分享查看预览,3为已购模板进入查看分享
|
|
@@ -143,15 +103,19 @@
|
|
|
// #endif
|
|
|
|
|
|
// 获取模板id
|
|
|
- this.mtype = opt.mtype
|
|
|
+ this.mtype = +opt.mtype
|
|
|
// 获取查看类型
|
|
|
this.type = +opt.type
|
|
|
// 是否首页进入
|
|
|
if (this.type === 0) {
|
|
|
- this.templateData = this.cardInfo;
|
|
|
this.isLook = 1;
|
|
|
this.getShowTemplateItem();
|
|
|
- this.getCommonUserCardInfo(this.userInfo.uid);
|
|
|
+ if (this.userInfo.uid) {
|
|
|
+ this.getCommonUserCardInfo(this.userInfo.uid);
|
|
|
+ }else{
|
|
|
+ // 展示默认数据
|
|
|
+ this.isDefault = true;
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
//个人中心提交数据预览
|
|
@@ -161,14 +125,14 @@
|
|
|
}
|
|
|
//分享预览
|
|
|
if (this.type === 2) {
|
|
|
- console.log(opt.type,'opt.type');
|
|
|
+ console.log(opt.type, 'opt.type');
|
|
|
this.isLook = 2;
|
|
|
this.getCommonUserCardInfo(opt.uid);
|
|
|
return
|
|
|
}
|
|
|
//我的模板页进入预览
|
|
|
if (this.type === 3) {
|
|
|
- console.log(opt.type,'opt.type');
|
|
|
+ console.log(opt.type, 'opt.type');
|
|
|
this.isShare = true;
|
|
|
this.isLook = 2;
|
|
|
this.shareId = this.userInfo.uid;
|
|
@@ -246,14 +210,38 @@
|
|
|
...mapMutations('user', ['setUserInfo']),
|
|
|
// 模板预览
|
|
|
preview() {
|
|
|
- this.templateData = this.userTemplate.id ? this.userTemplate : this.cardInfo;
|
|
|
+ if (!this.userInfo.uid) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '您未登录是否登录查看',
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '立即登录',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ saveUrl();
|
|
|
+ interceptor();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是否显示默认数据
|
|
|
+ if (this.userTemplate.id) {
|
|
|
+ this.isDefault = false;
|
|
|
+ } else {
|
|
|
+ this.isDefault = true;
|
|
|
+ }
|
|
|
this.previewShow = true;
|
|
|
+
|
|
|
// 隐藏浏览数量
|
|
|
this.isLook = 0;
|
|
|
},
|
|
|
// 结束预览
|
|
|
outPreview() {
|
|
|
- this.templateData = this.cardInfo;
|
|
|
+ // 显示默认数据
|
|
|
+ this.isDefault = true;
|
|
|
this.previewShow = false;
|
|
|
if (this.type == 0) {
|
|
|
this.isLook = 1;
|
|
@@ -367,7 +355,7 @@
|
|
|
}).then(res => {
|
|
|
that.modelInfo = res.data;
|
|
|
if (that.type == 0) {
|
|
|
- that.cardInfo.look_count = res.data.look_count
|
|
|
+ that.shareNumber = res.data.look_count
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -385,8 +373,11 @@
|
|
|
res.data.service_area_all = arr
|
|
|
// 保存用户模板数据
|
|
|
that.userTemplate = res.data
|
|
|
- if (that.type == 3||that.type == 2) {
|
|
|
- that.templateData = res.data
|
|
|
+ // 判断是否从用户个人中心或者分享进入
|
|
|
+ if (that.type == 3 || that.type == 2) {
|
|
|
+ // 修改为非默认数据
|
|
|
+ that.isDefault = false;
|
|
|
+ that.shareNumber = res.data.card_look_count;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -708,6 +699,7 @@
|
|
|
padding: 0;
|
|
|
border-radius: 0;
|
|
|
flex-grow: 1;
|
|
|
+
|
|
|
&::after {
|
|
|
border: none;
|
|
|
}
|