Commit 38e033aa authored by wangqinghua's avatar wangqinghua

color

parent 55d4605b
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="io.ionic.starter" version="1.2.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>智汇19号</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
......
......@@ -17,7 +17,8 @@
<div class="item-header-style">
<span class="item-title">{{item.title}}</span>
<!--<span float-right class="done" *ngIf="item.state==1 ">未发布</span>-->
<span float-right class="done">已完成</span>
<span *ngIf="item?.writeSelf != 0" float-right class="done">已完成</span>
<span *ngIf="item?.writeSelf == 0" float-right class="done">未完成</span>
<!--<span float-right class="done" *ngIf="item.state==3 ">已过期</span>-->
</div>
</div>
......@@ -32,13 +33,5 @@
</ion-item>
</ng-container>
</ng-container>
<ng-container *ngIf="list.length == 0">
<div text-center style="margin-top: 10rem" *ngIf="list.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</div>
</ng-container>
</ion-list>
</ion-content>
......@@ -34,7 +34,7 @@
</ng-container>
<ng-container *ngIf="item.quesType == 3">
<ng-container *ngFor=" let option2 of item.quesDesc;let i2 = index;">
<p><span class="input-check {{item.option?.answerdesc[i2] == i2?'select-check':''}}"></span>{{option2.option_title}}</p>
<p><span class="input-check {{option2.select == true?'select-check':''}}"></span>{{option2.option_title}}</p>
</ng-container>
</ng-container>
<ng-container *ngIf="item.quesType == 4">
......
......@@ -62,8 +62,8 @@ page-survey-preview {
border: 1px solid #ddd;
display: inline-block;
border-radius: 50%;
width: 1.2rem;
height: 1.2rem;
width: 15px;
height: 15px;
margin-right: 8px;
vertical-align: sub;
}
......@@ -73,9 +73,9 @@ page-survey-preview {
.select-raio::after{
content: '';
position: absolute;
width: 0.7rem;
width: 10px;
top: 2px;
height: 0.7rem;
height: 10px;
border-radius: 50%;
background-color: #333;
left: 2px;
......@@ -83,8 +83,8 @@ page-survey-preview {
.input-check{
border: 1px solid #ddd;
display: inline-block;
width: 1.2rem;
height: 1.2rem;
width: 16px;
height: 16px;
margin-right: 8px;
vertical-align: text-top;
border-radius: 2px;
......@@ -95,9 +95,9 @@ page-survey-preview {
.select-check::after{
content: '\2713';
position: absolute;
width: 0.7rem;
width: 10px;
top: -4px;
height: 0.7rem;
height: 10px;
font-size: 1.5rem;
font-weight: bold;
}
......
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import { AppService } from "../../../../service/appHttpService";
import {AppService} from "../../../../service/appHttpService";
import {Storage} from "@ionic/storage";
import {SurveyResultPage} from "../survey-result/survey-result";
......@@ -36,10 +36,17 @@ export class SurveyPreviewPage {
.subscribe((res) => {
this.survey = res.json().data;
this.contentList = res.json().data.ques.datalist;
this.contentList.forEach(res=>{
this.contentList.forEach(res => {
res.quesDesc = JSON.parse(res.quesDesc);
if(res.quesType == 3 && res.option){
res.option.answerdesc = res.option.answerdesc.split(',');
if (res.quesType == 3 && res.option) {
res.quesDesc.forEach(data=>{
if( res.option.answerdesc.indexOf(data.index) != -1 ){
data.select = true;
}else{
data.select = false;
}
});
console.log(res.option.answerdesc);
}
});
console.log(this.contentList);
......
......@@ -62,8 +62,8 @@ page-survey-result {
border: 1px solid #ddd;
display: inline-block;
border-radius: 50%;
width: 1.2rem;
height: 1.2rem;
width: 15px;
height: 15px;
margin-right: 8px;
vertical-align: sub;
}
......@@ -73,9 +73,9 @@ page-survey-result {
.select-raio::after{
content: '';
position: absolute;
width: 0.7rem;
width: 10px;
top: 2px;
height: 0.7rem;
height: 10px;
border-radius: 50%;
background-color: #333;
left: 2px;
......@@ -83,8 +83,8 @@ page-survey-result {
.input-check{
border: 1px solid #ddd;
display: inline-block;
width: 1.2rem;
height: 1.2rem;
width: 15px;
height: 15px;
margin-right: 8px;
vertical-align: text-top;
border-radius: 2px;
......@@ -95,9 +95,9 @@ page-survey-result {
.select-check::after{
content: '\2713';
position: absolute;
width: 0.7rem;
width: 10px;
top: -4px;
height: 0.7rem;
height: 10px;
font-size: 1.5rem;
font-weight: bold;
}
......
......@@ -72,5 +72,5 @@
</div>
</ion-list>
<button class="submit-btn submit" (click)="submit()">提交</button>
<button class="submit-btn submit" (click)="confirm()">提交</button>
</ion-content>
......@@ -6,8 +6,8 @@ page-survey-write {
border: 1px solid #ddd;
display: inline-block;
border-radius: 50%;
width: 1.2rem;
height: 1.2rem;
width: 16px;
height: 16px;
margin-right: 8px;
vertical-align: sub;
position: absolute;
......@@ -23,9 +23,9 @@ page-survey-write {
input:checked + .input-radio::after {
content: '';
position: absolute;
width: 0.7rem;
width: 10px;
top: 2px;
height: 0.7rem;
height: 10px;
border-radius: 50%;
background-color: #333;
left: 2px;
......@@ -34,8 +34,8 @@ page-survey-write {
.input-check{
border: 1px solid #ddd;
display: inline-block;
width: 1.2rem;
height: 1.2rem;
width: 15px;
height: 15px;
margin-right: 8px;
vertical-align: text-top;
border-radius: 2px;
......@@ -47,9 +47,9 @@ page-survey-write {
input:checked + .input-check::after {
content: '\2713';
position: absolute;
width: 0.7rem;
width: 10px;
top: -4px;
height: 0.7rem;
height: 10px;
font-size: 1.5rem;
font-weight: bold;
}
......
......@@ -55,6 +55,12 @@ export class SurveyWritePage {
console.log(this.ansArr[i]);
}
confirm(){
this.appService.alert('确定提交问卷?',res=>{
this.submit();
});
}
submit() {
if (!this.check()) {
......
......@@ -136,7 +136,7 @@ export class CreatePage {
const arr = [
{
questionId: this.temp.id,
isAns: 1,
isAns: this.isAns,
quesType: this.qType,
title: this.title,
limit: 1000, //问答的字数限制
......
......@@ -54,7 +54,7 @@
<p class="survey-title">{{temp?.title}}</p>
<div class="footter-opr">
<div *ngIf="swiperIndex == 0" (click)="edit()"><span>编辑</span></div>
<div *ngIf="swiperIndex == 1" (click)="edit()"><span>查看</span></div>
<div *ngIf="swiperIndex == 1" (click)="look()"><span>查看</span></div>
<div *ngIf="swiperIndex == 1" (click)="overDue()"><span>设为过期</span></div>
<div *ngIf="swiperIndex == 0" (click)="release()"><span>发布</span></div>
<div *ngIf="swiperIndex == 1 || swiperIndex == 2" (click)="result()"><span>结果</span></div>
......
......@@ -293,7 +293,7 @@ export class AppService {
}
//
// //app请求方式
//
// import {LoadingController, AlertController, ToastController} from 'ionic-angular';
......@@ -561,8 +561,8 @@ export class AppService {
// }
//
// }
//
//
//
//
//
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