2021-08-19 06:40:59 +00:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 状态栏 -->
|
|
|
|
|
<status-nav :titleVal="'分享中心'" :statusTitle="true"></status-nav>
|
|
|
|
|
<!-- 自定义二级分类 -->
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
|
|
|
|
|
<view class="radius20 pad20 bacf mar-s20 col3">
|
2021-08-19 09:27:37 +00:00
|
|
|
|
<view class="fon28 bold mar-x40 pad-z10">我的分享</view>
|
2021-08-19 06:40:59 +00:00
|
|
|
|
<view class="disja">
|
|
|
|
|
<view @tap="goPage(index)" class="disac fc flexs width33" v-for="(item,index) in dataList" :key="index">
|
|
|
|
|
<view class="fon36 bold clips1">{{item.num}}</view>
|
|
|
|
|
<view class="fon26 mar-s25">{{item.title}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 分享按钮 -->
|
2021-08-19 09:27:37 +00:00
|
|
|
|
<view @tap="shareEv" class="disjcac radius20 posir" style="height: 90rpx;margin: 70rpx 80rpx;background-color: #38CE51;line-height: 90rpx;">
|
2021-08-19 06:40:59 +00:00
|
|
|
|
<view class="disac">
|
|
|
|
|
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
|
|
|
|
|
<view class="fon40 bold colf mar-z10">分享给好友</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <button open-type="share" class="posia width100" style="opacity: 0;">分享给好友</button> -->
|
2021-08-19 09:27:37 +00:00
|
|
|
|
<!-- <button @tap="shareEv" class="posia width100" style="opacity: 0;">分享给好友</button> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 弹框 -->
|
|
|
|
|
<pu-po :isShowT="isShowT" :contentVal="'暂未开放此功能,请耐心等候'" :isCenter="true" :comfrimVal="'好的'" @comfirmev="isShowT=false"></pu-po>
|
2021-08-26 09:57:04 +00:00
|
|
|
|
<!-- 底部客服 -->
|
2022-02-15 08:02:16 +00:00
|
|
|
|
<!-- <public-customer :nbottom="100"></public-customer> -->
|
2022-03-04 08:48:40 +00:00
|
|
|
|
<!-- 用户信息授权,手机号授权 -->
|
|
|
|
|
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
|
2022-02-15 08:02:16 +00:00
|
|
|
|
<!-- 底部tab -->
|
|
|
|
|
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
|
2021-08-19 06:40:59 +00:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-03-04 08:48:40 +00:00
|
|
|
|
statusHNH:uni.getStorageSync('electric_nav_height'),
|
2021-08-19 06:40:59 +00:00
|
|
|
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
|
|
|
|
isShowT:false,
|
|
|
|
|
imgSrc:'/static/public/shareh.png',
|
|
|
|
|
dataList:[
|
2021-08-19 09:27:37 +00:00
|
|
|
|
{num:'0',title:'积分'},
|
2021-08-19 06:40:59 +00:00
|
|
|
|
{num:'0',title:'分享人'},
|
|
|
|
|
{num:'0',title:'分享订单'},
|
2021-08-19 09:27:37 +00:00
|
|
|
|
],
|
2021-12-02 09:31:26 +00:00
|
|
|
|
imgSrcP:uni.getStorageSync('imgSrcP'),
|
2022-02-15 08:02:16 +00:00
|
|
|
|
titleList:[],//tab标题
|
|
|
|
|
imgList:[],//tab图标
|
2022-03-24 08:32:33 +00:00
|
|
|
|
shareFlag:true
|
2021-08-19 06:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShareAppMessage(options) {
|
|
|
|
|
var ya = this;
|
|
|
|
|
var shareObj = {
|
|
|
|
|
title: '恒美植发', // 默认是小程序的名称(可以写slogan等)
|
2022-03-04 08:48:40 +00:00
|
|
|
|
path: `/pagesB/sharingCenter/sharingCenter?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
2021-08-19 06:40:59 +00:00
|
|
|
|
imageUrl: ya.imgSrc, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
|
|
|
|
success: function(res){
|
|
|
|
|
// 转发成功之后的回调
|
|
|
|
|
if(res.errMsg == 'shareAppMessage:ok'){
|
2022-03-04 08:48:40 +00:00
|
|
|
|
// 调用tools.js中的种植埋点事件
|
|
|
|
|
this.$toolAll.tools.plantPoint(4);
|
2021-08-19 06:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fail: function(res){
|
|
|
|
|
// 转发失败之后的回调
|
|
|
|
|
if(res.errMsg == 'shareAppMessage:fail cancel'){
|
|
|
|
|
// 用户取消转发
|
|
|
|
|
}else if(res.errMsg == 'shareAppMessage:fail'){
|
|
|
|
|
// 转发失败,其中 detail message 为详细失败信息
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return shareObj;
|
|
|
|
|
},
|
2021-12-02 09:31:26 +00:00
|
|
|
|
onLoad(options) {
|
2022-03-21 01:44:07 +00:00
|
|
|
|
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){this.$toolAll.tools.isLogin()}
|
2021-08-19 06:40:59 +00:00
|
|
|
|
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
|
2022-02-15 08:02:16 +00:00
|
|
|
|
this.$requst.post('index/mini-program-setting').then(res=>{
|
|
|
|
|
// log('数据:',res);
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
if(res.data.length!=0){
|
|
|
|
|
if(res.data.footBar.length!=0){//底部导航
|
|
|
|
|
res.data.footBar.forEach(item=>{
|
|
|
|
|
let newName = item.name
|
|
|
|
|
let newObj = {
|
|
|
|
|
iconPath:this.$http + item.icon[0],
|
|
|
|
|
selectedIconPath:this.$http + item.icon[1],
|
|
|
|
|
}
|
|
|
|
|
if(item.key=="home"){
|
|
|
|
|
this.imgList[0] = newObj
|
|
|
|
|
this.titleList[0] = newName
|
|
|
|
|
}
|
|
|
|
|
if(item.key=="category"){
|
|
|
|
|
this.imgList[1] = newObj
|
|
|
|
|
this.titleList[1] = newName
|
|
|
|
|
}
|
|
|
|
|
if(item.key=="service"){
|
|
|
|
|
this.imgList[2] = newObj
|
|
|
|
|
this.titleList[2] = newName
|
|
|
|
|
}
|
|
|
|
|
if(item.key=="shop"){
|
|
|
|
|
this.imgList[3] = newObj
|
|
|
|
|
this.titleList[3] = newName
|
|
|
|
|
}
|
|
|
|
|
if(item.key=="my"){
|
|
|
|
|
this.imgList[4] = newObj
|
|
|
|
|
this.titleList[4] = newName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('footTitle',this.titleList)
|
|
|
|
|
uni.setStorageSync('footimg',this.imgList)
|
|
|
|
|
this.titleList = uni.getStorageSync('footTitle')
|
|
|
|
|
this.imgList = uni.getStorageSync('footimg')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},error=>{})
|
2021-08-19 06:40:59 +00:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2021-08-19 09:27:37 +00:00
|
|
|
|
shareEv(){//分享事件
|
|
|
|
|
if(this.imgSrcP==''){
|
|
|
|
|
this.$toolAll.tools.showToast('请先前往个人海报申请海报')
|
|
|
|
|
} else {
|
2022-03-24 08:32:33 +00:00
|
|
|
|
this.$toolAll.tools.showToast('正在调起分享...','none',200000);
|
|
|
|
|
if(this.shareFlag){
|
|
|
|
|
this.shareFlag = false;
|
|
|
|
|
wx.showShareImageMenu({
|
|
|
|
|
path: this.imgSrcP,
|
|
|
|
|
success:(res=>{
|
|
|
|
|
uni.hideToast();
|
|
|
|
|
this.shareFlag = true;
|
|
|
|
|
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
|
|
|
|
|
// 调用tools.js中的种植埋点事件
|
|
|
|
|
this.$toolAll.tools.plantPoint(4);
|
|
|
|
|
}),
|
|
|
|
|
fail:(err=>{
|
|
|
|
|
uni.hideToast();
|
|
|
|
|
this.shareFlag = true;
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {this.$toolAll.tools.showToast('请勿重复点击');}
|
2021-08-19 09:27:37 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-08-19 06:40:59 +00:00
|
|
|
|
goPage(index){
|
|
|
|
|
let newUrl = ''
|
|
|
|
|
if(index==1) newUrl = '/pagesB/mysharer/mysharer'
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url:newUrl
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|