xuxy
2024-07-27 dcc7b2d14fcbac97fb6d2c8975a3cd93dfbcc458
sub_pages/customer/shop/shop.vue
@@ -1,8 +1,8 @@
<template>
  <view class="brand-detail">
   <view class="brand-detail" style="background: #20613D;">
    <view class="brand-top-info">
      <view class="search-container m-t-12 flex">
         <view class="search-container  flex" style="padding-left: 20rpx;padding-right: 20rpx;padding-top: 20rpx">
        <view class="flex1 input">
          <u-input placeholder="请输入花名" v-model="search_flow">
            <template slot="suffix">
@@ -13,20 +13,27 @@
      </view>
      <view class="info-brand m-t-12" v-if="id">
        <view class="flex">
          <image class="store-logo"></image>
               <image class="store-logo" :src="dto.cover"></image>
          <view>
            <view class="store-name">花仙子</view>
            <view class="store-address">云南省-昆明市-官渡区</view>
                  <view class="store-name">{{dto.name}}</view>
                  <view class="store-address">
                     {{ ((dto.province||'')+  (dto.city&&'-'||'') + (dto.city||'')+  (dto.region&&'-'||'')+(dto.region||'')) ||dto.address || '暂无详细地址'}}
                  </view>
          </view>
          <view class="store-sc m-l-a m-r-0" @click="updateGz(!dto.followed)">
            <view class="icon-view">
                     <image src="../../../static/icon-gz-1.png" class="icon" v-if="dto.followed"></image>
                     <image src="../../../static/icon-gz-0.png" class="icon" v-if="!dto.followed"></image>
                  </view>
                  <view>{{dto.followed?'取消':'关注'}}</view>
               </view>
               <!--         <view class="store-sc m-l-a m-r-0" @click="updateGz(!dto.followed)">
              <image src="../../../static/icon-gz-1.png" class="icon" v-if="dto.followed"
                     ></image>
              <image src="../../../static/icon-gz-0.png" class="icon" v-if="!dto.followed"
                     ></image>
            </view>
            <view>关注</view>
          </view>
          关注
        </view> -->
        </view>
      </view>
      <view class="tj-info m-t-12">
@@ -47,9 +54,11 @@
          <view class="label">关注</view>
        </view>
      </view>
      <top-tabs class="m-t-12" :tabs="tabs" :flg="flg" @change="changeTab">
         <view class="p10" style="padding-left: 20rpx;padding-right: 20rpx;">
            <top-tabs :tabs="tabs" :flg="flg" @change="changeTab">
      </top-tabs>
         </view>
    </view>
    <view class="brand-info">
      <view v-if="flg==='0'" class="brand-info-0">
@@ -124,11 +133,19 @@
        <view class="title">
          基础信息
        </view>
        <view class="form-input">
            <view class="form-input flex">
          <view class="label">经营模式</view>
          <view class="value">供应商</view>
        </view>
        <view class="form-input">
            <view class="form-input flex">
               <view class="label ">商家详细</view>
               <view class="value">{{dto.address || '暂无'}}</view>
            </view>
            <view class="form-input flex">
               <view class="label ">商家介绍</view>
               <view class="value">{{dto.description || '-'}}</view>
            </view>
            <view class="form-input flex">
          <view class="label">身份认证</view>
          <view class="value">个人身份认证</view>
        </view>
@@ -196,7 +213,9 @@
    //update 关注
    async updateGz(type) {
      this.$message.showLoading()
      const {code} = await this.$http.request(type ? 'post' : 'get', `/api/follow/${type ? 'add' : 'delete'}`, {
            const {
               code
            } = await this.$http.request(type ? 'post' : 'get', `/api/follow/${type ? 'add' : 'delete'}`, {
        data: {
          supplierId: this.dto.supplierId || this.dto.id
        },
@@ -204,16 +223,18 @@
          supplierId: this.dto.supplierId || this.dto.id
        }
      })
      this.$message.hideLoading()
      if (code === 0) {
        this.dto.followed = !this.dto.followed
        await this.$store.dispatch('sign_add', 'follow')
               this.$forceUpdate()
      }
            this.$message.hideLoading()
    },
    changeTab(flg) {
      this.flg = flg
            console.log('changeTab', flg)
            this.flg = ''+flg
      //如果没有加载数据,需要加载一下
    },
@@ -238,13 +259,14 @@
        return
      }
      this.$message.showLoading()
      const {code} = await http.request('post', '/api/customer/flower/cart/change-num', {
            const {
               code
            } = await http.request('post', '/api/customer/flower/cart/change-num', {
            data: {
              id: item.id,
              num: addnum
            }
          }
      )
            })
      this.$message.hideLoading()
      if (code === 0) {
        item.shopnum += addnum
@@ -260,23 +282,31 @@
.brand-detail {
  .brand-info {
    background: #FFFFFF;
    border-radius: 40rpx 40rpx 0rpx 0rpx;
         // border-radius: 40rpx 40rpx 0rpx 0rpx;
         border-top-left-radius: 40rpx;
         border-top-right-radius: 40rpx;
         overflow: hidden;
         overflow-y: scroll;
    padding: 40rpx 32rpx;
         height: calc(100vh - 650rpx);
         padding-top: 0rpx;
    .brand-info-0 {
      .top-title {
        height: 80rpx;
               height: 60rpx;
        background: #E4ECE8;
        border-radius: 4rpx;
        font-weight: 400;
        font-size: 24rpx;
        color: #779787;
        margin-top: 10rpx;
        line-height: 80rpx;
               line-height: 60rpx;
               padding-left: 20rpx;
      }
    }
    .brand-info-3 {
            padding: 40rpx 30rpx;
      .title {
        font-weight: 600;
        font-size: 32rpx;
@@ -285,12 +315,12 @@
        margin-bottom: 20rpx;
      }
      .form-item {
            .form-input {
        display: flex;
        border-bottom: 2rpx solid #EEEEEE;
        .label {
          font-weight: 400;
                  font-weight: 600;
          font-size: 28rpx;
          color: #000000;
          line-height: 40rpx;
@@ -302,6 +332,8 @@
          color: #666666;
          line-height: 40rpx;
          margin-left: auto;
                  margin-right: 0;
          text-align: right;
          .check {
@@ -315,6 +347,7 @@
  .brand-top-info {
    background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/37/37dc02b58bd44af79e45031af2bb6c0b%E4%BD%8D%E5%9B%BE@2x.png');
         background-size: 100% 100%;
    .tj-info {
      display: flex;
@@ -335,6 +368,7 @@
          font-size: 48rpx;
          color: #FFFFFF;
          line-height: 66rpx;
        }
      }
    }