Browse Source

Merge branch 'master' of http://git.lcpcp.cc/root/uni-app

BF-202205051124\Administrator 3 years ago
parent
commit
bcdc5c2178

+ 1 - 1
components/en-from/en-radio/en-radio.vue

@@ -95,7 +95,7 @@ export default {
       })
       })
     },
     },
     setValue(){
     setValue(){
-      this.inputValue = this.value
+      this.inputValue = this.value+''
     },
     },
     setLabelWidth(){
     setLabelWidth(){
       let differenceNum=4- this.label.length;
       let differenceNum=4- this.label.length;

+ 11 - 30
components/en-from/en-select/en-select.vue

@@ -21,30 +21,7 @@ export default {
   props: {
   props: {
     localData: {
     localData: {
       type: Array,
       type: Array,
-      default: [{
-        text: "一年级",
-        value: "1-0",
-        children: [{
-          text: "1.1班",
-          value: "1-1"
-        },
-          {
-            text: "1.2班",
-            value: "1-2"
-          }]
-      },
-        {
-          text: "二年级",
-          value: "2-0",
-          children: [{
-            text: "2.1班",
-            value: "2-1"
-          },
-            {
-              text: "2.2班",
-              value: "2-2"
-            }]
-        }]
+      default: []
     },
     },
     label: {
     label: {
       type: String,
       type: String,
@@ -88,6 +65,7 @@ export default {
       this.setValue()
       this.setValue()
     },
     },
     'inputValue': function () {
     'inputValue': function () {
+      console.log(this.inputValue)
       if(this.valueType==='1'){
       if(this.valueType==='1'){
         this.$emit('input', this.inputValue.join(','))
         this.$emit('input', this.inputValue.join(','))
       }else {
       }else {
@@ -98,22 +76,24 @@ export default {
   methods: {
   methods: {
     setValue(){
     setValue(){
       let value=this.value
       let value=this.value
-      if(typeof value==='string'){
+      if(!value){
+        value=[]
+      }else if(typeof value==='string'){
         value=value.split(',')
         value=value.split(',')
       }
       }
       if(this.inputValue!==value){
       if(this.inputValue!==value){
         this.inputValue=value
         this.inputValue=value
         this.optionName = "";
         this.optionName = "";
         this.localData.forEach((one)=>{
         this.localData.forEach((one)=>{
-          if(one.value===this.inputValue[0]){
+          if(one.value+''===this.inputValue[0]+''){
             this.optionName += one.text + " ";
             this.optionName += one.text + " ";
             if(one.children){
             if(one.children){
               one.children.forEach((two)=>{
               one.children.forEach((two)=>{
-                if(two.value===this.inputValue[1]){
+                if(two.value+''===this.inputValue[1]+''){
                   this.optionName += two.text + " ";
                   this.optionName += two.text + " ";
                   if(two.children){
                   if(two.children){
                     two.children.forEach((three)=>{
                     two.children.forEach((three)=>{
-                      if(three.value===this.inputValue[2]){
+                      if(three.value+''===this.inputValue[2]+''){
                         this.optionName += three.text + " ";
                         this.optionName += three.text + " ";
                       }
                       }
                     })
                     })
@@ -130,7 +110,6 @@ export default {
       this.showPicker = false;
       this.showPicker = false;
     },
     },
     showPickerObj() {
     showPickerObj() {
-      console.log(this.$refs.pickerObj)
       this.$refs.pickerObj.show();
       this.$refs.pickerObj.show();
       this.showPicker = true;
       this.showPicker = true;
     },
     },
@@ -158,7 +137,9 @@ export default {
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 @import url("../../static/css/en-common.css");
 @import url("../../static/css/en-common.css");
-
+::v-deep .selected-item-active{
+  border-bottom: 2px solid #FF0000 !important;
+}
 .box {
 .box {
   .input-box {
   .input-box {
     display: flex;
     display: flex;

+ 1 - 1
components/en-from/en-send/en-send.vue

@@ -23,7 +23,7 @@
 
 
 <script>
 <script>
 export default {
 export default {
-  name: 'en-input',
+  name: 'en-send',
   props: {
   props: {
     type: {
     type: {
       type: String,
       type: String,

+ 97 - 38
components/en-utils/en-nav/en-nav.vue

@@ -1,19 +1,21 @@
 <template>
 <template>
   <view class="">
   <view class="">
     <view class="header" :style="style">
     <view class="header" :style="style">
-      <view class="flexbox"
+      <view class="flexbox" :class="{'flexbox-xcx':(isXcx && rightShow)}"
         :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px','background':bgckgroundBox}]">
         :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px','background':bgckgroundBox}]">
         <view @tap="goBack">
         <view @tap="goBack">
           <text  class="iconfont" v-if="leftShow">
           <text  class="iconfont" v-if="leftShow">
             &#xe60e;
             &#xe60e;
-
           </text>
           </text>
         </view>
         </view>
-        <!-- <view v-if="false">
 
 
-        </view> -->
         <view class="title-text" :style="[{'marginLeft':left +'px'}]">{{title}}</view>
         <view class="title-text" :style="[{'marginLeft':left +'px'}]">{{title}}</view>
-        <view style="width: 36px;"></view>
+        <view  class="right-button button" @click="rightClick">
+          <slot name="right" v-if="rightShow">
+            <text class="rightName" v-if="rightType===1">{{rightText}}</text>
+            <text class="rightName r-but" v-else>{{rightText}}</text>
+          </slot>
+        </view>
       </view>
       </view>
     </view>
     </view>
     <view class="box-title">
     <view class="box-title">
@@ -26,12 +28,16 @@
 </template>
 </template>
 
 
 <script>
 <script>
+  import tools from "@/common/js/tools";
+
   export default {
   export default {
+    name: "en-nav",
     data() {
     data() {
       return {
       return {
         statusBarH: 0,
         statusBarH: 0,
         customBarH: 0,
         customBarH: 0,
-        left: 35
+        left: 35,
+        isXcx:false
       }
       }
     },
     },
     props: {
     props: {
@@ -43,19 +49,30 @@
         type: Boolean,
         type: Boolean,
         default: true
         default: true
       },
       },
-
       bgckgroundBox: {
       bgckgroundBox: {
         type: String,
         type: String,
         default: '#fff'
         default: '#fff'
       },
       },
-      // titleColor: {
-      //   type: String,
-      //   default: '#fff'
-      // },
-      // bgColor: {
-      //   type: String,
-      //   default: '#707'
-      // },
+
+      titleColor: {
+        type: String,
+        default: '#fff'
+      },
+      bgColor: {
+        type: String,
+        default: '#707'
+      },
+      rightText: {
+        type: String,
+        default: ''
+      },
+      rightShow: {
+        type: Boolean,
+        default: false
+      },
+      rightType: {
+        default: 1
+      },
     },
     },
     computed: {
     computed: {
       style() {
       style() {
@@ -71,23 +88,37 @@
       }
       }
     },
     },
     methods: {
     methods: {
+      rightClick() {
+        this.$emit('rightClick')
+      },
       goBack() {
       goBack() {
         if(!this.leftShow){
         if(!this.leftShow){
           return ;
           return ;
         }
         }
-        this.$emit('leftClick')
+        // this.$emit('leftClick')
+        tools.leftClick()
       }
       }
     },
     },
     created() {
     created() {
-      let self = this;
       uni.getSystemInfo({
       uni.getSystemInfo({
-        success: function(e) {
-          self.statusBarH = e.statusBarHeight + 10
-          let custom = wx.getMenuButtonBoundingClientRect()
-          self.customBarH = custom.height
-          self.$emit('navHeight', self.customBarH-10)
+        success: (e) =>{
+          this.statusBarH = e.statusBarHeight + 10
+          let custom=0;
+          //#ifdef MP-WEIXIN
+          custom = wx.getMenuButtonBoundingClientRect()
+          this.customBarH = custom.height
+          //#endif
+          //#ifdef H5
+          this.customBarH = 30
+          this.left=0
+          //#endif
+          console.log('self.customBarH---------'+this.customBarH)
+          this.$emit('navHeight', this.customBarH-10)
         }
         }
       })
       })
+      //#ifdef MP-WEIXIN
+      this.isXcx=true
+      //#endif
     }
     }
   }
   }
 </script>
 </script>
@@ -101,27 +132,55 @@
     left: 0;
     left: 0;
     top: 0;
     top: 0;
     z-index: 999999;
     z-index: 999999;
+    .flexbox {
+      display: flex;
+      justify-content: space-between;
+      padding: 0 20px;
+      .iconfont{
+        color: #333333;
+      }
+      .title-text {
+        font-size: 36rpx;
+        font-weight: 600;
+      }
+      .icon-left {
+        width: 20px;
+        height: 20px;
+      }
+
+      .button {
+        position: relative;
+        z-index: 5;
+        // width: 21px;
+        .rightName {
+          font-size: 14px;
+          color: #333333;
+        }
+        .r-but{
+          background-color:#FF0000 ;
+          color: #fff;
+          font-size: 12px;
+          padding: 5px;
+          border-radius: 3px;
+        }
+      }
+    }
+    .flexbox-xcx{
+      justify-content:left;
+      position: relative;
+      .right-button{
+        position: absolute;
+        right: 220rpx;
+      }
+    }
+
   }
   }
 
 
+
+
   .box-title {
   .box-title {
     width: 100vw;
     width: 100vw;
   }
   }
 
 
-  .flexbox {
-    display: flex;
-    justify-content: space-between;
-    padding: 0 20px;
-    .iconfont{
-      color: #fff;
-    }
-    .title-text {
-      font-size: 36rpx;
-      font-weight: 600;
-    }
 
 
-    .icon-left {
-      width: 20px;
-      height: 20px;
-    }
-  }
 </style>
 </style>