Commit c701448c authored by Facius's avatar Facius
parents 2547ffbd 36601a7b
...@@ -18,19 +18,24 @@ ...@@ -18,19 +18,24 @@
// 服务规范教程视频 // 服务规范教程视频
service_standard: { service_standard: {
"Course1": { "Course1": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4", url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第一节 接单服务标准", title: "第一节 师傅考核规则",
desc: "1.不同车企品牌结算价格不一,675元-1890元不等;", desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
}, },
"Course2": { "Course2": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4", url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第二节 完工服务标准", title: "第二节 安装材料及工具",
desc: "2.结算价格为包工包料价,安装材料根据车企品牌规格自行采购(电缆、空开、漏保);", desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
}, },
"Course3": { "Course3": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4", url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第二节 结算服务标准", title: "第二节 安装施工规范",
desc: "3.需具备一定的作业工具:如液压压线钳、冲击钻、电锤、登高安全带、电锤、绝缘电阻仪(摇表)、交流充电模拟器等;", desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
},
"Course4": {
url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第二节 录单上传要求",
desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
}, },
}, },
...@@ -46,10 +51,12 @@ ...@@ -46,10 +51,12 @@
that.globalData.token = util.getToken() that.globalData.token = util.getToken()
AnalysysAgent.registerSuperProperty("platform", "self-support"); AnalysysAgent.registerSuperProperty("platform", "self-support");
// 应用启动,或从后台进入前台显示
this.autoLogin()
}, },
onShow: function() { onShow: function() {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
this.autoLogin() // this.autoLogin()
}, },
onHide: function() { onHide: function() {
// 应用从前台进入后台 // 应用从前台进入后台
...@@ -73,7 +80,9 @@ ...@@ -73,7 +80,9 @@
if (!res.data) { if (!res.data) {
return return
} }
callBack(vm, res.data) if(typeof callBack == 'function') {
callBack(vm, res.data)
}
uni.hideLoading() uni.hideLoading()
return res.data return res.data
...@@ -95,6 +104,7 @@ ...@@ -95,6 +104,7 @@
if (result) { if (result) {
if (result.code == 200 && result.data) { if (result.code == 200 && result.data) {
that.setUserData(result.data) that.setUserData(result.data)
that.getBaseInfo(that)
} }
} else { } else {
uni.showModal({ uni.showModal({
......
...@@ -8,16 +8,19 @@ import { ...@@ -8,16 +8,19 @@ import {
settledApiFun settledApiFun
} from '@/common/api/settled.js'; } from '@/common/api/settled.js';
import { learnApiFun } from "@/common/api/learn.js"; import { learnApiFun } from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js";
let apiFun = function(vm) { let apiFun = function(vm) {
let commonApi = commonApiFun(vm); let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm) let settledApi = settledApiFun(vm)
let cloudApi = cloudRulesApiFun(vm) let cloudApi = cloudRulesApiFun(vm)
let learnApi=learnApiFun(vm) let learnApi=learnApiFun(vm)
let orderApi=orderApiFun(vm)
let apiUrl = { let apiUrl = {
...commonApi, ...commonApi,
...settledApi, ...settledApi,
...cloudApi, ...cloudApi,
...learnApi ...learnApi,
...orderApi,
} }
return apiUrl return apiUrl
} }
......
let orderApiFun = function(vm){
let listByRecommendOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/recommend/order', params);
const orderApi = {
listByRecommendOrder,
}
return orderApi
}
module.exports = {
orderApiFun
}
\ No newline at end of file
...@@ -36,7 +36,10 @@ let settledApiFun = function(vm){ ...@@ -36,7 +36,10 @@ let settledApiFun = function(vm){
let listOrderingTutorials = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/get-course-rate', params); let listOrderingTutorials = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/get-course-rate', params);
/* 更新接单教程状态 */ /* 更新接单教程状态 */
let saveCourseRate = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/save-course-rate', params); let saveCourseRate = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/save-course-rate', params);
/* 获取消息内容列表 */
let listByNotice = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/list', params);
const settledApi = { const settledApi = {
getSettleBaseInfo, getSettleBaseInfo,
...@@ -52,6 +55,7 @@ let settledApiFun = function(vm){ ...@@ -52,6 +55,7 @@ let settledApiFun = function(vm){
checkSettleSignInfo, checkSettleSignInfo,
listOrderingTutorials, listOrderingTutorials,
saveCourseRate, saveCourseRate,
listByNotice,
} }
return settledApi return settledApi
} }
......
...@@ -254,11 +254,6 @@ ...@@ -254,11 +254,6 @@
"path": "pages/settle/sign-contract", //启动页面,必选 "path": "pages/settle/sign-contract", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{
"name": "订单列表", //模式名称
"path": "pages/order/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{ {
"name": "订单 - 完工配置", //模式名称 "name": "订单 - 完工配置", //模式名称
"path": "pages/order/complete", //启动页面,必选 "path": "pages/order/complete", //启动页面,必选
......
<template> <template>
<view class="content"> <view class="content">
<!-- <scroll-view class="scroll-view" scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom" <!-- <scroll-view class="scroll-view" scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom"
@scroll="handleScroll" refresher-enabled :refresher-triggered="triggered" @refresherrefresh="onRefresh" @scroll="handleScroll" refresher-enabled :refresher-triggered="triggered" @refresherrefresh="onRefresh"
scroll-anchoring @refresherrestore="onRestore" @refresherpulling="triggered = true" :show-scrollbar="false" scroll-anchoring @refresherrestore="onRestore" @refresherpulling="triggered = true" :show-scrollbar="false"
enable-back-to-top> --> enable-back-to-top> -->
<view style="width: 700rpx; height: 800rpx;"> <view style="width: 700rpx; height: 800rpx">
<!-- <view class="title-view">充电桩自营平台</view> --> <!-- <view class="title-view">充电桩自营平台</view> -->
<u-navbar :is-back="false" background="{background: transparent}" :border-bottom="false" <u-navbar
:is-fixed="false"> :is-back="false"
<text class="title-view">充电桩自营平台</text> background="{background: transparent}"
</u-navbar> :border-bottom="false"
<u-swiper :height="240" :list="list" :indicator-pos="indicatorPos" :mode="mode" :interval="3000" :is-fixed="false"
@click="clickSwiper"> >
</u-swiper> <text class="title-view">充电桩自营平台</text>
<view class="msg-view"> </u-navbar>
<view class="msg-title">最新消息</view> <u-swiper
<view class="msg-list-view"> :height="240"
<view class="msg-content" v-for="(item, index) in messageList" :key="index"> :list="list"
<view class="msg-content-view"> :indicator-pos="indicatorPos"
<view class="left-view"> :mode="mode"
<image class="msg-icon"></image> :interval="3000"
<text>{{item.body}}</text> @click="clickSwiper"
</view> >
<image class="right-icon"></image> </u-swiper>
</view> <view class="msg-view">
<view class="line-view" v-if="messageList.length > index + 1"></view> <view class="msg-title">最新消息</view>
</view> <view class="msg-list-view">
</view> <view
</view> class="msg-content"
<!-- 订单推荐吸顶 --> v-for="(item, index) in messageList"
<u-sticky> :key="index"
<view class="sticky"> >
<text>订单推荐</text> <view class="msg-content-view">
</view> <view class="left-view">
</u-sticky> <image class="msg-icon"></image>
<view class="order-view"> <text>{{ item.body }}</text>
</view>
<!-- 入驻成功之后显示推荐订单列表 --> <image class="right-icon"></image>
<view class="order-list-view"> </view>
<view v-if="status == 7 && orderList.length > 0" class="order-item-view"> <view
<view v-for="(item, index) in orderList" :key="index"> class="line-view"
<OrderCell :orderData="item"> </OrderCell> v-if="messageList.length > index + 1"
</view> ></view>
<u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore> </view>
</view> </view>
<!-- 入驻成功之后无推荐订单 --> </view>
<view v-else-if="status == 7 && orderList.length <= 0" class="no-order-view"> <!-- 订单推荐吸顶 -->
暂无订单 <u-sticky>
</view> <view class="sticky">
<!-- 入驻前--> <text>订单推荐</text>
<view v-else-if="loaded" class="tip-view"> </view>
<view class="tip-title">当前订单(笔)</view> </u-sticky>
<view class="tip-count">{{ count }}</view> <view class="order-view">
<view class="tip-other">入驻通过后平台将向您推荐订单</view> <!-- 入驻成功之后显示推荐订单列表 -->
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn" <view class="order-list-view">
:custom-style="buttonStyle"> <!-- 入驻前-->
立即入驻 <view v-if="needSettled" class="tip-view">
</u-button> <view class="tip-title">当前订单(笔)</view>
</view> <view class="tip-count">{{ count }}</view>
</view> <view class="tip-other">入驻通过后平台将向您推荐订单</view>
</view> <u-button
</view> class="settle-button"
<!-- </scroll-view> --> type="primary"
</view> shape="circle"
@click="immediatelyIn"
:custom-style="buttonStyle"
>
立即入驻
</u-button>
</view>
<view
v-else-if="!needSettled && orderList.length > 0"
class="order-item-view"
>
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item"> </OrderCell>
</view>
<u-loadmore
:status="currentLoadStatus"
bgColor="#f2f2f2"
></u-loadmore>
</view>
<!-- 入驻成功之后无推荐订单 -->
<view
v-else-if="!needSettled && orderList.length <= 0"
class="no-order-view"
>
暂无订单
</view>
</view>
</view>
</view>
<!-- </scroll-view> -->
</view>
</template> </template>
<script> <script>
import util from "@/utils/util.js"; import util from "@/utils/util.js";
const app = getApp(); const app = getApp();
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
export default { export default {
components: { components: {
OrderCell, OrderCell,
}, },
data() { data() {
return { return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
triggered: false, triggered: false,
list: [{ list: [
image: "https://cdn.uviewui.com/uview/swiper/1.jpg", {
}, image: "https://cdn.uviewui.com/uview/swiper/1.jpg",
{ },
image: "https://cdn.uviewui.com/uview/swiper/2.jpg", {
}, image: "https://cdn.uviewui.com/uview/swiper/2.jpg",
{ },
image: "https://cdn.uviewui.com/uview/swiper/3.jpg", {
}, image: "https://cdn.uviewui.com/uview/swiper/3.jpg",
], },
title: false, ],
mode: "round", title: false,
indicatorPos: "bottomCenter", mode: "round",
title: "Hello", indicatorPos: "bottomCenter",
loaded: false, title: "Hello",
count: 0, // 推荐订单数量 loaded: false,
messageList: [{ needSettled: true,
id: 1234, count: 0, // 推荐订单数量
type: "", messageList: [],
level: "", loadStatus: ["more", "loading", "noMore"],
title: "", currentLoadStatus: "loading",
url: "", orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
body: "好消息", search: {
}, token: app.globalData.token || "",
{ pageNumber: 0,
id: 1234, pageSize: 10,
type: "", },
level: "", bottomLoading: false,
title: "", };
url: "", },
body: "好消息", watch: {},
}, computed: {
{ buttonStyle() {
id: 1234, return {
type: "", width: "400rpx",
level: "", height: "104rpx",
title: "", "font-size": "32rpx",
url: "", "font-weight": "bold",
body: "好消息", };
}, },
], msgStyle() {
loadStatus: ["more", "loading", "noMore"], return {
currentLoadStatus: "loading", 1: "", // 置顶
orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}], 2: "", // 通知
bottomLoading: false, 3: "", // 消息
}; };
}, },
computed: { },
buttonStyle() { onLoad() {
return { this._freshing = false;
'width': '400rpx', this.triggered = false;
'height': '104rpx', },
'font-size': '32rpx', onShow() {
'font-weight': 'bold' // 每次进入页面都刷新入驻状态
}; if (app.globalData.token) {
}, // 初始化入驻信息
msgStyle() { this.initSettleInfo();
return { } else {
'1': '', // 置顶 // 初始化订单数据
'2': '', // 通知 this.loadOrderList();
'3': '' // 消息 }
} },
} methods: {
}, async initSettleInfo() {
onLoad() { let self = this;
this._freshing = false; if (self.status == 7) return;
this.triggered = false; const callBack = (vm, result) => {
}, // 后台自动判断入驻流程是否完成,前台通过status确定状态
onShow() { if (result && result.record) {
// 每次进入页面都刷新入驻状态 vm.loaded = true;
if (app.globalData.token) { vm.needSettled = result.needSettled;
// 获取是否显示入驻按钮 vm.status = Number(result.record.status);
this.initSettleInfo(); // vm.status = 8
} }
}, };
methods: { await app.getBaseInfo(self, callBack);
async initSettleInfo() {
if (this.status == 7) return; // 加载消息列表
const callBack = (vm, result) => { self.loadMessageList();
// 后台自动判断入驻流程是否完成,前台通过status确定状态 self.loadOrderList();
if (result && result.record) { },
vm.loaded = true; loadMessageList() {
vm.status = Number(result.record.status); let self = this;
// vm.status = 8 self.$u.api.listByNotice().then((res) => {
} if (res.code == 200) {
}; if (res.data && res.data.length > 3) {
await app.getBaseInfo(this, callBack); self.messageList = res.data.slice(0, 3);
}, } else {
onRefresh() { self.messageList = res.data || [];
if (this._freshing) return; }
this._freshing = true; } else {
console.log(res.message, "初始化消息列表异常");
// 获取入驻状态 }
this.initSettleInfo(); });
// 获取推荐订单及数量 },
// .... loadOrderList() {
let self = this;
setTimeout(() => { // 加载订单列表
// 数据加载完成更新入驻状态和推荐列表 self.search.token = app.globalData.token;
this.triggered = false; self.$u.api.listByRecommendOrder(self.search).then((res) => {
this._freshing = false; if (res.code == 200) {
}, 1000); if (res.data && res.data.length > 0) {
}, self.orderList.push().apply(res.data);
onRestore() { }
this.triggered = "restore"; } else {
}, console.log(res.message, "初始化订单列表异常");
reachBottom() { }
console.log("-----bottom will-----"); });
if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) { },
return; onRefresh() {
} if (this._freshing) return;
console.log("-----bottom did-----"); this._freshing = true;
this.bottomLoading = true; // 获取入驻状态
this.initSettleInfo();
setTimeout(() => { // 获取推荐订单及数量
// 加载更多数据 // ....
// ...
this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]); setTimeout(() => {
// 数据加载完成更新入驻状态和推荐列表
// 加载完成 this.triggered = false;
this.currentLoadStatus = false /*是否还有*/ ? this._freshing = false;
this.loadStatus[1] : }, 1000);
this.loadStatus[2]; },
this.$nextTick(function() { onRestore() {
this.bottomLoading = false; this.triggered = "restore";
}); },
}, 1000); reachBottom() {
}, console.log("-----bottom will-----");
clickSwiper(index) {}, if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) {
handleScroll() { return;
console.log("-----scroll-------"); }
}, console.log("-----bottom did-----");
immediatelyIn() {
if (util.getToken()) { this.bottomLoading = true;
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
var pageIndex = 1 setTimeout(() => {
switch(this.status) { // 加载更多数据
case 1: // ...
case 2: this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]);
case 3:
case 4: // 加载完成
pageIndex = 2 this.currentLoadStatus = false /*是否还有*/
break ? this.loadStatus[1]
case 8: : this.loadStatus[2];
pageIndex = 3 this.$nextTick(function () {
break this.bottomLoading = false;
case 5: });
case 6: }, 1000);
pageIndex = 4 },
break clickSwiper(index) {},
case 7: handleScroll() {
pageIndex = 5 console.log("-----scroll-------");
break },
default: immediatelyIn() {
pageIndex = 1 if (util.getToken()) {
break // 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
} var pageIndex = 1;
switch (this.status) {
uni.navigateTo({ case 1:
url: this.status > 0 ? "/pages/settle/prompt?pageIndex=" + pageIndex : "/pages/settle/index", case 2:
}); case 3:
} else { case 4:
uni.navigateTo({ pageIndex = 2;
url: "pages/login/index", break;
}); case 8:
} pageIndex = 3;
}, break;
}, case 5:
}; case 6:
pageIndex = 4;
break;
case 7:
pageIndex = 5;
break;
default:
pageIndex = 1;
break;
}
uni.navigateTo({
url:
this.status > 0
? "/pages/settle/prompt?pageIndex=" + pageIndex
: "/pages/settle/index",
});
} else {
uni.navigateTo({
url: "pages/login/index",
});
}
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; height: 100vh;
background-color: #F4F5F7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
.scroll-view { .scroll-view {
::-webkit-scrollbar { ::-webkit-scrollbar {
/*隐藏滚轮*/ /*隐藏滚轮*/
display: none; display: none;
} }
} }
.title-view { .title-view {
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
font-size: 40rpx; font-size: 40rpx;
} }
.msg-view { .msg-view {
.msg-title { .msg-title {
color: #333333; color: #333333;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 50rpx 0rpx 30rpx 0rpx; padding: 50rpx 0rpx 30rpx 0rpx;
} }
.msg-list-view { .msg-list-view {
border-radius: 12rpx; border-radius: 12rpx;
background-color: #FFFFFF; background-color: #ffffff;
padding: 6rpx 30rpx; padding: 6rpx 30rpx;
} height: 268rpx;
}
.msg-content {
color: #333333; .msg-content {
font-size: 26rpx; color: #333333;
font-size: 26rpx;
.msg-content-view {
display: flex; .msg-content-view {
align-items: center; display: flex;
justify-content: space-between; align-items: center;
margin-top: 20rpx; justify-content: space-between;
margin-bottom: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex; .left-view {
align-items: center; display: flex;
align-items: center;
.msg-icon {
width: 80rpx; .msg-icon {
height: 36rpx; width: 80rpx;
} height: 36rpx;
} }
}
.right-icon {
width: 14rpx; .right-icon {
height: 24px; width: 14rpx;
} height: 24px;
}
} }
.line-view { .line-view {
height: 2rpx; height: 2rpx;
background-color: #F4F5F7; background-color: #f4f5f7;
} }
} }
}
} }
}
.logo {
.logo { height: 200 rpx;
height: 200 rpx; width: 100%;
width: 100%; margin: 0 rpx auto 50 rpx auto;
margin: 0 rpx auto 50 rpx auto; }
}
.text-area {
.text-area { display: flex;
display: flex; justify-content: center;
justify-content: center; }
}
.title {
.title { font-size: 36 rpx;
font-size: 36 rpx; color: #8f8f94;
color: #8f8f94; }
}
// .sticky-view {
// .sticky-view { // position: sticky;
// position: sticky; // position: -webkit-sticky;
// position: -webkit-sticky; // top: 0rpx;
// top: 0rpx; // width: 100%;
// width: 100%; // height: 200rpx;
// height: 200rpx; // background-color: black;
// background-color: black; // }
// }
.sticky {
.sticky { background-color: #f4f5f7;
background-color: #F4F5F7; color: #fff;
color: #fff; padding: 24 rpx;
padding: 24 rpx; text-align: left;
text-align: left; font-size: 32rpx;
font-size: 32rpx; font-weight: bold;
font-weight: bold; color: #333333;
color: #333333; padding: 46rpx 0 28rpx 0;
padding: 46rpx 0 28rpx 0; }
}
.order-view {
.order-view { text-align: center;
text-align: center;
.order-list-view {
background-color: #ffffff;
.order-list-view { border-radius: 12rpx;
background-color: #FFFFFF; min-height: 460rpx;
border-radius: 12rpx; padding: 30rpx;
min-height: 460rpx; margin-bottom: 30rpx;
padding: 30rpx;
margin-bottom: 30rpx; .order-item-view {
}
.order-item-view {}
.no-order-view {
.no-order-view {} }
.tip-view { .tip-view {
.tip-title {
.tip-title { font-size: 32rpx;
font-size: 32rpx; font-weight: bold;
font-weight: bold; color: #333333;
color: #333333; margin-top: 30rpx;
margin-top: 30rpx; }
}
.tip-count {
.tip-count { color: #2272ff;
color: #2272FF; font-size: 70rpx;
font-size: 70rpx; font-weight: bold;
font-weight: bold; margin-top: 50rpx;
margin-top: 50rpx; margin-bottom: 20rpx;
margin-bottom: 20rpx; }
}
.tip-other {
.tip-other { font-size: 28rpx;
font-size: 28rpx; color: #333333;
color: #333333; margin-bottom: 56rpx;
margin-bottom: 56rpx; }
} }
} }
} }
} </style>
</style>
<template> <template>
<view class="learn-vedio"> <view class="learn-vedio">
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc" <view
@error="videoErrorCallback" controls></video></view> ><video
<view class="title-content"> object-fit="cover"
<view class="item-content"> class="course-video"
<view class="item-st"> id="courseVideo"
<image style="width: 80rpx;height: 36rpx;" :src="kcImage"></image> :src="courseSrc"
<text class="item-st-text">{{courseTitle.split(' ') ? courseTitle.split(' ')[0] : ''}}</text> @error="videoErrorCallback"
</view> controls
<view class="item-title">{{courseTitle.split(' ') ? courseTitle.split(' ')[1] : ''}}</view> ></video
</view> ></view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view> <view class="title-content">
</view> <view class="item-content">
<view class="learn-view" v-if="currentIndex >= 0"> <view class="item-st">
<view class="learn-view-title">视频内容介绍</view> <image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<view class="learn-list" v-for="(item, key) in courseOutlines[currentIndex]" :key="key"> <text class="item-st-text">{{
<view class="learn-list-item">{{item}}</view> courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
</view> }}</text>
</view> </view>
</view> <view class="item-title">{{
</view> 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"
v-for="(item, key) in courseOutlines[courseId]"
:key="key"
>
<view class="learn-list-item">{{ item }}</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, // 第几个视频
}; };
}, },
computed: { computed: {
courseOutlines() { // 视频内容介绍 courseOutlines() {
return [[ // 视频内容介绍
'1、考核规则:接单及时率', return {
'2、考核规则:上门及时率', 1: [
'3、考核规则:安装完工率', "1、考核规则:接单及时率",
'4、考核规则:资料提交及时率', "2、考核规则:上门及时率",
'5、考核规则:安装完工率', "3、考核规则:安装完工率",
'6、考核规则:客户满意度' "4、考核规则:资料提交及时率",
], "5、考核规则:安装完工率",
[ "6、考核规则:客户满意度",
'1、必备材料4大类', ],
'2、施工工具准备' 2: ["1、必备材料4大类", "2、施工工具准备"],
], 3: [
[ "1、接线安装工艺标准",
'1、接线安装工艺标准', "2、PVC、镀锌管电缆管明敷",
'2、PVC、镀锌管电缆管明敷', "3、电缆敷设的防火要求",
'3、电缆敷设的防火要求', "4、电源点标识",
'4、电源点标识', "5、配电箱接线及安装",
'5、配电箱接线及安装', "6、管线敷设接头处理",
'6、管线敷设接头处理', "7、充电桩内部接线",
'7、充电桩内部接线', "8、配电箱安装",
'8、配电箱安装' ],
], 4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
[ };
'1、勘测环节录单要求', },
'2、安装环节录单要求' kcImage() {
]] return qn_base_url + "kc.png";
}, },
kcImage() { },
return qn_base_url + 'kc.png' onLoad(e) {
} if (e) {
}, if (e.courseId) {
onLoad(e) { this.courseId = e.courseId;
if (e) { }
if (e.courseId) { if (e.id) {
this.courseId = e.courseId; this.courseId = e.courseId;
} this.courseSrc = app.globalData.service_standard[e.id].url;
if (e.id) { this.courseTitle = app.globalData.service_standard[e.id].title;
this.courseId = e.courseId; this.courseDesc = app.globalData.service_standard[e.id].desc;
this.courseSrc = app.globalData.service_standard[e.id].url; this.changeCourseStatus();
this.courseTitle = app.globalData.service_standard[e.id].title; }
this.courseDesc = app.globalData.service_standard[e.id].desc;
this.changeCourseStatus(); if (e.status) {
} this.courseStatus = e.status;
}
if (e.status) { }
this.courseStatus = e.status; },
} onReady: function (res) {
} // #ifndef MP-ALIPAY
}, this.videoContext = uni.createVideoContext("courseVideo");
onReady: function(res) { // #endif
// #ifndef MP-ALIPAY },
this.videoContext = uni.createVideoContext('courseVideo'); methods: {
// #endif videoErrorCallback: function (e) {
}, uni.showModal({
methods: { content: e.target.errMsg,
videoErrorCallback: function(e) { showCancel: false,
uni.showModal({ });
content: e.target.errMsg, },
showCancel: false getRandomColor: function () {
}); const rgb = [];
}, for (let i = 0; i < 3; ++i) {
getRandomColor: function() { let color = Math.floor(Math.random() * 256).toString(16);
const rgb = []; color = color.length == 1 ? "0" + color : color;
for (let i = 0; i < 3; ++i) { rgb.push(color);
let color = Math.floor(Math.random() * 256).toString(16); }
color = color.length == 1 ? '0' + color : color; return "#" + rgb.join("");
rgb.push(color); },
} changeCourseStatus() {
return '#' + rgb.join(''); let that = this;
}, if (that.courseId) {
changeCourseStatus() { that.$u.api
let that = this .saveCourseRate({
if (that.courseId) { courseId: that.courseId,
that.$u.api.saveCourseRate({ })
courseId: that.courseId .then((res) => {
}).then(res => { if (res.code !== 200) {
if (res.code == 200) { uni.showToast({
// uni.navigateBack({delta: 1}) icon: "none",
uni.navigateTo({ title: "更新课程状态失败",
url: "/pages/learn/exam" });
}) }
} else { });
uni.showToast({ } else {
icon: "none", uni.showToast({
title: "更新课程状态失败" title: "课程ID为空,请重新选择课程",
}) });
} }
}).catch(e => { },
},
}) };
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程"
})
}
},
}
};
</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;
} }
.course-video {
width: 100%;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #FFFFFF;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
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 {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
} .course-video {
width: 100%;
}
.item-content { .course-title {
display: flex; font-size: 36rpx;
padding-bottom: 30rpx; font-weight: 700;
} padding: 80rpx 60rpx 40rpx 60rpx;
}
.item-title { .course-desc {
color: #333333; margin-left: 60rpx;
font-size: 28rpx; }
}
.learn-view { .title-content {
background-color: #FFFFFF; padding: 40rpx 30rpx;
border-radius: 12rpx; margin-bottom: 20rpx;
padding: 38rpx 30rpx 30rpx 30rpx; background-color: #ffffff;
margin-bottom: 20rpx; color: #999999;
font-size: 32rpx; font-size: 24rpx;
color: #333333;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
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 {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
}
.learn-view-title { .item-content {
font-size: 32rpx; display: flex;
font-weight: bold; padding-bottom: 30rpx;
margin-bottom: 10rpx;
} }
.learn-list {
.learn-list-item { .item-title {
font: 24rpx; color: #333333;
margin-top: 30rpx; font-size: 28rpx;
margin-bottom: 30rpx; }
}
.line-view { .learn-view {
background-color: #F4F5F7; background-color: #ffffff;
height: 2rpx; border-radius: 12rpx;
width: 100%; padding: 38rpx 30rpx 30rpx 30rpx;
} margin-bottom: 20rpx;
} font-size: 32rpx;
} color: #333333;
</style>
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font: 24rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
width: 100%;
}
}
}
</style>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
id: 'Course1', id: 'Course1',
courseId: 1, courseId: 1,
title: '', title: '',
value: '已学习', value: '去学习',
courseActive: {}, courseActive: {},
status: 1, status: 1,
url: '' url: ''
...@@ -104,6 +104,15 @@ ...@@ -104,6 +104,15 @@
courseActive: {}, courseActive: {},
status: 0, status: 0,
url: '' url: ''
},
{
id: 'Course4',
courseId: 4,
title: '',
value: '去学习',
courseActive: {},
status: 0,
url: ''
} }
], ],
tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程' tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程'
...@@ -160,8 +169,9 @@ ...@@ -160,8 +169,9 @@
that.$u.api that.$u.api
.listOrderingTutorials() .listOrderingTutorials()
.then(res => { .then(res => {
debugger
const results = res.data; const results = res.data;
if (res.status == 200 && results && results.length > 0) { if (res.code == 200 && results && results.length > 0) {
that.tutorials.forEach((data, i) => { that.tutorials.forEach((data, i) => {
if (results.hasOwnProperty(data.id)) { if (results.hasOwnProperty(data.id)) {
data.status = results[data.id]; data.status = results[data.id];
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
</image> </image>
</view> </view>
<view class="txt-box"> <view class="txt-box">
<text :class="['title', {failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr">{{txt}}</text> <text :class="['title', {failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr" :key="index">{{txt}}</text>
</view> </view>
<view class="tips-box" v-if="info.tipsArr"> <view class="tips-box" v-if="info.tipsArr">
<text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']" <text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']"
v-for="(txt,index) in info.tipsArr">{{txt}}</text> v-for="(txt,index) in info.tipsArr" :key="index">{{txt}}</text>
</view> </view>
<view class="services-view"> <view class="services-view">
<image class="service-info-image" :src="erweimaImage"></image> <image class="service-info-image" :src="erweimaImage"></image>
......
...@@ -33,6 +33,7 @@ function authorization(data) { ...@@ -33,6 +33,7 @@ function authorization(data) {
if (res) { if (res) {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
app.setUserData(res.data) app.setUserData(res.data)
app.getBaseInfo(app.$vm)
resolve(res); resolve(res);
} else { } else {
reject(res); reject(res);
...@@ -53,6 +54,7 @@ function signup(data) { ...@@ -53,6 +54,7 @@ function signup(data) {
if (res) { if (res) {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
app.setUserData(res.data) app.setUserData(res.data)
app.getBaseInfo(app.$vm)
resolve(res); resolve(res);
} else { } else {
uni.showModal({ uni.showModal({
......
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