Commit ca5bd637 authored by 刘文虎's avatar 刘文虎

环境配置

parent 7871fa46
Pipeline #2713 canceled with stages
// 废弃
const UNI_APP = {
apiUrl: 'https://api.weixin.qq.com',
qn_base_url: 'https://qn-static.kaying.cc/camp/',
qn_asset_url: 'https://qn-static.banshouhui.com/',
socket_url: 'wss://api-fans-test.banshouhui.com/',
pc_url: 'https://fans.kaying.cc',
argoDebugMode: 1,
version: 'v1.0.0',
}
module.exports = UNI_APP
;(function() {
let NODE_ENV = 'test' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION = 'v1.0.0'
if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js')
} else if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js')
} else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js')
}
} else if (process.env.NODE_ENV === 'production') {
if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js')
} else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js')
}
}
if (ENV_VAR) {
process.uniEnv = {}
process.uniEnv['node_env'] = NODE_ENV
process.uniEnv['versionName'] = VERSION
for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]
}
}
})()
const UNI_APP = {
apiUrl: 'https://api2-fans.kaying.cc/',
qn_base_url: 'https://qn-static.kaying.cc/camp/',
qn_asset_url: 'https://qn-static.banshouhui.com/',
socket_url: 'wss://api2-fans.kaying.cc/',
pc_url: 'https://fans.kaying.cc',
argoDebugMode: 0,
version: 'v1.0.0',
}
module.exports = UNI_APP
const UNI_APP = {
apiUrl: 'https://api-fans-test.banshouhui.com',
qn_base_url: 'https://qn-static.kaying.cc/camp/',
qn_asset_url: 'https://qn-static.banshouhui.com/',
socket_url: 'wss://api-fans-test.banshouhui.com/',
pc_url: 'https://fans.kaying.cc',
argoDebugMode: 1,
version: 'v1.0.0',
}
module.exports = UNI_APP
<template>
<u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
<view class="">
<u-tabbar :list="tabbar" :mid-button="true" :before-switch="beforeSwitch"></u-tabbar>
<!-- <mid-popup ref='mid-popup'></mid-popup> -->
<u-popup v-model="show" mode="top">
<view class="">
<view>出淤泥而不染,濯清涟而不妖</view>
<view>出淤泥而不染,濯清涟而不妖</view>
<view>出淤泥而不染,濯清涟而不妖</view>
<view>出淤泥而不染,濯清涟而不妖</view>
<view>出淤泥而不染,濯清涟而不妖</view>
<view>出淤泥而不染,濯清涟而不妖</view>
</view>
</u-popup>
</view>
</template>
<script>
import {tabbar} from "@/utils/settings.js"
export default {
name:"lw-tabbar",
data() {
return {
tabbar
};
import MidPopup from '../mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
export default {
name: 'lw-tabbar',
components: {
MidPopup
},
data() {
return {
tabbar,
show: false
};
},
methods: {
beforeSwitch(index) {
console.log(index)
if (index === 2) {
// this.$refs["mid-popup"].open()
// this.$emit("midClick")
this.show=true
return false;
}else{
// this.show=false
}
return true;
}
}
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<style lang="scss" scoped></style>
<template>
<u-popup v-model="show" border-radius="24" safe-area-inset-bottom mode="bottom">
<view class="mid-popup">
<u-row gutter="16" >
<u-col span="4" v-for="(item,index) in list" :key="index">
<view class="button-view">
<view class="button-view-background">
<image src="../../static/image/index/photo.png" mode=""></image>
</view>
<view class="button-view-content">{{item.label}}</view>
</view>
</u-col>
</u-row>
<view class="close">
<view class="close-button" @click="close">
X
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
name: 'mid-popup',
data() {
return {
show: false,
list: [
{
label: '记行程',
path: '',
icon: ''
},
{
label: '维修帐',
path: '',
icon: ''
},
{
label: '日常帐',
path: '',
icon: ''
}
]
};
},
methods: {
open() {
this.show = true;
},
close(){
this.show = false;
}
}
};
</script>
<style lang="scss" scoped>
.mid-popup {
padding: 20upx;
.button-view{
height: 200upx;
height: 200upx;
display: flex;
justify-content: center;
align-items: center;
position: relative;
&-background{
position: absolute;
z-index: 1;
width: 120upx;
height: 120upx;
}
&-content{
position: relative;
z-index: 2;
color: #ffffff;
}
}
.close{
display: flex;
align-items: center;
justify-content: center;
&-button{
width: 100upx;
height: 100upx;
background-color: #cccccc;
text-align: center;
line-height: 100upx;
color: #ffffff;
border-radius: 50%;
font-size: 48upx;
}
}
}
</style>
<template>
<view class="navbar-custom">
<u-navbar
:back-icon-color="backIconColor"
:background="background"
:title="title || ' '"
:titleColor="titleColor"
:border-bottom="borderBottom"
title-bold
:is-back="isBack"
:custom-back="goBack"
>
<view class="left-content">
<view class="left-text" :style="'color:' + titleColor" v-if="left.title">{{ left.title }}</view>
<view hover-class="u-hover-class" @click="handleClickLeft" class="left-button-view">
<view v-if="left.imageUrl" class="left-button" :style="{ backgroundColor: left.backgroundColor }">
<image :src="left.imageUrl" mode="widthFix" class="left-image"></image>
</view>
<view class="right-text" :style="'color:' + titleColor" v-if="left.rightTitle">{{ left.rightTitle }}</view>
</view>
</view>
<view v-if="right.length" slot="right" class="right-content">
<view v-for="(item, index) in right" :style="item.style" class="right-button" :key="index">
<view @click="handleClickRight(index)" hover-class="u-hover-class">
<view v-if="item.red" class="red-dot"></view>
<image :src="item.imageUrl" mode="widthFix" class="right-image" :style="item.style || { backgroundColor: item.backgroundColor }"></image>
</view>
</view>
</view>
</u-navbar>
</view>
</template>
<script>
import NavbarNormal from '@/components/navbar-normal';
export default {
components: {
NavbarNormal
},
props: {
// 导航栏标题
title: {
type: String,
default: ''
},
titleColor: {
type: String,
default: '#191C27'
},
// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
background: {
type: Object,
default() {
return {
background: 'transparent'
};
}
},
// 返回箭头的颜色
backIconColor: {
type: String,
default: '#333333'
},
// 是否显示导航栏的下边框
borderBottom: {
type: Boolean,
default: false
},
isBack: {
type: [Boolean, String],
default: false
},
// 自定义返回逻辑
customBack: {
type: Function,
default() {
return () => {
if (getCurrentPages().length == 1) {
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.navigateBack();
}
};
}
},
right: {
type: Array,
default() {
return [
{
title: '',
imageUrl: '',
path: ''
}
];
}
},
left: {
type: Object,
default() {
return {
title: '',
imageUrl: ''
};
}
}
},
data() {
return {};
},
computed: {},
created() {},
methods: {
handleClickLeft() {
console.log('click left');
this.$emit('leftClick');
},
handleClickRight(index) {
console.log('click right:', index);
this.$emit('rightClick', index);
},
goBack() {
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
if (typeof this.customBack === 'function') {
// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
this.customBack.bind(this.$u.$parent.call(this))();
} else {
uni.navigateBack();
}
}
}
};
</script>
<style lang="scss" scoped>
.navbar-custom {
.left-content {
min-width: 120rpx;
display: flex;
align-content: center;
.left-text {
display: flex;
align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #191c27;
max-width: 280rpx;
white-space: nowrap;
padding-right: 44rpx;
text-overflow: ellipsis;
overflow: hidden;
}
.left-button-view {
display: flex;
align-items: center;
.left-button {
margin-left: 32rpx;
width: 64rpx;
// height: 64rpx;
border-radius: 24rpx;
.left-image {
width: 64rpx;
height: 64rpx;
// border-radius: 24rpx;
}
}
.right-text {
display: flex;
align-content: center;
align-items: center;
margin-left: 16rpx;
color: #333;
font-size: 28rpx;
}
}
}
.right-content {
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: 2rpx;
.right-button {
width: 64rpx;
// height: 64rpx;
margin-right: 16rpx;
position: relative;
.red-dot {
position: absolute;
right: 8rpx;
top: -4rpx;
border-radius: 8rpx;
width: 16rpx;
height: 16rpx;
background-color: #e54b46;
}
.right-image {
width: 64rpx;
height: 64rpx;
// border-radius: 24rpx;
}
}
}
}
</style>
This diff is collapsed.
import App from './App'
// 引入 .env.js 文件
import '.env.js'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
......
......@@ -50,9 +50,10 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"appid" : "wx4101d2c19dfc7aab",
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"minified" : true
},
"usingComponents" : true
},
......
export default {
components: {
MidPopup
},
data() {
return {
tabbar,
}
},
methods: {
}
}
{
"name": "digital-key",
"name": "account-book",
"version": "1.0.0",
"description": "",
"main": "main.js",
......@@ -10,7 +10,12 @@
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "npm run dev:h5",
"build": "npm run build:h5",
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --minimize --watch",
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
},
"repository": {
"type": "git",
......
......@@ -6,31 +6,32 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
}, {
"path": "pages/index/schedule",
"path": "pages/index/schedule/schedule",
"style": {
"navigationBarTitleText": "行程",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/account",
"path": "pages/index/account/account",
"style": {
"navigationBarTitleText": "记账",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/bill",
"path": "pages/index/bill/bill",
"style": {
"navigationBarTitleText": "账单",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/mine",
"path": "pages/index/mine/mine",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
......@@ -40,7 +41,7 @@
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
......@@ -55,22 +56,22 @@
"selectedIconPath": "/static/image/index/service_click@2x.png",
"text": "首页"
}, {
"pagePath": "pages/index/schedule",
"pagePath": "pages/index/schedule/schedule",
"iconPath": "/static/image/index/control_car_gray@2x.png",
"selectedIconPath": "/static/image/index/control_car_click@2x.png",
"text": "行程"
}, {
"pagePath": "pages/index/account",
"pagePath": "pages/index/account/account",
"iconPath": "/static/image/index/tianj@2x.png",
"selectedIconPath": "/static/image/index/tianj@2x.png",
"text": ""
}, {
"pagePath": "pages/index/bill",
"pagePath": "pages/index/bill/bill",
"iconPath": "/static/image/index/service_unclick@2x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png",
"text": "账单"
}, {
"pagePath": "pages/index/mine",
"pagePath": "pages/index/mine/mine",
"iconPath": "/static/image/index/personal_center_unclick@2x.png",
"selectedIconPath": "/static/image/index/personal_center_click@2x.png",
"text": "我的"
......
<template>
<view>
<!-- <lw-tabbar></lw-tabbar> -->
<u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
<script>
import LwTabbar from "@/components/lw-tabbar/lw-tabbar.vue"
import {tabbar} from "@/utils/settings.js"
export default {
components:{
LwTabbar
},
data() {
return {
tabbar
};
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
<script>
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
export default {
components: {
MidPopup
},
data() {
return {
tabbar
};
},
methods: {
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
return false;
}
return true;
}
}
};
</script>
<style lang="scss" scoped></style>
<template>
<view>
<!-- <lw-tabbar></lw-tabbar> -->
<u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
<script>
import LwTabbar from "@/components/lw-tabbar/lw-tabbar.vue"
import {tabbar} from "@/utils/settings.js"
export default {
components:{
LwTabbar
},
data() {
return {
tabbar
};
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
<script>
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
export default {
components: {
MidPopup
},
data() {
return {
tabbar
};
},
methods: {
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
return false;
}
return true;
}
}
};
</script>
<style lang="scss" scoped></style>
<template>
<view class="navbar-custom">
<u-navbar
:back-icon-color="backIconColor"
:background="background"
:title="title || ' '"
:titleColor="titleColor"
:border-bottom="borderBottom"
title-bold
:is-back="isBack"
:custom-back="goBack"
>
<view class="left-content">
<view class="left-text" :style="'color:' + titleColor" v-if="left.title">{{ left.title }}</view>
<view hover-class="u-hover-class" @click="handleClickLeft" class="left-button-view">
<view v-if="left.imageUrl" class="left-button" :style="{ backgroundColor: left.backgroundColor }">
<image :src="left.imageUrl" mode="widthFix" class="left-image"></image>
</view>
<view class="right-text" :style="'color:' + titleColor" v-if="left.rightTitle">{{ left.rightTitle }}</view>
</view>
</view>
<view v-if="right.length" slot="right" class="right-content">
<view v-for="(item, index) in right" :style="item.style" class="right-button" :key="index">
<view @click="handleClickRight(index)" hover-class="u-hover-class">
<view v-if="item.red" class="red-dot"></view>
<image :src="item.imageUrl" mode="widthFix" class="right-image" :style="item.style || { backgroundColor: item.backgroundColor }"></image>
</view>
</view>
</view>
</u-navbar>
</view>
</template>
<script>
import NavbarNormal from '@/components/navbar-normal';
export default {
components: {
NavbarNormal
},
props: {
// 导航栏标题
title: {
type: String,
default: ''
},
titleColor: {
type: String,
default: '#191C27'
},
// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
background: {
type: Object,
default() {
return {
background: 'transparent'
};
}
},
// 返回箭头的颜色
backIconColor: {
type: String,
default: '#333333'
},
// 是否显示导航栏的下边框
borderBottom: {
type: Boolean,
default: false
},
isBack: {
type: [Boolean, String],
default: false
},
// 自定义返回逻辑
customBack: {
type: Function,
default() {
return () => {
if (getCurrentPages().length == 1) {
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.navigateBack();
}
};
}
},
right: {
type: Array,
default() {
return [
{
title: '',
imageUrl: '',
path: ''
}
];
}
},
left: {
type: Object,
default() {
return {
title: '',
imageUrl: ''
};
}
}
},
data() {
return {};
},
computed: {},
created() {},
methods: {
handleClickLeft() {
console.log('click left');
this.$emit('leftClick');
},
handleClickRight(index) {
console.log('click right:', index);
this.$emit('rightClick', index);
},
goBack() {
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
if (typeof this.customBack === 'function') {
// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
this.customBack.bind(this.$u.$parent.call(this))();
} else {
uni.navigateBack();
}
}
}
};
</script>
<style lang="scss" scoped>
.navbar-custom {
.left-content {
min-width: 120rpx;
display: flex;
align-content: center;
.left-text {
display: flex;
align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #191c27;
max-width: 280rpx;
white-space: nowrap;
padding-right: 44rpx;
text-overflow: ellipsis;
overflow: hidden;
}
.left-button-view {
display: flex;
align-items: center;
.left-button {
margin-left: 32rpx;
width: 64rpx;
// height: 64rpx;
border-radius: 24rpx;
.left-image {
width: 64rpx;
height: 64rpx;
// border-radius: 24rpx;
}
}
.right-text {
display: flex;
align-content: center;
align-items: center;
margin-left: 16rpx;
color: #333;
font-size: 28rpx;
}
}
}
.right-content {
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: 2rpx;
.right-button {
width: 64rpx;
// height: 64rpx;
margin-right: 16rpx;
position: relative;
.red-dot {
position: absolute;
right: 8rpx;
top: -4rpx;
border-radius: 8rpx;
width: 16rpx;
height: 16rpx;
background-color: #e54b46;
}
.right-image {
width: 64rpx;
height: 64rpx;
// border-radius: 24rpx;
}
}
}
}
</style>
<template>
<view>
<lw-tabbar></lw-tabbar>
<!-- <u-tabbar :list="tabbar" :mid-button="true"></u-tabbar> -->
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
<script>
import LwTabbar from "@/components/lw-tabbar/lw-tabbar.vue"
import {tabbar} from "@/utils/settings.js"
export default {
components:{
LwTabbar
},
data() {
return {
tabbar
};
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
import {addBind} from "@/api/login/index.js"
export default {
components: {
MidPopup
},
data() {
return {
tabbar
};
},
onReady() {
addBind({
})
},
methods: {
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
return false;
}
return true;
}
}
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
<template>
<view>
<!-- <lw-tabbar></lw-tabbar> -->
<u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
<script>
import LwTabbar from "@/components/lw-tabbar/lw-tabbar.vue"
import {tabbar} from "@/utils/settings.js"
export default {
components:{
LwTabbar
},
data() {
return {
tabbar
};
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
<script>
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
export default {
components: {
MidPopup
},
data() {
return {
tabbar
};
},
methods: {
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
return false;
}
return true;
}
}
};
</script>
<style lang="scss" scoped></style>
<template>
<view>
<!-- <lw-tabbar></lw-tabbar> -->
<u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
<script>
import LwTabbar from "@/components/lw-tabbar/lw-tabbar.vue"
import {tabbar} from "@/utils/settings.js"
export default {
components:{
LwTabbar
},
data() {
return {
tabbar
};
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
<script>
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import { tabbar } from '@/utils/settings.js';
export default {
components: {
MidPopup
},
data() {
return {
tabbar
};
},
methods: {
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
return false;
}
return true;
}
}
};
</script>
<style lang="scss" scoped></style>
......@@ -16,6 +16,9 @@ import {
} from "./common.js"
import store from "@/store/index.js"
const globalUrl = process.uniEnv || {}
let apiUrl = globalUrl.apiUrl
function request({
url,
method = 'GET',
......@@ -38,7 +41,7 @@ function request({
}
// #endif
// #ifndef H5
url = API_HOST + url
url = apiUrl + url
// #endif
console.log("requestUrl=" + url)
// console.log("请求参数===")
......
......@@ -4,23 +4,23 @@ export const tabbar = [{
"selectedIconPath": "/static/image/index/service_click@2x.png",
"text": "首页"
}, {
"pagePath": "/pages/index/schedule",
"pagePath": "/pages/index/schedule/schedule",
"iconPath": "/static/image/index/control_car_gray@2x.png",
"selectedIconPath": "/static/image/index/control_car_click@2x.png",
"text": "行程"
},{
"pagePath": "/pages/index/account",
"pagePath": "/pages/index/account/account",
"iconPath": "/static/image/index/tianj@2x.png",
"selectedIconPath": "/static/image/index/tianj@2x.png",
"text": "",
"midButton": true
}, {
"pagePath": "/pages/index/bill",
"pagePath": "/pages/index/bill/bill",
"iconPath": "/static/image/index/service_unclick@2x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png",
"text": "账单"
}, {
"pagePath": "/pages/index/mine",
"pagePath": "/pages/index/mine/mine",
"iconPath": "/static/image/index/personal_center_unclick@2x.png",
"selectedIconPath": "/static/image/index/personal_center_click@2x.png",
"text": "我的"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment