分享优化,客服绑定优化

master
chen 2022-02-17 11:49:34 +08:00
parent 439369e45f
commit 08639988cf
47 changed files with 65 additions and 70 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
/node_modules
/public/storage
/unpackage
/.hbuilderx
Homestead.yaml
Homestead.json
.env

View File

@ -2,18 +2,10 @@
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

13
App.vue
View File

@ -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();
},

View File

@ -31,6 +31,7 @@
// console.log('',res);
if(res.code==0){
this.showPhone = false;
this.$toolAll.tools.overdue();
this.$toolAll.tools.showToast('手机号绑定成功','success');
}
},error=>{})

View File

@ -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)
}

View File

@ -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: "",
},

View File

@ -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',

View File

@ -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、mac3.1.10+、windows3.1.10+、linux3.1.10+
if(uni.getSystemInfoSync().platform != "devtools"){//devtools开发版 值域为ios、android、mac3.1.10+、windows3.1.10+、linux3.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',

View File

@ -57,6 +57,11 @@
this.canIGetUserProfile = true;
}
},
onUnload() {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
},
methods: {
refuse(){//
this.isShowP=false;

View File

@ -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:{

View File

@ -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){

View File

@ -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:{

View File

@ -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:{

View File

@ -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:{

View File

@ -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() { //

View File

@ -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:{

View File

@ -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