Commit 7224a1b6 authored by 刘文虎's avatar 刘文虎

静态页面基本完成

parent 344a9792
const UNI_APP = {
apiUrl: 'https://api-fans-test.banshouhui.com',
apiUrl: 'https://api-book-test.banshouhui.com',
qn_base_url: 'http://reu2asz23.hn-bkt.clouddn.com/icon/',
qn_asset_url: 'https://reu2asz23.hn-bkt.clouddn.com/upload-image/',
argoDebugMode: 1,
......
......@@ -2,6 +2,7 @@
export default {
onLaunch: function() {
console.log('App Launch')
this.$store.dispatch('Get_system_info')
},
onShow: function() {
console.log('App Show')
......
......@@ -13,4 +13,20 @@ export function getList(data) {
method: 'POST',
data
})
}
\ No newline at end of file
}
export function userAuthLogin(data) {
return request({
url: `/app/unify/authorization`,
method: 'POST',
data
})
}
export function sendCode(data) {
return request({
url: `/anno/moblie/sendCode`,
method: 'GET',
data
})
}
......@@ -23,10 +23,8 @@
<view class="billing-category"><billing-category :checked="form.category" @handleClick="billingCategoryChange"></billing-category></view>
<view class="billing-remark">
<view class="billing-remark-upload" @click="handleClickChangeImage">
<u-icon name="camera"></u-icon>
<view class="billing-remark-upload-icon">
<u-icon name="checkbox-mark"></u-icon>
</view>
<image :src="takePhotoSuccessIcon" mode="" v-if="form.photos"></image>
<image :src="takePhotoIcon" mode="" v-else></image>
</view>
<view class="billing-remark-input">
<u-input
......@@ -55,6 +53,7 @@ import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue';
import CalendarPopup from '@/components/calendar-popup/calendar-popup.vue';
import BillingCategory from './components/billing-category.vue';
import { billingTypeOptions } from '@/utils/options/index';
import { indexBaseUrl } from '@/utils/config.js';
import upload from '@/utils/upload';
export default {
name: 'billing-details',
......@@ -67,6 +66,8 @@ export default {
data() {
return {
billingTypeOptions,
takePhotoIcon:indexBaseUrl+'shangchuanbeizhu@3x.png',
takePhotoSuccessIcon:indexBaseUrl+'shangchuanbeizhuchenggong@3x.png',
show: false,
customStyle: {
width: '104rpx',
......@@ -78,7 +79,8 @@ export default {
location: '庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威',
date: '2022-07-13',
money: '56465464646456544444444444444444444444444444444444',
category: '2'
category: '2',
photos:'1'
},
upload: {
uploading: false,
......
<template>
<view class="billing-category">
<view class="billing-category-item" :class="{ active: item.value === checked }" v-for="(item, index) in list" :key="index" @click="handleCheck(item)">
<view class="billing-category-item-icon"></view>
<view class="billing-category-item-icon">
<image :src="billBaseUrl+item.icon" mode="" v-if="item.value !== checked"></image>
<image :src="billBaseUrl+item.selectedIcon" mode="" v-else></image>
</view>
<view class="billing-category-item-text">{{item.label}}</view>
</view>
</view>
......@@ -9,6 +12,7 @@
<script>
import { billingCategoryOptions } from '@/utils/options/index/index.js';
import { billBaseUrl } from '@/utils/config.js';
export default {
name: 'billing-category',
props: {
......@@ -19,6 +23,7 @@ export default {
},
data() {
return {
billBaseUrl,
list: billingCategoryOptions,
};
},
......
......@@ -5,12 +5,12 @@
<u-row gutter="16">
<u-col span="4" v-for="(item, index) in list" :key="index">
<view class="button-view" @click="openBill(item)">
<view class="button-view-background"><image src="../../static/image/index/photo.png" mode=""></image></view>
<view class="button-view-icon"><image :src="item.icon" 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 class="close"><view class="close-button" @click="close">X</view></view> -->
</view>
</u-popup>
<billing-details ref="billing-details" :type="type"></billing-details>
......@@ -19,35 +19,17 @@
<script>
import BillingDetails from '@/components/billing-details/billing-details.vue';
import { minPopupOptions } from '@/utils/options/index/index.js';
export default {
name: 'mid-popup',
components:{
components: {
BillingDetails
},
data() {
return {
show: false,
type:"",
list: [
{
label: '记行程',
path: '',
icon: '',
type:'1',
},
{
label: '维修帐',
path: '',
icon: '',
type:'2',
},
{
label: '日常帐',
path: '',
icon: '',
type:'3',
}
]
type: '',
list: minPopupOptions
};
},
methods: {
......@@ -57,10 +39,18 @@ export default {
close() {
this.show = false;
},
openBill(item){
this.type=item.type;
this.close()
this.$refs["billing-details"].open()
openBill(item) {
this.type = item.type;
this.close();
if (this.type === '3') {
this.$refs['billing-details'].open();
} else {
if (item.path) {
uni.navigateTo({
url: `${item.path}`
});
}
}
}
}
};
......@@ -68,24 +58,28 @@ export default {
<style lang="scss" scoped>
.mid-popup {
padding: 20upx;
padding: 0 20upx;
padding-top: 48upx;
padding-bottom: 144upx;
.button-view {
height: 200upx;
height: 200upx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
&-background {
position: absolute;
z-index: 1;
width: 120upx;
height: 120upx;
margin-right: 96upx;
&:last-child {
margin-right: 0;
}
&-icon {
width: 144upx;
height: 144upx;
display: flex;
}
&-content {
position: relative;
z-index: 2;
color: #ffffff;
margin-top: 32upx;
font-size: 32upx;
line-height: 32upx;
}
}
.close {
......
This diff is collapsed.
<template>
<view class="zb-tooltip" :style="{
'--theme-bg-color':color
}">
<view class="zb_tooltip_content">
<slot></slot>
<view class="zb_tooltip__popper" :style="[style,{
visibility:isShow?'visible':'hidden',
color:color==='white'?'':'#fff',
boxShadow: color==='white'?'0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d':''
}]" >
<slot name="content">{{content}}</slot>
<view class="zb_popper__icon" :style="[arrowStyle]" :class="[{
'zb_popper__up':placement.indexOf('bottom')===0,
'zb_popper__arrow':placement.indexOf('top')===0,
'zb_popper__right':placement.indexOf('right')===0,
'zb_popper__left':placement.indexOf('left')===0,
}]">
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
visible:Boolean,
color:{
type:String,
default:'#303133',
},
placement:{
type:String,
default:'top',
},
content:{
type:String,
default:''
},
show:{
type:Boolean,
default:false,
}
},
data() {
return {
isShow :this.visible,
title: 'Hello',
arrowLeft:0,
query:null,
style:{
},
arrowStyle:{}
}
},
onLoad() {
},
watch:{
isShow:{
handler(val){
this.$emit('update:visible', val)
},
immediate:true,
},
visible:{
handler(val){
this.isShow = val
if(val){
this.$nextTick(()=>{
this.handleClick()
})
}
},
immediate:true,
}
},
mounted(){
// #ifdef H5
window.addEventListener('click',()=>{
this.isShow = false
})
// #endif
},
methods: {
close(){
this.isShow = false
},
fixedWrap(){
this.isShow = false
},
handleClick(){
uni.createSelectorQuery().in(this).selectAll('.zb_tooltip_content,.zb_tooltip__popper').boundingClientRect(async (data)=>{
let {left,bottom,right,top,width,height} = data[0]
let obj1 = data[1]
let objStyle = {}
let objStyle1 = {}
switch(this.placement){
case 'top':
if(obj1.width > width){
objStyle.left = `-${(obj1.width - width)/2}px`
}else{
objStyle.left = `${Math.abs(obj1.width - width)/2}px`
}
objStyle.bottom =`${height+8}px`
objStyle1.left = (obj1.width/2-6)+'px'
break;
case 'top-start':
objStyle.left = `0px`
objStyle.bottom =`${height+8}px`
break;
case 'top-end':
objStyle.right = `0px`
objStyle.bottom =`${height+8}px`
objStyle1.right=`8px`
break;
case 'bottom':
if(obj1.width>width){
objStyle.left = `-${(obj1.width - width)/2}px`
}else{
objStyle.left = `${Math.abs(obj1.width - width)/2}px`
}
objStyle.top =`${height+8}px`
objStyle1.left = (obj1.width/2-6)+'px'
break;
case 'bottom-start':
objStyle.left = `0px`
objStyle.top =`${height+8}px`
objStyle1.left = `8px`
break;
case 'bottom-end':
objStyle.right = `0px`
objStyle.top =`${height+8}px`
objStyle1.right = `8px`
break;
case 'right':
objStyle.left = `${width+8}px`
if(obj1.height>height){
objStyle.top =`-${(obj1.height - height)/2}px`
}else{
objStyle.top =`${Math.abs((obj1.height - height)/2)}px`
}
objStyle1.top = `${obj1.height/2-6}px`
break;
case 'right-start':
objStyle.left = `${width+8}px`
objStyle.top =`0px`
objStyle1.top = `8px`
break;
case 'right-end':
objStyle.left = `${width+8}px`
objStyle.bottom =`0px`
objStyle1.bottom = `8px`
break;
case 'left':
objStyle.right = `${width+8}px`
if(obj1.height>height){
objStyle.top =`-${(obj1.height - height)/2}px`
}else{
objStyle.top =`${Math.abs((obj1.height - height)/2)}px`
}
objStyle1.top = `${obj1.height/2-6}px`
break;
case 'left-start':
objStyle.right = `${width+8}px`
objStyle.top =`0px`
objStyle1.top = `8px`
break;
case 'left-end':
objStyle.right = `${width+8}px`
objStyle.bottom =`0px`
objStyle1.bottom = `8px`
break;
}
this.style = objStyle
// 三角形箭头
this.arrowStyle = objStyle1
this.isShow = true
}).exec()
}
}
}
</script>
<style lang="scss" scoped>
$theme-bg-color: var(--theme-bg-color);
.zb-tooltip{
position: relative;
}
.zb_tooltip_content{
height: 100%;
/* float: left; */
position: relative;
display: inline-block;
// display: flex;
// flex-direction: row;
// align-items: center;
/* overflow: hidden; */
}
.zb_tooltip__popper{
/* transform-origin: center top; */
background: $theme-bg-color;
visibility: hidden;
// color:'#fff';
position: absolute;
border-radius: 4px;
font-size: 12px;
padding: 10rpx;
min-width: 10px;
word-wrap: break-word;
display: inline-block;
white-space: nowrap;
z-index:9;
}
.zb_popper__icon{
width: 0;
height: 0;
z-index:9;
position: absolute;
}
.zb_popper__arrow{
bottom: -5px;
/* transform-origin: center top; */
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid $theme-bg-color;
}
.zb_popper__right{
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid $theme-bg-color;
left:-5px;
}
.zb_popper__left{
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid $theme-bg-color;
right:-5px;
}
.zb_popper__up{
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid $theme-bg-color;
top:-5px;
}
.fixed{
position: absolute;width: 100vw;
height: 100vh;
position: fixed;
left: 0;
top: 0;
pointer-events: auto;
background: red;
z-index:-1;
}
</style>
......@@ -57,7 +57,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx4101d2c19dfc7aab",
"appid" : "wxcd75f824ec0859ba",
"setting" : {
"urlCheck" : false,
"minified" : true
......
......@@ -41,7 +41,44 @@
}
}
],
,{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login/quick-login/quick-login",
"style" :
{
"navigationBarTitleText": "快速登录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/login/binding-phone/binding-phone",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/login/agreement/agreement",
"style" :
{
"navigationBarTitleText": "用户协议",
"enablePullDownRefresh": false
}
}
],
"subPackages": [{
"root": "pages/schedule",
"pages": [{
......@@ -100,6 +137,15 @@
}
}
,{
"path" : "quoted-price/price/price",
"style" :
{
"navigationBarTitleText": "查报价",
"enablePullDownRefresh": false
}
}
]
}, {
"root": "pages/mine",
......@@ -161,6 +207,24 @@
"navigationStyle": "custom"
}
}
,{
"path" : "update-log/update-log",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "about/about",
"style" :
{
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}
}
]
},
......@@ -197,30 +261,31 @@
"selectedColor": "#303133",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"spacing":"6px",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "/static/image/index/service_unclick@2x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png",
"iconPath": "/static/image/index/shouye0@3x.png",
"selectedIconPath": "/static/image/index/shouye1@3x.png",
"text": "首页"
}, {
"pagePath": "pages/index/schedule/schedule",
"iconPath": "/static/image/index/control_car_gray@2x.png",
"selectedIconPath": "/static/image/index/control_car_click@2x.png",
"iconPath": "/static/image/index/xingcheng0@3x.png",
"selectedIconPath": "/static/image/index/xingcheng1@3x.png",
"text": "行程"
}, {
"pagePath": "pages/index/account/account",
"iconPath": "/static/image/index/tianj@2x.png",
"selectedIconPath": "/static/image/index/tianj@2x.png",
"iconPath": "/static/image/index/kaishijizhang@3x.png",
"selectedIconPath": "/static/image/index/kaishijizhang@3x.png",
"text": ""
}, {
"pagePath": "pages/index/bill/bill",
"iconPath": "/static/image/index/service_unclick@2x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png",
"iconPath": "/static/image/index/zhangdan0@3x.png",
"selectedIconPath": "/static/image/index/zhangdan1@3x.png",
"text": "账单"
}, {
"pagePath": "pages/index/mine/mine",
"iconPath": "/static/image/index/personal_center_unclick@2x.png",
"selectedIconPath": "/static/image/index/personal_center_click@2x.png",
"iconPath": "/static/image/index/wode0@3x.png",
"selectedIconPath": "/static/image/index/wode1@3x.png",
"text": "我的"
}]
}
......
<template>
<!-- 查报价 -->
<view class="choose-category">
<quoted-price-tips></quoted-price-tips>
<view class="content">
<tabs-box :checked="form.type" :list="tabList" @change="tabChange"></tabs-box>
<view class="list">
</view>
</view>
</view>
</template>
<script>
import QuotedPriceTips from '../components/quoted-price-tips.vue';
import TabsBox from '../components/tabs-box.vue';
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
import { tabsOptions } from '@/utils/options/bill/quoted-price.js';
export default {
components: {
QuotedPriceTips,
TabsBox
},
data() {
return {
arrowUrl: billBaseUrl + 'meidi@3x.png',
tabList: tabsOptions,
form: {
type: 0
}
};
},
methods: {
next(item) {
uni.navigateTo({
url: `./choose-category/choose-category?id=${item.id}`
});
},
tabChange(params) {
let { item, index } = params;
this.form.type = index;
}
}
};
</script>
<style lang="scss" scoped>
.choose-category {
padding: 0 24upx;
display: flex;
flex-direction: column;
height: 100vh;
padding-bottom: 24upx;
.content {
flex: 1;
width: 100%;
display: flex;
overflow: hidden;
.list{
flex: 1;
height: 100%;
background-color: #ffffff;
padding:0 24upx;
}
}
}
</style>
<template>
<view class="quoted-price-tips">
<view class="quoted-price-tips-icon"><image :src="tipsUrl" mode=""></image></view>
<view class="quoted-price-tips-content">本报价数据与美的官方同步,仅供参考</view>
<view class="quoted-price-tips-brand"><image :src="logoUrl" mode=""></image></view>
</view>
</template>
<script>
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
export default {
data() {
return {
tipsUrl: mineBaseUrl + 'shouzhishezhitixing@3x.png',
logoUrl: billBaseUrl + 'meidi@3x.png'
};
}
};
</script>
<style lang="scss" scoped>
.quoted-price-tips {
padding-top: 24rpx;
width: 100%;
display: flex;
align-items: center;
padding-bottom: 36rpx;
&-icon {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
}
&-content {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 26rpx;
}
&-brand {
margin-left: 10upx;
width: 140upx;
height: 40upx;
}
}
</style>
<template>
<view class="tabs-box">
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
scroll-anchoring
>
<view class="scroll-view">
<view class="tabs-box-item" :class="{ active: checked == index }" v-for="(item, index) in list" :key="index" @click="handleClick(item, index)">
<view class="tabs-box-item-icon"></view>
<view class="tabs-box-item-label ellipsis">{{ item.label }}</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'tabs-box',
props: {
checked: {
type: Number | String,
default: 0
},
list: {
type: Array,
default: () => []
}
},
data() {
return {};
},
methods: {
handleClick(item, index) {
this.$emit('change', { item, index });
}
}
};
</script>
<style lang="scss" scoped>
.tabs-box {
width: 224upx;
height: 100%;
background-color: #f6f7fa;
overflow: hidden;
.scroll-view {
width: 100%;
height: 100%;
}
&-item {
width: 100%;
height: 96upx;
padding: 0 24upx 0 32upx;
display: flex;
align-items: center;
position: relative;
background-color: #f6f7fa;
&-icon {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4upx;
height: 32upx;
background-color: #f6f7fa;
}
&-label {
font-size: 28upx;
}
}
.active {
background-color: #ffffff;
color: $default-color;
.tabs-box-item-icon {
background-color: $default-color;
}
}
}
</style>
<template>
<u-popup v-model="show" border-radius="24" :custom-style="{ 'background-color': '#F6F7FA' }" mode="bottom">
<view class="content">
<view class="charge footer">
<view class="charge-title">收费列表</view>
<view class="charge-body">
<scroll-view scroll-y="true" :style="{ height: '100%', width: '100%' }" :scroll-with-animation="false">
<view class="charge-body-item" v-for="(item, index) in chargeList" :key="item.id">
<view class="charge-body-item-title">
<text>空调预埋管</text>
<text class="charge-body-item-title-subtitle">嵌入式空调</text>
</view>
<view class="charge-body-item-bottom">
<text class="charge-body-item-bottom-price">
<text>¥</text>
<text>{{ item.price }}/米</text>
</text>
<view class="charge-body-item-bottom-add">
<view class="charge-body-item-bottom-add-icon">
<number-box theme-colors="#02A074" inputHeight="40" v-model="item.num" disabled-input @change="valChange($event, item)"></number-box>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<shopping-cart :show.sync="cartShow" :autoHide="false" :list="chargeList"></shopping-cart>
</view>
</u-popup>
</template>
<script>
import NumberBox from '@/components/number-box/number-box.vue';
import ShoppingCart from './shopping-cart.vue';
export default {
components: {
NumberBox,
ShoppingCart
},
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {
show: false,
cartShow: true,
chargeList: []
};
},
watch: {
list: {
handler(val) {
this.chargeList = JSON.parse(JSON.stringify(val));
},
immediate: true
}
},
methods: {
open() {
this.show = true;
},
close() {
this.show = false;
},
valChange(e, item) {
console.log('cart-popup,$event', e);
console.log('item', item);
this.$set(item, 'num', e.value);
this.chargeList.forEach((item, index) => {
if (item.num === 0) {
// 当数量为0时,删除当前项
this.chargeList.splice(index, 1);
}
});
let params = {
list: this.chargeList,
deleted: null
};
// 当数量为0时,通知main里面计数器变为0
if (!item.num) {
params.deleted = item;
}
this.$emit('change', params);
if(!this.chargeList.length){
this.close()
}
}
}
};
</script>
<style lang="scss" scoped>
.content {
position: relative;
padding: 32rpx;
background-color: #ffffff;
color: #333333;
.charge {
margin-bottom: 172rpx;
&-title {
margin: 8rpx 0;
line-height: 32rpx;
font-weight: bold;
font-size: 32rpx;
}
&-body {
height: 540rpx;
width: 100%;
&-item {
width: 100%;
height: 168rpx;
margin-top: 40rpx;
background: #f6f7fa;
border-radius: 16rpx;
padding: 32rpx;
&-title {
line-height: 32rpx;
font-weight: bold;
font-size: 32rpx;
&-subtitle {
margin-left: 28rpx;
line-height: 28rpx;
font-weight: normal;
font-size: 28rpx;
}
}
&-bottom {
margin-top: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-price {
color: #fc524d;
}
&-add {
}
&-add-icon {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
}
}
}
}
</style>
<template>
<view class="collapse-body">
<view class="collapse-body-title">嵌入式空调</view>
<view class="collapse-body-desc">
空调预埋管在新机到货前预埋的,预埋管 费用=单价*预埋管总长度(新机到货 后,新机自带管路需进行回收,且将新机 管路费用按长度返还给用户),新机已到
货需要预埋的,预埋管费用=(预埋管总 长度﹣新机自带管路长度)*单价(需提 供整根管路进行预埋,新机自带管路进行 回收),预埋管包括应预埋部分的电源
线、信号线、保温管、排水管等费用;
</view>
<view class="collapse-body-bottom">
<text class="collapse-body-bottom-price">
<text>¥</text>
<text>{{ detail.price }}/米</text>
</text>
<view class="collapse-body-bottom-add">
<zb-tooltip placement="top-end" ref="tooltip1" color="#7f7f7f" :visible.sync="isShow">
<view class="collapse-body-bottom-add-icon" @click="add">
<number-box theme-colors="#02A074" inputHeight="40" v-model="form.num" disabled-input @change="valChange"></number-box>
</view>
<view class="tooltip" slot="content">
<text>点击可以加入计算器算出收费</text>
<u-icon name="close" class="tooltip-icon" @click.stop="close"></u-icon>
</view>
</zb-tooltip>
</view>
</view>
</view>
</template>
<script>
import ZbTooltip from '@/components/zb-tooltip/zb-tooltip.vue';
import NumberBox from '@/components/number-box/number-box.vue';
import { mapGetters } from 'vuex';
export default {
components: {
ZbTooltip,
NumberBox
},
props: {
detail: {
type: Object | null | String,
default: () => {}
}
},
data() {
return {
isShow: false,
form: {
num: 0
}
};
},
computed: {
...mapGetters(['quotedPriceTooltip'])
},
watch: {
quotedPriceTooltip: {
handler(val) {
this.isShow = !val;
},
immediate: true
},
detail: {
handler(val, old) {
this.form.num = val.num || 0;
},
immediate: true
}
},
onReady() {},
methods: {
close() {
this.$store.dispatch('Set_quoted_price_tooltip', true);
},
valChange(e) {
console.log("collapse-body-valChange",e);
this.form.num = e.value;
this.add();
},
add() {
this.$emit('add', {
item: this.detail,
num: this.form.num
});
}
}
};
</script>
<style lang="scss" scoped>
.collapse-body {
background: #f6f7fa;
border-radius: 16rpx;
padding: 24rpx;
color: #333333;
&-title {
font-weight: bold;
font-size: 24rpx;
margin-bottom: 18rpx;
}
&-desc {
font-size: 24rpx;
line-height: 36rpx;
color: #8d8d8d;
}
&-bottom {
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-price {
color: #fc524d;
}
&-add {
}
&-add-icon {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
.tooltip {
display: flex;
align-items: center;
height: 56rpx;
padding: 0 16rpx;
// background: #000000;
border-radius: 8rpx;
color: #ffffff;
font-size: 24rpx;
// opacity: 0.5;
.tooltip-icon {
margin-left: 16rpx;
}
}
}
</style>
<template>
<view class="shopping-cart footer" v-show="show">
<view class="shopping-cart-content">
<view class="shopping-cart-content-icon" @click="openCart">
<image :src="shoppingCartIcon" mode=""></image>
<u-badge size="mini" type="error" is-center :count="list.length"></u-badge>
</view>
<view class="shopping-cart-content-right">
<text>合计:</text>
<text class="shopping-cart-content-right-price">
<text>¥</text>
<text>{{totalPrice}}</text>
</text>
</view>
</view>
</view>
</template>
<script>
import { billBaseUrl } from '@/utils/config.js';
export default {
props:{
list:{
type:Array,
default:()=>[]
},
show:{
type:Boolean,
default:false
},
autoHide:{
type:Boolean,
default:true
}
},
watch:{
list:{
handler(val) {
if(!val.length){
if(this.autoHide){
this.$emit('update:show', false)
}
}
}
}
},
computed:{
totalPrice(){
let totalPrice=0
this.list.map(item=>{
totalPrice+=parseFloat(item.price*item.num)
})
return totalPrice
}
},
data() {
return {
shoppingCartIcon: billBaseUrl + 'shoufeijisuan@3x.png',
};
},
methods:{
openCart(){
this.$emit("handleClick")
}
}
};
</script>
<style lang="scss" scoped>
.shopping-cart {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #ffffff;
padding: 0 32rpx;
&-content {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 32rpx;
padding-bottom: 100rpx;
&-icon {
width: 36rpx;
height: 40rpx;
position: relative;
}
&-right {
line-height: 24rpx;
font-size: 24rpx;
display: flex;
// align-items: start;
align-items: center;
font-weight: bold;
&-price {
color: #fc524d;
line-height: 40rpx;
font-size: 40rpx;
}
}
}
}
</style>
This diff is collapsed.
<template>
<!-- 查报价 -->
<view class="quoted-price">
<view class="quoted-price-tips">
<view class="quoted-price-tips-icon"><image :src="tipsUrl" mode=""></image></view>
<view class="quoted-price-tips-content">本报价数据与美的官方同步,仅供参考</view>
<view class="quoted-price-tips-brand"><image :src="logoUrl" mode=""></image></view>
</view>
<quoted-price-tips></quoted-price-tips>
<view class="quoted-price-step">
<view class="quoted-price-step-label">操作流程:</view>
<view class="quoted-price-step-value">
......@@ -19,20 +15,22 @@
<view class="quoted-price-brand">
<view class="quoted-price-brand-item" v-for="(item, index) in list" :key="index" @click="next(item)">
<view class="quoted-price-brand-item-icon"><image :src="item.icon" mode=""></image></view>
<view class="quoted-price-brand-item-title">{{item.title}}</view>
<view class="quoted-price-brand-item-title">{{ item.title }}</view>
</view>
</view>
</view>
</template>
<script>
import QuotedPriceTips from './components/quoted-price-tips.vue';
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
import { quotedPriceSteps } from '@/utils/options/bill/index.js';
export default {
components: {
QuotedPriceTips
},
data() {
return {
tipsUrl: mineBaseUrl + 'shouzhishezhitixing@3x.png',
logoUrl: billBaseUrl + 'meidi@3x.png',
arrowUrl: billBaseUrl + 'meidi@3x.png',
steps: quotedPriceSteps,
list: [
......@@ -60,15 +58,15 @@ export default {
title: '美的',
icon: billBaseUrl + 'meidi@3x.png',
id: '1'
},
}
]
};
},
methods: {
next(item) {
uni.navigateTo({
url:`./choose-category/choose-category?id=${item.id}`
})
url: `./choose-category/choose-category?id=${item.id}`
});
}
}
};
......@@ -77,30 +75,7 @@ export default {
<style lang="scss" scoped>
.quoted-price {
padding: 0 24upx;
&-tips {
padding-top: 24rpx;
width: 100%;
display: flex;
align-items: center;
padding-bottom: 36rpx;
&-icon {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
}
&-content {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 26rpx;
}
&-brand {
margin-left: 10upx;
width: 140upx;
height: 40upx;
}
}
&-step {
height: 104upx;
background: #ffffff;
......@@ -157,7 +132,7 @@ export default {
flex-direction: column;
margin-right: 24upx;
margin-bottom: 24upx;
&:nth-child(3n){
&:nth-child(3n) {
margin-right: 0;
}
&-icon {
......
......@@ -43,13 +43,13 @@ export default {
justify-content: center;
position: relative;
&-icon {
width: 40upx;
height: 40upx;
width: 80upx;
height: 80upx;
}
&-value {
width: 100%;
text-align: center;
margin-top: 32upx;
margin-top: 0upx;
margin-bottom: 16upx;
line-height: 32upx;
font-size: 32upx;
......
......@@ -47,7 +47,7 @@ export default {
triggered: true,
freshing: false,
noDataText: '当前暂无账单内容',
noDataImage: 'dakawuzhuangtai@3x.png',
noDataImage: 'bill/wuzhangdanneirong@3x.png',
list: [
{
week: '今天',
......
......@@ -2,17 +2,11 @@
<view class="plan-view">
<view class="plan-view-head">
<view class="plan-view-head-title">代办计划</view>
<ab-button content="添加计划" :customStyle="customStyle" left-icon="plus" @click="toAdd"></ab-button>
<ab-button content="添加计划" :customStyle="customStyle" left-icon="plus" @click="toAdd"></ab-button>
</view>
<view class="time-line">
<block v-if="list.length">
<plan-step :datas="list" @handleClick="handleClick" @handleRemind="handleRemind"></plan-step>
</block>
<block v-else-if="afterGetList">
<view class="empty-page">
<empty-page></empty-page>
</view>
</block>
<block v-if="list.length"><plan-step :datas="list" @handleClick="handleClick" @handleRemind="handleRemind"></plan-step></block>
<block v-else-if="afterGetList"><no-data :imageName="imageName" text="当前暂无待办计划"></no-data></block>
</view>
</view>
</template>
......@@ -20,6 +14,7 @@
<script>
import AbButton from '@/components/common/ab-button.vue';
import EmptyPage from '@/components/common/empty-page.vue';
import NoData from '@/components/no-data';
import PlanStep from './plan-step.vue';
export default {
......@@ -27,78 +22,80 @@ export default {
components: {
AbButton,
PlanStep,
EmptyPage
EmptyPage,
NoData
},
data() {
return {
customStyle:{
width:"160rpx",
height:"64rpx"
imageName: 'plan/wudaibanjihua@3x.png',
customStyle: {
width: '160rpx',
height: '64rpx'
},
list: [
{
time: '10:30',
status: '1',
remark: '[杭州市]快件派送至【丰巢智能快递柜】'
},
{
time: '14:00',
status: '1',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
},
{
time: '08:30',
status: '0',
remark: '[杭州市]正在派送途中'
},
{
time: '14:00',
status: '0',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
},
{
time: '08:30',
status: '0',
remark: '[杭州市]正在派送途中'
}, {
time: '14:00',
status: '0',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
},
{
time: '08:30',
status: '0',
remark: '[杭州市]正在派送途中'
},
// {
// time: '10:30',
// status: '1',
// remark: '[杭州市]快件派送至【丰巢智能快递柜】'
// },
// {
// time: '14:00',
// status: '1',
// remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
// },
// {
// time: '08:30',
// status: '0',
// remark: '[杭州市]正在派送途中'
// },
// {
// time: '14:00',
// status: '0',
// remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
// },
// {
// time: '08:30',
// status: '0',
// remark: '[杭州市]正在派送途中'
// }, {
// time: '14:00',
// status: '0',
// remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
// },
// {
// time: '08:30',
// status: '0',
// remark: '[杭州市]正在派送途中'
// },
],
afterGetList:false
afterGetList: false
};
},
methods: {
async getList(date){
async getList(date) {
// let res=await getList()
let time=this.parseTime(date,'{y}-{m}-{d}')
console.log(time)
this.afterGetList=true
let time = this.parseTime(date, '{y}-{m}-{d}');
console.log(time);
this.afterGetList = true;
},
toAdd() {
uni.navigateTo({
url: 'pages/schedule/create-schedule/create-schedule'
});
},
handleRemind(item){
if(item.status!=='1'){
return false
handleRemind(item) {
if (item.status !== '1') {
return false;
}
uni.showToast({
icon:"none",
title:"提醒"
})
icon: 'none',
title: '提醒'
});
},
handleClick(item){
handleClick(item) {
uni.navigateTo({
url:`/pages/schedule/schedule-detail/schedule-detail?id=${item.id}`
})
url: `/pages/schedule/schedule-detail/schedule-detail?id=${item.id}`
});
}
}
};
......@@ -120,7 +117,7 @@ export default {
}
.time-line {
}
.empty-page{
.empty-page {
height: 250upx;
}
}
......
<template>
<view class="agreement-view"><web-view :src="webUrl"></web-view></view>
</template>
<script>
export default {
data() {
return {
content: '',
webUrl:"",
protocol:"http://www.weixiuhui.cn/protocol.html",//用户协议
policy:"http://www.weixiuhui.cn/policy.html",//隐私政策
};
},
onLoad(options) {
if(options&&options.type){
let title=""
if(options.type==="protocol"){
this.webUrl=this.protocol
title="用户协议"
}else if(options.type==="policy"){
this.webUrl=this.policy
title="隐私政策"
}
uni.setNavigationBarTitle({
title
});
}
},
onReady: function() {}
};
</script>
<style>
.agreement-view {
}
</style>
<template>
<view class="binding-phone-view">
<view class="title-view">绑定手机</view>
<view class="text-view">首次登录的用户需绑定手机</view>
<view class="phone-view">
<view class="left-view">+86</view>
<view class="middle-view"></view>
<view class="right-view"><input v-model="phone" type="number" width="100%" maxlength="20" clearable /></view>
</view>
<view class="code-view">
<view class="left-view"><input v-model="code" type="number" maxlength="6" clearable /></view>
<!-- <view :class="['right-view', { active: active }]" hover-class="u-hover-class" @click="$u.throttle(handleClick, 500)">{{ text }}</view> -->
<view class="right-view">
<u-toast ref="uToast"></u-toast>
<u-verification-code keep-running unique-key="binding-phone" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
<text :class="{ active: canGetCode }" @tap="$u.throttle(handleClick, 500)">{{ tips }}</text>
</view>
</view>
<view class="bottom-vew">
<u-button :disabled="disabled" type="primary" :customStyle="buttonStyle" :loading="loading" @click="handleClickSave">
<view class="button-text">立即绑定</view>
</u-button>
</view>
</view>
</template>
<script>
import {sendCode} from "@/api/login/index.js"
export default {
data() {
return {
phone: '',
code: '',
timer: null,
canGetCode: true,
seconds: 60,
encryptedData: '',
iv: '',
loading: false,
weixinAuthService: null,
params: {},
tips: '',
buttonStyle:{
height: '104rpx',
backgroundColor: '#3383FE',
color: 'transparent'
},
};
},
computed: {
disabled() {
return this.code && this.phone ? false : true;
}
},
onReady() {
this.canGetCode = this.$refs.uCode.canGetCode ? true : false;
},
onLoad(options) {
console.log('-----options----', options);
if (options) {
let { unionid } = options;
if (unionid) {
this.params = options;
}
}
},
methods: {
beginCountdown() {
if (!this.timer) {
this.timer = setInterval(() => {
if (this.seconds > 0) {
this.active = false;
this.seconds -= 1;
} else {
this.active = true;
}
}, 1000);
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer);
});
}
},
handleClick() {
if (this.phone == '') {
uni.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1500
});
return;
}
var reg = /^[1][3456789][0-9]{9}$/;
if (!reg.test(this.phone)) {
uni.showToast({
icon: 'none',
title: '请输入正确的手机号'
});
return false;
}
this.startCode();
},
startCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
if (uni.$u.platform !== '3') {
uni.showLoading({
title: '正在获取验证码'
});
} else {
this.$u.toast('正在获取验证码');
}
this.getCode();
}
},
async getCode() {
try{
let res=await sendCode({moblie: this.phone})
if (uni.$u.platform !== '3') {
uni.hideLoading();
}
if (res.status && res.data) {
this.$u.toast('验证码已发送');
this.$refs.uCode.start();
console.log('--------发送成功----------');
} else {
uni.showToast({
title: '获取验证码失败',
icon: 'none'
});
}
}catch(e){
//TODO handle the exception
if (uni.$u.platform !== '3') {
uni.hideLoading();
}
}
},
handleClickSave() {
this.signup();
},
signup() {
this.loading = true;
var reg = /^[1][3456789][0-9]{9}$/;
if (!reg.test(this.phone)) {
uni.showToast({
icon: 'none',
title: '请输入正确的手机号'
});
this.loading = false;
return false;
}
const app = getApp();
let userInfo = (app.globalData.tmp && app.globalData.tmp.wxUserInfo) || {
nickName: '',
avatarUrl: ''
};
if (uni.$u.platform === '4') {
this.onAppLogin();
} else {
this.onWxLogin(userInfo);
}
},
async onWxLogin(userInfo) {
try {
let res = await login.wxLogin();
let params = {
code: res.code,
nickname: userInfo.nickName,
avatar: userInfo.avatarUrl,
encryptedData: this.encryptedData,
iv: this.iv,
verify: this.code,
mobile: this.phone
};
await this.$store.dispatch('On_signup', {
params
});
} catch (e) {
console.log('onWxLogin:fail', e);
this.loading = false;
//TODO handle the exception
}
this.loading = false;
},
async onAppLogin() {
let params = {
...this.params,
verify: this.code,
mobile: this.phone
};
console.log(params);
await this.$store.dispatch('On_signup', {
params,
callback: () => {
this.toPhoneLogin();
}
});
this.loading = false;
},
async onSignup(params) {
try {
let res = await login.signup(params);
this.loading = false;
if (res) {
let { status, data, message } = res;
if (status && data) {
uni.switchTab({
url: '/pages/index/index'
});
} else if (data.code === -1) {
uni.redirectTo({
url: '/pages/login/binding-phone'
});
} else {
uni.showToast({
title: message || '绑定手机失败',
icon: 'none'
});
api.setAuthToken('');
}
}
} catch (e) {
//TODO handle the exception
}
},
codeChange(text) {
this.tips = text;
},
end() {
console.log('end');
this.canGetCode = true;
},
start() {
console.log('start');
this.canGetCode = false;
},
appWxLogin1() {
var self = this;
this.weixinAuthService.authorize(
function(res) {
console.log('authorize:', res);
//支持微信、qq和微博等
uni.login({
provider: 'weixin',
onlyAuthorize: true,
success: function(loginRes) {
console.log('uni.login:', loginRes);
// 微信用户信息存入本地,后期备用
var auth = null;
plus.oauth.getServices(
function(services) {
auth = services.find(service => {
return service.id === 'weixin';
});
try {
uni.setStorageSync('auth_service', auth);
} catch {}
},
function(e) {
console.log('e:', e);
}
);
if (loginRes.authResult) {
let access_token = loginRes.authResult.access_token;
let openid = loginRes.authResult.openid;
} else {
}
},
fail(e) {
console.log('e:', e);
}
});
},
function(error) {
console.log('error:', error);
},
{
scope: 'snsapi_userinfo'
}
);
},
appWxLogin(e) {
uni.hideLoading();
console.log(uni.getSystemInfoSync());
console.log(uni.$u.platform);
// uni.showLoading({
// title: '授权中'
// });
uni.getProvider({
service: 'oauth',
success: res => {
console.log('getProvider', res);
console.log(res.provider.findIndex(e => e === 'weixin'));
uni.hideLoading();
//支持微信、qq和微博等
if (res.provider.findIndex(e => e === 'weixin') !== -1) {
uni.login({
provider: 'weixin',
onlyAuthorize: true,
success: loginRes => {
console.log('uni.login', loginRes);
// this.appGetUserInfo(loginRes);
this.loginForApi(loginRes);
},
fail: err => {
console.log('uni.login失败', err);
let { errMsg, errCode, code } = err;
let title = '登录失败';
if (errCode === -8) {
title = '请先安装微信客户端';
}
uni.hideLoading();
uni.showToast({
icon: 'none',
title: title
});
}
});
}
}
});
},
loginForApi(loginRes) {
if (loginRes.code) {
let params = {
code: loginRes.code,
type: uni.$u.platform
};
this.onSignup(params);
} else {
console.log('未获取到code', loginRes);
}
}
}
};
</script>
<style scoped lang="scss">
.binding-phone-view {
padding: 60rpx;
.title-view {
font-size: 52rpx;
color: #333333;
font-weight: bold;
margin-bottom: 24rpx;
}
.text-view {
font-size: 28rpx;
color: #8d8d8d;
margin-bottom: 88rpx;
}
.phone-view {
display: flex;
align-items: center;
font-weight: bold;
font-size: 28rpx;
color: #333333;
background-color: #fafafa;
border-radius: 16rpx;
height: 104rpx;
padding: 0 32rpx;
margin-bottom: 48rpx;
.left-view {
width: 66rpx;
text-align: left;
flex-shrink: 0;
}
.middle-view {
background-color: #8d8d8d;
width: 4rpx;
height: 28rpx;
margin: 0 12rpx;
flex-shrink: 0;
}
.right-view {
flex: 1;
padding-left: 8rpx;
}
}
.code-view {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: bold;
font-size: 28rpx;
color: #333333;
background-color: #fafafa;
border-radius: 16rpx;
height: 104rpx;
padding: 0 32rpx;
margin-bottom: 96rpx;
.left-view {
width: 330rpx;
}
.right-view {
font-weight: 400;
.active {
color: #3383fe;
}
}
}
.bottom-vew {
.button-text {
color: #ffffff;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
}
}
}
</style>
<template>
<view class="quick">
<view class="quick-color">
<view class="quick-color-cancel" :style="{ 'padding-top': platform == '3' ? 0 : statusBarHeight + 'px' }"><u-icon name="close" @click="toIndex"></u-icon></view>
</view>
<view class="quick-background">
<image src="/static/images/login/startup/denglulogo@3x.png" mode="" class="quick-background-logo"></image>
<image src="/static/images/login/startup/shiyongbanshou@3x.png" mode="" class="quick-background-slogn"></image>
</view>
<view class="quick-mark">
<view class="quick-center" v-if="isIOS && platform === '4'">
<view class="submit-button-box">
<view class="submit-button apple" @click.stop="toPhoneLogin"><text>手机验证码登录</text></view>
</view>
</view>
<view class="quick-center" v-else>
<view class="submit-button-box">
<view class="submit-button" @click.stop="submit" :loading="loading">
<image src="/static/images/login/startup/weixin@3x.png" mode="" class="submit-button-icon" v-if="!(platform == '2' || platform == '3')"></image>
<text>{{ platform == '2' || platform == '3' ? '授权登录' : '微信登录' }}</text>
</view>
</view>
<view class="cancel-button"><text @click.stop="toPhoneLogin">手机验证码登录</text></view>
<!-- <view class="other-login">
<u-divider>其他登录方式</u-divider>
<view class="other-login-item">
<image src="/static/images/login/APPLE@3x.png" mode=""></image>
</view>
</view> -->
</view>
</view>
<view class="quick-title" @click="handleClickAgree">
<view class="icon-view" :class="{ 'icon-agree': agree }"><u-icon name="checkbox-mark" v-if="agree"></u-icon></view>
<view class="agree-text-view">
我已阅读并同意
<text class="name-text" @tap.stop.prevent="handleClick('protocol')">《用户服务协议》</text>
和
<text class="name-text" @tap.stop.prevent="handleClick('policy')">《隐私政策》</text>
</view>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
components: {},
data() {
return {
agree: false,
statusBarHeight: 20,
loading: false
};
},
computed: {
...mapGetters(['platform', 'isIOS', 'systemInfo'])
},
onLoad() {
console.log('this.platform', this.platform);
console.log('this.isIOS', this.isIOS);
let { statusBarHeight } = this.systemInfo;
this.statusBarHeight = statusBarHeight;
},
onShow() {
if (this.loading) {
this.loading = false;
}
},
methods: {
handleClick(type) {
uni.navigateTo({
url: '/pages/login/agreement/agreement?type=' + type
});
},
handleClickAgree() {
this.agree = !this.agree;
},
toIndex() {
uni.switchTab({
url: '/pages/index/index'
});
},
submit() {
if (!this.checkAgree()) {
return;
}
if (this.platform === '4') {
this.appWxLogin();
} else {
uni.redirectTo({
url: './quick-login/quick-login'
});
}
},
appWxLogin() {
uni.showLoading({
title: '授权中'
});
uni.getProvider({
service: 'oauth',
success: async res => {
console.log('getProvider', res);
//支持微信、qq和微博等
if (res.provider.findIndex(e => e === 'weixin') !== -1) {
this.loading = true;
try {
let res = await this.$store.dispatch('Wx_login');
let params = {
code: res.code,
type: uni.$u.platform,
grantType: '1' // APP微信登录
};
this.loading = false;
// uni.hideLoading();
await this.$store.dispatch('On_signup', {
params,
callback: back => {
this.toPhoneLogin(back);
}
});
} catch (e) {
this.loading = false;
console.log('Wx_login:||On_signup:', e);
uni.hideLoading();
}
} else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '不支持微信登录'
});
}
},
fail() {
uni.hideLoading();
}
});
},
toPhoneLogin(res) {
if (!this.checkAgree()) {
return;
}
console.log('toPhoneLogin');
let { openid, unionid, session_key, nickname, avatar } = res;
let params = {};
if (unionid) {
params = {
openid,
unionid,
session_key,
nickname,
avatar,
grantType: '1' // APP微信登录
};
}
this.$u.route({ url: 'pages/login/binding-phone', params });
},
checkAgree() {
if (!this.agree) {
uni.showToast({
title: '请阅读并同意《用户服务协议》和《隐私政策》',
icon: 'none',
duration: 2000
});
return false;
}
return true;
},
}
};
</script>
<style lang="scss" scoped>
.quick {
width: 100%;
height: 100vh;
background: #ffffff;
position: relative;
color: #333333;
&-color {
width: 100%;
height: 30%;
background: linear-gradient(180deg, #e9f3ff 0%, #ffffff 100%);
overflow: hidden;
&-cancel {
width: 60upx;
height: 60upx;
text-align: left;
margin-top: 20upx;
margin-left: 32upx;
font-size: 32upx;
}
}
&-background {
position: absolute;
overflow: hidden;
top: 20%;
text-align: center;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
&-logo {
width: 144upx;
height: 144upx;
}
&-slogn {
width: 362upx;
height: 38upx;
margin-top: 46upx;
}
}
&-mark {
// overflow: hidden;
width: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
&-center {
position: relative;
width: 100%;
.submit-button-box {
width: 100%;
padding: 0 80upx;
margin-bottom: 54upx;
.submit-button {
position: relative;
width: 100%;
height: 104upx;
border-radius: 52upx;
line-height: 104upx;
color: #ffffff;
font-size: 32upx;
font-weight: bold;
text-align: center;
background: #00c802;
box-shadow: 0px 12upx 24upx 0px rgba(0, 200, 2, 0.32);
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
&:active {
background: #41c845;
}
.submit-button-icon {
width: 38upx;
height: 32upx;
margin-right: 16upx;
}
}
.apple {
background: #458eff;
box-shadow: 0px 12upx 24upx 0px rgba(69, 142, 255, 0.32);
&:active {
background: #83afff;
}
}
}
.cancel-button {
text-align: center;
font-size: 32upx;
color: #8d8d8d;
}
.other-login {
position: absolute;
left: 0;
bottom: -300upx;
z-index: 9;
width: 100%;
&-item {
margin: 0 auto;
margin-top: 48upx;
width: 80upx;
height: 80upx;
image {
width: 100%;
height: 100%;
}
}
}
}
&-title {
z-index: 10;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
left: 0;
bottom: 5%;
text-align: center;
line-height: 28upx;
font-size: 24upx;
color: #8d8d8d;
font-weight: 500;
&-weight {
font-weight: bold;
color: #333333;
}
&-icon {
width: 28upx;
height: 28upx;
border-radius: 50%;
margin-right: 16upx;
border: 2upx solid #333333;
display: inline-block;
}
.icon-view {
width: 36rpx;
height: 36rpx;
font-size: 18rpx;
border-radius: 50%;
border: 2rpx solid #3383fe;
display: flex;
justify-content: center;
align-items: center;
background-color: #ffffff;
margin-right: 12rpx;
}
.icon-agree {
background-color: #3383fe;
color: #ffffff;
}
.name-text {
color: #3383fe;
}
}
}
</style>
This diff is collapsed.
<template>
<view class="content">
<view class="other-items">
<view class="serviceBtn" id="suggest" @tap="handleClick('protocol')">
<view class="left"><text class="otherText-l">用户协议</text></view>
<u-icon name="arrow-right" color="#999999" :size="28" />
</view>
<view class="serviceBtn" id="service" @tap="handleClick('policy')">
<view class="left"><text class="otherText-l">隐私政策</text></view>
<u-icon name="arrow-right" color="#999999" :size="28" />
</view>
<view class="serviceBtn">
<view class="left"><text class="otherText-l">系统版本</text></view>
<view class="right">
<text class="text">{{ version }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { version } from '@/utils/config.js';
export default {
data() {
return {
version
};
},
methods: {
handleClick(type) {
uni.navigateTo({
url: '/pages/login/agreement/agreement?type=' + type
});
},
}
};
</script>
<style lang="scss" scoped>
.content {
padding: 24rpx;
}
/*content 4*/
.other-items {
background-color: #ffffff;
border-radius: 16rpx;
padding: 0 24rpx;
}
.serviceBtn {
display: flex;
justify-content: space-between;
align-items: center;
color: #333333;
height: 88rpx;
}
.serviceBtn .left {
display: flex;
align-items: center;
}
.serviceBtn .right {
display: flex;
align-items: center;
justify-content: flex-end;
}
.serviceBtn .right .text {
color: #999999;
font-size: 26rpx;
padding-right: 6rpx;
}
</style>
<template>
<view class="update-log-item" :class="{active:checked}">
<view class="head">
<view class="head-title">{{detail.title}}</view>
<view class="head-time">{{detail.createdTime}}</view>
</view>
<view class="content">{{detail.content}}</view>
</view>
</template>
<script>
export default {
props:{
detail:{
type:Object,
default:()=>{}
},
checked:{
type:Boolean,
default:false
}
},
data() {
return {};
}
};
</script>
<style lang="scss" scoped>
.update-log-item {
padding: 24rpx;
background-color: #ffffff;
margin-bottom: 24rpx;
border-radius: 16rpx;
color: #8d8d8d;
.head {
padding: 16rpx 0 32rpx 0;
border-bottom: 2px solid #f6f7fa;
display: flex;
justify-content: space-between;
.head-title {
line-height: 32rpx;
font-size: 32rpx;
font-weight: bold;
}
.head-time {
color: #8d8d8d;
line-height: 28rpx;
font-size: 28rpx;
}
}
.content {
padding: 32rpx 0;
line-height: 40rpx;
font-size: 28rpx;
}
}
.active{
color: #333333;
}
</style>
<template>
<view class="update-log">
<update-log-item v-for="(item,index) in list" :key="index" :detail="item" :checked="index===0"></update-log-item>
</view>
</template>
<script>
import UpdateLogItem from "./components/update-log-item.vue"
export default {
components:{
UpdateLogItem
},
data() {
return {
list:[
{
title:"V1.0.1更新内容",
createdTime:"2022-07-22",
content:"修复一些已知问题,上线了某某功能,改进了某功能的体验。"
},
{
title:"V1.0.0更新内容",
createdTime:"2022-07-16",
content:"扳手记账正式上线,很高心为您服务"
},
]
};
}
}
</script>
<style lang="scss" scoped>
.update-log{
padding: 32rpx 24rpx;
}
</style>
<template>
<view class="sound-player">
<free-audio ref="free-audio" activeColor="#CCCCCC" startPic="/static/image/schedule/play.png" endPic="/static/image/schedule/stop.png" audioId="audio1" :url="path"></free-audio>
<free-audio ref="free-audio" activeColor="#CCCCCC" :startPic="startPic" :endPic="endPic" audioId="audio1" :url="path"></free-audio>
<view class="sound-player-close" @click="clear" v-if="showClose">
X
</view>
......@@ -9,6 +9,7 @@
<script>
import freeAudio from '@/components/free-audio';
import {planBaseUrl} from "@/utils/config.js"
export default {
components: { freeAudio },
props:{
......@@ -20,6 +21,8 @@ export default {
},
data() {
return {
startPic:planBaseUrl+'bofang@3x.png',
endPic:planBaseUrl+'zanting@3x.png',
};
},
beforeDestroy() {
......
......@@ -4,7 +4,9 @@ import {
checkCodeTimetamp,
showToast
} from "@/utils/common.js"
import store from "@/store/index.js"
import {whiteList} from "@/utils/config.js"
import store from "../store/index.js"
console.log("store",store)
import {
getCode
} from "@/utils/auth.js"
......@@ -26,7 +28,42 @@ const router = createRouter({
routerBeforeEach: (to, from, next) => {
console.log('+++++routerBeforeEach++++')
console.log(to)
next()
let {path}=to
let index=whiteList.findIndex(item=>item===path)
if(index!==-1){
// 白名单内直接跳转
console.log("白名单内直接跳转")
next()
}else{
// 鉴权
console.log("需要鉴权")
if(checkToken()){
next()
}else{
next()
// if(store.getters.platform==='4'){
// showToast('登录已过期,请重新登录')
// setTimeout(()=>{
// next({
// path:'/pages/login/login'
// })
// },1500)
// }else{
// store.dispatch('Auto_login').then(()=>{
// next()
// }).catch(()=>{
// showToast('自动登录失败');
// setTimeout(()=>{
// next({
// path:'/pages/login/login'
// })
// },1500)
// })
// }
}
}
},
routerAfterEach: (to, from) => {
console.log('--------routerAfterEach----')
......
const getters = {
userInfo:state=>state.login.userInfo,
isIOS:state=>state.login.isIOS,
systemInfo:state=>state.login.systemInfo,
platform:state=>state.login.platform,
quotedPriceTooltip:state=>state.common.quotedPriceTooltip,
}
export default getters
import Vue from 'vue'
import Vuex from 'vuex'
import login from './modules/login'
import common from './modules/common'
import getters from './getters'
......@@ -9,6 +10,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
login,
common,
},
getters
})
......
import {
setQuotedPriceTooltip,
getQuotedPriceTooltip,
} from "@/utils/common.js"
const state = {
quotedPriceTooltip: getQuotedPriceTooltip(),
}
const mutations = {
SET_QUOTED_PRICE_TOOLTIP: (state, data) => {
state.quotedPriceTooltip = data
setQuotedPriceTooltip(data)
},
}
const actions = {
Set_quoted_price_tooltip({
commit
}, data) {
commit("SET_QUOTED_PRICE_TOOLTIP", data)
},
}
export default {
state,
mutations,
actions
}
......@@ -5,13 +5,13 @@ import {
removeToken,
removeUserinfo,
removeTimetamp,
setCodeTimetamp
setTimetamp
} from "@/utils/common.js"
import {
loginInfo
} from "@/utils/config.js"
import {
userLogin,
userAuthLogin,
getProfile,
getDVRHost,
getHeadImageHost,
......@@ -20,8 +20,13 @@ import {
import {
wxLogin
} from "@/utils/auth.js"
import {
platform,
channel
} from '@/utils/platform'
const state = {
platform: platform,
userInfo: getUserinfo(),
scene: null,
showPublic: false,
......@@ -42,7 +47,7 @@ const state = {
// 1187,
],
systemInfo: null, // 系统信息
liveStatus:0
isIOS: false,
}
const mutations = {
......@@ -62,6 +67,9 @@ const mutations = {
SET_SYSTEM_INFO: (state, data) => {
state.systemInfo = data
},
SET_IS_IOS: (state, data) => {
state.isIOS = data
},
}
const actions = {
......@@ -70,58 +78,105 @@ const actions = {
}, data) {
commit("SET_SCENE", data)
},
Login({
App_WX_login({
state,
commit,
dispatch
}) {
return new Promise((resolve, reject) => {
wxLogin().then(wechatCode => {
loginInfo.wechatCode = wechatCode
userLogin(loginInfo).then(res => {
let {
code,
data
} = res
if (code === 200) {
setCodeTimetamp()
setToken(data)
resolve(res)
uni.showLoading({
title: '授权中'
});
uni.getProvider({
service: 'oauth',
success: res => {
console.log('getProvider', res);
//支持微信、qq和微博等
if (res.provider.findIndex(e => e === 'weixin') !== -1) {
resolve()
} else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '不支持微信登录'
});
reject()
}
}).catch(err => {
},
fail() {
uni.hideLoading();
reject()
})
}).catch(err => {
}
});
})
},
Auto_login({
state,
commit,
dispatch
},params) {
return new Promise(async (resolve, reject) => {
let authType = ''
let loginChannel = channel
switch (platform) {
case '1': // 微信
authType = "WX"
break;
case '2': // 百度
authType = ""
break;
case '3': // 抖音
authType = ""
break;
case '4': // 抖音
authType = "WX"
break;
}
try {
let code = await wxLogin()
let info={
...loginInfo,
authType:authType,
loginChannel:loginChannel,
code:code,
}
console.log(code)
return false
if(params){
info={
...info,
...params,
}
}
let res = await userAuthLogin(info)
setTimetamp()
setToken(res.token)
resolve(res)
} catch (e) {
console.log(e)
reject()
})
}
})
},
// 获取用户信息
GetInfo({
commit,
state
}) {
return new Promise((resolve, reject) => {
getProfile().then(res => {
return new Promise(async (resolve, reject) => {
try {
let res = await getProfile()
let {
code,
data
} = res
if (code === 200) {
setUserinfo(data)
commit("SET_USERINFO", data)
resolve(res)
} else {
reject()
}
}).catch(err => {
setUserinfo(data)
commit("SET_USERINFO", data)
resolve(res)
} catch (e) {
console.log(e)
reject()
})
}
})
},
// 退出系统
......@@ -173,13 +228,14 @@ const actions = {
Get_system_info({
commit
}) {
uni.getSystemInfo({
success: res => {
commit("SET_SYSTEM_INFO", res)
}
});
let res = uni.getSystemInfoSync();
commit("SET_SYSTEM_INFO", res)
let {
platform
} = res
commit("SET_IS_IOS", platform === 'ios')
},
// 检查用户是否已经关注公众号
Get_subscribeCyzn() {
return new Promise((resolve, reject) => {
......
let localtionshowModal = null
import store from "@/store/index.js"
import {platform, channel} from './platform'
export function showModal({
content = "检测到您没打开获取位置信息功能权限,是否去设置打开?",
......@@ -110,23 +110,44 @@ export const getWritePhotosAlbum = function() {
})
}
export const wxLogin = function() {
export const wxLogin = function(provider) {
return new Promise((resolve, reject) => {
uni.login({
// #ifdef APP-PLUS
provider: 'weixin',
onlyAuthorize: true,
// #endif
success: res => {
console.log('-----wxLogin success-----', res)
if (!res.code) {
uni.showModal({
content: res.errMsg,
showCancel: false
});
reject(res);
} else {
resolve(res.code);
}
},
fail: err => {
console.log('-----wxLogin fail-----', err)
let {
errMsg,
errCode,
code
} = res
if (errMsg === "login:ok") {
resolve(code)
}else{
reject()
} = err;
let title = '登录失败';
if (errCode === -8) {
title = '请先安装微信客户端';
}
},
fail: err => {
reject()
if(platform==='4'){
uni.showModal({
content: title,
showCancel: false
});
}
reject(err);
}
});
})
......
......@@ -7,8 +7,7 @@ import {
} from "./config.js"
export function setToken(data) {
uni.setStorageSync(token, data);
let time = new Date().getTime()
uni.setStorageSync(TIMETAMP, time);
setTimetamp()
}
export function getToken() {
......@@ -17,8 +16,8 @@ export function getToken() {
export function removeToken() {
uni.removeStorageSync(token);
uni.removeStorageSync(TIMETAMP);
uni.removeStorageSync(userinfo);
removeTimetamp()
removeUserinfo()
}
export function setTimetamp() {
......@@ -59,6 +58,15 @@ export function removeUserinfo() {
uni.removeStorageSync(userinfo);
}
export function setQuotedPriceTooltip(data) {
uni.setStorageSync("quotedPriceTooltip", data);
}
export function getQuotedPriceTooltip() {
return uni.getStorageSync("quotedPriceTooltip") || false
}
export function checkPhone() {
let userinfo = getUserinfo()
let {
......
export const baseURL="/baseapi"
export const version="1.0.0"
export const token="TOKEN"
export const PHONENUMBER="PHONENUMBER"
export const TIMETAMP="TIMETAMP"
export const codeTimestamp="CODETIMESTAMP"
export const userinfo="USERINFO"
export const baseURL = "/baseapi"
export const version = "1.0.0"
export const token = "TOKEN"
export const PHONENUMBER = "PHONENUMBER"
export const TIMETAMP = "TIMETAMP"
export const codeTimestamp = "CODETIMESTAMP"
export const userinfo = "USERINFO"
export const headName = 'admin-token';
export const temperature = 'TEMPERATURE';
export const appid="wx55e75ad85611191f"
export const appid = "wx55e75ad85611191f"
// export const API_HOST = ''; // 正式服
export const API_HOST = ''; // 测试服
export const baseUrl = process.uniEnv.qn_base_url; // 七牛云OSS图片地址
export const mineBaseUrl = process.uniEnv.qn_base_url+'mine/'; // 七牛云OSS图片地址
export const billBaseUrl = process.uniEnv.qn_base_url+'bill/'; // 七牛云OSS图片地址
export const IMG_HOST = ''; // 服务器线上图片地址
export const STATIC_IMG_HOST = ''; // 服务器静态图片地址
export const API_HOST = ''; // 测试服
export const baseUrl = process.uniEnv.qn_base_url; // 七牛云对象存储图片地址
export const indexBaseUrl = process.uniEnv.qn_base_url + 'index/'; // 七牛云对象存储图片地址-首页
export const mineBaseUrl = process.uniEnv.qn_base_url + 'mine/'; // 七牛云对象存储图片地址-我的
export const billBaseUrl = process.uniEnv.qn_base_url + 'bill/'; // 七牛云对象存储图片地址-账单
export const planBaseUrl = process.uniEnv.qn_base_url + 'plan/'; // 七牛云对象存储图片地址-行程
export const IMG_HOST = ''; // 服务器线上图片地址
export const STATIC_IMG_HOST = ''; // 服务器静态图片地址
export const whiteList = ['/pages/index/index', '/pages/index/schedule/schedule', '/pages/index/bill/bill',
'/pages/index/mine/mine', '/pages/login/login', '/pages/login/quick-login/quick-login',
'/pages/login/binding-phone/binding-phone', '/pages/login/agreement/agreement','/pages/mine/update-log/update-log','/pages/mine/about/about'
]; // 服务器静态图片地址
export const loginInfo = {
"faceBase64": "",
"faceFeatureStr": "",
"faceGroupId": "",
"fingerprint": "",
"fingerprintGroupId": "",
"applicationType":3,
"flag": 8,
"password": "",
"phone": "",
"phoneCode": "",
"username": "",
"wechatCode": "",
"wechatScope": ""
}
\ No newline at end of file
"account": "",
"authType": "",
"avatar": "",
"code": "",
"encryptedData": "",
"iv": "",
"loginChannel": "",
"nickname": "",
"openId": "",
"password": "",
"unionId": "",
}
import {
billBaseUrl
} from "@/utils/config.js"
export const billCountOptions = [{
value: "income",
label: "本月总收入(元)",
icon: ""
icon: billBaseUrl+"zongshouru@3x.png"
},
{
value: "disbursement",
label: "本月总支出(元)",
icon: ""
icon: billBaseUrl+"zongzhichu@3x.png"
},
{
value: "surplus",
label: "本月总结余(元)",
icon: ""
icon: billBaseUrl+"zongjieyu@3x.png"
},
]
......
export const tabsOptions = [{
value: "1",
label: "空调",
},
{
value: "2",
label: "洗衣机",
},
{
value: "3",
label: "热水器",
},
{
value: "4",
label: "厨房大家电",
},
]
\ No newline at end of file
import {
indexBaseUrl
} from "@/utils/config.js"
export const minPopupOptions = [{
label: '记行程',
path: '/pages/schedule/create-schedule/create-schedule',
icon: indexBaseUrl + 'jixingcheng@3x.png',
type: '1',
},
{
label: '维修帐',
path: '',
icon: indexBaseUrl + 'weixiuzhang@3x.png',
type: '2',
},
{
label: '日常帐',
path: '',
icon: indexBaseUrl + 'richangzhang@3x.png',
type: '3',
}
]
export const billingTypeOptions = [{
value: "1",
label: "收入"
......@@ -11,42 +34,50 @@ export const billingTypeOptions = [{
export const billingCategoryOptions = [{
value: "1",
label: "交通",
icon:''
icon: 'jiaotong0@3x.png',
selectedIcon:'jiaotong1@3x.png'
},
{
value: "2",
label: "餐饮",
icon:''
icon: 'canying0@3x.png',
selectedIcon:'canying1@3x.png'
},
{
value: "3",
label: "服饰",
icon:''
icon: 'fushi0@3x.png',
selectedIcon:'fushi1@3x.png'
},
{
value: "4",
label: "购物",
icon:''
icon: 'gouwu0@3x.png',
selectedIcon:'gouwu1@3x.png'
},
{
value: "5",
label: "娱乐",
icon:''
icon: 'yule0@3x.png',
selectedIcon:'yule1@3x.png'
},
{
value: "6",
label: "教育",
icon:''
icon: 'jiaoyu0@3x.png',
selectedIcon:'jiaoyu1@3x.png'
},
{
value: "7",
label: "材料",
icon:''
icon: 'cailiao0@3x.png',
selectedIcon:'cailiao1@3x.png'
},
{
value: "8",
label: "设置",
icon:''
icon: 'shezhi0@3x.png',
selectedIcon:'shezhi1@3x.png'
},
]
\ No newline at end of file
]
......@@ -33,19 +33,19 @@ export const packageOptions = [{
id: 1,
title: '用户服务&隐私协议',
icon: 'file-text',
path: "/pages/mine/complaint/complaint"
path: "/pages/mine/about/about"
},
{
id: 2,
title: '更新日志',
icon: 'kefu-ermai',
path: "/pages/mine/service/service"
path: "/pages/mine/update-log/update-log"
},
{
id: 3,
title: '退出登录',
icon: 'bookmark',
path: "/pages/mine/about/about"
path: "/pages/mine/logout/logout"
}
]
......
......@@ -6,12 +6,11 @@
* }
*/
let platform = '' // 登录
let channel = '' // 首页弹窗接口
let {
appName
} = uni.getSystemInfoSync();
let isToutiao = appName === 'Toutiao' ? true : false
let platform = '' // 平台
let channel = '' // 渠道
let systemInfo = uni.getSystemInfoSync()
let isToutiao = systemInfo.appName === 'Toutiao' ? true : false
let isIOS = systemInfo.platform === 'ios'
// #ifdef VUE3
platform = 'vue3'
......@@ -23,7 +22,7 @@ platform = 'vue2'
// #ifdef APP-PLUS
platform = '4'
channel = '1'
channel = isIOS ? 'IOS' : 'ANDROID'
// #endif
// #ifdef APP-NVUE
......@@ -37,11 +36,12 @@ platform = 'h5'
// #ifdef MP-WEIXIN
platform = '1'
channel = '2'
channel = 'WX'
// #endif
// #ifdef MP-ALIPAY
platform = 'alipay'
channel = 'ZFB'
// #endif
// #ifdef MP-BAIDU
......
......@@ -76,17 +76,17 @@ function request({
resolve(res.data)
} else {
console.log("未登录或者登陆已过期")
resolve(res.data)
reject(res.data)
store.dispatch("LogOut")
uni.switchTab({
url: "/pages/index/index"
})
}
} else if (res.data.code === 23001) {
resolve(res.data)
reject(res.data)
} else {
showToast(res.data.msg)
resolve(res.data)
reject(res.data)
}
}
},
......
This diff is collapsed.
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