Commit 76175dff authored by Facius's avatar Facius

feat: 冲突

parents 85a5132e 9fb45e34
Pipeline #2824 canceled with stages
const UNI_APP = { const UNI_APP = {
apiUrl: 'https://api-fans-test.banshouhui.com', apiUrl: 'https://api-book-test.banshouhui.com',
qn_base_url: 'https://static-book.kaying.cc/icon/', qn_base_url: 'https://static-book.kaying.cc/icon/',
qn_asset_url: 'https://static-book.kaying.cc/upload-image/', qn_asset_url: 'https://static-book.kaying.cc/upload-image/',
argoDebugMode: 1, argoDebugMode: 1,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
this.$store.dispatch('Get_system_info')
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')
......
...@@ -13,4 +13,20 @@ export function getList(data) { ...@@ -13,4 +13,20 @@ export function getList(data) {
method: 'POST', method: 'POST',
data 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 @@ ...@@ -23,10 +23,8 @@
<view class="billing-category"><billing-category :checked="form.category" @handleClick="billingCategoryChange"></billing-category></view> <view class="billing-category"><billing-category :checked="form.category" @handleClick="billingCategoryChange"></billing-category></view>
<view class="billing-remark"> <view class="billing-remark">
<view class="billing-remark-upload" @click="handleClickChangeImage"> <view class="billing-remark-upload" @click="handleClickChangeImage">
<u-icon name="camera"></u-icon> <image :src="takePhotoSuccessIcon" mode="" v-if="form.photos"></image>
<view class="billing-remark-upload-icon"> <image :src="takePhotoIcon" mode="" v-else></image>
<u-icon name="checkbox-mark"></u-icon>
</view>
</view> </view>
<view class="billing-remark-input"> <view class="billing-remark-input">
<u-input <u-input
...@@ -55,6 +53,7 @@ import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue'; ...@@ -55,6 +53,7 @@ import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue';
import CalendarPopup from '@/components/calendar-popup/calendar-popup.vue'; import CalendarPopup from '@/components/calendar-popup/calendar-popup.vue';
import BillingCategory from './components/billing-category.vue'; import BillingCategory from './components/billing-category.vue';
import { billingTypeOptions } from '@/utils/options/index'; import { billingTypeOptions } from '@/utils/options/index';
import { indexBaseUrl } from '@/utils/config.js';
import upload from '@/utils/upload'; import upload from '@/utils/upload';
export default { export default {
name: 'billing-details', name: 'billing-details',
...@@ -67,7 +66,9 @@ export default { ...@@ -67,7 +66,9 @@ export default {
data() { data() {
return { return {
billingTypeOptions, billingTypeOptions,
show: false, takePhotoIcon:indexBaseUrl+'shangchuanbeizhu@3x.png',
takePhotoSuccessIcon:indexBaseUrl+'shangchuanbeizhuchenggong@3x.png',
show: true,
customStyle: { customStyle: {
width: '104rpx', width: '104rpx',
height: '48rpx', height: '48rpx',
...@@ -78,7 +79,8 @@ export default { ...@@ -78,7 +79,8 @@ export default {
location: '庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威', location: '庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威庭威',
date: '2022-07-13', date: '2022-07-13',
money: '56465464646456544444444444444444444444444444444444', money: '56465464646456544444444444444444444444444444444444',
category: '2' category: '2',
photos:'1'
}, },
upload: { upload: {
uploading: false, uploading: false,
......
<template> <template>
<view class="billing-category"> <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)"> <uni-swiper-dot :info="swiperList" :current="current" field="content" :mode="mode" :dotsStyles="dotsStyles">
<view class="billing-category-item-icon"></view> <swiper class="swiper" circular :indicator-dots="false" indicator-color="#8d8d8d" indicator-active-color="#02A074" :autoplay="false" :duration="duration" @change="change">
<view class="billing-category-item-text">{{item.label}}</view> <swiper-item v-for="(swiper, swiperIndex) in swiperList" :key="swiperIndex">
</view> <view class="swiper-item">
<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">
<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>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view> </view>
</template> </template>
<script> <script>
import UniSwiperDot from "@/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue"
import { billingCategoryOptions } from '@/utils/options/index/index.js'; import { billingCategoryOptions } from '@/utils/options/index/index.js';
import { billBaseUrl } from '@/utils/config.js';
export default { export default {
name: 'billing-category', name: 'billing-category',
props: { props: {
...@@ -19,12 +32,27 @@ export default { ...@@ -19,12 +32,27 @@ export default {
}, },
data() { data() {
return { return {
billBaseUrl,
list: billingCategoryOptions, list: billingCategoryOptions,
swiperList: [1, 2],
duration: 500,
current:0,
mode:'round',
dotsStyles:{
width:8,
bottom:10,
backgroundColor:'#8d8d8d',
selectedBackgroundColor:'#02A074'
}
}; };
}, },
methods: { methods: {
handleCheck(item) { handleCheck(item) {
this.$emit('handleClick', item); this.$emit('handleClick', item);
},
change(e) {
this.current = e.detail.current;
console.log(this.current)
} }
} }
}; };
...@@ -32,10 +60,20 @@ export default { ...@@ -32,10 +60,20 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.billing-category { .billing-category {
display: flex;
flex-wrap: wrap;
margin-top: 24upx; margin-top: 24upx;
// margin-bottom: 24upx; // margin-bottom: 24upx;
width: 100%;
height: 272rpx;
.swiper {
width: 100%;
height: 272rpx;
.swiper-item {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
}
}
&-item { &-item {
padding: 0 22upx; padding: 0 22upx;
font-size: 28upx; font-size: 28upx;
...@@ -59,7 +97,7 @@ export default { ...@@ -59,7 +97,7 @@ export default {
} }
} }
.active { .active {
.billing-category-item-icon{ .billing-category-item-icon {
background-color: $default-color; background-color: $default-color;
} }
.billing-category-item-text { .billing-category-item-text {
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<u-row gutter="16"> <u-row gutter="16">
<u-col span="4" v-for="(item, index) in list" :key="index"> <u-col span="4" v-for="(item, index) in list" :key="index">
<view class="button-view" @click="openBill(item)"> <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 class="button-view-content">{{ item.label }}</view>
</view> </view>
</u-col> </u-col>
</u-row> </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> </view>
</u-popup> </u-popup>
<billing-details ref="billing-details" :type="type"></billing-details> <billing-details ref="billing-details" :type="type"></billing-details>
...@@ -19,35 +19,17 @@ ...@@ -19,35 +19,17 @@
<script> <script>
import BillingDetails from '@/components/billing-details/billing-details.vue'; import BillingDetails from '@/components/billing-details/billing-details.vue';
import { minPopupOptions } from '@/utils/options/index/index.js';
export default { export default {
name: 'mid-popup', name: 'mid-popup',
components:{ components: {
BillingDetails BillingDetails
}, },
data() { data() {
return { return {
show: false, show: false,
type:"", type: '',
list: [ list: minPopupOptions
{
label: '记行程',
path: '',
icon: '',
type:'1',
},
{
label: '维修帐',
path: '',
icon: '',
type:'2',
},
{
label: '日常帐',
path: '',
icon: '',
type:'3',
}
]
}; };
}, },
methods: { methods: {
...@@ -57,10 +39,18 @@ export default { ...@@ -57,10 +39,18 @@ export default {
close() { close() {
this.show = false; this.show = false;
}, },
openBill(item){ openBill(item) {
this.type=item.type; this.type = item.type;
this.close() this.close();
this.$refs["billing-details"].open() if (this.type === '3') {
this.$refs['billing-details'].open();
} else {
if (item.path) {
uni.navigateTo({
url: `${item.path}`
});
}
}
} }
} }
}; };
...@@ -68,24 +58,28 @@ export default { ...@@ -68,24 +58,28 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.mid-popup { .mid-popup {
padding: 20upx; padding: 0 20upx;
padding-top: 48upx;
padding-bottom: 144upx;
.button-view { .button-view {
height: 200upx;
height: 200upx;
display: flex; display: flex;
flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
&-background { margin-right: 96upx;
position: absolute; &:last-child {
z-index: 1; margin-right: 0;
width: 120upx; }
height: 120upx; &-icon {
width: 144upx;
height: 144upx;
display: flex;
} }
&-content { &-content {
position: relative; margin-top: 32upx;
z-index: 2; font-size: 32upx;
color: #ffffff; line-height: 32upx;
} }
} }
.close { .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 @@ ...@@ -57,7 +57,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx4101d2c19dfc7aab", "appid" : "wxcd75f824ec0859ba",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true "minified" : true
......
...@@ -41,7 +41,44 @@ ...@@ -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": [{ "subPackages": [{
"root": "pages/schedule", "root": "pages/schedule",
"pages": [{ "pages": [{
...@@ -100,6 +137,15 @@ ...@@ -100,6 +137,15 @@
} }
} }
,{
"path" : "quoted-price/price/price",
"style" :
{
"navigationBarTitleText": "查报价",
"enablePullDownRefresh": false
}
}
] ]
}, { }, {
"root": "pages/mine", "root": "pages/mine",
...@@ -161,6 +207,24 @@ ...@@ -161,6 +207,24 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}
,{
"path" : "update-log/update-log",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "about/about",
"style" :
{
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}
} }
] ]
}, },
...@@ -255,30 +319,31 @@ ...@@ -255,30 +319,31 @@
"selectedColor": "#303133", "selectedColor": "#303133",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "black", "borderStyle": "black",
"spacing":"6px",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "/static/image/index/service_unclick@2x.png", "iconPath": "/static/image/index/shouye0@3x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png", "selectedIconPath": "/static/image/index/shouye1@3x.png",
"text": "首页" "text": "首页"
}, { }, {
"pagePath": "pages/index/schedule/schedule", "pagePath": "pages/index/schedule/schedule",
"iconPath": "/static/image/index/control_car_gray@2x.png", "iconPath": "/static/image/index/xingcheng0@3x.png",
"selectedIconPath": "/static/image/index/control_car_click@2x.png", "selectedIconPath": "/static/image/index/xingcheng1@3x.png",
"text": "行程" "text": "行程"
}, { }, {
"pagePath": "pages/index/account/account", "pagePath": "pages/index/account/account",
"iconPath": "/static/image/index/tianj@2x.png", "iconPath": "/static/image/index/kaishijizhang@3x.png",
"selectedIconPath": "/static/image/index/tianj@2x.png", "selectedIconPath": "/static/image/index/kaishijizhang@3x.png",
"text": "" "text": ""
}, { }, {
"pagePath": "pages/index/bill/bill", "pagePath": "pages/index/bill/bill",
"iconPath": "/static/image/index/service_unclick@2x.png", "iconPath": "/static/image/index/zhangdan0@3x.png",
"selectedIconPath": "/static/image/index/service_click@2x.png", "selectedIconPath": "/static/image/index/zhangdan1@3x.png",
"text": "账单" "text": "账单"
}, { }, {
"pagePath": "pages/index/mine/mine", "pagePath": "pages/index/mine/mine",
"iconPath": "/static/image/index/personal_center_unclick@2x.png", "iconPath": "/static/image/index/wode0@3x.png",
"selectedIconPath": "/static/image/index/personal_center_click@2x.png", "selectedIconPath": "/static/image/index/wode1@3x.png",
"text": "我的" "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> <template>
<!-- 查报价 --> <!-- 查报价 -->
<view class="quoted-price"> <view class="quoted-price">
<view class="quoted-price-tips"> <quoted-price-tips></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>
<view class="quoted-price-step"> <view class="quoted-price-step">
<view class="quoted-price-step-label">操作流程:</view> <view class="quoted-price-step-label">操作流程:</view>
<view class="quoted-price-step-value"> <view class="quoted-price-step-value">
...@@ -19,20 +15,22 @@ ...@@ -19,20 +15,22 @@
<view class="quoted-price-brand"> <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" 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-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> </view>
</view> </view>
</template> </template>
<script> <script>
import QuotedPriceTips from './components/quoted-price-tips.vue';
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js'; import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
import { quotedPriceSteps } from '@/utils/options/bill/index.js'; import { quotedPriceSteps } from '@/utils/options/bill/index.js';
export default { export default {
components: {
QuotedPriceTips
},
data() { data() {
return { return {
tipsUrl: mineBaseUrl + 'shouzhishezhitixing@3x.png',
logoUrl: billBaseUrl + 'meidi@3x.png',
arrowUrl: billBaseUrl + 'meidi@3x.png', arrowUrl: billBaseUrl + 'meidi@3x.png',
steps: quotedPriceSteps, steps: quotedPriceSteps,
list: [ list: [
...@@ -60,15 +58,15 @@ export default { ...@@ -60,15 +58,15 @@ export default {
title: '美的', title: '美的',
icon: billBaseUrl + 'meidi@3x.png', icon: billBaseUrl + 'meidi@3x.png',
id: '1' id: '1'
}, }
] ]
}; };
}, },
methods: { methods: {
next(item) { next(item) {
uni.navigateTo({ uni.navigateTo({
url:`./choose-category/choose-category?id=${item.id}` url: `./choose-category/choose-category?id=${item.id}`
}) });
} }
} }
}; };
...@@ -77,30 +75,7 @@ export default { ...@@ -77,30 +75,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.quoted-price { .quoted-price {
padding: 0 24upx; 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 { &-step {
height: 104upx; height: 104upx;
background: #ffffff; background: #ffffff;
...@@ -157,7 +132,7 @@ export default { ...@@ -157,7 +132,7 @@ export default {
flex-direction: column; flex-direction: column;
margin-right: 24upx; margin-right: 24upx;
margin-bottom: 24upx; margin-bottom: 24upx;
&:nth-child(3n){ &:nth-child(3n) {
margin-right: 0; margin-right: 0;
} }
&-icon { &-icon {
......
...@@ -43,13 +43,13 @@ export default { ...@@ -43,13 +43,13 @@ export default {
justify-content: center; justify-content: center;
position: relative; position: relative;
&-icon { &-icon {
width: 40upx; width: 80upx;
height: 40upx; height: 80upx;
} }
&-value { &-value {
width: 100%; width: 100%;
text-align: center; text-align: center;
margin-top: 32upx; margin-top: 0upx;
margin-bottom: 16upx; margin-bottom: 16upx;
line-height: 32upx; line-height: 32upx;
font-size: 32upx; font-size: 32upx;
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
triggered: true, triggered: true,
freshing: false, freshing: false,
noDataText: '当前暂无账单内容', noDataText: '当前暂无账单内容',
noDataImage: 'dakawuzhuangtai@3x.png', noDataImage: 'bill/wuzhangdanneirong@3x.png',
list: [ list: [
{ {
week: '今天', week: '今天',
......
...@@ -2,17 +2,11 @@ ...@@ -2,17 +2,11 @@
<view class="plan-view"> <view class="plan-view">
<view class="plan-view-head"> <view class="plan-view-head">
<view class="plan-view-head-title">代办计划</view> <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>
<view class="time-line"> <view class="time-line">
<block v-if="list.length"> <block v-if="list.length"><plan-step :datas="list" @handleClick="handleClick" @handleRemind="handleRemind"></plan-step></block>
<plan-step :datas="list" @handleClick="handleClick" @handleRemind="handleRemind"></plan-step> <block v-else-if="afterGetList"><no-data :imageName="imageName" text="当前暂无待办计划"></no-data></block>
</block>
<block v-else-if="afterGetList">
<view class="empty-page">
<empty-page></empty-page>
</view>
</block>
</view> </view>
</view> </view>
</template> </template>
...@@ -20,6 +14,7 @@ ...@@ -20,6 +14,7 @@
<script> <script>
import AbButton from '@/components/common/ab-button.vue'; import AbButton from '@/components/common/ab-button.vue';
import EmptyPage from '@/components/common/empty-page.vue'; import EmptyPage from '@/components/common/empty-page.vue';
import NoData from '@/components/no-data';
import PlanStep from './plan-step.vue'; import PlanStep from './plan-step.vue';
export default { export default {
...@@ -27,78 +22,80 @@ export default { ...@@ -27,78 +22,80 @@ export default {
components: { components: {
AbButton, AbButton,
PlanStep, PlanStep,
EmptyPage EmptyPage,
NoData
}, },
data() { data() {
return { return {
customStyle:{ imageName: 'plan/wudaibanjihua@3x.png',
width:"160rpx", customStyle: {
height:"64rpx" width: '160rpx',
height: '64rpx'
}, },
list: [ list: [
{ // {
time: '10:30', // time: '10:30',
status: '1', // status: '1',
remark: '[杭州市]快件派送至【丰巢智能快递柜】' // remark: '[杭州市]快件派送至【丰巢智能快递柜】'
}, // },
{ // {
time: '14:00', // time: '14:00',
status: '1', // status: '1',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)' // remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
}, // },
{ // {
time: '08:30', // time: '08:30',
status: '0', // status: '0',
remark: '[杭州市]正在派送途中' // remark: '[杭州市]正在派送途中'
}, // },
{ // {
time: '14:00', // time: '14:00',
status: '0', // status: '0',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)' // remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
}, // },
{ // {
time: '08:30', // time: '08:30',
status: '0', // status: '0',
remark: '[杭州市]正在派送途中' // remark: '[杭州市]正在派送途中'
}, { // }, {
time: '14:00', // time: '14:00',
status: '0', // status: '0',
remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)' // remark: '[杭州市]快件交给黄平,正在派送途中(联系电话:15157162459)'
}, // },
{ // {
time: '08:30', // time: '08:30',
status: '0', // status: '0',
remark: '[杭州市]正在派送途中' // remark: '[杭州市]正在派送途中'
}, // },
], ],
afterGetList:false afterGetList: false
}; };
}, },
methods: { methods: {
async getList(date){ async getList(date) {
// let res=await getList() // let res=await getList()
let time=this.parseTime(date,'{y}-{m}-{d}') let time = this.parseTime(date, '{y}-{m}-{d}');
console.log(time) console.log(time);
this.afterGetList=true this.afterGetList = true;
}, },
toAdd() { toAdd() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/schedule/create-schedule/create-schedule' url: 'pages/schedule/create-schedule/create-schedule'
}); });
}, },
handleRemind(item){ handleRemind(item) {
if(item.status!=='1'){ if (item.status !== '1') {
return false return false;
} }
uni.showToast({ uni.showToast({
icon:"none", icon: 'none',
title:"提醒" title: '提醒'
}) });
}, },
handleClick(item){ handleClick(item) {
uni.navigateTo({ 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 { ...@@ -120,7 +117,7 @@ export default {
} }
.time-line { .time-line {
} }
.empty-page{ .empty-page {
height: 250upx; 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> <template>
<view class="sound-player"> <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"> <view class="sound-player-close" @click="clear" v-if="showClose">
X X
</view> </view>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<script> <script>
import freeAudio from '@/components/free-audio'; import freeAudio from '@/components/free-audio';
import {planBaseUrl} from "@/utils/config.js"
export default { export default {
components: { freeAudio }, components: { freeAudio },
props:{ props:{
...@@ -20,6 +21,8 @@ export default { ...@@ -20,6 +21,8 @@ export default {
}, },
data() { data() {
return { return {
startPic:planBaseUrl+'bofang@3x.png',
endPic:planBaseUrl+'zanting@3x.png',
}; };
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -4,7 +4,9 @@ import { ...@@ -4,7 +4,9 @@ import {
checkCodeTimetamp, checkCodeTimetamp,
showToast showToast
} from "@/utils/common.js" } 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 { import {
getCode getCode
} from "@/utils/auth.js" } from "@/utils/auth.js"
...@@ -26,7 +28,42 @@ const router = createRouter({ ...@@ -26,7 +28,42 @@ const router = createRouter({
routerBeforeEach: (to, from, next) => { routerBeforeEach: (to, from, next) => {
console.log('+++++routerBeforeEach++++') console.log('+++++routerBeforeEach++++')
console.log(to) 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) => { routerAfterEach: (to, from) => {
console.log('--------routerAfterEach----') console.log('--------routerAfterEach----')
......
const getters = { const getters = {
userInfo:state=>state.login.userInfo, 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 export default getters
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import login from './modules/login' import login from './modules/login'
import common from './modules/common'
import getters from './getters' import getters from './getters'
...@@ -9,6 +10,7 @@ Vue.use(Vuex) ...@@ -9,6 +10,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
login, login,
common,
}, },
getters 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 { ...@@ -5,13 +5,13 @@ import {
removeToken, removeToken,
removeUserinfo, removeUserinfo,
removeTimetamp, removeTimetamp,
setCodeTimetamp setTimetamp
} from "@/utils/common.js" } from "@/utils/common.js"
import { import {
loginInfo loginInfo
} from "@/utils/config.js" } from "@/utils/config.js"
import { import {
userLogin, userAuthLogin,
getProfile, getProfile,
getDVRHost, getDVRHost,
getHeadImageHost, getHeadImageHost,
...@@ -20,8 +20,13 @@ import { ...@@ -20,8 +20,13 @@ import {
import { import {
wxLogin wxLogin
} from "@/utils/auth.js" } from "@/utils/auth.js"
import {
platform,
channel
} from '@/utils/platform'
const state = { const state = {
platform: platform,
userInfo: getUserinfo(), userInfo: getUserinfo(),
scene: null, scene: null,
showPublic: false, showPublic: false,
...@@ -42,7 +47,7 @@ const state = { ...@@ -42,7 +47,7 @@ const state = {
// 1187, // 1187,
], ],
systemInfo: null, // 系统信息 systemInfo: null, // 系统信息
liveStatus:0 isIOS: false,
} }
const mutations = { const mutations = {
...@@ -62,6 +67,9 @@ const mutations = { ...@@ -62,6 +67,9 @@ const mutations = {
SET_SYSTEM_INFO: (state, data) => { SET_SYSTEM_INFO: (state, data) => {
state.systemInfo = data state.systemInfo = data
}, },
SET_IS_IOS: (state, data) => {
state.isIOS = data
},
} }
const actions = { const actions = {
...@@ -70,58 +78,105 @@ const actions = { ...@@ -70,58 +78,105 @@ const actions = {
}, data) { }, data) {
commit("SET_SCENE", data) commit("SET_SCENE", data)
}, },
Login({ App_WX_login({
state, state,
commit, commit,
dispatch dispatch
}) { }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wxLogin().then(wechatCode => { uni.showLoading({
loginInfo.wechatCode = wechatCode title: '授权中'
userLogin(loginInfo).then(res => { });
let { uni.getProvider({
code, service: 'oauth',
data success: res => {
} = res console.log('getProvider', res);
if (code === 200) { //支持微信、qq和微博等
setCodeTimetamp() if (res.provider.findIndex(e => e === 'weixin') !== -1) {
setToken(data) resolve()
resolve(res)
} else { } else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '不支持微信登录'
});
reject() reject()
} }
}).catch(err => { },
fail() {
uni.hideLoading();
reject() 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() reject()
}) }
}) })
}, },
// 获取用户信息 // 获取用户信息
GetInfo({ GetInfo({
commit, commit,
state state
}) { }) {
return new Promise((resolve, reject) => { return new Promise(async (resolve, reject) => {
getProfile().then(res => { try {
let res = await getProfile()
let { let {
code, code,
data data
} = res } = res
if (code === 200) { setUserinfo(data)
setUserinfo(data) commit("SET_USERINFO", data)
commit("SET_USERINFO", data) resolve(res)
resolve(res) } catch (e) {
} else { console.log(e)
reject()
}
}).catch(err => {
reject() reject()
}) }
}) })
}, },
// 退出系统 // 退出系统
...@@ -173,13 +228,14 @@ const actions = { ...@@ -173,13 +228,14 @@ const actions = {
Get_system_info({ Get_system_info({
commit commit
}) { }) {
uni.getSystemInfo({ let res = uni.getSystemInfoSync();
success: res => { commit("SET_SYSTEM_INFO", res)
commit("SET_SYSTEM_INFO", res) let {
} platform
}); } = res
commit("SET_IS_IOS", platform === 'ios')
}, },
// 检查用户是否已经关注公众号 // 检查用户是否已经关注公众号
Get_subscribeCyzn() { Get_subscribeCyzn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
<template>
<view class="uni-swiper__warp">
<slot />
<view v-if="mode === 'default'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
'width': (index === current? dots.width*2:dots.width ) + 'px','height':dots.width/2 +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
</view>
<view v-if="mode === 'dot'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item" />
</view>
<view v-if="mode === 'round'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
<view v-for="(item,index) in info" @click="clickItem(index)" :class="[index === current&&'uni-swiper__dots-long']" :style="{
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item " />
</view>
<view v-if="mode === 'nav'" key='nav' :style="{'background-color':dotsStyles.backgroundColor,'bottom':'0'}" class="uni-swiper__dots-box uni-swiper__dots-nav">
<text :style="{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">{{ (current+1)+"/"+info.length +' ' +info[current][field] }}</text>
</view>
<view v-if="mode === 'indexes'" key='indexes' :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
'width':dots.width + 'px','height':dots.height +'px' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes"><text class="uni-swiper__dots-indexes-text">{{ index+1 }}</text></view>
</view>
</view>
</template>
<script>
/**
* SwiperDod 轮播图指示点
* @description 自定义轮播图指示点
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
* @value defualt 默认指示点
* @value round 圆形指示点
* @value nav 条形指示点
* @value indexes 索引指示点
* @property {String} field mode 为 nav 时,显示的内容字段(mode = nav 时必填)
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
* @property {Object} dotsStyles 指示点样式
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
*/
export default {
name: 'UniSwiperDot',
emits:['clickItem'],
props: {
info: {
type: Array,
default () {
return []
}
},
current: {
type: Number,
default: 0
},
dotsStyles: {
type: Object,
default () {
return {}
}
},
// 类型 :default(默认) indexes long nav
mode: {
type: String,
default: 'default'
},
// 只在 nav 模式下生效,变量名称
field: {
type: String,
default: ''
}
},
data() {
return {
dots: {
width: 6,
height: 6,
bottom: 10,
color: '#fff',
backgroundColor: 'rgba(0, 0, 0, .3)',
border: '1px rgba(0, 0, 0, .3) solid',
selectedBackgroundColor: '#333',
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
}
}
},
watch: {
dotsStyles(newVal) {
this.dots = Object.assign(this.dots, this.dotsStyles)
},
mode(newVal) {
if (newVal === 'indexes') {
this.dots.width = 14
this.dots.height = 14
} else {
this.dots.width = 6
this.dots.height = 6
}
}
},
created() {
if (this.mode === 'indexes') {
this.dots.width = 12
this.dots.height = 12
}
this.dots = Object.assign(this.dots, this.dotsStyles)
},
methods: {
clickItem(index) {
this.$emit('clickItem', index)
}
}
}
</script>
<style lang="scss" scoped>
.uni-swiper__warp {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: column;
position: relative;
overflow: hidden;
}
.uni-swiper__dots-box {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-swiper__dots-item {
width: 8px;
border-radius: 100px;
margin-left: 6px;
background-color: rgba(0, 0, 0, 0.4);
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
/* #ifdef H5 */
// border-width: 5px 0;
// border-style: solid;
// border-color: transparent;
// background-clip: padding-box;
/* #endif */
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
}
.uni-swiper__dots-item:first-child {
margin: 0;
}
.uni-swiper__dots-default {
border-radius: 100px;
}
.uni-swiper__dots-long {
border-radius: 50px;
}
.uni-swiper__dots-bar {
border-radius: 50px;
}
.uni-swiper__dots-nav {
bottom: 0px;
// height: 26px;
padding: 8px 0;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: flex-start;
align-items: center;
background-color: rgba(0, 0, 0, 0.2);
}
.uni-swiper__dots-nav-item {
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; */
font-size: 14px;
color: #fff;
margin: 0 15px;
}
.uni-swiper__dots-indexes {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
// flex: 1;
justify-content: center;
align-items: center;
}
.uni-swiper__dots-indexes-text {
color: #fff;
font-size: 12px;
line-height: 14px;
}
</style>
let localtionshowModal = null let localtionshowModal = null
import store from "@/store/index.js" import {platform, channel} from './platform'
export function showModal({ export function showModal({
content = "检测到您没打开获取位置信息功能权限,是否去设置打开?", content = "检测到您没打开获取位置信息功能权限,是否去设置打开?",
...@@ -110,23 +110,44 @@ export const getWritePhotosAlbum = function() { ...@@ -110,23 +110,44 @@ export const getWritePhotosAlbum = function() {
}) })
} }
export const wxLogin = function() { export const wxLogin = function(provider) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.login({ uni.login({
// #ifdef APP-PLUS
provider: 'weixin', provider: 'weixin',
onlyAuthorize: true,
// #endif
success: res => { 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 { let {
errMsg, errMsg,
errCode,
code code
} = res } = err;
if (errMsg === "login:ok") {
resolve(code) let title = '登录失败';
}else{ if (errCode === -8) {
reject() title = '请先安装微信客户端';
} }
}, if(platform==='4'){
fail: err => { uni.showModal({
reject() content: title,
showCancel: false
});
}
reject(err);
} }
}); });
}) })
......
...@@ -7,8 +7,7 @@ import { ...@@ -7,8 +7,7 @@ import {
} from "./config.js" } from "./config.js"
export function setToken(data) { export function setToken(data) {
uni.setStorageSync(token, data); uni.setStorageSync(token, data);
let time = new Date().getTime() setTimetamp()
uni.setStorageSync(TIMETAMP, time);
} }
export function getToken() { export function getToken() {
...@@ -17,8 +16,8 @@ export function getToken() { ...@@ -17,8 +16,8 @@ export function getToken() {
export function removeToken() { export function removeToken() {
uni.removeStorageSync(token); uni.removeStorageSync(token);
uni.removeStorageSync(TIMETAMP); removeTimetamp()
uni.removeStorageSync(userinfo); removeUserinfo()
} }
export function setTimetamp() { export function setTimetamp() {
...@@ -59,6 +58,15 @@ export function removeUserinfo() { ...@@ -59,6 +58,15 @@ export function removeUserinfo() {
uni.removeStorageSync(userinfo); uni.removeStorageSync(userinfo);
} }
export function setQuotedPriceTooltip(data) {
uni.setStorageSync("quotedPriceTooltip", data);
}
export function getQuotedPriceTooltip() {
return uni.getStorageSync("quotedPriceTooltip") || false
}
export function checkPhone() { export function checkPhone() {
let userinfo = getUserinfo() let userinfo = getUserinfo()
let { let {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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