分享优化,客服绑定优化

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 /node_modules
/public/storage /public/storage
/unpackage /unpackage
/.hbuilderx
Homestead.yaml Homestead.yaml
Homestead.json Homestead.json
.env .env

View File

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

13
App.vue
View File

@ -2,17 +2,15 @@
import toolAll from '@/jsFile/tools.js'; import toolAll from '@/jsFile/tools.js';
import requst from '@/jsFile/requst.js'; import requst from '@/jsFile/requst.js';
export default { export default {
//
globalData:{
// domainName:'https://hengmei.scdxtc.cn/api/',
domainName:'https://hm.hmzfyy.cn/api/',
},
onLaunch: function() { onLaunch: function() {
//
// uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/');
uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
toolAll.tools.clearClog();// toolAll.tools.clearClog();//
// //
// toolAll.tools.zhuColorT(); // toolAll.tools.zhuColorT();
uni.request({ uni.request({
url: `${this.globalData.domainName}index/mini-program-setting`, url: `${uni.getStorageSync('hostapi')}index/mini-program-setting`,
method: 'GET', method: 'GET',
data: '', data: '',
header: { header: {
@ -31,7 +29,6 @@
}) })
}, },
onShow: function() { onShow: function() {
// uni.clearStorageSync() // uni.clearStorageSync()
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')!='') {
toolAll.tools.daoTime(); toolAll.tools.daoTime();
@ -40,7 +37,7 @@
} }
setTimeout(()=>{ setTimeout(()=>{
toolAll.tools.overdue();// toolAll.tools.overdue();//
},3000) },5000)
toolAll.tools.isVedio(); toolAll.tools.isVedio();
toolAll.tools.checkQuan(); toolAll.tools.checkQuan();
}, },

View File

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

View File

@ -122,6 +122,7 @@
uni.setStorageSync('token',res.data.token)//token uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('expire',res.data.expire)// uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('is_active',res.data.is_active)// uni.setStorageSync('is_active',res.data.is_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)
ya.successAfterEv(userInfo) ya.successAfterEv(userInfo)
} }

View File

@ -4,7 +4,7 @@ console.log('当前环境', process.env.NODE_ENV)
const apiHub = { const apiHub = {
//开发环境 //开发环境
development: { development: {
BASE_URL: `${getApp().globalData.domainName}`, BASE_URL: `${uni.getStorageSync('hostapi')}`,
IMG_URL: "https://xx", IMG_URL: "https://xx",
BASE_UPLOAD_URL: "", BASE_UPLOAD_URL: "",
}, },

View File

@ -78,7 +78,7 @@ const request = (method, url, options) => {
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: `${getApp().globalData.domainName}${url}`, url: `${uni.getStorageSync('hostapi')}${url}`,
method: methods, method: methods,
data: dataObj(url, options), data: dataObj(url, options),
header: headers, header: headers,
@ -112,7 +112,7 @@ const uploadFile = (url, options) => {
uni.showLoading({title: "上传中..."}) uni.showLoading({title: "上传中..."})
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${getApp().globalData.domainName}${url}`, url: `${uni.getStorageSync('hostapi')}${url}`,
filePath: tempData.file, filePath: tempData.file,
name: 'image', name: 'image',
fileType:'image', fileType:'image',

View File

@ -1,7 +1,6 @@
import {buriedPoint,reportBuriedPoint,zhuColor,checkQuan} from './publicAPI.js'; import {buriedPoint,reportBuriedPoint,zhuColor,checkQuan} from './publicAPI.js';
const tools = { const tools = {
timer:'', timer:'',
timerNot:'',
// 埋点倒计时 // 埋点倒计时
daoTime(){ daoTime(){
let daoTime = uni.getStorageSync('daoTime') let daoTime = uni.getStorageSync('daoTime')
@ -37,6 +36,10 @@ const tools = {
},1000) },1000)
} }
}, },
closeTimer(){
clearInterval(this.timer)//关闭倒计时
console.log('倒计时清空了');
},
zhuColorT(){//调用主色调 zhuColorT(){//调用主色调
zhuColor() zhuColor()
}, },
@ -56,11 +59,6 @@ const tools = {
} }
}); });
}, },
closeTimer(){
clearInterval(this.timer)//关闭倒计时
console.log('倒计时清空了');
clearInterval(this.timerNot)//关闭倒计时
},
buriedPointAll(){//查询埋点类型事件 buriedPointAll(){//查询埋点类型事件
buriedPoint() buriedPoint()
}, },
@ -245,9 +243,11 @@ const tools = {
}) })
}, },
clearClog(){//去除某环境下的所有console.log()//输出信息 clearClog(){//去除某环境下的所有console.log()//输出信息
// console.log(uni.getSystemInfoSync(),248);
// console.log(wx.getAccountInfoSync(),249);
// uniapp性能优化 // uniapp性能优化
// #ifdef APP-PLUS // #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 = () =>{} console.log = () =>{}
} }
// #endif // #endif
@ -291,7 +291,7 @@ const tools = {
language:obj.language language:obj.language
} }
uni.request({ uni.request({
url: `${getApp().globalData.domainName}user/login`, url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post', method: 'post',
data: params, data: params,
header: { header: {
@ -383,7 +383,7 @@ const tools = {
}, },
isVedio(){//是否显示视频内容 isVedio(){//是否显示视频内容
uni.request({ uni.request({
url: `${getApp().globalData.domainName}index/base-config`, url: `${uni.getStorageSync('hostapi')}index/base-config`,
method: 'get', method: 'get',
header: { header: {
'Content-Type': 'application/json; charset=UTF-8', 'Content-Type': 'application/json; charset=UTF-8',

View File

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

View File

@ -460,7 +460,7 @@
is_hot:1 is_hot:1
} }
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/list`, url:`${uni.getStorageSync('hostapi')}spu/list`,
data:params, data:params,
method:'post', method:'post',
header:{ header:{

View File

@ -166,7 +166,6 @@
} }
this.$toolAll.tools.maiDian(maiOjb) this.$toolAll.tools.maiDian(maiOjb)
if(uni.getStorageSync('token')!='' && uni.getStorageSync('chu')=='') { if(uni.getStorageSync('token')!='' && uni.getStorageSync('chu')=='') {
this.$toolAll.tools.daoTime()
uni.setStorageSync('chu',1) uni.setStorageSync('chu',1)
} }
this.checkKT()// this.checkKT()//
@ -186,7 +185,6 @@
  return shareObj;   return shareObj;
}, },
onLoad(options) { onLoad(options) {
this.$toolAll.tools.isVedio();
if(options.source_code!='' && options.source_code!=undefined){ if(options.source_code!='' && options.source_code!=undefined){
this.loginEv(options); this.loginEv(options);
} else if(options.q!=undefined){ } else if(options.q!=undefined){

View File

@ -409,7 +409,7 @@
disease_id:this.disease_id//ID disease_id:this.disease_id//ID
} }
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/list`, url:`${uni.getStorageSync('hostapi')}spu/list`,
data:params, data:params,
method:'post', method:'post',
header:{ header:{

View File

@ -523,7 +523,7 @@
this.$toolAll.tools.showToast('正在调起支付','loading',1500); this.$toolAll.tools.showToast('正在调起支付','loading',1500);
} }
uni.request({ uni.request({
url:`${getApp().globalData.domainName}order/create`, url:`${uni.getStorageSync('hostapi')}order/create`,
data:parmas, data:parmas,
method:'post', method:'post',
header:{ header:{

View File

@ -243,7 +243,7 @@
if(index==1){ if(index==1){
this.isWen = false; this.isWen = false;
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/collection`, url:`${uni.getStorageSync('hostapi')}spu/collection`,
data:{page:this.page,size:this.size}, data:{page:this.page,size:this.size},
method:'post', method:'post',
header:{ header:{

View File

@ -165,7 +165,7 @@
isZanw:true, isZanw:true,
allList:[], allList:[],
contentVal:'', contentVal:'',
newHeight:'450' newHeight:'450',
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -524,7 +524,7 @@
}) })
} }
this.cateCurrent = e; this.cateCurrent = e;
} else this.$toolAll.tools.showToast(res.msg); }
}, error => {}) }, error => {})
}, },
tapLike() { // tapLike() { //

View File

@ -496,7 +496,7 @@
}, },
checkPTList(id){// checkPTList(id){//
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/group-list`, url:`${uni.getStorageSync('hostapi')}spu/group-list`,
data:{id:id}, data:{id:id},
method:'post', method:'post',
header:{ header:{
@ -675,7 +675,7 @@
checkDetail(newId,is_activity){ checkDetail(newId,is_activity){
console.log(newId,is_activity,'参数'); console.log(newId,is_activity,'参数');
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/detail`, url:`${uni.getStorageSync('hostapi')}spu/detail`,
data:{id:newId,is_activity:is_activity}, data:{id:newId,is_activity:is_activity},
method:'post', method:'post',
header:{ header:{
@ -819,7 +819,7 @@
disease_id:''//ID disease_id:''//ID
} }
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/list`, url:`${uni.getStorageSync('hostapi')}spu/list`,
data:params, data:params,
method:'post', method:'post',
header:{ header:{

View File

@ -278,7 +278,7 @@
size:this.size, size:this.size,
} }
uni.request({ uni.request({
url:`${getApp().globalData.domainName}spu/list`, url:`${uni.getStorageSync('hostapi')}spu/list`,
data:params, data:params,
method:'post', method:'post',
header:{ 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