Просмотр исходного кода

[ 零售前端 ] 286 零售-供货商-进店采购补充头部商家信息栏

wangn 5 лет назад
Родитель
Сommit
d970ae4f52
1 измененных файлов с 83 добавлено и 9 удалено
  1. 83 9
      hdApp/src/pagesPurchase/ghsProduct.vue

+ 83 - 9
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -2,12 +2,20 @@
 <template>
 	<view class="billing_box_bg">
 <!--		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="33.3%" />-->
+    <view class="c_header">
+      <view class="header_inside">
+        <image :src="pageInfo.avatar"></image>
+        <view class="shop_info">
+          <view class="shop_title">{{pageInfo.name}}</view>
+          <view class="shop_intro"><text style="margin-right: 20upx;">已采购:{{pageInfo.expendAmount}}</text> <text>欠款:{{pageInfo.debtAmount}}</text></view>
+        </view>
+        <i class="iconfont icondianhua1" @tap="toPhone(pageInfo.mobile)"></i>
+      </view>
+    </view>
 		<view class="input-wrap" >
 			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @search="searchFn" />
 		</view>
 		<view class="scroll-middle_bx">
-
-
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" >
 				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
 					<text>{{ item.className || "" }}</text>
@@ -116,6 +124,7 @@ import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
 import {mapActions, mapGetters} from "vuex";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
+import { getGhsDataApi, ghsInfo } from "@/api/ghs/index";
 import { getShop } from '@/api/common/index'
 // import suitProductMins from "@/mixins/ghsProduct";
 export default {
@@ -180,13 +189,21 @@ export default {
 		}
 	},
   onShow() {
-    getShop({shopId: this.options.shopId}).then(res => {
-      console.log('179 res ===>', res)
-      this.pageInfo = res.data.info
-      uni.setNavigationBarTitle({
-        title: this.pageInfo.shopName
-      })
-    }).catch(err => {})
+    if(this.option.id == 0) {
+      ghsInfo({shopId: this.option.shopId}).then(res => {
+        this.pageInfo = res.data
+        uni.setNavigationBarTitle({
+          title: this.pageInfo.name
+        })
+      }).catch(err => {})
+    } else {
+      getGhsDataApi({id: this.option.id}).then(res => {
+        this.pageInfo = res.data
+        uni.setNavigationBarTitle({
+          title: this.pageInfo.name
+        })
+      }).catch(err => {})
+    }
   },
 
 	methods: {
@@ -198,6 +215,12 @@ export default {
 				this.initAllInput();
 			})
 		},
+    // 拨打电话  wangn  2021-5-6
+    toPhone(phone){
+			uni.makePhoneCall({
+				phoneNumber: phone //仅为示例
+			});
+		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
@@ -287,6 +310,57 @@ export default {
 	height: 100%;
 	display: flex;
 	flex-direction: column;
+  .c_header{
+    height: 240upx;
+    width: 100vw;
+    padding: 0 15upx;
+    box-sizing: border-box;
+    background: linear-gradient(to bottom,#3385FF, #fff);
+    &>.header_inside{
+      position: relative;
+      height: 190upx;
+      margin-top: 30upx;
+      background: #fff;
+      box-shadow: 0px 1px 21px 0px rgba(161, 166, 173, 0.4);
+      border-radius: 20px;
+      padding: 30upx;
+      box-sizing: border-box;
+      &>image{
+        height: 130upx;
+        width: 130upx;
+        display: inline-block;
+        border-radius: 10px;
+        background-color: #eee;
+        vertical-align: top;
+      }
+      &>.shop_info{
+        vertical-align: top;
+        display: inline-block;
+        height: 100%;
+        margin-left: 30upx;
+        &>.shop_title{
+          margin-top: 14upx;
+          font-size: 40px;
+          font-weight: 600;
+          color: #060606;
+        }
+        &>.shop_intro{
+          margin-top: 15upx;
+          font-size: 26px;
+          font-weight: 400;
+          color: #666666;
+        }
+      }
+      &>.iconfont{
+        font-size: 40upx;
+        position: absolute;
+        right: 30upx;
+        top: 50%;
+        transform: translateY(-50%);
+        color: #3385FF;
+      }
+    }
+  }
 	.input-wrap {
 		padding: 22px 20px 22px 30px;
 	}