Compare commits
2 Commits
ece7767727
...
9aa289a172
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9aa289a172 | ||
![]() |
7f92f9b9e7 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,3 +2,5 @@
|
|||||||
unpackage/*
|
unpackage/*
|
||||||
unpackage
|
unpackage
|
||||||
.idea
|
.idea
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
// baseUrl: 'https://www.nuoyunr.com',
|
// baseUrl: 'https://www.nuoyunr.com',
|
||||||
baseUrl: 'http://127.0.0.1:48080',
|
baseUrl: 'http://127.0.0.1:48080',
|
||||||
|
// baseUrl: 'http://192.168.1.31:48080',
|
||||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||||
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
||||||
wsUrl: 'wss://www.nuoyunr.com',
|
wsUrl: 'wss://www.nuoyunr.com',
|
||||||
|
15
package-lock.json
generated
15
package-lock.json
generated
@ -5,12 +5,13 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"rich-text-parser": "^1.0.2",
|
||||||
"uview-ui": "^2.0.36",
|
"uview-ui": "^2.0.36",
|
||||||
"weapp-qrcode": "^1.0.0"
|
"weapp-qrcode": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.79.3",
|
||||||
"sass-loader": "^10.4.1"
|
"sass-loader": "^10.5.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jridgewell/gen-mapping": {
|
"node_modules/@jridgewell/gen-mapping": {
|
||||||
@ -731,6 +732,11 @@
|
|||||||
"url": "https://paulmillr.com/funding/"
|
"url": "https://paulmillr.com/funding/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/rich-text-parser": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/rich-text-parser/-/rich-text-parser-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-fv6Piuikqf0PCuFGfFMtfOdc9fWE/HoSxi4gkDawco/NDKHfR6W5t1/t7Lh0pySf3GkV/rVcgAp/LKx8ZMwjuw=="
|
||||||
|
},
|
||||||
"node_modules/safe-buffer": {
|
"node_modules/safe-buffer": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
@ -1682,6 +1688,11 @@
|
|||||||
"integrity": "sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==",
|
"integrity": "sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"rich-text-parser": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/rich-text-parser/-/rich-text-parser-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-fv6Piuikqf0PCuFGfFMtfOdc9fWE/HoSxi4gkDawco/NDKHfR6W5t1/t7Lh0pySf3GkV/rVcgAp/LKx8ZMwjuw=="
|
||||||
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"rich-text-parser": "^1.0.2",
|
||||||
"uview-ui": "^2.0.36",
|
"uview-ui": "^2.0.36",
|
||||||
"weapp-qrcode": "^1.0.0"
|
"weapp-qrcode": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"sass": "^1.79.3",
|
"sass": "^1.79.3",
|
||||||
"sass-loader": "^10.5.2"
|
"sass-loader": "^10.5.2",
|
||||||
|
"rich-text-parser": "^1.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import {getUserInfoRequest} from "@/utils/common.js";
|
|
||||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
VNavigationBar,
|
VNavigationBar,
|
||||||
@ -43,14 +41,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow(data) {
|
onShow(data) {
|
||||||
if(!getToken()){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
console.log("已登录")
|
|
||||||
this.getUserInfos()
|
|
||||||
}
|
|
||||||
this.customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
this.customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
||||||
this.getActive()
|
this.getActive()
|
||||||
},
|
},
|
||||||
@ -58,10 +48,7 @@ export default {
|
|||||||
this.getActive()
|
this.getActive()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取当前登录用户信息
|
|
||||||
async getUserInfos() {
|
|
||||||
getUserInfoRequest()
|
|
||||||
},
|
|
||||||
//查询营销活动列表
|
//查询营销活动列表
|
||||||
async getActive() {
|
async getActive() {
|
||||||
let customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
let customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
||||||
|
@ -2,21 +2,39 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<web-view :src="richTextHtml"></web-view>
|
<VNavigationBar titleColor="rgba(0,0,0,0.9)" backgroundColor="#fff" title="活动内容"></VNavigationBar>
|
||||||
|
<!-- <!– #ifdef MP-WEIXIN –>-->
|
||||||
|
<!-- <v-navigation-bar background-color="rgba(255,255,255,1)" title-color="rgba(0,0,0,0)" title="活动内容"></v-navigation-bar>-->
|
||||||
|
<!-- <!– #endif –>-->
|
||||||
|
<!-- <web-view :src="richTextHtml"></web-view>-->
|
||||||
|
<div class="body">
|
||||||
|
<rich-text style="width: 100%" :nodes="richTextHtml | formatRichText" />
|
||||||
|
</div>
|
||||||
|
<view class="fixed-button" @click="toActivity">参与<br/>活动</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from "../../utils/request";
|
import request from "../../utils/request";
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
|
import parser from 'rich-text-parser'
|
||||||
|
import VNavigationBar from "../../components/VNavigationBar.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "content",
|
name: "content",
|
||||||
|
components: {VNavigationBar},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
richTextHtml: ''
|
richTextHtml: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
formatRichText(html) { // 控制小程序中图片大小
|
||||||
|
console.log(html)
|
||||||
|
const nodes = parser.getRichTextJson(html)
|
||||||
|
return nodes.children
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
const id = data.id;
|
const id = data.id;
|
||||||
this.getRichTextHtml(id)
|
this.getRichTextHtml(id)
|
||||||
@ -29,19 +47,58 @@ export default {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
const data = res.data
|
const data = res.data
|
||||||
this.richTextHtml = data.content.replace(/(<img[^>]+src=")([^":]*?)(")/g, (match, p1, p2, p3) => {
|
this.richTextHtml = data.content
|
||||||
return `${p1}${config.baseImageUrl}/${p2}${p3}`;
|
// this.richTextHtml = data.content.replace(/(<img[^>]+src=")([^":]*?)(")/g, (match, p1, p2, p3) => {
|
||||||
});
|
// return `${p1}${config.baseImageUrl}/${p2}${p3}`;
|
||||||
this.richTextHtml = `data:text/html;charset=utf-8,${encodeURIComponent(this.richTextHtml)}`
|
// });
|
||||||
|
// this.richTextHtml = `data:text/html;charset=utf-8,${encodeURIComponent(this.richTextHtml)}`
|
||||||
}catch {}
|
}catch {}
|
||||||
|
},
|
||||||
|
// TODO 参与活动
|
||||||
|
toActivity(){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.body{
|
||||||
|
flex: 1;
|
||||||
|
height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
img{
|
img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
.fixed-button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 3rem; /* 距离底部的距离 */
|
||||||
|
right: 2rem; /* 距离右边的距离 */
|
||||||
|
z-index: 1000; /* 确保按钮在其他元素之上 */
|
||||||
|
width: 80px; /* 按钮直径 */
|
||||||
|
height: 80px; /* 按钮直径 */
|
||||||
|
background-color: #f00; /* 按钮背景颜色 */
|
||||||
|
color: #fff; /* 文字颜色 */
|
||||||
|
border-radius: 50%; /* 圆形 */
|
||||||
|
display: flex; /* 使用弹性盒子布局 */
|
||||||
|
justify-content: center; /* 水平居中文本 */
|
||||||
|
align-items: center; /* 垂直居中文本 */
|
||||||
|
font-size: 18px; /* 字体大小 */
|
||||||
|
text-align: center; /* 文字水平居中 */
|
||||||
|
line-height: normal; /* 使用默认行高 */
|
||||||
|
font-family: 'Arial', sans-serif; /* 选择字体 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 为了确保文本垂直居中并且分行 */
|
||||||
|
.fixed-button br {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,7 +4,19 @@
|
|||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="body-top-banner">
|
<view class="body-top-banner">
|
||||||
<!-- <image class="banner" src="@/static/images/banner.jpg" mode="aspectFit" />-->
|
<!-- <image class="banner" src="@/static/images/banner.jpg" mode="aspectFit" />-->
|
||||||
<image class="banner" v-for="banner in bannerList" :key="banner.id" :src="banner.url" @click="toContent(banner.id)" mode="scaleToFill" />
|
<!-- <image class="banner" v-for="banner in bannerList" :key="banner.id" :src="banner.url" @click="toContent(banner.id)" mode="scaleToFill" />-->
|
||||||
|
<swiper class="swiper" circular indicator-dots="true" autoplay="true" interval="2000"
|
||||||
|
duration="500">
|
||||||
|
<swiper-item v-for="banner in bannerList" :key="banner.id" @click="toContent(banner.id)">
|
||||||
|
<image class="banner" :src="banner.url" mode="scaleToFill" />
|
||||||
|
</swiper-item>
|
||||||
|
<!-- <swiper-item>-->
|
||||||
|
<!-- <view class="swiper-item uni-bg-green">B</view>-->
|
||||||
|
<!-- </swiper-item>-->
|
||||||
|
<!-- <swiper-item>-->
|
||||||
|
<!-- <view class="swiper-item uni-bg-blue">C</view>-->
|
||||||
|
<!-- </swiper-item>-->
|
||||||
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class="menus">
|
<view class="menus">
|
||||||
<view @click="gotoPage(menu)" v-for="(menu, index) in menus" :key="index" class="menu-item">
|
<view @click="gotoPage(menu)" v-for="(menu, index) in menus" :key="index" class="menu-item">
|
||||||
@ -23,7 +35,7 @@
|
|||||||
<image class="more-icon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
|
<image class="more-icon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="repairShop">
|
<view class="repairShop">
|
||||||
<view class="title">附近修理厂</view>
|
<view class="title">推荐修理厂</view>
|
||||||
<view class="shopList">
|
<view class="shopList">
|
||||||
<view v-for="(item, index) in shopList" :key="index" class="shopItem" @click="gotoShopDetail(item)">
|
<view v-for="(item, index) in shopList" :key="index" class="shopItem" @click="gotoShopDetail(item)">
|
||||||
<image class="shopImg" :src="item.image" mode="aspectFill"></image>
|
<image class="shopImg" :src="item.image" mode="aspectFill"></image>
|
||||||
|
@ -146,6 +146,8 @@
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uni.checkSession({
|
uni.checkSession({
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.request({
|
uni.request({
|
||||||
@ -155,17 +157,21 @@
|
|||||||
code: uni.getStorageSync('c1'),
|
code: uni.getStorageSync('c1'),
|
||||||
encryptedIv: e.detail.iv,
|
encryptedIv: e.detail.iv,
|
||||||
encryptedData: e.detail.encryptedData,
|
encryptedData: e.detail.encryptedData,
|
||||||
inviteId: uni.getStorageSync('inviteId') ? uni.getStorageSync('inviteId') : null
|
inviteId: uni.getStorageSync('inviteId')?uni.getStorageSync('inviteId'):null
|
||||||
},
|
},
|
||||||
success: (rex) => {
|
success: (rex) => {
|
||||||
|
|
||||||
if (rex.data.code == 0) {
|
if (rex.data.code == 0) {
|
||||||
//设置token
|
if (this.loginStatus) {
|
||||||
setToken(rex.data.data.token)
|
clearInterval(this.loginStatus)
|
||||||
if (rex.data.data.ifNeedFill) {
|
}
|
||||||
uni.reLaunch({
|
uni.setStorageSync('App-Token', rex.data.data.token);
|
||||||
url: '/pages/my/register'
|
if (this.returnUrl) {
|
||||||
})
|
|
||||||
|
uni.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
|
//this.userinfo()
|
||||||
|
console.log('跳转');
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
@ -195,7 +201,10 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
userinfo(){
|
userinfo(){
|
||||||
console.log('执行了');
|
console.log('执行了');
|
||||||
request({
|
request({
|
||||||
@ -219,6 +228,17 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// let roles=[];
|
||||||
|
// let jcshopRole = false;
|
||||||
|
// let jcgfRole = false;
|
||||||
|
// roles.forEach(it->{
|
||||||
|
// if(it=='jcshop'){
|
||||||
|
// jcshopRole = true
|
||||||
|
// }
|
||||||
|
// if(it=='jcgf'){
|
||||||
|
// jcgfRole = true
|
||||||
|
// }
|
||||||
|
// })
|
||||||
getxz(index){
|
getxz(index){
|
||||||
this.activeid = index
|
this.activeid = index
|
||||||
},
|
},
|
||||||
|
@ -65,20 +65,14 @@
|
|||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import {getUserInfoRequest} from "@/utils/common.js";
|
import {getToken} from '@/utils/auth.js'
|
||||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tabBarVue,
|
tabBarVue,
|
||||||
VNavigationBar
|
VNavigationBar
|
||||||
},
|
},
|
||||||
onShow(data) {
|
onShow(data) {
|
||||||
if(!getToken()){
|
if(getToken()){
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
console.log("已登录")
|
|
||||||
this.getServer()
|
this.getServer()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -111,8 +105,21 @@
|
|||||||
},
|
},
|
||||||
//获取当前登录用户信息
|
//获取当前登录用户信息
|
||||||
async getServer() {
|
async getServer() {
|
||||||
console.log("获取用户信息")
|
const res = await request({
|
||||||
this.customInfo = getUserInfoRequest()
|
url: "/userClient/customer/getUserCustomer",
|
||||||
|
method: 'get',
|
||||||
|
params:{}
|
||||||
|
})
|
||||||
|
if(!res.data){
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/register'
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.customInfo = res.data
|
||||||
|
uni.setStorageSync('customerInfo', JSON.stringify(this.customInfo))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<view class="top_Bar">
|
<view class="top_Bar">
|
||||||
<uni-icons @click="goHome()" size="24" type="left"
|
<uni-icons @click="goHome()" size="24" type="left"
|
||||||
color="#000" style="margin-left: 10px;" ></uni-icons>
|
color="#000" style="margin-left: 10px;" ></uni-icons>
|
||||||
<view class="title_top">完善会员信息</view>
|
<view class="title_top">注册会员</view>
|
||||||
<view style="width: 24px;height: 24px;"></view>
|
<view style="width: 24px;height: 24px;"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="body">
|
<view class="body">
|
||||||
@ -39,12 +39,12 @@
|
|||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="formItem">-->
|
<view class="formItem">
|
||||||
<!-- <view class="formLabel">手机号</view>-->
|
<view class="formLabel">手机号</view>
|
||||||
<!-- <view class="formContainer">-->
|
<view class="formContainer">
|
||||||
<!-- <input placeholder="请填写你的手机号" v-model="formData.phoneNumber" type="text"/>-->
|
<input placeholder="请填写你的手机号" v-model="formData.phoneNumber" type="text"/>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">联系地址</view>
|
<view class="formLabel">联系地址</view>
|
||||||
<view class="formContainer">
|
<view class="formContainer">
|
||||||
@ -52,7 +52,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="dl" @click="getlogin()">
|
<view class="dl" @click="getlogin()">
|
||||||
<text>保存</text>
|
<text>注册</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -77,7 +77,7 @@ export default {
|
|||||||
sex: "",
|
sex: "",
|
||||||
idCard:"",
|
idCard:"",
|
||||||
birthday:"请选择你的生日",
|
birthday:"请选择你的生日",
|
||||||
// phoneNumber:"",
|
phoneNumber:"",
|
||||||
address:"",
|
address:"",
|
||||||
},
|
},
|
||||||
//性别
|
//性别
|
||||||
@ -153,13 +153,13 @@ export default {
|
|||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
|
if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
|
||||||
// uni.showToast({
|
uni.showToast({
|
||||||
// title: '请填写手机号',
|
title: '请填写手机号',
|
||||||
// icon: 'none'
|
icon: 'none'
|
||||||
// })
|
})
|
||||||
// return false
|
return false
|
||||||
// }
|
}
|
||||||
if(""==this.formData.address){
|
if(""==this.formData.address){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请填写联系地址',
|
title: '请填写联系地址',
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||||
import request from "../../utils/request";
|
import request from "../../utils/request";
|
||||||
import config from "config";
|
import config from "config";
|
||||||
import {getUserInfoRequest} from "@/utils/common.js";
|
|
||||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
@ -56,23 +54,11 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(!getToken()){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
console.log("已登录")
|
|
||||||
this.getUserInfos()
|
|
||||||
}
|
|
||||||
// 页面显示时执行初始化操作
|
// 页面显示时执行初始化操作
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取当前登录用户信息
|
|
||||||
async getUserInfos() {
|
|
||||||
console.log("获取用户信息")
|
|
||||||
getUserInfoRequest()
|
|
||||||
},
|
|
||||||
getList(){
|
getList(){
|
||||||
request({
|
request({
|
||||||
url: '/userClient/base/myCar/get',
|
url: '/userClient/base/myCar/get',
|
||||||
|
@ -102,8 +102,6 @@
|
|||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import config from "@/config";
|
import config from "@/config";
|
||||||
import {getUserInfoRequest} from "@/utils/common.js";
|
|
||||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -188,23 +186,10 @@
|
|||||||
this.getServer(this.info.id)
|
this.getServer(this.info.id)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(!getToken()){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
console.log("已登录")
|
|
||||||
this.getUserInfos()
|
|
||||||
}
|
|
||||||
this.initCarList()
|
this.initCarList()
|
||||||
this.initDateList()
|
this.initDateList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取当前登录用户信息
|
|
||||||
async getUserInfos() {
|
|
||||||
console.log("获取用户信息")
|
|
||||||
getUserInfo()
|
|
||||||
},
|
|
||||||
initDateList(){
|
initDateList(){
|
||||||
const daysOfWeek = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
const daysOfWeek = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||||
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
|
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import {getUserInfoRequest} from "@/utils/common.js";
|
|
||||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -48,21 +46,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(!getToken()){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
console.log("已登录")
|
|
||||||
this.getUserInfos()
|
|
||||||
}
|
|
||||||
this.getBookingPage()
|
this.getBookingPage()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取当前登录用户信息
|
|
||||||
async getUserInfos() {
|
|
||||||
getUserInfoRequest()
|
|
||||||
},
|
|
||||||
async getBookingPage(){
|
async getBookingPage(){
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: "/userClient/repair/booking/page",
|
url: "/userClient/repair/booking/page",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
const TokenKey = 'App-Token'
|
const TokenKey = 'App-Token'
|
||||||
const UserInfo = 'customerInfo'
|
|
||||||
const TenantIdKey = 'TENANT_ID'
|
const TenantIdKey = 'TENANT_ID'
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
return uni.getStorageSync(TokenKey)
|
return uni.getStorageSync(TokenKey)
|
||||||
@ -30,11 +29,3 @@ export function hasRole(roleCode) {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUserInfo() {
|
|
||||||
return uni.getStorageSync(UserInfo)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setUserInfo(userInfo) {
|
|
||||||
return uni.setStorageSync(UserInfo, userInfo)
|
|
||||||
}
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import request from "@/utils/request";
|
|
||||||
import {setUserInfo} from '@/utils/auth.js'
|
|
||||||
/**
|
/**
|
||||||
* 显示消息提示框
|
* 显示消息提示框
|
||||||
* @param content 提示的标题
|
* @param content 提示的标题
|
||||||
@ -54,23 +52,3 @@ export function tansParams(params) {
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户信息
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
export async function getUserInfoRequest(){
|
|
||||||
const res = await request({
|
|
||||||
url: "/userClient/customer/getUserCustomer",
|
|
||||||
method: 'get',
|
|
||||||
params:{}
|
|
||||||
})
|
|
||||||
if(!res.data){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/my/register'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
setUserInfo(JSON.stringify(res.data))
|
|
||||||
return res.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -13,6 +13,8 @@ const request = config => {
|
|||||||
config.header = config.header || {}
|
config.header = config.header || {}
|
||||||
if (getToken() && !isToken) {
|
if (getToken() && !isToken) {
|
||||||
config.header['Authorization'] = 'Bearer ' + getToken()
|
config.header['Authorization'] = 'Bearer ' + getToken()
|
||||||
|
}else{
|
||||||
|
config.header['Authorization'] = 'Bearer ' +'6e753c0a509e4d01bde4f315f6a39ceb'
|
||||||
}
|
}
|
||||||
// get请求映射params参数
|
// get请求映射params参数
|
||||||
if (config.params) {
|
if (config.params) {
|
||||||
|
Loading…
Reference in New Issue
Block a user