适配H5
This commit is contained in:
parent
0aa7f77cbf
commit
a70dce6f44
@ -1,9 +1,9 @@
|
||||
// const userCenterBaseUrl = 'http://192.168.0.107:7001/usercenter';
|
||||
const userCenterBaseUrl = 'http://211.82.137.19:8188/usercenter'; //正式服务器
|
||||
const userCenterBaseUrl = 'http://121.36.71.250:58033/usercenter'; //正式服务器
|
||||
// const evalutaionBaseUrl = 'http://127.0.0.1:7003/evaluation';
|
||||
// const evalutaionBaseUrl = 'http://192.168.0.110:7003/evaluation';
|
||||
// const evalutaionBaseUrl = 'http://39.104.74.123:8082/evaluation'; //正式服务器
|
||||
const evalutaionBaseUrl = 'http://211.82.137.19:8188/evaluation'; //正式服务器
|
||||
const evalutaionBaseUrl = 'http://121.36.71.250:58033/evaluation'; //正式服务器
|
||||
const missionList = evalutaionBaseUrl + '/app/apptask/listtasktoapp';
|
||||
|
||||
function pathArgsHasSameValue(pathArgArray) {
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<view>
|
||||
<iframe ref="iframe" id="iframe" :srcdoc="data" style="width:100%;" scrolling="no"
|
||||
onload="this.height=this.contentWindow.document.documentElement.scrollHeight"></iframe>
|
||||
|
||||
<web-view :src="webUrl"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -54,8 +51,8 @@
|
||||
// setTimeout(function() {
|
||||
// _self.window.document.getElementById('iframe').contentWindow.location.reload(
|
||||
// true);
|
||||
// }, 1000);
|
||||
|
||||
// }, 1000);
|
||||
|
||||
|
||||
},
|
||||
fail(error) {
|
||||
@ -71,7 +68,11 @@
|
||||
key: 'appToken',
|
||||
success: res => {
|
||||
_self.token = res.data;
|
||||
_self.getHtml(ldRes.taskId, ldRes.rid);
|
||||
_self.webUrl = common.evalutaionBaseUrl +
|
||||
'/app/apptask/getoptiontemplatedefault-release/' +
|
||||
ldRes.taskId + "?token=" + _self.token;
|
||||
console.log(_self.webUrl)
|
||||
// _self.getHtml(ldRes.taskId, ldRes.rid);
|
||||
// console.log(_self.webviewStyles)
|
||||
// _self.webviewStyles.additionalHttpHeaders = {
|
||||
// token: _self.token
|
||||
|
@ -45,12 +45,9 @@
|
||||
// _self.createView(ldRes.taskId, ldRes.rid)
|
||||
// // #endif
|
||||
// // #ifdef H5
|
||||
_self.webUrl = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaultresult/' +
|
||||
ldRes.taskId + '/' + ldRes.rid;
|
||||
console.log(_self.webUrl)
|
||||
_self.webstyle.additionalHttpHeaders = {
|
||||
token: _self.token
|
||||
}
|
||||
_self.webUrl = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaultresult-release/' +
|
||||
ldRes.taskId + '/' + ldRes.rid + "?token=" + _self.token;
|
||||
console.log(_self.webUrl)
|
||||
// // #endif
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="search">
|
||||
<view class="input-box">
|
||||
<input class="input-font" placeholder="请输入关键字" type="text" v-model="keyword" placeholder-class="input-placeholder" />
|
||||
<image src="../../static/ic_search.png" style="width: 70rpx;height: 70rpx;margin-right: 20rpx;"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="search">
|
||||
<view class="input-box">
|
||||
<input class="input-font" placeholder="请输入关键字" type="text" v-model="keyword"
|
||||
placeholder-class="input-placeholder" />
|
||||
<image src="../../static/ic_search.png" style="width: 70rpx;height: 70rpx;margin-right: 20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="evaluations.length>0" style="display: flex;flex-direction: column;justify-content: center;width: 100%;">
|
||||
<view v-if="evaluations.length>0"
|
||||
style="display: flex;flex-direction: column;justify-content: center;width: 100%;">
|
||||
<view class="content" v-for="(evaluation,index) in evaluations" :key="index" @tap="itemClick(evaluation)"
|
||||
:data-taskid="evaluation.taskId">
|
||||
:data-taskid="evaluation.taskId">
|
||||
<view class="item-li">
|
||||
<view class="item-title">{{index + 1}}.{{evaluation.taskName}}</view>
|
||||
<view class="item-content">{{evaluation.evaluationName}}</view>
|
||||
@ -16,24 +18,26 @@
|
||||
<view class="item-tag-box">
|
||||
<view class="item-time">
|
||||
{{evaluation.taskStartTime.substring(0, 10)}}至{{evaluation.taskEndTime.substring(0, 10)}}
|
||||
</view>
|
||||
<view class="item-tag">
|
||||
<view v-if="evaluation.taskType === 1" style="display: flex;flex-direction: row;">
|
||||
<view style="color: #000000;">{{evaluation.taskTypeContent.split('|')[1]}} </view>
|
||||
<view style="color: #757575;"><text> </text>[被测评部门]</view>
|
||||
</view>
|
||||
<view v-if="evaluation.taskType === 2" style="display: flex;flex-direction: row;">
|
||||
<view style="color: #000000;">{{evaluation.taskTypeContent.split('|')[2]}}</view>
|
||||
<view style="color: #757575;"><text> </text>[被测评人员]</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-tag">
|
||||
<view v-if="evaluation.taskType === 1" style="display: flex;flex-direction: row;">
|
||||
<view style="color: #000000;">{{evaluation.taskTypeContent.split('|')[1]}} </view>
|
||||
<view style="color: #757575;"><text> </text>[被测评部门]</view>
|
||||
</view>
|
||||
<view v-if="evaluation.taskType === 2" style="display: flex;flex-direction: row;">
|
||||
<view style="color: #000000;">{{evaluation.taskTypeContent.split('|')[2]}}</view>
|
||||
<view style="color: #757575;"><text> </text>[被测评人员]</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-count-tag">
|
||||
<view class="item-count-yet">{{evaluation.taskRecordSubmitCount.substring(0,evaluation.taskRecordSubmitCount.lastIndexOf('|'))}}
|
||||
<view class="item-count-yet">
|
||||
{{evaluation.taskRecordSubmitCount.substring(0,evaluation.taskRecordSubmitCount.lastIndexOf('|'))}}
|
||||
</view>
|
||||
<text style="color: #FFFFFF;" space="emsp" decode="true">{{divider}}</text>
|
||||
<view class="item-count-not">
|
||||
{{evaluation.taskRecordSubmitCount.substring(evaluation.taskRecordSubmitCount.lastIndexOf('未'),evaluation.taskRecordSubmitCount.length)}}</view>
|
||||
{{evaluation.taskRecordSubmitCount.substring(evaluation.taskRecordSubmitCount.lastIndexOf('未'),evaluation.taskRecordSubmitCount.length)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -42,7 +46,8 @@
|
||||
<view v-else>
|
||||
<emptyView></emptyView>
|
||||
</view>
|
||||
<yomol-upgrade :type="upgradeType" :url="upgradeUrl" title="发现新版本" :content="upgradeContent" ref="yomolUpgrade"></yomol-upgrade>
|
||||
<yomol-upgrade :type="upgradeType" :url="upgradeUrl" title="发现新版本" :content="upgradeContent" ref="yomolUpgrade">
|
||||
</yomol-upgrade>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@ -99,7 +104,10 @@
|
||||
});
|
||||
}
|
||||
_self.token = appToken
|
||||
// #ifdef APP-PLUS
|
||||
_self.checkAppVersion();
|
||||
// #endif
|
||||
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
var self = this;
|
||||
@ -110,7 +118,8 @@
|
||||
checkAppVersion() {
|
||||
var versionUrl = common.userCenterBaseUrl +
|
||||
'/app/appversion/getappversionnumber/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
var downloadUrl = common.userCenterBaseUrl + '/app/appversion/downloadapp/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
var downloadUrl = common.userCenterBaseUrl +
|
||||
'/app/appversion/downloadapp/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
uni.request({
|
||||
url: versionUrl,
|
||||
header: {
|
||||
@ -209,31 +218,33 @@
|
||||
position: fixed;
|
||||
top: 0;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.input-box {
|
||||
margin-top: 10rpx;
|
||||
width: 90%;
|
||||
min-height: 50rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F5F5F5;
|
||||
border: #666666 solid #555555;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.input-font {
|
||||
color: #000000;
|
||||
width: 90%;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
align-self: center;
|
||||
font-size: 30rpx;
|
||||
min-height: 50rpx;
|
||||
border: #666666 solid #555555;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
margin-top: 10rpx;
|
||||
width: 90%;
|
||||
min-height: 50rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F5F5F5;
|
||||
border: #666666 solid #555555;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.input-font {
|
||||
color: #000000;
|
||||
width: 90%;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
align-self: center;
|
||||
font-size: 30rpx;
|
||||
min-height: 50rpx;
|
||||
border: #666666 solid #555555;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
|
||||
.item-count {
|
||||
font-size: 15rpx;
|
||||
display: flex;
|
||||
@ -310,7 +321,7 @@
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.item-tag {
|
||||
.item-tag {
|
||||
color: #888888;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="evaluations.length>0" style="display: flex;flex-direction: column;justify-content: center;width: 100%;margin-top: 10rpx;">
|
||||
<view v-if="evaluations.length>0"
|
||||
style="display: flex;flex-direction: column;justify-content: center;width: 100%;margin-top: 10rpx;">
|
||||
<view class="content" v-for="(evaluation,index) in evaluations" :key="index" @tap="itemClick(evaluation)"
|
||||
:data-taskid="evaluation.evaluationId">
|
||||
:data-taskid="evaluation.evaluationId">
|
||||
<view class="item-li">
|
||||
<view class="item-title">{{index + 1}}.{{evaluation.evaluationName}}</view>
|
||||
</view>
|
||||
@ -11,7 +12,8 @@
|
||||
<view v-else>
|
||||
<emptyView></emptyView>
|
||||
</view>
|
||||
<yomol-upgrade :type="upgradeType" :url="upgradeUrl" title="发现新版本" :content="upgradeContent" ref="yomolUpgrade"></yomol-upgrade>
|
||||
<yomol-upgrade :type="upgradeType" :url="upgradeUrl" title="发现新版本" :content="upgradeContent" ref="yomolUpgrade">
|
||||
</yomol-upgrade>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@ -59,14 +61,17 @@
|
||||
});
|
||||
}
|
||||
_self.token = appToken
|
||||
// #ifdef APP-PLUS
|
||||
_self.checkAppVersion();
|
||||
// #endif
|
||||
_self.initData();
|
||||
},
|
||||
methods: {
|
||||
checkAppVersion() {
|
||||
var versionUrl = common.userCenterBaseUrl +
|
||||
'/app/appversion/getappversionnumber/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
var downloadUrl = common.userCenterBaseUrl + '/app/appversion/downloadapp/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
var downloadUrl = common.userCenterBaseUrl +
|
||||
'/app/appversion/downloadapp/240fbf7a-aa32-4cde-9674-5147a7d5eb2f'
|
||||
uni.request({
|
||||
url: versionUrl,
|
||||
header: {
|
||||
@ -117,11 +122,11 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
itemClick(e) {
|
||||
uni.navigateTo({
|
||||
url:'indexTwo?id='+ e.evaluationId,
|
||||
itemClick(e) {
|
||||
uni.navigateTo({
|
||||
url: 'indexTwo?id=' + e.evaluationId,
|
||||
})
|
||||
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: '../evaluation/doEvaluation?taskId=' + e.taskId
|
||||
// })
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<view style="position: fixed;top: 0;background-color: #FFFFFF;">
|
||||
<view style="position: fixed;top: 100rpx;background-color: #FFFFFF;">
|
||||
<QSTabs :current="current_1" line2Style="tab-line1" defaultColor="#888" activeColor="#008B8B" :tabs="tabList" width="245"
|
||||
@change="tabChange($event, '1')" />
|
||||
<view class="search">
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<web-view :src="webUrl"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -11,33 +12,38 @@
|
||||
data() {
|
||||
const token = '';
|
||||
return {
|
||||
token: ''
|
||||
token: '',
|
||||
webUrl: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
createView(taskid,trid) {
|
||||
var url = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaulttemporary/' + taskid+'/'+trid
|
||||
wv = plus.webview.create(url, "custom-webview", {
|
||||
top: uni.getSystemInfoSync().statusBarHeight + 44,
|
||||
bottom: '0px',
|
||||
additionalHttpHeaders: {
|
||||
token: _self.token
|
||||
}
|
||||
})
|
||||
// wv.loadURL(url)
|
||||
var currentWebview = this.$mp.page.$getAppWebview()
|
||||
currentWebview.append(wv);
|
||||
setTimeout(function() {}, 1000);
|
||||
createView(taskid, trid) {
|
||||
var url = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaulttemporary/' + taskid + '/' +
|
||||
trid + "?token="
|
||||
// wv = plus.webview.create(url, "custom-webview", {
|
||||
// top: uni.getSystemInfoSync().statusBarHeight + 44,
|
||||
// bottom: '0px',
|
||||
// additionalHttpHeaders: {
|
||||
// token: _self.token
|
||||
// }
|
||||
// })
|
||||
// // wv.loadURL(url)
|
||||
// var currentWebview = this.$mp.page.$getAppWebview()
|
||||
// currentWebview.append(wv);
|
||||
// setTimeout(function() {}, 1000);
|
||||
}
|
||||
},
|
||||
onLoad(ldRes) {
|
||||
_self = this;
|
||||
_self = this;
|
||||
console.log(ldRes.trid);
|
||||
uni.getStorage({
|
||||
key: 'appToken',
|
||||
success: res => {
|
||||
_self.token = res.data;
|
||||
_self.createView(ldRes.taskId,ldRes.trid)
|
||||
_self.webUrl = common.evalutaionBaseUrl +
|
||||
'/app/apptask/getoptiontemplatedefaulttemporary-release/' +
|
||||
ldRes.taskId + '/' +
|
||||
ldRes.trid + "?token=" + _self.token;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user