Ver Fonte

多语言

guanchunjie há 3 anos atrás
pai
commit
21bb8ca603

+ 1 - 3
src/components/Personalcenter/Mycollect.vue

@@ -564,7 +564,6 @@ export default {
           .coverUrl {
             width: 88px;
             height: 88px;
-            margin-right: 24px;
             border-radius: 4px;
             display: flex;
             justify-content: center;
@@ -578,7 +577,6 @@ export default {
             width: 528px;
             display: flex;
             flex-direction: column;
-
             align-items: flex-start;
             .name {
               font-weight: normal;
@@ -752,7 +750,7 @@ export default {
 .OrderManage {
   .el-menu.el-menu--horizontal {
     border: 0;
-    padding: 0 32px;
+    padding: 0;
   }
   .el-menu--horizontal > .el-menu-item {
     height: 44px;

+ 0 - 1
src/components/Personalcenter/Mytextbook.vue

@@ -232,7 +232,6 @@ export default {
         -webkit-line-clamp: 2;
         text-overflow: ellipsis;
         overflow: hidden;
-        text-align: left;
       }
     }
   }

+ 26 - 7
src/components/Personalcenter/OrderManage.vue

@@ -58,11 +58,23 @@
             <div class="main-content-middle">
               <div class="middle-con">
                 <span class="middle-con-text">原价</span>
-                <span class="middle-con-p1">¥{{ item.price }}</span>
+                <span
+                  :class="[
+                    'middle-con-p1',
+                    language_type == 'AR' ? 'textLeft' : '',
+                  ]"
+                  >¥{{ item.price }}</span
+                >
               </div>
               <div class="middle-con middle-con-discount">
                 <span class="middle-con-text">折扣 </span>
-                <span class="middle-con-p1">¥{{ item.discount_money }}</span>
+                <span
+                  :class="[
+                    'middle-con-p1',
+                    language_type == 'AR' ? 'textLeft' : '',
+                  ]"
+                  >¥{{ item.discount_money }}</span
+                >
                 <template v-if="item.discount_code">
                   <el-tooltip
                     class="item"
@@ -188,6 +200,8 @@ import Goodstype from "../common/Goodstype.vue";
 import Confirmorder from "../common/Confirmorder.vue";
 import Payment from "../common/Payment.vue";
 
+import { mapGetters } from "vuex";
+
 export default {
   components: { EditTitle, Empty, Goodstype, Confirmorder, Payment },
   props: {},
@@ -233,7 +247,9 @@ export default {
     };
   },
   //计算属性 类似于data概念
-  computed: {},
+  computed: {
+    ...mapGetters(["language_type"]),
+  },
   //监控data中数据变化
   watch: {},
   //方法集合
@@ -482,7 +498,7 @@ export default {
 /* @import url(); 引入css类 */
 .OrderManage {
   .menuBox {
-    padding-right: 32px;
+    padding: 0 32px;
     display: flex;
     justify-content: space-between;
     align-items: center;
@@ -543,11 +559,10 @@ export default {
         &-left {
           display: flex;
           justify-content: flex-start;
-          margin-right: 34px;
+          margin-right: 18px;
           .coverUrl {
             width: 120px;
             height: 120px;
-            margin-right: 16px;
             border-radius: 4px;
             display: flex;
             justify-content: center;
@@ -563,6 +578,7 @@ export default {
             flex-direction: column;
             justify-content: flex-start;
             align-items: flex-start;
+            margin: 0 16px;
             .name {
               max-height: 48px;
               word-break: break-all;
@@ -648,6 +664,9 @@ export default {
               line-height: 22px;
               text-align: right;
               color: #2c2c2c;
+              &.textLeft {
+                text-align: left;
+              }
             }
             &-p2 {
               font-weight: bold;
@@ -776,7 +795,7 @@ export default {
 .OrderManage {
   .el-menu.el-menu--horizontal {
     border: 0;
-    padding: 0 32px;
+    padding: 0;
   }
   .el-menu--horizontal > .el-menu-item {
     height: 44px;

+ 56 - 49
src/components/Personalcenter/Teachcourse.vue

@@ -7,13 +7,22 @@
         <div v-for="(item, i) in list" :key="i" @click="jump(item)">
           <div class="img-box" :class="item.checked ? 'active' : ''">
             <div class="fengmian">
-              <img :src="userType=='TEACHER'?item.picture_url:item.goods_picture_url" alt="" />
+              <img
+                :src="
+                  userType == 'TEACHER'
+                    ? item.picture_url
+                    : item.goods_picture_url
+                "
+                alt=""
+              />
             </div>
             <div class="checkout-box" v-if="isShowCheckBox">
               <img src="@/assets/Personalcenter/selected-icon.png" />
             </div>
           </div>
-          <p class="goods_name">{{ userType=='TEACHER'?item.name:item.goods_name }}</p>
+          <p class="goods_name">
+            {{ userType == "TEACHER" ? item.name : item.goods_name }}
+          </p>
         </div>
       </div>
       <div class="paging" :class="list.length < 16 ? 'paging1' : ''">
@@ -67,13 +76,12 @@ export default {
   //方法集合
   methods: {
     jump(item) {
-        if(this.userType=='TEACHER'){
-            let url = `/GCLS-Learn/#/GoodsDetail?goods_id=${item.id}&goods_type=201`
-            window.open(url);
-        }else{
-            jumpPath(item);
-        }
-      
+      if (this.userType == "TEACHER") {
+        let url = `/GCLS-Learn/#/GoodsDetail?goods_id=${item.id}&goods_type=201`;
+        window.open(url);
+      } else {
+        jumpPath(item);
+      }
     },
     //   修改当前页
     changecurrentPage(val) {
@@ -84,51 +92,51 @@ export default {
     getOrderList() {
       let _this = this;
       _this.loading = true;
-      let MethodName = ''
-      let data = null
-      if(_this.userType=='TEACHER'){
-          MethodName = "page_query-PageQueryMyCourseList";
-          data = {
-            finish_status: -1, // 完成状态列表, - 1 表示查询所有
-            release_status: -1, // 发布状态 -1【全部】,1 【已发布】,0【未发布】
-            name: "", // 课程名称,模糊查询
-            page_capacity: _this.pageSize, // 每页容量,最大不能超过 200
-            cur_page: _this.pageNum, // 当前查询第几页,页码序号从 1 开始
-          };
-      }else{
-          MethodName = "page_query-PageQueryMyGoodsList";
-          data = {
-            goods_id_list: [], // 商品 ID 列表,空表示查询所有商品
-            goods_type_list: JSON.parse(_this.activeIndex), // 商品类型列表,具体参看数据字典 6.9,订单商品类型。空表示查询所有类型
-            goods_name: _this.goods_name, // 商品名称,模糊查询,空表示查询所有
-            pay_status: 1, //支付状态 -1全部0未支付1已支付
-            cancel_status: 0, //取消状态 -1 全部 0 未取消 1 已取消(只有未支付的订单才会有取消状态)
-            page_capacity: _this.pageSize, // 每页容量,最大不能超过 200
-            cur_page: _this.pageNum, // 当前查询第几页,页码序号从 1 开始
-          };
+      let MethodName = "";
+      let data = null;
+      if (_this.userType == "TEACHER") {
+        MethodName = "page_query-PageQueryMyCourseList";
+        data = {
+          finish_status: -1, // 完成状态列表, - 1 表示查询所有
+          release_status: -1, // 发布状态 -1【全部】,1 【已发布】,0【未发布】
+          name: "", // 课程名称,模糊查询
+          page_capacity: _this.pageSize, // 每页容量,最大不能超过 200
+          cur_page: _this.pageNum, // 当前查询第几页,页码序号从 1 开始
+        };
+      } else {
+        MethodName = "page_query-PageQueryMyGoodsList";
+        data = {
+          goods_id_list: [], // 商品 ID 列表,空表示查询所有商品
+          goods_type_list: JSON.parse(_this.activeIndex), // 商品类型列表,具体参看数据字典 6.9,订单商品类型。空表示查询所有类型
+          goods_name: _this.goods_name, // 商品名称,模糊查询,空表示查询所有
+          pay_status: 1, //支付状态 -1全部0未支付1已支付
+          cancel_status: 0, //取消状态 -1 全部 0 未取消 1 已取消(只有未支付的订单才会有取消状态)
+          page_capacity: _this.pageSize, // 每页容量,最大不能超过 200
+          cur_page: _this.pageNum, // 当前查询第几页,页码序号从 1 开始
+        };
       }
       getLearnWebContent(MethodName, data).then((res) => {
         _this.loading = false;
         this.total = res.total_count;
-        let list = []
-        if(_this.userType=='TEACHER'){
-            if (res.course_list && res.course_list.length > 0) {
-                list = res.course_list;
-                this.isEmpty = false;
-            } else {
-                this.isEmpty = true;
-            }
-        }else{
-            if (res.goods_list && res.goods_list.length > 0) {
-                list = res.goods_list; 
-                this.isEmpty = false;
-            } else {
-                this.isEmpty = true;
-            }
+        let list = [];
+        if (_this.userType == "TEACHER") {
+          if (res.course_list && res.course_list.length > 0) {
+            list = res.course_list;
+            this.isEmpty = false;
+          } else {
+            this.isEmpty = true;
+          }
+        } else {
+          if (res.goods_list && res.goods_list.length > 0) {
+            list = res.goods_list;
+            this.isEmpty = false;
+          } else {
+            this.isEmpty = true;
+          }
         }
         list = list.map((item) => {
-            item.checked = false;
-            return item;
+          item.checked = false;
+          return item;
         });
         this.list = list;
       });
@@ -258,7 +266,6 @@ export default {
         -webkit-line-clamp: 2;
         text-overflow: ellipsis;
         overflow: hidden;
-        text-align: left;
       }
     }
   }

+ 1 - 1
src/views/Personalcenter.vue

@@ -58,7 +58,7 @@
             </div>
           </div>
         </div>
-        <div class="right" :dir="dir">
+        <div class="right">
           <Mymessage v-if="SeleNavId == 0" />
           <Mytextbook v-if="SeleNavId == 1" />
           <Teachcourse