Просмотр исходного кода

feat: ✨ 员工教练新增头像功能

zhangtao 3 недель назад
Родитель
Сommit
2c934b02c6

+ 6 - 1
src/components/classItem/index.vue

@@ -14,7 +14,7 @@
       </view>
       <commonbtn
         bg-color="#0074FF"
-        @click="handleGoPath(`/subPack/selectClass/index?id=${item.id}`)"
+        @click="handlePic(String(item.id))"
         v-if="type == 0 && showBtn"
         >拍照核销</commonbtn
       >
@@ -88,6 +88,11 @@ function handleGoPath(url: string) {
     url,
   });
 }
+function handlePic(id: string) {
+  if (props.item?.unwrittenOffNum == 0)
+    return uni.showToast({ title: "全部学生已核销" });
+  handleGoPath(`/subPack/selectClass/index?id=${id}`);
+}
 </script>
 
 <style scoped></style>

+ 2 - 1
src/config/index.ts

@@ -8,7 +8,8 @@ const mapEnvVersion = {
   /**
    * 	体验版
    */
-  trial: "",
+  trial: "http://192.168.1.166:8080/jeecg-boot",
+  // trial: "http://192.168.0.11:8080/jeecg-boot",
   /**
    * 正式版
    */

+ 25 - 0
src/subPack/EmployeeListAdd/index.vue

@@ -221,6 +221,30 @@
             ></upload>
           </wd-cell>
         </customFormItem>
+        <customFormItem label="头像" :required="isShowInstructor" bg="#fff">
+          <wd-cell
+            vertical
+            :rules="[
+              {
+                required: isShowInstructor,
+                message: '请上传头像',
+                validator(value, rule) {
+                  return isShowInstructor ? value.length > 0 : true;
+                },
+              },
+            ]"
+            prop="avatar"
+          >
+            <upload
+              tip="单张照片,不超过5MB"
+              :max-size="5242880"
+              :sourceType="['camera']"
+              v-model:file-list-custom="formData.avatar"
+              accept="image"
+              :limit="1"
+            ></upload>
+          </wd-cell>
+        </customFormItem>
         <customFormItem label="教学理念" v-if="isShowInstructor" required>
           <wd-input
             type="text"
@@ -329,6 +353,7 @@ let formData = reactive<any>({
   healthy: [],
   honor: [],
   realname: "",
+  avatar: "",
 });
 const type = ref(0);
 const treeFlage = ref(false);

+ 6 - 5
src/subPack/Evaluation/index.vue

@@ -36,12 +36,13 @@
           <view class="flex items-center justify-between mt-2">
             <view class="flex items-center text-24rpx">
               <image
-                src="https://pic1.arkoo.com/56D0B40F99F841DF8A2425762AE2565D/picture/o_1i4qop009177v1tgf14db15he1iaj1is.jpg"
-                class="w-60rpx h-60rpx rounded-full"
+                :src="item.avatar"
+                class="w-60rpx h-60rpx rounded-full min-w-60rpx"
               ></image>
-              <view class="ml-20rpx text-[rgba(0,0,0,0.9)]">{{
-                item.username
-              }}</view>
+              <view
+                class="ml-20rpx text-[rgba(0,0,0,0.9)] truncate max-w-200rpx"
+                >{{ item.username }}</view
+              >
               <view class="ml-20rpx text-[rgba(0,0,0,0.3)]">{{
                 dayjs(item.createTime).format("YYYY-MM-DD")
               }}</view>