Przeglądaj źródła

调试企业详情的产品详情接口 修改查企业 提诉求页面问题

Jing-Jiu 4 lat temu
rodzic
commit
8d5d0420b3
2 zmienionych plików z 105 dodań i 61 usunięć
  1. 104 59
      pages/enterprise/enterprise_detail.vue
  2. 1 2
      pages/enterprise/index.vue

+ 104 - 59
pages/enterprise/enterprise_detail.vue

@@ -1,13 +1,13 @@
 <template>
-  <div class="content" :class="{ 'margin-bottom-80': isMar }" v-if="isShow">
-    <div class="title">
-      <div class="logo">
-        <img :src="'https://kiq.xazhima.com' + info.pic_url" alt="" />
-      </div>
-      <div class="name">
+  <view class="content" :class="{ 'margin-bottom-80': isMar }" v-if="isShow">
+    <!-- <view class="title">
+      <view class="logo">
+        <image :src="'https://kiq.xazhima.com' + info.pic_url" alt=""></image>
+      </view>
+      <view class="name">
         {{ info.name }}
-      </div>
-    </div>
+      </view>
+    </view> -->
     <view class="enterprise-item-box">
       <view
         v-for="(item, idx) in titleList"
@@ -19,12 +19,12 @@
         {{ item }}
       </view>
     </view>
-    <div class="baseInfo" v-if="active === 0">
-      <div class="card-title">{{ model.title }}</div>
-      <div class="item-list">
-        <div v-for="(item, idx) in model.item" :key="idx" class="term">
-          <div class="term-name">{{ item.name }}:</div>
-          <div class="term-value-group">
+    <view class="baseInfo" v-if="active === 0">
+      <view class="card-title">{{ model.title }}</view>
+      <view class="item-list">
+        <view v-for="(item, idx) in model.item" :key="idx" class="term">
+          <view class="term-name">{{ item.name }}:</view>
+          <view class="term-value-group" v-if="item.name !== '网址'">
             <p
               v-for="(value, idx) in item.value"
               :key="idx"
@@ -33,41 +33,37 @@
             >
               {{ value }}
             </p>
-          </div>
-        </div>
-      </div>
-    </div>
-    <div v-else-if="active === 1" class="proInfo">
-      <div class="products">
-        <div class="product" @click="toDetail(1)">
-          <div class="img">
-            <img src="/static/enterprise/product.jpg" />
-          </div>
-          <div class="name">硬件销售</div>
-        </div>
-        <div class="product">
-          <div class="img">
-            <img src="/static/enterprise/product.jpg" />
-          </div>
-          <div class="name">硬件销售</div>
-        </div>
-        <div class="product">
-          <div class="img">
-            <img src="/static/enterprise/product.jpg" />
-          </div>
-          <div class="name">硬件销售</div>
-        </div>
-      </div>
-    </div>
-    <div style="width: 100%">
+          </view>
+          <view class="term-value-group" v-else>
+            <div class="flex_i">
+              <div class="">
+                {{ item.value[0] }}
+              </div>
+              <div class="copy" @click="copy(item.value[0])">复制</div>
+            </p>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view v-else-if="active === 1" class="proInfo">
+      <view class="products">
+        <view class="product" @click="toDetail(id)" v-for="(item,idx) in productList" :key="idx">
+          <view class="img">
+            <image :src="'https://kiq.xazhima.com' + item.pic_url"></image>
+          </view>
+          <view class="name">{{item.name}}</view>
+        </view>
+      </view>
+    </view>
+    <view style="width: 100%">
       <footer-share
         style="width: 100%"
         :isCollection="true"
         @collectionPages="collectionPage"
         @sharePages="sharePage"
       ></footer-share>
-    </div>
-  </div>
+    </view>
+  </view>
 </template>
 
 <script>
@@ -80,13 +76,15 @@ export default {
       titleList: ["基本信息", "产品信息"],
       active: 0,
       info: {},
-      model:{},
+      model: {},
+      productList: [],
       isShow: false,
     };
   },
   onLoad(option) {
     let id = option.id;
     this.getCompanyInfo(id);
+    this.getProductInfo(id);
   },
   methods: {
     collectionPage() {
@@ -147,9 +145,9 @@ export default {
               work_address,
               rigiser_address,
               web_url,
-              contact,
+              phone,
+              work_range,
             } = res.data.data;
-            console.log(res.data.data);
             this.info = {
               name,
               pic_url,
@@ -162,7 +160,8 @@ export default {
               work_address,
               rigiser_address,
               web_url,
-              contact,
+              phone,
+              work_range,
             };
             this.model = {
               title: this.info.name,
@@ -192,14 +191,8 @@ export default {
                   value: [this.info.park_name],
                 },
                 {
-                  name: "经营地址",
-                  value: [this.info.work_address],
-                },
-                {
                   name: "经营范围",
-                  value: [
-                    "一、提供国内、地区和国际定期及不定期航空客、货、邮、行李运输服务;二、提供通用航空服务;三、提供航空器维修服务;四、经营国内外航空公司的代理业务;五、提供航空配餐服务(仅限分支机构经营);六、进行其他航空业务及相关业务,包括为该等业务进行广告宣传;",
-                  ],
+                  value: [this.info.work_range],
                 },
                 {
                   name: "地址",
@@ -211,7 +204,7 @@ export default {
                 },
                 {
                   name: "电话",
-                  value: [this.info.contact],
+                  value: [this.info.phone],
                 },
               ],
             };
@@ -223,6 +216,50 @@ export default {
         },
       });
     },
+    getProductInfo(id) {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&action=list&source=company_product&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          s_company_id: id,
+        },
+        success: (res) => {
+          if (res.data.code === 200) {
+            this.productList = res.data.data.list;
+            console.log(this.productList);
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    copy(data) {
+      uni.setClipboardData({
+        data,
+        success: function () {
+          console.log("复制成功");
+        },
+      });
+    },
   },
 };
 </script>
@@ -258,7 +295,6 @@ export default {
       margin-left: 20rpx;
       display: flex;
       flex-direction: column;
-
       .term {
         display: flex;
         .term-name {
@@ -276,6 +312,11 @@ export default {
           .term-value-item {
             margin: 20rpx;
           }
+          .flex_i {
+            display: flex;
+            flex-flow: row;
+            justify-content: space-around;
+          }
         }
       }
     }
@@ -293,14 +334,18 @@ export default {
         border-radius: 30rpx;
         box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
         width: 40%;
-        height: 30%;
+        height: 100px;
         display: flex;
         flex-flow: column;
         justify-content: space-between;
         align-items: center;
-        img {
-          width: 250rpx;
+        .img {
+          width: 200rpx;
           height: 200rpx;
+          image {
+            width: 200rpx;
+            height: 200rpx;
+          }
         }
       }
     }

+ 1 - 2
pages/enterprise/index.vue

@@ -151,10 +151,9 @@ export default {
           "content-type": "application/x-www-form-urlencoded",
         },
         data: {
-          ss_content_text: this.searchVal, //1.省 2.市 3.区 4.新城
+          ss_name: this.searchVal, //1.省 2.市 3.区 4.新城
         },
         success: (res) => {
-          console.log(res.data);
           if (res.data.code === 200) {
             let list = res.data.data.list;
             console.log(list);