Explorar el Código

可输入下拉框调整

lifanagju_citu hace 2 meses
padre
commit
138681352d

+ 40 - 56
components/searchCombox/index.vue

@@ -101,12 +101,12 @@
       // 被选中的背景颜色
       // 被选中的背景颜色
       selectedBackground: {
       selectedBackground: {
         type: String,
         type: String,
-        default: '#e5e5e5',
+        default: '#daf3e6',
       },
       },
       // 被选中的字体颜色
       // 被选中的字体颜色
       selectedColor: {
       selectedColor: {
         type: String,
         type: String,
-        default: '#3774c6',
+        default: '#00B760',
       },
       },
 			// #endif
 			// #endif
 		},
 		},
@@ -184,11 +184,6 @@
 			onBlur() {
 			onBlur() {
 				setTimeout(() => {
 				setTimeout(() => {
 					this.showSelector = false
 					this.showSelector = false
-					//输入后赋值
-					// if (this.inputVal) {
-					// 	this.$emit('input', this.inputVal)
-					// 	this.$emit('update:modelValue', this.inputVal)
-					// }
           this.$emit('onBlur')
           this.$emit('onBlur')
 				}, 153)
 				}, 153)
 			},
 			},
@@ -222,11 +217,12 @@
 					}
 					}
 				})
 				})
 			},
 			},
-			getOnInputValueObj() {
-        return { [this.itemTextName]: this.inputVal, [this.itemValueName]: null }
-			},
 			getOnInputValue() {
 			getOnInputValue() {
         return this.inputVal
         return this.inputVal
+			},
+			getValue() {
+				if (this.inputVal === this.dictVal) return { [this.itemTextName]: this.inputVal, [this.itemValueName]: null }
+				else return { [this.itemTextName]: null, [this.itemValueName]: this.dictVal }
 			}
 			}
 		}
 		}
 	}
 	}
@@ -234,33 +230,29 @@
 
 
 <style lang="scss">
 <style lang="scss">
 	.uni-combox {
 	.uni-combox {
-		font-weight: 300;
-		font-size: 28upx;
-		background-color: #fff;
-		// border: #e5e5e5 solid 2upx;
-		border: 1px solid #e5e5e5;
-		border-radius: 5px;
-		padding: 0 10px;
 		position: relative;
 		position: relative;
 		display: flex;
 		display: flex;
-		height: 35px;
 		flex-direction: row;
 		flex-direction: row;
 		align-items: center;
 		align-items: center;
-		// border-bottom: solid 1px #DDDDDD;
+		min-height: 70rpx;
+		// width: 100%;
+		padding: 0 15rpx 0 20rpx;
+  	font-size: 28rpx;
+		border: 1px solid #e5e5e5;
+		border-radius: 8rpx;
+		// background-color: #fff;
 	}
 	}
 
 
 	.uni-combox__label {
 	.uni-combox__label {
-		font-size: 16px;
-		line-height: 22px;
-		padding-right: 10px;
+		padding-right: 10rpx;
 		color: #999999;
 		color: #999999;
+		font-size: 32rpx;
+		line-height: 44rpx;
 	}
 	}
 
 
 	.uni-combox__input-box {
 	.uni-combox__input-box {
 		position: relative;
 		position: relative;
-		/* #ifndef APP-NVUE */
 		display: flex;
 		display: flex;
-		/* #endif */
 		flex: 1;
 		flex: 1;
 		flex-direction: row;
 		flex-direction: row;
 		align-items: center;
 		align-items: center;
@@ -268,62 +260,54 @@
 
 
 	.uni-combox__input {
 	.uni-combox__input {
 		flex: 1;
 		flex: 1;
-		font-size: 14px;
-		// height: 22px;
-		// line-height: 22px;
+		height: 44rpx;
+		font-size: 28rpx;
+		line-height: 44rpx;
 	}
 	}
 
 
 	.uni-combox__input-plac {
 	.uni-combox__input-plac {
-		font-size: 13px;
-		color: grey;
-		font-weight: 300;
+		color: #999;
+		font-size: 12px;
 	}
 	}
 
 
 	.uni-combox__selector {
 	.uni-combox__selector {
-		/* #ifndef APP-NVUE */
-		box-sizing: border-box;
-		/* #endif */
 		position: absolute;
 		position: absolute;
 		top: calc(100% + 12px);
 		top: calc(100% + 12px);
 		left: 0;
 		left: 0;
+		z-index: 999;
+		box-sizing: border-box;
 		width: 100%;
 		width: 100%;
+		padding: 8rpx 0;
 		background-color: #FFFFFF;
 		background-color: #FFFFFF;
-		border: 1px solid #EBEEF5;
-		border-radius: 6px;
+		border: 1px solid #ebeef5;
+		border-radius: 12rpx;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-		z-index: 999;
-		padding: 4px 0;
 	}
 	}
 
 
 	.uni-combox__selector-scroll {
 	.uni-combox__selector-scroll {
-		/* #ifndef APP-NVUE */
-		max-height: 200px;
+		max-height: 300rpx;
 		box-sizing: border-box;
 		box-sizing: border-box;
-		/* #endif */
 	}
 	}
 
 
 	.uni-combox__selector-empty,
 	.uni-combox__selector-empty,
 	.uni-combox__selector-item {
 	.uni-combox__selector-item {
-		/* #ifndef APP-NVUE */
 		display: flex;
 		display: flex;
-		cursor: pointer;
-		/* #endif */
-		line-height: 36px;
-		font-size: 28upx;
+		padding: 0px 0px;
+		// padding: 0px 10px;
+		font-size: 14px;
+  	line-height: 70rpx;
+		text-indent: 1rem;
 		text-align: center;
 		text-align: center;
-		// border-bottom: solid 1px #DDDDDD;
-		padding: 0px 10px;
+		cursor: pointer;
 	}
 	}
 
 
 	.uni-combox__selector-item:hover {
 	.uni-combox__selector-item:hover {
-		background-color: #f9f9f9;
+		background-color: #e5e5e5;
 	}
 	}
 
 
 	.uni-combox__selector-empty:last-child,
 	.uni-combox__selector-empty:last-child,
 	.uni-combox__selector-item:last-child {
 	.uni-combox__selector-item:last-child {
-		/* #ifndef APP-NVUE */
 		border-bottom: none;
 		border-bottom: none;
-		/* #endif */
 	}
 	}
 
 
 	// picker 弹出层通用的指示小三角
 	// picker 弹出层通用的指示小三角
@@ -335,22 +319,22 @@
 		height: 0;
 		height: 0;
 		border-color: transparent;
 		border-color: transparent;
 		border-style: solid;
 		border-style: solid;
-		border-width: 6px;
+		border-width: 12rpx;
 	}
 	}
 
 
 	.uni-popper__arrow {
 	.uni-popper__arrow {
-		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
-		top: -6px;
+		top: -12rpx;
 		left: 10%;
 		left: 10%;
 		margin-right: 3px;
 		margin-right: 3px;
 		border-top-width: 0;
 		border-top-width: 0;
-		border-bottom-color: #EBEEF5;
+		border-bottom-color: #ebeef5;
+		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
 	}
 	}
 
 
 	.uni-popper__arrow::after {
 	.uni-popper__arrow::after {
 		content: " ";
 		content: " ";
-		top: 1px;
-		margin-left: -6px;
+		top: 2rpx;
+		margin-left: -12rpx;
 		border-top-width: 0;
 		border-top-width: 0;
 		border-bottom-color: #fff;
 		border-bottom-color: #fff;
 	}
 	}

+ 2 - 5
layout/components/authModal/selectUserType/studentInfoForm.vue

@@ -256,11 +256,8 @@ const submit = async () => {
   
   
   let params = {...formData.value}
   let params = {...formData.value}
 
 
-  const schoolClassInput = schoolClassIdRef.value?.getOnInputValue()
-  const schoolClassObj = schoolClassIdRef.value?.getOnInputValueObj()
-  if (schoolClassInput === params.schoolClassId) {
-    params = {...params, ...schoolClassObj}
-  }
+  const schoolClassObj = schoolClassIdRef.value?.getValue()
+  params = {...params, ...schoolClassObj}
 
 
   try {
   try {
     await saveStudentSimpleInfo(params)
     await saveStudentSimpleInfo(params)

+ 1 - 1
pages/index/my.vue

@@ -89,7 +89,7 @@ onShow(() => {
     currentTabBar?.setData({ selected: 4 });
     currentTabBar?.setData({ selected: 4 });
 })
 })
 
 
-// showAuthModal('selectUserType') //测试 selectUserType
+// showAuthModal('') //测试 selectUserType
 
 
 const inputDialog = ref()
 const inputDialog = ref()
 const useUserStore = userStore()
 const useUserStore = userStore()

+ 96 - 154
pagesA/student/certificateDetail.vue

@@ -1,174 +1,116 @@
+<!-- 分享招聘会 -->
 <template>
 <template>
-	<view v-if="itemData" style="width: 100vw;height: 100vh;overflow: auto;">
-		<view class="cer-img">
-      <image src="https://minio.citupro.com/dev/static/bgc.jpg" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
-      <view class="cer-introduce">
-				兹有
-				<span class="cer-text">{{ itemData?.student?.schoolName }}</span>
-        <span class="cer-text">{{ itemData?.student?.majorName }}</span>
-        专业<span class="cer-text">{{ itemData?.person?.name }}</span>
-        同学于<span class="cer-text">{{ itemData?.startTime ? timesTampChange(itemData?.startTime, 'Y-M-D') : '' }}</span>
-        至<span class="cer-text">{{ itemData?.endTime ? timesTampChange(itemData?.endTime, 'Y-M-D') : '' }}</span>
-        在<span class="cer-text">{{ formatName(itemData?.enterprise?.anotherName || itemData?.enterprise?.name) }}</span>
-        实习。
-			</view>
-			<view class="cer-comment">{{ itemData?.evaluate }}</view>
-			<view class="cer-prove">特此证明。</view>
-			<view class="cer-end">
-        <view>{{ itemData?.createTime ? timesTampChange(itemData?.createTime, 'Y-M-D') : '' }}</view>
-      </view>
-		</view>
-
-		<view class="bottom-sticky">
-      <view style="display: flex;justify-content: space-evenly;align-itens: center;width: 100%;margin: 20rpx 0;">
-        <!-- <view @click="shareClick" style="display: flex;justify-content: center;flex-direction: column;align-items: center;">
-          <uni-icons type="redo-filled" size="24" color="#00B760"/>
-          <span style="color:#00B760;font-weight:bold;">分享</span>
-        </view> -->
-        <button v-if="itemData?.certificate" type="primary" size="default" class="buttons" @click="viewReport(itemData)">查看附件</button>
-        <button v-else type="primary" size="default" class="buttons" style="background-color:grey;">查看附件</button>
-      </view>
+  <view style="position: relative;">
+    <view v-if="shareUrl" class="d-flex align-center flex-column justify-center" style="height: 100vh;">
+      <image v-if="!!shareUrl" :style="imgStyle" @click="handlePreviewSharePoster" :src="shareUrl" :show-menu-by-longpress="true"></image>
+      <view class="color-999 ss-m-t-20 font-size-14 ss-m-b-50">点击图片预览,长按图片保存</view>
     </view>
     </view>
-	</view>
+		<canvas canvas-id="posterCanvas" class="shareCanvas" :style="`width: ${canvasWidth}px; height: ${canvasHeight}px;`"></canvas>
+  </view>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref } from 'vue'
-import { preview } from '@/utils/preview'
+import { ref, computed } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 import { timesTampChange } from '@/utils/date'
 import { timesTampChange } from '@/utils/date'
 import { formatName } from '@/utils/getText'
 import { formatName } from '@/utils/getText'
 
 
+const canvasWidth = 500
+const canvasHeight = 700
+
+const shareUrl = ref('')
+const windowWidth = ref(0)
+
 const itemData = ref(null)
 const itemData = ref(null)
-onLoad((options) => {
-  if (options.itemData) itemData.value = JSON.parse(options.itemData)
+onLoad(async (options) => {
+  if (options.itemData) {
+    itemData.value = JSON.parse(options.itemData)
+    createPoster()
+  }
+  const windowInfo = wx.getWindowInfo()
+  windowWidth.value = windowInfo.windowWidth
+})
+
+const imgStyle = computed(() => {
+  if (windowWidth.value <= 320) return `width: 259px; height: ${Math.round((canvasHeight*259)/canvasWidth)}px;`
+  if (windowWidth.value > 320 && windowWidth.value <= 375) return `width: 313px; height: ${Math.round((canvasHeight*313)/canvasWidth)}px;`
+  if (windowWidth.value > 375) return `width: 328px; height: ${Math.round((canvasHeight*328)/canvasWidth)}px;`
 })
 })
 
 
-const viewReport = (item) => {
-	if (!item.certificate) {
-		uni.showToast({
-      title: '加载失败,请稍后重试',
-      icon: 'none',
-      duration: 2000
+// 图片预览
+const handlePreviewSharePoster = () => {
+	uni.previewImage({
+		current: 0,
+		longPressActions: {
+			itemList: ['发送给朋友', '保存图片', '收藏']
+		},
+		urls: [shareUrl.value]
+	})
+}
+
+const getImageTempRatio = (url) => {
+  return new Promise((req, rej)=>{
+    wx.getImageInfo({
+      src:url,
+      success:(res) =>{
+        req(res)
+      }
     })
     })
-		return
-	}
-	preview(item.certificate)
+  })
 }
 }
 
 
-// 分享按钮点击事件
-// const shareClick = () => {
-// }
+const createPoster = async () => {
+  uni.showLoading({ title: '生成中...', mask: true })
+  var ctx = uni.createCanvasContext('posterCanvas')
+  //清空画布
+  ctx.clearRect(0, 0, canvasWidth, canvasHeight)
 
 
-</script>
+  //背景图片
+  const { path: bgUrl } = await getImageTempRatio('https://minio.citupro.com/dev/static/bgc.jpg')
+  ctx.drawImage(bgUrl, 0, 0, canvasWidth, canvasHeight) // 路径、x、y、宽、高
+  
+  const info = { ...itemData.value }
+  // 绘制文字内容
+  ctx.setFontSize(16)
+  if (info?.student?.schoolName) ctx.fillText(info.student.schoolName, 50, 130)
+  if (info?.student?.majorName) ctx.fillText(info.student.majorName, 50, 160)
+  if (info?.person?.name) ctx.fillText(info.person.name, 50, 190)
+  if (info?.startTime) ctx.fillText(timesTampChange(info.startTime, 'Y-M-D'), 50, 250)
+  if (info?.endTime) ctx.fillText(timesTampChange(info?.endTime, 'Y-M-D'), 50, 310)
+  if (info?.enterprise?.anotherName || info?.enterprise?.name) ctx.fillText(formatName(info.enterprise?.anotherName || info.enterprise.name), 50, 400)
+  if (info?.evaluate) ctx.fillText(info.evaluate, 20, 460)
+  if (info?.createTime) ctx.fillText(timesTampChange(info?.createTime, 'Y-M-D'), 200, 520)
 
 
-<style lang="less" scoped>
-.cer-img{
-  width: 100vw;
-  height: 89.5vh;
-  position: relative;
-  font-weight: 600;
-}
-.cer-introduce{
-  width: 70%;
-  position: absolute;
-  top: 51%;
-  left: 50%;
-  transform: translate(-50%,-50%);
-  text-indent: 2em;
-	font-weight: 500;
-}
-.cer-text{
-  text-decoration: underline;
-  margin: 0 3px;
-	font-weight: 700;
-}
-.cer-comment{
-	width: 70%;
-  position: absolute;
-  top: 68%;
-  left: 50%;
-  transform: translate(-50%,-50%);
-	text-indent: 2em;
-	display: -webkit-box;
-	-webkit-box-orient: vertical;
-	-webkit-line-clamp: 3;
-	overflow: hidden;
-	text-overflow: ellipsis;
-	font-weight: 500;
-}
-.cer-prove{
-  width: 70%;
-  position: absolute;
-  top: 82%;
-  left: 50%;
-  transform: translate(-50%,-50%);
-  text-indent: 2em;
-	font-weight: 500;
-}
-.cer-end{
-  position: absolute;
-  top: 87%;
-  right: 16%;
-	font-weight: 500;
-}
-button::after{
-	border:none;
-}
-.pop-btn-wrapper{
-	position: relative;
-	margin-top: 15vh;
-	.pop-confirm{
-		background-color: #fff;
-		color: #4b9afd;
-		font-size: 21px;
-		width: 45vw;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-	}
-	.pop-cancel{
-		background-color: #fff;
-		font-size: 21px;
-		width: 45vw;
-		position: absolute;
-		bottom: 0;
-		right: 0;
-	}
-}
-.buttons{
-  width: 70vw;
-  height: 44px;
-  border-radius: 25px;
-  background-color: #00B760;
-  margin: 0;
+  ctx.font = 'bold';
+  ctx.fillText('兹有', 20, 100)
+  ctx.fillText('同学于', 20, 220)
+  ctx.fillText('至', 20, 280)
+  ctx.fillText('在', 20, 340)
+  ctx.fillText('实习。', 20, 430)
+  ctx.fillText('特此证明。', 20, 490)
+
+  ctx.draw(false, () =>{
+    wx.canvasToTempFilePath({ 
+      canvasId: 'posterCanvas',
+      success:(res)=>{
+        shareUrl.value = res.tempFilePath
+        console.log('canvas-success', shareUrl.value)
+        uni.hideLoading({})
+      },
+      fail:(err)=>{
+        uni.hideLoading({})
+        console.log('canvas-fail', err)
+      }
+    })
+  })
 }
 }
+</script>
 
 
-.share-pop {
-  width: 100%;
-  // height:300rpx;
-  display: flex;
-  justify-content: center;
-  .f-straight {
-    margin: 40rpx;
-    background: unset;
-    &::after{
-      border:none !important;
-    }
-  }
-  .share-round {
-    border-radius:50%;
-    height:100rpx;
-    width:100rpx;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
-  .share-round-1 {
-    background-color:#22a039;
-  }
-  .share-round-2 {
-    background-color:#3693cd;
-  }
+<style scoped lang="scss">
+.shareCanvas {
+	position: fixed;
+	top: -99999upx;
+	left: -99999upx;
+	z-index: -99999;
 }
 }
-</style>
+</style>

+ 3 - 5
pagesA/student/information.vue

@@ -149,11 +149,9 @@ const submit = async () => {
   if (!validate) return uni.showToast({ title: '请将信息补充完整', icon: 'none' })
   if (!validate) return uni.showToast({ title: '请将信息补充完整', icon: 'none' })
   let params = {...formData.value}
   let params = {...formData.value}
 
 
-  const schoolClassInput = schoolClassIdRef.value?.getOnInputValue()
-  const schoolClassObj = schoolClassIdRef.value?.getOnInputValueObj()
-  if (schoolClassInput === params.schoolClassId) {
-    params = {...params, ...schoolClassObj}
-  }
+  const schoolClassObj = schoolClassIdRef.value?.getValue()
+  params = { ...params, ...schoolClassObj }
+
   try {
   try {
     await saveStudentSimpleInfo(params)
     await saveStudentSimpleInfo(params)
     uni.showToast({
     uni.showToast({