Commit e87b4489 by 侯体倬

Merge branch 'xhyx/release' into 'xhyx/hotfix'

Xhyx/release

See merge request !1
parents 44ec7684 63990eda
......@@ -1539,13 +1539,15 @@
}
},
"call-bind": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz",
"integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
"integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
"requires": {
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.1",
"set-function-length": "^1.1.1"
"get-intrinsic": "^1.2.4",
"set-function-length": "^1.2.1"
},
"dependencies": {
"function-bind": {
......@@ -3267,13 +3269,13 @@
}
},
"define-data-property": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz",
"integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
"integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
"requires": {
"get-intrinsic": "^1.2.1",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.0"
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
"gopd": "^1.0.1"
}
},
"define-properties": {
......@@ -3676,6 +3678,19 @@
"string.prototype.trimstart": "^1.0.1"
}
},
"es-define-property": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
"integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
"requires": {
"get-intrinsic": "^1.2.4"
}
},
"es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="
},
"es-to-primitive": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
......@@ -4464,10 +4479,11 @@
"dev": true
},
"get-intrinsic": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz",
"integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
"integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
"requires": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2",
"has-proto": "^1.0.1",
"has-symbols": "^1.0.3",
......@@ -4632,17 +4648,17 @@
"dev": true
},
"has-property-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz",
"integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
"integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
"requires": {
"get-intrinsic": "^1.2.2"
"es-define-property": "^1.0.0"
}
},
"has-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
"integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg=="
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
"integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q=="
},
"has-symbols": {
"version": "1.0.1",
......@@ -4729,9 +4745,9 @@
}
},
"hasown": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
"integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"requires": {
"function-bind": "^1.1.2"
},
......@@ -5752,9 +5768,9 @@
"dev": true
},
"mayi-analytics": {
"version": "1.1.57",
"resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.57.tgz",
"integrity": "sha512-iN+IQjLKH30enCYMt0iMz+CgGuRoDXC3vBxwuDeIBTuAPN7s3dYqQL3Vf8sPqLYUSZC1OxhEwo6et4KzZxC9Cg==",
"version": "1.1.59",
"resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.59.tgz",
"integrity": "sha512-ci3G4JOHsaKfgu31DzAVVvllToxPU3XuBvQEuorzxVYmCL5yeyG6fX4e6QqcWx2DvJG0g4Sa2GWAvSAfjr3hEA==",
"requires": {
"js-cookie": "^2.2.0",
"qs": "^6.7.0",
......@@ -5762,11 +5778,11 @@
},
"dependencies": {
"qs": {
"version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
"integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
"version": "6.12.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz",
"integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==",
"requires": {
"side-channel": "^1.0.4"
"side-channel": "^1.0.6"
}
}
}
......@@ -8817,15 +8833,16 @@
"dev": true
},
"set-function-length": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz",
"integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
"integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
"requires": {
"define-data-property": "^1.1.1",
"define-data-property": "^1.1.4",
"es-errors": "^1.3.0",
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.2",
"get-intrinsic": "^1.2.4",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.1"
"has-property-descriptors": "^1.0.2"
},
"dependencies": {
"function-bind": {
......@@ -8916,13 +8933,14 @@
}
},
"side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
"integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
"call-bind": "^1.0.7",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.4",
"object-inspect": "^1.13.1"
},
"dependencies": {
"object-inspect": {
......
......@@ -30,7 +30,7 @@
"build:my": "node build/build.js my"
},
"dependencies": {
"mayi-analytics": "^1.1.57",
"mayi-analytics": "^1.1.59",
"mayi-front-tools": "^1.0.3",
"mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5",
......
......@@ -20,6 +20,11 @@ export default {
return requestPOST(`${process.env.OLSHOP_URL}/cms/get_shop_install_pages?homePageFlag=${params.homePageFlag || false}&shopMixId=${params.shopMixId}`,
);
},
// 页面数据V2
themePagesInfoV2(params) {
return requestPOST(`${process.env.OLSHOP_URL}/cms/get_shop_install_pages_v2?homePageFlag=${params.homePageFlag || false}&shopMixId=${params.shopMixId}`,
);
},
// 查单页面
singlePageInfo(params) {
return requestPOST(`${process.env.OLSHOP_URL}/cms/get_shop_page_by_id?id=${params.id}`,
......@@ -89,6 +94,13 @@ export default {
data
);
},
// 进店规则获取门店id预进入门店
getEnterShopIdV1(data) {
return requestPOST(
`${process.env.OLSHOP_URL}/enterShopRule/getEnterShopIdV1`,
data
);
},
// 商城二维码分配组织或跟进人
ShopCodeDistributionOrg(data) {
return requestPOST(
......
......@@ -11,7 +11,6 @@
"pages/tabBar2/main",
"pages/tabBar3/main",
"pages/tabBar4/main",
"pages/changeAdr/main",
"pages/wxArticle/main",
"pages/userInfo/main",
"pages/memberCode/main",
......
......@@ -22,7 +22,6 @@ export default {
}
},
components: {
// 'area-navigation' : () => import('~/components/theme/components/other/area-navigation')
},
data() {
return {
......@@ -55,13 +54,14 @@ export default {
mounted() {
this.bacImage = `url(${this.pageSettingData.backgroundImage})`;
this.imgRgb = `${this.pageSettingData.backgroundColor}`;
this.mpApp.setStoreAddrColor(this.imgRgb);
},
computed: {
},
methods: {
setHomeBgImg({ backgroundImage, imgRgb }) {
// this.bacImage = backgroundImage;
this.mpApp.setStoreAddrColor(imgRgb);
if (this.pageCode != 1) return;
this.bacImage = "";
this.imgRgb = imgRgb;
......
......@@ -8,7 +8,6 @@
"time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index",
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index",
......
......@@ -4,7 +4,9 @@
<div class="logo">
<image :src="logoUrl" alt=""></image>
</div>
<div class="contentInfo flex" v-if="name != ''">
<div class="contentInfo flex" v-if="name != ''" :style="{
'color': imgRgb,
}">
<p class="info">{{ name }}</p>
<p class="addr" v-if="distanceForXinHua">{{ distanceForXinHua | formatDistance}}</p>
<p class="change"><i class="ant-fanhui-line"></i></p>
......@@ -36,9 +38,11 @@ export default {
logoUrl: "",
openThousandsStoresFlag: false,
distanceForXinHua: 0,
imgRgb: "",
};
},
async onLoad() {
this.mpApp.setStoreAddrColor = this.setStoreAddrColor;
try {
this.getLocationHandle(() => {
this.$emit("toUpdate");
......@@ -63,6 +67,13 @@ export default {
computed: {
},
methods: {
setStoreAddrColor(imgRgb) {
if (imgRgb != 'undefined' && imgRgb != 'null' && imgRgb != '' && imgRgb != null && imgRgb != undefined) {
this.imgRgb = imgRgb;
} else {
this.imgRgb = '#333';
}
},
reloadName() {
let { offlineShopName } = getStoreInfo();
this.name = decodeURI(offlineShopName) || "";
......@@ -135,30 +146,31 @@ export default {
align-items: center;
.contentInfo {
height: 0;
background-color: currentColor;
align-items: center;
p{
filter: grayscale(1) contrast(999) invert(1);
}
.info {
font-size: 14px;
color: #333;
flex: 1;
}
.addr{
font-size: 12px;
margin-left: 4px;
color: #333;
}
.change {
flex-shrink: 0;
padding-left: 6px;
color: #333;
font-size: 14px;
align-items: center;
i{
display: inline-block;
transform: rotateZ(-90deg);
font-weight: bold;
color: #333;
margin-top: 4px;
}
}
......
......@@ -17,9 +17,6 @@
<div v-else-if="item1.componentCode == 'ranking-list' && item1.componentInfo.visible == 1">
<ranking-list :datas="item1"></ranking-list>
</div>
<div v-else-if="item1.componentCode == 'area-navigation' && item1.componentInfo.visible == 1">
<area-navigation :datas="item1" :changeLocation="changeLocation"></area-navigation>
</div>
<div v-else-if="item1.componentCode == 'cube-nav' && item1.componentInfo.visible == 1">
<cube-nav :datas="item1"></cube-nav>
</div>
......
......@@ -8,7 +8,6 @@
"time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index",
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index",
......
......@@ -106,7 +106,9 @@ mpApp.openSelectGoods = function () { }
// 打开选择商品规格(2B)弹窗
mpApp.openTwoBAddCart = function () { }
// 动态设置首页背景图片
mpApp.setHomeBgImg = function () {}
mpApp.setHomeBgImg = function () { }
// 动态设置导航栏颜色
mpApp.setStoreAddrColor = function () {}
/**
* 组件点击行为收集
......@@ -188,15 +190,14 @@ function getThemePage({ mixid, shopid }) {
let userId
// 分销员 id
let spokesmanId
let startViewTime = new Date().getTime(); // 进入时间
let endViewTime = null; // 跳出时间
let viewPageList = []; // 两个参数 上一个页面、当前页面
/**
* 全局页面切换监听
*/
wx.onAppRoute(res => {
// 获取当前页面信息
let currentPage = getCurrentPages()
console.log(currentPage,'--currentPage')
console.log(res,'--res')
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
console.log(res, '--res')
let whetherToForceLogin = mpApp.globalData.shopInfo && mpApp.globalData.shopInfo.whetherToForceLogin || 0
log.info("wx.onAppRoute", res, mpApp.globalData.shopInfo, whetherToForceLogin, wx.getStorageSync('sessionid'), res.path != "pages/login/main");
console.log(res,mpApp.globalData.shopInfo,whetherToForceLogin,wx.getStorageSync('sessionid'),res.path !="pages/login/main",'---------wx.onAppRoute')
......@@ -250,5 +251,40 @@ wx.onAppRoute(res => {
log.info("mpBehavior.trackPageView",trackPageViewQuery)
console.log("mpBehavior.trackPageView",trackPageViewQuery)
mpBehavior.trackPageView(trackPageViewQuery);
trackPageLeave(res);
})
})
/**
* 页面访问时长埋点
* @param {*} res
*/
function trackPageLeave() {
endViewTime = new Date().getTime();
const duration = endViewTime - startViewTime;
// 获取当前页面信息
let currentPage = getCurrentPages()
if (viewPageList.length == 0) {
viewPageList = [currentPage[currentPage.length - 1]]
} else {
viewPageList = [currentPage[currentPage.length - 1], viewPageList[0]]
}
console.log('trackPageLeave-viewPageList->', viewPageList);
if (!isNaN(duration) && viewPageList.length > 1) {
let pagePath = viewPageList[1].route;
let pageQuery = viewPageList[1].options;
let query = {
title: '',
location: pagePath, // 需要存上一个页面的
path: `${pagePath}${serialize(pageQuery)?('?'+serialize(pageQuery)):''}`,
sales: spokesmanId || "",
userId: userId || "",
lsdcode: getStoreInfo().offlineShopCode,
lsdname: getStoreInfo().offlineShopName,
}
query.amount = duration / 1000
mpBehavior.trackPageLeave(query)
}
console.log('trackPageLeave-duration->', query.amount);
startViewTime = endViewTime;
}
\ No newline at end of file
<template>
<div class="con">
<div class="tabbar" :style="{'height' : tabbarHeight + 'px','padding-top':systemInfo.statusBarHeight + 'px'}" @click="back">
<div class="tab-back">
<van-icon name="arrow-left" />
</div>
</div>
<div class="container1">
<div class="title">当前定位城市</div>
<div class="position">
<div>
<div class="city" @click="changeCity(positionCity,1)" v-if="locationStatus && positionCity.operatingAreaAreaId">{{ positionCity.regionName }}</div>
<div
class="position-err"
v-if="!locationStatus && !reLocationStatus"
@click="reLocation"
>
定位失败,点击重试
</div>
<div
class="position-err"
v-if="locationStatus && !positionCity.operatingAreaAreaId"
>
{{positionCity.regionName}}(该地区暂未开放)
</div>
<div v-if="reLocationStatus" style="padding-bottom:10px">
<van-loading type="spinner" size="18" />
<span style="font-size:14px;line-height:20px;vertical-align:top;margin-left:4px">正在定位...</span>
</div>
</div>
<div class="reset-position" @click="resetPosition">重新定位</div>
</div>
<div class="title" style="margin-top:10px">选择其他城市</div>
<div class="city-list clearfix">
<div class="item fl" v-for="item in cityList" :key="item.id" @click="changeCity(item,2)">
{{ item.regionName }}
</div>
</div>
</div>
</div>
</template>
<script>
import changeAdr from '@/api/changeAdr'
export default {
data(){
return{
cityList: [],
positionCity: {},
locationStatus: false,
reLocationStatus: true,
systemInfo : null,
tabbarHeight : 0,
noLocation : '',
areaGroupId : ''
}
},
onLoad(options){
this.noLocation = options.noLocation
this.areaGroupId = options.areaGroupId
this.systemInfo = wx.getSystemInfoSync()
let menuButtonInfo = wx.getMenuButtonBoundingClientRect()
console.log(menuButtonInfo,'menuButtonInfo')
this.tabbarHeight = (menuButtonInfo.top - this.systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + this.systemInfo.statusBarHeight
console.log(options)
this.locationStart();
changeAdr.query_operating_area_area_list(options.areaGroupId).then(res => {
console.log(res.data)
if(res.data.code == '200'){
if(res.data.data){
res.data.data.forEach(item => {
item.areaGroupId= options.areaGroupId
})
this.cityList = res.data.data
}
}
})
},
methods:{
back(){
if(this.noLocation == '1'){
wx.showModal({
title: '提示',
content: '请选择定位地址',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
return
}
wx.navigateBack()
},
changeCity(item,type){
this.locationStatus = true
if(type == 1){
wx.setStorageSync('location',JSON.stringify({
id : item.operatingAreaAreaId,
regionName : item.regionName,
regionType : item.regionType,
systemRegionId : item.systemRegionId,
areaGroupId : this.areaGroupId,
outId : item.outId
}))
}else{
wx.setStorageSync('location',JSON.stringify({
id : item.id,
regionName : item.regionName,
regionType : item.regionType,
systemRegionId : item.systemRegionId,
areaGroupId : this.areaGroupId,
outId : item.outId
}))
}
this.define()
},
define(){
// wx.setStorageSync('changeAdr','changeAdr')
wx.reLaunch({
url : '/pages/home/main?changeLocation=1'
})
},
locationStart(type){
console.log(wx.getStorageSync('location'),'2222222222222222222222222222')
let _this = this
if(wx.getStorageSync('location')){
let location = wx.getStorageSync('location') && JSON.parse(wx.getStorageSync('location'))
this.positionCity = {
operatingAreaAreaId : location.id,
regionName : location.regionName,
regionType : location.regionType,
systemRegionId : location.systemRegionId,
areaGroupId : location.areaGroupId,
}
if(!type){
this.reLocationStatus = false;
this.locationStatus = true;
return
}
wx.getLocation({
type: 'wgs84',
success:function(res){
const latitude = res.latitude
const longitude = res.longitude
console.log('定位成功',res)
changeAdr.query_Location_operating_area_area_list({
location : longitude + ',' + latitude
}).then(res => {
if(res.data.code == '200'){
let city = '';
res.data.data.forEach(item => {
if(item.operatingAreaAreaId){
city = item
}
})
if(city == ''){
_this.positionCity = res.data.data[0];
}else{
_this.positionCity = city;
}
_this.reLocationStatus = false;
_this.locationStatus = true;
}else{
wx.showModal({
title: '提示',
content: '定位失败,请检查是否开启了定位服务',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
_this.reLocationStatus = false;
_this.locationStatus = false;
}
})
},
fail:function(err){
console.log('定位失败',err)
wx.showModal({
title: '提示',
content: '定位失败,请检查是否开启了定位服务',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
_this.reLocationStatus = false;
_this.locationStatus = false;
}
})
}else{
wx.getLocation({
type: 'wgs84',
success:function(res){
const latitude = res.latitude
const longitude = res.longitude
console.log('定位成功',res)
changeAdr.query_Location_operating_area_area_list({
location : longitude + ',' + latitude
}).then(res => {
if(res.data.code == '200'){
let city = '';
res.data.data.forEach(item => {
if(item.operatingAreaAreaId){
city = item
}
})
if(city == ''){
_this.positionCity = res.data.data[0];
}else{
_this.positionCity = city;
}
_this.reLocationStatus = false;
_this.locationStatus = true;
}else{
wx.showModal({
title: '提示',
content: '定位失败,请检查是否开启了定位服务',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
_this.reLocationStatus = false;
_this.locationStatus = false;
}
})
},
fail:function(err){
console.log('定位失败',err)
wx.showModal({
title: '提示',
content: '定位失败,请检查是否开启了定位服务',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
_this.reLocationStatus = false;
_this.locationStatus = false;
}
})
}
},
resetPosition(){
this.reLocationStatus = true
this.locationStatus = false
this.locationStart(1)
},
reLocation() {
this.reLocationStatus = true;
this.locationStart();
},
}
}
</script>
<style lang="scss" scoped>
.tabbar{
width: 100%;
background-color: white;
box-sizing: border-box;
}
.tab-back{
width: 50px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.con {
min-height: 100vh;
background-color: #f3f3f3;
}
.container1 {
padding: 10px;
}
.title {
color: #999;
}
.position {
margin-top: 6px;
display: flex;
justify-content: space-between;
align-items: center;
.city {
padding: 6px 36px;
font-size: 14px;
color: #333;
background-color: white;
border: 1px solid #ddd;
display: inline-block;
}
.position-err {
font-size: 14px;
padding-bottom: 10px;
}
.reset-position{
color: var(--main-color);
}
}
.city-list {
margin-top: 6px;
.item {
padding: 6px 30px;
font-size: 14px;
margin-right: 10px;
color: #333;
background-color: white;
border: 1px solid #ddd;
margin-bottom: 10px;
display: inline-block;
}
}
.van-loading {
height: 20px;
width: 20px;
display: inline-block;
vertical-align: bottom;
margin-right: 4px;
}
</style>
\ No newline at end of file
import Vue from 'vue'
import App from './index'
const app = new Vue(App)
app.$mount()
\ No newline at end of file
{
"usingComponents": {
"van-loading": "/static/vant/loading/index",
"van-icon": "/static/vant/icon/index"
},
"navigationStyle":"custom"
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
</div> -->
<CustomNav :customBgOpacity="customBgOpacity"></CustomNav>
<StoreAddr v-if="showStoreAddr" @toUpdate="reloadEnterShopRule" @toPageLoading="toPageLoading" ref="StoreAddr"></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<ThemeDataPlant v-if="!pageLoading"></ThemeDataPlant>
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1">
<banner :datas="item"></banner>
......@@ -21,9 +21,6 @@
<div v-else-if="item.componentCode == 'ranking-list' && item.componentInfo.visible == 1">
<ranking-list :datas="item"></ranking-list>
</div>
<div v-else-if="item.componentCode == 'area-navigation' && item.componentInfo.visible == 1">
<area-navigation :datas="item" :changeLocation="changeLocation"></area-navigation>
</div>
<div v-else-if="item.componentCode == 'cube-nav' && item.componentInfo.visible == 1">
<cube-nav :datas="item"></cube-nav>
</div>
......@@ -207,22 +204,22 @@ export default {
pageInfo: {},
pageData: [],
contentList: [],
themeColor:{
'--main-color':"",
'--minor-color':"",
themeColor: {
'--main-color': "",
'--minor-color': "",
},
changeLocation : '',
beforeScrollTop:0,
changeLocation: '',
beforeScrollTop: 0,
showSpokesManHome: false,//分销商货架是否展示
showMyCard: false,
showHomepage: false,//分销商首页入口
applySucessEntry: false,//成为分销弹框
getDistributorHomepageName: '',//小店入口名称
active:-1,
active: -1,
toHomePage: false,//是否分销隔断
options: 1,
// 新人有礼
newGiftList:[],
newGiftList: [],
newCustomerGiftActivityId: "", //新客活动id
showNewUser: false, //新客有礼入口
showgiftBag: false, //新客礼包弹框
......@@ -240,6 +237,9 @@ export default {
customBgOpacity: true, // 沉浸式风格
reloadPage: false, // 切换门店进入首页重新获取相关配置
showStoreAddr: false,
preEntryStoreId: "", // 预进入门店code
preEntryStore: {}, // 预进入门店
storeDetail: {},
};
},
components:{
......@@ -573,8 +573,6 @@ export default {
}
// 新人有礼弹窗
this.newUserFun();
// 新店调试
this.debugShopFun();
//清除商品列表组件懒加载缓存
// 需清除的缓存keyList
......@@ -594,6 +592,7 @@ export default {
}
}
})
await this.getEnterShopIdV1();
},
setPageLoading() {
setTimeout(() => {
......@@ -620,6 +619,7 @@ export default {
}
},
async enterStoreRule() {
let _this = this;
try {
console.log(wx.getStorageSync("locationObj"),'--locationObj')
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
......@@ -634,37 +634,97 @@ export default {
console.log(`%cgetEnterShopId${JSON.stringify(res)}`,'color:yellow;font-size:20px;')
if (res.data.code == 200) {
let enterShopId = res.data.data;
console.log(enterShopId,'--enterShopId')
if (enterShopId) {
let storeDetail = await shop.getOfflineStoreDetail({
shopId: enterShopId,
});
if (storeDetail.data.code == 200) {
setStoreInfo({
offlineShopCode: storeDetail.data.data.shopCode,
offlineShopName: storeDetail.data.data.shopName,
});
this.$refs.StoreAddr.reloadName();
console.log("refreshInit--------3")
this.refreshInit();
}
console.log(storeDetail, '-------storeDetail');
let loginUserInfo = wx.getStorageSync("loginUserInfo") || null;
let query2 = {
telephoneNum: loginUserInfo && loginUserInfo.mobilephone,
enterShopSource: "买家直接进入",
hitRule: "首页进入",
shopName: storeDetail.data.data.shopName,
}
log.info("进店规则-----",query2)
shop.saveEnterShopRecord(query2);
console.log(enterShopId, '--enterShopId');
let storeDetail = await shop.getOfflineStoreDetail({
shopId: enterShopId,
});
if (storeDetail.data.code == 200) {
this.storeDetail = storeDetail.data.data;
}
console.log('enterStoreRule->', this.preEntryStoreId, enterShopId)
if (this.preEntryStoreId && this.preEntryStoreId != enterShopId) {
wx.showModal({
title: '提醒',
content: `当前定位最近门店【${this.storeDetail.shopName}】是否要进入该门店?`,
success (res) {
if (res.confirm) {
_this.enterStore(enterShopId);
} else if (res.cancel) {
console.log('用户点击取消')
_this.setPageLoading();
}
}
})
} else {
await this.enterStore(enterShopId);
}
}
} catch (error) {
console.log('enterStoreRule-error->', error)
}
// this.setPageLoading();
},
async getEnterShopIdV1() {
// 如果url有参数就return
if (this.h5Params && this.h5Params.offlineShopCode) {
return;
}
this.preEntryStoreId = "";
try {
let res = await shop.getEnterShopIdV1({
channelType: 2,
consumerLongitude: "",
consumerLatitude: "",
distributionOfficerShopCode: ""
});
if (res.data.code == 200 && !isNaN(res.data.data - 0)) {
this.preEntryStoreId = res.data.data;
let storeDetail = await shop.getOfflineStoreDetail({
shopId: this.preEntryStoreId,
});
if (storeDetail.data.code == 200) {
this.storeDetail = storeDetail.data.data;
}
await this.enterStore(this.preEntryStoreId);
}
} catch (error) {
console.log('getEnterShopIdV1-error->', error)
}
},
async enterStore(enterId) {
if (enterId) {
if (this.storeDetail.shopCode) {
setStoreInfo({
offlineShopCode: this.storeDetail.shopCode,
offlineShopName: this.storeDetail.shopName,
});
this.$refs.StoreAddr.reloadName();
console.log("refreshInit--------3")
// this.refreshInit();
let that = this;
console.log("onPullDownRefresh");
console.log("refreshInit--------4")
this.refreshInit();
this.mpApp.pageCallBack = function (params) {
console.log("获取页面数据-3",params)
that.init(params);
};
}
console.log(this.storeDetail, '-------this.storeDetail');
let loginUserInfo = wx.getStorageSync("loginUserInfo") || null;
let query2 = {
telephoneNum: loginUserInfo && loginUserInfo.mobilephone,
enterShopSource: "买家直接进入",
hitRule: "首页进入",
shopName: this.storeDetail.shopName,
}
log.info("进店规则-----",query2)
shop.saveEnterShopRecord(query2);
}
},
getOfflineStoreDetail() {
},
toPageLoading() {
},
async setVisible(pageList, cb) {
......@@ -1193,6 +1253,9 @@ export default {
} catch (error) {
}
// 新店调试
this.debugShopFun();
this.setPageLoading();
wx.stopPullDownRefresh();
},
ShopCodeDistributionOrg() {
......
......@@ -12,7 +12,6 @@
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index",
"van-stepper": "/static/vant/stepper/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index",
......
......@@ -109,7 +109,7 @@ export default {
if(!this.withoutScene) {
return;
}
this.newPageUrl = this.pageUrl;
this.newPageUrl = this.removeEmptyQueryParams(this.pageUrl);
console.log('------------------index----2')
// 进入直播页面调用不息屏api
console.log(this.pageUrl,this.pageUrl.includes('/liveBroadcast/lived'),"this.pageUrl.includes('/liveBroadcast/lived')")
......@@ -159,7 +159,11 @@ export default {
}
},
onLoad(options) {
wx.removeStorageSync("firstView");
let { offlineShopCode, offlineShopName } = getStoreInfo();
// 新用户首次扫码进入此页没缓存认定为第一次访问
if (offlineShopCode) {
wx.removeStorageSync("firstView");
}
console.log(options,'---options')
if(wx.getStorageSync("sessionid")) {
......@@ -498,7 +502,7 @@ export default {
}
}
this.newPageUrl = this.pageUrl;
this.newPageUrl = this.removeEmptyQueryParams(this.pageUrl);
console.log('this.newPageUrl', this.newPageUrl)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
if (this.newPageUrl.includes('/goods/') && (options.share || options.share_copy)) {
......@@ -712,6 +716,31 @@ export default {
}
return '';
},
// 将多余的参数删除: ?abc=&cba=1 => ?cba=1
removeEmptyQueryParams(url) {
try {
// 分割URL,分离基础URL和查询字符串
const [baseUrl, queryPart] = url.split('?');
// 若没有查询字符串,直接返回基础URL
if (!queryPart) return baseUrl;
// 分割查询字符串为参数数组
const queryParams = queryPart.split('&');
// 过滤掉空值参数
const filteredParams = queryParams.filter(param => {
const [key, value] = param.split('=');
return value;
});
// 重新组合查询字符串并附加到基础URL上
const cleanedQuery = filteredParams.join('&');
return baseUrl + (cleanedQuery ? `?${cleanedQuery}` : '');
} catch (err) {
console.log('parseUrlError:', err);
return url;
}
}
},
onUnload() {
......
......@@ -43,7 +43,6 @@ export const noLoginList = [
"personalCenter-spokesmanCenter-mine-spokesmanHomePage",
"liveBroadcast-lived",
"personalCenter-spokesmanCenter-mine-getBusinessCard",
"changeAdr"
];
// path
export const noLoginListPath = noLoginList.map(item => {
......
// static/nativeComponents/AreaNavigation/index.js
const app = getApp()
const { indexApi } = app;
Component({
/**
* 组件的属性列表
*/
properties: {
datas : {
type : Object
},
changeLocation:{
type : String
}
},
/**
* 组件的初始数据
*/
data: {
noShow : false,
positionCity: "",
changeShow: false,
positionName: '定位中',
wxReady: false,
designateAreaObj : null,
showSpokesManHome: false,
},
ready(){
console.log('++++++++++++++++++++定位组件加载好了++++++++++++++++++++')
console.log(this.data.changeLocation,'changeLocation')
console.log(getCurrentPages())
this.setData({
designateAreaObj: this.data.datas.componentData.designateAreaObj
})
//分销商货架存在
if(
app.fenxiaoModel.spokesmanInfo&&
app.fenxiaoModel.spokesmanInfo.parentSpokesmanDistributionModel == '1'&&
app.fenxiaoModel.spokesmanInfo.distributorHomepage.id
) {
this.setData({
showSpokesManHome: true
})
}else {
this.setData({
showSpokesManHome: false
})
}
console.log(this.data.datas.componentData.designateAreaObj,'2222')
if (!wx.getStorageSync('location')) {
wx.navigateTo({
url: `/pages/changeAdr/main?areaGroupId=${this.data.datas.componentData.designateAreaObj.areaGroupId}&noLocation=1`
})
return
}
if (this.data.datas.componentInfo.visible == 1) {
let _this = this;
if (wx.getStorageSync('location')) {
this.setData({
'designateAreaObj.id': JSON.parse(wx.getStorageSync('location')).id,
'designateAreaObj.regionName': JSON.parse(wx.getStorageSync('location')).regionName,
'designateAreaObj.regionType': JSON.parse(wx.getStorageSync('location')).regionType,
'designateAreaObj.systemRegionId': JSON.parse(wx.getStorageSync('location')).systemRegionId,
'designateAreaObj.outId': JSON.parse(wx.getStorageSync('location')).outId,
'designateAreaObj.areaGroupId': JSON.parse(wx.getStorageSync('location')).areaGroupId,
})
this.setData({
positionName: this.data.designateAreaObj.regionName
})
}
console.log('组件1', this.data.designateAreaObj)
if(this.data.changeLocation == 1){
return
}
wx.getLocation({
type: 'wgs84',
success(res) {
console.log('组件1111', _this.data.designateAreaObj)
console.log(res, '++++++++++获取地区')
const latitude = res.latitude
const longitude = res.longitude
console.log('组件2', _this.data.designateAreaObj)
indexApi.queryLocation(longitude, latitude).then(data => {
if (data.data.code == '200') {
let city = ''
data.data.data.forEach(item => {
if (item.operatingAreaAreaId) {
city = item;
}
})
if (city == '') {
_this.setData({
positionCity: data.data.data[0]
})
} else {
_this.setData({
positionCity: city
})
}
if(!wx.getStorageSync('location')){
_this.setData({
'designateAreaObj.id': _this.data.positionCity.operatingAreaAreaId,
'designateAreaObj.regionName': _this.data.positionCity.regionName,
'designateAreaObj.regionType': _this.data.positionCity.regionType,
'designateAreaObj.systemRegionId': _this.data.positionCity.systemRegionId,
'designateAreaObj.outId': _this.data.positionCity.outId,
})
}
console.log(_this.data.positionCity, '定位城市信息')
console.log(_this.data.designateAreaObj, '组件信息')
let str = JSON.stringify({
id: _this.data.positionCity.operatingAreaAreaId,
regionName: _this.data.positionCity.regionName,
regionType: _this.data.positionCity.regionType,
systemRegionId: _this.data.positionCity.systemRegionId,
outId: _this.data.positionCity.outId,
areaGroupId: _this.data.designateAreaObj.areaGroupId,
})
console.log(str, 'str.......')
wx.setStorageSync('location', str)
if (_this.data.positionCity.operatingAreaAreaId == _this.data.designateAreaObj.id) {
_this.setData({
positionName: _this.data.positionCity.regionName
})
} else {
_this.setData({
changeShow: true
})
}
} else {
if (!wx.getStorageSync('location')) {
if (_this.data.designateAreaObj.id) {
wx.setStorageSync('location', JSON.stringify({
id: _this.data.designateAreaObj.id,
regionName: _this.data.designateAreaObj.regionName,
regionType: _this.data.designateAreaObj.regionType,
systemRegionId: _this.data.designateAreaObj.systemRegionId,
areaGroupId: _this.data.designateAreaObj.areaGroupId,
outId: _this.data.designateAreaObj.outId
}))
_this.setData({
positionName: _this.data.designateAreaObj.regionName
})
}
}
}
}).catch(err => {
console.log('定位')
if (!wx.getStorageSync('location')) {
if (_this.data.designateAreaObj.id) {
wx.setStorageSync('location', JSON.stringify({
id: _this.data.designateAreaObj.id,
regionName: _this.data.designateAreaObj.regionName,
regionType: _this.data.designateAreaObj.regionType,
systemRegionId: _this.data.designateAreaObj.systemRegionId,
areaGroupId: _this.data.designateAreaObj.areaGroupId,
outId: _this.data.designateAreaObj.outId
}))
_this.setData({
positionName: _this.data.designateAreaObj.regionName
})
}
}
})
},
fail(error) {
console.log('定位失败')
if(!wx.getStorageSync('location')){
if(_this.data.designateAreaObj.id){
wx.setStorageSync('location', JSON.stringify({
id : _this.data.designateAreaObj.id,
regionName: _this.data.designateAreaObj.regionName,
regionType: _this.data.designateAreaObj.regionType,
systemRegionId : _this.data.designateAreaObj.systemRegionId,
areaGroupId : _this.data.designateAreaObj.areaGroupId,
outId : _this.data.designateAreaObj.outId
}))
_this.setData({
positionName : _this.data.designateAreaObj.regionName
})
}
}
}
})
}
console.log('111111++++++++++++++++++++定位组件加载好了++++++++++++++++++++111')
},
pageLifetimes : {
show(){
console.log('组件页面出来show', this.data.designateAreaObj)
console.log('组件页面出来show', this.data.positionCity)
if(wx.getStorageSync('location')){
let locationObj = JSON.parse(wx.getStorageSync('location'))
if (locationObj.id){
if (locationObj.id != this.data.positionCity.operatingAreaAreaId){
this.setData({
positionName: locationObj.regionName
})
this.setData({
'designateAreaObj.id': locationObj.id,
'designateAreaObj.regionName': locationObj.regionName,
'designateAreaObj.regionType': locationObj.regionType,
'designateAreaObj.systemRegionId': locationObj.systemRegionId,
'.designateAreaObj.areaGroupId': locationObj.areaGroupId,
'designateAreaObj.outId': locationObj.outId
})
let obj = {
operatingAreaAreaId: locationObj.id,
regionName: locationObj.regionName,
regionType: locationObj.regionType,
systemRegionId: locationObj.systemRegionId,
areaGroupId: locationObj.areaGroupId,
outId: locationObj.outId,
}
this.setData({
positionCity : obj
})
}
// app.getThemePage({ mixid: "antgood", shopid: 67 })
return
}
if (locationObj.regionName != this.data.positionCity.regionName){
this.setData({
positionName: locationObj.regionName
})
this.setData({
'designateAreaObj.id': locationObj.id,
'designateAreaObj.regionName': locationObj.regionName,
'designateAreaObj.regionType': locationObj.regionType,
'designateAreaObj.systemRegionId': locationObj.systemRegionId,
'designateAreaObj.areaGroupId': locationObj.areaGroupId,
'designateAreaObj.outId': locationObj.outId
})
let obj = {
operatingAreaAreaId: locationObj.id,
regionName: locationObj.regionName,
regionType: locationObj.regionType,
systemRegionId: locationObj.systemRegionId,
areaGroupId: locationObj.areaGroupId,
outId: locationObj.outId,
}
this.setData({
positionCity: obj
})
// app.getThemePage({ mixid: "antgood", shopid: 67 })
return
}
}
}
},
/**
* 组件的方法列表
*/
methods: {
//切换城市
changeTo(e){
console.log(this.data.designateAreaObj)
this.setData({
'designateAreaObj.id': this.data.positionCity.operatingAreaAreaId,
'designateAreaObj.regionName': this.data.positionCity.regionName,
'designateAreaObj.regionType': this.data.positionCity.regionType,
'designateAreaObj.systemRegionId': this.data.positionCity.systemRegionId,
// 'designateAreaObj.areaGroupId': this.data.positionCity.areaGroupId,
'designateAreaObj.outId': this.data.positionCity.outId
})
console.log(this.data.designateAreaObj)
console.log(this.data.positionCity)
let change = JSON.stringify(this.data.designateAreaObj)
this.setData({
positionName: this.data.positionCity.regionName,
changeShow : false
})
wx.setStorageSync('location', change )
app.trackCpn(e, this.data.datas.componentName, 'tzChangeTo')
wx.reLaunch({
url: '/pages/home/main?changeLocation=1'
})
},
continueBrowser(e){
console.log(this.data.designateAreaObj,'this.data.designateAreaObj')
wx.setStorageSync('location', JSON.stringify(this.data.designateAreaObj))
this.setData({
positionName: this.data.designateAreaObj.regionName,
changeShow: false
})
// wx.startPullDownRefresh()
app.trackCpn(e, this.data.datas.componentName, 'continueBrowser')
wx.reLaunch({
url: '/pages/home/main?changeLocation=1'
})
},
changeOtherCity(e){
console.log(getCurrentPages())
app.trackCpn(e, this.data.datas.componentName, 'changeOtherCity')
wx.navigateTo({
url: '/pages/changeAdr/main?areaGroupId=' + this.data.designateAreaObj.areaGroupId,
})
},
toSearchPage(e){
app.trackCpn(e, this.data.datas.componentName, 'toSearchPage')
app.$themeToLink({
type : 1,
link: '/goodsSearch/goodsSearch'
})
}
},
})
{
"component": true,
"usingComponents": {
"van-dialog": "/static/vant/dialog/index",
"van-icon": "/static/vant/icon/index",
"van-sticky":"/static/vant/sticky/index"
}
}
\ No newline at end of file
<!--static/nativeComponents/AreaNavigation/index.wxml-->
<van-sticky offset-top="{{showSpokesManHome?44:0}}" wx:if="{{datas.componentData.scrollPosition}}">
<view class="area-navigation clearfix" style="background-color:{{datas.componentData.backgroundColor}}">
<view style="width:100%;display:flex;">
<view class="area-l" style="font-size:{{datas.componentData.fontSize / 16 + 'em'}};color:{{datas.componentData.fontColor}};font-weight:{{datas.componentData.fontWeight}}" bindtap="changeOtherCity">
<view class="antt ant-gongsidizhi"></view>
<text class="title">{{positionName}}</text>
<van-icon name="arrow-down" style="margin-left:4rpx" />
</view>
<view class="area-r">
<input class="area-search" type="text" bindtap="toSearchPage" style="background-color:{{datas.componentData.searchBgColor}};font-size:{{datas.componentData.searchFontSize / 16 + 'em'}};color:{{datas.componentData.searchFontColor}};font-weight:{{datas.componentData.searchFontWeight}}">
</input>
</view>
</view>
</view>
</van-sticky>
<view wx:if="{{!datas.componentData.scrollPosition}}">
<view class="area-navigation clearfix" style="background-color:{{datas.componentData.backgroundColor}}">
<view style="width:100%;display:flex;">
<view class="area-l" style="font-size:{{datas.componentData.fontSize / 16 + 'em'}};color:{{datas.componentData.fontColor}};font-weight:{{datas.componentData.fontWeight}}" bindtap="changeOtherCity">
<view class="antt ant-gongsidizhi"></view>
<text class="title">{{positionName}}</text>
<van-icon name="arrow-down" style="margin-left:4rpx" />
</view>
<view class="area-r">
<input class="area-search" type="text" style="background-color:{{datas.componentData.searchBgColor}};font-size:{{datas.componentData.searchFontSize / 16 + 'em'}};color:{{datas.componentData.searchFontColor}};font-weight:{{datas.componentData.searchFontWeight}}">
</input>
</view>
</view>
</view>
</view>
<van-dialog
show="{{noShow}}"
use-slot
showConfirmButton="{{false}}"
>
<view class="change-dialog">
<view style="line-height:60rpx">您所在的地区暂未开放</view>
<view class="change-btn">切换其他城市</view>
</view>
</van-dialog>
<van-dialog
show="{{changeShow}}"
use-slot
showConfirmButton="{{false}}"
>
<view class="change-dialog">
<view style="line-height:60rpx">
定位显示为{{ positionCity.regionName }}
</view>
<view class="change-btn line-clamp1" bindtap="changeTo">
切换到{{ positionCity.regionName }}
</view>
<view class="continue line-clamp1" bindtap="continueBrowser">
继续浏览{{ designateAreaObj.regionName }}
</view>
</view>
</van-dialog>
/* static/nativeComponents/AreaNavigation/index.wxss */
@import '../../nicon/iconfont.wxss';
.area-navigation {
width: 100%;
box-sizing: border-box;
padding: 12rpx 24rpx;
z-index: 99999999;
font-size: 32rpx;
top: 0;
}
.area-navigation-margintop {
padding-top: 100rpx;
}
.area-l{
line-height: 60rpx;
}
.area-l .ant-gongsidizhi{
line-height: 60rpx;
float: left;
}
.area-l .title{
display: block;
float: left;
}
.area-r {
margin-left: 20rpx;
flex: 1;
}
.area-search {
width: 100%;
height: 60rpx;
border-radius: 30rpx;
box-sizing: border-box;
padding: 0 24rpx;
line-height: 60rpx;
border: none;
}
.change-dialog {
text-align: center;
padding: 20rpx 80rpx 36rpx !important;
box-sizing: border-box;
}
.change-dialog .continue {
height: 60rpx;
padding: 0 20rpx;
box-sizing: border-box;
width: 100%;
border-radius: 30rpx;
background-color: white;
text-align: center;
line-height: 60rpx;
margin: 20rpx auto 0;
border: 1rpx solid #999;
font-size: 28rpx;
}
.change-dialog .change-btn {
height: 60rpx;
border-radius: 30rpx;
line-height: 60rpx;
margin: 20rpx auto 0;
width: 100%;
box-sizing: border-box;
color: white;
background-color: var(--main-color);
text-align: center;
font-size: 28rpx;
padding: 0 20rpx;
}
\ No newline at end of file
......@@ -367,25 +367,36 @@ const componentOptions = {
}
},
async briefProduct(query) {
await goodsApi.queryBriefProductInfo(query).then(res => {
if (res.data.code == 200) {
let data = res.data.data.list;
let ids = data.map(element => {
let goodsList = this.render ? res.data.list : res.data.data.list;
return element.terminalProductId;
});
const storageIds = this.getStorageSync('ids');
storageIds[this.data.goodsListIndex] = query.terminalProductIds;
this.setStorageSync('ids', storageIds);
const storageDatasList = this.getStorageSync('storageDatasList');
storageDatasList[this.data.goodsListIndex] = this.data.datas.componentData;
this.setStorageSync('storageDatasList', storageDatasList);
this.moreProduct(true);
// FIXME: 原来逻辑
// await goodsApi.queryBriefProductInfo(query).then(res => {
// if (res.data.code == 200) {
// let data = res.data.data.list;
// let ids = data.map(element => {
// let goodsList = this.render ? res.data.list : res.data.data.list;
// return element.terminalProductId;
// });
let storageIds = this.getStorageSync('ids')
storageIds[this.data.goodsListIndex] = ids
this.setStorageSync('ids',storageIds)
// let storageIds = this.getStorageSync('ids')
// storageIds[this.data.goodsListIndex] = ids
// this.setStorageSync('ids',storageIds)
let storageDatasList = this.getStorageSync('storageDatasList')
storageDatasList[this.data.goodsListIndex] = this.data.datas.componentData
this.setStorageSync('storageDatasList',storageDatasList)
// let storageDatasList = this.getStorageSync('storageDatasList')
// storageDatasList[this.data.goodsListIndex] = this.data.datas.componentData
// this.setStorageSync('storageDatasList',storageDatasList)
this.moreProduct(true);
}
});
// this.moreProduct(true);
// }
// });
},
async moreProduct(flag) {
......@@ -419,11 +430,12 @@ const componentOptions = {
goodsList = res.data.data;
let pageGoodsList = this.data.pageGoodsList[this.data.goodsListIndex] || [];
this.goodsListVal(goodsList, 1,flag);
} else {
this.setData({ scrollLoading: false });
}
});
},
goodsListVal(goodsList, type, flag) {
console.log('goodsListVal', goodsList, type, flag);
let { attributeValueList } = this.data.datas.componentData;
goodsList.forEach((item, index) => {
item.marketingTag = item.defaultTags
......@@ -481,7 +493,6 @@ const componentOptions = {
pageGoodsList[that.data.datasIndex] = list;
}
this.setStorageSync('pageGoodsList', pageGoodsList);
console.log('goodsListVal->2', that.data.goodsListIndex, that.data.datasIndex, list)
// 获取是否要开启请求拦截
......@@ -756,7 +767,6 @@ const componentOptions = {
});
},
setStorageSync(key, val) {
console.log('setStorageSync->', this.data.storageKey, key, val)
return wx.setStorageSync(`${this.data.storageKey}_${key}`,val)
},
getStorageSync(key) {
......
......@@ -64,7 +64,7 @@
style="display:grid;grid-template-columns:repeat({{datas.componentData.columnNum}},minmax(0px, 1fr));gap:{{datas.componentData.proGap*2}}rpx;"
>
<view
wx:for="{{pageGoodsList[datasIndex]}}"
wx:for="{{datas.componentData.goodsList}}"
wx:key="index"
class="goods-item {{'goodsItemIndex'+index}}"
style="margin-bottom:20rpx;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment