Commit cdfb698b authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/master'

parents 04b2589d 7c429cd2
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头 apiUrl: 'http://rest-u.yunya.com', //php端域名请求头
xueUrl: 'http://xue.yunya.com', //学院 xueUrl: 'http://xue.yunya.com', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
apiUrl: 'http://192.168.1.22', //java端域名请求头 apiUrl: 'http://192.168.1.22', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头 // apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/' qn_asset_url: 'http://deudn.c.pp.cc/',
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -302,6 +302,10 @@ ...@@ -302,6 +302,10 @@
/deep/ button[plain] { /deep/ button[plain] {
border: none; border: none;
} }
button[disabled]:not([type]) {
background: #d1d4d4;
color: #ffffff;
}
} }
} }
</style> </style>
...@@ -248,7 +248,6 @@ ...@@ -248,7 +248,6 @@
this.$emit('click') this.$emit('click')
}, },
handleChange(timestamp) { handleChange(timestamp) {
console.log(timestamp)
if (this.timeout) this.$refs['order-count-down'].seconds += 2 if (this.timeout) this.$refs['order-count-down'].seconds += 2
if (timestamp == 0 && !this.timeout) { if (timestamp == 0 && !this.timeout) {
setTimeout(()=> { setTimeout(()=> {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
.no-order-image { .no-order-image {
width: 374rpx; width: 374rpx;
height: 218rpx; height: 218rpx;
margin-top: 60rpx; margin-top: 50rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
......
...@@ -32,11 +32,12 @@ ...@@ -32,11 +32,12 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; // height: 100vh;
background-color: #f4f5f7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto; // overflow-y: auto;
&.fixed { &.fixed {
height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
......
<template> <template>
<TabBarPage title="充电桩自营平台"> <scroll-view scroll-y style="margin-bottom: 20rpx;height: 100vh;" @scrolltolower="reachBottom"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<TabBarPage title="充电桩自营平台">
<image class="banner-image" :src="bannerImage"></image> <image class="banner-image" :src="bannerImage"></image>
<view class="msg-view"> <view class="msg-view">
...@@ -41,15 +45,15 @@ ...@@ -41,15 +45,15 @@
<NoOrder /> <NoOrder />
</view> </view>
<view v-else class="order-item-view"> <view v-else class="order-item-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" <!-- <scroll-view scroll-y style="margin-bottom: 20rpx;" @scrolltolower="reachBottom"
scroll-anchoring> scroll-anchoring> -->
<view v-for="(item, index) in orderList" :key="index"> <view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location" <OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick(item.orderId)" @action="handleAction(item.orderId)"> @click="handleClick(item.orderId)" @action="handleAction(item.orderId)">
</OrderCell> </OrderCell>
</view> </view>
<u-loadmore :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore> <u-loadmore :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
</scroll-view> <!-- </scroll-view> -->
</view> </view>
</template> </template>
...@@ -62,7 +66,8 @@ ...@@ -62,7 +66,8 @@
<view class="bottom-text">我也是有底线哒</view> <view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view> <view class="bottom-line-view"></view>
</view> </view>
</TabBarPage> </TabBarPage>
</scroll-view>
</template> </template>
<script> <script>
...@@ -95,7 +100,9 @@ ...@@ -95,7 +100,9 @@
token: "", token: "",
pageNumber: 0, pageNumber: 0,
pageSize: 100, pageSize: 100,
}, },
triggered: false,
_freshing: false,
}; };
}, },
watch: { watch: {
...@@ -131,7 +138,8 @@ ...@@ -131,7 +138,8 @@
return process.uniEnv.qn_base_url + 'weiruzhu.png' return process.uniEnv.qn_base_url + 'weiruzhu.png'
}, },
}, },
onLoad() { onLoad() {
this._freshing = false;
this.getOrderCount() this.getOrderCount()
}, },
onShow() { onShow() {
...@@ -140,12 +148,20 @@ ...@@ -140,12 +148,20 @@
this.initSettleInfo(); this.initSettleInfo();
} }
}, },
onPullDownRefresh() { // onPullDownRefresh() {
console.log('------下拉刷新------') // console.log('------下拉刷新------')
// 下拉刷洗 // // 下拉刷洗
this.initSettleInfo() // this.initSettleInfo()
}, // },
// onReachBottom() {
// console.log('----------底部-------------', this.currentLoadStatus)
// if (this.currentLoadStatus != 'loadmore') return
// this.currentLoadStatus == 'loading'
// this.loadOrderList()
// },
// onPageScroll(obj) {
// console.log('---------scroll---------', obj)
// },
methods: { methods: {
handleClick(orderId) { // 点击了cell handleClick(orderId) { // 点击了cell
console.log('点击了cell') console.log('点击了cell')
...@@ -173,11 +189,11 @@ ...@@ -173,11 +189,11 @@
} }
}; };
await app.getBaseInfo(self, callBack); await app.getBaseInfo(self, callBack);
this.orderList = []
this.search.pageNumber = 0
// 加载消息列表 // 加载消息列表
self.loadMessageList(); self.loadMessageList();
self.search.pageNumber = 0
self.loadedOrder = false
self.loadOrderList(); self.loadOrderList();
}, },
loadMessageList() { loadMessageList() {
...@@ -204,6 +220,8 @@ ...@@ -204,6 +220,8 @@
self.$u.api.listByRecommendOrder(self.search).then((res) => { self.$u.api.listByRecommendOrder(self.search).then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新 uni.stopPullDownRefresh() // 结束下拉刷新
self.loadedOrder = true self.loadedOrder = true
self.triggered = false;
self._freshing = false;
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/ /*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// if (res.data.list) { // if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) { // if (res.data.list.length == 0 && res.data.total > 0) {
...@@ -238,7 +256,10 @@ ...@@ -238,7 +256,10 @@
// } // }
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/ /*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.list && res.data.list.length > 0) { if (res.data && res.data.list && res.data.list.length > 0) {
if (self.search.pageNumber == 1) {
self.orderList = []
}
self.orderList.push(...res.data.list); self.orderList.push(...res.data.list);
self.currentLoadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore' self.currentLoadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
...@@ -251,10 +272,26 @@ ...@@ -251,10 +272,26 @@
onRestore() { onRestore() {
this.triggered = "restore"; this.triggered = "restore";
}, },
reachBottom() { reachBottom() {
console.log(this.currentLoadStatus)
if (this.currentLoadStatus != 'loadmore') return if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading' this.currentLoadStatus == 'loading'
this.loadOrderList() this.loadOrderList()
},
onPulling(e) {
console.log("onpulling", e);
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.initSettleInfo()
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
}, },
// clickSwiper(index) {}, // clickSwiper(index) {},
handleScroll() { handleScroll() {
...@@ -330,7 +367,7 @@ ...@@ -330,7 +367,7 @@
.banner-image { .banner-image {
width: 730rpx; width: 730rpx;
height: 280rpx; height: 280rpx;
margin-left: -14rpx; margin-left: -16rpx;
} }
.msg-view { .msg-view {
...@@ -455,7 +492,7 @@ ...@@ -455,7 +492,7 @@
.order-item-view { .order-item-view {
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
} }
} }
} }
......
...@@ -44,21 +44,23 @@ ...@@ -44,21 +44,23 @@
<view v-else class="order-item-more"> <view v-else class="order-item-more">
<view class="line-view"></view> <view class="line-view"></view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>品牌:</text> <text class="cell-title">品牌:</text>
<text>{{ order.brandName }}</text> <text>{{ order.brandName }}</text>
</view> </view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>数量:</text> <text class="cell-title">数量:</text>
<text>x{{ order.orderProductCount }}</text> <text>x{{ order.orderProductCount }}</text>
</view> </view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>信息:</text> <text>充电桩信息:</text>
<text class="cell-title">充电桩信息:</text>
<text>{{ order.serviceContent }}</text> <text>{{ order.serviceContent }}</text>
</view> </view>
<view class="order-cell between-cell"> <!-- <view class="order-cell between-cell">
<!-- <view class="order-cell between-cell">
<text>备注:</text> <text>备注:</text>
<text>{{ order.serviceContent }}</text> <text>{{ order.serviceContent }}</text>
</view> </view> -->
<view class="read-more-toggle"> <view class="read-more-toggle">
<u-icon name="arrow-up"></u-icon> <u-icon name="arrow-up"></u-icon>
<text class="read-more-text" @click="readMore = true">点击收起</text> <text class="read-more-text" @click="readMore = true">点击收起</text>
...@@ -130,8 +132,6 @@ ...@@ -130,8 +132,6 @@
</u-count-down> </u-count-down>
</view> </view>
</view> </view>
</view> </view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件--> <!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right"> <view class="right">
...@@ -212,7 +212,8 @@ ...@@ -212,7 +212,8 @@
isAllowDianhuaAndDaohang : false, isAllowDianhuaAndDaohang : false,
appointmentDatetimeRange:'', appointmentDatetimeRange:'',
appointmentDatetime:'', appointmentDatetime:'',
signDistance:3000 signDistance:3000,
num:0
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -220,9 +221,7 @@ ...@@ -220,9 +221,7 @@
console.log("option", option) console.log("option", option)
if (option && option.id) { if (option && option.id) {
this.orderId = option.id this.orderId = option.id
} else { }
// 异常处理
}
this.loadOrderDetail() this.loadOrderDetail()
this.loadOrderRecord() this.loadOrderRecord()
this.getLocation() this.getLocation()
...@@ -236,7 +235,6 @@ ...@@ -236,7 +235,6 @@
}else{ }else{
return process.uniEnv.qn_base_url + 'dianhua-0.png' return process.uniEnv.qn_base_url + 'dianhua-0.png'
} }
}, },
navigationIcon() { navigationIcon() {
//self-support/icon/daohang-0@2x.png //self-support/icon/daohang-0@2x.png
...@@ -245,7 +243,6 @@ ...@@ -245,7 +243,6 @@
}else{ }else{
return process.uniEnv.qn_base_url + 'daohang-0.png' return process.uniEnv.qn_base_url + 'daohang-0.png'
} }
}, },
centerButtonClass() { centerButtonClass() {
let btnClass = "appoint-btn" let btnClass = "appoint-btn"
...@@ -336,7 +333,6 @@ ...@@ -336,7 +333,6 @@
}; };
self.$u.api.orderDetail(data, self.orderId).then((res) => { self.$u.api.orderDetail(data, self.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data)
self.order = res.data self.order = res.data
this.getCurrentBtn() this.getCurrentBtn()
if(self.order.isFirstOrder){ if(self.order.isFirstOrder){
...@@ -362,7 +358,6 @@ ...@@ -362,7 +358,6 @@
}; };
self.$u.api.listOrderRecord(param).then((res) => { self.$u.api.listOrderRecord(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
self.orderRecords = res.data self.orderRecords = res.data
} else { } else {
console.log(res.message, "获取订单详情失败!"); console.log(res.message, "获取订单详情失败!");
...@@ -371,39 +366,55 @@ ...@@ -371,39 +366,55 @@
}, },
weekChange(data){ weekChange(data){
// 点击下一周 // 点击下一周
console.log(data,'weekChange') console.log(data,'week-data')
if (data && data.time) { if (data && data.time) {
let num = data.num let num = data.num
let time = data.time let time = data.time
this.num = num
if (num == 0) { if (num == 0) {
this.dateList = [ this.loadCalendar()
{day: time, timeRange: []},
{day: time + (1*86400000), timeRange: []},
{day: time + (2*86400000), timeRange: []},
{day: time + (3*86400000), timeRange: []},
{day: time + (4*86400000), timeRange: []},
{day: time + (5*86400000), timeRange: []},
{day: time + (6*86400000), timeRange: []},
]
} else { } else {
this.dateList = [ this.loadCalendar()
{day: time, timeRange: []},
{day: time + (1*86400000), timeRange: []},
{day: time + (2*86400000), timeRange: []},
{day: time + (3*86400000), timeRange: []},
{day: time + (4*86400000), timeRange: []},
{day: time + (5*86400000), timeRange: []},
]
} }
} }
},/* 加载日历数据 */
async loadCalendar() {
let self = this
let params = {
num: this.num
}
let res = await this.$u.api.workerCalendar(params)
if(res && res.code == 200) {
self.dateList = res.data
self.dateList[1].timeRange[0]='appointment_range_8'
}
},
/* 加载预约时间段 */
async loadTimerange() {
let self = this
let res = await this.$u.api.openTimerange()
if(res && res.code == 200) {
let list = res.data
list.map((item, index) => {
item.disabled = false
})
self.timeList = list
}
}, },
dateChange(data){ dateChange(data){
// 点击日期选择 // 点击日期选择
console.log(data,'dateChange') console.log(data,'dateChange')
this.loadCalendar()
let self = this let self = this
self.appointmentDatetime = data.item.day self.appointmentDatetime = data.item.day
self.timeList.map((item, index) => {
if(data.item.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true
} else {
item.disabled = false
}
})
}, },
timeChange(data){ timeChange(data){
// 时间段选择变化 // 时间段选择变化
...@@ -625,7 +636,7 @@ ...@@ -625,7 +636,7 @@
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.order-wrap { .order-wrap {
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
...@@ -757,6 +768,7 @@ ...@@ -757,6 +768,7 @@
.order-item-more { .order-item-more {
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
text-align: right;
.line-view { .line-view {
background-color: #F4F5F7; background-color: #F4F5F7;
height: 2rpx; height: 2rpx;
...@@ -946,7 +958,7 @@ ...@@ -946,7 +958,7 @@
color: #333333; color: #333333;
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
text-align: left;
} }
.between-cell { .between-cell {
...@@ -954,4 +966,8 @@ ...@@ -954,4 +966,8 @@
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
} }
.cell-title {
text-align: left;
flex-shrink: 0;
}
</style> </style>
...@@ -176,6 +176,7 @@ ...@@ -176,6 +176,7 @@
}, },
reachBottom(e) { reachBottom(e) {
console.log('-------底部-------', this.loadStatus)
if (this.loadStatus != 'loadmore') return if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading' this.loadStatus == 'loading'
this.getOrderList(this.currentIndex) this.getOrderList(this.currentIndex)
...@@ -249,23 +250,23 @@ ...@@ -249,23 +250,23 @@
// 获取订单数量 // 获取订单数量
getOrderCount() { getOrderCount() {
var self = this; // 加载订单列表 // 加载订单列表
self.$u.api.listOrderCount().then((res) => { this.$u.api.listOrderCount().then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data) console.log("===", res.data)
if (res.data) { if (res.data) {
var count = 0 var count = 0
self.list.forEach(item => { this.list.forEach(item => {
if (item.name === '待预约') { if (item.name === '待预约') {
item.count = res.data.toAppointmentCount item.total = res.data.toAppointmentCount
} else if (item.name === '待签到') { } else if (item.name === '待签到') {
item.count = res.data.toCheckinCount item.total = res.data.toCheckinCount
} else if (item.name === '待完工') { } else if (item.name === '待完工') {
item.count = res.data.toFinishCount item.total = res.data.toFinishCount
} else if (item.name === '待审核') { } else if (item.name === '审核中') {
item.count = res.data.reviewingCount item.total = res.data.reviewingCount
} else if (item.name === '异常单') { } else if (item.name === '异常单') {
item.count = res.data.exceptionCount item.total = res.data.exceptionCount
} }
}) })
var count = 0 var count = 0
......
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