MrShi
12 小时以前 62b483cc627b0a5f7d626d6b333a3ef7c7c1f4f4
mini-program/pages/index/index.vue
@@ -6,7 +6,7 @@
            <view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
            <view class="head-bar-nav" :style="{ height: navHeight + 'px' }" @click="openLoacing">
               <image src="/static/icon/home_ic_location@2x.png" mode="widthFix"></image>
               <text>莲花科技创新产业园F座</text>
               <text>{{position.formatted_addresses.recommend}}</text>
               <u-icon name="arrow-right" color="#222222" size="13"></u-icon>
            </view>
         </view>
@@ -20,7 +20,7 @@
         <u-scroll-list indicatorActiveColor="#004096">
            <view class="scroll-list">
               <view class="scroll-list__line" v-for="(item, index) in labels" :key="index">
                  <view class="cate-item" v-for="(child, index) in item" :key="index">
                  <view class="cate-item" v-for="(child, index) in item" :key="index" @click="jumpSearch(child, 1)">
                     <view class="cate-item-image">
                        <image :src="child.imgUrl" mode="widthFix"></image>
                     </view>
@@ -35,7 +35,7 @@
         <u-scroll-list indicatorActiveColor="#004096">
            <view class="scroll-list" style="padding: 0;">
               <view class="scroll-list__line" v-for="(item, index) in brand" :key="index">
                  <view class="cate-item1" v-for="(child, index) in item" :key="index">
                  <view class="cate-item1" v-for="(child, index) in item" :key="index" @click="jumpSearch(child, 2)">
                     <image :src="child.imgUrl" mode="widthFix"></image>
                     <text>{{child.name}}</text>
                  </view>
@@ -44,7 +44,7 @@
         </u-scroll-list>
         <view class="title">
            <view class="title-left">品质专区</view>
            <view class="title-right">
            <view class="title-right" @click="toZhuanqu">
               <text>更多</text>
               <u-icon name="arrow-right" color="#AAAAAA" size="10"></u-icon>
            </view>
@@ -143,6 +143,11 @@
         this.getGoodsList()
      },
      methods: {
         toZhuanqu() {
            uni.navigateTo({
               url: '/pages/zhuanqu/zhuanqu'
            })
         },
         addCard(e) {
            this.$u.api.addCart({
               goodsId: e.id,
@@ -260,10 +265,19 @@
               highAccuracyExpireTime: 3000,
               isHighAccuracy: true,
               success: function(addr) {
               }
            });
         },
         openLoacing() {
            var that = this;
            uni.chooseLocation({
               success(res1) {
                  const locParam = {
                     latitude: addr.latitude,
                     longitude: addr.longitude
                     latitude: res1.latitude,
                     longitude: res1.longitude
                  };
                  console.log(locParam)
                  const qqmapsdk = new QQMapWX({
                     key: 'HEIBZ-QJLLM-SZ36X-6ZBHI-S6Y2J-S6FND'
                  });
@@ -271,26 +285,32 @@
                  qqmapsdk.reverseGeocoder({
                     locParam,
                     success: function(res) {
                        console.log(res, '==================获取地址');
                        console.log(res,  '==================index获取地址')
                        that.$store.commit('setPosition', res.result)
                     },
                     fail: (err) => {
                        console.error('获取位置失败===========', err);
                     }
                  });
               }
            });
            })
         },
         openLoacing() {
            uni.chooseLocation({
               success(res) {
                  console.log(res)
         jumpSearch(row, type) {
            if (row) {
               if (type === 1) {
                  uni.navigateTo({
                     url: '/pages/search/search?categoryId=' + row.id
                  })
               } else {
                  uni.navigateTo({
                     url: '/pages/search/search?applicableBrandId=' + row.id
                  })
               }
            })
         },
         jumpSearch() {
            uni.navigateTo({
               url: '/pages/search/search'
            })
            } else {
               uni.navigateTo({
                  url: '/pages/search/search'
               })
            }
         }
      }
   }
@@ -380,10 +400,14 @@
               }
               text {
                  max-width: 400rpx;
                  font-weight: 500;
                  font-size: 32rpx;
                  color: #111111;
                  margin-right: 8rpx;
                  white-space: nowrap;
                  overflow: hidden;
                  text-overflow: ellipsis;
               }
            }
         }