添加vuex状态机控制主题色和底部导航、修改request.js请求接口
parent
07360c6ad8
commit
5bec64ceec
26
App.vue
26
App.vue
|
@ -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: '更新提示',
|
||||
|
|
|
@ -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)
|
||||
// })
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
226
jsFile/requst.js
226
jsFile/requst.js
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
7
main.js
7
main.js
|
@ -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()
|
||||
|
|
|
@ -67,15 +67,6 @@
|
|||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "immediatePayment/immediatePayment",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "member/member",
|
||||
|
|
|
@ -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 => {})
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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:'',//是否为医生,0否,1是
|
||||
is_servicer:'',//是否为客服,0否,1是
|
||||
is_staff:'',//是否为普通员工,0否,1是
|
||||
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() {
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('electric_nav_height'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isScreenshot:false,
|
||||
upImg:'',
|
||||
chooseIndex:0,
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('electric_nav_height'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
chuTop:'',
|
||||
navList:['未使用','已使用','可领取','已过期'],
|
||||
isStatus:0,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>
|
|
@ -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(){//查询积分列表
|
||||
|
|
|
@ -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++
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
|
|
@ -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++
|
||||
|
|
|
@ -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){//返回到订单准备页
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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(){//确定提现事件、
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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'},
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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=>{})
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('electric_nav_height'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
imgSrc:'',
|
||||
isBtn:false
|
||||
}
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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(){//查询一二级分享总人数
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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++
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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(){//分享事件
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue