From 62b483cc627b0a5f7d626d6b333a3ef7c7c1f4f4 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 25 二月 2026 18:41:01 +0800
Subject: [PATCH] 调试
---
mini-program/pages/index/index.vue | 60 ++++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/mini-program/pages/index/index.vue b/mini-program/pages/index/index.vue
index 14f505b..d6f113a 100644
--- a/mini-program/pages/index/index.vue
+++ b/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>鑾茶姳绉戞妧鍒涙柊浜т笟鍥璅搴�</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;
}
}
}
--
Gitblit v1.9.3