添加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>
import toolAll from '@/jsFile/tools.js';
import requst from '@/jsFile/requst.js';
import { themeEv } from '@/jsFile/publicAPI.js';
export default {
globalData:{
outside:true//,
outside:true,//,
hostApi:''//
},
onLaunch: function() {
//
themeEv();
this.autoUpdate();
//
toolAll.tools.currentContext();
//
uni.setStorageSync('electric_nav_height',uni.getSystemInfoSync().statusBarHeight + 54);
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() {
if(uni.getStorageSync('token')!='') {
@ -53,7 +39,7 @@
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() //1.
updateManager.onCheckForUpdate(function(res) { //
if (res.hasUpdate) {
if (res.hasUpdate) {
//
wx.showModal({
title: '更新提示',

View File

@ -81,8 +81,8 @@
// console.log(currentPage.route,'');
console.log(currentPage.$page.fullPath,'获取当前页面完整路径带参数');
// console.log(currentPage.options,'');
uni.setStorageSync('urlparams',currentPage.$page.fullPath);
if(uni.getStorageSync('token')==''){
uni.setStorageSync('urlparams',currentPage.$page.fullPath);
this.loginEv(currentPage.options);
this.showAuth = true;
}
@ -104,15 +104,29 @@
source_code: data.source_code || '', //
channel: data.channel || ''
}
//
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)
uni.request({
url: `https://hengmei.scdxtc.cn/api/user/login`,
method: 'GET',
data: params,
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // token
uni.setStorageSync('openid',res.data.data.openid)//openid
uni.setStorageSync('expire',res.data.data.expire); //
uni.setStorageSync('phone_active',res.data.data.phone_active); //
uni.setStorageSync('is_active',res.data.data.is_active)//
}
},
})
//
// 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 toolAll from './tools.js';
import store from '@/store/index.js'
export function collectionEV(data){//收藏事件
return requst.post('archives/record',data).then(res=>{
@ -73,14 +74,50 @@ export function reportBuriedPoint(data){//上报埋点事件
// console.log('埋点的数据:',data);
return requst.post('statistics/report',data).then(res=>{},error=>{})
}
// export function zhuColor(){//查询主题色
// return requst.post('index/mini-program-setting').then(res=>{
// if(res.code==0){
// uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
// // uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
// }
// },error=>{})
// }
export function themeEv(){//查询主题色
return requst.post('index/mini-program-setting','',false).then(res=>{
if(res.code==0){
if(res.data.length!=0){
let imgList = [];
let titleList = [];
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(){//查询主题色
return requst.post('common/slide-positions').then(res=>{
if(res.code==0){
@ -88,11 +125,11 @@ export function checkSwip(){//查询主题色
}
},error=>{})
}
export function checkBanner(data){//查询主题色
return requst.post('common/slides',data)
export function checkBanner(data){//查询banner
return requst.post('common/slides',data,false)
}
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.data.has_coupon==1){
uni.setStorageSync('isQuan',true);

View File

@ -1,19 +1,30 @@
// const ENV = process.env.NODE_ENV;
const ENV = process.env;
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 = () => {
uni.clearStorageSync();
uni.showToast({
title:'信息错误请重新登录',
icon:'none'
})
setTimeout(()=>{
uni.reLaunch({
url: '/pages/login/login'
})
},1000)
// uni.clearStorageSync();
// uni.showToast({
// title:'信息错误请重新登录',
// icon:'none'
// })
// setTimeout(()=>{
// uni.reLaunch({
// url: '/pages/login/login'
// })
// },1000)
}
// 请求错误处理
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 headers = {};
switch (method) {
@ -79,58 +92,151 @@ const request = (method, url, options) => {
break;
}
return new Promise((resolve, reject) => {
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/';
if(ifLogin) {
var date = new Date();
var timestamp = date.getTime();//精确到毫秒
// 如果过期时间 减 10分钟 小于当前时间刷新token
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
// token已失效
urls.push(url);
if(urls.length<=1) {
// 调用登录事件
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post',
data: params,
success: res => {
console.log(114);
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
timer = setInterval(()=>{
if((uni.getStorageSync('expire')*1000 - 600000) > timestamp) {
clearInterval(timer);
if(urls.length) {
urls.forEach(item=>{
uni.request({
url: `${hostapi}${item}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${item}返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
resolve(res.data)
} else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
checkError(res)
}
} else if(res.statusCode==500) {
// goLogin();
} else {
checkError(res)
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
})
}
}
},100)
}
}
})
},
});
}
} else {
// 快到token失效时间了
uni.request({
url: `${hostapi}${url}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${url}返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
resolve(res.data)
} else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
checkError(res)
}
} else if(res.statusCode==500) {
// goLogin();
} else {
checkError(res)
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
}
// #endif
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 {
// 不需要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 {
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);
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
})
}
})
}
// 上传文件 封装请求
const uploadFile = (url, options) => {
let tempData = options || {}
return new Promise((resolve, reject) => {
uni.uploadFile({
url: `${uni.getStorageSync('hostapi')}${url}`,
url: `${hostapi}${url}`,
filePath: tempData.file,
name: 'image',
fileType:'image',
@ -174,19 +280,19 @@ const uploadFile = (url, options) => {
export default {
get: (url, options) => {
return request('get', url, options)
get: (url, options, ifLogin=true) => {
return request('get', url, options, ifLogin)
},
// JOSN格式
post: (url, options) => {
return request('post', url, options)
post: (url, options, ifLogin=true) => {
return request('post', url, options, ifLogin)
},
// form-data格式
postForm: (url, options) => {
return request('postForm', url, options)
postForm: (url, options, ifLogin=true) => {
return request('postForm', url, options, ifLogin)
},
// 上传
upload: (url, options) => {
return uploadFile(url, options)
upload: (url, options, ifLogin=true) => {
return uploadFile(url, options, ifLogin)
}
}

View File

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

View File

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

View File

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

View File

@ -152,7 +152,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
ccurrent:0,
cateList:[],
cateListTwo:[//
@ -173,8 +172,6 @@
category_id:'',//ID
disease_id:'',//ID
bannerList:[],
titleList:[],
imgList:[],
zanArr:[],
dataShopList:[],
timeList:[],
@ -182,6 +179,20 @@
isAutoPlay:false,
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
@ -222,46 +233,6 @@
if(this.ccurrent==0) {
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: {

View File

@ -157,12 +157,11 @@
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
import {checkBanner} from '@/jsFile/publicAPI.js';
import {checkBanner,themeEv} from '@/jsFile/publicAPI.js';
export default {
data() {
return {
statusHNH:uni.getSystemInfoSync().statusBarHeight + 54,
publicColor:uni.getStorageSync('publicColor'),
tongList:[
{num:'0',title:'我的积分'},
{num:'0',title:'孔雀币'},
@ -211,8 +210,6 @@
is_doctor:'',//01
is_servicer:'',//01
is_staff:'',//01
titleList:[],
imgList:[],
isQian:false,
bannerList:[],
guangImg:'',
@ -234,52 +231,26 @@
let pages = getCurrentPages();
// console.log('pages:',pages);
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() {
uni.removeStorageSync('uinfo')//
this.$toolAll.tools.isLogin();
uni.removeStorageSync('shareAll')//
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
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() {

View File

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

View File

@ -172,10 +172,7 @@
},
data() {
return {
titleList:[],
imgList:[],
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),
activeIndex:'-1',
shopCate:['全部分类','全部医生','全部活动'],
cateTitle:'',
@ -209,17 +206,26 @@
gaodu:0
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onHide() {
this.isAutoPlay = false;
},
onUnload() {
this.isAutoPlay = false;
},
onShow() {
this.$toolAll.tools.isLogin();
this.cartNumEv();//
this.isAutoPlay = true;
},
onPageScroll(e) {
if(e.scrollTop>=242){
this.positionMode = "fixed";
@ -229,6 +235,13 @@
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) {
this.optionObj = options;
// +
@ -246,46 +259,6 @@
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
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: {

View File

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

View File

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

View File

@ -179,7 +179,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isExpress:false,
switchQuan:true,
showQuan:false,//
@ -227,6 +226,12 @@
payType:''// wechat=;coin=;hybrid=
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() {
//
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() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
activeJF:true,
dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
@ -90,10 +89,8 @@
this.$toolAll.tools.isLogin();
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkInfo();
this.checkList();
}
this.checkInfo();
this.checkList();
},
methods: {
checkList(){//

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
chuTop:'',//
activeIndex:'',
statusList:['全部','待付款','待发货','待核验','待收货','已完成'],
@ -151,10 +150,18 @@
timeList:[],
orderInfo:{},
checkGrounpId:0,
titleList:[],//tab
imgList:[],//tab
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
},
onShareAppMessage(res) {
  return false;
},
@ -174,10 +181,8 @@
//
this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkZT(this.activeIndex);
this.checkList(this.activeIndex);
}
this.checkZT(this.activeIndex);
this.checkList(this.activeIndex);
},
onLoad(options) {
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
@ -186,46 +191,6 @@
// console.log('+',rect);
this.chuTop = rect.height
}).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: {
comeing(coding){

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -77,7 +77,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:false,
category:'',
tname:'',//
@ -88,8 +87,20 @@
xialCurrent:0,
xialone:[],
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() {
@ -99,46 +110,6 @@
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkCate();
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: {

View File

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

View File

@ -67,7 +67,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
headImg:'/static/public/like.png',
name:'恒美植发',
time:'2021-07-14 08:22',
@ -88,6 +87,12 @@
shareImg:''//
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onShareAppMessage(res) {
var ya = this;
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() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
imgSrc:'',
isBtn:false
}

View File

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

View File

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

View File

@ -54,7 +54,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[
// {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
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,17 +44,24 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:true,
imgList:uni.getStorageSync('imgSrcList'),
imgSrc:'',
showBtn:false,
isHaib:false,
titleList:[],//tab
tabimgList:[],//tab
shareFlag:true//
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
tabimgList() {
return this.$store.state.imgList
},
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.$toolAll.tools.isLogin() ;
@ -62,46 +69,6 @@
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//
else this.imgList = []
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: {

View File

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

View File

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

View File

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

View File

@ -40,7 +40,6 @@
data() {
return {
statusHNH:uni.getStorageSync('electric_nav_height'),
publicColor:uni.getStorageSync('publicColor'),//
isShowT:false,
imgSrc:'/static/public/shareh.png',
dataList:[
@ -49,11 +48,19 @@
{num:'0',title:'分享订单'},
],
imgSrcP:uni.getStorageSync('imgSrcP'),
titleList:[],//tab
imgList:[],//tab
shareFlag:true
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
},
onShareAppMessage(options) {
var ya = this;
   var shareObj = {
@ -78,49 +85,11 @@
  };
  return shareObj;
},
onShow() {
this.$toolAll.tools.isLogin();
},
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
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: {
shareEv(){//

View File

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

View File

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

View File

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