界面刷新

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

19
App.vue
View File

@ -2,18 +2,15 @@
//#ifdef APP-PLUS //#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush"); const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
// #ifdef APP-PLUS // #ifdef APP-PLUS
// //
plus.screen.lockOrientation('landscape-primary'); plus.screen.lockOrientation('landscape-primary');
// #endif // #endif
var main = plus.android.runtimeMainActivity();
var pkName = main.getPackageName();
console.log(pkName)
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')
@ -23,8 +20,7 @@
// //
//#ifdef APP-PLUS //#ifdef APP-PLUS
jpushModule.addNotificationListener(res => { jpushModule.addNotificationListener(res => {
console.log(res,'111111') // console.log(res, '111111')
if (res.notificationEventType == 'notificationOpened') return if (res.notificationEventType == 'notificationOpened') return
audioContext.play() audioContext.play()
uni.vibrateLong(); uni.vibrateLong();
@ -48,9 +44,8 @@
page { page {
background: #F3F4F8; background: #F3F4F8;
} }
@import "static/css/base.css";
@import "static/css/base.css";
@import url('static/iconfont/iconfont.css') @import url('static/iconfont/iconfont.css')
</style> </style>

View File

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

View File

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

View File

@ -115,7 +115,22 @@
<div class="shop-content-a1">商品信息</div> <div class="shop-content-a1">商品信息</div>
<div class="shop-content-a2">{{ lisobj.product.length }}</div> <div class="shop-content-a2">{{ lisobj.product.length }}</div>
</view> </view>
<view class="shop" v-for="(items,j) in lisobj.product" :key="j"> <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 style="display: flex;">
<view class="shop-img"> <view class="shop-img">
<image :src="items.goods_pic" alt=""> <image :src="items.goods_pic" alt="">
@ -123,7 +138,7 @@
<view class="shop-txt">{{ items.goods_name }}</view> <view class="shop-txt">{{ items.goods_name }}</view>
</view> </view>
<view style="line-height: 26rpx;">X{{ items.product_num}}</view> <view style="line-height: 26rpx;">X{{ items.product_num}}</view>
</view> </view> -->
</view> </view>
@ -184,7 +199,6 @@
}, },
data() { data() {
return { return {
lisobj: [], lisobj: [],
page_no: 1, page_no: 1,
page_size: 1, page_size: 1,
@ -194,11 +208,13 @@
} }
}, },
mounted() { mounted() {
this.getlist(this.type) this.getlist(this.type)
// console.log(this.type) // console.log(this.type)
this.$refs.globalPopup.show();
}, },
methods: { methods: {
returnlog() { returnlog() {
@ -224,12 +240,15 @@
take_code: this.code take_code: this.code
}).then((res) => { }).then((res) => {
console.log(res)
this.code = '' this.code = ''
if (res.code == 1) { if (res.code == 1) {
// Toast(res.msg) // Toast(res.msg)
this.$refs.globalPopup.open() this.$refs.globalPopup.open()
setTimeout(() => {
this.$emit('outfun', '2') this.$emit('outfun', '2')
}, 1500)
} }
@ -256,16 +275,8 @@
close() { close() {
this.$refs.globalPopup.close() this.$refs.globalPopup.close()
}, },
serch() {
this.getlist()
},
inpuval(e) {
if (e.length == 0) {
this.getlist()
}
},
getlist(id) { getlist(id) {
detail({ detail({
id: id id: id
@ -278,7 +289,7 @@
}, },
openCamera() { openCamera() {
console.log('1111111')
// this.show1() // this.show1()
this.isShow1 = !this.isShow1 this.isShow1 = !this.isShow1
} }
@ -651,32 +662,90 @@
color: #0022c7; color: #0022c7;
} }
.shop { .shop-content {
height: 130px; padding-left: 20px;
overflow: hidden; padding-right: 20px;
overflow-y: auto;
display: flex;
justify-content: space-between;
} }
.shop-image { .shop-content-a {
width: 26px; display: flex;
height: 26px; 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; border-radius: 6px 6px 6px 6px;
} }
.shop-img image { .shop-img image {
width: 26px; width: 34rpx;
height: 26px; height: 34rpx;
border-radius: 6px 6px 6px 6px; 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 { .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-a1">商品信息</div>
<div class="shop-content-a2">{{ lisobj.product.length }}</div> <div class="shop-content-a2">{{ lisobj.product.length }}</div>
</view> </view>
<view class="shop" v-for="(items,j) in lisobj.product" :key="j">
<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 style="display: flex;">
<view class="shop-img"> <img :src="items.goods_pic" alt=""></view> <view class="shop-img"> <img :src="items.goods_pic" alt=""></view>
<view class="shop-txt">{{ items.goods_name }}</view> <view class="shop-txt">{{ items.goods_name }}</view>
</view> </view>
<view style="line-height: 26rpx;">X{{ items.product_num}}</view> <view style="line-height: 26rpx;">X{{ items.product_num}}</view>
</view> </view> -->
</view> </view>
</view> </view>
@ -156,15 +174,7 @@
// }) // })
this.$emit('outfun', '3') this.$emit('outfun', '3')
}, },
serch() {
this.getlist()
},
inpuval(e) {
if (e.length == 0) {
this.getlist()
}
},
getlist(id) { getlist(id) {
detail({ detail({
id: id id: id
@ -172,7 +182,7 @@
if (res.code == 1) { if (res.code == 1) {
this.lisobj = res.data this.lisobj = res.data
console.log(this.lisobj, '11111')
} }
}) })
} }
@ -438,31 +448,90 @@
color: #0022c7; color: #0022c7;
} }
.shop { .shop-content {
height: 130px; padding-left: 20px;
overflow: hidden; padding-right: 20px;
overflow-y: auto;
}
.shop-content-a {
display: flex; display: flex;
justify-content: space-between; 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 { .shop-img {
width: 26px; width: 34rpx;
height: 26px; height: 34rpx;
border-radius: 6px 6px 6px 6px; border-radius: 6px 6px 6px 6px;
} }
.shop-img img { .shop-img image {
width: 26px; width: 34rpx;
height: 26px; height: 34rpx;
border-radius: 6px 6px 6px 6px; 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 { .shop-txt {
margin-left: 20px; display: inline-block;
/* 转换为行内块元素 */
white-space: normal;
/* 允许自动换行 */
word-break: break-all;
/* 单词内断行 */
} }
} }
} }

View File

@ -1,84 +1,91 @@
<template> <template>
<view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container"> <view class="dashboard-container">
<view class="container-top"> <view class="container-top">
<!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> --> <!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> -->
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false' height="3" <u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false'
bgColor='#fff'></u-search> height="3" bgColor='#fff'></u-search>
<view class="serch" @click="serch">搜索</view> <view class="serch" @click="serch">搜索</view>
</view> </view>
<view class="container-content" v-if="list.length>0"> <view class="container-content" v-if="list.length>0">
<scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;" <scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;"
@scrolltolower="loadMoreData"> @scrolltolower="loadMoreData">
<view v-for="(item,i) in list" :key="i" class="content-one"> <view v-for="(item,i) in list" :key="i" class="content-one">
<view class="" @click="kk(item)"> <view class="" @click="kk(item)">
<view class="content-one-title">商户名称{{item.shop_name}}</view> <view class="content-one-title">商户名称{{item.shop_name}}</view>
<view class="content-one-con"> <view class="content-one-con">
<view>店主姓名{{item.shop_user}}</view> <view>店主姓名{{item.shop_user}}</view>
<view>联系电话{{item.shop_phone}}</view> <view>联系电话{{item.shop_phone}}</view>
<view>商家地址{{item.shop_address}}</view> <view>商家地址{{item.shop_address}}</view>
<view>订单编号{{item.order_sn}}</view> <view>订单编号{{item.order_sn}}</view>
<!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> --> <!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> -->
</view>
</view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<view class="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>
</view>
<view class="container-txt">
<text class=" centered-multi-line shop-txt">
{{ items.goods_name }}</text>
</view>
</view> </view>
<view style="line-height: 34rpx;">X{{ items.product_num}}</view>
</view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<view class="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>
</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> </view>
<view class="btn" @click="openCamera(item)">
<view class="btn1">
<image src="@/static/images/er.png" mode=""></image>
</view>
<view class="btn2">扫码取货</view>
</view>
</view> </view>
</scroll-view>
</view>
<view class="bj" v-else>
</view> <view class="bj-conter">
<view class="bja">
<view class="btn" @click="openCamera(item)"> <image src="@/static/images/zanwu.png" mode=""></image>
<view class="btn1"> </view>
<view class="bjb">
暂无订单信息
<image src="@/static/images/er.png" mode=""></image>
</view> </view>
<view class="btn2">扫码取货</view>
</view> </view>
</view> </view>
</scroll-view>
</view>
<view class="bj" v-else>
<view class="bj-conter">
<view class="bja">
<image src="@/static/images/zanwu.png" mode=""></image>
</view>
<view class="bjb">
暂无订单信息
</view>
</view> </view>
</view>
</you-scroll>
<uni-popup ref="globalPopup" :custom="true"> <uni-popup ref="globalPopup" :custom="true">
<view class="popup-content" @click="close"> <view class="popup-content" @click="close">
<view class="popup-content-a"> <view class="popup-content-a">
@ -106,7 +113,11 @@
Toast Toast
} from '../../libs/uniApi' } from '../../libs/uniApi'
import youScroll from '@/components/you-scroll'
export default { export default {
components: {
youScroll
},
data() { data() {
return { return {
@ -125,15 +136,23 @@
camera: 'auto' camera: 'auto'
} }
}, },
mounted() {
this.getlist()
mounted() {
this.initlist()
}, },
methods: {
refresh() {
this.initlist()
methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
}, 1000 * 1)
},
refresh() {
this.initlist()
}, },
close() { close() {
this.$refs.globalPopup.close() this.$refs.globalPopup.close()
@ -166,6 +185,7 @@
data data
).then(res => { ).then(res => {
if (res.code == 1) { if (res.code == 1) {
uni.hideLoading();
this.list = [...this.list, ...res.data] this.list = [...this.list, ...res.data]
this.page_no = this.page_no + 1 this.page_no = this.page_no + 1
@ -179,7 +199,9 @@
// url: '/pages/index/detail?id=' + item.id // url: '/pages/index/detail?id=' + item.id
// }) // })
// }) // })
this.$emit('onfunction', item.id)
this.$emit('onfunction', item.id, 1)
}, },
loadMoreData() { loadMoreData() {
@ -187,13 +209,12 @@
}, },
// //
getDocumentListApi(item, oredr) { getDocumentListApi(item, oredr) {
let data = { let data = {
id: item.id, id: item.id,
order_id: item.order_id, order_id: item.order_id,
order_sn: oredr order_sn: oredr
} }
console.log(data)
takeGoods(data).then(res => { takeGoods(data).then(res => {
// Toast(res.msg) // Toast(res.msg)
@ -206,11 +227,11 @@
}, },
// //
openCamera(item) { openCamera(item) {
console.log(item);
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
this.getDocumentListApi(item, res.result) this.getDocumentListApi(item, res.result)
// console.log(res.result); // console.log(item, res.result); //
} }
}); });

View File

@ -1,93 +1,102 @@
<template> <template>
<view class="dashboard-container"> <view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container">
<view class="container-top"> <view class="container-top">
<!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> --> <!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> -->
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false' height="30" <u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false'
bgColor='#fff'></u-search> height="30" bgColor='#fff'></u-search>
<view class="serch" @click="serch">搜索</view> <view class="serch" @click="serch">搜索</view>
</view> </view>
<view class="container-content" v-if="list.length>0"> <view class="container-content" v-if="list.length>0">
<scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;" <scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;"
@scrolltolower="loadMoreData"> @scrolltolower="loadMoreData">
<view v-for="(item,i) in list" :key="i" class="content-one"> <view v-for="(item,i) in list" :key="i" class="content-one">
<view class="" @click="kk(item)"> <view class="" @click="kk(item)">
<view class="content-one-title">收货人名称{{item.receiver_name}}</view> <view class="content-one-title">收货人名称{{item.receiver_name}}</view>
<view class="content-one-con"> <view class="content-one-con">
<view>联系电话{{item.receiver_phone}}</view> <view>联系电话{{item.receiver_phone}}</view>
<view>商家地址{{item.receiver_address}}</view> <view>商家地址{{item.receiver_address}}</view>
<view>订单编号{{item.order_sn}}</view> <view>订单编号{{item.order_sn}}</view>
<!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> --> <!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> -->
</view>
</view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<view class="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>
</view>
<view class="container-txt">
<text class=" centered-multi-line shop-txt">
{{ items.goods_name }}</text>
</view>
</view> </view>
<view style="line-height: 34rpx;">X{{ items.product_num}}</view>
</view>
</view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<view class="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>
</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="btn" @click="show1(item)">
<view class="btn1">
<image src="@/static/images/che.png" mode=""></image>
</view>
<view class="btn2">货物送达</view>
</view>
</view>
</view> </view>
</scroll-view>
<view class="btn" @click="show1(item)"> </view>
<view class="btn1"> <view class="bj" v-else>
<image src="@/static/images/che.png" mode=""></image>
</view> <view class="bj-conter">
<view class="btn2">货物送达</view> <view class="bja">
<image src="@/static/images/zanwu.png" mode=""></image>
</view>
<view class="bjb">
暂无订单信息
</view> </view>
</view> </view>
</view> </view>
</scroll-view>
</view>
<view class="bj" v-else>
<view class="bj-conter">
<view class="bja">
<image src="@/static/images/zanwu.png" mode=""></image>
</view>
<view class="bjb">
暂无订单信息
</view>
</view> </view>
</view>
</you-scroll>
<gb-popup :isShow="isShow1" rName="确定" :isBut="false" lName="取消" @lEvent="copyshow" @rEvent="copyData" <gb-popup :isShow="isShow1" rName="确定" :isBut="false" lName="取消" @lEvent="copyshow" @rEvent="copyData"
title="请输入取件码"> title="请输入取件码">
<view style="padding: 30rpx;"> <view style="padding: 30rpx;">
<input type="value" v-model="code" placeholder="请输入" <input type="value" v-model="code" placeholder="请输入"
placeholder-style="font-size: 12rpx;height: 50rpx;line-height: 50rpx;" placeholder-style="font-size: 12rpx;height: 50rpx;line-height: 50rpx;"
style="height: 50rpx;font-size: 18rpx;" /> style="height: 50rpx;font-size: 18rpx;" />
</view> </view>
</gb-popup> </gb-popup>
<uni-popup ref="globalPopup" :custom="true"> <uni-popup ref="globalPopup" :custom="true">
<view class="popup-content" @click="close"> <view class="popup-content" @click="close">
<view class="popup-content-a"> <view class="popup-content-a">
<view class="popup-item"> <view class="popup-item">
用户完成收货 用户完成收货
</view> </view>
<view class="popup-item"> <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> </image>
</view> </view>
</view> </view>
@ -102,8 +111,12 @@
delivery delivery
} from '@/api/oa.js' } from '@/api/oa.js'
export default { import youScroll from '@/components/you-scroll'
export default {
components: {
youScroll
},
data() { data() {
return { return {
isShow1: false, isShow1: false,
@ -124,11 +137,18 @@
} }
}, },
mounted() { mounted() {
this.getlist()
this.initlist()
}, },
methods: { methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
}, 1000 * 1)
},
refresh() { refresh() {
this.initlist() this.initlist()
@ -136,7 +156,7 @@
close() { close() {
this.$refs.globalPopup.close() this.$refs.globalPopup.close()
}, },
// //
serch() { serch() {
this.initlist() this.initlist()
@ -144,7 +164,7 @@
// //
inpuval(e) { inpuval(e) {
if (e.length == 0) { if (e.length == 0) {
this.initlist() this.initlist()
} }
}, },
@ -179,7 +199,7 @@
this.isShow1 = true this.isShow1 = true
this.typeid = row.id this.typeid = row.id
}, },
copyshow() { copyshow() {
this.isShow1 = false this.isShow1 = false
@ -231,7 +251,7 @@
// uni.navigateTo({ // uni.navigateTo({
// url: '/pages/psong/detail?id=' + item.id // url: '/pages/psong/detail?id=' + item.id
// }) // })
this.$emit('onfunction1', item.id) this.$emit('onfunction', item.id,2)
}, },
// //

View File

@ -1,88 +1,93 @@
<template> <template>
<view class="dashboard-container"> <view class="">
<you-scroll ref="scroll" @onPullDown="onPullDown">
<view class="dashboard-container">
<view class="container-top"> <view class="container-top">
<!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> --> <!-- <input v-model="keyword" prefix-icon="el-icon-search" placeholder="请输入内容" @input="inpuval" /> -->
<u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false' <u-search placeholder="请输入订单编号,联系方式,名称" v-model="keyword" @input="inpuval" :showAction='false'
bgColor='#fff' height="30" class="usearch"></u-search> bgColor='#fff' height="30" class="usearch"></u-search>
<view class="serch" @click="serch">搜索</view> <view class="serch" @click="serch">搜索</view>
</view> </view>
<view class="container-content" v-if="list.length>0"> <view class="container-content" v-if="list.length>0">
<scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;" <scroll-view scroll-x="true" style="width: 565rpx;white-space: nowrap;overflow: hidden;"
@scrolltolower="loadMoreData"> @scrolltolower="loadMoreData">
<view v-for="(item,i) in list" :key="i" class="content-one" @click="kk(item)"> <view v-for="(item,i) in list" :key="i" class="content-one" @click="kk(item)">
<view class="" @click="kk(item)"> <view class="" @click="kk(item)">
<view :class="item.status==3?'content-one-title1':'content-one-title'"> <view :class="item.status==3?'content-one-title1':'content-one-title'">
<view class="">收货人名称{{item.receiver_name}}</view> <view class="">收货人名称{{item.receiver_name}}</view>
<view class="" v-if="item.status==3">已取消</view> <view class="" v-if="item.status==3">已取消</view>
</view>
<view class="content-one-con">
<view>联系电话{{item.receiver_phone}}</view>
<view>商家地址{{item.shop_address}}</view>
<view>订单编号{{item.order_sn}}</view>
<view v-if="item.status!=3">取货时间{{item.qh_time}}</view>
<view v-if="item.status!=3">送达时间{{item.ps_time}}</view>
<!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> -->
</view>
</view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<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>
</view>
<view class="container-txt">
<text class=" centered-multi-line shop-txt">
{{ items.goods_name }}</text>
</view>
</view> </view>
<view style="line-height: 34rpx;">X{{ items.product_num}}</view> <view class="content-one-con">
<view>联系电话{{item.receiver_phone}}</view>
<view>商家地址{{item.shop_address}}</view>
<view>订单编号{{item.order_sn}}</view>
<view v-if="item.status!=3">取货时间{{item.qh_time}}</view>
<view v-if="item.status!=3">送达时间{{item.ps_time}}</view>
<!-- <view>订单状态{{item.status==0?'待取货':item.status==1?'配送中':item.status==2?'已配送':'待取消'}}</view> -->
</view>
</view> </view>
<view class="shop-content">
<view class="shop-content-a">
<view class="shop-content-a1">商品信息</view>
<view class="shop-content-a2">{{ item.products.length }}</view>
</view>
<view class="shop-list">
<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>
</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="btn" :class="item.status==3?'btns':'btn'">
<view class="btn1">
<image src="@/static/images/yan.png" mode=""></image>
</view>
<view class="btn2" @click="openCamera"> 查看详情</view>
</view>
</view>
</view> </view>
</scroll-view>
</view>
<view class="btn" :class="item.status==3?'btns':'btn'"> <view class="bj" v-else>
<view class="btn1">
<image src="@/static/images/yan.png" mode=""></image> <view class="bj-conter">
</view> <view class="bja">
<view class="btn2" @click="openCamera"> 查看详情</view> <image src="@/static/images/zanwu.png" mode=""></image>
</view>
<view class="bjb">
暂无订单信息
</view> </view>
</view> </view>
</view> </view>
</scroll-view>
</view>
<view class="bj" v-else>
<view class="bj-conter">
<view class="bja">
<image src="@/static/images/zanwu.png" mode=""></image>
</view>
<view class="bjb">
暂无订单信息
</view>
</view> </view>
</view> </you-scroll>
</view> </view>
</template> </template>
@ -90,8 +95,11 @@
import { import {
lists lists
} from '@/api/oa.js' } from '@/api/oa.js'
import youScroll from '@/components/you-scroll'
export default { export default {
components: {
youScroll
},
data() { data() {
return { return {
@ -111,10 +119,18 @@
} }
}, },
mounted() { mounted() {
this.initlist() this.initlist()
}, },
methods: { methods: {
onPullDown(done) { //
setTimeout(() => {
this.initlist()
done(); //
},1000*1)
},
refresh() { refresh() {
this.initlist() this.initlist()
@ -127,7 +143,7 @@
this.initlist() this.initlist()
} }
}, },
initlist() { initlist() {
this.list = [] this.list = []
this.page_no = 1 this.page_no = 1
this.getlist() this.getlist()
@ -155,7 +171,7 @@
// uni.navigateTo({ // uni.navigateTo({
// url: '/pages/sda/detail?id=' + item.id // url: '/pages/sda/detail?id=' + item.id
// }) // })
this.$emit('onfunction2', item.id) this.$emit('onfunction', item.id,3)
}, },
loadMoreData() { 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": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true,
"app-plus": { "app-plus": {
"subNVues": [{ "subNVues": [{
"id": "concat", // "id": "concat", //

View File

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

View File

@ -22,12 +22,9 @@
<view class="left-bottom-right"> <view class="left-bottom-right">
<view class="bottom-right1"> <view class="bottom-right1">
<view class="bottom-right_a"> <view class="bottom-right_a">
</view> </view>
<view class="bottom-right_b"> <view class="bottom-right_b">
{{oaUserInfo.nickname ?'在线':'离线'}} {{oaUserInfo.nickname ?'在线':'离线'}}
</view> </view>
</view> </view>
<view class="bottom-right2" @click="logout"> <view class="bottom-right2" @click="logout">
@ -37,13 +34,12 @@
</view> </view>
</view> </view>
<view class="content-right"> <view class="content-right">
<index ref="list" @onfunction='onfunction' v-if="num==0&&isshow" /> <index ref="list" @onfunction='onfunction' v-show="showIndexComponent" />
<indexa :type='type' @outfun='outfun' v-if="num==0&&!isshow" /> <indexa :type='type' @outfun='outfun' v-if="showIndexAComponent" />
<index1 ref="list1" @onfunction1='onfunction1' v-if="num==1&&isshow1" /> <index1 ref="list1" @onfunction='onfunction' v-show="showIndex1Component" />
<indexb :type='type' @outfun='outfun' v-if="num==1&&!isshow1" /> <indexb :type='type' @outfun='outfun' v-if="showIndexBComponent" />
<pindex ref="list2" @onfunction2='onfunction2' v-if="num==2&&isshow2" /> <pindex ref="list2" @onfunction='onfunction' v-show="showPIndexComponent" />
<indexc :type='type' @outfun='outfun' v-if="num==2 &&!isshow2" /> <indexc :type='type' @outfun='outfun' v-if="showIndexCComponent" />
</view> </view>
</view> </view>
@ -78,7 +74,7 @@
indexc indexc
}, },
data() { data() {
return { return {
title: 'Hello', title: 'Hello',
BarHeight: '', BarHeight: '',
@ -106,7 +102,24 @@
oaUserInfo() { oaUserInfo() {
return this.$store.state.app.userInfo 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() { 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() this.$refs.list.refresh()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
} else if (this.num == 1) { } else if (this.num == 1 && this.isshow1) {
this.$refs.list1.refresh() this.$refs.list1.refresh()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
} else { } else if (this.num == 2 && this.isshow2) {
this.$refs.list2.refresh() this.$refs.list2.refresh()
uni.stopPullDownRefresh() 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: { methods: {
login() { login() {
@ -137,59 +172,75 @@
}) })
}, },
logout() { logout() {
uni.reLaunch({
url: '/pages/oaLogin/oaLogin' 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) { getlist(index) {
this.num = index this.num = index
if (index == 1) { if (index == 1) {
this.$refs.list1.refresh()
this.isshow2 = true this.isshow2 = true
this.isshow = true this.isshow = true
} }
if (index == 2) { if (index == 2) {
this.isshow1 = true this.isshow1 = true
this.isshow = true this.isshow = true
this.$refs.list2.refresh()
} }
if (index == 0) { if (index == 0) {
this.$refs.list.refresh()
this.isshow1 = true this.isshow1 = true
this.isshow2 = true this.isshow2 = true
} }
}, },
onfunction(e) { onfunction(e,id) {
if (e) { console.log(e,id)
if (id == 1) {
this.isshow = false this.isshow = false
this.type = e this.type = e
} } else if (id == 2) {
},
onfunction1(e) {
if (e) {
this.isshow1 = false this.isshow1 = false
this.type = e this.type = e
} } else {
},
onfunction2(e) {
if (e) {
this.isshow2 = false this.isshow2 = false
this.type = e this.type = e
} }
}, },
outfun(e) { outfun(e) {
if (e == 1) { if (e == 1) {
this.$refs.list.refresh()
this.isshow = true this.isshow = true
} else if (e == 2) { } else if (e == 2) {
this.$refs.list1.refresh()
this.isshow1 = true this.isshow1 = true
} else { } else {
this.$refs.list2.refresh()
this.isshow2 = true this.isshow2 = true
} }
}, },

View File

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

BIN
static/pullDown.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB