lex-xin 3 years ago
parent
commit
21efec8854

BIN
src/assets/images/icon_phone.png


+ 1 - 1
src/router/auditionRouter.js

@@ -60,7 +60,7 @@ let auditionRouter = [
         name: 'arrangeWork',
         component: () => import(/* webpackChunkName:'ArrangeWork'*/'@/views/audition/ArrangeWork.vue'),
         meta: {
-            descrition: '布置作业',
+            descrition: '布置训练',
             weight: 4 // 页面权重
         }
     }

+ 135 - 5
src/views/audition/ArrangeWork.vue

@@ -37,7 +37,10 @@
       <van-tab v-for="(item, i) in params.subjectList" :title="item.subjectName" :name="item.id" :key="i" class="van-hairline--bottom">
         <van-cell class="endTime" v-for="(music, index) in item.musicScoreIdList" :key="index" style="margin-top: 0;" title="训练曲目" @click="onSelectAccompany(item, index)" readonly is-link placeholder="请选择训练曲目" >
           <template #default>
-            {{ music.name }}
+            <template v-if="music.name">
+              {{ music.name }}
+            </template>
+            <span v-else style="color: #808080;">请选择</span>
           </template>
         </van-cell>
         <div class="addAccompaniment" v-if="item.musicScoreIdList.length < 3" @click="addCloud(item)">
@@ -69,6 +72,55 @@
       </van-sticky>
       <accompaniment-modal isHead @onSelectMusic="onSelectMusic" :searchSubjectId="tabActive" />
     </van-popup>
+
+    <van-popup
+      v-model="studentStatus"
+      :lock-scroll="true"
+      position="bottom"
+      :style="{ height: '180%' }"
+    >
+      <van-sticky>
+        <van-search
+          show-action
+          shape="round"
+          :left-icon="searchIcon"
+          @search="onSearch"
+          v-model="params.search"
+          placeholder="请输入学生名或手机号"
+        >
+          <template #action>
+            <div @click="onSearch">搜索</div>
+          </template>
+        </van-search>
+      </van-sticky>
+      <div class="paddingB80">
+        <van-cell-group v-if="dataShow">
+          <van-cell
+            v-for="(item, index) in dataList"
+            :key="index"
+            class="input-cell"
+            :center="true"
+          >
+            <template slot="icon">
+              <img class="logo" v-if="item.avatar" :src="item.avatar" alt="" />
+              <img class="logo" v-else src="@/assets/images/icon_student.png" alt="" />
+            </template>
+            <template slot="title">
+              <div class="studentName">
+                {{ item.userName }}
+              </div>
+            </template>
+            <template slot="label">
+              <span>{{ (item.phone) }}</span>
+            </template>
+          </van-cell>
+        </van-cell-group>
+        <m-empty class="empty" v-else key="data" />
+      </div>
+      <div class="button-group-popup">
+        <span class="btn">取消</span>
+      </div>
+    </van-popup>
   </div>
 </template>
 <script>
@@ -118,8 +170,10 @@ export default {
         studentMemberCount: 0, // 学员会员数
         subjectIdList: [],
         subjectList: []
-      }
-
+      },
+      dataShow: true,
+      studentStatus: false,
+      dataList: [],
     };
   },
   async mounted() {
@@ -128,7 +182,7 @@ export default {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
       localStorage.setItem("userInfo", decodeURI(params.Authorization));
     }
-    document.title = '布置作业'
+    document.title = '布置训练'
     if(browser().android || browser().iPhone) {
       this.headerStatus = false
     }
@@ -136,6 +190,7 @@ export default {
       const result = res.data
       if(result.code != 200) { return }
       const tempData = result.data || []
+      this.dataList = tempData
       let params = {
         studentCount: tempData.length, // 学员总数
         studentMemberCount: 0, // 学员会员数
@@ -172,6 +227,7 @@ export default {
     })
   },
   methods: {
+
     onSelectAccompany(item, index) {
       this.accompanimentStatus = true
       this.tabActiveList = item
@@ -237,7 +293,7 @@ export default {
       if(notAccompanySong.length - subjectLength < 0 && notAccompanySong != 0) {
         console.log('选择曲目')
       }
-      
+
       this.$toast.loading({
         message: '加载中...',
         duration: 10000,
@@ -377,4 +433,78 @@ export default {
   color: #666666;
 }
 
+.paddingB80 {
+  padding-bottom: 0.8rem;
+}
+.studentName {
+  font-size: 0.16rem;
+  color: #1a1a1a;
+  line-height: 0.22rem;
+}
+.studentContainer {
+  /deep/.van-cell__title {
+    font-size: 0.14rem;
+    color: @mFontColor;
+    // flex: 1 auto;
+  }
+
+  .logo {
+    width: 0.42rem;
+    height: 0.42rem;
+    margin-right: 0.12rem;
+    border-radius: 100%;
+  }
+
+  .input-cell {
+    padding: 0.2rem 0.16rem;
+
+    .van-radio {
+      justify-content: flex-end;
+    }
+  }
+
+  /deep/.van-cell__value {
+    height: 0.2rem;
+  }
+
+  /deep/.van-radio__icon .van-icon {
+    border-color: #d3d3d3;
+  }
+
+  /deep/.van-radio__icon--checked {
+    .van-icon {
+      border-color: @mColor;
+      background: @mColor;
+    }
+  }
+
+  .van-tag {
+    margin-left: 0.08rem;
+  }
+}
+.button-group-popup {
+  position: fixed;
+  bottom: 0;
+  padding: 0.2rem 0;
+  width: 100%;
+  text-align: center;
+  background-color: #ffffff;
+  .btn {
+    line-height: 0.5rem;
+    display: inline-block;
+    border: 1px solid @mColor;
+    width: 1.65rem;
+    border-radius: 0.4rem;
+    color: @mColor;
+    background: #fff;
+    font-size: 0.18rem;
+    &.primary {
+      color: #fff;
+      background: @mColor;
+    }
+  }
+  .btn + .btn {
+    margin-left: 0.1rem;
+  }
+}
 </style>

+ 1 - 0
src/views/trainStatistics/index.vue

@@ -142,6 +142,7 @@ export default {
                 query: {
                     userId: item.userId,
                     username: item.username,
+                    phone: item.phone,
                     musicGroupName: item.musicGroupName,
                     avatar: item.avatar
                 }

+ 29 - 3
src/views/visitManager/addVisit.vue

@@ -19,7 +19,11 @@
         input-align="right"
         :is-link="id || userId ? false : true"
         placeholder="请选择"
-      />
+      >
+        <template #right-icon>
+          <a v-if="studentPhone" @click.stop="() => {}" class="phone_section" :href="'tel:' + studentPhone"><img src="../../assets/images/icon_phone.png" class="iconPhone" alt=""></a>
+        </template>
+      </van-field>
       <van-field
         label="回访类型"
         @click="onChange('type')"
@@ -211,6 +215,7 @@ export default {
       id: query.id,
       name: query.name,
       userId: query.userId,
+      inside: query.inside || 0,
       dataForm: {
         // 时间下拉框
         status: false,
@@ -230,6 +235,7 @@ export default {
         data: [],
       },
       studentName: query.username || null,
+      studentPhone: query.phone || null,
       teacherName: null,
       form: {
         teacherId: null,
@@ -265,7 +271,7 @@ export default {
     if (browser().android || browser().iPhone) {
       this.statusList.headerStatus = false;
     }
-    document.title = this.name;
+    document.title = this.name || '新增回访记录';
     this.__init();
   },
   methods: {
@@ -299,6 +305,8 @@ export default {
           this.$toast(res.msg);
         }
       }
+
+
     },
     async onSubmit() {
       let form = this.form;
@@ -339,7 +347,9 @@ export default {
       if (result.code == 200) {
         this.$toast("添加成功");
         setTimeout(() => {
-          if(this.userId) {
+          if(this.inside) {
+            this.onAppBack()
+          } else if(this.userId) {
             const query = this.$route.query
             this.$router.replace({
               path: '/trainDetail',
@@ -357,6 +367,15 @@ export default {
         return;
       }
     },
+    onAppBack() {
+      if (browser().android) {
+        DAYA.postMessage(JSON.stringify({ api: "back" }));
+      } else if (browser().iPhone) {
+        window.webkit.messageHandlers.DAYA.postMessage(
+          JSON.stringify({ api: "back" })
+        );
+      }
+    },
     onCheckStudent() {
       if (this.id || this.userId) {
         return;
@@ -572,6 +591,13 @@ export default {
     margin-left: 0.08rem;
   }
 }
+/deep/.van-field__right-icon {
+  display: flex;
+}
+.iconPhone {
+  width: .17rem;
+  height: .21rem;
+}
 .paddingB80 {
   padding-bottom: 0.8rem;
 }