分享优化,客服绑定优化
parent
439369e45f
commit
08639988cf
|
@ -2,6 +2,7 @@
|
|||
/node_modules
|
||||
/public/storage
|
||||
/unpackage
|
||||
/.hbuilderx
|
||||
Homestead.yaml
|
||||
Homestead.json
|
||||
.env
|
||||
|
|
|
@ -2,18 +2,10 @@
|
|||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"h5" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
|
|
13
App.vue
13
App.vue
|
@ -2,17 +2,15 @@
|
|||
import toolAll from '@/jsFile/tools.js';
|
||||
import requst from '@/jsFile/requst.js';
|
||||
export default {
|
||||
// 全局域名配置
|
||||
globalData:{
|
||||
// domainName:'https://hengmei.scdxtc.cn/api/',
|
||||
domainName:'https://hm.hmzfyy.cn/api/',
|
||||
},
|
||||
onLaunch: function() {
|
||||
// 全局域名配置
|
||||
// uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/');
|
||||
uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
|
||||
toolAll.tools.clearClog();//去除体验版和正式版的所有输出日志
|
||||
// 主题颜色
|
||||
// toolAll.tools.zhuColorT();
|
||||
uni.request({
|
||||
url: `${this.globalData.domainName}index/mini-program-setting`,
|
||||
url: `${uni.getStorageSync('hostapi')}index/mini-program-setting`,
|
||||
method: 'GET',
|
||||
data: '',
|
||||
header: {
|
||||
|
@ -31,7 +29,6 @@
|
|||
})
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
// uni.clearStorageSync()
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
toolAll.tools.daoTime();
|
||||
|
@ -40,7 +37,7 @@
|
|||
}
|
||||
setTimeout(()=>{
|
||||
toolAll.tools.overdue();//查询是否第一次授权
|
||||
},3000)
|
||||
},5000)
|
||||
toolAll.tools.isVedio();
|
||||
toolAll.tools.checkQuan();
|
||||
},
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.showPhone = false;
|
||||
this.$toolAll.tools.overdue();
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||
}
|
||||
},error=>{})
|
||||
|
|
|
@ -122,6 +122,7 @@
|
|||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('phone_active',res.data.phone_active)//是否绑定手机号
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
ya.successAfterEv(userInfo)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ console.log('当前环境', process.env.NODE_ENV)
|
|||
const apiHub = {
|
||||
//开发环境
|
||||
development: {
|
||||
BASE_URL: `${getApp().globalData.domainName}`,
|
||||
BASE_URL: `${uni.getStorageSync('hostapi')}`,
|
||||
IMG_URL: "https://xx",
|
||||
BASE_UPLOAD_URL: "",
|
||||
},
|
||||
|
|
|
@ -78,7 +78,7 @@ const request = (method, url, options) => {
|
|||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}${url}`,
|
||||
url: `${uni.getStorageSync('hostapi')}${url}`,
|
||||
method: methods,
|
||||
data: dataObj(url, options),
|
||||
header: headers,
|
||||
|
@ -112,7 +112,7 @@ const uploadFile = (url, options) => {
|
|||
uni.showLoading({title: "上传中..."})
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${getApp().globalData.domainName}${url}`,
|
||||
url: `${uni.getStorageSync('hostapi')}${url}`,
|
||||
filePath: tempData.file,
|
||||
name: 'image',
|
||||
fileType:'image',
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {buriedPoint,reportBuriedPoint,zhuColor,checkQuan} from './publicAPI.js';
|
||||
const tools = {
|
||||
timer:'',
|
||||
timerNot:'',
|
||||
// 埋点倒计时
|
||||
daoTime(){
|
||||
let daoTime = uni.getStorageSync('daoTime')
|
||||
|
@ -37,6 +36,10 @@ const tools = {
|
|||
},1000)
|
||||
}
|
||||
},
|
||||
closeTimer(){
|
||||
clearInterval(this.timer)//关闭倒计时
|
||||
console.log('倒计时清空了');
|
||||
},
|
||||
zhuColorT(){//调用主色调
|
||||
zhuColor()
|
||||
},
|
||||
|
@ -56,11 +59,6 @@ const tools = {
|
|||
}
|
||||
});
|
||||
},
|
||||
closeTimer(){
|
||||
clearInterval(this.timer)//关闭倒计时
|
||||
console.log('倒计时清空了');
|
||||
clearInterval(this.timerNot)//关闭倒计时
|
||||
},
|
||||
buriedPointAll(){//查询埋点类型事件
|
||||
buriedPoint()
|
||||
},
|
||||
|
@ -245,9 +243,11 @@ const tools = {
|
|||
})
|
||||
},
|
||||
clearClog(){//去除某环境下的所有console.log()//输出信息
|
||||
// console.log(uni.getSystemInfoSync(),248);
|
||||
// console.log(wx.getAccountInfoSync(),249);
|
||||
// uniapp性能优化
|
||||
// #ifdef APP-PLUS
|
||||
if(uni.getSystemInfoSync().platform != "devtool"){//devtools:开发版 值域为:ios、android、mac(3.1.10+)、windows(3.1.10+)、linux(3.1.10+)
|
||||
if(uni.getSystemInfoSync().platform != "devtools"){//devtools:开发版 值域为:ios、android、mac(3.1.10+)、windows(3.1.10+)、linux(3.1.10+)
|
||||
console.log = () =>{}
|
||||
}
|
||||
// #endif
|
||||
|
@ -291,7 +291,7 @@ const tools = {
|
|||
language:obj.language
|
||||
}
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}user/login`,
|
||||
url: `${uni.getStorageSync('hostapi')}user/login`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
|
@ -383,7 +383,7 @@ const tools = {
|
|||
},
|
||||
isVedio(){//是否显示视频内容
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}index/base-config`,
|
||||
url: `${uni.getStorageSync('hostapi')}index/base-config`,
|
||||
method: 'get',
|
||||
header: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
|
|
|
@ -57,6 +57,11 @@
|
|||
this.canIGetUserProfile = true;
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
refuse(){//暂不绑定事件
|
||||
this.isShowP=false;
|
||||
|
|
|
@ -460,7 +460,7 @@
|
|||
is_hot:1
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
|
@ -166,7 +166,6 @@
|
|||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if(uni.getStorageSync('token')!='' && uni.getStorageSync('chu')=='') {
|
||||
this.$toolAll.tools.daoTime()
|
||||
uni.setStorageSync('chu',1)
|
||||
}
|
||||
this.checkKT()//恒美课堂列表
|
||||
|
@ -186,7 +185,6 @@
|
|||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$toolAll.tools.isVedio();
|
||||
if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv(options);
|
||||
} else if(options.q!=undefined){
|
||||
|
|
|
@ -409,7 +409,7 @@
|
|||
disease_id:this.disease_id//病种ID
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
|
@ -523,7 +523,7 @@
|
|||
this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}order/create`,
|
||||
url:`${uni.getStorageSync('hostapi')}order/create`,
|
||||
data:parmas,
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
|
@ -243,7 +243,7 @@
|
|||
if(index==1){
|
||||
this.isWen = false;
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/collection`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/collection`,
|
||||
data:{page:this.page,size:this.size},
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
isZanw:true,
|
||||
allList:[],
|
||||
contentVal:'',
|
||||
newHeight:'450'
|
||||
newHeight:'450',
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -524,7 +524,7 @@
|
|||
})
|
||||
}
|
||||
this.cateCurrent = e;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}, error => {})
|
||||
},
|
||||
tapLike() { //喜欢、不喜欢事件
|
||||
|
|
|
@ -496,7 +496,7 @@
|
|||
},
|
||||
checkPTList(id){//查询正在拼团的人数
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/group-list`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/group-list`,
|
||||
data:{id:id},
|
||||
method:'post',
|
||||
header:{
|
||||
|
@ -675,7 +675,7 @@
|
|||
checkDetail(newId,is_activity){
|
||||
console.log(newId,is_activity,'参数');
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/detail`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/detail`,
|
||||
data:{id:newId,is_activity:is_activity},
|
||||
method:'post',
|
||||
header:{
|
||||
|
@ -819,7 +819,7 @@
|
|||
disease_id:''//病种ID
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
|
@ -278,7 +278,7 @@
|
|||
size:this.size,
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
url:`${uni.getStorageSync('hostapi')}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
|
|
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
Loading…
Reference in New Issue