界面刷新

This commit is contained in:
jia 2023-11-28 08:59:04 +08:00
parent 46a0a22722
commit 3022db1349
14 changed files with 911 additions and 371 deletions

View File

@ -10,10 +10,7 @@
//
plus.screen.lockOrientation('landscape-primary');
// #endif
var main = plus.android.runtimeMainActivity();
var pkName = main.getPackageName();
console.log(pkName)
},
onShow: function() {
console.log('App Show')
@ -23,8 +20,7 @@
//
//#ifdef APP-PLUS
jpushModule.addNotificationListener(res => {
console.log(res,'111111')
// console.log(res, '111111')
if (res.notificationEventType == 'notificationOpened') return
audioContext.play()
uni.vibrateLong();
@ -51,6 +47,5 @@
@import "static/css/base.css";
@import url('static/iconfont/iconfont.css')
</style>

View File

@ -12,43 +12,65 @@
},
endPoint: {
type: Array,
default: () => [],
default: () => [116.40717,39.90469],
},
},
computed: {
points() {
console.log(this.startPoint, this.endPoint)
// console.log(this.startPoint, this.endPoint)
return {
startPoint: this.startPoint,
endPoint: this.endPoint
};
}
}
},
};
</script>
<script module="aMapRenderJs" lang="renderjs">
import {
Toast
} from '.././libs/uniApi'
const A_MAP_KEY = "4e96ffd5a5612a52c9caa25312ed9ace";
const A_MAP_SECRET_KEY = "4817909f57e07c7694c056a62bb39124";
export default {
mounted() {
if (typeof window.AMap === 'function') {
this.initAmap();
} else {
window._AMapSecurityConfig = {
securityJsCode: A_MAP_SECRET_KEY,
};
const script = document.createElement('script');
script.src = `https://webapi.amap.com/maps?v=1.4.15&key=${A_MAP_KEY}&plugin=AMap.Driving`;
this.loadMapApi().then(() => {
this.initAmap()
})
script.onload = this.initAmap.bind(this);
document.head.appendChild(script);
}
},
methods: {
loadMapApi() {
const A_MAP_KEY = "4e96ffd5a5612a52c9caa25312ed9ace";
const A_MAP_SECRET_KEY = "4817909f57e07c7694c056a62bb39124";
return new Promise((resolve, reject) => {
if (typeof window.AMap === 'function') {
resolve()
} else {
const script = document.createElement('script')
script.src =
`https://webapi.amap.com/maps?v=1.4.15&key=${A_MAP_KEY}&plugin=AMap.Driving&async=true&defer=true`
script.onload = () => {
window._AMapSecurityConfig = {
securityJsCode: A_MAP_SECRET_KEY
}
resolve()
}
script.onerror = reject
document.head.appendChild(script)
}
})
},
initAmap() {
const map = new AMap.Map('amap', {
center: this.startPoint,
resizeEnable: true,
});
//
@ -73,6 +95,8 @@
console.log('绘制路线完成');
} else {
console.error('路线数据查询失败' + result);
this.$emit('sbai','1')
}
}
);
@ -82,5 +106,7 @@
this.makeWalking();
},
},
};
</script>

View File

@ -18,7 +18,7 @@
:polyline="polyline" :markers='markers'><cover-image class="map_btn" @tap="getoption()"
src="@/static/images/DH.png">
</cover-image></map> -->
<a-map-walking :startPoint="startPoint" :endPoint="endPoint"
<a-map-walking :startPoint="startPoint" :endPoint="endPoint" @sbai='onshibai'
style="width: 100%;height: 265rpx;"></a-map-walking>
<view class="walking-img">
<image src="@/static/images/DH.png" mode="aspectFit" @click="getoption()"></image>
@ -36,7 +36,7 @@
</view>
<view class="btn" @click="openCamera(lisobj.logistics)">
<view class="btn" @click="openCamera(lisobj.logistics)" v-if="lisobj.logistics">
<view class="btn1">
@ -136,7 +136,7 @@
<script>
import {
detail,
takeGoods
} from '@/api/oa.js'
const ttAMapNavi = uni.requireNativePlugin('TT-AMapNavi');
import AMapWalking from "@/components/a-map-walking.vue";
@ -188,20 +188,19 @@
}
},
onLoad() {
},
mounted() {
this.getlist(this.type)
this.getLocation()
// this.$refs.globalPopup.open()
},
methods: {
//
returnlog() {
this.$emit('outfun', '1')
@ -210,6 +209,17 @@
console.log('Map updated:', e);
// 线线polylinemarkers
},
//
onshibai(e) {
if (e == 1) {
uni.showToast({
title: '路线规划失败',
icon: none
})
}
},
//
getoption() {
@ -329,7 +339,7 @@
},
//
getLocation() {
async getLocation() {
uni.getLocation({
type: 'gcj02',
@ -353,7 +363,6 @@
// })
},
fail: (res) => {
console.log(res)
@ -362,15 +371,6 @@
});
},
serch() {
this.getlist()
},
inpuval(e) {
if (e.length == 0) {
this.getlist()
}
},
//
getDocumentListApi(item, oredr) {
@ -380,14 +380,18 @@
order_sn: oredr
}
takeGoods(data).then(res => {
// Toast(res.msg)
if (res.code == 1) {
this.getlist()
const subNVue = uni.getSubNVueById('concat'); // id nvue
subNVue.show('none', 250); // nvue
subNVue.show('none', 1000); // nvue
setTimeout(() => {
this.$emit('outfun', '1')
}, 1500)
}
})
@ -811,7 +815,7 @@
.btn1 {
width: 23rpx;
height: 23rpx;
margin-left: 80rpx;
margin-left: 100rpx;
margin-top: 0rpx;
margin-right: 10rpx;
}

View File

@ -115,7 +115,22 @@
<div class="shop-content-a1">商品信息</div>
<div class="shop-content-a2">{{ lisobj.product.length }}</div>
</view>
<view class="shop-list">
<view class="shop" v-for="(items,j) in lisobj.product" :key="j">
<view style="display: flex;">
<view class="shop-img">
<image :src="items.goods_pic" mode="aspectFit"></image>
</view>
<view class="container-txt">
<text class=" centered-multi-line shop-txt">
{{ items.goods_name }}</text>
</view>
</view>
<view style="line-height: 34rpx;">X{{ items.product_num}}</view>
</view>
</view>
<!-- <view class="shop" v-for="(items,j) in lisobj.product" :key="j">
<view style="display: flex;">
<view class="shop-img">
<image :src="items.goods_pic" alt="">
@ -123,7 +138,7 @@
<view class="shop-txt">{{ items.goods_name }}</view>
</view>
<view style="line-height: 26rpx;">X{{ items.product_num}}</view>
</view>
</view> -->
</view>
@ -184,7 +199,6 @@
},
data() {
return {
lisobj: [],
page_no: 1,
page_size: 1,
@ -194,11 +208,13 @@
}
},
mounted() {
this.getlist(this.type)
// console.log(this.type)
this.$refs.globalPopup.show();
},
methods: {
returnlog() {
@ -224,12 +240,15 @@
take_code: this.code
}).then((res) => {
console.log(res)
this.code = ''
if (res.code == 1) {
// Toast(res.msg)
this.$refs.globalPopup.open()
setTimeout(() => {
this.$emit('outfun', '2')
}, 1500)
}
@ -256,16 +275,8 @@
close() {
this.$refs.globalPopup.close()
},
serch() {
this.getlist()
},
inpuval(e) {
if (e.length == 0) {
this.getlist()
}
},
getlist(id) {
detail({
id: id
@ -278,7 +289,7 @@
},
openCamera() {
console.log('1111111')
// this.show1()
this.isShow1 = !this.isShow1
}
@ -651,32 +662,90 @@
color: #0022c7;
}
.shop {
height: 130px;
overflow: hidden;
overflow-y: auto;
.shop-content {
padding-left: 20px;
padding-right: 20px;
display: flex;
justify-content: space-between;
}
.shop-image {
width: 26px;
height: 26px;
.shop-content-a {
display: flex;
justify-content: space-between;
margin-top: 14px;
margin-bottom: 10px;
}
.shop-content-a1 {
font-size: 13rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
}
.shop-content-a2 {
font-size: 12rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #0022C7;
}
.shop-list {
height: 220rpx;
overflow: hidden;
overflow-y: auto;
margin-bottom: 10rpx;
}
.shop {
display: flex;
justify-content: space-between;
font-size: 10rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
margin-bottom: 10rpx;
}
.shop-img {
width: 34rpx;
height: 34rpx;
border-radius: 6px 6px 6px 6px;
}
.shop-img image {
width: 26px;
height: 26px;
width: 34rpx;
height: 34rpx;
border-radius: 6px 6px 6px 6px;
}
.container-txt {
margin-left: 10rpx;
width: 130rpx;
/* 设置容器高度 */
display: flex;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
}
.centered-multi-line {
text-align: left;
/* 文本水平居中 */
width: 100%;
/* 宽度占满父容器 */
}
.shop-txt {
margin-left: 20px;
display: inline-block;
/* 转换为行内块元素 */
white-space: normal;
/* 允许自动换行 */
word-break: break-all;
/* 单词内断行 */
}
}

View File

@ -109,13 +109,31 @@
<div class="shop-content-a1">商品信息</div>
<div class="shop-content-a2">{{ lisobj.product.length }}</div>
</view>
<view class="shop-list">
<view class="shop" v-for="(items,j) in lisobj.product" :key="j">
<view style="display: flex;">
<view class="shop-img">
<image :src="items.goods_pic" mode="aspectFit"></image>
</view>
<view class="container-txt">
<text class=" centered-multi-line shop-txt">
{{ items.goods_name }}</text>
</view>
</view>
<view style="line-height: 34rpx;">X{{ items.product_num}}</view>
</view>
</view>
<!-- <view class="shop" v-for="(items,j) in lisobj.product" :key="j">
<view style="display: flex;">
<view class="shop-img"> <img :src="items.goods_pic" alt=""></view>
<view class="shop-txt">{{ items.goods_name }}</view>
</view>
<view style="line-height: 26rpx;">X{{ items.product_num}}</view>
</view>
</view> -->
</view>
</view>
@ -156,15 +174,7 @@
// })
this.$emit('outfun', '3')
},
serch() {
this.getlist()
},
inpuval(e) {
if (e.length == 0) {
this.getlist()
}
},
getlist(id) {
detail({
id: id
@ -172,7 +182,7 @@
if (res.code == 1) {
this.lisobj = res.data
console.log(this.lisobj, '11111')
}
})
}
@ -438,31 +448,90 @@
color: #0022c7;
}
.shop {
height: 130px;
overflow: hidden;
overflow-y: auto;
.shop-content {
padding-left: 20px;
padding-right: 20px;
}
.shop-content-a {
display: flex;
justify-content: space-between;
margin-top: 14px;
margin-bottom: 10px;
}
.shop-content-a1 {
font-size: 13rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
}
.shop-content-a2 {
font-size: 12rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #0022C7;
}
.shop-list {
height: 220rpx;
overflow: hidden;
overflow-y: auto;
margin-bottom: 10rpx;
}
.shop {
display: flex;
justify-content: space-between;
font-size: 10rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
margin-bottom: 10rpx;
}
.shop-img {
width: 26px;
height: 26px;
width: 34rpx;
height: 34rpx;
border-radius: 6px 6px 6px 6px;
}
.shop-img img {
width: 26px;
height: 26px;
.shop-img image {
width: 34rpx;
height: 34rpx;
border-radius: 6px 6px 6px 6px;
}
.container-txt {
margin-left: 10rpx;
width: 130rpx;
/* 设置容器高度 */
display: flex;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
}
.centered-multi-line {
text-align: left;
/* 文本水平居中 */
width: 100%;
/* 宽度占满父容器 */
}
.shop-txt {
margin-left: 20px;
display: inline-block;
/* 转换为行内块元素 */
white-space: normal;
/* 允许自动换行 */
word-break: break-all;
/* 单词内断行 */
}
}
}

View File

@ -1,11 +1,13 @@
<template>
<view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container">
<view class="container-top">
<!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> -->
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false' height="3"
bgColor='#fff'></u-search>
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false'
height="3" bgColor='#fff'></u-search>
<view class="serch" @click="serch">搜索</view>
</view>
@ -79,6 +81,11 @@
</view>
</view>
</view>
</you-scroll>
<uni-popup ref="globalPopup" :custom="true">
<view class="popup-content" @click="close">
<view class="popup-content-a">
@ -106,7 +113,11 @@
Toast
} from '../../libs/uniApi'
import youScroll from '@/components/you-scroll'
export default {
components: {
youScroll
},
data() {
return {
@ -125,15 +136,23 @@
camera: 'auto'
}
},
mounted() {
this.getlist()
mounted() {
this.initlist()
},
methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
}, 1000 * 1)
},
refresh() {
this.initlist()
},
close() {
this.$refs.globalPopup.close()
@ -166,6 +185,7 @@
data
).then(res => {
if (res.code == 1) {
uni.hideLoading();
this.list = [...this.list, ...res.data]
this.page_no = this.page_no + 1
@ -179,7 +199,9 @@
// url: '/pages/index/detail?id=' + item.id
// })
// })
this.$emit('onfunction', item.id)
this.$emit('onfunction', item.id, 1)
},
loadMoreData() {
@ -187,13 +209,12 @@
},
//
getDocumentListApi(item, oredr) {
let data = {
id: item.id,
order_id: item.order_id,
order_sn: oredr
}
console.log(data)
takeGoods(data).then(res => {
// Toast(res.msg)
@ -206,11 +227,11 @@
},
//
openCamera(item) {
console.log(item);
uni.scanCode({
success: (res) => {
this.getDocumentListApi(item, res.result)
// console.log(res.result); //
console.log(item, res.result); //
}
});

View File

@ -1,10 +1,12 @@
<template>
<view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container">
<view class="container-top">
<!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> -->
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false' height="30"
bgColor='#fff'></u-search>
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false'
height="30" bgColor='#fff'></u-search>
<view class="serch" @click="serch">搜索</view>
</view>
<view class="container-content" v-if="list.length>0">
@ -68,6 +70,12 @@
</view>
</view>
</view>
</view>
</you-scroll>
<gb-popup :isShow="isShow1" rName="确定" :isBut="false" lName="取消" @lEvent="copyshow" @rEvent="copyData"
title="请输入取件码">
@ -87,7 +95,8 @@
</view>
<view class="popup-item">
<image src="@/static/images/zzw.png" mode="aspectFit" style="width: 150rpx; height: 150rpx;">
<image src="@/static/images/zzw.png" mode="aspectFit"
style="width: 150rpx; height: 150rpx;">
</image>
</view>
</view>
@ -102,8 +111,12 @@
delivery
} from '@/api/oa.js'
export default {
import youScroll from '@/components/you-scroll'
export default {
components: {
youScroll
},
data() {
return {
isShow1: false,
@ -124,11 +137,18 @@
}
},
mounted() {
this.getlist()
this.initlist()
},
methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
}, 1000 * 1)
},
refresh() {
this.initlist()
@ -231,7 +251,7 @@
// uni.navigateTo({
// url: '/pages/psong/detail?id=' + item.id
// })
this.$emit('onfunction1', item.id)
this.$emit('onfunction', item.id,2)
},
//

View File

@ -1,4 +1,6 @@
<template>
<view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container">
<view class="container-top">
@ -44,7 +46,8 @@
<view class="shop-list">
<view :class="item.status==3?'shop1':'shop'" v-for="(items,j) in item.products" :key="j">
<view :class="item.status==3?'shop1':'shop'" v-for="(items,j) in item.products"
:key="j">
<view style="display: flex;">
<view class="shop-img">
<image :src="items.goods_pic" mode=""></image>
@ -82,6 +85,8 @@
</view>
</view>
</view>
</view>
</you-scroll>
</view>
</template>
@ -90,8 +95,11 @@
import {
lists
} from '@/api/oa.js'
import youScroll from '@/components/you-scroll'
export default {
components: {
youScroll
},
data() {
return {
@ -111,10 +119,18 @@
}
},
mounted() {
this.initlist()
},
methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
},1000*1)
},
refresh() {
this.initlist()
@ -155,7 +171,7 @@
// uni.navigateTo({
// url: '/pages/sda/detail?id=' + item.id
// })
this.$emit('onfunction2', item.id)
this.$emit('onfunction', item.id,3)
},
loadMoreData() {

271
components/you-scroll.vue Normal file
View File

@ -0,0 +1,271 @@
<template>
<view class="you-scroll" ref="youScroll">
<view class="pullDown" :style="{ transform: 'translateY('+translateY+'px)', transition: isDown ? '0s' : '0.3s' }">
<slot name="pullDown">
<!-- <img src="@/static/pullDown.jpg" :class="{'down-icon': true,'animate': pullDownStatus == 3}"></img> -->
<span>
<block v-if="pullDownStatus == 1">{{downPullToRefresh}}</block>
<block v-if="pullDownStatus == 2">{{downReleaseToRefresh}}</block>
<block v-if="pullDownStatus == 3">{{downRefreshing}}</block>
</span>
</slot>
</view>
<scroll-view class="you-scroll-inner" ref="youScrollInner" :scroll-top="scrollToTop" scroll-with-animation scroll-y :style="{ transform: 'translateY('+translateY+'px)', transition: isDown ? '0s' : 'transform 0.3s' }"
@touchstart="startFn" @touchmove="moveFn" @touchend="endFn" @touchcancel="endFn" @scroll="scroll">
<view class="you-scroll-content">
<slot></slot>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
scrollToTop: 0,
scrollTop: 0,
oldTop: 0,
sPageY: 0,
mPageY: 0,
ePageY: 0,
translateY: 0,
pullDownStatus: 1, // 1 2 3
isDown: false
};
},
props: {
pullDownDistance: {
type: Number,
default: 50 //
},
reachBottomDistance: {
type: Number,
default: 30 //
},
downPullToRefresh: {
type: String,
default: '下拉刷新'
},
downReleaseToRefresh: {
type: String,
default: '松开刷新'
},
downRefreshing: {
type: String,
default: '刷新中…'
},
},
methods: {
startFn(e) {
this.isDown = true;
this.sPageY = e.changedTouches[0].pageY;
this.pointY = this.translateY;
},
moveFn(e) {
let view = uni.createSelectorQuery().in(this).select(".you-scroll-inner");
view.fields({
size: true,
scrollOffset: true
}, data => {
this.scrollTop = data.scrollTop;
this.mPageY = e.changedTouches[0].pageY;
if (this.scrollTop <= 0) {
let translateY = ((this.mPageY - this.sPageY) / 2) + this.pointY;
this.translateY = (translateY < 0 ? 0 : translateY);
if(this.pullDownStatus != 3) {
if(this.translateY < this.pullDownDistance) {
this.pullDownStatus = 1;
} else if(this.translateY >= this.pullDownDistance) {
this.pullDownStatus = 2;
}
}
}
}).exec();
},
endFn(e) {
this.isDown = false;
this.ePageY = e.changedTouches[0].pageY;
setTimeout(() => {
this.translateY = this.translateY >= this.pullDownDistance ? this.pullDownDistance : 0;
if(this.pullDownStatus == 2) { //
this.pullDownStatus = 3;
this.$emit('onPullDown',this.endPullDown);
}
},100)
},
endPullDown(mm) {
if(this.timeout) clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
this.translateY = 0;
this.pullDownStatus = 1;
}, mm || 0);
},
prevent(e) {
if(this.translateY > 0) {
e.preventDefault();
}
},
scroll(e) {
this.$emit('onScroll',e);
this.oldTop = e.detail.scrollTop;
if(this.timeout) clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
this.scrolltolower(e);
},20);
},
scrolltolower(e) {
let view = uni.createSelectorQuery().in(this).select(".you-scroll-inner");
view.fields({
size: true,
scrollOffset: true
}, data => {
if(data.scrollTop >= (e.detail.scrollHeight - data.height - this.reachBottomDistance)) {
this.$emit('onLoadMore',e);
}
}).exec();
},
isWeixinCient(){
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)=="micromessenger") {
return true;
} else {
return false;
}
},
goTop(top) {
this.scrollToTop = this.oldTop;
this.$nextTick(function() {
this.scrollToTop = top || 0;
});
}
},
mounted() {
// #ifdef H5
if(this.isWeixinCient()) {
document.body.addEventListener('touchmove', this.prevent);
}
// #endif
},
destroyed() {
// #ifdef H5
if(this.isWeixinCient()) {
document.body.removeEventListener('touchmove', this.prevent);
}
// #endif
}
}
</script>
<style scoped>
.you-scroll {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
// background-color: #eee;
}
.you-scroll .pullDown {
width: 100%;
height: 40px;
line-height: 50px;
text-align: center;
font-size: 14px;
overflow: hidden;
transform: translateY(-100%);
position: absolute;
top: -40px;
left: 0;
}
.you-scroll .pullDown .down-icon {
width: 40px;
height: 32px;
display: inline-block;
vertical-align: middle;
}
.you-scroll .pullDown .animate {
-webkit-animation: scaleIcon 1s infinite linear;
-moz-animation: scaleIcon 1s infinite linear;
-ms-animation: scaleIcon 1s infinite linear;
animation: scaleIcon 1s infinite linear;
}
.you-scroll .pullDown span {
white-space: nowrap;
overflow: hidden;
display: inline-block;
vertical-align: middle;
}
.you-scroll .you-scroll-inner {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
.you-scroll-content {
overflow: hidden;
}
@-webkit-keyframes scaleIcon {
0% {
transform: scaleY(1);
}
40% {
transform: scaleY(0.8);
}
80% {
transform: scaleY(0.9);
}
100% {
transform: scaleY(1);
}
}
@-moz-keyframes scaleIcon {
0% {
transform: scaleY(1);
}
40% {
transform: scaleY(0.8);
}
80% {
transform: scaleY(0.9);
}
100% {
transform: scaleY(1);
}
}
@-ms-keyframes scaleIcon {
0% {
transform: scaleY(1);
}
40% {
transform: scaleY(0.8);
}
80% {
transform: scaleY(0.9);
}
100% {
transform: scaleY(1);
}
}
@keyframes scaleIcon {
0% {
transform: scaleY(1);
}
40% {
transform: scaleY(0.8);
}
80% {
transform: scaleY(0.9);
}
100% {
transform: scaleY(1);
}
}
</style>

View File

@ -6,7 +6,7 @@
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
"enablePullDownRefresh": true,
"app-plus": {
"subNVues": [{
"id": "concat", //

View File

@ -108,7 +108,6 @@
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
methods: {

View File

@ -22,12 +22,9 @@
<view class="left-bottom-right">
<view class="bottom-right1">
<view class="bottom-right_a">
</view>
<view class="bottom-right_b">
{{oaUserInfo.nickname ?'在线':'离线'}}
</view>
</view>
<view class="bottom-right2" @click="logout">
@ -37,13 +34,12 @@
</view>
</view>
<view class="content-right">
<index ref="list" @onfunction='onfunction' v-if="num==0&&isshow" />
<indexa :type='type' @outfun='outfun' v-if="num==0&&!isshow" />
<index1 ref="list1" @onfunction1='onfunction1' v-if="num==1&&isshow1" />
<indexb :type='type' @outfun='outfun' v-if="num==1&&!isshow1" />
<pindex ref="list2" @onfunction2='onfunction2' v-if="num==2&&isshow2" />
<indexc :type='type' @outfun='outfun' v-if="num==2 &&!isshow2" />
<index ref="list" @onfunction='onfunction' v-show="showIndexComponent" />
<indexa :type='type' @outfun='outfun' v-if="showIndexAComponent" />
<index1 ref="list1" @onfunction='onfunction' v-show="showIndex1Component" />
<indexb :type='type' @outfun='outfun' v-if="showIndexBComponent" />
<pindex ref="list2" @onfunction='onfunction' v-show="showPIndexComponent" />
<indexc :type='type' @outfun='outfun' v-if="showIndexCComponent" />
</view>
</view>
@ -106,7 +102,24 @@
oaUserInfo() {
return this.$store.state.app.userInfo
},
showIndexComponent: function() {
return this.num === 0 && this.isshow;
},
showIndexAComponent: function() {
return this.num === 0 && !this.isshow;
},
showIndex1Component: function() {
return this.num === 1 && this.isshow1;
},
showIndexBComponent: function() {
return this.num === 1 && !this.isshow1;
},
showPIndexComponent: function() {
return this.num === 2 && this.isshow2;
},
showIndexCComponent: function() {
return this.num === 2 && !this.isshow2;
}
},
onLoad() {
@ -114,21 +127,43 @@
},
onPullDownRefresh() {
if (this.num == 0) {
// onPullDownRefresh() {
// if (this.num == 0 && this.isshow) {
// this.$refs.list.refresh()
// uni.stopPullDownRefresh()
// } else if (this.num == 1 && this.isshow1) {
// this.$refs.list1.refresh()
// uni.stopPullDownRefresh()
// } else if (this.num == 2 && this.isshow2) {
// this.$refs.list2.refresh()
// uni.stopPullDownRefresh()
// }
// },
onShow() {
if (this.num == 0 && this.isshow) {
this.$refs.list.refresh()
uni.stopPullDownRefresh()
} else if (this.num == 1) {
} else if (this.num == 1 && this.isshow1) {
this.$refs.list1.refresh()
uni.stopPullDownRefresh()
} else {
} else if (this.num == 2 && this.isshow2) {
this.$refs.list2.refresh()
uni.stopPullDownRefresh()
}
},
mounted() {
mounted() {
if (this.num == 0 && this.isshow) {
this.$refs.list.refresh()
uni.stopPullDownRefresh()
} else if (this.num == 1 && this.isshow1) {
this.$refs.list1.refresh()
uni.stopPullDownRefresh()
} else if (this.num == 2 && this.isshow2) {
this.$refs.list2.refresh()
uni.stopPullDownRefresh()
}
},
methods: {
login() {
@ -137,59 +172,75 @@
})
},
logout() {
uni.showModal({
title: '提示',
content: '确定退出?',
cancelText: "取消", //
confirmText: "确认", //
showCancel: true, // true
confirmColor: '#f55850',
cancelColor: '#39B54A',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/oaLogin/oaLogin'
})
console.log('comfirm') //
} else {
console.log('cancel') //
}
}
})
},
getlist(index) {
this.num = index
if (index == 1) {
this.$refs.list1.refresh()
this.isshow2 = true
this.isshow = true
}
if (index == 2) {
this.isshow1 = true
this.isshow = true
this.$refs.list2.refresh()
}
if (index == 0) {
this.$refs.list.refresh()
this.isshow1 = true
this.isshow2 = true
}
},
onfunction(e) {
if (e) {
onfunction(e,id) {
console.log(e,id)
if (id == 1) {
this.isshow = false
this.type = e
}
},
onfunction1(e) {
if (e) {
} else if (id == 2) {
this.isshow1 = false
this.type = e
}
},
onfunction2(e) {
if (e) {
} else {
this.isshow2 = false
this.type = e
}
},
outfun(e) {
if (e == 1) {
this.$refs.list.refresh()
this.isshow = true
} else if (e == 2) {
this.$refs.list1.refresh()
this.isshow1 = true
} else {
this.$refs.list2.refresh()
this.isshow2 = true
}
},

View File

@ -104,7 +104,7 @@
jpushModule.getRegistrationID(result => {
console.log("设备----", result)
// id
this.formData.register_id = result.registerID || 1
this.formData.register_id = result.registerID
console.log("设备----", this.formData)
})
// #endif
@ -117,6 +117,7 @@
async login() {
if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
@ -126,7 +127,7 @@
// })
console.log(that.formData)
let res = await loginAccount(that.formData);
console.log(res)
// console.log(res)
encrypt.encode('ACT', that.formData);
this.$store.commit('SET_USERINFO', {
@ -139,8 +140,6 @@
// console.log(data, '11111111')
// this.$store.commit('setUserInfo', data);
uni.hideLoading()
if (res.data.token) {
// console.log('111111111')

BIN
static/pullDown.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB