Commit 6bcdfaea authored by Damon's avatar Damon
parents 8643bae6 acbc8e28
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.16.0",
"appid": "wx402a711597dddbaf",
"projectname": "miniprogram-1",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}
<!-- 完工校验弹窗 --> <!-- 完工校验弹窗 -->
<template> <template>
<view class="check-wrap"> <view>
<u-modal <u-popup
v-model="show" v-model="open"
:mask-close-able="false"
border-radius="12" border-radius="12"
width="690" ref="checkPopup"
:cancel-style="{ mode="center"
'margin': '36rpx 15rpx 52rpx 30rpx', width="690rpx">
'height': '104rpx',
'border-radius': '52rpx',
'border': '2px solid #2272FF',
'font-size': '32rpx',
'font-weight': '600',
'color': '#2272FF',
}"
:confirm-style="{
'margin': '36rpx 30rpx 52rpx 15rpx',
'height': '104rpx',
'border-radius': '52rpx',
'background': '#2272FF',
'font-size': '32rpx',
'font-weight': '600',
'color': '#FFFFFF',
}"
:confirm-text="confirmText"
@cancel="cancel"
@confirm="confirm" ref="checkModel"
:show-cancel-button="true"
:show-title="false">
<view class="slot-content"> <view class="slot-content">
<view class="check-status"> <view class="check-status">
<u-image width="224rpx" height="224rpx" :src="statusImage"></u-image> <u-image width="224rpx" height="224rpx" :src="statusImage"></u-image>
...@@ -35,13 +15,13 @@ ...@@ -35,13 +15,13 @@
</view> </view>
<view class="check-list"> <view class="check-list">
<view class="u-flex u-row-between list-title"> <view class="u-flex u-row-between list-title">
<view>验证项</view> <view class="left-txt">验证项</view>
<view>已提交/需提交</view> <view>已提交/需提交</view>
<view>结果</view> <view class="right-txt">结果</view>
</view> </view>
<view class="u-flex u-row-between list-item" <view class="u-flex u-row-between list-item"
v-for="(item, index) in listData" :key="index"> v-for="(item, index) in listData" :key="index">
<view class="item-txt"> <view class="item-txt left-txt" style="width: 160rpx;text-align: left;">
<u-icon <u-icon
:name="item.pass ? passIcon : noPassIcon" :name="item.pass ? passIcon : noPassIcon"
:label="item.label" :label="item.label"
...@@ -51,23 +31,40 @@ ...@@ -51,23 +31,40 @@
size="32"></u-icon> size="32"></u-icon>
</view> </view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view> <view class="item-txt">{{item.submitted}}/{{item.required}}</view>
<view :class="['item-txt', item.pass ? 'pass-color' : 'no-pass-color']"> <view
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style="width: 160rpx;text-align: right;">
{{item.pass ? "通过" : "未通过"}} {{item.pass ? "通过" : "未通过"}}
</view> </view>
</view> </view>
</view> </view>
<view class="check-bottom">
<view class="button cancel" v-show="!pass" @tap="cancel">取消</view>
<view class="button confirm" @tap="confirm">{{confirmText}}</view>
</view> </view>
</u-modal> </view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
/**
* modal 完工校验模态框
* @description 完工校验模态框,用于完工信息检查和提醒
* @property {Boolean} show 是否显示模态框
* @property {Boolean} pass 是否通过校验
* @property {Array} listData 完工信息项
* @event {Function} close 取消按钮被点击
* @event {Function} handle 去处理按钮被点击
* @event {Function} confirm 确认按钮被点击
* @example <u-modal :src="title" :content="content"></u-modal>
*/
export default { export default {
name:"complete-check", name:"complete-check",
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: true default: false
}, },
pass: { pass: {
type: Boolean, type: Boolean,
...@@ -86,8 +83,16 @@ ...@@ -86,8 +83,16 @@
}, },
data() { data() {
return { return {
open: this.show
}; };
}, },
watch: {
// 如果是异步关闭时,外部修改v-model的值为false时,重置内部的loading状态
// 避免下次打开的时候,状态混乱
show(n) {
this.open = n
}
},
computed: { computed: {
statusImage() { statusImage() {
if(this.pass) { if(this.pass) {
...@@ -111,14 +116,12 @@ ...@@ -111,14 +116,12 @@
}, },
confirm() { confirm() {
if(this.pass) { if(this.pass) {
uni.navigateTo({ this.$emit('confirm')
url: "pages/order/index"
})
} else { } else {
let data = this.listData.find((item, index) => { let data = this.listData.find((item, index) => {
return item.pass == false; return item.pass == false;
}) })
this.$emit('handle-problem', data) this.$emit('handle', data)
} }
} }
...@@ -158,6 +161,30 @@ ...@@ -158,6 +161,30 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
} }
.check-bottom {
display: flex;
justify-content: center;
align-items: center;
.button {
text-align: center;
height: 104rpx;
width: 300rpx;
border-radius: 52rpx;
font-size: 32rpx;
font-weight: 600;
line-height: 104rpx;
}
.cancel {
margin: 36rpx 15rpx 52rpx 30rpx;
border: 2px solid #2272FF;
color: #2272FF;
}
.confirm {
margin: 36rpx 30rpx 52rpx 15rpx;
background: #2272FF;
color: #FFFFFF;
}
}
} }
.item-txt { .item-txt {
height: 32rpx; height: 32rpx;
...@@ -166,15 +193,18 @@ ...@@ -166,15 +193,18 @@
color: #333333; color: #333333;
line-height: 32rpx; line-height: 32rpx;
} }
.left-txt {
width: 160rpx;
text-align: left;
}
.right-txt {
width: 160rpx;
text-align: right;
}
.pass-color { .pass-color {
color: #2272FF !important; color: #2272FF !important;
} }
.no-pass-color { .no-pass-color {
color: #FA5A49 !important;; color: #FA5A49 !important;;
} }
.u-border-top {
position: unset;
}
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<view> <view>
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle" <u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"/> :custom-style="customStyle" :clearable="false" :border="border"/>
</view> </view>
</template> </template>
...@@ -38,12 +38,23 @@ ...@@ -38,12 +38,23 @@
}, },
customStyle() { customStyle() {
return { return {
'background-color': '#F4F5F7', 'background-color': this.backgroundColor,
'border-radius': '12rpx', 'border-radius': '12rpx',
'color': '#333333', 'color': '#333333',
'padding-left': '20rpx', 'padding-left': this.textarea ? '0rpx' : '20rpx',
'width': this.width 'width': this.width,
'font-size':'26rpx',
'height': '76rpx'
} }
},
border() {
return this.textarea
},
textarea() {
return this.type == 'textarea'
},
backgroundColor() {
return this.textarea ? '#FFFFFF' : '#F4F5F7'
} }
}, },
watch: {}, watch: {},
......
<!-- ******************* 单个下拉选择 ******************* --> <!-- ******************* 单个下拉选择 ******************* -->
<template> <template>
<view> <view class="xh-select">
<u-input :value="text" readOnly @click="show=true" type="select" /> <u-input :value="text" readOnly @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
<u-action-sheet :list="settings" v-model="show" @click="actionSheetCallback"></u-action-sheet> :custom-style="customStyle" :clearable="false"></u-input>
<u-action-sheet :list="settings" v-model="show" @click="actionSheetCallback" safe-area-inset-bottom></u-action-sheet>
<u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
</template> </template>
...@@ -12,7 +15,16 @@ ...@@ -12,7 +15,16 @@
name: 'XhSelect', name: 'XhSelect',
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: {}, props: {
placeholder: {
type: String,
default: '请选择'
},
width: { // 例如:454rpx
type: String,
default: '100%'
}
},
data() { data() {
return { return {
show: false show: false
...@@ -32,7 +44,9 @@ ...@@ -32,7 +44,9 @@
result = settings.map(item => { result = settings.map(item => {
return { return {
text: item.label, text: item.label,
id: item.key id: item.key,
color: '#333333',
fontSize: 26
} }
}) })
return result return result
...@@ -40,6 +54,21 @@ ...@@ -40,6 +54,21 @@
text(){ text(){
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue}) let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue})
return option?option.label:'' return option?option.label:''
},
placeholderStyle() {
return 'color:#999999;font-size:26rpx'
},
customStyle() {
return {
'background-color': '#F4F5F7',
'border-radius': '12rpx',
'color': '#333333',
'padding-left': '20rpx',
'padding-right': '60rpx',
'width': this.width,
'font-size':'26rpx',
'height': '76rpx'
}
} }
}, },
watch: {}, watch: {},
...@@ -54,5 +83,15 @@ ...@@ -54,5 +83,15 @@
} }
</script> </script>
<style> <style lang="scss" scoped>
.xh-select {
position: relative;
.input-icon {
position: absolute;
right: 20rpx;
top: 26rpx;
color: #2272FF;
}
}
</style> </style>
...@@ -162,7 +162,6 @@ ...@@ -162,7 +162,6 @@
} }
}, },
fail(e) { fail(e) {
debugger
} }
}) })
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<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="currency-class" :style="{'background-image':'url(/static/photo/jianbian@3x.png)'}"> <view class="currency-class" :style="{'background-image':'url(/static/photo/jianbian@3x.png)'}">
<view class="class1" @click=ccc(courselist[0].id)> <view class="class1" @click="goToPrint">
<image class="img" :src="rule.pic" mode=""></image> <image class="img" :src="rule.pic" mode=""></image>
<view class="right u-margin-left-30 u-padding-top-10 u-padding-bottom-14 width-360"> <view class="right u-margin-left-30 u-padding-top-10 u-padding-bottom-14 width-360">
<view class="u-font-32 font-bold"> <view class="u-font-32 font-bold">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<view class="top"> <view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view> <view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="currency-class"> <view class="currency-class">
<view class="class1" @click=ccc(courselist[0].id)> <view class="class1" @click=ccc(courselist[0].sectionId)>
<image class="img" :src="courselist[0].pic" mode=""></image> <image class="img" :src="courselist[0].pic" mode=""></image>
<view class="right"> <view class="right">
<view class="u-font-32 font-bold"> <view class="u-font-32 font-bold">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="class1 u-margin-top-40" @click=ccc(courselist[1].id)> <view class="class1 u-margin-top-40" @click=ccc(courselist[1].sectionId)>
<image class="img" :src="courselist[1].pic" mode=""></image> <image class="img" :src="courselist[1].pic" mode=""></image>
<view class="right"> <view class="right">
<view class="u-font-32 font-bold"> <view class="u-font-32 font-bold">
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</view> </view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view> <view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view>
<view class="currency-class"> <view class="currency-class">
<view class="class1" @click=ccc(courselist[2].id)> <view class="class1" @click=ccc(courselist[2].sectionId)>
<image class="img" :src="courselist[2].pic" mode=""></image> <image class="img" :src="courselist[2].pic" mode=""></image>
<view class="right"> <view class="right">
<view class="u-font-32 font-bold"> <view class="u-font-32 font-bold">
...@@ -221,7 +221,8 @@ ...@@ -221,7 +221,8 @@
percent: 0, percent: 0,
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 173 id: 173,
sectionId: ''
}, },
{ {
title: '接单操作', title: '接单操作',
...@@ -229,7 +230,8 @@ ...@@ -229,7 +230,8 @@
percent: 0, percent: 0,
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 173 id: 173,
sectionId: ''
}, },
{ {
title: '从0-1学习充电桩安装服务', title: '从0-1学习充电桩安装服务',
...@@ -237,7 +239,8 @@ ...@@ -237,7 +239,8 @@
percent: 0, percent: 0,
status: '', status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png", pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
id: 173 id: 173,
sectionId: ''
} }
], ],
examList: [{ examList: [{
...@@ -356,6 +359,7 @@ ...@@ -356,6 +359,7 @@
res.data.learnedInfo.learnPercent *= 100; res.data.learnedInfo.learnPercent *= 100;
this.courselist[i].status = this.getTypeName(res.data.learnedInfo.learnPercent); this.courselist[i].status = this.getTypeName(res.data.learnedInfo.learnPercent);
this.courselist[i].percent = res.data.learnedInfo.learnPercent; this.courselist[i].percent = res.data.learnedInfo.learnPercent;
this.courselist[i].sectionId = res.data.learnedInfo.nextLearnedSectionId;
} }
} }
}) })
...@@ -418,7 +422,7 @@ ...@@ -418,7 +422,7 @@
//跳转到课程介绍 //跳转到课程介绍
ccc(id) { ccc(id) {
uni.navigateTo({ uni.navigateTo({
url: "./curriculum?course_id=" + id, url: "./section?section_id=" + 288,
}); });
}, },
//跳转到 //跳转到
......
...@@ -8,22 +8,34 @@ ...@@ -8,22 +8,34 @@
<view class="item-content"> <view class="item-content">
<view class="item-st"> <view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image> <image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{ courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" }}</text> <text class="item-st-text">5课时</text>
</view> </view>
<view class="item-title">{{ courseTitle.split(" ") ? courseTitle.split(" ")[1] : "" }}</view> <view class="item-title">服务规范</view>
</view> </view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view> <view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
</view> </view>
<view class="learn-view" v-if="courseId >= 0"> <view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view> <view class="learn-view-title">课程讲师</view>
<!-- <view <view class="" style="padding-top: 30rpx;display: flex;padding-left: 30rpx;">
class="learn-list" <u-avatar :style="{'width':'100rpx', 'height':'100rpx'}" :src="teacher.avatar" mode="circle"></u-avatar>
v-for="(item, key) in courseOutlines[courseId]" <view style="height:120rpx;font-size: 30rpx;padding-left:30rpx;">
:key="key" <view class="" style="display: flex;font-size: 32rpx;">
> --> <view class="" style="font-size: 32rpx;font-weight: bold;">{{ teacher.name }}</view>
<!-- <view class="learn-list-item">{{ item }}</view> --> <view class="" style="font-size: 24rpx;margin-left: 30rpx;margin-top: 6rpx;">课程讲师</view>
<view class="u-content"> </view>
<u-parse :html="CourseSectionlist.content"></u-parse> <view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view>
</view>
</view>
<view class="learn-view-title">目录</view>
<view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;">
<view v-for="(item, index) in list" :key="index">
<view @click="goNext(item.id)" class="list-cell list-default" :class="{'list-default-active': item.isActive}" style="width:280rpx;height:150rpx;margin-left: 20rpx;padding: 20rpx;border-radius: 12rpx;">
<view class="" style="font-size: 24rpx;">{{ item.title }}</view>
<view class="" style="font-size: 26rpx;margin-top: 16rpx;">
{{ item.intro }}
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -53,6 +65,17 @@ ...@@ -53,6 +65,17 @@
section_id: 0, section_id: 0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {name: '', content: ''}, //节信息 CourseSectionlist: {name: '', content: ''}, //节信息
list: [
{'title': '第一节', 'intro': '考核规则1:接单及 时率', 'isActive': true},
{'title': '第二节', 'intro': '考核规则1:接单及 时率', 'isActive': false},
{'title': '第三节', 'intro': '考核规则1:接单及 时率', 'isActive': false},
{'title': '第四节', 'intro': '考核规则1:接单及 时率', 'isActive': false},
{'title': '第五节', 'intro': '考核规则1:接单及 时率', 'isActive':false},
],
teacher: {
name: "",
avatar: ""
},
playerOptions: { playerOptions: {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度 playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: true, //如果true,浏览器准备好时开始回放。 autoplay: true, //如果true,浏览器准备好时开始回放。
...@@ -118,6 +141,11 @@ ...@@ -118,6 +141,11 @@
// #endif // #endif
}, },
methods: { methods: {
goNext(id){
uni.navigateTo({
url: "./section?section_id=" + id,
});
},
onPlayerTimeupdate(player) { onPlayerTimeupdate(player) {
console.log('-----onplay----'); console.log('-----onplay----');
console.log(player); console.log(player);
...@@ -165,6 +193,8 @@ ...@@ -165,6 +193,8 @@
this.courseDesc = res.data.content; this.courseDesc = res.data.content;
this.section_id = res.data.id; this.section_id = res.data.id;
this.section_content = res.data.content; this.section_content = res.data.content;
this.teacher.name = res.data.teachers[0].name;
this.teacher.avatar = res.data.teachers[0].avatar;
if (this.isShowVideo) { if (this.isShowVideo) {
let coureWareList = res.data.courseware; let coureWareList = res.data.courseware;
this.courseSrc = coureWareList[0].src; this.courseSrc = coureWareList[0].src;
...@@ -195,7 +225,7 @@ ...@@ -195,7 +225,7 @@
status: 1, status: 1,
}; };
this.$u.api.updateLearnCourses(param).then((res) => { this.$u.api.updateLearnCourses(param).then((res) => {
console.log('--' + this.howTimeToUpdateLearnedStatus + '更新一次观看状态--time:' + nowTime); // console.log('--' + this.howTimeToUpdateLearnedStatus + '更新一次观看状态--time:' + nowTime);
}).catch((err) => { }).catch((err) => {
console.log('--------updateLearnedStatusForText---------'); console.log('--------updateLearnedStatusForText---------');
console.log(err); console.log(err);
...@@ -326,8 +356,8 @@ ...@@ -326,8 +356,8 @@
.learn-view { .learn-view {
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx; // padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx; // margin-bottom: 20rpx;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
...@@ -335,6 +365,8 @@ ...@@ -335,6 +365,8 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
margin-bottom: 10rpx; margin-bottom: 10rpx;
padding-top: 30rpx;
margin-left: 30rpx;
} }
.learn-list { .learn-list {
...@@ -358,4 +390,18 @@ ...@@ -358,4 +390,18 @@
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.list-default {
background-color: #F4F5F7;
border-radius: 12rpx;
color: #333333;
}
.list-default-active {
background-color: #ffffff;
border-radius: 12rpx;
color: #2272FF;
border: 2rpx solid #2272FF;
box-sizing: border-box;
}
</style> </style>
<template> <template>
<view class="com-content"> <view class="com-content">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check>
<view class="u-wrap" v-if="!takeStatus"> <view class="u-wrap" v-if="!takeStatus">
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="26" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="26" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar>
<u-tabs-swiper ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper> <u-tabs-swiper ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper>
...@@ -161,7 +162,12 @@ ...@@ -161,7 +162,12 @@
submitBtnStatus: false, submitBtnStatus: false,
takeStatus: false, takeStatus: false,
fileIndex: null, fileIndex: null,
files: [] files: [],
completeCheckStatus: false,
completeCheckResult: [],
waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0,
} }
}, },
components: { components: {
...@@ -286,16 +292,78 @@ ...@@ -286,16 +292,78 @@
} }
}) })
}, },
checkCompleteItem(){
let self = this
let checkResult = []
let pass = true
let first = true
self.list.forEach((panel, panelIndex)=>{
let panelResult = {label: panel.panelName, submitted: 0, required: 0, pass: true}
panel.items.forEach((group, groupIndex) =>{
group.items.forEach((ele, eleIndex)=>{
if(ele.required){
panelResult.required++
let value = self.form[ele.fieldsName]
if(value&&!Array.isArray(value)){
panelResult.submitted++
}else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
first = false
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
}
}
})
})
panelResult.pass = panelResult.required <= panelResult.submitted
pass = pass&&panelResult.pass
checkResult.push(panelResult)
})
console.log(checkResult)
self.completeCheckResult = checkResult
return pass
},
confirm(){// 检查结果窗口 确认回调
uni.navigateTo({
url: 'pages/order/index'
})
},
closeCheckResult(){// 检查结果窗口取消回调
this.completeCheckStatus = false
},
handerProgrom(){// 检查结果窗口 去处理回调 定位到缺失的项
this.completeCheckStatus = false
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
this.swichMenu(groupIndex)
})
},
orderFinish(){ orderFinish(){
let self = this let self = this
let pass = this.checkCompleteItem()
if(!pass){
self.completeCheckStatus = true
}else{
console.log("完工");
if(self.inGuaranteePeriod === 'Y'){ if(self.inGuaranteePeriod === 'Y'){
self.$u.api.inOrderFinish(self.orderId).then((res)=>{ self.$u.api.inOrderFinish(self.orderId).then((res)=>{
console.log(res) console.log(res)
self.completeCheckStatus = true
}) })
}else{ }else{
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{ self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{
console.log(res) console.log(res)
self.completeCheckStatus = true
}) })
}
} }
}, },
getTakeStatus(event) { getTakeStatus(event) {
......
...@@ -160,8 +160,6 @@ export default { ...@@ -160,8 +160,6 @@ export default {
} }
}, },
async onLoad(e) { async onLoad(e) {
this.orderId = 1;
this.categoryId = 88;
if (e) { if (e) {
this.orderId = e.orderId || null; this.orderId = e.orderId || null;
this.categoryId = e.categoryId || null; this.categoryId = e.categoryId || null;
...@@ -327,7 +325,6 @@ export default { ...@@ -327,7 +325,6 @@ export default {
}, },
async submitForm() { async submitForm() {
let self = this; let self = this;
self.orderId = 666;
if (!self.orderId) { if (!self.orderId) {
uni.showToast({ uni.showToast({
icon: error, icon: error,
......
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