Commit b4fb3328 authored by Morson's avatar Morson
parents 50d7fc1f 8356b206
......@@ -10,9 +10,14 @@
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
</view>
<view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<text>{{item + ':'}}</text>
<text>{{orderData[key]}}</text>
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<view class="info-title">
<text>{{item.name + ':'}}</text>
</view>
<view class="info-content">
<text>{{orderData[key]}}</text>
<text v-if="item.content">{{' / ' + orderData[item.content]}}</text>
</view>
</view>
<view class="address-view">
<view class="address-left-view">
......@@ -133,9 +138,10 @@
},
infoTexts() {
return {
'orderNumber': '工单编号',
'contactName': '客户信息',
'contactPhone': '联系方式'
'orderNumber': {name:'工单编号'},
'partnerCompanyName': {name: '合作厂商'},
'contactName': {name: '客户信息', content: 'contactPhone'},
}
},
typeTexts() {
......@@ -375,8 +381,17 @@
text-align: left;
color: #333333;
font-size: 26rpx;
margin-top: 12rpx;
margin-bottom: 12rpx;
margin-top: 18rpx;
margin-bottom: 18rpx;
display: flex;
align-items: flex-start;
.info-title {
flex-shrink: 0;
}
.info-content {
word-break: break-all;
}
}
.address-view {
......@@ -385,7 +400,7 @@
justify-content: space-between;
color: #333333;
font-size: 24rpx;
margin-top: 12rpx;
margin-top: 20rpx;
.address-left-view {
display: flex;
......
......@@ -53,6 +53,9 @@
"ios" : {},
/* ios打包配置 */
"sdkConfigs" : {}
},
"uniStatistics" : {
"enable" : true
}
},
/* SDK配置 */
......@@ -71,6 +74,9 @@
"scope.userLocation" : {
"desc" : "方便查看订单与你的距离"
}
},
"uniStatistics" : {
"enable" : true
}
},
"mp-alipay" : {
......
......@@ -158,6 +158,7 @@
} else {
this.waitInit = true
}
// 第一次入驻成功弹出客服弹窗
if (e && e.visible) {
this.visible = e.visible
}
......@@ -166,8 +167,10 @@
// 每次进入页面都刷新入驻状态
this.pageNumber = 0
this.initSettleInfo();
this.getLocation()
this.initSettleInfo();
if (this.status == 7) {
this.getLocation()
}
},
// onPullDownRefresh() {
// console.log('------下拉刷新------')
......
......@@ -153,7 +153,7 @@ var json = {
{
title: "服务规范",
desc: "为用户提供更好服务,自己赚更多钱",
pic: process.uniEnv.qn_base_url + "fwgf-3x.png",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
id: 173,
......@@ -162,7 +162,7 @@ var json = {
{
title: "接单规范",
desc: "快速学习,使用APP 接单、抢单",
pic: process.uniEnv.qn_base_url + "jdgf-3x.png",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
id: 173,
......@@ -171,7 +171,7 @@ var json = {
{
title: "从0-1学习充电桩安装服务",
desc: "让你全面了解充电桩市场及服务规范",
pic: process.uniEnv.qn_base_url + "cdz-3x.png",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 173,
......@@ -182,7 +182,7 @@ var json = {
{
title: "服务规范",
desc: "为用户提供更好服务,自己赚更多钱",
pic: process.uniEnv.qn_base_url + "fwgf-3x.png",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
id: 150,
......@@ -191,7 +191,7 @@ var json = {
{
title: "接单规范",
desc: "快速学习,使用APP 接单、抢单",
pic: process.uniEnv.qn_base_url + "jdgf-3x.png",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
id: 149,
......@@ -200,7 +200,7 @@ var json = {
{
title: "从0-1学习充电桩安装服务",
desc: "让你全面了解充电桩市场及服务规范",
pic: process.uniEnv.qn_base_url + "cdz-3x.png",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 151,
......@@ -211,7 +211,7 @@ var json = {
{
title: "服务规范",
desc: "为用户提供更好服务,自己赚更多钱",
pic: process.uniEnv.qn_base_url + "fwgf-3x.png",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
sectionId: "",
......@@ -219,7 +219,7 @@ var json = {
{
title: "接单规范",
desc: "快速学习,使用APP 接单、抢单",
pic: process.uniEnv.qn_base_url + "jdgf-3x.png",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
sectionId: "",
......@@ -227,7 +227,7 @@ var json = {
{
title: "从0-1学习充电桩安装服务",
desc: "让你全面了解充电桩市场及服务规范",
pic: process.uniEnv.qn_base_url + "cdz-3x.png",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
sectionId: "",
......@@ -242,7 +242,7 @@ var examJson = {
desc: "通过本认证,是接单的必要条件",
condition: "随机20题,及格20题",
status: "",
pic: process.uniEnv.qn_base_url + "fwgf-3x.png",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 2,
examId: "",
examStatus: "",
......@@ -425,6 +425,12 @@ export default {
},
},
onShow: function (param) {
try {
if (param.tabs) {
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
} catch (e) {}
if (this.current == 2 || this.current == 3) {
this.tabsChange(this.current);
}
......@@ -588,8 +594,8 @@ export default {
},
//tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
switch (index) {
this.swiperCurrent = Number(index);
switch (this.swiperCurrent) {
case 1:
this.loadNews();
break;
......@@ -705,25 +711,24 @@ export default {
var examInfo = this.examList[index];
if (examInfo.examStatus == 0) {
wx.navigateTo({
// url: "/pages/learn/answer?examId=" + examInfo.id,
url: "/pages/learn/assessment?examId=" + examInfo.id,
});
} else if (examInfo.examStatus == 1) {
let url = '';
if (examInfo.status == "已通过") {
wx.navigateTo({
url:
"/pages/learn/exam-pass?userExamId=" +
examInfo.examId,
});
url = "/pages/learn/exam-pass?userExamId=" +
examInfo.examId +
"&examId=" +
examInfo.id;
} else {
wx.navigateTo({
url:
"/pages/learn/result?userExamId=" +
url = "/pages/learn/result?userExamId=" +
examInfo.examId +
"&examId=" +
examInfo.id,
});
examInfo.id
}
wx.navigateTo({
url: url,
});
} else if (examInfo.examStatus == 2) {
wx.navigateTo({
url: "/pages/learn/assessment?examId=" + examInfo.id,
......@@ -885,7 +890,7 @@ export default {
width: 160rpx;
height: 200rpx;
position: absolute;
top: -45rpx;
bottom: 5rpx;
left: 30rpx;
}
......
......@@ -136,25 +136,22 @@ export default {
toSubmit() {
//判断是否通过,通过去成功页,失败去失败页
let examInfo = this.examInfo;
let examId = this.examId;
let status = examInfo.examLevelResult == "已通过";
let url = '';
if (status) {
wx.navigateTo({
url:
"/pages/learn/exam-pass?userExamId=" +
url = "/pages/learn/exam-pass?userExamId=" +
this.userExamId +
"&examId=" +
examId,
});
this.examId;
} else {
wx.navigateTo({
url:
"/pages/learn/result?userExamId=" +
url = "/pages/learn/result?userExamId=" +
this.userExamId +
"&examId=" +
examId,
});
this.examId
}
wx.redirectTo({
url: url,
});
},
contentFilter(txt) {
if (!txt) {
......@@ -172,7 +169,12 @@ export default {
this.getUserExamInfo();
},
gotoLogin() {
uni.navigateTo({
url: "/pages/login/wxlogin",
});
return;
},
//获取考试信息
getUserExamInfo: function () {
uni.showLoading({
......@@ -201,10 +203,12 @@ export default {
return;
}
if (res.data.code == 401 || res.data.code == 403) {
uni.navigateTo({
url: "/pages/login/wxlogin",
//提示 提交结果失败 请再次提交
uni.showToast({
icon: "none",
title: "获取考试结果失败,请再次尝试提交",
});
return;
return
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
......@@ -264,10 +268,8 @@ export default {
success: (res) => {
uni.hideLoading();
if (res.statusCode == 401) {
uni.navigateTo({
url: "/pages/login/wxlogin",
});
return;
this.gotoLogin();
return
}
if (res.data.code == 200) {
......@@ -347,11 +349,16 @@ export default {
success: (res) => {
uni.hideLoading();
if (res.statusCode == 401) {
uni.navigateTo({
url: "/pages/login/wxlogin",
});
this.gotoLogin()
return;
}
if(res.statusCode == 403){
uni.showToast({
icon: "none",
title: "获取考试结果失败,请再次尝试提交",
});
return
}
if (res.data.code == 200) {
that.currentItem = res.data.data;
console.log(that.currentItem);
......@@ -496,55 +503,6 @@ export default {
this.handleAnswer();
//this.getNext()
},
//上传考试结果
postResult: function () {
uni.showLoading({
title: "请稍候",
});
let that = this;
uni.request({
url:
ucenterApiUrl +
"/v1/settled/update-settled-exam-score" +
"?access-token=" +
that.vuex_token,
method: "POST",
data: {
score: this.examScore || 0,
},
success: (res) => {
uni.hideLoading();
if (res.statusCode == 401) {
uni.navigateTo({
url: "/pages/login/wxlogin",
});
return;
}
if (res.statusCode == 200) {
// uni.navigateTo({
// url: '/pages/settle/prompt'
// })
} else {
uni.showToast({
icon: "none",
title: "上传考试结果失败",
});
}
},
fail: (e) => {
uni.hideLoading();
uni.showToast({
icon: "none",
title: "上传考试结果失败",
});
},
});
},
//所选答案
handleAnswer: function () {
/*
......
......@@ -31,7 +31,7 @@ export default {
data() {
return {
text: "",
examId: 2,
examId: null,
result: null,
is_pass: false,
score: 0,
......@@ -39,54 +39,44 @@ export default {
};
},
onLoad(a) {
this.examId = a.examId;
this.userExamId = a.userExamId;
console.log("userExamId是", this.userExamId);
this.nextClick();
this.getCourseResult();
},
onUnload() {
this.toIndex()
},
// onUnload() {
// wx.reLaunch({
// url: "./index",
// });
// },
methods: {
//考试结果
nextClick: function () {
console.log("wwwwwwwwww");
uni.request({
url:
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (res) => {
this.result = res.data.data;
this.text = res.data.data.examLevelResult;
getCourseResult: function () {
this.$u.api
.getExamResult(this.examId)
.then((res) => {
if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({
icon: "none",
title: "获取考试结果失败",
});
}
this.result = res.data;
this.text = res.data.examLevelResult;
this.score = this.result.examScore;
this.is_pass = this.result.result == '通过';
console.log("标识符55", this.result);
},
});
},
//再次考试
getAgain: function () {
wx.navigateTo({
url: "/pages/learn/assessment",
});
})
.catch((err) => {
console.log("getUserExamInfo err" + err);
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let length = routes.length
uni.navigateBack({
delta: length - 1
uni.switchTab({
url: '/pages/index/learn'
});
},
},
......
......@@ -46,52 +46,50 @@ export default {
this.userExamId = a.userExamId;
this.examId = a.examId;
console.log("userExamId是", this.userExamId);
this.nextClick();
this.getCourseResult();
},
onUnload() {
this.toIndex()
},
// onUnload() {
// wx.reLaunch({
// url: "./index",
// });
// },
methods: {
//考试结果
nextClick: function () {
console.log("wwwwwwwwww");
uni.request({
url:
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (res) => {
this.result = res.data.data;
this.text = res.data.data.examLevelResult;
getCourseResult: function () {
this.$u.api
.getExamResult(this.examId)
.then((res) => {
if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({
icon: "none",
title: "获取考试结果失败",
});
}
this.result = res.data;
this.text = res.data.examLevelResult;
this.score = this.result.examScore;
console.log("标识符55", this.result);
},
});
})
.catch((err) => {
console.log("getUserExamInfo err" + err);
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
});
},
//再次考试
getAgain: function () {
let examId = this.examId;
wx.navigateTo({
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
console.log(routes.length);
uni.navigateTo({
url: "/pages/learn/assessment?examId=" + examId,
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let length = routes.length
uni.navigateBack({
delta: length - 1
uni.switchTab({
url: '/pages/index/learn'
});
},
},
......
......@@ -101,9 +101,10 @@ export default {
}
.jf-currency-class {
width: 100%;
min-height: 180rpx;
border-radius: 12rpx;
padding-top: 40rpx;
margin-top: 74rpx;
padding: 20rpx;
margin-top: 80rpx;
background: #ffffff;
position: relative;
.left {
......@@ -111,7 +112,7 @@ export default {
height: 200rpx;
padding: 30rpx 14rpx 0 14rpx;
position: absolute;
top: -40rpx;
bottom: 30rpx;
left: 30rpx;
background: url(@/static/photo/hetong.png);
border-radius: 6px;
......
......@@ -18,6 +18,10 @@
<text>工单编号:</text>
<text>{{ order.orderNumber }}</text>
</view>
<view class="order-cell">
<text>合作厂商:</text>
<text>{{ order.partnerCompanyName }}</text>
</view>
<view class="order-cell between-cell">
<view class="left">
<text>客户信息:</text>
......@@ -123,7 +127,7 @@
<view>
<u-toast ref="uToast" />
</view>
<view v-if="showCenterBtn" @click="$u.throttle(handleBtn, 500)" class="button" :class="['center-button-view', btnClass]">
<view v-if="showCenterBtn" @click="$u.throttle(handleBtn, 500)" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime && showTimeOut" class="time-view">
<text style="padding-right: 8rpx;">{{order.currentOverTime > new Date().getTime()?'剩':'超'}}</text>
......@@ -232,7 +236,8 @@
num:0,
showTimeOut:true,
clicking: false,
dateItem: null
dateItem: null,
centerBtnDisabled:false
}
},
onLoad(option) {
......@@ -242,9 +247,14 @@
}
this.loadOrderDetail()
this.loadOrderRecord()
this.getLocation()
// this.getLocation()
this.getSignDistance()
},
onHide() {
this.closeLocationChange()
},onUnload() {
this.closeLocationChange()
},
computed: {
phoneIcon() {
......@@ -301,6 +311,38 @@
});
}
},
updateLocation(){
let self = this
wx.startLocationUpdate({
success:function(){
self.openLocationChange()
}
})
},
_locationChangeFn(res) {
let self = this
console.log('location change', res)
const dataValue = this.dataValue || []
dataValue.push(res.longitude)
dataValue.push(res.latitude)
self.dataValue = dataValue
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离
this.btnClass = "isGan-btn"
this.centerBtnDisabled = false
}else{
this.centerBtnDisabled = true
}
},
openLocationChange(){
console.log("openLocationChange")
wx.onLocationChange(this._locationChangeFn);
},
closeLocationChange(){
console.log("closeLocationChange")
wx.offLocationChange(this._locationChangeFn);
},
phoneToCustomer(phone){ // 联系客户
if(this.isAllowDianhuaAndDaohang){
uni.makePhoneCall({
......@@ -515,7 +557,8 @@
this.submitType = "maintainWorkerCheckin"
this.isAllowDianhuaAndDaohang = true
this.errorSignIn = true
this.addressToCoordinate()
// this.addressToCoordinate()
this.updateLocation()
} else if (orderStatus > 31 && orderStatus < 80) {
// 完工
this.centerButton = "filish"
......@@ -554,9 +597,15 @@
}
data.appointmentDatetimeRange = this.appointmentDatetimeRange.pkey
}else if (this.submitType === 'maintainWorkerCheckin') { // 签到
// 检查见到距离是否符合
if(!this.isErrorSign){
if(this.getDistance(this.contactAddressLatitud,this.contactAddressLongitud)>this.signDistance){
if(!this.centerBtnDisabled){
return
}else{
this.closeLocationChange()
}
if(this.getDistance() > this.signDistance){
this.commonToast('签到失败,请点击异常签到处理或联系客服','error')
return
}
......@@ -603,13 +652,14 @@
}
})
} else {
let self = this
this.$refs.uToast.show({
title: res.data.message!==undefined ? res.data.message:res.message,
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
type: 'warning',
callback: function() {
this.clicking = false
res.data.message==='抱歉,手快的师傅已经抢到此单!'?this.isGan():''
res.data.message==='抱歉,手快的师傅已经抢到此单!'?self.isGan():''
}
})
}
......@@ -683,7 +733,7 @@
});
},
getDistance(Latitud, Longitud){
return this.distance(Latitud,Longitud,this.dataValue[1],this.dataValue[0])
return this.distance(this.order.contactAddressLatitud,this.order.contactAddressLongitud,this.dataValue[1],this.dataValue[0])
},
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
......@@ -720,7 +770,7 @@
var nowTime = new Date(); // 当前时间
if(currentOverTime && nowTime.getTime() > currentOverTime){
this.btnClass='timeOut-btn'
self.$refs['uCountDown'].seconds += 2
this.$refs['uCountDown'].seconds += 2
}
},
handleClick(){
......@@ -1074,7 +1124,7 @@
.between-cell {
display: flex;
justify-content: space-between;
align-items: flex-start;
align-items: center;
}
.display-cell {
display: flex;
......
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