Commit 8f578a52 authored by 郭晓清's avatar 郭晓清
parents 0185e547 407616aa
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://192.168.1.46', //php端域名请求头 apiUrl: 'http://rest-u.yunya.com', //php端域名请求头
xueUrl: 'http://192.168.1.46:8088', //学院 xueUrl: 'http://xue.yunya.com', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
......
...@@ -5,8 +5,7 @@ const UNI_APP = { ...@@ -5,8 +5,7 @@ const UNI_APP = {
banshou: 'https://m.test.ibanshou.cn', //扳手app banshou: 'https://m.test.ibanshou.cn', //扳手app
}, },
systemUrl: { systemUrl: {
// apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头 apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头
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/'
} }
......
...@@ -37,7 +37,11 @@ let orderApiFun = function(vm){ ...@@ -37,7 +37,11 @@ let orderApiFun = function(vm){
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params) let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params)
/* 预约+过程反馈 接口 */ /* 预约+过程反馈 接口 */
let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post(`/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/`+vm.vuex_token+`/`+orderId, params) let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + '/' + orderId, params)
/* 师傅拒单 */
let rejectOrder = async (params = {}, orderId) => await vm.$u.get('/wxh-worker-rest/rest/' + vm.vuex_token + '/order/' + orderId + '/workerReject/V2', params)
/** /**
* 查询工单操作记录列表接口 * 查询工单操作记录列表接口
...@@ -88,6 +92,7 @@ let orderApiFun = function(vm){ ...@@ -88,6 +92,7 @@ let orderApiFun = function(vm){
maintainWorkerCheckin, maintainWorkerCheckin,
feedbackConfig, feedbackConfig,
traceAndAppointment, traceAndAppointment,
rejectOrder,
orderStandard, orderStandard,
saveImage, saveImage,
getWatermark, getWatermark,
......
...@@ -68,7 +68,7 @@ export default [{ ...@@ -68,7 +68,7 @@ export default [{
"fieldsTitle": "电缆", "fieldsTitle": "电缆",
"fieldsName": "file", "fieldsName": "file",
"fieldsType": "file", "fieldsType": "file",
"key": "短裙", "key": "电缆",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg", "icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg",
"cat": 10 "cat": 10
}, },
...@@ -76,7 +76,7 @@ export default [{ ...@@ -76,7 +76,7 @@ export default [{
"fieldsTitle": "管材", "fieldsTitle": "管材",
"fieldsName": "file", "fieldsName": "file",
"fieldsType": "file", "fieldsType": "file",
"key": "短裙", "key": "管材",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg", "icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg",
"cat": 10 "cat": 10
}, },
...@@ -98,54 +98,30 @@ export default [{ ...@@ -98,54 +98,30 @@ export default [{
"icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg", "icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg",
"cat": 10 "cat": 10
}, },
{ // {
"fieldsTitle": "多级选择", // "fieldsTitle": "多级选择",
"fieldsName": "mutiPicker", // "fieldsName": "mutiPicker",
"fieldsType": "mutipicker", // "fieldsType": "mutipicker",
"required": true, // "required": true,
"key": "妈妈装", // "key": "妈妈装",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/8.jpg", // "icon": "https://cdn.uviewui.com/uview/common/classify/1/8.jpg",
"cat": 10 // "cat": 10
}, // },
{ // {
"fieldsTitle": "时间选择", // "fieldsTitle": "时间选择",
"fieldsName": "time", // "fieldsName": "time",
"fieldsType": "time", // "fieldsType": "time",
"required": true, // "required": true,
"key": "牛仔裤", // "key": "牛仔裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/9.jpg", // "icon": "https://cdn.uviewui.com/uview/common/classify/1/9.jpg",
"cat": 10 // "cat": 10
}, // },
{ {
"fieldsTitle": "备注", "fieldsTitle": "备注",
"key": "备注", "key": "备注",
"fieldsType": "textarea", "fieldsType": "textarea",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/10.jpg", "icon": "https://cdn.uviewui.com/uview/common/classify/1/10.jpg",
"cat": 10 "cat": 10
},
{
"fieldsTitle": "休闲裤",
"key": "休闲裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/11.jpg",
"cat": 10
},
{
"fieldsTitle": "雪纺衫",
"key": "雪纺衫",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/12.jpg",
"cat": 10
},
{
"fieldsTitle": "防晒衣",
"key": "防晒衣",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/13.jpg",
"cat": 10
},
{
"fieldsTitle": "礼服/婚纱",
"key": "礼服婚纱",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/14.jpg",
"cat": 10
} }
] ]
}, },
......
<!-- 预约时间 --> <!-- 预约时间 -->
<template> <template>
<view :class="{'con-box':titleShow}"> <view :class="{'con-box':titleShow}">
<view class="title" v-if="titleShow">{{'预约时间'}}</view> <view class="title" v-if="titleShow">{{ '预约时间' }}</view>
<view class="u-m-t-40"> <view class="u-m-t-40">
<view class="appoint-box"> <view class="appoint-box">
<view class="select-date"> <view class="select-date">
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<view class="select-time u-p-t-50"> <view class="select-time u-p-t-50">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view class="txt">选择时间</view> <view class="txt">选择时间</view>
<view class="txt active">{{ timeList[currentTime] }}</view> <view class="txt active">{{ currentTimeTxt }}</view>
</view> </view>
<view class="u-p-t-30 u-flex u-flex-wrap time-list"> <view class="u-p-t-30 u-flex u-flex-wrap time-list">
<view @click="timeChange(item,index,timeList)" <view @click="timeChange(item,index,timeList)"
:class="{'time-item':true,'active':index===currentTime}" v-for="(item,index) in timeList" :class="{'time-item':true,'active': (currentTime && index===currentTime)}" v-for="(item,index) in timeList"
:key="index"> :key="index">
<text class="time">{{item}}</text> <text class="time">{{item}}</text>
</view> </view>
...@@ -51,31 +51,39 @@ ...@@ -51,31 +51,39 @@
data() { data() {
return { return {
currentDay: 0, currentDay: 0,
currentTime: 0, currentTime: null,
dateList: [{ dateList: [{
weekDay: '周三', weekDay: '周三',
day: '21' day: '21',
}, { }, {
weekDay: '周三', weekDay: '周四',
day: '21' day: '22',
}, { }, {
weekDay: '周三', weekDay: '周五',
day: '21' day: '23',
}, { }, {
weekDay: '周三', weekDay: '周六',
day: '21' day: '24',
}, { }, {
weekDay: '周三', weekDay: '周日',
day: '21' day: '25',
}, { }, {
weekDay: '周三', weekDay: '周一',
day: '21' day: '26',
}, ], }, ],
timeList: ['06:00-08:00', '08:00-10:00', '10:00-12:00', '12:00-14:00', '14:00-16:00', '16:00-18:00', timeList: ['06:00-08:00', '08:00-10:00', '10:00-12:00', '12:00-14:00', '14:00-16:00', '16:00-18:00',
'18:00-20:00', '20:00-22:00', '22:00-24:00' '18:00-20:00', '20:00-22:00', '22:00-24:00'
] ],
} }
}, },
computed: {
currentTimeTxt() {
if(this.currentTime != null) {
return this.timeList[this.currentTime]
}
return ''
},
},
methods: { methods: {
getDateList() { getDateList() {
// 获取日期 // 获取日期
......
...@@ -29,7 +29,11 @@ ...@@ -29,7 +29,11 @@
name: 'XhFiles', name: 'XhFiles',
components: {}, components: {},
mixins: [objMixin,baseFile], mixins: [objMixin,baseFile],
props: {}, props: {
files: {
type: Array,
}
},
filters:{}, filters:{},
data() { data() {
return { return {
...@@ -41,7 +45,8 @@ ...@@ -41,7 +45,8 @@
{ {
text: '拍照' text: '拍照'
} }
] ],
takeStatus: false,
} }
}, },
computed: { computed: {
...@@ -49,7 +54,22 @@ ...@@ -49,7 +54,22 @@
return this.item.settings || [] return this.item.settings || []
} }
}, },
watch: {}, watch: {
'takeStatus': function(val, oldVal){
this.$emit('getTakeStatus', {status: val, index: this.itemIndex})
},
'files': { // 处理相机拍照返回的图片
handler (val) {
this.imgList = val.map(v => {
v.path = v.src
return v
})
this.setValue()
},
deep:true,
immediate: true,
}
},
mounted() {}, mounted() {},
methods: { methods: {
selectUpload(){ selectUpload(){
...@@ -79,7 +99,7 @@ ...@@ -79,7 +99,7 @@
return return
} }
// 使用拍照工具拍摄 // 使用拍照工具拍摄
this.takeStatus = true
}, },
setValue() { setValue() {
const dataValue = [] const dataValue = []
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
let str = '' let str = ''
const dataValue = this.dataValue const dataValue = this.dataValue
if(dataValue && dataValue.length>1){ if(dataValue && dataValue.length>1){
str = '经度:'+dataValue[0]+','+'维度:'+dataValue[1] str = '经度:'+dataValue[0].toFixed(4)+','+'纬度:'+dataValue[1].toFixed(4)
} }
return str return str
}, },
......
...@@ -73,11 +73,19 @@ ...@@ -73,11 +73,19 @@
auditDatetime: '2021.04.19 12:45:09', // 审核时间 auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间 submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果 auditResults: {}, // 审核结果
orderBusinessType: 'R', // 业务类型 R 为抢单 orderBusinessType: 'R', // 业务类型 R 为抢单
orderId: '0', // 订单id
} }
} }
}, },
orderType: Number, // 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工' // waitAccept:待接单、
// waitAppointment:待预约、
// waitCheckIn:待签到、
// waitFinish:待完工、
// review: 审核中、
// exception:异常单、
// finish:已完工
type: String,
location: { // 当前坐标 location: { // 当前坐标
type: Array, type: Array,
default () { default () {
...@@ -207,6 +215,20 @@ ...@@ -207,6 +215,20 @@
}, },
showDistance() { showDistance() {
return this.orderType == 0 return this.orderType == 0
},
types() {
return {
'waitAccept': 0, // 待接单、
'waitAppointment': 1, // 待预约、
'waitCheckIn': 2, // 待签到、
'waitFinish': 3, // 待完工、
'review': 4, // 审核中、
'exception': 5, // 异常单、
'finish': 6, //已完工
}
},
orderType() {
return this.types[this.type]
} }
}, },
methods: { methods: {
......
<template> <template>
<view class="no-order-view"> <view class="no-order-view" :style="customStyle">
<image class="no-order-image" :src="wudingdanImage"></image> <image class="no-order-image" :src="wudingdanImage"></image>
<text>当前暂无订单</text> <text>当前暂无订单</text>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
customStyle: {
type: String,
default: 'background-color: #FFFFFF'
}
},
computed: { computed: {
wudingdanImage() { wudingdanImage() {
return process.uniEnv.qn_base_url + 'wudingdan.png' return process.uniEnv.qn_base_url + 'wudingdan.png'
...@@ -24,7 +30,6 @@ ...@@ -24,7 +30,6 @@
color: #666666; color: #666666;
font-size: 28rpx; font-size: 28rpx;
padding: 30rpx; padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
min-height: 460rpx; min-height: 460rpx;
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
standardId: '', standardId: '',
images: [], images: [],
files: [], files: [],
fileMaps: [],
keys: [], keys: [],
token: '', token: '',
product: '', product: '',
...@@ -74,7 +73,7 @@ ...@@ -74,7 +73,7 @@
}) })
} }
} }
photo.allImages.unshift(photo.tempPath.mixWater)
if(photo.currentItem){ if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater) photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
} }
...@@ -139,34 +138,16 @@ ...@@ -139,34 +138,16 @@
self.confirmUpload(true) self.confirmUpload(true)
}, },
submitFile() { submitFile() {
let self = this const photo = getApp().globalData.photo
if(self.keys.length) { photo.currentItemLength = photo.currentItemLength + 1
for (let s of self.keys) { uni.hideLoading()
self.$u.api.saveImage({ // 当前项的图片显示
"token": self.token, // 拍照项张数目增加 等于10张
"standardId": self.standardId, photo.allImages.unshift(this.fileMaps[0])
"url": s, if(photo.currentItemLength<10){
}).then(async res =>{ this.$emit('changeType', 1)
console.log(res, "云服务保存图片"); }else{
if(res.result.code) { this.$emit('finish')
// TODO 参数是否要来回传递
const photo = getApp().globalData.photo
photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
// 拍照项张数目增加 等于10张
if(photo.currentItemLength<10){
this.$emit('changeType', 1)
}else{
this.$emit('finish')
}
} else {
uni.showToast({
title:'图片上传失败 '+ res.result.msg
})
}
})
}
} }
}, },
downloadImages() { downloadImages() {
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<view class="order-pop-title"> <view class="order-pop-title">
<text>{{title}}</text> <text>{{title}}</text>
</view> </view>
<view class="line-view" /> <view class="line-view" />
<view v-if="count" class="order-content">
你本月还有<text class="order-content-count">{{count}}</text>次拒单机会
</view>
<view class="order-pop-text"> <view class="order-pop-text">
<text>{{message}}</text> <text>{{message}}</text>
</view> </view>
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
取消 取消
</u-button> </u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure"> <u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure">
确定 {{buttonText}}
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -29,7 +32,12 @@ ...@@ -29,7 +32,12 @@
props: { props: {
visible: Boolean, visible: Boolean,
title: String, title: String,
message: String, message: String,
count: Number, // 剩余次数
buttonText: { // 确定按钮
type: String,
default: '查看'
},
}, },
data() { data() {
return {} return {}
...@@ -76,21 +84,31 @@ ...@@ -76,21 +84,31 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.order-pop-view { .order-pop-view {
padding: 30rpx; padding: 30rpx;
min-height: 520rpx;
.order-pop-title { .order-pop-title {
font-size: 40rpx; font-size: 40rpx;
margin-top: 40rpx; margin-top: 30rpx;
margin-bottom: 40rpx; margin-bottom: 34rpx;
text-align: center; text-align: center;
color: #333333; color: #333333;
}
.order-content {
text-align: center;
color: #333333;
font-size: 32rpx;
margin-top: 26rpx;
.order-content-count {
color: #FA5A49;
}
} }
.order-pop-text { .order-pop-text {
color: #999999; color: #999999;
text-align: center; text-align: center;
margin-top: 40rpx; margin-top: 30rpx;
font-size: 28rpx; font-size: 28rpx;
margin-bottom: 260rpx; // margin-bottom: 180rpx;
} }
.line-view { .line-view {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<u-navbar style="position: absolute;" title="入驻" background="{background: transparent}" :border-bottom="false" <u-navbar style="position: absolute;" title="入驻" background="{background: transparent}" :border-bottom="false"
back-icon-color="#ffffff" title-color="#ffffff"></u-navbar> back-icon-color="#ffffff" title-color="#ffffff"></u-navbar>
<image :src="url" style="width: 100%;" mode="widthFix"></image> <image :src="url" style="width: 100%;" mode="widthFix"></image>
<view class="introduction"> <view :class="['introduction', {'active': type}]">
<slot></slot> <slot></slot>
</view> </view>
<view class="settle-bottom"> <view class="settle-bottom">
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
index: { index: {
type: Number, type: Number,
default: 1 default: 1
},
// 0: introduction距离底部168rpx 1: introduction距离底部0rpx
type: {
type: Number,
default: 0
} }
}, },
data() { data() {
...@@ -45,7 +50,10 @@ ...@@ -45,7 +50,10 @@
top: 370rpx; top: 370rpx;
bottom: 168rpx; bottom: 168rpx;
left: 30rpx; left: 30rpx;
right: 30rpx; right: 30rpx;
&.active {
bottom: 0rpx;
}
} }
.settle-bottom { .settle-bottom {
......
...@@ -111,7 +111,8 @@ ...@@ -111,7 +111,8 @@
created(e) { created(e) {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
getApp().trackPage('拍照页') getApp().trackPage('拍照页')
photo.allImages = [] photo.allImages = []
photo.currentItemLength = 0
// this.ctx = uni.createCameraContext(); // this.ctx = uni.createCameraContext();
this.updateTime() this.updateTime()
this.getLocation() this.getLocation()
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
"path": "pages/order/complete", "path": "pages/order/complete",
"style": { "style": {
"navigationBarTitleText": "订单-完工配置", "navigationBarTitleText": "订单-完工配置",
"navigationBarBackgroundColor": "#2272FF", "navigationStyle": "custom",
"navigationBarTextStyle": "white" "disableScroll": true
} }
},{ },{
"path": "pages/order/feedback", "path": "pages/order/feedback",
...@@ -365,8 +365,8 @@ ...@@ -365,8 +365,8 @@
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
"name": "订单 - 过程反馈", //模式名称 "name": "订单 - 拒单", //模式名称
"path": "pages/order/feedback", //启动页面,必选 "path": "pages/order/refuse", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
} }
] ]
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
</view> </view>
<view v-else-if="!needSettled && orderList.length > 0" class="order-item-view"> <view v-else-if="!needSettled && orderList.length > 0" class="order-item-view">
<view v-for="(item, index) in orderList" :key="index"> <view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" :orderType="0" :location="location" @click="handleClick" <OrderCell :orderData="item" type="waitAccept" :location="location" @click="handleClick(item.orderId)"
@action="handleAction"> </OrderCell> @action="handleAction(item.orderId)"> </OrderCell>
</view> </view>
<u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore> <u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore>
</view> </view>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
search: { search: {
token: "", token: "",
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 100,
}, },
bottomLoading: false bottomLoading: false
}; };
...@@ -143,12 +143,18 @@ ...@@ -143,12 +143,18 @@
}, },
methods: { methods: {
handleClick() { // 点击了cell handleClick(orderId) { // 点击了cell
console.log('点击了cell') console.log('点击了cell')
this.viewOderItem(orderId)
}, },
handleAction() { // 点击了按钮 handleAction(orderId) { // 点击了按钮
console.log('点击了按钮') console.log('点击了按钮')
this.viewOderItem(orderId)
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
})
}, },
async initSettleInfo() { async initSettleInfo() {
let self = this; let self = this;
...@@ -164,7 +170,6 @@ ...@@ -164,7 +170,6 @@
await app.getBaseInfo(self, callBack); await app.getBaseInfo(self, callBack);
this.orderList = [] this.orderList = []
this.messageList = []
// 加载消息列表 // 加载消息列表
self.loadMessageList(); self.loadMessageList();
self.loadOrderList(); self.loadOrderList();
......
<template> <template>
<view class="study"> <view class="study">
<u-navbar <u-navbar :is-back="false" background="{background: transparent}" :border-bottom="false" :is-fixed="false">
:is-back="false" <text class="title-view">学习</text>
background="{background: transparent}"
:border-bottom="false"
:is-fixed="false"
>
<text class="title-view">学习</text>
</u-navbar> </u-navbar>
<image :src="bannerImage" mode="" class="banner"></image> <image :src="bannerImage" mode="" class="banner"></image>
<!-- <u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change"></u-tabs> --> <!-- <u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change"></u-tabs> -->
<view> <view>
<u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper> <u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs"
:current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view> </view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height: 755rpx;"> <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"
style="height: 755rpx;">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom">
<view class="standard" @click="goToPrint"> <view class="standard" @click="goToPrint">
...@@ -47,15 +44,18 @@ ...@@ -47,15 +44,18 @@
<image class="img" :src=courselist.course.preview_pic mode=""></image> <image class="img" :src=courselist.course.preview_pic mode=""></image>
<view class="right"> <view class="right">
<view class=""> <view class="">
{{courselist.course.name}} {{courselist.course.name}}
</view> </view>
<view class="intro" v-html="courselist.course.intro"> <view class="intro" v-html="courselist.course.intro">
{{courselist.course.intro}} {{courselist.course.intro}}
</view> </view>
<view class="" style="display:flex;justify-content: space-between;"> <view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent=courselist.learnedInfo.learnPercent style="width:54%;"></u-line-progress> <u-line-progress active-color="#2979ff"
<text v-text="(courselist.learnedInfo.isLearned) ?(courselist.learnedInfo.learnPercent==1)?'已完成':'继续':'未观看' "></text> :percent=courselist.learnedInfo.learnPercent style="width:54%;">
</u-line-progress>
<text
v-text="(courselist.learnedInfo.isLearned) ?(courselist.learnedInfo.learnPercent==1)?'已完成':'继续':'未观看' "></text>
</view> </view>
</view> </view>
</view> </view>
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
快速学习,使用APP接单、抢单 快速学习,使用APP接单、抢单
</view> </view>
<view class="" style="display:flex;justify-content: space-between;"> <view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="30" style="width:54%;"></u-line-progress> <u-line-progress active-color="#2979ff" :percent="30" style="width:54%;">
</u-line-progress>
<text>继续</text> <text>继续</text>
</view> </view>
</view> </view>
...@@ -87,7 +88,8 @@ ...@@ -87,7 +88,8 @@
让你全面了解充电桩市场及服务规范 让你全面了解充电桩市场及服务规范
</view> </view>
<view class="" style="display:flex;justify-content: space-between;"> <view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="100" style="width:54%;"></u-line-progress> <u-line-progress active-color="#2979ff" :percent="100" style="width:54%;">
</u-line-progress>
<text>完成</text> <text>完成</text>
</view> </view>
</view> </view>
...@@ -162,378 +164,394 @@ ...@@ -162,378 +164,394 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
msg: "赣南吴彦祖", msg: "赣南吴彦祖",
tabs: [ tabs: [{
{ name: "交付规范",
name: "交付规范", },
}, {
{ name: "培训通知",
name: "培训通知", },
}, {
{ name: "在线学习",
name: "在线学习", },
}, {
{ name: "考核认证",
name: "考核认证", },
}, ],
], current: 0,
current: 0, swiperCurrent: 0,
swiperCurrent: 0, params: {
params: { start: 0,
start: 0, },
}, list: [],
list: [], courselist: null,
courselist: null, loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式 isLoadMore: false, //是否加载中
isLoadMore: false, //是否加载中 course_id: "course_id_=173",
course_id: "course_id_=173", exam: null,
exam: null, };
}; },
}, onLoad() {
onLoad() { // this.getList();
this.getList(); // this.getCourseList();
this.getCourseList(); // this.getUserExamInfo();
this.getUserExamInfo(); },
}, computed: {
computed: { bannerImage() {
bannerImage() { return process.uniEnv.qn_base_url + "banner-xx.png";
return process.uniEnv.qn_base_url + "banner-xx.png"; },
}, },
}, methods: {
methods: { getList() {
getList() { this.$u.api
this.$u.api .getTrainingNoticeList(this.params)
.getTrainingNoticeList(this.params) .then((res) => {
.then((res) => { if (res.code == 200) {
if (res.code == 200) { if (res.data) {
if (res.data) { this.list = this.list.concat(res.data);
this.list = this.list.concat(res.data); if (res.data.length < 5) {
if (res.data.length < 5) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
//判断接口返回数据量小于请求数据量,则表示此为最后一页 this.isLoadMore = true;
this.isLoadMore = true; this.loadStatus = "nomore";
this.loadStatus = "nomore"; } else {
} else { this.isLoadMore = false;
this.isLoadMore = false; }
} } else {
} else { this.isLoadMore = true;
this.isLoadMore = true; this.loadStatus = "nomore";
this.loadStatus = "nomore"; }
} } else {
} else { //接口请求失败的处理
//接口请求失败的处理 uni.showToast({
uni.showToast({ title: res.message,
title: res.message, icon: "none",
icon: "none", });
}); this.isLoadMore = false;
this.isLoadMore = false; if (this.params.start > 0) {
if (this.params.start > 0) { this.page -= 5;
this.page -= 5; }
} }
} })
}) .catch((err) => {
.catch((err) => { uni.showToast({
uni.showToast({ title: err,
title: err, icon: "none",
icon: "none", });
}); this.isLoadMore = false;
this.isLoadMore = false; if (this.params.start > 0) {
if (this.params.start > 0) { this.page -= 5;
this.page -= 5; }
} });
}); },
}, //在线学习通用课程信息
//在线学习通用课程信息 getCourseList() {
getCourseList() { this.$u.api
this.$u.api .CourseList()
.CourseList() .then((res) => {
.then((res) => { if (res.code == 200) {
if (res.code == 200) { if (res.data) {
if (res.data) { this.courselist = res.data;
this.courselist = res.data; console.log("--------");
console.log("--------"); console.log(this.courselist);
console.log(this.courselist); if (res.data.length < 5) {
if (res.data.length < 5) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
//判断接口返回数据量小于请求数据量,则表示此为最后一页 this.isLoadMore = true;
this.isLoadMore = true; this.loadStatus = "nomore";
this.loadStatus = "nomore"; } else {
} else { this.isLoadMore = false;
this.isLoadMore = false; }
} } else {
} else { this.isLoadMore = true;
this.isLoadMore = true; this.loadStatus = "nomore";
this.loadStatus = "nomore"; }
} } else {
} else { //接口请求失败的处理
//接口请求失败的处理 uni.showToast({
uni.showToast({ title: res.message,
title: res.message, icon: "none",
icon: "none", });
}); this.isLoadMore = false;
this.isLoadMore = false; if (this.params.start > 0) {
if (this.params.start > 0) { this.page -= 5;
this.page -= 5; }
} }
} })
}) .catch((err) => {
.catch((err) => { uni.showToast({
uni.showToast({ title: err,
title: err, icon: "none",
icon: "none", });
}); this.isLoadMore = false;
this.isLoadMore = false; if (this.params.start > 0) {
if (this.params.start > 0) { this.page -= 5;
this.page -= 5; }
} });
}); },
}, //tabs通知swiper切换
//tabs通知swiper切换 tabsChange(index) {
tabsChange(index) { this.swiperCurrent = index;
this.swiperCurrent = index; switch (index) {
}, case 1:
//swiper-item左右移动,通知tabs的滑块跟随移动 this.getList();
transition(e) { break;
let dx = e.detail.dx; case 2:
this.$refs.uTabs.setDx(dx); this.getCourseList();
}, console.log('重新加载学习进度');
animationfinish(e) { break;
let current = e.detail.current; case 3:
this.$refs.uTabs.setFinishCurrent(current); this.getUserExamInfo();
this.swiperCurrent = current; break;
this.current = current; }
}, },
//跳转到assessment页面 //swiper-item左右移动,通知tabs的滑块跟随移动
aaa() { transition(e) {
wx.navigateTo({ let dx = e.detail.dx;
url: "./assessment", this.$refs.uTabs.setDx(dx);
}); },
}, animationfinish(e) {
//跳转到课程介绍 let current = e.detail.current;
ccc(id) { this.$refs.uTabs.setFinishCurrent(current);
uni.navigateTo({ this.swiperCurrent = current;
url: "./curriculum?course_id=" + id, this.current = current;
}); },
}, //跳转到assessment页面
//跳转到 aaa() {
bbb(e) { wx.navigateTo({
var news = { url: "./assessment",
body: e.body, });
id: e.id, },
level: e.level, //跳转到课程介绍
title: e.title, ccc(id) {
}; uni.navigateTo({
// console.log(news) url: "./curriculum?course_id=" + id,
});
},
//跳转到
bbb(e) {
var news = {
body: e.body,
id: e.id,
level: e.level,
title: e.title,
};
// console.log(news)
uni.navigateTo({ uni.navigateTo({
url: "./news-details", url: "./news-details",
}); });
setTimeout(() => { setTimeout(() => {
uni.$emit("news", news), console.log("发送数据"); uni.$emit("news", news), console.log("发送数据");
}, 500); }, 500);
console.log("跳转结束11111111"); console.log("跳转结束11111111");
}, },
//scroll-view到底部加载更多 //scroll-view到底部加载更多
onreachBottom() { onreachBottom() {
console.log("上拉触底函数"); console.log("上拉触底函数");
//上拉触底函数 //上拉触底函数
if (!this.isLoadMore) { if (!this.isLoadMore) {
this.isLoadMore = true; this.isLoadMore = true;
this.params.start += 5; this.params.start += 5;
if (this.loadStatus !== "nomore") { if (this.loadStatus !== "nomore") {
this.getList(); this.getList();
} }
} }
}, },
//跳转到拍照小程序首页 //跳转到拍照小程序首页
goToPrint() { goToPrint() {
console.log("111111"); console.log("111111");
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: "wxd1d6eede324b0465", appId: "wxd1d6eede324b0465",
success(res) { success(res) {
//打开成功 //打开成功
console.log("success", res); console.log("success", res);
}, },
fail(err) { fail(err) {
console.log("err", err); console.log("err", err);
}, },
}); });
}, },
//考核认证,通用认证,考试通过or未通过查询接口请求 //考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() { getUserExamInfo() {
uni.showLoading({ uni.showLoading({
title: "请稍候", title: "请稍候",
}); });
let that = this; let that = this;
uni.request({ uni.request({
url: url: "http://192.168.1.22" +
"http://192.168.1.22" + "/wxh-worker-rest/rest/exam" +
"/wxh-worker-rest/rest/exam" + "/serviceRule/userExamInfo/" +
"/serviceRule/userExamInfo/" + getApp().globalData.token +
getApp().globalData.token + "?examId=" +
"?examId=" + 2,
2, method: "POST",
method: "POST", data: {
data: { //examId:this.examId,
//examId:this.examId, },
}, header: {
header: { "Content-Type": "application/x-www-form-urlencoded",
"Content-Type": "application/x-www-form-urlencoded", },
}, success: (res) => {
success: (res) => { console.log(res.data);
console.log(res.data); uni.hideLoading();
uni.hideLoading(); if (!res.data) {
if (!res.data) { return;
return; }
} if (res.data.code == 401 || res.data.code == 403) {
if (res.data.code == 401 || res.data.code == 403) { // uni.navigateTo({
// uni.navigateTo({ // url: '/pages/login/wxlogin'
// url: '/pages/login/wxlogin' // })
// }) // return
// return console.log("洪塘张学友");
console.log("洪塘张学友"); }
} if (res.data.code == 200) {
if (res.data.code == 200) { //examStatus 用户考试状态 0考试中 1考试完成 2未参与
//examStatus 用户考试状态 0考试中 1考试完成 2未参与 that.exam = res.data.data;
that.exam = res.data.data; console.log(that.exam);
console.log(that.exam); if (res.data.data.examStatus == 2) {
if (res.data.data.examStatus == 2) { that.applyExam();
that.applyExam(); return;
return; }
} if (res.data.data.examStatus == 1) {
if (res.data.data.examStatus == 1) { console.log("111111111111111111111111111");
console.log("111111111111111111111111111"); that.isComplete = true;
that.isComplete = true; that.examScore = res.data.data.examScore;
that.examScore = res.data.data.examScore; that.postResult();
that.postResult(); return;
return; }
} if (res.data.data.examStatus == 0) {
if (res.data.data.examStatus == 0) { that.userExamId = res.data.data.id;
that.userExamId = res.data.data.id; that.getNext();
that.getNext(); }
} } else {
} else { uni.showToast({
uni.showToast({ icon: "none",
icon: "none", title: res.data.message,
title: res.data.message, });
}); }
} },
}, fail: (e) => {
fail: (e) => { uni.hideLoading();
uni.hideLoading(); uni.showToast({
uni.showToast({ icon: "none",
icon: "none", title: "获取考试信息失败",
title: "获取考试信息失败", });
}); },
}, });
}); },
}, },
}, };
};
</script> </script>
<style> <style>
.study { .study {
height: 100vh; height: 100vh;
background-color: #f4f5f7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
} }
.title-view {
color: #333333; .title-view {
font-weight: bold; color: #333333;
font-size: 40rpx; font-weight: bold;
} font-size: 40rpx;
}
.banner {
width: 690rpx;
height: 240rpx;
/* margin-left: -15rpx; */
}
/* //交付规范 */
.standard {
width: 656rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #82848a;
padding: 0 34rpx;
margin: 72rpx auto;
}
/* //培训通知 */
.notice {
border: #808080 solid 2rpx;
width: 100%;
height: 400rpx;
margin-top: 36rpx;
overflow: hidden;
}
.n-head {
text-align: center;
margin: 32rpx 0;
}
.news {}
/* //在线学习 */
.currency-class {
width: 100%;
background: #ffffff;
padding: 18rpx;
margin-bottom: 11px;
border-radius: 12rpx;
}
.banner { .title {
width: 690rpx; font-size: 32rpx;
height: 240rpx; font-weight: bold;
/* margin-left: -15rpx; */ font-family: PingFang-SC-Bold, PingFang-SC;
} }
/* //交付规范 */ .class1 {
.standard { display: flex;
width: 656rpx; justify-content: space-between;
display: flex; padding-top: 22rpx;
justify-content: space-between; margin-top: 28rpx;
border-bottom: 1rpx solid #82848a; border-top: 1rpx solid #808080;
padding: 0 34rpx; }
margin: 72rpx auto;
}
/* //培训通知 */ .img {
.notice { width: 201rpx;
border: #808080 solid 2rpx; height: 201rpx;
width: 100%; display: block;
height: 400rpx; margin-right: 0rpx;
margin-top: 36rpx; }
overflow: hidden;
}
.n-head { .right {
text-align: center; width: 428rpx;
margin: 32rpx 0; display: flex;
} flex-direction: column;
.news { justify-content: space-between;
} }
/* //在线学习 */
.currency-class {
width: 100%;
background: #ffffff;
padding: 18rpx;
margin-bottom: 11px;
border-radius: 12rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
font-family: PingFang-SC-Bold, PingFang-SC;
}
.class1 {
display: flex;
justify-content: space-between;
padding-top: 22rpx;
margin-top: 28rpx;
border-top: 1rpx solid #808080;
}
.img { .intro {
width: 201rpx; color: #9999a6;
height: 201rpx; }
display: block;
margin-right: 0rpx;
}
.right { .tab {
width: 428rpx; background: #fff;
display: flex; height: 82rpx;
flex-direction: column; margin: 0 0;
justify-content: space-between; }
}
.intro {
color: #9999a6;
}
.tab {
background: #fff;
height: 82rpx;
margin: 0 0;
}
.text { .text {
margin: 0 40rpx; margin: 0 40rpx;
line-height: 82rpx; line-height: 82rpx;
color: #667eb5; color: #667eb5;
} }
.content { .content {
margin: 5px 0; margin: 5px 0;
height: 485rpx; height: 485rpx;
background: #fff; background: #fff;
} }
swiper { swiper {
height: 691rpx; height: 691rpx;
} }
</style> </style>
<template> <template>
<view class="learn-vedio" v-if="isShowVideo"> <view class="learn-vedio" v-if="isShowVideo">
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view><video <view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc"
object-fit="cover" :options="playerOptions" :playsinline="true" @play="playCourse" @error="videoErrorCallback"
class="course-video" @ready="playerReadied" @timeupdate="onPlayerTimeupdate($event)" controls></video></view>
id="courseVideo" <view class="title-content">
:src="courseSrc" <view class="item-content">
:options="playerOptions" <view class="item-st">
:playsinline="true" <image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
@play="playCourse" <text class="item-st-text">{{ courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" }}</text>
@error="videoErrorCallback" </view>
@ready="playerReadied" <view class="item-title">{{ courseTitle.split(" ") ? courseTitle.split(" ")[1] : "" }}</view>
@timeupdate = "onPlayerTimeupdate($event)" </view>
controls <view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
></video </view>
></view> <view class="learn-view" v-if="courseId >= 0">
<view class="title-content"> <view class="learn-view-title">视频内容介绍</view>
<view class="item-content"> <!-- <view
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{
courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
}}</text>
</view>
<view class="item-title">{{
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
</view>
<view
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view
>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view>
<!-- <view
class="learn-list" class="learn-list"
v-for="(item, key) in courseOutlines[courseId]" v-for="(item, key) in courseOutlines[courseId]"
:key="key" :key="key"
> --> > -->
<view class="learn-list-item">{{ item }}</view> <!-- <view class="learn-list-item">{{ item }}</view> -->
</view> <view class="u-content">
</view> <u-parse :html="CourseSectionlist.content"></u-parse>
</view> </view>
</view>
</view>
</view>
<view v-else> <view v-else>
<view class="title"> <view class="title">
{{CourseSectionlist.name}} {{CourseSectionlist.name}}
</view> </view>
<view class="content" v-html="CourseSectionlist.content"> <view class="u-content">
{{CourseSectionlist.content}} <u-parse :html="CourseSectionlist.content"></u-parse>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
courseId: "", courseId: "",
courseStatus: 0, courseStatus: 0,
courseSrc: "", courseSrc: "",
courseTitle: "", courseTitle: "",
courseDesc: "", courseDesc: "",
currentIndex: -1, // 第几个视频 currentIndex: -1, // 第几个视频
section_id:0, section_id: 0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {},//节信息 CourseSectionlist: {}, //节信息
playerOptions : { playerOptions: {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度 playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。 autoplay: true, //如果true,浏览器准备好时开始回放。
muted: false, // 默认情况下将会消除任何音频。 muted: false, // 默认情况下将会消除任何音频。
loop: false, // 导致视频一结束就重新开始。 loop: false, // 导致视频一结束就重新开始。
preload: 'auto', preload: 'auto',
language: 'zh-CN', language: 'zh-CN',
aspectRatio: '16:9', aspectRatio: '16:9',
fluid: true, fluid: true,
// sources: [{ notSupportedMessage: '此视频暂无法播放,请稍后再试',
// type: "", controlBar: {
// src: "" //url地址 timeDivider: true,
// }], durationDisplay: true,
// poster: "../../static/images/test.jpg", //你的封面地址 remainingTimeDisplay: false,
// width: document.documentElement.clientWidth, fullscreenToggle: true //全屏按钮
notSupportedMessage: '此视频暂无法播放,请稍后再试',
controlBar: {
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: false,
fullscreenToggle: true //全屏按钮
}
},
gklog: '',
videoTotalTime: 0,
howTimeToUpdateLearnedStatus: 5,//设置几秒提交一次状态
status: 1,//是否已学习默认1已学习
howLongIsLearned: this.videoTotalTime/2,//默认设置观看1/2就是已学
};
},
computed: {
courseOutlines() {
// 视频内容介绍
return {
1: [
"1、考核规则:接单及时率",
"2、考核规则:上门及时率",
"3、考核规则:安装完工率",
"4、考核规则:资料提交及时率",
"5、考核规则:安装完工率",
"6、考核规则:客户满意度",
],
2: ["1、必备材料4大类", "2、施工工具准备"],
3: [
"1、接线安装工艺标准",
"2、PVC、镀锌管电缆管明敷",
"3、电缆敷设的防火要求",
"4、电源点标识",
"5、配电箱接线及安装",
"6、管线敷设接头处理",
"7、充电桩内部接线",
"8、配电箱安装",
],
4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
};
},
kcImage() {
return process.uniEnv.qn_base_url + "kc.png";
},
},
onLoad(e) {
this.getCourseSection({section_id:e.section_id})
},
onReady: function (res) {
// #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext("courseVideo");
// #endif
},
methods: {
onPlayerTimeupdate (player) {
console.log('-----onplay----');
console.log(player);
let intCurrentTime = parseInt(player.detail.currentTime);
this.updateLearnedStatus(intCurrentTime);
this.gklog = intCurrentTime;
console.log(' onPlayerTimeupdate!', this.gklog)
},
videoErrorCallback: function (e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
getRandomColor: function () {
const rgb = [];
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16);
color = color.length == 1 ? "0" + color : color;
rgb.push(color);
}
return "#" + rgb.join("");
},
playCourse: function (e) {
if(this.courseStatus && (this.courseStatus == "1"||this.courseStatus == 1)) {
return
}
this.changeCourseStatus();
},
playerReadied (player) {
console.log('i go to playerReadied gklog:' + this.gklog)
player.currentTime(this.gklog)
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
getCourseSection(param) {
this.$u.api
.CourseSection(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.CourseSectionlist = res.data;
console.log("--------")
console.log(this.CourseSectionlist)
let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0";
if(this.isShowVideo){
let coureWareList = res.data.courseware;
this.courseSrc = coureWareList[0].src;
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time);
console.log('视频时长信息:' + this.videoTotalTime);
this.courseTitle = res.data.name;
this.courseDesc = res.data.content;
this.section_id = res.data.id;
}
} }
} },
gklog: '',
videoTotalTime: 0,
howTimeToUpdateLearnedStatus: 5, //设置几秒提交一次状态
status: 1, //是否已学习默认1已学习
howLongIsLearned: this.videoTotalTime / 2, //默认设置观看1/2就是已学
};
},
computed: {
courseOutlines() {
// 视频内容介绍
return {
1: [
"1、考核规则:接单及时率",
"2、考核规则:上门及时率",
"3、考核规则:安装完工率",
"4、考核规则:资料提交及时率",
"5、考核规则:安装完工率",
"6、考核规则:客户满意度",
],
2: ["1、必备材料4大类", "2、施工工具准备"],
3: [
"1、接线安装工艺标准",
"2、PVC、镀锌管电缆管明敷",
"3、电缆敷设的防火要求",
"4、电源点标识",
"5、配电箱接线及安装",
"6、管线敷设接头处理",
"7、充电桩内部接线",
"8、配电箱安装",
],
4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
};
},
kcImage() {
return process.uniEnv.qn_base_url + "kc.png";
},
},
onLoad(e) {
this.getCourseSection({
section_id: e.section_id
}) })
.catch((err) => { },
console.log('--------settttt---------'); onReady: function(res) {
console.log(err); // #ifndef MP-ALIPAY
uni.showToast({ this.videoContext = uni.createVideoContext("courseVideo");
title: err, // #endif
icon: "none", },
methods: {
onPlayerTimeupdate(player) {
console.log('-----onplay----');
console.log(player);
let intCurrentTime = parseInt(player.detail.currentTime);
this.updateLearnedStatus(intCurrentTime);
this.gklog = intCurrentTime;
console.log(' onPlayerTimeupdate!', this.gklog)
},
videoErrorCallback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
}); });
}); },
}, getRandomColor: function() {
updateLearnedStatus(nowLength) { const rgb = [];
if(this.gklog != nowLength && nowLength%this.howTimeToUpdateLearnedStatus == 0){ for (let i = 0; i < 3; ++i) {
if(nowLength < this.howLongIsLearned){ let color = Math.floor(Math.random() * 256).toString(16);
this.status = 0; color = color.length == 1 ? "0" + color : color;
}else{ rgb.push(color);
this.status = 1; }
console.log('--已学习--'); return "#" + rgb.join("");
} },
//大于 playCourse: function(e) {
let param = { if (this.courseStatus && (this.courseStatus == "1" || this.courseStatus == 1)) {
section_id: this.section_id, return
video_time: nowLength, }
status: this.status, this.changeCourseStatus();
}; },
this.$u.api.updateLearnCourses(param).then((res) => { playerReadied(player) {
console.log('--'+this.howTimeToUpdateLearnedStatus+'更新一次观看状态--time:' + nowLength); console.log('i go to playerReadied gklog:' + this.gklog)
}); player.currentTime(this.gklog)
} },
} changeCourseStatus() {
}, let that = this;
}; if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
getCourseSection(param) {
this.$u.api
.CourseSection(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.CourseSectionlist = res.data;
console.log("--------")
console.log(this.CourseSectionlist)
let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0";
if (this.isShowVideo) {
let coureWareList = res.data.courseware;
this.courseSrc = coureWareList[0].src;
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time);
console.log('视频时长信息:' + this.videoTotalTime);
this.courseTitle = res.data.name;
this.courseDesc = res.data.content;
this.section_id = res.data.id;
this.section_content = res.data.content;
}
}
}
})
.catch((err) => {
console.log('--------settttt---------');
console.log(err);
uni.showToast({
title: err,
icon: "none",
});
});
},
updateLearnedStatus(nowTime) {
if (this.gklog != nowTime && nowTime % this.howTimeToUpdateLearnedStatus == 0) {
if (nowTime < this.howLongIsLearned) {
this.status = 0;
} else {
this.status = 1;
console.log('--大于规定时间标记为已学习--');
}
let param = {
section_id: this.section_id,
video_time: nowTime,
status: this.status,
};
this.$u.api.updateLearnCourses(param).then((res) => {
console.log('--' + this.howTimeToUpdateLearnedStatus + '更新一次观看状态--time:' + nowTime);
});
}
}
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.learn-vedio { .learn-vedio {
background-color: #f4f5f7; background-color: #f4f5f7;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto; overflow-y: auto;
} }
.course-video {
width: 100%;
}
.course-video { .course-title {
width: 100%; font-size: 36rpx;
} font-weight: 700;
padding: 40rpx 40rpx 10rpx 40rpx;
}
.course-title { .title {
font-size: 36rpx; font-weight: 700;
font-weight: 700; font-family: Medium, Helvetica Neue, Helvetica, Arial, sans-serif;
padding: 80rpx 60rpx 40rpx 60rpx; font-size: 77rpx;
} color: #333;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
}
.title { .course-desc {
font-weight: 700; margin-left: 60rpx;
font-family: Medium,Helvetica Neue,Helvetica,Arial,sans-serif; }
font-size: 77rpx;
color: #333;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.content { .title-content {
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} background-color: #ffffff;
color: #999999;
font-size: 24rpx;
.course-desc { .item-content {
margin-left: 60rpx; display: flex;
} align-items: center;
}
.title-content { .item-st {
padding: 40rpx 30rpx; width: 80rpx;
margin-bottom: 20rpx; height: 36rpx;
background-color: #ffffff; padding-right: 2rpx;
color: #999999; text-align: center;
font-size: 24rpx; margin-right: 20rpx;
line-height: 24rpx;
position: relative;
.item-content { .item-st-text {
display: flex; color: #ffffff;
align-items: center; position: absolute;
} font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
.item-st { .item-title {
width: 80rpx; color: #333333;
height: 36rpx; font-size: 44rpx;
padding-right: 2rpx; font-weight: bold;
text-align: center; }
margin-right: 20rpx; }
line-height: 24rpx;
position: relative;
.item-st-text {
color: #ffffff;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
.item-title { .item-content {
color: #333333; display: flex;
font-size: 44rpx; padding-bottom: 30rpx;
font-weight: bold; }
}
}
.item-content { .item-title {
display: flex; color: #333333;
padding-bottom: 30rpx; font-size: 28rpx;
} }
.item-title { .learn-view {
color: #333333; background-color: #ffffff;
font-size: 28rpx; border-radius: 12rpx;
} padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view { .learn-view-title {
background-color: #ffffff; font-size: 32rpx;
border-radius: 12rpx; font-weight: bold;
padding: 38rpx 30rpx 30rpx 30rpx; margin-bottom: 10rpx;
margin-bottom: 20rpx; }
font-size: 32rpx;
color: #333333;
.learn-view-title { .learn-list {
font-size: 32rpx; .learn-list-item {
font-weight: bold; font-size: 28rpx;
margin-bottom: 10rpx; margin-top: 30rpx;
} margin-bottom: 30rpx;
.learn-list { color: #333333;
.learn-list-item { }
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
}
.line-view { .line-view {
background-color: #f4f5f7; background-color: #f4f5f7;
height: 2rpx; height: 2rpx;
width: 100%; width: 100%;
} }
} }
} }
.u-content {
// margin-top: 10rpx;
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
}
</style> </style>
<template> <template>
<view class="u-wrap"> <view>
<u-tabs-swiper ref="tabs" :current="tabIndex" :list="list" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper> <view class="u-wrap" v-if="!takeStatus">
<view class="u-menu-wrap"> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="26" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar>
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" <u-tabs-swiper ref="tabs" :current="tabIndex" :list="list" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper>
:scroll-into-view="itemId"> <view class="u-menu-wrap">
<view v-for="(item,index) in groupList" :key="index" class="u-tab-item" <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> :scroll-into-view="itemId">
<text class="u-line-1">{{item.groupName}}</text> <view v-for="(item,index) in groupList" :key="index" class="u-tab-item"
</view> :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
</scroll-view> <text class="u-line-1">{{item.groupName}}</text>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" </view>
@scroll="rightScroll"> </scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
@scroll="rightScroll">
<u-form :model="form" ref="uForm"> <u-form :model="form" ref="uForm">
<template v-for="(groupItem,groupIndex) in groupList"> <template v-for="(groupItem,groupIndex) in groupList">
<view class="class-item" :key="groupIndex"> <view class="class-item" :key="groupIndex">
<view class="title">{{groupItem.groupName}}</view> <view class="title">{{groupItem.groupName}}</view>
<view class="class-bd"> <view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.item" :key="itemIndex" <u-form-item v-for="(item,itemIndex) in groupItem.item" :key="itemIndex"
label-position="top" :prop="item.fieldsName" :border-bottom="false"> label-position="top" :prop="item.fieldsName" :border-bottom="false">
<view class="label" v-if="item.fieldsType!=='location'"> <view class="label" v-if="item.fieldsType!=='location'">
<!-- <text class="required" v-if="item.required">*</text> --> <!-- <text class="required" v-if="item.required">*</text> -->
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}} {{item.fieldsTitle}}
</view> </view>
<template v-if="item.fieldsType"> <template v-if="item.fieldsType">
<xh-input v-if="typeToComponentType(item.fieldsType)==='input'" :groupIndex="groupIndex" <xh-input v-if="typeToComponentType(item.fieldsType)==='input'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange"> :itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-input> </xh-input>
<xh-multi-input v-else-if="typeToComponentType(item.fieldsType)==='multiinput'" <xh-multi-input v-else-if="typeToComponentType(item.fieldsType)==='multiinput'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-multi-input> </xh-multi-input>
<xh-radio v-else-if="typeToComponentType(item.fieldsType)==='radio'" <xh-radio v-else-if="typeToComponentType(item.fieldsType)==='radio'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-radio> </xh-radio>
<xh-checkbox v-else-if="typeToComponentType(item.fieldsType)==='checkbox'" <xh-checkbox v-else-if="typeToComponentType(item.fieldsType)==='checkbox'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-checkbox> </xh-checkbox>
<xh-select v-else-if="typeToComponentType(item.fieldsType)==='select'" <xh-select v-else-if="typeToComponentType(item.fieldsType)==='select'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-select> </xh-select>
<xh-files v-else-if="typeToComponentType(item.fieldsType)==='file'" <xh-files v-else-if="typeToComponentType(item.fieldsType)==='file'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
@value-change="fieldValueChange"> :files="files[itemIndex.toString()]"
</xh-files> @value-change="fieldValueChange" @getTakeStatus="getTakeStatus">
<xh-location v-else-if="typeToComponentType(item.fieldsType)==='location'" </xh-files>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" <xh-location v-else-if="typeToComponentType(item.fieldsType)==='location'"
@value-change="fieldValueChange"> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
</xh-location> @value-change="fieldValueChange">
<xh-scan v-else-if="typeToComponentType(item.fieldsType)==='scan'" </xh-location>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" <xh-scan v-else-if="typeToComponentType(item.fieldsType)==='scan'"
@value-change="fieldValueChange"> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
</xh-scan> @value-change="fieldValueChange">
<xh-picker v-else-if="typeToComponentType(item.fieldsType)==='picker'" </xh-scan>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" <xh-picker v-else-if="typeToComponentType(item.fieldsType)==='picker'"
@value-change="fieldValueChange"> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
</xh-picker> @value-change="fieldValueChange">
<xh-time v-else-if="typeToComponentType(item.fieldsType)==='time'" </xh-picker>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" <xh-time v-else-if="typeToComponentType(item.fieldsType)==='time'"
@value-change="fieldValueChange"> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item"
</xh-time> @value-change="fieldValueChange">
</template> </xh-time>
</u-form-item> </template>
</u-form-item>
</view>
</view> </view>
</view> </template>
</template> </u-form>
</u-form> </scroll-view>
</scroll-view> </view>
</view> <view class="btn-wrap flex-xc">
<view @click="nextStep">下一步</view> <u-button class="btn-submit" @click="$u.debounce(nextStep, 500)" :custom-style="buttonStyle"
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
下一步
</u-button>
</view>
</view>
<take-photo v-else @close="closeTake"></take-photo>
</view> </view>
</template> </template>
<script> <script>
...@@ -87,7 +97,7 @@ ...@@ -87,7 +97,7 @@
import XhScan from '@/components/createCom/XhScan.vue' import XhScan from '@/components/createCom/XhScan.vue'
import XhPicker from '@/components/createCom/XhPicker.vue' import XhPicker from '@/components/createCom/XhPicker.vue'
import XhTime from '@/components/createCom/XhTime.vue' import XhTime from '@/components/createCom/XhTime.vue'
import takePhoto from '@/components/take/index.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue' // import XhRadio from '@/components/createCom/XhRadio.vue'
export default { export default {
data() { data() {
...@@ -103,7 +113,7 @@ ...@@ -103,7 +113,7 @@
name: '安装信息' name: '安装信息'
} }
], ],
tabIndex: 0, tabIndex: 1,
scrollTop: 0, //tab标题的滚动条位置 scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0, oldScrollTop: 0,
current: 0, // 预设当前项的值 current: 0, // 预设当前项的值
...@@ -144,7 +154,11 @@ ...@@ -144,7 +154,11 @@
// 触发器可以同时用blur和change // 触发器可以同时用blur和change
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}] }]
} },
submitBtnStatus: false,
takeStatus: false,
fileIndex: null,
files: []
} }
}, },
components: { components: {
...@@ -157,7 +171,8 @@ ...@@ -157,7 +171,8 @@
XhLocation, XhLocation,
XhScan, XhScan,
XhPicker, XhPicker,
XhTime, XhTime,
'take-photo': takePhoto
}, },
created() { created() {
// console.log(allComponents,'allComponents') // console.log(allComponents,'allComponents')
...@@ -176,9 +191,36 @@ ...@@ -176,9 +191,36 @@
computed: { computed: {
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png' return process.uniEnv.qn_base_url + 'mixing.png'
},
buttonStyle() {
return this.submitBtnStatus ? {
'color': '#FFFFFF',
'background-color': '#2272FF;',
'width': '600rpx',
'height': '104rpx',
'font-size': '32rpx',
'font-weight': 'bold'
} : {
'color': '#FFFFFF',
'background-color': '#D1D4D4;',
'width': '600rpx',
'height': '104rpx',
'font-size': '32rpx',
'font-weight': 'bold'
}
} }
}, },
methods: { methods: {
getTakeStatus(event) {
this.takeStatus = event.status
this.fileIndex = event.index.toString()
if(!this.files[event.index] || this.files[event.index].length < 1) this.files[event.index] = []
},
closeTake(images) {
this.takeStatus = false
//const newFile = this.files[this.fileIndex].concat(images)
this.$set(this.files, this.fileIndex, images)
},
// 字段的值更新 // 字段的值更新
fieldValueChange(data) { fieldValueChange(data) {
// data.groupIndex data.itemIndex值下标 data.value //值 // data.groupIndex data.itemIndex值下标 data.value //值
...@@ -199,14 +241,12 @@ ...@@ -199,14 +241,12 @@
console.log(this.form, 'this.form') console.log(this.form, 'this.form')
}, },
nextStep(item) { nextStep(item) {
// 下一步 if (this.tabIndex < 3) this.tabIndex++
console.log(item, 'item')
}, },
typeToComponentType(type) { typeToComponentType(type) {
// 将fieldType类型统一转换为公共组件判定类型 // 将fieldType类型统一转换为公共组件判定类型
let formType = '' let formType = ''
type = type.toLocaleLowerCase() type = type.toLocaleLowerCase()
//console.log(type,'type')
switch (type) { switch (type) {
case 'text': case 'text':
case 'password': case 'password':
...@@ -242,9 +282,6 @@ ...@@ -242,9 +282,6 @@
case 'time': case 'time':
formType = 'time' formType = 'time'
break break
case 'file':
formType = 'XhFiles'
break
} }
//console.log(formType,'formType') //console.log(formType,'formType')
return formType return formType
...@@ -522,5 +559,11 @@ ...@@ -522,5 +559,11 @@
.item-menu-image { .item-menu-image {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
}
/*提交按钮*/
.btn-wrap {
width: 100%;
padding: 20rpx 0 40rpx 0;
} }
</style> </style>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmit">确定</button> <button class="btn" @click="submitForm" :loading="submiting" :disabled="disabledSubmit">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -89,7 +89,8 @@ ...@@ -89,7 +89,8 @@
title:'问题类型', title:'问题类型',
}, },
appoint:{ appoint:{
title:'预约时间', '报单': '下次联系时间',
'改约': '预约时间',
} }
}, },
config: null, config: null,
...@@ -117,11 +118,14 @@ ...@@ -117,11 +118,14 @@
disabledSubmit() { disabledSubmit() {
let self = this let self = this
debugger if(self.trace.reasonType && self.trace.reasonType == '报备'){
if(self.trace.reasonType if(self.trace.reasonRelegation && self.trace.reason
&& (self.trace.reasonType == '报备' || self.trace.reasonType == '改约')){ && self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) {
return false
}
} else if(self.trace.reasonType && self.trace.reasonType == '改约') {
if(self.trace.reasonRelegation && self.trace.reason if(self.trace.reasonRelegation && self.trace.reason
&& self.trace.appointmentDatetimeRange) { && self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) {
return false return false
} }
} }
...@@ -212,12 +216,23 @@ ...@@ -212,12 +216,23 @@
dateChange(data){ dateChange(data){
// 点击日期选择 // 点击日期选择
console.log(data,'week-data') console.log(data,'week-data')
let self = this
if(self.trace.reasonType == '报备') {
self.trace.appointmentDatetime = null
self.trace.nextTraceDatetime = data.item.day
} else if(self.trace.reasonType == '改约') {
self.trace.appointmentDatetime = data.item.day
self.trace.nextTraceDatetime = null
}
}, },
timeChange(data){ timeChange(data){
// 时间段选择变化 // 时间段选择变化
console.log(data,'week-data') console.log(data,'week-data')
this.trace.appointmentDatetimeRange = data.item
}, },
async submitFrom() { async submitForm() {
let self = this let self = this
self.orderId = 666 self.orderId = 666
if(!self.orderId) { if(!self.orderId) {
......
<template> <template>
<TabBarPage title="订单" :fixed="true"> <TabBarPage title="订单" :fixed="true">
<!-- <view class="wrap"> --> <!-- <view class="wrap"> -->
<view class="tools-box"> <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
<u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white" <u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange" height="72" inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange" height="72"
bold> bold>
</u-subsection> </u-subsection>
</view>
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-text">搜订单</text>
</view>
</view>
<view class="u-tabs-box" v-show="curNow == 0">
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
:offset="[0,0]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false" font-size="28" bold></u-tabs>
</view> </view>
<view class="tab-view"> <view class="search-btn" @click="handleClickSearch">
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> --> <image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring> <text class="search-btn-text">搜订单</text>
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</scroll-view>
<!-- </swiper-item> -->
</view> </view>
</view>
<view class="u-tabs-box" v-show="curNow == 0">
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
bar-width="44" :offset="[0,0]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false" font-size="28" bold></u-tabs>
</view>
<NoOrder v-if="noMore" customStyle="margin-top: 100rpx;background-color: #F4F5F7" />
<view v-else class="tab-view">
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring>
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick(item)"
@action="handleAction(item)"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</scroll-view>
<!-- </swiper-item> -->
</view>
<!-- </view> --> <!-- </view> -->
<PopView title="aaaa" message="bbbb" :visible="visibale"/> <PopView title="aaaa" message="bbbb" :visible="visibale" />
</TabBarPage> </TabBarPage>
</template> </template>
<script> <script>
import TabBarPage from "@/components/tabBarList/index.vue" import TabBarPage from "@/components/tabBarList/index.vue"
import OrderCell from "@/components/order/index.vue" import OrderCell from "@/components/order/index.vue"
import NoOrder from "@/components/order/noOrder.vue"
export default { export default {
components: { components: {
TabBarPage, TabBarPage,
OrderCell OrderCell,
NoOrder
}, },
data() { data() {
return { return {
visibale: false, visibale: false,
showSview: true, showSview: true,
curNow: 0, curNow: 0,
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 100,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus: {
0: 'waitAppointment',
1: 'waitCheckIn',
2: 'waitFinish',
3: 'exception',
5: 'finish'
},
orderList: [], orderList: [],
list: [{ list: [{
name: '待预约', name: '待预约',
...@@ -72,7 +69,7 @@ ...@@ -72,7 +69,7 @@
total: 0, total: 0,
}, },
{ {
name: '待审核', name: '审核中',
total: 0, total: 0,
}, },
{ {
...@@ -83,6 +80,7 @@ ...@@ -83,6 +80,7 @@
current: 0, current: 0,
loadStatus: 'loading', loadStatus: 'loading',
dataValue: [], dataValue: [],
loaded: false
}; };
}, },
onLoad() { onLoad() {
...@@ -94,31 +92,57 @@ ...@@ -94,31 +92,57 @@
subList() { subList() {
return ['待受理', '已完工'] return ['待受理', '已完工']
}, },
// 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工' // 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
orderType() { orderType() {
return this.currentIndex + 1 return this.indexStatus[this.currentIndex]
}, },
currentIndex() { currentIndex() {
return this.curNow == 0 ? this.current : 5 return this.curNow == 0 ? this.current : 5
}, },
sousuoImage() { sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png' return process.uniEnv.qn_base_url + 'sousuo.png'
},
types() {
return {
'waitAppointment': 0, // 待预约、
'waitCheckIn': 1, // 待签到、
'waitFinish': 2, // 待完工、
'review': 3, // 审核中、
'exception': 4, // 异常单、
'finish': 5, //已完工
}
},
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus() {
return {
0: 'waitAppointment',
1: 'waitCheckIn',
2: 'waitFinish',
3: 'review',
4: 'exception',
5: 'finish'
}
},
noMore() {
console.log('nomore:', this.orderList.length == 0 && this.pageNumber != 0)
return this.orderList.length == 0 && this.loaded
} }
}, },
methods: { methods: {
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
this.pageNumber = 0 this.pageNumber = 0
this.orderList = [] this.orderList = []
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getOrderList(index === 0 ? 0 : 5) this.getOrderList(index === 0 ? 0 : 5)
}, },
// tab栏切换 // tab栏切换
change(index) { change(index) {
this.current = index; this.current = index;
this.orderList = [] this.pageNumber = 0
this.loadStatus = 'loading' this.orderList = []
this.getOrderList(index); this.loadStatus = 'loading'
this.getOrderList(index);
}, },
/** /**
* 获取当前位置的经纬度 * 获取当前位置的经纬度
...@@ -140,15 +164,16 @@ ...@@ -140,15 +164,16 @@
}); });
}, },
reachBottom(e) { reachBottom(e) {
if (this.loadStatus != 'loadmore') return if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading' this.loadStatus == 'loading'
this.getOrderList(this.currentIndex) this.getOrderList(this.currentIndex)
}, },
// 页面数据 // 页面数据
getOrderList(index) { getOrderList(index) {
// 状态处理 // 状态处理
// this.pageNumber += 1 this.pageNumber += 1
this.loaded = false
var param = { var param = {
pageNumber: this.pageNumber, pageNumber: this.pageNumber,
pageSize: this.pageSize, pageSize: this.pageSize,
...@@ -156,15 +181,15 @@ ...@@ -156,15 +181,15 @@
type: this.indexStatus[index] type: this.indexStatus[index]
} }
var self = this; var self = this;
self.$u.api.listOrder(param).then((res) => { self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("getOrderList", res.data) console.log("getOrderList", res.data)
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/ /*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
var res = { res.data.type = self.orderType
data: { if (res.data.list) {
total: 15, if (res.data.list.length == 0 && res.data.total > 0) {
orderType: this.currentIndex, res.data.total = 15
list: [{ res.data.list = [{
orderServiceType: '安装', // 服务类型:安装、维修 orderServiceType: '安装', // 服务类型:安装、维修
categoryName: '充电桩', // 品类:充电桩 categoryName: '充电桩', // 品类:充电桩
orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池 orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
...@@ -183,25 +208,29 @@ ...@@ -183,25 +208,29 @@
auditResults: {}, // 审核结果 auditResults: {}, // 审核结果
orderBusinessType: 'R', // 业务类型 R 为抢单 orderBusinessType: 'R', // 业务类型 R 为抢单
orderId:'1100000216' orderId:'1100000216'
}] }]
res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data
.list,
...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list, ...res
.data.list, ...res.data.list
]
} }
}
}
res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list,
...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list]
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/ /*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回orderType,防止数据返回延迟期间点击了其他的tab // 后台需要返回type,防止数据返回延迟期间点击了其他的tab
if (res.data) { if (res.data.type != self.orderType) return
if (res.data.list) {
self.orderList.push(...res.data.list) self.orderList.push(...res.data.list)
if (self.list[res.data.orderType]) { if (self.list[self.types[res.data.type]]) {
self.list[res.data.orderType].total = res.data.total self.list[self.types[res.data.type]].total = res.data.total
} }
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore' self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
} }
} else { } else {
console.log(res.message, "获取订单数量失败!"); console.log(res.message, "获取订单数量失败!");
} }
this.loaded = true
}); });
}, },
...@@ -244,11 +273,11 @@ ...@@ -244,11 +273,11 @@
handleAction(item) { handleAction(item) {
console.log('click button') console.log('click button')
this.viewOderItem(item.orderId) this.viewOderItem(item.orderId)
}, },
handleClickSearch() { handleClickSearch() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/search' url: 'pages/order/search'
}) })
} }
} }
}; };
...@@ -434,12 +463,12 @@ ...@@ -434,12 +463,12 @@
flex-direction: column; flex-direction: column;
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
width: 100%; width: 100%;
} }
.tab-view { .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
// .swiper-box { // .swiper-box {
...@@ -447,9 +476,9 @@ ...@@ -447,9 +476,9 @@
// } // }
// .swiper-item { // .swiper-item {
// height: 100%; // height: 100%;
// .page-box { // .page-box {
// padding-bottom: 20rpx; // padding-bottom: 20rpx;
// } // }
// } // }
...@@ -473,12 +502,14 @@ ...@@ -473,12 +502,14 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.search-image {
width: 36rpx; .search-image {
height: 32rpx; width: 36rpx;
flex-shrink: 0; height: 32rpx;
margin-right: 24rpx; flex-shrink: 0;
margin-right: 24rpx;
} }
.search-btn-text { .search-btn-text {
line-height: 36rpx; line-height: 36rpx;
font-weight: 400; font-weight: 400;
......
<!-- 过程反馈 --> <!-- 过程反馈 -->
<template> <template>
<view class="refuse-box bg"> <view class="refuse-box bg">
<u-navbar back-icon-color="#FFFFFF" :background="background" title="拒单" title-color="#fff" :border-bottom="false"></u-navbar> <u-navbar back-icon-color="#FFFFFF" :background="background" title-color="#fff" :border-bottom="false"></u-navbar>
<view class="title">拒单说明</view> <view class="title">拒单说明</view>
<view class="content"> <view class="content">
<view class="con-box"> <view class="con-box">
<view class="tit u-m-b-40 u-flex"><text class="txt label">※</text>{{refuse.title}}</view> <view class="tit u-m-b-40 u-flex"><text class="txt label">※</text>{{refuse.title}}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view :class="{'txt-item':true,'active':true}" v-for="(txt,index) in refuse.list" :key="index"> <view
:class="{
'txt-item':true,
'active': (formData.rejectReason == txt)}"
v-for="(txt,index) in refuse.list"
:key="index" @click="changeReason(txt)">
<text class="txt">{{txt}}</text> <text class="txt">{{txt}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="con-box"> <view class="con-box" style="padding-top: 10rpx;">
<view class="tit u-m-b-40">补充说明</view> <view class="tit u-m-b-20">补充说明</view>
<u-input class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input> <u-input v-model="formData.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
</view> </view>
</view> </view>
<view class="u-m-60"> <view class="bottm-btn-view">
<button class="btn">确定</button> <button :loading="submiting" :disabled="disabledSubmit" class="btn" @click="handleClickSubmit">确定</button>
</view> </view>
<PopView title="拒单提示" message="确定“拒单”操作,将影响对您的派单频率,\n甚至进入黑名单,请谨慎操作"
:visible.sync="visibale" :count="count" @click="handleClick" buttonText="确定"/>
</view> </view>
</template> </template>
<script> <script>
import PopView from "@/components/popView/index.vue"
export default { export default {
data() { data() {
return { return {
visibale: false,
orderId: '',
submiting: false,
background: { background: {
backgroundColor: 'none', backgroundColor: 'none',
}, },
refuse:{ refuse:{
title:'问题归属', title:'拒单原因',
list:['时间不匹配', '技术不匹配', '价格过低', '距离太远', '其他'], list:['时间不匹配', '技术不匹配', '价格过低', '距离太远', '其他'],
}, },
formData: {
rejectReason: '',
remark: ''
},
count: 0, // 剩余次数
}; };
}, },
components:{}, computed: {
disabledSubmit() {
return !this.formData.rejectReason
}
},
components:{
PopView
},
onLoad(e) {
this.orderId = 111
if(e && e.orderId) {
this.orderId = e.orderId
}
},
methods: { methods: {
changeReason(reason) {
this.formData.rejectReason = reason
},
handleClickSubmit() {
if (this.count > 0) {
this.visibale = true
} else {
let message = '本月无拒单机会,请联系客服'
uni.showToast({
icon: 'none',
title: message,
})
}
},
handleClick() {
this.visibale = false
this.submitForm()
},
async submitForm() {
let self = this
self.submiting = true
let res = await self.$u.api.rejectOrder(self.formData, self.orderId)
self.submiting = false
if(res && res.code == 200) {
let data = res.data
if(data.code == 200) {
uni.showToast({
title: "拒单成功",
})
} else {
let message = '本月无拒单机会,请联系客服'
uni.showToast({
icon: 'none',
title: message,
})
}
}
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.bg { .bg {
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
background-color: #F4F5F7; background-color: #F4F5F7;
background-image: linear-gradient(to top, #F4F5F7 0%, #2272FF 100%); background-image: linear-gradient(to top, #F4F5F7 0%, #2272FF 50%);
background-size: 750rpx 600rpx; background-size: 750rpx 600rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
...@@ -63,9 +130,10 @@ ...@@ -63,9 +130,10 @@
border-radius: 12rpx; border-radius: 12rpx;
padding-bottom: 60rpx; padding-bottom: 60rpx;
background-color: #fff; background-color: #fff;
min-height: 800rpx;
} }
.con-box{ .con-box{
padding:30rpx 30rpx 30rpx 20rpx; padding: 30rpx;
// border-radius: 12rpx; // border-radius: 12rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
.tit{ .tit{
...@@ -79,10 +147,11 @@ ...@@ -79,10 +147,11 @@
margin-right:-20rpx; margin-right:-20rpx;
.txt-item{ .txt-item{
border-radius: 12rpx; border-radius: 12rpx;
padding:24rpx 38rpx; padding-top:24rpx;
min-width: 196rpx; padding-bottom: 24rpx;
width: 196rpx;
text-align: center; text-align: center;
margin-right: 20rpx; margin-right: 22rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #F4F5F7; background-color: #F4F5F7;
&.active{ &.active{
...@@ -99,6 +168,11 @@ ...@@ -99,6 +168,11 @@
line-height: 26rpx; line-height: 26rpx;
color: #333; color: #333;
} }
.label{
font-size:24rpx;
line-height: 40rpx;
color:#FA5A49
}
.textarea{ .textarea{
/deep/ .u-input{ /deep/ .u-input{
...@@ -121,8 +195,13 @@ ...@@ -121,8 +195,13 @@
&::after{ &::after{
content:''; content:'';
height:0; height:0;
border: none;
} }
} }
button[disabled]:not([type]) {
background: #D1D4D4;
color: #FFFFFF;
}
.width-320{ .width-320{
width:320rpx; width:320rpx;
} }
...@@ -139,4 +218,10 @@ ...@@ -139,4 +218,10 @@
margin-right: 10rpx; margin-right: 10rpx;
color:#FA5A49 color:#FA5A49
} }
.bottm-btn-view {
width: 100%;
padding: 0 80rpx;
position: absolute;
bottom: 40rpx;
}
</style> </style>
<template> <template>
<view class="container u-row-between" v-if="info"> <view class="container u-row-between" v-if="info">
<Settle :index="pageIndex"> <Settle :index="pageIndex" :type="1">
<view class="content-view"> <view class="content-view">
<!-- <view style="min-height: 120rpx;" v-if="status == 8"></view> --> <!-- <view style="min-height: 120rpx;" v-if="status == 8"></view> -->
<view class="u-flex u-row-center"> <view class="u-flex u-row-center">
......
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