From 844619e18e32f860636e232851c9ed65a83f9f75 Mon Sep 17 00:00:00 2001 From: sjeam <359824901@qq.com> Date: Fri, 5 Sep 2025 14:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 3 +- src/interceptors/request.ts | 8 +-- src/pages/about/detail.vue | 55 +++++++++++------ src/pages/about/index.vue | 4 +- src/pages/index/index.vue | 88 ++++++++++----------------- src/pages/my/components/wx-login.vue | 70 +++++++++++---------- src/pages/web_view/h5.vue | 20 ++++-- src/pages/web_view/index.vue | 8 +-- src/service/crmeb/product.ts | 25 ++++++++ src/static/icons/my1.png | Bin 0 -> 745 bytes src/static/icons/my2.png | Bin 0 -> 1952 bytes src/static/icons/my3.png | Bin 0 -> 1164 bytes src/static/icons/my4.png | Bin 0 -> 1748 bytes src/static/icons/my5.png | Bin 0 -> 1888 bytes src/static/icons/my6.png | Bin 0 -> 2114 bytes src/static/icons/my7.png | Bin 0 -> 1857 bytes src/utils/index.ts | 28 ++++++--- 17 files changed, 176 insertions(+), 133 deletions(-) create mode 100644 src/static/icons/my1.png create mode 100644 src/static/icons/my2.png create mode 100644 src/static/icons/my3.png create mode 100644 src/static/icons/my4.png create mode 100644 src/static/icons/my5.png create mode 100644 src/static/icons/my6.png create mode 100644 src/static/icons/my7.png diff --git a/env/.env b/env/.env index 15a8e43..05b3b56 100644 --- a/env/.env +++ b/env/.env @@ -13,7 +13,8 @@ VITE_LOGIN_URL = '/pages/login/index' # 数字乡村 VITE_SERVER_BASEURL = 'http://test.data-middle.lihaink.cn' VITE_UPLOAD_BASEURL = 'http://test.data-middle.lihaink.cn/upload' - +# 商城 +VITE_SHOP_SERVER_BASEURL = 'https://shop.lihaink.cn' # 村集体 VITE_CRMEB_SERVER_BASEURL = 'https://test.shop.lihaink.cn' diff --git a/src/interceptors/request.ts b/src/interceptors/request.ts index a0ece44..0112154 100644 --- a/src/interceptors/request.ts +++ b/src/interceptors/request.ts @@ -81,10 +81,10 @@ const httpInterceptor = { const userStore = useUserStore() const { token } = userStore.userInfo as unknown as IUserInfo // console.log('token', token) - // if (token) { - // options.header.Authorization = `Bearer ${token.access_token}` - // } - options.header.Authorization = `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4udGlueXdhbi5jbiIsImF1ZCI6IndlYm1hbi50aW55d2FuLmNuIiwiaWF0IjoxNzU2ODYzNDAwLCJuYmYiOjE3NTY4NjM0MDAsImV4cCI6MTc1Njg3MDYwMCwiZXh0ZW5kIjp7ImlkIjoyMX19.5jmRqytXC-mqeNZBvef6vo4fm4RE0T-QR_mGzjZaAYM` + if (token) { + options.header.Authorization = `Bearer ${token.access_token}` + } + // options.header.Authorization = `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4udGlueXdhbi5jbiIsImF1ZCI6IndlYm1hbi50aW55d2FuLmNuIiwiaWF0IjoxNzU2ODYzNDAwLCJuYmYiOjE3NTY4NjM0MDAsImV4cCI6MTc1Njg3MDYwMCwiZXh0ZW5kIjp7ImlkIjoyMX19.5jmRqytXC-mqeNZBvef6vo4fm4RE0T-QR_mGzjZaAYM` }, } diff --git a/src/pages/about/detail.vue b/src/pages/about/detail.vue index de0e6ed..78d7beb 100644 --- a/src/pages/about/detail.vue +++ b/src/pages/about/detail.vue @@ -25,7 +25,6 @@ :list="swiperList" autoplay :indicator="{ type: 'dots-bar' }" - @change="onChange" > - + 泸州市龙马潭区海吉星路 @@ -64,7 +63,8 @@ 场所介绍 - + + @@ -81,19 +81,15 @@ - - + + - - {{ item.author }} - {{ item.description }} + + + {{ item.author }} + + {{ item.description }} 泸州市龙马潭区海吉星路 @@ -121,14 +117,11 @@ import { getArticleCategoryAPI, getArticleIndexAPI, getArticleDetailAPI, + openLocation, } from '@/service/crmeb/product.ts' -import { useUserStore } from '@/store' import { getUrl, getWebUrl } from '@/utils' - -const userStore = useUserStore() -const hasLogin = computed(() => userStore.userInfo?.id) import { defineComponent } from 'vue' - +import { http } from '@/utils/http' export default defineComponent({ data() { return { @@ -164,6 +157,30 @@ export default defineComponent({ goPage(item) { getUrl('/pages/about/detail?id=' + item.id) }, + + // 打开地图 + location(res) { + // uni.getLocation({ + // type: 'gcj02', + // success: function (res) { + // console.log(res) + // }, + // }) + // openLocation(res.latitude, res.longitude, res.address, res.address) + openLocation(28.910634, 105.436959) + // http + // .get(`https://test.shop.lihaink.cn/api/lbs/geocoder?location=${28.910634},${105.436959}`) + // .catch((res) => { + // console.log(res) + // // // that.addFrom_address = res.data.address + // // // that.addFrom.province = res.data.address_component.province + // // // that.addFrom.city = res.data.address_component.city + // // // that.addFrom.district = res.data.address_component.district + // // // that.addFrom.latitude = res.data.location.latitude + // // // that.addFrom.longitude = res.data.location.longitude + // // // // that.addFrom.detail = res.data.address_component.street + // }) + }, }, }) diff --git a/src/pages/about/index.vue b/src/pages/about/index.vue index ceefef6..7e2eedb 100644 --- a/src/pages/about/index.vue +++ b/src/pages/about/index.vue @@ -62,7 +62,9 @@ - {{ item.author }} + + {{ item.author }} + {{ item.description }} diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index c48b8fa..ef7cfa3 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -60,21 +60,30 @@ name: '租赁服务', url: '/pages/activity/lease/index', icon: '/static/icons/village_service.png', + type: 3, color: 'green', }, { name: '农事服务', url: '/pages/store/home/index?id=13', icon: '/static/icons/agriculture_service.png', + type: 3, color: 'blue', }, { name: '店铺街', url: '/pages/store/shopStreet/index', icon: '/static/icons/agriculture_course.png', + type: 3, color: 'orange', }, - { name: '美丽乡村', icon: '/static/icons/rural_ecommerce.png', color: 'red' }, + { + name: '村集体', + url: '', + icon: '/static/icons/rural_ecommerce.png', + type: 2, + color: 'red', + }, ]" > @@ -101,7 +110,16 @@ 好物上新季,特产抢先购 - + @@ -116,7 +134,7 @@ @click=" more({ type: 2, - url: ' ', + url: `/pages/goods_details/index?id=${item.product_id} `, }) " v-for="item in product_30" @@ -361,14 +379,14 @@ // import { toLogin } from '@/libs/login.js' import { getProductAPI, getBannerAPI } from '@/service/crmeb/product.ts' import { useUserStore } from '@/store' -import { getUrl, getWebUrl } from '@/utils' +import { getUrl, getWebUrl, getShopWebUrl } from '@/utils' import { getArticleCategoryAPI, getArticleIndexAPI, getArticleDetailAPI, } from '@/service/crmeb/product.ts' const userStore = useUserStore() -const hasLogin = computed(() => userStore.userInfo?.id) + import { defineComponent } from 'vue' export default defineComponent({ @@ -376,7 +394,7 @@ export default defineComponent({ return { show: false, product_30: {}, - swiperList: {}, + swiperList: [], index_eat: {}, index_live: {}, index_play: {}, @@ -456,70 +474,30 @@ export default defineComponent({ url: '/pages-tourism-sub/home/index', }) }, - // more(item) { - // uni.navigateTo({ - // url: `/pages/web_view/index?target=${item.url}&title=${item.name}`, - // }) - // }, + switchTab(index) { uni.switchTab({ url: '/pages/about/index?category_id=' + index, }) }, more(item) { + const hasLogin = userStore.userInfo['id'] ? true : false + if (!hasLogin) { + this.show = true + return + } + console.log(item) if (item.type == 1) { getUrl(item.url) } else if (item.type == 2) { getWebUrl(item.url) + } else if (item.type == 3) { + getShopWebUrl(item.url) } }, }, }) - -// const swiperList = [ -// { -// city: '三江区街道', -// title: -// '因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。', -// url: 'https://img.shetu66.com/2023/07/04/1688453333865029.png', -// }, -// { -// city: '农资供应', -// title: -// '因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。', -// url: 'https://www.keaitupian.cn/cjpic/frombd/2/253/1659552792/3869332496.jpg', -// }, -// { -// city: '土地流转', -// title: -// '因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。', -// url: 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/a6bba9bd1de44293b8d08a64d94775e4.jpg', -// }, -// ] - -// function more { -// console.log('数字乡村详情') -// uni.navigateTo({ -// url: '/pages/index/detail', -// }) -// } -// function more { -// // if (this.isLogin) { -// // const target = encodeURIComponent('/pages/goods_cate/goods_cate') -// const target = '/pages/goods_cate/goods_cate' -// // let urls = 'https://test.shop.lihaink.cn/pages/user/login' -// uni.navigateTo({ -// url: `/pages/web_view/index?target=${target}&title=区域特产`, -// }) -// // } else { -// // this.openAuto() -// // } -// } -// // 打开授权 -// function openAuto() { -// toLogin() -// }