本地添加达人

This commit is contained in:
陈浩 2025-03-24 10:53:42 +08:00
parent 47ce5602e7
commit 57daf0f0f8
16 changed files with 417 additions and 42 deletions

16
App.vue
View File

@ -259,12 +259,12 @@ body {
transition-duration: 300ms;
}
uni-page-body,
html,
body,
page {
width: 100% !important;
height: 100% !important;
overflow: hidden;
}
// uni-page-body,
// html,
// body,
// page {
// width: 100% !important;
// height: 100% !important;
// overflow: hidden;
// }
</style>

View File

@ -12,6 +12,17 @@ export function getAdvertisement() {
});
}
/**
* 像后端传递经纬度
*/
export function postAdvertisementjw(data) {
return http.request({
url: "/member/address/location",
method: Method.POST,
header: { "content-type": "application/x-www-form-urlencoded" },
data
});
}
/**

View File

@ -13,7 +13,7 @@ import {http, Method} from '@/utils/request.js';
*/
export function getStoreList(params) {
return http.request({
url: '/store',
url: '/store/store',
method: Method.GET,
params,
});

View File

@ -7,7 +7,7 @@ export default {
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
aMapKey: "AOHBZ-VCEL3-XX73N-O623U-FMTP6-ASBTD", //在腾讯的中申请web端key
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址

View File

@ -21,7 +21,7 @@
"navigationBarTitleText": "商城",
"navigationStyle": "custom", //
"navigationBarTextStyle": "black",
"enablePullDownRefresh":true
"enablePullDownRefresh": true
}
},
@ -1084,7 +1084,7 @@
},
{
"pagePath": "pages/tabbar/home/index",
"text": "商城"
"text": "本地"
},
{
"pagePath": "pages/tabbar/im/index",

View File

@ -63,6 +63,7 @@ export default {
},
tostorePage(val) {
console.log(val);
uni.navigateTo({
url: "../product/shopPage?id=" + val.storeId,
});

View File

@ -7,21 +7,22 @@
<div class="wrapper" v-if="storeList.length!=0">
<div class="store-item" @click="handleClickStore(item)" v-for="(item,index) in storeList" :key="index">
<div>
<u-image shape="circle" width="100" height="100" :src="item.storeLogo">
<u-image shape="square" width="100" height="100" :src="item.storeLogo">
</u-image>
</div>
<div class="store-msg">
<div class="store-name">
{{item.storeName}}
<div> {{item.storeName}}</div>
<div class="typeof" >{{item.selfOperated?'自营':'非自营'}}</div>
</div>
<div class="goods-num">
商品 {{item.goodsNum}}
商品 {{item.goodsNum}} <span class="line">|</span> <span class="store-collection">收藏 {{item.collectionNum}}</span>
</div>
<div class="flex store-distance">
<div>
<span class="store-score">{{item.serviceScore | unitPrice}}</span>
<span class="line">|</span>
<span class="store-collection">收藏 {{item.collectionNum}}</span>
<template v-for="i in 5">
<u-icon :name="i <= item.serviceScore ? 'star-fill' : 'star'" color="#FF0000" size="30"></u-icon>
</template>
</div>
</div>
</div>
@ -113,11 +114,19 @@ export default {
padding: 24rpx;
}
.store-msg {
width: 100%;
margin-left: 20rpx;
}
.store-name {
font-weight: bold;
font-size: 30rpx;
font-size: 35rpx;
display: flex;
justify-content: space-between;
.typeof{
border: 1px solid red;
color: red;
font-size: 30rpx;
}
}
.goods-num,
.store-collection {

View File

@ -1,7 +1,9 @@
<template>
<div class="wrapper">
<!-- 楼层装修组件 -->
<tpl ref="tpl" />
<!-- 楼层装修组件 -->
<!-- <div v-for="i in 200">{{i}}</div> -->
<tpl ref="tpl" />
</div>
</template>
<script>
@ -15,19 +17,20 @@ export default {
},
};
},
onPullDownRefresh() {
this.$refs.tpl.init();
uni.stopPullDownRefresh();
},
components: {
tpl,
},
onPullDownRefresh() {
console.log("下拉刷新");
this.$refs.tpl.init();
uni.stopPullDownRefresh();
},
};
</script>
<style lang="scss" scoped>
.wrapper{
height: 100%;
}
</style>

View File

@ -0,0 +1,103 @@
<template>
<div class="layout">
<div class="con_view">
<div class="-item-tilte">
<img class="image-mode" style="height: 150px" :src="model.imgs" />
<span> {{ model.name }}</span>
</div>
<div class="sea" @click="clickSwiper">更多></div>
</div>
<!-- <div>自己代码编辑</div> -->
<div class="menu-list" style="overflow-x: auto; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none;">
<div class="menu-item" v-for="(item, index) in res.list" :key="index">
<div>
<img class="menu-img" :src="item.img" alt="" @click="tostorePage(item)" />
</div>
<!-- <div class="menu-title">{{ item.title }}</div> -->
</div>
</div>
</div>
</template>
<script>
import { modelNavigateTo } from "./tpl";
export default {
title: "达人店",
props: ["res","model"],
watch: {
res: {
handler(newValue, oldValue) {
this.$set(this, "res", newValue);
},
deep: true,
},
},
methods: {
//
tostorePage(val) {
uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.url.id,
});
},
//
clickSwiper(index) {
uni.navigateTo({
url: "/pages/product/shopList",
});
},
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.carousel,
.image-mode {
width: 30px;
height: 30px !important;
}
.layout{
background: url('@/static/tanback.png') no-repeat;
background-size: 100% 100%;
}
.con_view {
display: flex;
justify-content: space-between;
}
.-item-tilte {
display: flex;
& > span {
display: flex;
align-items: center;
padding: 10px;
font-weight: 800;
color: white;
}
}
.sea {
display: flex;
align-items: center;
padding: 10px;
color: white;
}
.menu-list {
display: flex;
align-items: center;
// flex-wrap: wrap;
> .menu-item {
text-align: center;
width: 200px;
margin: 10px 10px;
}
}
.menu-img {
width: 60px;
height: 60px;
}
.menu-title {
font-size: 12px;
}
.menu-list::-webkit-scrollbar {
display: none;
}
</style>

View File

@ -0,0 +1,20 @@
<template>
<div class="layout">
<img :src="res.list[0].img" alt="">
</div>
</template>
<script>
export default {
title: "活动",
props: ["res"],
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout{
width: 100%;
height: 100%;
}
</style>

View File

@ -1,38 +1,259 @@
<template>
<div class="layout">
<div class="search" @click="handleSearch">
<u-icon name="search"></u-icon>
{{ res.list[0].title }}
<div class="addres" @click="showPicker" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
{{ cityOrCounty == "" ? "请选择" : cityOrCounty }}
</div>
<div class="search">{{ res.list[0].title }}</div>
<div class="shop" @click="toshop"></div>
<m-city
:provinceData="list"
headTitle="区域选择"
ref="cityPicker"
@funcValue="getpickerParentValue"
pickerSize="3"
>
</m-city>
</div>
</template>
<script>
import config from "@/config/config";
import { postAdvertisementjw } from "@/api/home.js";
import gkcity from "@/components/m-city/m-city.vue";
import { Icon } from "uview-ui";
export default {
title:"搜索栏",
components: {
"m-city": gkcity,
Icon,
},
title: "搜索栏",
props: ["res"],
data() {
return {
location: null,
//
cityOrCounty: uni.getStorageSync("cityOrCounty") || "",
form: {},
list: [
{
id: "",
localName: "请选择",
children: [],
},
],
//
storedLat: uni.getStorageSync("latitude") || null,
storedLon: uni.getStorageSync("longitude") || null,
};
},
mounted() {
// 使
if (this.storedLat && this.storedLon) {
this.form.lat = this.storedLat;
this.form.lon = this.storedLon;
this.getAdvertisementByLocation();
}
//
this.cityOrCounty = uni.getStorageSync("cityOrCounty") || "";
// this.getLocation();
},
methods: {
toshop() {
uni.navigateTo({
url: "/pages/tabbar/cart/cartList",
});
},
//
async getpickerParentValue(e) {
//
this.form.consigneeAddressIdPath = [];
this.form.consigneeAddressPath = [];
let name = "";
e.forEach((item, index) => {
if (item.id) {
//
this.form.consigneeAddressIdPath.push(item.id);
this.form.consigneeAddressPath.push(item.localName);
name += item.localName;
this.form.___path = name;
}
if (index == e.length - 1) {
//
let _town = item.children.filter((_child) => {
return _child.id == item.id;
});
this.form.lat = _town[0].center.split(",")[1];
this.form.lon = _town[0].center.split(",")[0];
}
});
const jwobj = {
longitude: Number(this.form.lon),
latitude: Number(this.form.lat),
};
const { data } = await postAdvertisementjw(jwobj);
if (data.success) {
//
this.cityOrCounty = this.form.consigneeAddressPath[2];
uni.setStorageSync("cityOrCounty", this.cityOrCounty);
//
uni.setStorageSync("longitude", this.form.lon);
uni.setStorageSync("latitude", this.form.lat);
//
this.storedLat = this.form.lat;
this.storedLon = this.form.lon;
}
},
// 广
async getAdvertisementByLocation() {
const jwobj = {
longitude: Number(this.storedLon),
latitude: Number(this.storedLat),
};
const { data } = await postAdvertisementjw(jwobj);
if (data.success) {
//
}
},
showPicker() {
this.$refs.cityPicker.show();
},
handleSearch() {
uni.navigateTo({
url: "/pages/navigation/search/searchPage",
});
},
// async getLocation() {
// const permision = await import("@/js_sdk/wa-permission/permission.js");
// // #ifdef APP-PLUS
// if (plus.os.name == "iOS") {
// if (permision.judgeIosPermissionLocation()) {
// this.getLocationInfo();
// } else {
// this.refuseLocation();
// }
// } else {
// const result = await permision.requestAndroidPermission(
// "android.permission.ACCESS_FINE_LOCATION"
// );
// if (result == 1) {
// this.getLocationInfo();
// } else {
// this.refuseLocation();
// }
// }
// // #endif
// // #ifndef APP-PLUS
// this.getLocationInfo();
// // #endif
// },
// getLocationInfo() {
// uni.getLocation({
// type: "wgs84",
// success: async (resss) => {
// this.location = resss;
// console.log("", resss);
// const jwobj = {
// latitude: resss.latitude,
// longitude: resss.longitude,
// };
// const { data } = await postAdvertisementjw(jwobj);
// if (data.success) {
// uni.request({
// url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${resss.latitude},${resss.longitude}&key=${config.aMapKey}`,
// success: (res) => {
// console.log("API", res);
// this.cityOrCounty = res.data.result.address_component.district || res.data.result.address_component.city;
// uni.setStorageSync('cityOrCounty', this.cityOrCounty);
// //
// uni.setStorageSync('longitude', resss.longitude);
// uni.setStorageSync('latitude', resss.latitude);
// //
// this.storedLat = resss.latitude;
// this.storedLon = resss.longitude;
// },
// fail: (error) => {
// uni.showToast({
// title: "222",
// icon: "none"
// });
// }
// });
// }
// },
// fail: (err) => {
// console.error("", err);
// },
// });
// },
// refuseLocation() {
// uni.showModal({
// title: "",
// content: ",",
// confirmText: "",
// success(res) {
// if (res.confirm) {
// //
// // #ifndef MP-WEIXIN
// uni.getSystemInfo({
// success(res) {
// if (res.platform == "ios") {
// //IOS
// plus.runtime.openURL("app-settings://");
// } else if (res.platform == "android") {
// //
// let main = plus.android.runtimeMainActivity();
// let Intent = plus.android.importClass(
// "android.content.Intent"
// );
// let mIntent = new Intent("android.settings.ACTION_SETTINGS");
// main.startActivity(mIntent);
// }
// },
// });
// // #endif
// }
// },
// });
// },
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.search {
height: 64rpx;
border-radius: 10rpx;
width: 68%;
height: 32px;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
background: #ededed;
}
.layout {
background: #fff;
padding: 0 16rpx;
display: flex;
justify-content: space-between;
}
.addres {
// width: 15%;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
}
.layout {
background: #fff;
display: flex;
justify-content: space-between;
}
.shop {
width: 10%;
height: 32px;
display: flex;
background: url("@/static/shop.png") no-repeat;
background-size: 100% 100%;
}
</style>

View File

@ -18,14 +18,17 @@
<leftTwoRightOne v-if="item.type == 'leftTwoRightOne'" :res="item.options" />
<topOneBottomTwo v-if="item.type == 'topOneBottomTwo'" :res="item.options" />
<topTwoBottomOne v-if="item.type == 'topTwoBottomOne'" :res="item.options" />
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
<textPicture v-if="item.type == 'textPicture'" :res="item.options" />
<menuLayout v-if="item.type == 'menu'" :res="item.options" />
<flexOne v-if="item.type == 'flexOne'" :res="item.options" />
<activity v-if="item.type == 'activity'" :res="item.options" />
<Talent v-if="item.type == 'talent'" :res="item.options" :model="item" />
<goods v-if="item.type == 'goods'" :res="item.options" />
<group v-if="item.type == 'group'" :res="item.options" />
@ -56,6 +59,8 @@ import tpl_menu from "@/pages/tabbar/home/template/tpl_menu"; //五列菜单模
import tpl_search from "@/pages/tabbar/home/template/tpl_search"; //
import tpl_group from "@/pages/tabbar/home/template/tpl_group"; //
import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //
import Talent from "@/pages/tabbar/home/template/Talent"; //
import tpl_activity from "@/pages/tabbar/home/template/tpl_activity"; //
//
import { getFloorData } from "@/api/home"; //
import permision from "@/js_sdk/wa-permission/permission.js"; //
@ -90,6 +95,8 @@ export default {
flexOne: tpl_flex_one,
goods: tpl_goods,
group: tpl_group,
Talent,
activity: tpl_activity,
// spike: tpl_spike,
// joinGroup: tpl_join_group,
// integral: tpl_integral,
@ -102,7 +109,7 @@ export default {
uni.showShareMenu({ withShareTicket: true });
// #endif
},
methods: {
/**
* 实例化首页数据楼层
@ -112,6 +119,7 @@ export default {
getFloorData().then((res) => {
if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData);
console.log(this.pageData.list);
}
});
},
@ -128,7 +136,6 @@ export default {
uni.scanCode({
success: function (res) {
let path = encodeURIComponent(res.result);
// WX_CODE
if (res.scanType == "WX_CODE") {
console.log(res)
@ -208,14 +215,14 @@ export default {
this.seacnCode();
// #endif
},
},
};
</script>
<style scoped lang="scss">
.wrapper{
height: auto;
overflow-y: auto; /* 当内容超出时显示垂直滚动条 */
height: 100%;
}
.navbar-right {
padding: 0 16rpx 0 0;

BIN
static/shop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/tabbar/bei.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

BIN
static/tabbar/shop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/tanback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB