wucl 2 سال پیش
والد
کامیت
9443b95abd

+ 70 - 32
pages/index/index.vue

@@ -3,10 +3,10 @@
 		<view class="">
 			<image class="logo" src="../../static/logo.png"></image>
 			<view class="uni-box-head">
-				<uni-title type="h2" align="center" :title="formData.itemName"></uni-title>
-				<uni-title type="h4" align="center" :title="formData.type + formData.scope +'-'+formData.cycleName"
-					color=rgb(191,44,35)></uni-title>
+				<uni-title type="h2" align="center" :title="formData.itemName + formData.cycleName"></uni-title>
 			</view>
+			<uni-notice-bar show-icon text="以下各评分项之和需等于100" />
+			<uni-title type="h5" align="center" :title="questions[0].parentLabel" color=rgb(191,44,35)></uni-title>
 		</view>
 		<view class="formData">
 			<uni-forms :modelValue="formData" ref="form">
@@ -16,11 +16,14 @@
 							maxlength="8" trim="all" />
 					</uni-forms-item>
 				</view>
-				<uni-forms-item v-for="(item,index) in formData.questions" :key="index">
+				<uni-forms-item v-for="(item,index) in questions" :key="index">
 					<uni-card :is-shadow="true" margin="5px">
 						<uni-icons type="help-filled" size="20" color="green"></uni-icons>
 						<text class="uni-body"
-							style="color: black; font-size:medium; letter-spacing: 1px; margin-left: 20rpx; border-bottom: 1rpx solid gray;">{{(index+1) +"."+item.name}}</text>
+							style="color: black; font-size:medium; letter-spacing: 1px; margin-left: 20rpx; border-bottom: 1rpx solid gray;">{{(index+1) +"."+item.label}}</text>
+						<text style="font-size: smaller;  color:darkgrey;float:right">
+							{{(item.minScore==null ||item.maxScore==null )?"":item.minScore+'-'+item.maxScore}}
+						</text>
 						<view slot="actions">
 							<view class="uni-mt-5">
 								<uni-forms-item name="score">
@@ -33,7 +36,7 @@
 					</uni-card>
 				</uni-forms-item>
 			</uni-forms>
-			<button type="primary" @click="submit">提交</button>
+			<button type="primary" @click="submit">下一步</button>
 		</view>
 		<view>
 			<!-- 提示窗示例 -->
@@ -56,19 +59,26 @@
 					id: null,
 					documentId: null,
 					cycleName: "",
-					itemName: null,
-					questions: [{
-						name: "",
-						id: null,
-						score: null
-					}]
+					itemName: "",
+					questions: [
+						{
+							parentLabel:""
+						}
+					]
 				},
 				msgType: 'error',
 				content: null,
-				socket:null
+				socket: null,
+				questions: [
+					{
+						parentLabel:""
+					}
+				],
+				commitQuestions: [],
+				index: 1
 			}
 		},
-		
+
 		onLoad() {
 			this.initWS();
 			this.getDocument();
@@ -77,8 +87,9 @@
 			initWS() {
 				let socket = uni.connectSocket({
 					url: 'wss://kps.scdayou.com/ws/apo/ws',
+					//url: 'ws://127.0.0.1:8090/apo/ws',
 					method: 'GET',
-					success :()=>{
+					success: () => {
 						console.log("socket success")
 					}
 				});
@@ -97,6 +108,7 @@
 					method: "get",
 					success: function(res) {
 						that.formData = res.data.data;
+						that.questions = that.formData.questions[0];
 					},
 				})
 			},
@@ -105,25 +117,43 @@
 				//uni.showLoading()
 				var that = this;
 				const data = that.formData;
+				let xQuestions = that.questions;
 				if (!data.professorNo) {
 					that.dialogToggle("请输入专家编号")
 					//uni.hideLoading()
 					return
 				}
-				console.log(data.questions)
 				let totalScore = 0;
-				for (let i in data.questions) {
-					if (data.questions[i].score == null || data.questions[i].score == "") {
+				for (let i in xQuestions) {
+					if (xQuestions[i].score == null || xQuestions[i].score == "") {
 						that.dialogToggle("还存在未评分的题目,请完成后提交。")
 						return
 					}
-					totalScore += parseFloat(data.questions[i].score);
+					totalScore += parseFloat(xQuestions[i].score);
 				}
-				console.log(totalScore);
 				if (totalScore != 100) {
 					that.dialogToggle("评分之和必须等于100,请检查后再提交。")
 					return
 				}
+				for (let i in that.questions) {
+					that.commitQuestions.push(that.questions[i]);
+				}
+				console.log("当前的", xQuestions)
+				that.questions = [];
+				for (let i=this.index; i<that.formData.questions.length;i++){
+					console.log("i",i)
+					if (that.formData.questions[i].length>0){
+						this.questions = that.formData.questions[i];
+						this.index = i+1;
+						return
+					}
+				}
+
+
+				console.log("that.commotData", that.commitQuestions)
+
+				that.formData.result = that.commitQuestions;
+				that.formData.questions = [];
 				uni.request({
 					//url: "http://127.0.0.1:8090/apo/document/commit",
 					url: "https://kps.scdayou.com/apo/document/commit",
@@ -132,26 +162,34 @@
 					success: function(res) {
 						that.formData = {
 							professorNo: null,
-							questions: {}
+							questions: []
 						};
+						that.commitQuestions = [];
+						that.questions = [];
 						uni.closeSocket(that.socket);
 						uni.navigateTo({
 							url: 'ok'
 						});
-						
+
 					},
 				})
-			}
+			},
+				findChildren(item,callback){
+					if (item.children.length>0){
+						callback(item.children);
+					}
+				}
+		},
+
+		destoryed() {
+			// 在组件销毁前断开 WebSocket 连接
+			uni.onSocketClose(function(res) {
+				console.log('WebSocket 已关闭!');
+			});
 		},
-		  destoryed() {
-		    // 在组件销毁前断开 WebSocket 连接
-		       uni.onSocketClose(function (res) {
-		         console.log('WebSocket 已关闭!');
-		       });
-		    },
-		beforeDestory(){
-			uni.onSocketClose(function (res) {
-			  console.log('WebSocket 已关闭!');
+		beforeDestory() {
+			uni.onSocketClose(function(res) {
+				console.log('WebSocket 已关闭!');
 			});
 		}
 	}

+ 18 - 0
uni_modules/uni-notice-bar/changelog.md

@@ -0,0 +1,18 @@
+## 1.2.1(2022-09-05)
+- 新增 属性 fontSize,可修改文字大小。
+## 1.2.0(2021-11-19)
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar)
+## 1.1.1(2021-11-09) 
+- 新增 提供组件设计资源,组件样式调整
+## 1.1.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.9(2021-05-12)
+- 新增 组件示例地址
+## 1.0.8(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 1.0.7(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.6(2021-02-05)
+- 调整为uni_modules目录规范

+ 426 - 0
uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue

@@ -0,0 +1,426 @@
+<template>
+	<view v-if="show" class="uni-noticebar" :style="{ backgroundColor }" @click="onClick">
+		<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound"
+			:color="color" :size="fontSize * 1.5" />
+		<view ref="textBox" class="uni-noticebar__content-wrapper"
+			:class="{
+				'uni-noticebar__content-wrapper--scrollable': scrollable,
+				'uni-noticebar__content-wrapper--single': !scrollable && (single || moreText)
+			}"
+			:style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }"
+		>
+			<view :id="elIdBox" class="uni-noticebar__content"
+				:class="{
+					'uni-noticebar__content--scrollable': scrollable,
+					'uni-noticebar__content--single': !scrollable && (single || moreText)
+				}"
+			>
+				<text :id="elId" ref="animationEle" class="uni-noticebar__content-text" 
+					:class="{
+						'uni-noticebar__content-text--scrollable': scrollable,
+						'uni-noticebar__content-text--single': !scrollable && (single || showGetMore)
+					}" 
+					:style="{
+						color: color,
+						fontSize: fontSize + 'px',
+						lineHeight: fontSize * 1.5 + 'px',
+						width: wrapWidth + 'px',
+						'animationDuration': animationDuration,
+						'-webkit-animationDuration': animationDuration,
+						animationPlayState: webviewHide ? 'paused' : animationPlayState,
+						'-webkit-animationPlayState': webviewHide ? 'paused' : animationPlayState,
+						animationDelay: animationDelay,
+						'-webkit-animationDelay': animationDelay
+					}"
+				>{{text}}</text>
+			</view>
+		</view>
+		<view v-if="isShowGetMore" class="uni-noticebar__more uni-cursor-point"
+			@click="clickMore">
+			<text v-if="moreText.length > 0" :style="{ color: moreColor, fontSize: fontSize + 'px' }">{{ moreText }}</text>
+			<uni-icons v-else type="right" :color="moreColor" :size="fontSize * 1.1" />
+		</view>
+		<view class="uni-noticebar-close uni-cursor-point" v-if="isShowClose">
+			<uni-icons type="closeempty" :color="color" :size="fontSize * 1.1" @click="close" />
+		</view>
+	</view>
+</template>
+
+<script>
+	// #ifdef APP-NVUE
+	const dom = weex.requireModule('dom');
+	const animation = weex.requireModule('animation');
+	// #endif
+
+	/**
+	 * NoticeBar 自定义导航栏
+	 * @description 通告栏组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=30
+	 * @property {Number} speed 文字滚动的速度,默认100px/秒
+	 * @property {String} text 显示文字
+	 * @property {String} backgroundColor 背景颜色
+	 * @property {String} color 文字颜色
+	 * @property {String} moreColor 查看更多文字的颜色
+	 * @property {String} moreText 设置“查看更多”的文本
+	 * @property {Boolean} single = [true|false] 是否单行
+	 * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
+	 * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
+	 * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
+	 * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
+	 * @event {Function} click 点击 NoticeBar 触发事件
+	 * @event {Function} close 关闭 NoticeBar 触发事件
+	 * @event {Function} getmore 点击”查看更多“时触发事件
+	 */
+
+	export default {
+		name: 'UniNoticeBar',
+		emits: ['click', 'getmore', 'close'],
+		props: {
+			text: {
+				type: String,
+				default: ''
+			},
+			moreText: {
+				type: String,
+				default: ''
+			},
+			backgroundColor: {
+				type: String,
+				default: '#FFF9EA'
+			},
+			speed: {
+				// 默认1s滚动100px
+				type: Number,
+				default: 100
+			},
+			color: {
+				type: String,
+				default: '#FF9A43'
+			},
+			fontSize: {
+				type: Number,
+				default: 14
+			},
+			moreColor: {
+				type: String,
+				default: '#FF9A43'
+			},
+			single: {
+				// 是否单行
+				type: [Boolean, String],
+				default: false
+			},
+			scrollable: {
+				// 是否滚动,添加后控制单行效果取消
+				type: [Boolean, String],
+				default: false
+			},
+			showIcon: {
+				// 是否显示左侧icon
+				type: [Boolean, String],
+				default: false
+			},
+			showGetMore: {
+				// 是否显示右侧查看更多
+				type: [Boolean, String],
+				default: false
+			},
+			showClose: {
+				// 是否显示左侧关闭按钮
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		data() {
+			const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+			const elIdBox = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+			return {
+				textWidth: 0,
+				boxWidth: 0,
+				wrapWidth: '',
+				webviewHide: false,
+				// #ifdef APP-NVUE
+				stopAnimation: false,
+				// #endif
+				elId: elId,
+				elIdBox: elIdBox,
+				show: true,
+				animationDuration: 'none',
+				animationPlayState: 'paused',
+				animationDelay: '0s'
+			}
+		},
+		computed: {
+			isShowGetMore() {
+				return this.showGetMore === true || this.showGetMore === 'true'
+			},
+			isShowClose() {
+				return (this.showClose === true || this.showClose === 'true') 
+					&& (this.showGetMore === false || this.showGetMore === 'false')
+			}
+		},
+		mounted() {
+			// #ifdef APP-PLUS
+			var pages = getCurrentPages();
+			var page = pages[pages.length - 1];
+			var currentWebview = page.$getAppWebview();
+			currentWebview.addEventListener('hide', () => {
+				this.webviewHide = true
+			})
+			currentWebview.addEventListener('show', () => {
+				this.webviewHide = false
+			})
+			// #endif
+			this.$nextTick(() => {
+				this.initSize()
+			})
+		},
+		// #ifdef APP-NVUE
+		beforeDestroy() {
+			this.stopAnimation = true
+		},
+		// #endif
+		methods: {
+			initSize() {
+				if (this.scrollable) {
+					// #ifndef APP-NVUE
+					let query = [],
+						boxWidth = 0,
+						textWidth = 0;
+					let textQuery = new Promise((resolve, reject) => {
+						uni.createSelectorQuery()
+							// #ifndef MP-ALIPAY
+							.in(this)
+							// #endif
+							.select(`#${this.elId}`)
+							.boundingClientRect()
+							.exec(ret => {
+								this.textWidth = ret[0].width
+								resolve()
+							})
+					})
+					let boxQuery = new Promise((resolve, reject) => {
+						uni.createSelectorQuery()
+							// #ifndef MP-ALIPAY
+							.in(this)
+							// #endif
+							.select(`#${this.elIdBox}`)
+							.boundingClientRect()
+							.exec(ret => {
+								this.boxWidth = ret[0].width
+								resolve()
+							})
+					})
+					query.push(textQuery)
+					query.push(boxQuery)
+					Promise.all(query).then(() => {
+						this.animationDuration = `${this.textWidth / this.speed}s`
+						this.animationDelay = `-${this.boxWidth / this.speed}s`
+						setTimeout(() => {
+							this.animationPlayState = 'running'
+						}, 1000)
+					})
+					// #endif
+					// #ifdef APP-NVUE
+					dom.getComponentRect(this.$refs['animationEle'], (res) => {
+						let winWidth = uni.getSystemInfoSync().windowWidth
+						this.textWidth = res.size.width
+						animation.transition(this.$refs['animationEle'], {
+							styles: {
+								transform: `translateX(-${winWidth}px)`
+							},
+							duration: 0,
+							timingFunction: 'linear',
+							delay: 0
+						}, () => {
+							if (!this.stopAnimation) {
+								animation.transition(this.$refs['animationEle'], {
+									styles: {
+										transform: `translateX(-${this.textWidth}px)`
+									},
+									timingFunction: 'linear',
+									duration: (this.textWidth - winWidth) / this.speed * 1000,
+									delay: 1000
+								}, () => {
+									if (!this.stopAnimation) {
+										this.loopAnimation()
+									}
+								});
+							}
+						});
+					})
+					// #endif
+				}
+				// #ifdef APP-NVUE
+				if (!this.scrollable && (this.single || this.moreText)) {
+					dom.getComponentRect(this.$refs['textBox'], (res) => {
+						this.wrapWidth = res.size.width
+					})
+				}
+				// #endif
+			},
+			loopAnimation() {
+				// #ifdef APP-NVUE
+				animation.transition(this.$refs['animationEle'], {
+					styles: {
+						transform: `translateX(0px)`
+					},
+					duration: 0
+				}, () => {
+					if (!this.stopAnimation) {
+						animation.transition(this.$refs['animationEle'], {
+							styles: {
+								transform: `translateX(-${this.textWidth}px)`
+							},
+							duration: this.textWidth / this.speed * 1000,
+							timingFunction: 'linear',
+							delay: 0
+						}, () => {
+							if (!this.stopAnimation) {
+								this.loopAnimation()
+							}
+						});
+					}
+				});
+				// #endif
+			},
+			clickMore() {
+				this.$emit('getmore')
+			},
+			close() {
+				this.show = false;
+				this.$emit('close')
+			},
+			onClick() {
+				this.$emit('click')
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-noticebar {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		width: 100%;
+		box-sizing: border-box;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		padding: 10px 12px;
+		margin-bottom: 10px;
+	}
+
+	.uni-cursor-point {
+		/* #ifdef H5 */
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-noticebar-close {
+		margin-left: 8px;
+		margin-right: 5px;
+	}
+
+	.uni-noticebar-icon {
+		margin-right: 5px;
+	}
+
+	.uni-noticebar__content-wrapper {
+		flex: 1;
+		flex-direction: column;
+		overflow: hidden;
+	}
+
+	.uni-noticebar__content-wrapper--single {
+		/* #ifndef APP-NVUE */
+		line-height: 18px;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-wrapper--single,
+	.uni-noticebar__content-wrapper--scrollable {
+		flex-direction: row;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-noticebar__content-wrapper--scrollable {
+		position: relative;
+	}
+
+	/* #endif */
+
+	.uni-noticebar__content--scrollable {
+		/* #ifdef APP-NVUE */
+		flex: 0;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		flex: 1;
+		display: block;
+		overflow: hidden;
+		/* #endif */
+	}
+
+	.uni-noticebar__content--single {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		flex: none;
+		width: 100%;
+		justify-content: center;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-text {
+		font-size: 14px;
+		line-height: 18px;
+		/* #ifndef APP-NVUE */
+		word-break: break-all;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-text--single {
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		display: block;
+		width: 100%;
+		white-space: nowrap;
+		/* #endif */
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+
+	.uni-noticebar__content-text--scrollable {
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		padding-left: 750rpx;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		position: absolute;
+		display: block;
+		height: 18px;
+		line-height: 18px;
+		white-space: nowrap;
+		padding-left: 100%;
+		animation: notice 10s 0s linear infinite both;
+		animation-play-state: paused;
+		/* #endif */
+	}
+
+	.uni-noticebar__more {
+		/* #ifndef APP-NVUE */
+		display: inline-flex;
+		/* #endif */
+		flex-direction: row;
+		flex-wrap: nowrap;
+		align-items: center;
+		padding-left: 5px;
+	}
+
+	@keyframes notice {
+		100% {
+			transform: translate3d(-100%, 0, 0);
+		}
+	}
+</style>

+ 87 - 0
uni_modules/uni-notice-bar/package.json

@@ -0,0 +1,87 @@
+{
+  "id": "uni-notice-bar",
+  "displayName": "uni-notice-bar 通告栏",
+  "version": "1.2.1",
+  "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "通告栏",
+    "公告",
+    "跑马灯"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [
+			"uni-scss",
+			"uni-icons"
+		],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 13 - 0
uni_modules/uni-notice-bar/readme.md

@@ -0,0 +1,13 @@
+
+
+## NoticeBar 通告栏
+> **组件名:uni-notice-bar**
+> 代码块: `uNoticeBar`
+
+
+通告栏组件 。
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-notice-bar)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
+
+

+ 79 - 41
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -7,16 +7,23 @@ const _sfc_main = {
         id: null,
         documentId: null,
         cycleName: "",
-        itemName: null,
-        questions: [{
-          name: "",
-          id: null,
-          score: null
-        }]
+        itemName: "",
+        questions: [
+          {
+            parentLabel: ""
+          }
+        ]
       },
       msgType: "error",
       content: null,
-      socket: null
+      socket: null,
+      questions: [
+        {
+          parentLabel: ""
+        }
+      ],
+      commitQuestions: [],
+      index: 1
     };
   },
   onLoad() {
@@ -27,6 +34,7 @@ const _sfc_main = {
     initWS() {
       let socket = common_vendor.index.connectSocket({
         url: "wss://kps.scdayou.com/ws/apo/ws",
+        //url: 'ws://127.0.0.1:8090/apo/ws',
         method: "GET",
         success: () => {
           console.log("socket success");
@@ -47,30 +55,46 @@ const _sfc_main = {
         method: "get",
         success: function(res) {
           that.formData = res.data.data;
+          that.questions = that.formData.questions[0];
         }
       });
     },
     submit() {
       var that = this;
       const data = that.formData;
+      let xQuestions = that.questions;
       if (!data.professorNo) {
         that.dialogToggle("请输入专家编号");
         return;
       }
-      console.log(data.questions);
       let totalScore = 0;
-      for (let i in data.questions) {
-        if (data.questions[i].score == null || data.questions[i].score == "") {
+      for (let i in xQuestions) {
+        if (xQuestions[i].score == null || xQuestions[i].score == "") {
           that.dialogToggle("还存在未评分的题目,请完成后提交。");
           return;
         }
-        totalScore += parseFloat(data.questions[i].score);
+        totalScore += parseFloat(xQuestions[i].score);
       }
-      console.log(totalScore);
       if (totalScore != 100) {
         that.dialogToggle("评分之和必须等于100,请检查后再提交。");
         return;
       }
+      for (let i in that.questions) {
+        that.commitQuestions.push(that.questions[i]);
+      }
+      console.log("当前的", xQuestions);
+      that.questions = [];
+      for (let i = this.index; i < that.formData.questions.length; i++) {
+        console.log("i", i);
+        if (that.formData.questions[i].length > 0) {
+          this.questions = that.formData.questions[i];
+          this.index = i + 1;
+          return;
+        }
+      }
+      console.log("that.commotData", that.commitQuestions);
+      that.formData.result = that.commitQuestions;
+      that.formData.questions = [];
       common_vendor.index.request({
         //url: "http://127.0.0.1:8090/apo/document/commit",
         url: "https://kps.scdayou.com/apo/document/commit",
@@ -79,14 +103,21 @@ const _sfc_main = {
         success: function(res) {
           that.formData = {
             professorNo: null,
-            questions: {}
+            questions: []
           };
+          that.commitQuestions = [];
+          that.questions = [];
           common_vendor.index.closeSocket(that.socket);
           common_vendor.index.navigateTo({
             url: "ok"
           });
         }
       });
+    },
+    findChildren(item, callback) {
+      if (item.children.length > 0) {
+        callback(item.children);
+      }
     }
   },
   destoryed() {
@@ -102,6 +133,7 @@ const _sfc_main = {
 };
 if (!Array) {
   const _easycom_uni_title2 = common_vendor.resolveComponent("uni-title");
+  const _easycom_uni_notice_bar2 = common_vendor.resolveComponent("uni-notice-bar");
   const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
   const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
   const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
@@ -109,9 +141,10 @@ if (!Array) {
   const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
   const _easycom_uni_popup_dialog2 = common_vendor.resolveComponent("uni-popup-dialog");
   const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
-  (_easycom_uni_title2 + _easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_icons2 + _easycom_uni_card2 + _easycom_uni_forms2 + _easycom_uni_popup_dialog2 + _easycom_uni_popup2)();
+  (_easycom_uni_title2 + _easycom_uni_notice_bar2 + _easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_icons2 + _easycom_uni_card2 + _easycom_uni_forms2 + _easycom_uni_popup_dialog2 + _easycom_uni_popup2)();
 }
 const _easycom_uni_title = () => "../../uni_modules/uni-title/components/uni-title/uni-title.js";
+const _easycom_uni_notice_bar = () => "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.js";
 const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
 const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js";
 const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
@@ -120,7 +153,7 @@ const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-for
 const _easycom_uni_popup_dialog = () => "../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js";
 const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
 if (!Math) {
-  (_easycom_uni_title + _easycom_uni_easyinput + _easycom_uni_forms_item + _easycom_uni_icons + _easycom_uni_card + _easycom_uni_forms + _easycom_uni_popup_dialog + _easycom_uni_popup)();
+  (_easycom_uni_title + _easycom_uni_notice_bar + _easycom_uni_easyinput + _easycom_uni_forms_item + _easycom_uni_icons + _easycom_uni_card + _easycom_uni_forms + _easycom_uni_popup_dialog + _easycom_uni_popup)();
 }
 function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   return common_vendor.e({
@@ -129,70 +162,75 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
     b: common_vendor.p({
       type: "h2",
       align: "center",
-      title: $data.formData.itemName
+      title: $data.formData.itemName + $data.formData.cycleName
     }),
     c: common_vendor.p({
-      type: "h4",
+      ["show-icon"]: true,
+      text: "以下各评分项之和需等于100"
+    }),
+    d: common_vendor.p({
+      type: "h5",
       align: "center",
-      title: $data.formData.type + $data.formData.scope + "-" + $data.formData.cycleName,
+      title: $data.questions[0].parentLabel,
       color: "rgb(191,44,35)"
     }),
-    d: common_vendor.o(($event) => $data.formData.professorNo = $event),
-    e: common_vendor.p({
+    e: common_vendor.o(($event) => $data.formData.professorNo = $event),
+    f: common_vendor.p({
       prefixIcon: "person",
       placeholder: "请输入专家编号(必填)",
       maxlength: "8",
       trim: "all",
       modelValue: $data.formData.professorNo
     }),
-    f: common_vendor.p({
+    g: common_vendor.p({
       name: "professorNo"
     }),
-    g: common_vendor.f($data.formData.questions, (item, index, i0) => {
+    h: common_vendor.f($data.questions, (item, index, i0) => {
       return {
-        a: "7cd16330-7-" + i0 + "," + ("7cd16330-6-" + i0),
-        b: common_vendor.t(index + 1 + "." + item.name),
-        c: "7cd16330-9-" + i0 + "," + ("7cd16330-8-" + i0),
-        d: common_vendor.o(($event) => item.score = $event, index),
-        e: common_vendor.p({
+        a: "7cd16330-8-" + i0 + "," + ("7cd16330-7-" + i0),
+        b: common_vendor.t(index + 1 + "." + item.label),
+        c: common_vendor.t(item.minScore == null || item.maxScore == null ? "" : item.minScore + "-" + item.maxScore),
+        d: "7cd16330-10-" + i0 + "," + ("7cd16330-9-" + i0),
+        e: common_vendor.o(($event) => item.score = $event, index),
+        f: common_vendor.p({
           suffixIcon: "star-filled",
           type: "number",
           trim: "all",
           placeholder: "请输入该项分数",
           modelValue: item.score
         }),
-        f: "7cd16330-8-" + i0 + "," + ("7cd16330-6-" + i0),
-        g: "7cd16330-6-" + i0 + "," + ("7cd16330-5-" + i0),
-        h: index,
-        i: "7cd16330-5-" + i0 + ",7cd16330-2"
+        g: "7cd16330-9-" + i0 + "," + ("7cd16330-7-" + i0),
+        h: "7cd16330-7-" + i0 + "," + ("7cd16330-6-" + i0),
+        i: index,
+        j: "7cd16330-6-" + i0 + ",7cd16330-3"
       };
     }),
-    h: common_vendor.p({
+    i: common_vendor.p({
       type: "help-filled",
       size: "20",
       color: "green"
     }),
-    i: common_vendor.p({
+    j: common_vendor.p({
       name: "score"
     }),
-    j: common_vendor.p({
+    k: common_vendor.p({
       ["is-shadow"]: true,
       margin: "5px"
     }),
-    k: common_vendor.sr("form", "7cd16330-2"),
-    l: common_vendor.p({
+    l: common_vendor.sr("form", "7cd16330-3"),
+    m: common_vendor.p({
       modelValue: $data.formData
     }),
-    m: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
-    n: common_vendor.o(_ctx.dialogClose),
-    o: common_vendor.p({
+    n: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
+    o: common_vendor.o(_ctx.dialogClose),
+    p: common_vendor.p({
       type: $data.msgType,
       cancelText: "关闭",
       title: "提示",
       content: $data.content
     }),
-    p: common_vendor.sr("alertDialog", "7cd16330-10"),
-    q: common_vendor.p({
+    q: common_vendor.sr("alertDialog", "7cd16330-11"),
+    r: common_vendor.p({
       type: "dialog"
     })
   } : {});

+ 1 - 0
unpackage/dist/dev/mp-weixin/pages/index/index.json

@@ -2,6 +2,7 @@
   "navigationBarTitleText": "评分问卷",
   "usingComponents": {
     "uni-title": "../../uni_modules/uni-title/components/uni-title/uni-title",
+    "uni-notice-bar": "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar",
     "uni-easyinput": "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput",
     "uni-forms-item": "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item",
     "uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml


+ 202 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.js

@@ -0,0 +1,202 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const _sfc_main = {
+  name: "UniNoticeBar",
+  emits: ["click", "getmore", "close"],
+  props: {
+    text: {
+      type: String,
+      default: ""
+    },
+    moreText: {
+      type: String,
+      default: ""
+    },
+    backgroundColor: {
+      type: String,
+      default: "#FFF9EA"
+    },
+    speed: {
+      // 默认1s滚动100px
+      type: Number,
+      default: 100
+    },
+    color: {
+      type: String,
+      default: "#FF9A43"
+    },
+    fontSize: {
+      type: Number,
+      default: 14
+    },
+    moreColor: {
+      type: String,
+      default: "#FF9A43"
+    },
+    single: {
+      // 是否单行
+      type: [Boolean, String],
+      default: false
+    },
+    scrollable: {
+      // 是否滚动,添加后控制单行效果取消
+      type: [Boolean, String],
+      default: false
+    },
+    showIcon: {
+      // 是否显示左侧icon
+      type: [Boolean, String],
+      default: false
+    },
+    showGetMore: {
+      // 是否显示右侧查看更多
+      type: [Boolean, String],
+      default: false
+    },
+    showClose: {
+      // 是否显示左侧关闭按钮
+      type: [Boolean, String],
+      default: false
+    }
+  },
+  data() {
+    const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
+    const elIdBox = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
+    return {
+      textWidth: 0,
+      boxWidth: 0,
+      wrapWidth: "",
+      webviewHide: false,
+      elId,
+      elIdBox,
+      show: true,
+      animationDuration: "none",
+      animationPlayState: "paused",
+      animationDelay: "0s"
+    };
+  },
+  computed: {
+    isShowGetMore() {
+      return this.showGetMore === true || this.showGetMore === "true";
+    },
+    isShowClose() {
+      return (this.showClose === true || this.showClose === "true") && (this.showGetMore === false || this.showGetMore === "false");
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.initSize();
+    });
+  },
+  methods: {
+    initSize() {
+      if (this.scrollable) {
+        let query = [];
+        let textQuery = new Promise((resolve, reject) => {
+          common_vendor.index.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
+            this.textWidth = ret[0].width;
+            resolve();
+          });
+        });
+        let boxQuery = new Promise((resolve, reject) => {
+          common_vendor.index.createSelectorQuery().in(this).select(`#${this.elIdBox}`).boundingClientRect().exec((ret) => {
+            this.boxWidth = ret[0].width;
+            resolve();
+          });
+        });
+        query.push(textQuery);
+        query.push(boxQuery);
+        Promise.all(query).then(() => {
+          this.animationDuration = `${this.textWidth / this.speed}s`;
+          this.animationDelay = `-${this.boxWidth / this.speed}s`;
+          setTimeout(() => {
+            this.animationPlayState = "running";
+          }, 1e3);
+        });
+      }
+    },
+    loopAnimation() {
+    },
+    clickMore() {
+      this.$emit("getmore");
+    },
+    close() {
+      this.show = false;
+      this.$emit("close");
+    },
+    onClick() {
+      this.$emit("click");
+    }
+  }
+};
+if (!Array) {
+  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
+  _easycom_uni_icons2();
+}
+const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
+if (!Math) {
+  _easycom_uni_icons();
+}
+function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
+  return common_vendor.e({
+    a: $data.show
+  }, $data.show ? common_vendor.e({
+    b: $props.showIcon === true || $props.showIcon === "true"
+  }, $props.showIcon === true || $props.showIcon === "true" ? {
+    c: common_vendor.p({
+      type: "sound",
+      color: $props.color,
+      size: $props.fontSize * 1.5
+    })
+  } : {}, {
+    d: common_vendor.t($props.text),
+    e: $data.elId,
+    f: $props.scrollable ? 1 : "",
+    g: !$props.scrollable && ($props.single || $props.showGetMore) ? 1 : "",
+    h: $props.color,
+    i: $props.fontSize + "px",
+    j: $props.fontSize * 1.5 + "px",
+    k: $data.wrapWidth + "px",
+    l: $data.animationDuration,
+    m: $data.animationDuration,
+    n: $data.webviewHide ? "paused" : $data.animationPlayState,
+    o: $data.webviewHide ? "paused" : $data.animationPlayState,
+    p: $data.animationDelay,
+    q: $data.animationDelay,
+    r: $data.elIdBox,
+    s: $props.scrollable ? 1 : "",
+    t: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
+    v: $props.scrollable ? 1 : "",
+    w: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
+    x: $props.scrollable ? $props.fontSize * 1.5 + "px" : "auto",
+    y: $options.isShowGetMore
+  }, $options.isShowGetMore ? common_vendor.e({
+    z: $props.moreText.length > 0
+  }, $props.moreText.length > 0 ? {
+    A: common_vendor.t($props.moreText),
+    B: $props.moreColor,
+    C: $props.fontSize + "px"
+  } : {
+    D: common_vendor.p({
+      type: "right",
+      color: $props.moreColor,
+      size: $props.fontSize * 1.1
+    })
+  }, {
+    E: common_vendor.o((...args) => $options.clickMore && $options.clickMore(...args))
+  }) : {}, {
+    F: $options.isShowClose
+  }, $options.isShowClose ? {
+    G: common_vendor.o($options.close),
+    H: common_vendor.p({
+      type: "closeempty",
+      color: $props.color,
+      size: $props.fontSize * 1.1
+    })
+  } : {}, {
+    I: $props.backgroundColor,
+    J: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
+  }) : {});
+}
+const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c3453ea3"], ["__file", "F:/development/HbuildWorkspace/KPS/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue"]]);
+wx.createComponent(Component);

+ 6 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
+  }
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.wxml


+ 101 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.wxss

@@ -0,0 +1,101 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+/* 颜色变量 */
+/* 行为相关颜色 */
+/* 文字基本颜色 */
+/* 背景颜色 */
+/* 边框颜色 */
+/* 尺寸变量 */
+/* 文字尺寸 */
+/* 图片尺寸 */
+/* Border Radius */
+/* 水平间距 */
+/* 垂直间距 */
+/* 透明度 */
+/* 文章场景相关 */
+.uni-noticebar.data-v-c3453ea3 {
+  display: flex;
+  width: 100%;
+  box-sizing: border-box;
+  flex-direction: row;
+  align-items: center;
+  padding: 10px 12px;
+  margin-bottom: 10px;
+}
+.uni-noticebar-close.data-v-c3453ea3 {
+  margin-left: 8px;
+  margin-right: 5px;
+}
+.uni-noticebar-icon.data-v-c3453ea3 {
+  margin-right: 5px;
+}
+.uni-noticebar__content-wrapper.data-v-c3453ea3 {
+  flex: 1;
+  flex-direction: column;
+  overflow: hidden;
+}
+.uni-noticebar__content-wrapper--single.data-v-c3453ea3 {
+  line-height: 18px;
+}
+.uni-noticebar__content-wrapper--single.data-v-c3453ea3,
+.uni-noticebar__content-wrapper--scrollable.data-v-c3453ea3 {
+  flex-direction: row;
+}
+.uni-noticebar__content-wrapper--scrollable.data-v-c3453ea3 {
+  position: relative;
+}
+.uni-noticebar__content--scrollable.data-v-c3453ea3 {
+  flex: 1;
+  display: block;
+  overflow: hidden;
+}
+.uni-noticebar__content--single.data-v-c3453ea3 {
+  display: flex;
+  flex: none;
+  width: 100%;
+  justify-content: center;
+}
+.uni-noticebar__content-text.data-v-c3453ea3 {
+  font-size: 14px;
+  line-height: 18px;
+  word-break: break-all;
+}
+.uni-noticebar__content-text--single.data-v-c3453ea3 {
+  display: block;
+  width: 100%;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.uni-noticebar__content-text--scrollable.data-v-c3453ea3 {
+  position: absolute;
+  display: block;
+  height: 18px;
+  line-height: 18px;
+  white-space: nowrap;
+  padding-left: 100%;
+  animation: notice-c3453ea3 10s 0s linear infinite both;
+  animation-play-state: paused;
+}
+.uni-noticebar__more.data-v-c3453ea3 {
+  display: inline-flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  padding-left: 5px;
+}
+@keyframes notice-c3453ea3 {
+100% {
+    transform: translate3d(-100%, 0, 0);
+}
+}