Browse Source

Merge branch 'fix'

shenjj 7 years ago
parent
commit
e7bf306eb0
1 changed files with 23 additions and 6 deletions
  1. 23 6
      pages/mobile/user/index.vue

+ 23 - 6
pages/mobile/user/index.vue

@@ -130,8 +130,8 @@
               <div class="linetext">单位:PCS</div>
               <div class="linetext">单位:PCS</div>
             </div>
             </div>
             <div class="fr" :class="providerType == 'enterprise' && item.batchCount > 0 ? '' : 'addtop'" >
             <div class="fr" :class="providerType == 'enterprise' && item.batchCount > 0 ? '' : 'addtop'" >
-              <div class="look" v-if="item.batchCount && providerType == 'enterprise'" @click="lookProductitem(item.id, item)" :class="{noadd: item.addProductPerson}">查看产品</div>
-              <div class="add" v-if="providerType == 'enterprise' && !item.addProductPerson" @click="addProtoperson(item)">加入个人产品</div>
+              <div class="look" v-if="item.batchCount && providerType == 'enterprise'" @click="lookProductitem(item.id, item)" >查看产品</div>
+              <div class="add" v-if="providerType == 'enterprise'" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}">加入个人产品</div>
               <div class="delete" v-if="providerType == 'person'" @click="deleteProvider(item.id, index)">删除</div>
               <div class="delete" v-if="providerType == 'person'" @click="deleteProvider(item.id, index)">删除</div>
             </div>
             </div>
           </div>
           </div>
@@ -554,6 +554,7 @@
           this.GetEnterpriseListData.splice(0, this.GetEnterpriseListData.length)
           this.GetEnterpriseListData.splice(0, this.GetEnterpriseListData.length)
           this.GetEnterpriseListData = null
           this.GetEnterpriseListData = null
           this.GetEnterpriseListData = []
           this.GetEnterpriseListData = []
+          this.seekPage = 1
         }
         }
         this.reloadData()
         this.reloadData()
       },
       },
@@ -697,10 +698,20 @@
         this.showDelete = false
         this.showDelete = false
       },
       },
       addProtoperson: function(item) {
       addProtoperson: function(item) {
+        if (item.addProductPerson) {
+          this.collectResult = '已在个人产品库'
+          this.timeoutCount++
+          return false
+        }
         this.$http.post('/trade/products/person', [item.id])
         this.$http.post('/trade/products/person', [item.id])
           .then(response => {
           .then(response => {
             this.collectResult = '绑定成功'
             this.collectResult = '绑定成功'
             this.timeoutCount++
             this.timeoutCount++
+            this.seekPage = 1
+            this.GetEnterpriseListData.splice(0, this.GetEnterpriseListData.length)
+            this.GetEnterpriseListData = null
+            this.GetEnterpriseListData = []
+            this.reloadData()
           }, () => {
           }, () => {
             this.collectResult = '绑定失败'
             this.collectResult = '绑定失败'
             this.timeoutCount++
             this.timeoutCount++
@@ -1252,6 +1263,11 @@
           .add {
           .add {
             background: #0067e7;
             background: #0067e7;
             color: #fff;
             color: #fff;
+            &.noadd{
+              background: #cccbcb;
+              color: #fff;
+              border:1px solid #cccbcb;
+            }
           }
           }
         }
         }
         div {
         div {
@@ -1264,10 +1280,6 @@
             background: #0067e7;
             background: #0067e7;
             color: #fff;
             color: #fff;
           }
           }
-          &.noadd {
-            margin-bottom: 0px;
-            margin-top: 0.3rem;
-          }
           &.add{
           &.add{
             background: #fff;
             background: #fff;
             color: #0067e7;
             color: #0067e7;
@@ -1278,6 +1290,11 @@
             color: #f70415;
             color: #f70415;
             border: 1px solid #f70415;
             border: 1px solid #f70415;
           }
           }
+          &.noadd{
+            background: #cccbcb;
+            color: #fff;
+            border:1px solid #cccbcb;
+          }
         }
         }
         div:nth-child(1){
         div:nth-child(1){
           margin-bottom: 0.26rem
           margin-bottom: 0.26rem