修改医生详情、调整商城列表活动时样式问题、调整登录失效问题

master
chen 2022-04-08 17:54:56 +08:00
parent d93d24b89f
commit 75c1ba8e33
51 changed files with 206 additions and 222 deletions

View File

@ -20,8 +20,8 @@
onShow: function() { onShow: function() {
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')!='') {
toolAll.tools.networkStatus();// toolAll.tools.networkStatus();//
// toolAll.tools.updaX();//
toolAll.tools.isLogin();//token toolAll.tools.isLogin();//token
toolAll.tools.refreshToken();
} }
toolAll.tools.checkQuan(); // toolAll.tools.checkQuan(); //
}, },

View File

@ -38,6 +38,7 @@
</template> </template>
<script> <script>
import {reportBuriedPoint} from '@/jsFile/publicAPI.js';
export default { export default {
name:"auth-userInfo-mobileInfo", name:"auth-userInfo-mobileInfo",
props:{ props:{
@ -104,7 +105,7 @@
channel: data.channel || '' channel: data.channel || ''
} }
uni.request({ uni.request({
url: `https://hengmei.scdxtc.cn/api/user/login`, url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'GET', method: 'GET',
data: params, data: params,
success: res => { success: res => {
@ -116,6 +117,7 @@
uni.setStorageSync('is_active',res.data.data.is_active)// uni.setStorageSync('is_active',res.data.data.is_active)//
if(res.data.data.phone_active==0 || res.data.data.is_active==0) { if(res.data.data.phone_active==0 || res.data.data.is_active==0) {
this.showAuth = true; this.showAuth = true;
// this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
} else { } else {
uni.reLaunch({ // uni.reLaunch({ //
url:uni.getStorageSync('urlparams') url:uni.getStorageSync('urlparams')

View File

@ -29,10 +29,14 @@
default:'0' default:'0'
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
data() { data() {
return { return {};
publicColor:uni.getStorageSync('publicColor'),
};
}, },
methods:{ methods:{
lianK(){ lianK(){

View File

@ -79,7 +79,6 @@
}, },
data() { data() {
return { return {
publicColor:uni.getStorageSync('publicColor'),
isZhuan:false, isZhuan:false,
current:0, current:0,
tagIds:[], tagIds:[],
@ -88,6 +87,12 @@
isAll:false isAll:false
}; };
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
methods:{ methods:{
// //
closeXial(){ closeXial(){

View File

@ -107,11 +107,16 @@
}, },
data() { data() {
return { return {
publicColor:uni.getStorageSync('publicColor'),
newList:[], newList:[],
timeList:[]// timeList:[]//
}; };
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
methods:{ methods:{
goPage(id,index){// goPage(id,index){//
uni.navigateTo({ uni.navigateTo({

View File

@ -96,12 +96,17 @@
}, },
data() { data() {
return { return {
publicColor:uni.getStorageSync('publicColor'),
newList:[], newList:[],
timeList:[],// timeList:[],//
timer:'' timer:''
}; };
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
mounted() { mounted() {
if(this.dataList.length!=0){ if(this.dataList.length!=0){
this.dataList.forEach((item,index)=>{ this.dataList.forEach((item,index)=>{

View File

@ -62,8 +62,6 @@ const checkError = (e) => {
} }
} }
const flag = true; const flag = true;
let urls = [];
let timer = null;
// 封装请求 // 封装请求
const request = (method, url, options, ifLogin) => { const request = (method, url, options, ifLogin) => {
let methods = ''; let methods = '';
@ -92,126 +90,47 @@ const request = (method, url, options, ifLogin) => {
break; break;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(ifLogin) { // 不需要登录
var date = new Date(); if(flag) {
var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 10分钟 小于当前时间刷新token
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
// token已失效
urls.push(url);
if(urls.length<=1) {
// 调用登录事件
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post',
data: params,
success: res => {
console.log(114);
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
timer = setInterval(()=>{
if((uni.getStorageSync('expire')*1000 - 600000) > timestamp) {
clearInterval(timer);
if(urls.length) {
urls.forEach(item=>{
uni.request({
url: `${hostapi}${item}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${item}返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
resolve(res.data)
} else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
checkError(res)
}
} else if(res.statusCode==500) {
// goLogin();
} else {
checkError(res)
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
})
}
}
},100)
}
}
})
},
});
}
} else {
// 快到token失效时间了
uni.request({
url: `${hostapi}${url}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${url}返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
resolve(res.data)
} else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
checkError(res)
}
} else if(res.statusCode==500) {
// goLogin();
} else {
checkError(res)
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
}
} else {
// 不需要token的
uni.request({ uni.request({
url: `${hostapi}${url}`, url: `${hostapi}${url}`,
method: methods, method: methods,
data: options, data: options,
header: headers, header: headers,
success: res => { success: res => {
console.log(`${url}返的结果===>`,res); console.log(`${url}接口返的结果===>`,res);
if (res.statusCode == 200) { if (res.statusCode == 200) {
if (res.data.code == 0) { if (res.data.code == 0) {
resolve(res.data) resolve(res.data)
} else { } else {
uni.showToast({ flag = false;
title:res.data.msg, uni.login({
icon:'none' provider: 'weixin',
}) success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post',
data: params,
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('paramsUrl')
})
}
}
})
},
});
// uni.showToast({
// title:res.data.msg,
// icon:'none'
// })
checkError(res) checkError(res)
} }
} else if(res.statusCode==500) { } else if(res.statusCode==500) {

View File

@ -41,6 +41,29 @@ const tools = {
clearInterval(this.timer); clearInterval(this.timer);
console.log('倒计时清空了'); console.log('倒计时清空了');
}, },
// 设置埋点数据事件
maiDian(data){
let maiList = uni.getStorageSync('maiList')
// console.log(maiList);
if(maiList==''){
maiList = [data]
} else maiList.push(data)
uni.setStorageSync('maiList',maiList)
},
// 种植埋点
plantPoint(num, id=''){
console.log(num,id,67);
let maiOjb = {
e: num, //内容访问
c: id * 1,
t: new Date().getTime() //当前时间戳
}
this.maiDian(maiOjb);
},
// 立即执行埋点上报
reportImmediately() {
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
},
// 查券 // 查券
checkQuan(){ checkQuan(){
checkQuan(); checkQuan();
@ -60,25 +83,6 @@ const tools = {
buriedPointAll(){//查询埋点类型事件 buriedPointAll(){//查询埋点类型事件
buriedPoint() buriedPoint()
}, },
// 种植埋点
plantPoint(num, id=''){
console.log(num,id,67);
let maiOjb = {
e: num, //内容访问
c: id * 1,
t: new Date().getTime() //当前时间戳
}
this.maiDian(maiOjb);
},
// 设置埋点数据事件
maiDian(data){
let maiList = uni.getStorageSync('maiList')
// console.log(maiList);
if(maiList==''){
maiList = [data]
} else maiList.push(data)
uni.setStorageSync('maiList',maiList)
},
weekDate(){//获取未来七天星期几,几号 weekDate(){//获取未来七天星期几,几号
let date = new Date() let date = new Date()
let year = date.getFullYear() let year = date.getFullYear()
@ -351,12 +355,21 @@ const tools = {
var date = new Date(); var date = new Date();
var timestamp = date.getTime();//精确到毫秒 var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 10分钟 小于当前时间刷新token // 如果过期时间 减 10分钟 小于当前时间刷新token
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp && uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0) { if((uni.getStorageSync('expire')*1000 - 6565575) < timestamp && uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0) {
// 调用登录事件 // 调用登录事件
this.loginEv(); this.loginEv();
} }
console.log('进入了检测是否登录过期事件'); console.log('进入了检测是否登录过期事件');
}, },
timeToken:null,
// 开启每十分钟刷新token
refreshToken(){
clearInterval(this.timeToken);
this.timeToken = setInterval(()=>{
console.log('进入了每十分钟刷新token');
this.isLogin();
},600000)
},
// 登录事件 // 登录事件
loginEv(){ loginEv(){
uni.login({ uni.login({

View File

@ -50,13 +50,18 @@
data() { data() {
return { return {
userInfo: {},// userInfo: {},//
publicColor:uni.getStorageSync('publicColor'),
canIGetUserProfile: false, canIGetUserProfile: false,
imgSrc: '/static/public/logo.png',//logo imgSrc: '/static/public/logo.png',//logo
appletName:'恒美植发',// appletName:'恒美植发',//
isShowP:false, isShowP:false,
}; };
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onLoad(options) { onLoad(options) {
// //
this.$toolAll.tools.currentContext(); this.$toolAll.tools.currentContext();

View File

@ -97,7 +97,6 @@
return { return {
vision:false, vision:false,
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),
tongList:[ tongList:[
{num:'0',title:'文章收藏'}, {num:'0',title:'文章收藏'},
{num:'0',title:'积分'}, {num:'0',title:'积分'},

View File

@ -127,6 +127,7 @@
isNewRenderDone:false ,// isNewRenderDone:false ,//
isQuan:uni.getStorageSync('isQuan'), isQuan:uni.getStorageSync('isQuan'),
quanImg:uni.getStorageSync('quanImg'), quanImg:uni.getStorageSync('quanImg'),
pagePath:''
} }
}, },
computed: { computed: {
@ -182,6 +183,10 @@
getApp().globalData.outside = false; getApp().globalData.outside = false;
}, },
onLoad(options) { onLoad(options) {
//
let pages = getCurrentPages(); //
let currentPage = pages[pages.length - 1]; //
this.pagePath = currentPage.$page.fullPath;
if(options.q!=undefined){ if(options.q!=undefined){
// unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1") // unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1")
// decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1") // decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
@ -211,10 +216,13 @@
uni.setStorageSync('is_active',res.data.is_active)// uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token); uni.setStorageSync('token',res.data.token);
uni.setStorageSync('openid',res.data.openid)//openid uni.setStorageSync('openid',res.data.openid)//openid
if(res.data.is_active==0 || res.data.phone_active==0) {
// this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
}
},error => {}) },error => {})
}, },
}); });
} else if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0 && uni.getStorageSync('is_active')!=0){ } else if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0 && uni.getStorageSync('is_active')==0){
this.loginEv(options); this.loginEv(options);
} }
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()
@ -245,14 +253,15 @@
source_code:option.source_code || '', source_code:option.source_code || '',
channel:option.channel || '' channel:option.channel || ''
} }
console.log(params);
this.$requst.post('user/login',params,false).then(res => { this.$requst.post('user/login',params,false).then(res => {
console.log(239);
uni.setStorageSync('phone_active',res.data.phone_active); uni.setStorageSync('phone_active',res.data.phone_active);
uni.setStorageSync('invite_code',res.data.invite_code); uni.setStorageSync('invite_code',res.data.invite_code);
uni.setStorageSync('is_active',res.data.is_active)// uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token); uni.setStorageSync('token',res.data.token);
uni.setStorageSync('openid',res.data.openid)//openid uni.setStorageSync('openid',res.data.openid)//openid
if(res.data.is_active==0 || res.data.phone_active==0) {
// this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
}
},error => {}) },error => {})
}, },
}); });

View File

@ -67,7 +67,7 @@
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;"></view> <view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;"></view>
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;"></view> <view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;"></view>
</view> </view>
<view class="disjbac"> <view class="disjbac" :class="item1.isIntegral ? '' : 'fw'">
<view class="disac"> <view class="disac">
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;"> <view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
<view v-if="item1.isIntegral" class="mar-s20"> <view v-if="item1.isIntegral" class="mar-s20">
@ -86,7 +86,7 @@
<!-- <view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> --> <!-- <view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> -->
<view class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> <view class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view>
</view> </view>
<view class="fon24" style="color: #C7C7C7;">销量{{item1.amount}}</view> <view class="fon24 flexs" style="color: #C7C7C7;">销量{{item1.amount}}</view>
</view> </view>
<view v-if="item1.isPing" class="disjbac mar-s20"> <view v-if="item1.isPing" class="disjbac mar-s20">
<view class="fon24 col80">已拼团{{item1.activity_group_num}}</view> <view class="fon24 col80">已拼团{{item1.activity_group_num}}</view>
@ -128,7 +128,7 @@
<!-- <view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> --> <!-- <view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> -->
<view class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view> <view class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view>
</view> </view>
<view class="fon24" style="color: #C7C7C7;">销量{{item1.amount}}</view> <view class="fon24 flexs" style="color: #C7C7C7;">销量{{item1.amount}}</view>
</view> </view>
<view v-if="item1.isPing" class="disjbac mar-s20"> <view v-if="item1.isPing" class="disjbac mar-s20">
<view class="fon24 col80">已拼团{{item1.activity_group_num}}</view> <view class="fon24 col80">已拼团{{item1.activity_group_num}}</view>
@ -419,7 +419,8 @@
let group_cover = []; let group_cover = [];
if(item.activity_group_cover.length!=0) { if(item.activity_group_cover.length!=0) {
item.activity_group_cover.forEach(item=>{ item.activity_group_cover.forEach(item=>{
group_cover.push(this.$http + item) // group_cover.push(this.$http + item)
group_cover.push(item)
}) })
} }
let obj = { let obj = {

View File

@ -5,30 +5,8 @@
<!-- 自定义二级分类 --> <!-- 自定义二级分类 -->
<!-- 列表 --> <!-- 列表 -->
<view :style="{paddingTop: statusHNH+'px'}" class=" pad-x180"> <view :style="{paddingTop: statusHNH+'px'}" class=" pad-x180">
<view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-y32 pad-x40"> <view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-x40">
<view class="disjb pad-z30"> <view class="pad-zy20">
<image class="radius10" :src="doctorObj.doctor_extra.headimg || moImg" mode="widthFix" lazy-load></image>
<!-- <image class="radius10 flexs mar-z30" :src="doctorObj.doctor_extra.headimg || moImg" style="width: 300rpx;height: 300rpx;" mode="aspectFill"></image>
<view class="pad-z20 width100">
<view class="fon28 bold col3">{{doctorObj.doctor_extra.name}}</view>
<view class="col80 fon24">
<view class="flexs">擅长领域</view>
<view class="dis fw">
<view class="flexs" v-for="(item,index) in doctorObj.diseases" :key="index" style="background-color: #F5F5F5;border-radius: 10rpx;padding: 6rpx 10rpx;margin-top: 10rpx;margin-right: 10rpx;">
<text class="bold pcol">{{item.disease_name}}</text>
</view>
</view>
</view>
</view> -->
</view>
<view class="mar-z32">
<view class="bbot mar-s30"></view>
<view class="fon28 bold col3 mar-sx20">医生简介</view>
<rich-text class="fon26 col3" :nodes="peopleJian"></rich-text>
</view>
<view class="mar-z32">
<view class="bbot mar-s30"></view>
<view class="fon28 bold col3 mar-sx20">医生详情</view>
<rich-text class="fon26 col3" :nodes="detailInfo"></rich-text> <rich-text class="fon26 col3" :nodes="detailInfo"></rich-text>
</view> </view>
</view> </view>

View File

@ -1,12 +1,12 @@
<template> <template>
<view> <view class="pad-x180">
<!-- 状态栏 --> <!-- 状态栏 -->
<status-nav :titleVal="titleStr" :statusTitle="true"></status-nav> <status-nav :titleVal="titleStr" :statusTitle="true"></status-nav>
<!-- 输入框 --> <!-- 输入框 -->
<view class="search-input-box bacf" :style="{paddingTop: statusHNH+'px'}"> <view class="search-input-box bacf" :style="{paddingTop: statusHNH+'px'}">
<view class="disac pad-zy30 mar-s20"> <view class="disac pad-zy30 mar-s20">
<!-- 输入框 --> <!-- 输入框 -->
<input @confirm="searchEv" class="width100 fon34 radius10 problem-input" type="text" v-model="searchVal" placeholder="请输入内容..."/> <input @confirm="searchEv" @input="inputEv" class="width100 fon34 radius10 problem-input" type="text" v-model="searchVal" placeholder="请输入内容..."/>
<!-- 搜索 --> <!-- 搜索 -->
<view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view> <view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
</view> </view>
@ -27,6 +27,8 @@
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> --> <!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 --> <!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo> <auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
</view> </view>
</template> </template>
@ -59,6 +61,14 @@
} }
}, },
computed: { computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
// //
publicColor() { publicColor() {
return this.$store.state.publicColor return this.$store.state.publicColor
@ -90,6 +100,10 @@
this.$toolAll.tools.isLogin() this.$toolAll.tools.isLogin()
}, },
methods: { methods: {
//
inputEv(e) {
this.page = 1;
},
chooseLike(e){// chooseLike(e){//
if(this.dataList[e].is_collected==0){ if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1 this.dataList[e].is_collected = 1
@ -172,14 +186,6 @@
cancleev(){// cancleev(){//
this.isShowT = false this.isShowT = false
}, },
chooseTwo(index){//
// console.log('',index);
this.isZanw = true
this.page = 1
this.newCurrent = index
this.category_id = this.cateList[index].id
this.searchEv()
},
} }
} }
</script> </script>

View File

@ -33,7 +33,7 @@
</view> </view>
<span>{{detailObj.name}}</span> <span>{{detailObj.name}}</span>
</view> </view>
<view class="fon24 col7D">无任何额外消费</view> <view class="fon24 col7D">{{detailObj.subtitle || '无任何额外消费'}}</view>
<!-- 团购商品详情时显示 --> <!-- 团购商品详情时显示 -->
<view v-if="isNei==0" class="disjbac fon24 mar-s20 col7D"> <view v-if="isNei==0" class="disjbac fon24 mar-s20 col7D">
<view>团购累计参与人员{{detailObj.activity_order_num}}</view> <view>团购累计参与人员{{detailObj.activity_order_num}}</view>
@ -181,6 +181,10 @@
<view @tap="tuneUp" class="disjcac lianShare mai-btn"><span v-if="isNei!=1"></span><span v-else></span></view> <view @tap="tuneUp" class="disjcac lianShare mai-btn"><span v-if="isNei!=1"></span><span v-else></span></view>
</view> </view>
</view> </view>
<!-- 分享 -->
<view @tap="shareImgEv" class="detail-cart-box" style="display: flex;justify-content: center;align-items: center;width: 112rpx;height: 112rpx;border-radius: 100%;background-color: rgba(0,0,0,.5);bottom: 436rpx;color: #FFFFFF;">
分享
</view>
<!-- 购物车 --> <!-- 购物车 -->
<view @tap="goShopCart" class="detail-cart-box"> <view @tap="goShopCart" class="detail-cart-box">
<view class="posir"> <view class="posir">
@ -264,6 +268,7 @@
import swiperPu from '@/components/swiper-pu.vue'; import swiperPu from '@/components/swiper-pu.vue';
import {cancleCollectionShopEV,collectionShopEV} from '@/jsFile/publicAPI.js'; import {cancleCollectionShopEV,collectionShopEV} from '@/jsFile/publicAPI.js';
import shopList from '@/components/shop-list.vue'; import shopList from '@/components/shop-list.vue';
import { base64ToPath } from '@/jsFile/base64-src.js';
export default { export default {
components:{ components:{
listDoctor, listDoctor,
@ -339,6 +344,8 @@
isactivity:0,//01 isactivity:0,//01
orderId:'',//id orderId:'',//id
timeout:null, timeout:null,
shareId:'',
shareFlag:true
} }
}, },
computed: { computed: {
@ -362,6 +369,7 @@
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let shareImgSrc = '';
var ya = this; var ya = this;
this.$requst.post('user/record',{type:this.detailObj.is_activity==0 ? 'spu':'activity',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{}) this.$requst.post('user/record',{type:this.detailObj.is_activity==0 ? 'spu':'activity',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js // tools.js
@ -390,6 +398,8 @@
this.isAutoPlay = false; this.isAutoPlay = false;
}, },
onLoad(options) { onLoad(options) {
this.isactivity = options.is_activity;
this.orderId = options.id;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDetail(options.id,options.is_activity); this.checkDetail(options.id,options.is_activity);
this.cartNumEv(); this.cartNumEv();
@ -400,8 +410,6 @@
} }
if(options.share_id!=undefined) this.share_id = options.share_id if(options.share_id!=undefined) this.share_id = options.share_id
if(options.isIntegral=="true"){this.isScore = 3;} if(options.isIntegral=="true"){this.isScore = 3;}
this.isactivity = options.is_activity;
this.orderId = options.id;
// //
if(options.shareCate==1) { if(options.shareCate==1) {
// options.checkGrounpIid // options.checkGrounpIid
@ -410,6 +418,31 @@
} }
}, },
methods: { methods: {
//
shareImgEv(){
this.$toolAll.tools.showToast('分享图生成中...','none',10000);
if(this.shareFlag){
this.shareFlag = false;
this.$requst.post('spu/share',{id:this.orderId,is_activity:this.isactivity}).then(res=>{
base64ToPath(res.data.share_img).then(path=>{
uni.hideToast();
this.$toolAll.tools.showToast('正在调起分享...');
wx.showShareImageMenu({
path: path,
success:(res=>{
this.shareFlag = true;
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderId}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(4);
}),
fail:(err=>{
this.shareFlag = true;
})
})
})
})
} else {this.$toolAll.tools.showToast('请勿重复点击');}
},
// //
tuneUp(){ tuneUp(){
if(this.detailObj.is_close==0){ if(this.detailObj.is_close==0){

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long