Commit 7d4a30ba by yuzhenWang

Merge branch 'feature-20260203-解决外部跳转页面登录问题' into 'dev'

拉起小程序分享发生产

See merge request !99
parents e65a4457 64f3e2ff
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment"; import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
import api from './api/api'; import api from './api/api';
import {hshare} from '@/util/fiveshare'; import {hshare} from '@/util/fiveshare';
import dataHandling from "@/util/dataHandling";
export default { export default {
data() { data() {
return { return {
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
if(!uni.getStorageSync('loginType')){ if(!uni.getStorageSync('loginType')){
uni.setStorageSync('loginType','visitor'); uni.setStorageSync('loginType','visitor');
} }
if(!uni.getStorageSync('visitorUuid')){
uni.setStorageSync('visitorUuid',dataHandling.uuid());
}
// 处理外部链接参数 // 处理外部链接参数
this.handleExternalUrlParams(); this.handleExternalUrlParams();
......
...@@ -454,7 +454,7 @@ export default { ...@@ -454,7 +454,7 @@ export default {
}, },
//获取分享状态名片信息 //获取分享状态名片信息
getShareBusinessCard(cardId) { getShareBusinessCard(cardId) {
return request(`${apiURL}/business-card/view/${cardId}`, 'GET') return request(`${apiURL}/business-card/cards/${cardId}`, 'GET')
}, },
//查询名片状态 //查询名片状态
checkBusinessCradStatus(businessCardId) { checkBusinessCradStatus(businessCardId) {
...@@ -467,4 +467,8 @@ export default { ...@@ -467,4 +467,8 @@ export default {
dealerCouponCardList(params) { dealerCouponCardList(params) {
return request(`${sfpUrl}/dealerCoupon/inventory/list/page`, 'POST', params) return request(`${sfpUrl}/dealerCoupon/inventory/list/page`, 'POST', params)
}, },
//统计名片查看次数
statusBusinessCard(params) {
return request(`${apiURL}/business-card/cards/views`, 'POST', params)
},
} }
<!-- /components/ShareGuideTips/ShareGuideTips.vue -->
<template>
<view class="markBox" @click="close" v-if="show">
<view class="guideImgBox">
<image :src="imgSrc" mode="widthFix" ></image>
<view class="tips">
<view style="margin-bottom:30rpx">请点击右上角菜单</view>
<view>分享给朋友</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'ShareGuideTips',
props: {
// 控制是否显示
show: {
type: Boolean,
default: false
},
// 自定义图片路径(可选)
imgSrc: {
type: String,
default: '/static/Group132.png'
}
},
methods: {
close() {
this.$emit('update:show', false); // 支持 .sync 或 v-model
this.$emit('close'); // 兼容事件监听
}
}
};
</script>
<style scoped>
.markBox {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
justify-content: flex-end;
align-items: flex-start; /* 确保内容靠上 */
z-index: 100000;
background: rgba(0, 0, 0, 0.8);
}
.guideImgBox {
position: relative;
margin: 20px auto;
width: 100%;
}
.guideImgBox image {
width: 25% !important;
height: auto;
display: block;
position: absolute;
top: 0;
right: 10%;
}
.tips {
margin-top: 30%; /* 可根据设计调整 */
padding: 0 30px;
text-align: center;
font-size: 28rpx;
}
</style>
\ No newline at end of file
...@@ -136,7 +136,8 @@ ...@@ -136,7 +136,8 @@
const params = { const params = {
loginType:'3', loginType:'3',
mobile: this.mobile, mobile: this.mobile,
code: this.code code: this.code,
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
api.loginVerification(params).then((res)=>{ api.loginVerification(params).then((res)=>{
if(res['success']){ if(res['success']){
...@@ -151,6 +152,7 @@ ...@@ -151,6 +152,7 @@
uni.setStorageSync('cffp_userId', this.userId); uni.setStorageSync('cffp_userId', this.userId);
console.log('============',uni.getStorageSync('cffp_userId')) console.log('============',uni.getStorageSync('cffp_userId'))
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
this.loginTypeSync = "codelogin"; this.loginTypeSync = "codelogin";
this.queryInfo() this.queryInfo()
uni.$emit('loginUpdate'); uni.$emit('loginUpdate');
......
...@@ -6,14 +6,6 @@ ...@@ -6,14 +6,6 @@
<image class="imgbox" src="../assets/images/bg1.jpg" mode="widthFix"></image> <image class="imgbox" src="../assets/images/bg1.jpg" mode="widthFix"></image>
<view class="wapper"> <view class="wapper">
<view style="flex: 1;"> <view style="flex: 1;">
<!-- <view class="header">
<view class="one">
合伙人加盟
</view>
<view class="two">
优质资源,专业服务
</view>
</view> -->
<view class="header"> <view class="header">
<view class="headerLeft"> <view class="headerLeft">
<view class="one"> <view class="one">
...@@ -95,6 +87,7 @@ ...@@ -95,6 +87,7 @@
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue'; import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default { export default {
components: { components: {
everyJoinPopup, everyJoinPopup,
...@@ -153,7 +146,6 @@ ...@@ -153,7 +146,6 @@
}, },
onShow() { onShow() {
console.log('onShowloginType', uni.getStorageSync('loginType'));
if (uni.getStorageSync('loginType')) { if (uni.getStorageSync('loginType')) {
this.loginType = uni.getStorageSync('loginType') this.loginType = uni.getStorageSync('loginType')
} }
...@@ -345,7 +337,8 @@ ...@@ -345,7 +337,8 @@
} }
const params = { const params = {
loginType: '3', loginType: '3',
...this.form ...this.form,
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
if (this.loginType == 'codelogin') { if (this.loginType == 'codelogin') {
this.getApply() this.getApply()
...@@ -368,6 +361,7 @@ ...@@ -368,6 +361,7 @@
uni.setStorageSync('loginType', 'codelogin'); uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', this.userId); uni.setStorageSync('cffp_userId', this.userId);
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
this.queryInfo() this.queryInfo()
// 禁用和注销状态并存,以禁用为准 // 禁用和注销状态并存,以禁用为准
// 已经进行过注销操作的, 弹窗提示90天内不可再次申请加盟为合伙人 // 已经进行过注销操作的, 弹窗提示90天内不可再次申请加盟为合伙人
...@@ -401,106 +395,7 @@ ...@@ -401,106 +395,7 @@
} }
}, 500), }, 500),
// gotoApply() {
// // this.loginType = uni.getStorageSync('loginType')
// if (uni.getStorageSync('sharePosterObj')) {
// this.sharePosterObj = uni.getStorageSync('sharePosterObj')
// }
// console.log('this.sharePosterObj', this.sharePosterObj)
// // 登录并且是禁用状态
// if (this.loginType == 'codelogin' && this.userInfo.userIsActive == 2) {
// this.showCode = true
// this.restrictedOrCanelContent = '您的账号处在不可用状态,请扫码添加客服咨询情况'
// this.$refs.restrictedOrCanelTip.open()
// return
// }
// // 登录并且是注销状态 前端不判断,通过申请加盟的接口判断
// if (!this.form.nickName) {
// common.errorDialog(1, '请输入昵称');
// return false;
// }
// if (this.form.nickName && this.form.nickName.length < 2) {
// common.errorDialog(1, '昵称长度为2~10个字符');
// return
// }
// if (!this.form.mobile) {
// common.errorDialog(1, '请输入手机号');
// return false;
// }
// if (!common.mobileNoValid(this.form.mobile)) {
// common.errorDialog(2, '手机号格式填写错误');
// return false;
// }
// if (!this.loginType || this.loginType === 'visitor') {
// if (!this.form.code) {
// common.errorDialog(1, '请输入验证码');
// return false;
// }
// }
// if (!this.agreeFlag) {
// uni.showToast({
// title: '请阅读并勾选' + `${this.companyInfo.companyFullName}` + '服务协议和隐私条款',
// duration: 3000,
// icon: 'none'
// })
// return false;
// }
// const params = {
// loginType: '3',
// ...this.form
// }
// if (this.loginType == 'codelogin') {
// this.getApply()
// return
// }
// if (!this.loginType || this.loginType == 'visitor') {
// api.loginVerification(params).then((res) => {
// if (res['success']) {
// // 不能登录并且是禁用状态
// if (res.data.userIsActive == 2) {
// this.showCode = true
// this.restrictedOrCanelContent = '您的账号处在不可用状态,请扫码添加客服咨询情况'
// this.$refs.restrictedOrCanelTip.open()
// return
// }
// this.userId = String(res['data']['userId']);
// uni.setStorageSync('isLogin', '1');
// uni.setStorageSync('loginType', 'codelogin');
// uni.setStorageSync('cffp_userId', this.userId);
// uni.setStorageSync('uni-token', res.data['token']);
// this.queryInfo()
// // 禁用和注销状态并存,以禁用为准
// // 已经进行过注销操作的, 弹窗提示90天内不可再次申请加盟为合伙人
// // partnerIsActive 合伙人状态:1签约,2解约,3为加盟 ;解约过的合伙人状态一直为解约,直到下次签约成功才会改变
// // 登录并且是注销状态 前端不判断,通过申请加盟的接口判断
// // if(res.data.partnerIsActive==2){
// // this.showCode = false
// // this.restrictedOrCanelContent = '90天内不可再次申请加盟为合伙人'
// // this.$refs.restrictedOrCanelTip.open()
// // return
// // }
// // 是合伙人就不让在加盟
// if (res.data.isPartner && res.data.partnerIsActive == 1) {
// this.$refs.everyJoinPopup.open()
// return
// }
// // 不是合伙人就加盟
// if (!res.data.isPartner && res.data.partnerIsActive != 1) {
// this.getApply()
// }
// } else {
// uni.showToast({
// title: res['message'],
// duration: 2000,
// icon: 'none'
// })
// }
// })
// }
// },
queryInfo() { queryInfo() {
api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => { api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
......
...@@ -255,6 +255,7 @@ ...@@ -255,6 +255,7 @@
}, },
data() { data() {
return { return {
visitorUuid:'',
sharelogin: false, //是否需要登录 sharelogin: false, //是否需要登录
isLogin: true, //登录状态 isLogin: true, //登录状态
shareTipsFlag: false, shareTipsFlag: false,
...@@ -355,19 +356,24 @@ ...@@ -355,19 +356,24 @@
this.isShare = true this.isShare = true
this.userId = options.userId this.userId = options.userId
this.cardId = options.cardId this.cardId = options.cardId
} }
this.systemInfo = uni.getSystemInfoSync(); this.systemInfo = uni.getSystemInfoSync();
const { platform, deviceType, screenWidth, screenHeight } = this.systemInfo; const { platform, deviceType, screenWidth, screenHeight } = this.systemInfo;
}, },
onShow() { onShow() {
if(uni.getStorageSync('visitorUuid')){
this.visitorUuid = uni.getStorageSync('visitorUuid')
}
if (this.companyType == '1') { if (this.companyType == '1') {
this.companyLogo = '../../static/myteam/Group1633.png'; this.companyLogo = '../../static/myteam/Group1633.png';
} else if (this.companyType == '2') { } else if (this.companyType == '2') {
this.companyLogo = '../../static/suplogo.png'; this.companyLogo = '../../static/suplogo.png';
} }
if (this.isShare) { if (this.isShare) {
this.businessCradStatic()
this.getShareCard() this.getShareCard()
} else { } else {
this.getCard() this.getCard()
...@@ -449,25 +455,13 @@ ...@@ -449,25 +455,13 @@
this.isLogin = true this.isLogin = true
this.getCard() this.getCard()
}, },
// H5 自定义分享
getshareData() {
let data = {
title: ` ${this.cardInfo.userName}| ${this.cardInfo.companyInfoList[0].position} - ${this.cardInfo.companyInfoList[0].companyName}`,
desc: '​AI普惠型新家办领创家庭财事治理蓝海生态',
link: `${shareURL}/myPackageA/businessCard/businessCard?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1`, //分享链接
imgUrl: `${shareURL}/static/suplogo.png`, //图片
}
var url = window.location.href.split('#')[0]
hshare(data, url)
},
// 分享状态下获取名片信息 // 分享状态下获取名片信息
getShareCard() { getShareCard() {
console.log('获取分享名片');
api.getShareBusinessCard( api.getShareBusinessCard(
this.cardId this.cardId
).then(res => { ).then(res => {
if (res['success']) { if (res['success']) {
this.cardInfo = res.data.data this.cardInfo = res.data.data
this.cardId = res.data.data.id this.cardId = res.data.data.id
// this.infoList[0].value = this.cardInfo.phone || '暂无' // this.infoList[0].value = this.cardInfo.phone || '暂无'
...@@ -480,9 +474,27 @@ ...@@ -480,9 +474,27 @@
this.infoList[1].value = this.cardInfo.email || null this.infoList[1].value = this.cardInfo.email || null
this.infoList[2].value = this.cardInfo.address || '暂无' this.infoList[2].value = this.cardInfo.address || '暂无'
if (dataHandling.h5RuntimeEnv() !== 'miniprogram') { if (dataHandling.h5RuntimeEnv() !== 'miniprogram') {
// this.getshareData()
this.setRealPageMetaAndShare() this.setRealPageMetaAndShare()
} }
if(dataHandling.h5RuntimeEnv() == 'wechat-miniprogram'){
let shareInfo = {
title: ` ${this.cardInfo.userName}| ${this.cardInfo.companyInfoList[0].position} - ${this.cardInfo.companyInfoList[0].companyName}`,
desc: '​AI普惠型新家办领创家庭财事治理蓝海生态',
link: `${shareURL}/pages/lanch/index?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1&landingPage=businessCard&miniShare=1`,
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
sharePage:'businessCard',//分享的哪个页面
userId:this.userId,
cardId:this.cardId,
commonId:this.cardId
}
wx.miniProgram.postMessage({
data:{
type:'share',
shareData:JSON.stringify(shareInfo)
}
})
}
console.log('cardInfo', this.cardInfo); console.log('cardInfo', this.cardInfo);
} else { } else {
uni.showToast({ uni.showToast({
...@@ -512,15 +524,30 @@ ...@@ -512,15 +524,30 @@
this.btnList[1].phoneNumber = this.cardInfo.phone || null this.btnList[1].phoneNumber = this.cardInfo.phone || null
this.infoList[1].value = this.cardInfo.email || null this.infoList[1].value = this.cardInfo.email || null
this.infoList[2].value = this.cardInfo.address || '暂无' this.infoList[2].value = this.cardInfo.address || '暂无'
// this.cardInfo.companyInfoList = [
// {companyName:'上海律宝科技有限公司',position:'副总经理'},
// {companyName:'上海律宝科技有限公司',position:'CEO'},
// ]
if (dataHandling.h5RuntimeEnv() !== 'miniprogram') { if (dataHandling.h5RuntimeEnv() !== 'miniprogram') {
this.setRealPageMetaAndShare() this.setRealPageMetaAndShare()
// this.getshareData()
}
if(dataHandling.h5RuntimeEnv() == 'wechat-miniprogram'){
let shareInfo = {
title: ` ${this.cardInfo.userName}| ${this.cardInfo.companyInfoList[0].position} - ${this.cardInfo.companyInfoList[0].companyName}`,
desc: '​AI普惠型新家办领创家庭财事治理蓝海生态',
link: `${shareURL}/pages/lanch/index?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1&landingPage=businessCard&miniShare=1`,
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
sharePage:'businessCard',//分享的哪个页面
userId:this.userId,
cardId:this.cardId,
commonId:this.cardId
}
wx.miniProgram.postMessage({
data:{
type:'share',
shareData:JSON.stringify(shareInfo)
}
})
} }
this.getCardStatic() this.getCardStatic()
} else { } else {
uni.showToast({ uni.showToast({
...@@ -549,6 +576,21 @@ ...@@ -549,6 +576,21 @@
} }
}) })
}, },
// 统计名片查看次数
businessCradStatic() {
api.statusBusinessCard({ visitorUuid:this.visitorUuid,cardId:this.cardId }).then(res => {
if (res['success']) {
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
},
onClickItem(index) { onClickItem(index) {
if (this.current !== index) { if (this.current !== index) {
this.current = index; this.current = index;
...@@ -590,24 +632,31 @@ ...@@ -590,24 +632,31 @@
this.$refs.popup.open() this.$refs.popup.open()
return return
} }
if (dataHandling.h5RuntimeEnv() !== 'wechat-miniprogram') {
this.setRealPageMetaAndShare()
}
// 如果是移动端 // 如果是移动端
this.shareTipsFlag = true; //提示用户点击小程序的右上角胶囊进行分享 this.shareTipsFlag = true; //提示用户点击小程序的右上角胶囊进行分享
if (dataHandling.h5RuntimeEnv() !== 'miniprogram') { if(dataHandling.h5RuntimeEnv() == 'wechat-miniprogram'){
this.getshareData() let shareInfo = {
title: ` ${this.cardInfo.userName}| ${this.cardInfo.companyInfoList[0].position} - ${this.cardInfo.companyInfoList[0].companyName}`,
desc: '​AI普惠型新家办领创家庭财事治理蓝海生态',
link: `${shareURL}/pages/lanch/index?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1&landingPage=businessCard&miniShare=1`,
// link: `${shareURL}/myPackageA/businessCard/businessCard?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1`, //分享链接
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
sharePage:'businessCard',//分享的哪个页面
userId:this.userId,
cardId:this.cardId,
commonId:this.userId
}
wx.miniProgram.postMessage({
data:{
type:'share',
shareData:JSON.stringify(shareInfo)
}
})
} }
// if(dataHandling.h5RuntimeEnv() == 'miniprogram'){
// let data = {
// title: ` ${this.cardInfo.userName}| ${this.cardInfo.companyInfoList[0].position} - ${this.cardInfo.companyInfoList[0].companyName}`,
// desc: '​AI普惠型新家办领创家庭财事治理蓝海生态',
// link: `${shareURL}/myPackageA/businessCard/businessCard?userId=${this.userId}&cardId=${this.cardId}&isShareCard=1`, //分享链接
// imgUrl: `${shareURL}/myPackageA/static/images/suplogo.png`, //图片
// }
// // 这里应该给小程序的webview发消息,不知道该怎样发送?此时
// wx.miniProgram.navigateTo({
// url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}`
// })
// }
} }
}, },
//关闭登录 //关闭登录
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
import {companyInfo} from "@/environments/environment"; import {companyInfo} from "@/environments/environment";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue'; import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
import dataHandling from "@/util/dataHandling";
export default { export default {
data() { data() {
return { return {
...@@ -180,7 +181,8 @@ ...@@ -180,7 +181,8 @@
}); });
const params = { const params = {
loginType:loginType, loginType:loginType,
...this.form ...this.form,
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
api.loginVerification(params).then((res)=>{ api.loginVerification(params).then((res)=>{
if(res['success']){ if(res['success']){
...@@ -195,7 +197,7 @@ ...@@ -195,7 +197,7 @@
uni.setStorageSync('cffp_userId',this.userId); uni.setStorageSync('cffp_userId',this.userId);
uni.setStorageSync('loginType',this.loginType); uni.setStorageSync('loginType',this.loginType);
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
if(urlType == 'personalCenter'){ if(urlType == 'personalCenter'){
uni.switchTab({ uni.switchTab({
url:'/pages/personalCenter/personalCenter' url:'/pages/personalCenter/personalCenter'
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
:cffpCourseInfos="cffpCourseInfos" :cffpCourseInfos="cffpCourseInfos"
@changeCourseClassify="changeCourseClassify" @changeCourseClassify="changeCourseClassify"
ref="courselist" ref="courselist"
pageSource="index"
></courselist> ></courselist>
</view> </view>
...@@ -204,6 +205,7 @@ ...@@ -204,6 +205,7 @@
import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue"; import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue";
import {hshare} from '@/util/fiveshare'; import {hshare} from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue'; import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
import wx from 'weixin-js-sdk'
export default { export default {
data() { data() {
return { return {
...@@ -270,13 +272,13 @@ ...@@ -270,13 +272,13 @@
JoinPopup, JoinPopup,
PartnerTipPopup, PartnerTipPopup,
restrictedTip, restrictedTip,
}, },
onShow() { onShow() {
if(uni.getStorageSync('dataToken')){ if(uni.getStorageSync('dataToken')){
this.dataToken = uni.getStorageSync('dataToken') this.dataToken = uni.getStorageSync('dataToken')
} }
console.log('webview',typeof wx !== 'undefined' && wx.miniProgram);
this.loginType = uni.getStorageSync('loginType') this.loginType = uni.getStorageSync('loginType')
this.init(); this.init();
...@@ -291,7 +293,24 @@ ...@@ -291,7 +293,24 @@
if(uni.getStorageSync('cffp_userId')){ if(uni.getStorageSync('cffp_userId')){
this.userId = uni.getStorageSync('cffp_userId') this.userId = uni.getStorageSync('cffp_userId')
} }
if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
let shareInfo = {
title: '成为银盾合伙人,分享商品赚不停',
desc: `资源+伙伴,共赢未来!`,
link: `${shareURL}/pages/index/index?miniShare=1`, //分享链接
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
commonId:uni.getStorageSync('cffp_userId') || Date.now(),
sharePage:'index'//分享出去得页面
}
wx.miniProgram.postMessage({
data: {
type: 'share',
shareData: JSON.stringify(shareInfo)
}
})
return
}
}, },
onHide() { onHide() {
this.$nextTick(()=>{ this.$nextTick(()=>{
...@@ -494,7 +513,7 @@ ...@@ -494,7 +513,7 @@
] ]
uni.removeTabBarBadge({ index: 3 }); uni.removeTabBarBadge({ index: 3 });
api.loginVerification({ api.loginVerification({
"loginType": 1 "loginType": 1,
}).then((res) => { }).then((res) => {
if (res['success']) { if (res['success']) {
this.userId = String(res['data']['userId']); this.userId = String(res['data']['userId']);
...@@ -752,6 +771,7 @@ ...@@ -752,6 +771,7 @@
}) })
}, },
reLogin(){ reLogin(){
console.log('index调用');
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}); });
...@@ -759,7 +779,9 @@ ...@@ -759,7 +779,9 @@
const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i); const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i);
const params = { const params = {
loginType:'5', loginType:'5',
authToken: this.dataToken authToken: this.dataToken,
loginType: '5',
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
api.loginVerification(params).then((res)=>{ api.loginVerification(params).then((res)=>{
if(res['success']){ if(res['success']){
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
<view class="markBox" @click="shareTipsFlag=false" v-if="shareTipsFlag"> <!-- <view class="markBox" @click="shareTipsFlag=false" v-if="shareTipsFlag">
<view class="guideImgBox"> <view class="guideImgBox">
<image src="../../static/Group132.png" mode="widthFix"></image> <image src="../../static/Group132.png" mode="widthFix"></image>
<view class="tips"> <view class="tips">
...@@ -102,7 +102,9 @@ ...@@ -102,7 +102,9 @@
<view>分享给朋友</view> <view>分享给朋友</view>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 分享得向导图 -->
<ShareGuide :show.sync="shareTipsFlag" @close="shareTipsFlag=false"></ShareGuide>
<!-- 海报弹窗 --> <!-- 海报弹窗 -->
<sharePosterPop ref="sharePosterPop" :generatedImage="generatedImage" @closePoster="closePoster" <sharePosterPop ref="sharePosterPop" :generatedImage="generatedImage" @closePoster="closePoster"
btnBottom="-15%"></sharePosterPop> btnBottom="-15%"></sharePosterPop>
...@@ -119,10 +121,13 @@ ...@@ -119,10 +121,13 @@
import UQRCode from 'uqrcodejs'; import UQRCode from 'uqrcodejs';
import { elementToImage } from '@/util/htmlToImage'; import { elementToImage } from '@/util/htmlToImage';
import loadingIcon from '@/components/loading/loading.vue'; import loadingIcon from '@/components/loading/loading.vue';
import ShareGuide from '@/components/ShareGuide/ShareGuide.vue';
import wx from 'weixin-js-sdk'
export default { export default {
components: { components: {
sharePosterPop, sharePosterPop,
loadingIcon loadingIcon,
ShareGuide
}, },
data() { data() {
return { return {
...@@ -172,7 +177,7 @@ ...@@ -172,7 +177,7 @@
if (this.companyType == '1') { if (this.companyType == '1') {
this.ydLogoShare = `${shareURL}/static/cffp_logo.jpg`; this.ydLogoShare = `${shareURL}/static/cffp_logo.jpg`;
} else { } else {
this.ydLogoShare = `${shareURL}/static/suplogo.png`; this.ydLogoShare = `${shareURL}/myPackageA/static/images/logo3.webp`;
} }
if (companyInfo.companyType == '1') { if (companyInfo.companyType == '1') {
this.companyLogo = '../../static/myteam/Group1633.png'; this.companyLogo = '../../static/myteam/Group1633.png';
...@@ -272,6 +277,7 @@ ...@@ -272,6 +277,7 @@
// this.dataForm.areaName = this.isCross == false ? this.queryList[this.index].areaName : this.dataForm.areaName // this.dataForm.areaName = this.isCross == false ? this.queryList[this.index].areaName : this.dataForm.areaName
this.dataForm.areaId = 1; this.dataForm.areaId = 1;
this.dataForm.areaName = '默认'; this.dataForm.areaName = '默认';
if (this.dataForm.name == "" || this.dataForm.mobileNumber == "" || this.dataForm.areaName == '') { if (this.dataForm.name == "" || this.dataForm.mobileNumber == "" || this.dataForm.areaName == '') {
uni.showToast({ uni.showToast({
title: '请将信息补充完整', title: '请将信息补充完整',
...@@ -311,15 +317,15 @@ ...@@ -311,15 +317,15 @@
// } // }
//#ifdef H5 //#ifdef H5
// 小程序跳cffp得分享 // 小程序跳cffp得分享
if (uni.getStorageSync('mpCffp')) { // if (uni.getStorageSync('mpCffp')) {
this.qrCodeUrl = shareURL + // this.qrCodeUrl = shareURL +
"/myPackageA/applyFranchise/applyFranchise?shareId=" + // "/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' + // this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' +
this.userId, //分享链接 // this.userId, //分享链接
this.posterImg = '@/static/images/sharePoster.png' // this.posterImg = '@/static/images/sharePoster.png'
this.isLoading = true // this.isLoading = true
return // return
} // }
this.shareTipsFlag = true; this.shareTipsFlag = true;
this.getshareData() this.getshareData()
// #endif // #endif
...@@ -340,6 +346,28 @@ ...@@ -340,6 +346,28 @@
if (!this.realName) { if (!this.realName) {
this.realName = "" this.realName = ""
} }
if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
let shareInfo = {
title: '银盾家办家庭财务策划师联盟邀您加入',
desc: `${this.realName}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`,
link: `${shareURL}/pages/lanch/index?shareId=${this.shareId}&invitationCode=${this.invitationCode}&inviteUserId=${this.userId}&landingPage=applyFranchise&miniShare=1`,
// link: shareURL +
// "/myPackageA/applyFranchise/applyFranchise?shareId=" +
// this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' + this
// .userId, //分享链接
imgUrl: this.ydLogoShare, //图片
commonId:this.invitationCode,
sharePage:'applyFranchise'//分享出去得页面
}
wx.miniProgram.postMessage({
data: {
type: 'share',
shareData: JSON.stringify(shareInfo)
}
})
return
}
let data = { let data = {
title: '银盾家办家庭财务策划师联盟邀您加入', title: '银盾家办家庭财务策划师联盟邀您加入',
//desc: `我是家庭财务策划师${this.realName}正在使用银盾家办,点击即刻加入!`, //desc: `我是家庭财务策划师${this.realName}正在使用银盾家办,点击即刻加入!`,
...@@ -391,15 +419,15 @@ ...@@ -391,15 +419,15 @@
this.$refs.share.open() this.$refs.share.open()
// #endif // #endif
//#ifdef H5 //#ifdef H5
if (uni.getStorageSync('mpCffp')) { // if (uni.getStorageSync('mpCffp')) {
this.qrCodeUrl = shareURL + // this.qrCodeUrl = shareURL +
"/myPackageA/applyFranchise/applyFranchise?shareId=" + // "/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' + // this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' +
this.userId, //分享链接 // this.userId, //分享链接
this.posterImg = '@/static/images/sharePoster.png' // this.posterImg = '@/static/images/sharePoster.png'
this.isLoading = true // this.isLoading = true
return // return
} // }
this.shareTipsFlag = true; this.shareTipsFlag = true;
this.getshareData() this.getshareData()
// #endif // #endif
......
...@@ -2,26 +2,62 @@ ...@@ -2,26 +2,62 @@
<view class="loadTxt">Loading...</view> <view class="loadTxt">Loading...</view>
</template> </template>
<script setup > <script setup>
import { ref } from "vue"; import { ref } from "vue";
import api from '@/api/api'; import api from '@/api/api';
import { onLaunch, onLoad } from '@dcloudio/uni-app' import { onLaunch, onLoad } from '@dcloudio/uni-app'
import * as environment from '@/environments/environment' import * as environment from '@/environments/environment'
import dataHandling from "@/util/dataHandling";
import wx from 'weixin-js-sdk'
let jumpInfo = ref({}) let jumpInfo = ref({})
let dataToken = ref() let dataToken = ref()
onLoad((options) => { onLoad((options) => {
jumpInfo.value = JSON.parse(JSON.stringify(options))
// 参数带token了重新登录 // 参数带token了重新登录
if (options.dataToken) { if (options.dataToken) {
jumpInfo.value = JSON.parse(JSON.stringify(options)) console.log('jumpInfo.value', jumpInfo.value);
// uni.clearStorageSync(); // uni.clearStorageSync();
dataToken.value = decodeURIComponent(options.dataToken) dataToken.value = decodeURIComponent(options.dataToken)
reLogin(options.landingPage) reLogin(options.landingPage)
return
} else if (options.miniShare) {
// 通过小程序分享进来的但没登录
if (options.landingPage == 'courseDetail') {
uni.reLaunch({ url: `/pages/courseDetail/courseDetail?fileId=${jumpInfo.value.fileId}&coursesharing=1&serialsNo=${jumpInfo.value.serialsNo}&shareCode=${jumpInfo.value.shareCode}&shareUserId=${jumpInfo.value.shareUserId}&jumpUrl=${jumpInfo.value.jumpUrl}&miniShare=1` })
} else if (options.landingPage == 'businessCard') {
uni.reLaunch({ url: `/myPackageA/businessCard/businessCard?userId=${jumpInfo.value.userId}&isShareCard=1&cardId=${jumpInfo.value.cardId}&miniShare=1` })
} else if (options.landingPage == 'applyFranchise') {
uni.reLaunch({ url: `/myPackageA/applyFranchise/applyFranchise?shareId=${jumpInfo.value.shareId}&invitationCode=${jumpInfo.value.invitationCode}&inviteUserId=${jumpInfo.value.inviteUserId}&miniShare=1` })
}else if(options.landingPage == 'index'){
uni.reLaunch({
url:'/pages/index/index?miniShare=1'
})
}else if(options.landingPage == 'courselist'){
uni.reLaunch({
url:'/pages/courselist/courselist'
})
}
return
}else if(options.noLogin){
// 去到小程序登录页了,没登录
if (options.landingPage == 'courseDetail') {
uni.reLaunch({ url: `/pages/courseDetail/courseDetail?fileId=${jumpInfo.value.fileId}` })
}else if(options.landingPage == 'index'){
uni.reLaunch({
url:'/pages/index/index'
})
}else if(options.landingPage == 'courselist'){
uni.reLaunch({
url:'/pages/courselist/courselist'
})
}
} }
}) })
const reLogin = (landingPage) => { const reLogin = (landingPage) => {
console.log('lanuch调用了');
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}); });
...@@ -29,7 +65,8 @@ ...@@ -29,7 +65,8 @@
const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i); const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i);
const params = { const params = {
loginType: '5', loginType: '5',
authToken: dataToken.value authToken: dataToken.value,
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
api.loginVerification(params).then((res) => { api.loginVerification(params).then((res) => {
if (res['success']) { if (res['success']) {
...@@ -37,13 +74,33 @@ ...@@ -37,13 +74,33 @@
uni.setStorageSync('loginType', 'codelogin'); uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', res.data.userId); uni.setStorageSync('cffp_userId', res.data.userId);
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
if (landingPage == 'sfpHousePurchase') { if (landingPage == 'sfpHousePurchase') {
uni.reLaunch({ url: `/sfp/housePurchase/housePurchase` }) uni.reLaunch({ url: `/sfp/housePurchase/housePurchase` })
}else if(landingPage == 'sfpIndex'){ } else if (landingPage == 'sfpIndex') {
uni.reLaunch({ url: `/sfp/index/index` }) uni.reLaunch({ url: `/sfp/index/index` })
}else if(landingPage == 'orderStatus'){ } else if (landingPage == 'orderStatus') {
uni.reLaunch({ url: `/pages/orderStatus/orderStatus?orderStatus=2` }) uni.reLaunch({ url: `/pages/orderStatus/orderStatus?orderStatus=2` })
} else if (landingPage == 'courseDetail') {
if(jumpInfo.value.noShare){
uni.reLaunch({ url: `/pages/courseDetail/courseDetail?fileId=${jumpInfo.value.fileId}&noShare=1`})
} else {
uni.reLaunch({ url: `/pages/courseDetail/courseDetail?fileId=${jumpInfo.value.fileId}&coursesharing=1&serialsNo=${jumpInfo.value.serialsNo}&shareCode=${jumpInfo.value.shareCode}&shareUserId=${jumpInfo.value.shareUserId}&jumpUrl=${jumpInfo.value.jumpUrl}&miniShare=1` })
}
return
} else if (landingPage == 'businessCard') {
uni.reLaunch({ url: `/myPackageA/businessCard/businessCard?userId=${jumpInfo.value.userId}&isShareCard=1&cardId=${jumpInfo.value.cardId}&miniShare=1` })
} else if (landingPage == 'applyFranchise') {
uni.reLaunch({ url: `/myPackageA/applyFranchise/applyFranchise?shareId=${jumpInfo.value.shareId}&invitationCode=${jumpInfo.value.invitationCode}&inviteUserId=${jumpInfo.value.inviteUserId}&miniShare=1` })
}else if(landingPage == 'index'){
uni.reLaunch({
url:'/pages/index/index?miniShare=1'
})
}else if(landingPage == 'courselist'){
uni.reLaunch({
url:'/pages/courselist/courselist'
})
} }
} else { } else {
uni.showToast({ uni.showToast({
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
</template> </template>
<!-- 价格明细 --> <!-- 价格明细 -->
<view class="priceInfoContent"> <view class="priceInfoContent">
<h4>价格明细</h4> <h4>价格明细</h4>
<view ><text class="txtFont">现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text></view> <view ><text class="txtFont">现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text></view>
<view> <view>
...@@ -209,6 +210,7 @@ ...@@ -209,6 +210,7 @@
calculatedPrice: 0, calculatedPrice: 0,
dataToken:'', dataToken:'',
oldToken:'',//原始用户token oldToken:'',//原始用户token
pollTimer:''
} }
}, },
computed: { computed: {
...@@ -229,7 +231,7 @@ ...@@ -229,7 +231,7 @@
} }
} }
}, },
methods: { methods: {
goBack() { goBack() {
...@@ -314,22 +316,15 @@ ...@@ -314,22 +316,15 @@
// 向小程序通信 // 向小程序通信
// if(dataHandling.h5RuntimeEnv()=='wechat-miniprogram'){ // if(dataHandling.h5RuntimeEnv()=='wechat-miniprogram'){
// wx.miniProgram.navigateBack({
// delta:1 // uni.setStorageSync('pendingPayOrder',JSON.stringify(param))
// })
// // 向小程序发送消息,只有触发后退,分享,复制的时候小程序才能接收消息
// wx.miniProgram.postMessage({
// data:{
// type:'pay',
// payInfo:param
// }
// })
// console.log('向小程序通信'); // console.log('向小程序通信');
// // 跳转到小程序消息接收中转页面,拉起小程序的支付 // // 跳转到小程序消息接收中转页面,拉起小程序的支付
// // wx.miniProgram.navigateTo({ // wx.miniProgram.navigateTo({
// // url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}` // url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}`
// // }) // })
// return // return
// } // }
...@@ -546,7 +541,8 @@ ...@@ -546,7 +541,8 @@
}); });
const params = { const params = {
loginType:'5', loginType:'5',
authToken: uni.getStorageSync('dataToken') authToken: uni.getStorageSync('dataToken'),
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid()
} }
api.loginVerification(params).then((res)=>{ api.loginVerification(params).then((res)=>{
if(res['success']){ if(res['success']){
...@@ -557,6 +553,7 @@ ...@@ -557,6 +553,7 @@
uni.setStorageSync('loginType','codelogin'); uni.setStorageSync('loginType','codelogin');
uni.setStorageSync('cffp_userId', res.data.userId); uni.setStorageSync('cffp_userId', res.data.userId);
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
}else if(flag=='2'){ }else if(flag=='2'){
// 有userid,直接可以购买但付款人只是帮订单账号付钱,购买成功还是进入到付款人的账号 // 有userid,直接可以购买但付款人只是帮订单账号付钱,购买成功还是进入到付款人的账号
this.oldToken = uni.getStorageSync('uni-token') this.oldToken = uni.getStorageSync('uni-token')
...@@ -575,9 +572,12 @@ ...@@ -575,9 +572,12 @@
}) })
uni.hideLoading() uni.hideLoading()
} },
}, },
onLoad(option) { onLoad(option) {
if(uni.getStorageSync('dataToken')){ if(uni.getStorageSync('dataToken')){
this.dataToken = uni.getStorageSync('dataToken') this.dataToken = uni.getStorageSync('dataToken')
} }
...@@ -627,6 +627,11 @@ ...@@ -627,6 +627,11 @@
}, window.location.href); }, window.location.href);
// #endif // #endif
}, },
beforeUnmount() {
// window.removeEventListener('pageshow', this.handlePageShow);
},
} }
</script> </script>
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
</text> </text>
<text <text
v-else-if="!customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentNickName}}</text> v-else-if="!customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentNickName}}</text>
</view> </view>
<view class="desBox">{{customerBasicInfo.mobile}}</view> <view class="desBox">{{customerBasicInfo.mobile}}</view>
</view> </view>
</view> </view>
...@@ -58,8 +58,7 @@ ...@@ -58,8 +58,7 @@
</view> </view>
</view> </view>
<!-- 有名片数据并且是启用状态可以看名片 --> <!-- 有名片数据并且是启用状态可以看名片 -->
<view class="infoBody" v-if="showbusinessCard" <view class="infoBody" v-if="showbusinessCard" style="margin-top: 10rpx;" @click="businessCard()">
style="margin-top: 10rpx;" @click="businessCard()">
<view class=""> <view class="">
我的名片 我的名片
</view> </view>
...@@ -181,11 +180,12 @@ ...@@ -181,11 +180,12 @@
import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue"; import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue'; import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
import wx from 'weixin-js-sdk'
export default { export default {
data() { data() {
return { return {
showbusinessCard:false,//是否显示名片 showbusinessCard: false, //是否显示名片
mpCffp:'', mpCffp: '',
showMyName: '', showMyName: '',
msgTotal: 0, msgTotal: 0,
messageInfo: [], messageInfo: [],
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
inviteEqrode: '', inviteEqrode: '',
currentPage: 'personalCenter', currentPage: 'personalCenter',
customerBasicInfo: {}, customerBasicInfo: {},
loginornot: true,//登录状态 loginornot: true, //登录状态
tabBarPadding: 100, tabBarPadding: 100,
settingItem: { settingItem: {
title: '系统设置', title: '系统设置',
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
id: '01', id: '01',
categoryName: '团队', categoryName: '团队',
children: [{ children: [{
key:'applyFranchises', key: 'applyFranchises',
title: '申请加盟', title: '申请加盟',
icon: 'icon-hezuo', icon: 'icon-hezuo',
link: '/myPackageA/applyFranchise/applyFranchise?', link: '/myPackageA/applyFranchise/applyFranchise?',
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
onShow() { onShow() {
this.showbusinessCard = false this.showbusinessCard = false
this.loginType = uni.getStorageSync('loginType') this.loginType = uni.getStorageSync('loginType')
if(uni.getStorageSync('mpCffp')){ if (uni.getStorageSync('mpCffp')) {
this.mpCffp = uni.getStorageSync('mpCffp') this.mpCffp = uni.getStorageSync('mpCffp')
} }
if (this.companyType == '1') { if (this.companyType == '1') {
...@@ -457,13 +457,13 @@ ...@@ -457,13 +457,13 @@
applyItem.isShow = !dealerId && levelCode != 'P3'; // 没有 dealerId 才显示 applyItem.isShow = !dealerId && levelCode != 'P3'; // 没有 dealerId 才显示
} }
} }
// #ifdef H5 // #ifdef H5
initJssdkShare(() => { initJssdkShare(() => {
setWechatShare(); setWechatShare();
}, window.location.href); }, window.location.href);
// #endif // #endif
console.log('mpcffp',this.mpCffp); console.log('mpcffp', this.mpCffp);
}, },
methods: { methods: {
...@@ -517,7 +517,8 @@ ...@@ -517,7 +517,8 @@
for (let key in this.partnerStatistic) { for (let key in this.partnerStatistic) {
if (key != 'peopleNum' && key != 'reachPeopleNum' && key != 'totalPeopleNum') { if (key != 'peopleNum' && key != 'reachPeopleNum' && key != 'totalPeopleNum') {
if (key) { if (key) {
this.partnerStatistic[key] = this.partnerStatistic[key] ? Number(this.partnerStatistic[key].toFixed(2)) : 0 this.partnerStatistic[key] = this.partnerStatistic[key] ? Number(this
.partnerStatistic[key].toFixed(2)) : 0
} }
} }
} }
...@@ -586,6 +587,10 @@ ...@@ -586,6 +587,10 @@
this.bootpage = false this.bootpage = false
}, },
isLogin() { isLogin() {
// if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
// this.jumpMplogin()
// return
// }
uni.navigateTo({ uni.navigateTo({
url: '/myPackageA/login/login?from=personalCenter' url: '/myPackageA/login/login?from=personalCenter'
}) })
...@@ -598,7 +603,7 @@ ...@@ -598,7 +603,7 @@
}, },
// 菜单跳转页面 // 菜单跳转页面
goDetail(item) { goDetail(item) {
if (uni.getStorageSync('cffp_userInfo')) { if (uni.getStorageSync('cffp_userInfo')) {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo')) this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
} }
...@@ -642,7 +647,6 @@ ...@@ -642,7 +647,6 @@
}); });
// #endif // #endif
// #ifdef H5 // #ifdef H5
console.log('H5====')
dataHandling.pocessTracking( dataHandling.pocessTracking(
'咨询客服', '咨询客服',
`用户咨询客服`, `用户咨询客服`,
...@@ -703,21 +707,23 @@ ...@@ -703,21 +707,23 @@
}); });
return return
} }
console.log('判断',(!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor') && !item.islogin);
if ((!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor') && !item.islogin) { if ((!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor') && !item.islogin) {
// 小程序进入到系统,走小程序的登录
this.isLogin() this.isLogin()
return return
} }
// 登录状态下直接去我的卡券 // 登录状态下直接去我的卡券
if(item.key=='ticket'){ if (item.key == 'ticket') {
uni.navigateTo({ uni.navigateTo({
url: `${item.link}` url: `${item.link}`
}); });
return return
} }
if (item.isShow && item.isOpen) { if (item.isShow && item.isOpen) {
if (item.title === '我的邀请码') { if (item.title === '我的邀请码') {
this.$refs.popup1.open('bottom'); this.$refs.popup1.open('bottom');
...@@ -745,9 +751,9 @@ ...@@ -745,9 +751,9 @@
url: `${item.link}?levelCode=` + this.customerBasicInfo.levelCode url: `${item.link}?levelCode=` + this.customerBasicInfo.levelCode
}); });
} else { } else {
const urlObj = JSON.parse(JSON.stringify(item)) const urlObj = JSON.parse(JSON.stringify(item))
console.log('222222222',urlObj.link); console.log('222222222', urlObj.link);
if (urlObj.type) { if (urlObj.type) {
urlObj.link = urlObj.link =
`${urlObj.link}?type=${urlObj.type}&from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}` `${urlObj.link}?type=${urlObj.type}&from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}`
...@@ -840,11 +846,11 @@ ...@@ -840,11 +846,11 @@
api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => { api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
if (res['success']) { if (res['success']) {
this.customerBasicInfo = res['data']; this.customerBasicInfo = res['data'];
if(res['data']['businessCardId']){ if (res['data']['businessCardId']) {
// 检查名片状态 // 检查名片状态
this.getBusissedCardStatus(res['data']['businessCardId']) this.getBusissedCardStatus(res['data']['businessCardId'])
} }
// id=03的权限设置 // id=03的权限设置
// 执行处理 // 执行处理
const result = this.setSpecificMenuIsShow(this.mainMenuLists, this.customerBasicInfo const result = this.setSpecificMenuIsShow(this.mainMenuLists, this.customerBasicInfo
...@@ -903,7 +909,7 @@ ...@@ -903,7 +909,7 @@
// url: '/myPackageA/noBusinessCard/noBusinessCard' // url: '/myPackageA/noBusinessCard/noBusinessCard'
// }); // });
// } // }
if (cardStatus == '2') { if (cardStatus == '2') {
// 名片审核中 // 名片审核中
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -936,7 +942,7 @@ ...@@ -936,7 +942,7 @@
getBusissedCardStatus(businessCardId) { getBusissedCardStatus(businessCardId) {
api.checkBusinessCradStatus(businessCardId).then(res => { api.checkBusinessCradStatus(businessCardId).then(res => {
if (res['success']) { if (res['success']) {
if(businessCardId&&res.data.data.status=='1'){ if (businessCardId && res.data.data.status == '1') {
this.showbusinessCard = true this.showbusinessCard = true
} }
} else { } else {
...@@ -948,6 +954,31 @@ ...@@ -948,6 +954,31 @@
} }
}) })
}, },
jumpMplogin(){
let currentUrl = window.location.href;
console.log('获取页面路径');
// if(this.miniShareInfo.miniShare){
// currentUrl = `${shareURL}/pages/lanch/index?fileId=${this.miniShareInfo.fileId}&coursesharing=1&serialsNo=${this.miniShareInfo.serialsNo}&shareCode=${this.miniShareInfo.shareCode}&shareUserId=${this.miniShareInfo.userId}&jumpUrl=${this.miniShareInfo.jumpUrl}&landingPage=courseDetail&miniShare=1`
// }else {
// currentUrl = `${shareURL}/pages/lanch/index?fileId=${this.fileId}&landingPage=courseDetail&noShare=1`
// }
let data = {
type:'login',
h5SystemType:'cffp',
link: encodeURIComponent(currentUrl),
}
wx.miniProgram.postMessage({
data:{
type:'login',
shareData:JSON.stringify(data)
}
})
wx.miniProgram.navigateBack({
delta:1
})
}
}, },
......
...@@ -441,6 +441,14 @@ export default{ ...@@ -441,6 +441,14 @@ export default{
// 如果不是合法 11 位手机号,原样返回或提示错误 // 如果不是合法 11 位手机号,原样返回或提示错误
return phone; return phone;
} },
// 生成uuid
uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
import api from "@/api/api"; import api from "@/api/api";
import dataHandling from './dataHandling' import dataHandling from './dataHandling'
import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import { shareURL } from "@/environments/environment";
import wx from 'weixin-js-sdk'
//只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页 //只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页
// 页面白名单,不受拦截 // 页面白名单,不受拦截
const whiteList = [ const whiteList = [
...@@ -23,6 +25,11 @@ const whiteList = [ ...@@ -23,6 +25,11 @@ const whiteList = [
'pages/lanch/index', 'pages/lanch/index',
'/myPackageA/poster/poster', '/myPackageA/poster/poster',
] ]
// 作为h5内嵌到小小程序时,自定义页面分享内容得页面
let shareCustomPageList = [
'/pages/courselist/courselist',
'/myPackageA/businessCard/businessCard',
]
export default function initApp(){ export default function initApp(){
let date = Date.now() let date = Date.now()
...@@ -36,6 +43,26 @@ export default function initApp(){ ...@@ -36,6 +43,26 @@ export default function initApp(){
let pages = getCurrentPages() let pages = getCurrentPages()
let pagesLength = pages.length let pagesLength = pages.length
if(shareCustomPageList.indexOf(e.url)==-1){
if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
let shareInfo = {
title: '成为银盾合伙人,分享商品赚不停',
desc: `资源+伙伴,共赢未来!`,
link: `${shareURL}/pages/index/index?miniShare=1`, //分享链接
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
commonId:uni.getStorageSync('cffp_userId'),
sharePage:'index'//分享出去得页面
}
wx.miniProgram.postMessage({
data: {
type: 'share',
shareData: JSON.stringify(shareInfo)
}
})
return
}
}
if(whiteList.indexOf(e.url)==-1&&!uni.getStorageSync('loginType')){ if(whiteList.indexOf(e.url)==-1&&!uni.getStorageSync('loginType')){
uni.setStorageSync('loginType','visitor') uni.setStorageSync('loginType','visitor')
...@@ -120,6 +147,26 @@ export default function initApp(){ ...@@ -120,6 +147,26 @@ export default function initApp(){
// tabbar页面跳转前进行拦截 // tabbar页面跳转前进行拦截
invoke(e) { invoke(e) {
if(shareCustomPageList.indexOf(e.url)==-1){
if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
let shareInfo = {
title: '成为银盾合伙人,分享商品赚不停',
desc: `资源+伙伴,共赢未来!`,
link: `${shareURL}/pages/index/index?miniShare=1`, //分享链接
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
commonId:uni.getStorageSync('cffp_userId'),
sharePage:'index'//分享出去得页面
}
wx.miniProgram.postMessage({
data: {
type: 'share',
shareData: JSON.stringify(shareInfo)
}
})
return
}
}
if(uni.getStorageSync('cffp_userId')){ if(uni.getStorageSync('cffp_userId')){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{ api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
// if(!res['success']){ // if(!res['success']){
...@@ -157,7 +204,26 @@ export default function initApp(){ ...@@ -157,7 +204,26 @@ export default function initApp(){
uni.addInterceptor('reLaunch', { uni.addInterceptor('reLaunch', {
//页面跳转前拦截 //页面跳转前拦截
invoke(e) { invoke(e) {
if(shareCustomPageList.indexOf(e.url)==-1){
if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
let shareInfo = {
title: '成为银盾合伙人,分享商品赚不停',
desc: `资源+伙伴,共赢未来!`,
link: `${shareURL}/pages/index/index?miniShare=1`, //分享链接
imgUrl: `${shareURL}/myPackageA/static/images/logo3.webp`, //图片
commonId:uni.getStorageSync('cffp_userId'),
sharePage:'index'//分享出去得页面
}
wx.miniProgram.postMessage({
data: {
type: 'share',
shareData: JSON.stringify(shareInfo)
}
})
return
}
}
if (date) { if (date) {
//如果时间戳存在 那么记录此页面的停留时间 //如果时间戳存在 那么记录此页面的停留时间
dataHandling.pocessTracking( dataHandling.pocessTracking(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment