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

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() {
if(uni.getStorageSync('token')!='') {
toolAll.tools.networkStatus();//
// toolAll.tools.updaX();//
toolAll.tools.isLogin();//token
toolAll.tools.refreshToken();
}
toolAll.tools.checkQuan(); //
},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -62,8 +62,6 @@ const checkError = (e) => {
}
}
const flag = true;
let urls = [];
let timer = null;
// 封装请求
const request = (method, url, options, ifLogin) => {
let methods = '';
@ -92,126 +90,47 @@ const request = (method, url, options, ifLogin) => {
break;
}
return new Promise((resolve, reject) => {
if(ifLogin) {
var date = new Date();
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的
// 不需要登录
if(flag) {
uni.request({
url: `${hostapi}${url}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${url}返的结果===>`,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'
})
flag = false;
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 => {
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)
}
} else if(res.statusCode==500) {

View File

@ -41,6 +41,29 @@ const tools = {
clearInterval(this.timer);
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();
@ -60,25 +83,6 @@ const tools = {
buriedPointAll(){//查询埋点类型事件
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(){//获取未来七天星期几,几号
let date = new Date()
let year = date.getFullYear()
@ -351,12 +355,21 @@ const tools = {
var date = new Date();
var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 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();
}
console.log('进入了检测是否登录过期事件');
},
timeToken:null,
// 开启每十分钟刷新token
refreshToken(){
clearInterval(this.timeToken);
this.timeToken = setInterval(()=>{
console.log('进入了每十分钟刷新token');
this.isLogin();
},600000)
},
// 登录事件
loginEv(){
uni.login({

View File

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

View File

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

View File

@ -127,6 +127,7 @@
isNewRenderDone:false ,//
isQuan:uni.getStorageSync('isQuan'),
quanImg:uni.getStorageSync('quanImg'),
pagePath:''
}
},
computed: {
@ -182,6 +183,10 @@
getApp().globalData.outside = false;
},
onLoad(options) {
//
let pages = getCurrentPages(); //
let currentPage = pages[pages.length - 1]; //
this.pagePath = currentPage.$page.fullPath;
if(options.q!=undefined){
// 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")
@ -211,10 +216,13 @@
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token);
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 => {})
},
});
} 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);
}
const query = wx.createSelectorQuery()
@ -245,14 +253,15 @@
source_code:option.source_code || '',
channel:option.channel || ''
}
console.log(params);
this.$requst.post('user/login',params,false).then(res => {
console.log(239);
uni.setStorageSync('phone_active',res.data.phone_active);
uni.setStorageSync('invite_code',res.data.invite_code);
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token);
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 => {})
},
});

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

View File

@ -5,30 +5,8 @@
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHNH+'px'}" class=" pad-x180">
<view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-y32 pad-x40">
<view class="disjb pad-z30">
<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>
<view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-x40">
<view class="pad-zy20">
<rich-text class="fon26 col3" :nodes="detailInfo"></rich-text>
</view>
</view>

View File

@ -1,12 +1,12 @@
<template>
<view>
<view class="pad-x180">
<!-- 状态栏 -->
<status-nav :titleVal="titleStr" :statusTitle="true"></status-nav>
<!-- 输入框 -->
<view class="search-input-box bacf" :style="{paddingTop: statusHNH+'px'}">
<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>
@ -27,6 +27,8 @@
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
</view>
</template>
@ -59,6 +61,14 @@
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
@ -90,6 +100,10 @@
this.$toolAll.tools.isLogin()
},
methods: {
//
inputEv(e) {
this.page = 1;
},
chooseLike(e){//
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1
@ -172,14 +186,6 @@
cancleev(){//
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>

View File

@ -33,7 +33,7 @@
</view>
<span>{{detailObj.name}}</span>
</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>团购累计参与人员{{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>
</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 class="posir">
@ -264,6 +268,7 @@
import swiperPu from '@/components/swiper-pu.vue';
import {cancleCollectionShopEV,collectionShopEV} from '@/jsFile/publicAPI.js';
import shopList from '@/components/shop-list.vue';
import { base64ToPath } from '@/jsFile/base64-src.js';
export default {
components:{
listDoctor,
@ -339,6 +344,8 @@
isactivity:0,//01
orderId:'',//id
timeout:null,
shareId:'',
shareFlag:true
}
},
computed: {
@ -362,6 +369,7 @@
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onShareAppMessage(res) {
let shareImgSrc = '';
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=>{})
// tools.js
@ -390,6 +398,8 @@
this.isAutoPlay = false;
},
onLoad(options) {
this.isactivity = options.is_activity;
this.orderId = options.id;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDetail(options.id,options.is_activity);
this.cartNumEv();
@ -400,8 +410,6 @@
}
if(options.share_id!=undefined) this.share_id = options.share_id
if(options.isIntegral=="true"){this.isScore = 3;}
this.isactivity = options.is_activity;
this.orderId = options.id;
//
if(options.shareCate==1) {
// options.checkGrounpIid
@ -410,6 +418,31 @@
}
},
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(){
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