添加vuex状态机控制主题色和底部导航、修改request.js请求接口

master
chen 2022-04-02 17:56:53 +08:00
parent 07360c6ad8
commit 5bec64ceec
83 changed files with 649 additions and 835 deletions

26
App.vue
View File

@ -1,35 +1,21 @@
<script> <script>
import toolAll from '@/jsFile/tools.js'; import toolAll from '@/jsFile/tools.js';
import requst from '@/jsFile/requst.js'; import requst from '@/jsFile/requst.js';
import { themeEv } from '@/jsFile/publicAPI.js';
export default { export default {
globalData:{ globalData:{
outside:true//, outside:true,//,
hostApi:''//
}, },
onLaunch: function() { onLaunch: function() {
//
themeEv();
this.autoUpdate(); this.autoUpdate();
// //
toolAll.tools.currentContext(); toolAll.tools.currentContext();
// //
uni.setStorageSync('electric_nav_height',uni.getSystemInfoSync().statusBarHeight + 54); uni.setStorageSync('electric_nav_height',uni.getSystemInfoSync().statusBarHeight + 54);
toolAll.tools.isVedio(); toolAll.tools.isVedio();
uni.request({
url: `${uni.getStorageSync('hostapi')}index/mini-program-setting`,
method: 'GET',
data: '',
header: {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
// console.log('===>',res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
uni.setStorageSync('publicColor', res.data.data.mainColor) //#3875F6 #2E8B57
// uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
}
}
}
})
}, },
onShow: function() { onShow: function() {
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')!='') {
@ -53,7 +39,7 @@
if (wx.canIUse('getUpdateManager')) { if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() //1. const updateManager = wx.getUpdateManager() //1.
updateManager.onCheckForUpdate(function(res) { // updateManager.onCheckForUpdate(function(res) { //
if (res.hasUpdate) { if (res.hasUpdate) {
// //
wx.showModal({ wx.showModal({
title: '更新提示', title: '更新提示',

View File

@ -81,8 +81,8 @@
// console.log(currentPage.route,''); // console.log(currentPage.route,'');
console.log(currentPage.$page.fullPath,'获取当前页面完整路径带参数'); console.log(currentPage.$page.fullPath,'获取当前页面完整路径带参数');
// console.log(currentPage.options,''); // console.log(currentPage.options,'');
uni.setStorageSync('urlparams',currentPage.$page.fullPath);
if(uni.getStorageSync('token')==''){ if(uni.getStorageSync('token')==''){
uni.setStorageSync('urlparams',currentPage.$page.fullPath);
this.loginEv(currentPage.options); this.loginEv(currentPage.options);
this.showAuth = true; this.showAuth = true;
} }
@ -104,15 +104,29 @@
source_code: data.source_code || '', // source_code: data.source_code || '', //
channel: data.channel || '' channel: data.channel || ''
} }
// uni.request({
this.$requst.post('user/login',params).then(res => { url: `https://hengmei.scdxtc.cn/api/user/login`,
if(res.code==0){console.log(params,101);} else this.$toolAll.tools.showToast(res.msg); method: 'GET',
},error => { data: params,
this.$toolAll.tools.showToast(error.msg); success: res => {
setTimeout(()=>{ if(res.data.data.token!=''){
uni.navigateTo({url:'/pages/login/login'}) uni.setStorageSync('token',res.data.data.token); // token
},2000) 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)//
}
},
}) })
//
// this.$requst.post('user/login',params).then(res => {
// if(res.code==0){console.log(params,101);} else this.$toolAll.tools.showToast(res.msg);
// },error => {
// // this.$toolAll.tools.showToast(error.msg);
// // setTimeout(()=>{
// // uni.navigateTo({url:'/pages/login/login'})
// // },2000)
// })
} }
}, },
}); });

View File

@ -1,5 +1,6 @@
import requst from './requst.js'; import requst from './requst.js';
import toolAll from './tools.js'; import toolAll from './tools.js';
import store from '@/store/index.js'
export function collectionEV(data){//收藏事件 export function collectionEV(data){//收藏事件
return requst.post('archives/record',data).then(res=>{ return requst.post('archives/record',data).then(res=>{
@ -73,14 +74,50 @@ export function reportBuriedPoint(data){//上报埋点事件
// console.log('埋点的数据:',data); // console.log('埋点的数据:',data);
return requst.post('statistics/report',data).then(res=>{},error=>{}) return requst.post('statistics/report',data).then(res=>{},error=>{})
} }
// export function zhuColor(){//查询主题色 export function themeEv(){//查询主题色
// return requst.post('index/mini-program-setting').then(res=>{ return requst.post('index/mini-program-setting','',false).then(res=>{
// if(res.code==0){ if(res.code==0){
// uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57 if(res.data.length!=0){
// // uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57 let imgList = [];
// } let titleList = [];
// },error=>{}) if(res.data.footBar.length!=0){//底部导航
// } res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:'https://oss.hmzfyy.cn' + item.icon[0],
selectedIconPath:'https://oss.hmzfyy.cn' + item.icon[1],
}
if(item.key=="home"){
imgList[0] = newObj
titleList[0] = newName
}
if(item.key=="category"){
imgList[1] = newObj
titleList[1] = newName
}
if(item.key=="service"){
imgList[2] = newObj
titleList[2] = newName
}
if(item.key=="shop"){
imgList[3] = newObj
titleList[3] = newName
}
if(item.key=="my"){
imgList[4] = newObj
titleList[4] = newName
}
})
store.commit('updateState', {
titleList,
imgList,
publicColor:res.data.mainColor
})
}
}
}
})
}
export function checkSwip(){//查询主题色 export function checkSwip(){//查询主题色
return requst.post('common/slide-positions').then(res=>{ return requst.post('common/slide-positions').then(res=>{
if(res.code==0){ if(res.code==0){
@ -88,11 +125,11 @@ export function checkSwip(){//查询主题色
} }
},error=>{}) },error=>{})
} }
export function checkBanner(data){//查询主题色 export function checkBanner(data){//查询banner
return requst.post('common/slides',data) return requst.post('common/slides',data,false)
} }
export function checkQuan(){//查询优惠券 export function checkQuan(){//查询优惠券
return requst.post('user/home-coupon').then(res=>{ return requst.post('user/home-coupon',{},false).then(res=>{
if(res.code==0){ if(res.code==0){
if(res.data.has_coupon==1){ if(res.data.has_coupon==1){
uni.setStorageSync('isQuan',true); uni.setStorageSync('isQuan',true);

View File

@ -1,19 +1,30 @@
// const ENV = process.env.NODE_ENV; // const ENV = process.env.NODE_ENV;
const ENV = process.env; const ENV = process.env;
console.log(ENV,2); console.log(ENV,2);
let hostapi = '';
// #ifdef MP-WEIXIN
let hInfo = wx.getAccountInfoSync();
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
// (开发版,体验版)域名
hostapi = 'https://hengmei.scdxtc.cn/api/';
} else {
// 正式版-域名
hostapi = 'https://hm.hmzfyy.cn/api/';
}
// #endif
// 清理所有缓存并前往授权页 // 清理所有缓存并前往授权页
const goLogin = () => { const goLogin = () => {
uni.clearStorageSync(); // uni.clearStorageSync();
uni.showToast({ // uni.showToast({
title:'信息错误请重新登录', // title:'信息错误请重新登录',
icon:'none' // icon:'none'
}) // })
setTimeout(()=>{ // setTimeout(()=>{
uni.reLaunch({ // uni.reLaunch({
url: '/pages/login/login' // url: '/pages/login/login'
}) // })
},1000) // },1000)
} }
// 请求错误处理 // 请求错误处理
const checkError = (e) => { const checkError = (e) => {
@ -50,9 +61,11 @@ const checkError = (e) => {
} }
} }
} }
const flag = true;
let urls = [];
let timer = null;
// 封装请求 // 封装请求
const request = (method, url, options) => { const request = (method, url, options, ifLogin) => {
let methods = ''; let methods = '';
let headers = {}; let headers = {};
switch (method) { switch (method) {
@ -79,58 +92,151 @@ const request = (method, url, options) => {
break; break;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let hostapi = ''; if(ifLogin) {
// #ifdef MP-WEIXIN var date = new Date();
let hInfo = wx.getAccountInfoSync(); var timestamp = date.getTime();//精确到毫秒
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版 // 如果过期时间 减 10分钟 小于当前时间刷新token
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){ if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
// (开发版,体验版)域名 // token已失效
hostapi = 'https://hengmei.scdxtc.cn/api/'; urls.push(url);
} else { if(urls.length<=1) {
// 正式版-域名 // 调用登录事件
hostapi = 'https://hm.hmzfyy.cn/api/'; 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);
}
})
} }
// #endif } else {
uni.request({ // 不需要token的
url: `${hostapi}${url}`, uni.request({
method: methods, url: `${hostapi}${url}`,
data: options, method: methods,
header: headers, data: options,
success: res => { header: headers,
console.log(`${url}返的结果===>`,res); success: res => {
if (res.statusCode == 200) { console.log(`${url}返的结果===>`,res);
if (res.data.code == 0) { if (res.statusCode == 200) {
resolve(res.data) 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 { } else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
checkError(res) checkError(res)
} }
} else if(res.statusCode==500) { },
goLogin(); fail: e => {
} else { checkError(e)
checkError(res) },
complete: rest => {
// console.log(rest);
} }
}, })
fail: e => { }
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
}) })
} }
// 上传文件 封装请求 // 上传文件 封装请求
const uploadFile = (url, options) => { const uploadFile = (url, options) => {
let tempData = options || {} let tempData = options || {}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${uni.getStorageSync('hostapi')}${url}`, url: `${hostapi}${url}`,
filePath: tempData.file, filePath: tempData.file,
name: 'image', name: 'image',
fileType:'image', fileType:'image',
@ -174,19 +280,19 @@ const uploadFile = (url, options) => {
export default { export default {
get: (url, options) => { get: (url, options, ifLogin=true) => {
return request('get', url, options) return request('get', url, options, ifLogin)
}, },
// JOSN格式 // JOSN格式
post: (url, options) => { post: (url, options, ifLogin=true) => {
return request('post', url, options) return request('post', url, options, ifLogin)
}, },
// form-data格式 // form-data格式
postForm: (url, options) => { postForm: (url, options, ifLogin=true) => {
return request('postForm', url, options) return request('postForm', url, options, ifLogin)
}, },
// 上传 // 上传
upload: (url, options) => { upload: (url, options, ifLogin=true) => {
return uploadFile(url, options) return uploadFile(url, options, ifLogin)
} }
} }

View File

@ -1,5 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import store from './store'
Vue.prototype.$store = store
import statusNav from './components/status-nav.vue';//引入状态栏组件 import statusNav from './components/status-nav.vue';//引入状态栏组件
Vue.component('status-nav',statusNav)//全局注册状态栏组件 Vue.component('status-nav',statusNav)//全局注册状态栏组件
@ -32,9 +34,12 @@ Vue.component('auth-userInfo-mobileInfo',authUserInfoMobileInfo)//全局注册
import share from './jsFile/share.js' import share from './jsFile/share.js'
Vue.mixin(share) Vue.mixin(share)
Vue.prototype.$hostApi = 'https://oss.hmzfyy.cn';
// 常用工具 // 常用工具
import tools from '@/jsFile/tools.js' import tools from '@/jsFile/tools.js'
Vue.prototype.$toolAll = tools; Vue.prototype.$toolAll = tools;
// 响应数据 // 响应数据
import requst from '@/jsFile/requst.js' import requst from '@/jsFile/requst.js'
Vue.prototype.$requst = requst; Vue.prototype.$requst = requst;
@ -55,11 +60,13 @@ Vue.prototype.$log = log
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
store,
...App ...App
}) })
app.$mount() app.$mount()

View File

@ -67,15 +67,6 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "immediatePayment/immediatePayment",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
,{ ,{
"path" : "member/member", "path" : "member/member",

View File

@ -187,9 +187,15 @@
// if(res.data.phone_active!=1){ // if(res.data.phone_active!=1){
// this.isShowP = true; // this.isShowP = true;
// } else { // } else {
uni.reLaunch({ if(uni.getStorageSync('urlparams')) {
url:'/pages/tabbar/pagehome/pagehome' uni.reLaunch({ //
}) url:uni.getStorageSync('urlparams')
})
} else {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
}
// } // }
} }
},error => {}) },error => {})

View File

@ -152,7 +152,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
ccurrent:0, ccurrent:0,
cateList:[], cateList:[],
cateListTwo:[// cateListTwo:[//
@ -173,8 +172,6 @@
category_id:'',//ID category_id:'',//ID
disease_id:'',//ID disease_id:'',//ID
bannerList:[], bannerList:[],
titleList:[],
imgList:[],
zanArr:[], zanArr:[],
dataShopList:[], dataShopList:[],
timeList:[], timeList:[],
@ -182,6 +179,20 @@
isAutoPlay:false, isAutoPlay:false,
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
@ -222,46 +233,6 @@
if(this.ccurrent==0) { if(this.ccurrent==0) {
if(this.category_id!='') this.checkCate(this.category_id)// if(this.category_id!='') this.checkCate(this.category_id)//
} }
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
} }
}, },
methods: { methods: {

View File

@ -157,12 +157,11 @@
<script> <script>
import {base64ToPath} from '@/jsFile/base64-src.js'; import {base64ToPath} from '@/jsFile/base64-src.js';
import {checkBanner} from '@/jsFile/publicAPI.js'; import {checkBanner,themeEv} from '@/jsFile/publicAPI.js';
export default { export default {
data() { data() {
return { return {
statusHNH:uni.getSystemInfoSync().statusBarHeight + 54, statusHNH:uni.getSystemInfoSync().statusBarHeight + 54,
publicColor:uni.getStorageSync('publicColor'),
tongList:[ tongList:[
{num:'0',title:'我的积分'}, {num:'0',title:'我的积分'},
{num:'0',title:'孔雀币'}, {num:'0',title:'孔雀币'},
@ -211,8 +210,6 @@
is_doctor:'',//01 is_doctor:'',//01
is_servicer:'',//01 is_servicer:'',//01
is_staff:'',//01 is_staff:'',//01
titleList:[],
imgList:[],
isQian:false, isQian:false,
bannerList:[], bannerList:[],
guangImg:'', guangImg:'',
@ -234,52 +231,26 @@
let pages = getCurrentPages(); let pages = getCurrentPages();
// console.log('pages:',pages); // console.log('pages:',pages);
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
uni.removeStorageSync('uinfo')// uni.removeStorageSync('uinfo')//
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
uni.removeStorageSync('shareAll')// uni.removeStorageSync('shareAll')//
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkInfo(); this.checkInfo();
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
} }
}, },
onUnload() { onUnload() {

View File

@ -97,16 +97,15 @@
statusBarHeight:uni.getSystemInfoSync().statusBarHeight, statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
searchVal:'',// searchVal:'',//
publicColor:'',// //
gonggList:[// gonggList:[],
], //
fwList:[// fwList:[],
],
kcurrent:0,// kcurrent:0,//
ktList:[// //
], ktList:[],
dataList:[// //
], dataList:[],
showTop:false, showTop:false,
newCurrent:0, newCurrent:0,
page:1, page:1,
@ -116,8 +115,6 @@
course_id:0, course_id:0,
isLoading:false, isLoading:false,
isShowT:true, isShowT:true,
titleList:[],//
imgList:[],//
gaoone:{}, gaoone:{},
gaotwo:{}, gaotwo:{},
gaothree:{}, gaothree:{},
@ -132,6 +129,20 @@
quanImg:uni.getStorageSync('quanImg'), quanImg:uni.getStorageSync('quanImg'),
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
@ -194,8 +205,7 @@
channel:newChanel, channel:newChanel,
source_code:newsource_code source_code:newsource_code
} }
// console.log(params); this.$requst.post('user/login',params,false).then(res => {
this.$requst.post('user/login',params).then(res => {
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)//
@ -235,7 +245,9 @@
source_code:option.source_code || '', source_code:option.source_code || '',
channel:option.channel || '' channel:option.channel || ''
} }
this.$requst.post('user/login',params).then(res => { 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('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)//
@ -246,7 +258,7 @@
}); });
}, },
checkQ(){// checkQ(){//
this.$requst.post('user/home-coupon').then(res=>{ this.$requst.post('user/home-coupon',{},false).then(res=>{
if(res.data.has_coupon==1){ if(res.data.has_coupon==1){
this.isQuan = true; this.isQuan = true;
this.quanImg = this.$http + res.data.home_coupon.cover; this.quanImg = this.$http + res.data.home_coupon.cover;
@ -308,7 +320,6 @@
this.wuNet = '刷新失败' this.wuNet = '刷新失败'
this.reNum = 0 this.reNum = 0
} }
this.publicColor = uni.getStorageSync('publicColor')
} else { } else {
uni.setStorageSync('isNet',true) uni.setStorageSync('isNet',true)
this.isNet = true this.isNet = true
@ -354,7 +365,7 @@
},error=>{}) },error=>{})
}, },
checkBCate(){// checkBCate(){//
this.$requst.post('index/mini-program-setting').then(res=>{ this.$requst.post('index/mini-program-setting',{},false).then(res=>{
// log('',res); // log('',res);
if(res.data.length!=0){ if(res.data.length!=0){
if(res.data.recommend.length!=0){// if(res.data.recommend.length!=0){//
@ -368,37 +379,6 @@
}) })
this.gonggList.push({src:this.$http + res.data.recommendMore,title:'更多'}) this.gonggList.push({src:this.$http + res.data.recommendMore,title:'更多'})
} }
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
}
if(res.data.ad.length!=0){// if(res.data.ad.length!=0){//
this.gaoone = { this.gaoone = {
imgSrc:this.$http + res.data.ad[0].img, imgSrc:this.$http + res.data.ad[0].img,
@ -413,7 +393,6 @@
url:res.data.ad[2].link, url:res.data.ad[2].link,
} }
} }
this.publicColor = res.data.mainColor
} }
}) })
}, },
@ -423,7 +402,7 @@
page:this.page, page:this.page,
size:this.size size:this.size
} }
this.$requst.post('archives/course',parmas).then(res=>{ this.$requst.post('archives/course',parmas,false).then(res=>{
// log('',res); // log('',res);
// //
if(res.data.course.length!=0){ if(res.data.course.length!=0){

View File

@ -172,10 +172,7 @@
}, },
data() { data() {
return { return {
titleList:[],
imgList:[],
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
activeIndex:'-1', activeIndex:'-1',
shopCate:['全部分类','全部医生','全部活动'], shopCate:['全部分类','全部医生','全部活动'],
cateTitle:'', cateTitle:'',
@ -209,17 +206,26 @@
gaodu:0 gaodu:0
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onHide() { onHide() {
this.isAutoPlay = false; this.isAutoPlay = false;
}, },
onUnload() { onUnload() {
this.isAutoPlay = false; this.isAutoPlay = false;
}, },
onShow() {
this.$toolAll.tools.isLogin();
this.cartNumEv();//
this.isAutoPlay = true;
},
onPageScroll(e) { onPageScroll(e) {
if(e.scrollTop>=242){ if(e.scrollTop>=242){
this.positionMode = "fixed"; this.positionMode = "fixed";
@ -229,6 +235,13 @@
this.gaodu = 0; this.gaodu = 0;
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
this.cartNumEv();//
}
this.isAutoPlay = true;
},
onLoad(options) { onLoad(options) {
this.optionObj = options; this.optionObj = options;
// + // +
@ -246,46 +259,6 @@
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkSX(); this.checkSX();
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
} }
}, },
methods: { methods: {

View File

@ -77,7 +77,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isScreenshot:false, isScreenshot:false,
upImg:'', upImg:'',
chooseIndex:0, chooseIndex:0,

View File

@ -58,7 +58,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
chuTop:'', chuTop:'',
navList:['未使用','已使用','可领取','已过期'], navList:['未使用','已使用','可领取','已过期'],
isStatus:0, isStatus:0,

View File

@ -179,7 +179,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isExpress:false, isExpress:false,
switchQuan:true, switchQuan:true,
showQuan:false,// showQuan:false,//
@ -227,6 +226,12 @@
payType:''// wechat=;coin=;hybrid= payType:''// wechat=;coin=;hybrid=
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();

View File

@ -1,221 +0,0 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'立即支付'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
<view v-if="!isSuccess">
<!-- 订单信息 -->
<view class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
<view class="bold fon28">订单支付</view>
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
<image :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
</navigator>
<view class="width100 disjb fw" style="height: 166rpx;">
<view>
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
<view class="fon28 col3 bold clips2">{{item.title}}</view>
</navigator>
<view class="order-sy">试用</view>
</view>
<view class="disjbac mar-s10 width100">
<view class="order-item-price">{{item.price}}</view>
<view class="fon28 col6">x{{item.num}}</view>
</view>
</view>
</view>
<view class="fon28 disjbac mar-s50 pad-s10 mar-x20">
<view class="col6">{{zf_allNum}}</view>
<view class="bold colf8">应付款{{zf_allPrice}}<span v-if="isKq">+{{zf_kqPrice}}</span></view>
</view>
</view>
<!-- 支付方式 -->
<view class="bacf radius20 mar-s20 fon28 col3 pad-sx30 pad-zy20">
<view class="bold fon28">选择支付方式</view>
<view @tap="chooseFS(index)" v-for="(item,index) in payFS" :key="index" class="disjbac mar-s30">
<view class="disac">
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="chooseDX" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" class="chooseDX" mode=""></image>
<view class="mar-z25">{{item.title}}</view>
</view>
<view v-if="item.num!=0">{{item.num}}</view>
</view>
</view>
<view v-if="isGuo" class="fon28 col3 dao-box"></view>
<view v-else class="fon28 col3 dao-box">请在<span class="colf8 bold">{{daoTime}}</span>完成支付</view>
<!-- 确认支付 -->
<view @tap="payment" class="submit-pay">确认支付</view>
</view>
<!-- 支付成功 -->
<view v-if="isSuccess" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;text-align: center;">
<image src="/static/public/pay-success.png" style="width: 194rpx;height: 194rpx;" mode=""></image>
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
<view class="" style="font-size: 46rpx;margin-bottom: 120rpx;color: #F85050;">{{jsPrice}}</view>
<view class="disja success-btn">
<view @tap="goDetail" style="">查看订单</view>
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isSuccess:false,
orderList:uni.getStorageSync('orderList'),
zf_allNum:0,//
zf_allPrice:0,//
zf_kqPrice:0,//
payFS:[
{title:'微信支付',isActive:true,num:0},
{title:'孔雀币',isActive:false,num:3000},
],
isKq:false,
jsPrice:0,//,
zc_allPrice:0,//
orderInfo:uni.getStorageSync('orderInfo'),
daoTime:'',//
isGuo:false//
}
},
onShow() {
this.$toolAll.tools.isLogin()
},
onUnload() {
uni.removeStorageSync('orderInfo');
},
onLoad(options) {
this.zc_allPrice = this.zf_allPrice = options.allPrice;
this.zf_allPrice = this.$toolAll.tools.addXiaoShu(this.zf_allPrice);
this.zf_allNum = options.allNum;
let endTime = this.orderInfo.expired_at;
let endChuo = new Date(this.orderInfo.expired_at).getTime();
this.daoTime = this.$toolAll.tools.dayTime(endTime,options.startTime);
let timer = setInterval(()=>{
if(options.startTime - endChuo>=0){
this.isGuo = true;
clearInterval(timer);
} else {
options.startTime = options.startTime*1 + 1000;
this.daoTime = this.$toolAll.tools.dayTime(endTime,options.startTime)
}
},1000)
},
methods: {
chooseFS(index){
this.payFS[index].isActive = !this.payFS[index].isActive;
if(index==0){
//+
if(this.payFS[0].isActive && this.payFS[1].isActive){
this.isKq = true;
return;
}
//+
if(!this.payFS[0].isActive && this.payFS[1].isActive){
this.$toolAll.tools.showToast('孔雀币不足');
return;
}
//+
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式');
return;
}
//+
if(this.payFS[0].isActive && this.payFS[1].isActive){
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
this.zf_kqPrice = this.payFS[index].num;
return;
}
}
if(index==1) {
//+
if(this.payFS[0].isActive && this.payFS[1].isActive) {
this.isKq = true;
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
this.zf_kqPrice = this.payFS[index].num;
return;
}
//+
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
this.isKq = false;
this.zf_allPrice = this.zc_allPrice;
return;
}
//++
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){
this.$toolAll.tools.showToast('孔雀币不足')
this.isKq = true;
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
this.zf_kqPrice = this.payFS[index].num;
return;
}
//++
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 < this.zf_kqPrice*1){
this.isKq = true;
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
this.zf_kqPrice = this.payFS[index].num;
return;
}
//+
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式')
this.isKq = false;
this.zf_allPrice = this.zc_allPrice;
return;
}
}
},
payment(){
if(!this.payFS[0].isActive && !this.payFS[1].isActive) {
this.$toolAll.tools.showToast('请选择支付方式')
} else if(!this.payFS[0].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){
this.$toolAll.tools.showToast('孔雀币不足')
} else {
console.log(this.orderInfo.needPay);
if(this.orderInfo.needPay){
uni.requestPayment({
provider: 'wxpay',
appId:this.orderInfo.payment_params.appId,//appId
timeStamp: this.orderInfo.payment_params.timeStamp,//
nonceStr: this.orderInfo.payment_params.nonceStr,//
package: this.orderInfo.payment_params.package,//package
signType: this.orderInfo.payment_params.signType,//MD5
paySign: this.orderInfo.payment_params.sign,//
success:(res)=> {
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
this.isSuccess = true;
},error=>{this.$toolAll.tools.showToast(res.msg);})
},
fail: (err)=> {}
});
} else {
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
this.isSuccess = true;
},error=>{this.$toolAll.tools.showToast(res.msg);})
}
}
},
goDetail(){
uni.navigateTo({
url:'/pagesB/orderDetail/orderDetail'
})
},
goShop(){
uni.reLaunch({
url:'/pages/tabbar/shop/shop'
})
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
</style>

View File

@ -57,7 +57,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
activeJF:true, activeJF:true,
dataList:[ dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'}, // {title:'',time:'2021.09.06 10:30:10',num:'1'},
@ -90,10 +89,8 @@
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkInfo();
this.checkInfo(); this.checkList();
this.checkList();
}
}, },
methods: { methods: {
checkList(){// checkList(){//

View File

@ -47,7 +47,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
failColor:'#CCCCCC',// failColor:'#CCCCCC',//
ingColor:'#FFBE4D',// ingColor:'#FFBE4D',//
quColor:'#FF4D4D',// quColor:'#FF4D4D',//
@ -66,6 +65,12 @@
zzId:''//ID zzId:''//ID
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onReachBottom() { onReachBottom() {
if(this.total!=this.dataList.length){ if(this.total!=this.dataList.length){
this.page++ this.page++

View File

@ -57,7 +57,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
huiList:[ huiList:[
{src:'/static/public/ru-hui50.png',title:'入会权益',ntype:'membership_interests'}, {src:'/static/public/ru-hui50.png',title:'入会权益',ntype:'membership_interests'},
{src:'/static/public/birthday50.png',title:'生日礼物',ntype:'birthday'}, {src:'/static/public/birthday50.png',title:'生日礼物',ntype:'birthday'},
@ -70,6 +69,12 @@
detailInfo:'',// detailInfo:'',//
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },

View File

@ -89,7 +89,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
optionObj:'', optionObj:'',
diary_title:'',// diary_title:'',//
diary_content:'',// diary_content:'',//
@ -108,6 +107,12 @@
placeholder: '开始输入...' placeholder: '开始输入...'
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },

View File

@ -38,7 +38,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
optionObj:'', optionObj:'',
dataList:[], dataList:[],
page:1, page:1,
@ -47,6 +46,12 @@
isZanw:true, isZanw:true,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onReachBottom() { onReachBottom() {
if(this.total!=this.dataList.length){ if(this.total!=this.dataList.length){
this.page++ this.page++

View File

@ -95,7 +95,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[], dataList:[],
idEdit:false, idEdit:false,
userName:'', userName:'',
@ -122,9 +121,7 @@
}, },
onLoad(options) { onLoad(options) {
this.isWhere = options.isWhere; this.isWhere = options.isWhere;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkList();
this.checkList();
}
}, },
methods: { methods: {
goBack(index){// goBack(index){//

View File

@ -119,7 +119,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
chuTop:'',// chuTop:'',//
activeIndex:'', activeIndex:'',
statusList:['全部','待付款','待发货','待核验','待收货','已完成'], statusList:['全部','待付款','待发货','待核验','待收货','已完成'],
@ -151,10 +150,18 @@
timeList:[], timeList:[],
orderInfo:{}, orderInfo:{},
checkGrounpId:0, checkGrounpId:0,
titleList:[],//tab
imgList:[],//tab
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
},
onShareAppMessage(res) { onShareAppMessage(res) {
  return false;   return false;
}, },
@ -174,10 +181,8 @@
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkZT(this.activeIndex);
this.checkZT(this.activeIndex); this.checkList(this.activeIndex);
this.checkList(this.activeIndex);
}
}, },
onLoad(options) { onLoad(options) {
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index; options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
@ -186,46 +191,6 @@
// console.log('+',rect); // console.log('+',rect);
this.chuTop = rect.height this.chuTop = rect.height
}).exec() }).exec()
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
}, },
methods: { methods: {
comeing(coding){ comeing(coding){

View File

@ -75,7 +75,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
moHead:'/static/public/logo.png', moHead:'/static/public/logo.png',
dataList:[ dataList:[
{title:'用户头像',content:'',imgSrc:'',fcon:''}, {title:'用户头像',content:'',imgSrc:'',fcon:''},
@ -112,6 +111,12 @@
whereCome:0, whereCome:0,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();

View File

@ -63,7 +63,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
activeJF:true, activeJF:true,
kNum:'',// kNum:'',//
dataList:[ dataList:[
@ -103,10 +102,8 @@
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkInfo();
this.checkInfo(); this.checkList(this.ntype);
this.checkList(this.ntype);
}
}, },
methods: { methods: {
confrimT(){// confrimT(){//

View File

@ -50,10 +50,7 @@
}, },
data() { data() {
return { return {
titleList:[],
imgList:[],
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
activeIndex:0, activeIndex:0,
shopCate:['综合','最新','兑换量','积分'], shopCate:['综合','最新','兑换量','积分'],
titleHeight:'',// titleHeight:'',//
@ -66,9 +63,25 @@
cartNum:0, cartNum:0,
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
this.cartNumEv(); if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.cartNumEv();
}
}, },
onLoad(options) { onLoad(options) {
// + // +
@ -78,8 +91,6 @@
this.titleHeight = rect.height this.titleHeight = rect.height
}).exec() }).exec()
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
// tools.js // tools.js
this.$toolAll.tools.plantPoint(12); this.$toolAll.tools.plantPoint(12);

View File

@ -86,7 +86,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
timeCurrent:0, timeCurrent:0,
dataList:[],// dataList:[],//
dataTD:[],// dataTD:[],//
@ -111,6 +110,12 @@
btnCon:'立即提交' btnCon:'立即提交'
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },

View File

@ -65,7 +65,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
showDel:false, showDel:false,
startX:'',// startX:'',//
endX:'',// endX:'',//
@ -81,6 +80,12 @@
timeout:null timeout:null
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() { onShow() {
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
uni.removeStorageSync('orderList'); uni.removeStorageSync('orderList');

View File

@ -53,7 +53,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
timeList:[], timeList:[],
dataList:[ dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'}, // {title:'',time:'2021.09.06 10:30:10',num:'1'},

View File

@ -77,7 +77,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:false, isShowT:false,
category:'', category:'',
tname:'',// tname:'',//
@ -88,8 +87,20 @@
xialCurrent:0, xialCurrent:0,
xialone:[], xialone:[],
btnCon:'立即提交', btnCon:'立即提交',
titleList:[],//tab }
imgList:[],//tab },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
} }
}, },
onShow() { onShow() {
@ -99,46 +110,6 @@
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkCate(); this.checkCate();
this.tphone = uni.getStorageSync('phone'); this.tphone = uni.getStorageSync('phone');
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
} }
}, },
methods: { methods: {

View File

@ -51,7 +51,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
cateListTwo:[ cateListTwo:[
// {title:''}, // {title:''},
// {title:''}, // {title:''},
@ -78,6 +77,12 @@
isAutoPlay:false, isAutoPlay:false,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -67,7 +67,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
headImg:'/static/public/like.png', headImg:'/static/public/like.png',
name:'恒美植发', name:'恒美植发',
time:'2021-07-14 08:22', time:'2021-07-14 08:22',
@ -88,6 +87,12 @@
shareImg:''// shareImg:''//
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShareAppMessage(res) { onShareAppMessage(res) {
var ya = this; var ya = this;
this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{}) this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})

View File

@ -19,7 +19,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
imgSrc:'', imgSrc:'',
isBtn:false isBtn:false
} }

View File

@ -49,7 +49,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[],// dataList:[],//
showTop:false,// showTop:false,//
keyword:'',// keyword:'',//
@ -60,6 +59,12 @@
ntype:'',// mine= ntype:'',// mine=
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -108,7 +108,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
category:'', category:'',
dataList:[], dataList:[],
showTop:false, showTop:false,
@ -138,6 +137,12 @@
realName:'',// realName:'',//
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -54,7 +54,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[ dataList:[
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''}, // {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''}, // {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
@ -72,6 +71,12 @@
searchTime:null searchTime:null
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -61,7 +61,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),//
cateList:[], cateList:[],
dataList:[], dataList:[],
newCurrent:0, newCurrent:0,
@ -80,6 +79,12 @@
doctorId:''//id doctorId:''//id
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShareAppMessage() { onShareAppMessage() {
var shareObj = { var shareObj = {
path: `/pagesB/doctorDetail/doctorDetail?invite_code=${uni.getStorageSync('invite_code')}&doctor_id=${this.doctorId}`, // / path: `/pagesB/doctorDetail/doctorDetail?invite_code=${uni.getStorageSync('invite_code')}&doctor_id=${this.doctorId}`, // /

View File

@ -40,7 +40,6 @@
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
searchVal:'',// searchVal:'',//
publicColor:uni.getStorageSync('publicColor'),//
dataList:[], dataList:[],
showTop:false,// showTop:false,//
chuTop:'', chuTop:'',
@ -79,54 +78,52 @@
this.chuTop = rect.height this.chuTop = rect.height
}).exec() }).exec()
if(options.index==undefined){this.isWen = false;this.ntype = 'message';} if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkMsg();
this.checkMsg(); let that = this ;
let that = this ; wx.showModal({
wx.showModal({ title: '温馨提示',
title: '温馨提示', content: '为及时通知到您,需要向您申请消息发送权限,不会骚扰您的生活!',
content: '为及时通知到您,需要向您申请消息发送权限,不会骚扰您的生活!', confirmText:"同意",
confirmText:"同意", cancelText:"拒绝",
cancelText:"拒绝", success: function (res) {
success: function (res) { if (res.confirm) {
if (res.confirm) { //
// console.log('用户点击确定', '订阅消息授权成功');
console.log('用户点击确定', '订阅消息授权成功'); //
// wx.requestSubscribeMessage({
wx.requestSubscribeMessage({ tmplIds: ['d0efR-Ga27c6eIvx9mAwJcnAqzhM_Sq68XiFvjvlBJM','eyxvInLLF3L_wmcSQc_O7XLKF7RoGK1dM3OwKj5fHio'],
tmplIds: ['d0efR-Ga27c6eIvx9mAwJcnAqzhM_Sq68XiFvjvlBJM','eyxvInLLF3L_wmcSQc_O7XLKF7RoGK1dM3OwKj5fHio'], success: (res) => {
success: (res) => { console.log(res, 'success')
console.log(res, 'success') },
}, fail: (res) => {
fail: (res) => { console.log(res, 'fail')
console.log(res, 'fail') },
}, complete: (res) => {
complete: (res) => { wx.getSetting({
wx.getSetting({ withSubscriptions: true,
withSubscriptions: true, success: (res) => {
success: (res) => { console.log(res, '获取设置信息')
console.log(res, '获取设置信息') }
} })
}) console.log(res, 'complete')
console.log(res, 'complete') }
} })
}) } else if (res.cancel) {
} else if (res.cancel) { console.log('用户点击取消', '订阅消息授权');
console.log('用户点击取消', '订阅消息授权'); ///
/// wx.showModal({
wx.showModal({ title: '温馨提示',
title: '温馨提示', content: '拒绝后您将无法获得及时的消息通知哦',
content: '拒绝后您将无法获得及时的消息通知哦', confirmText:"知道了",
confirmText:"知道了", showCancel:false,
showCancel:false, success: function (res) {
success: function (res) { ///
/// ///
/// }
} });
});
}
} }
}); }
} });
}, },
methods: { methods: {
readMsg(index1,index2){ readMsg(index1,index2){

View File

@ -135,7 +135,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[], dataList:[],
showTop:false,// showTop:false,//
newCurrent:0, newCurrent:0,
@ -157,6 +156,12 @@
collectionTime:null collectionTime:null
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
@ -180,10 +185,8 @@
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin() this.$toolAll.tools.isLogin()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkConList(this.category_id);
this.checkConList(this.category_id); this.shopCollection();
this.shopCollection();
}
}, },
onLoad(options) { onLoad(options) {
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()

View File

@ -46,7 +46,6 @@
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
flag:0, flag:0,
publicColor:uni.getStorageSync('publicColor'),//
cateList:[ cateList:[
{title:'一级',num:0,grade:'first'}, {title:'一级',num:0,grade:'first'},
{title:'二级',num:0,grade:'second'}, {title:'二级',num:0,grade:'second'},
@ -63,6 +62,12 @@
isZanw:true, isZanw:true,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
@ -88,10 +93,8 @@
this.navH = rect.height this.navH = rect.height
}).exec() }).exec()
} }
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkShare()//
this.checkShare()// this.checkPeople()//
this.checkPeople()//
}
}, },
methods: { methods: {
checkShare(){// checkShare(){//

View File

@ -121,7 +121,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
loading:false, loading:false,
isExpress:true, isExpress:true,
switchQuan:true, switchQuan:true,
@ -153,9 +152,7 @@
this.$toolAll.tools.isLogin(); this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ this.checkInfo(options.id);
this.checkInfo(options.id);
}
}, },
methods: { methods: {
comeing(coding){ comeing(coding){

View File

@ -44,17 +44,24 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:true, isShowT:true,
imgList:uni.getStorageSync('imgSrcList'), imgList:uni.getStorageSync('imgSrcList'),
imgSrc:'', imgSrc:'',
showBtn:false, showBtn:false,
isHaib:false, isHaib:false,
titleList:[],//tab
tabimgList:[],//tab
shareFlag:true// shareFlag:true//
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
tabimgList() {
return this.$store.state.imgList
},
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.$toolAll.tools.isLogin() ; this.$toolAll.tools.isLogin() ;
@ -62,46 +69,6 @@
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')// if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//
else this.imgList = [] else this.imgList = []
this.checkPoster(); this.checkPoster();
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.tabimgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.tabimgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.tabimgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.tabimgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.tabimgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.tabimgList)
this.titleList = uni.getStorageSync('footTitle')
this.tabimgList = uni.getStorageSync('footimg')
}
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
} }
}, },
methods: { methods: {

View File

@ -123,7 +123,6 @@
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
isLoading: false, isLoading: false,
statusHNH: uni.getStorageSync('statusHNH'), statusHNH: uni.getStorageSync('statusHNH'),
publicColor: uni.getStorageSync('publicColor') || '#3875F6', //
cateCurrent: 0, cateCurrent: 0,
cateList: [], cateList: [],
bannerList: [], // bannerList: [], //
@ -161,6 +160,12 @@
newHeight:'450', newHeight:'450',
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -42,7 +42,6 @@
titleStr:'',// titleStr:'',//
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
searchVal:'',// searchVal:'',//
publicColor:uni.getStorageSync('publicColor'),//
isShowT:false,// isShowT:false,//
cateList:[// cateList:[//
@ -59,6 +58,12 @@
category_id:'',//ID category_id:'',//ID
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onReachBottom() {// onReachBottom() {//
if(this.total!=this.dataList.length){ if(this.total!=this.dataList.length){
this.page++ this.page++

View File

@ -49,7 +49,6 @@
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
searchVal:'',// searchVal:'',//
publicColor:uni.getStorageSync('publicColor'),//
reSearchList:[// reSearchList:[//
{ {
title:'历史搜索', title:'历史搜索',
@ -85,6 +84,12 @@
category_id:'',//ID category_id:'',//ID
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -40,7 +40,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:false, isShowT:false,
imgSrc:'/static/public/shareh.png', imgSrc:'/static/public/shareh.png',
dataList:[ dataList:[
@ -49,11 +48,19 @@
{num:'0',title:'分享订单'}, {num:'0',title:'分享订单'},
], ],
imgSrcP:uni.getStorageSync('imgSrcP'), imgSrcP:uni.getStorageSync('imgSrcP'),
titleList:[],//tab
imgList:[],//tab
shareFlag:true shareFlag:true
} }
}, },
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
},
onShareAppMessage(options) { onShareAppMessage(options) {
var ya = this; var ya = this;
   var shareObj = {    var shareObj = {
@ -78,49 +85,11 @@
  };   };
  return shareObj;   return shareObj;
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){this.$toolAll.tools.isLogin()}
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0 uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
this.$requst.post('index/mini-program-setting').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
if(res.data.footBar.length!=0){//
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:this.$http + item.icon[0],
selectedIconPath:this.$http + item.icon[1],
}
if(item.key=="home"){
this.imgList[0] = newObj
this.titleList[0] = newName
}
if(item.key=="category"){
this.imgList[1] = newObj
this.titleList[1] = newName
}
if(item.key=="service"){
this.imgList[2] = newObj
this.titleList[2] = newName
}
if(item.key=="shop"){
this.imgList[3] = newObj
this.titleList[3] = newName
}
if(item.key=="my"){
this.imgList[4] = newObj
this.titleList[4] = newName
}
})
uni.setStorageSync('footTitle',this.titleList)
uni.setStorageSync('footimg',this.imgList)
this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg')
}
}
}
},error=>{})
}, },
methods: { methods: {
shareEv(){// shareEv(){//

View File

@ -275,7 +275,6 @@
statusBarHeight:uni.getSystemInfoSync().statusBarHeight, statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
isLoading:false, isLoading:false,
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor') || '#3875F6',//
cateCurrent:0, cateCurrent:0,
swiperHeight:uni.getSystemInfoSync().windowWidth, swiperHeight:uni.getSystemInfoSync().windowWidth,
cateList:[{ cateList:[{
@ -342,6 +341,12 @@
timeout:null, timeout:null,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onReachBottom() { // onReachBottom() { //
if(this.cateCurrent!=this.isNum){ if(this.cateCurrent!=this.isNum){
if(this.total!=this.allList.length){ if(this.total!=this.allList.length){
@ -370,6 +375,7 @@
  return shareObj;   return shareObj;
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
uni.removeStorageSync('chooseAddress'); uni.removeStorageSync('chooseAddress');
uni.removeStorageSync('payType'); uni.removeStorageSync('payType');
this.isAutoPlay = true; this.isAutoPlay = true;

View File

@ -134,7 +134,6 @@
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
searchVal:'',// searchVal:'',//
publicColor:uni.getStorageSync('publicColor'),//
reSearchList:[// reSearchList:[//
{ {
title:'历史搜索', title:'历史搜索',
@ -181,6 +180,12 @@
isShowP:false, isShowP:false,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

View File

@ -42,7 +42,6 @@
data() { data() {
return { return {
statusHNH:uni.getStorageSync('electric_nav_height'), statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[],// dataList:[],//
showTop:false,// showTop:false,//
customer_id:'',//ID customer_id:'',//ID
@ -53,6 +52,12 @@
isZanw:true, isZanw:true,
} }
}, },
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },

23
store/index.js Normal file
View File

@ -0,0 +1,23 @@
// 页面路径store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);//vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
state:{//存放状态
'titleList':[],
'imgList':[],
'publicColor':''
},
mutations: {
updateState(state, payload) {
// 变更状态
state.titleList = payload.titleList;
state.imgList = payload.imgList;
state.publicColor = payload.publicColor;
}
}
})
export default store

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