Commit b220d8b5 by 李嘉林

🎈 perf: 删除无用文件

parent 8cc8b7a8
...@@ -91,19 +91,19 @@ module.exports = merge(baseWebpackConfig, { ...@@ -91,19 +91,19 @@ module.exports = merge(baseWebpackConfig, {
// inject: true // inject: true
// }), // }),
new FriendlyErrorsPlugin(), new FriendlyErrorsPlugin(),
// new UglifyJsPlugin({ new UglifyJsPlugin({
// sourceMap: true, sourceMap: true,
// uglifyOptions: { uglifyOptions: {
// // 删除注释 // 删除注释
// output: { output: {
// comments: false comments: false
// }, },
// compress: { compress: {
// warnings: false, warnings: false,
// drop_console: true, drop_console: true,
// pure_funcs: ['console.log'] pure_funcs: ['console.log']
// } }
// } }
// }) })
] ]
}) })
...@@ -121,20 +121,20 @@ if (config.build.bundleAnalyzerReport) { ...@@ -121,20 +121,20 @@ if (config.build.bundleAnalyzerReport) {
var useUglifyJs = process.env.PLATFORM !== 'swan' var useUglifyJs = process.env.PLATFORM !== 'swan'
if (useUglifyJs) { if (useUglifyJs) {
// webpackConfig.plugins.push(new UglifyJsPlugin({ webpackConfig.plugins.push(new UglifyJsPlugin({
// sourceMap: true, sourceMap: true,
// uglifyOptions: { uglifyOptions: {
// // 删除注释 // 删除注释
// output: { output: {
// comments: false comments: false
// }, },
// compress: { compress: {
// warnings: false, warnings: false,
// drop_console: true, drop_console: true,
// pure_funcs: ['console.log'] pure_funcs: ['console.log']
// } }
// } }
// })) }))
} }
module.exports = webpackConfig module.exports = webpackConfig
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
"pages/tabBar2/main", "pages/tabBar2/main",
"pages/tabBar3/main", "pages/tabBar3/main",
"pages/tabBar4/main", "pages/tabBar4/main",
"pages/changeAdr/main",
"pages/wxArticle/main", "pages/wxArticle/main",
"pages/userInfo/main", "pages/userInfo/main",
"pages/memberCode/main", "pages/memberCode/main",
......
...@@ -22,7 +22,6 @@ export default { ...@@ -22,7 +22,6 @@ export default {
} }
}, },
components: { components: {
// 'area-navigation' : () => import('~/components/theme/components/other/area-navigation')
}, },
data() { data() {
return { return {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index", "time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index",
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index", "waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index", "van-button": "/static/vant/button/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index", "cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index", "float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index", "goods-search":"/static/nativeComponents/GoodsSearch/index",
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
<div v-else-if="item1.componentCode == 'ranking-list' && item1.componentInfo.visible == 1"> <div v-else-if="item1.componentCode == 'ranking-list' && item1.componentInfo.visible == 1">
<ranking-list :datas="item1"></ranking-list> <ranking-list :datas="item1"></ranking-list>
</div> </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"> <div v-else-if="item1.componentCode == 'cube-nav' && item1.componentInfo.visible == 1">
<cube-nav :datas="item1"></cube-nav> <cube-nav :datas="item1"></cube-nav>
</div> </div>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index", "time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index",
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index", "waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index", "van-button": "/static/vant/button/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index", "cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index", "float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index", "goods-search":"/static/nativeComponents/GoodsSearch/index",
......
<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
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
<div v-else-if="item.componentCode == 'ranking-list' && item.componentInfo.visible == 1"> <div v-else-if="item.componentCode == 'ranking-list' && item.componentInfo.visible == 1">
<ranking-list :datas="item"></ranking-list> <ranking-list :datas="item"></ranking-list>
</div> </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"> <div v-else-if="item.componentCode == 'cube-nav' && item.componentInfo.visible == 1">
<cube-nav :datas="item"></cube-nav> <cube-nav :datas="item"></cube-nav>
</div> </div>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index", "waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
"van-button": "/static/vant/button/index", "van-button": "/static/vant/button/index",
"van-stepper": "/static/vant/stepper/index", "van-stepper": "/static/vant/stepper/index",
"area-navigation":"/static/nativeComponents/AreaNavigation/index",
"cube-nav":"/static/nativeComponents/CubeNav/index", "cube-nav":"/static/nativeComponents/CubeNav/index",
"float-button":"/static/nativeComponents/FloatButton/index", "float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index", "goods-search":"/static/nativeComponents/GoodsSearch/index",
......
...@@ -43,7 +43,6 @@ export const noLoginList = [ ...@@ -43,7 +43,6 @@ export const noLoginList = [
"personalCenter-spokesmanCenter-mine-spokesmanHomePage", "personalCenter-spokesmanCenter-mine-spokesmanHomePage",
"liveBroadcast-lived", "liveBroadcast-lived",
"personalCenter-spokesmanCenter-mine-getBusinessCard", "personalCenter-spokesmanCenter-mine-getBusinessCard",
"changeAdr"
]; ];
// path // path
export const noLoginListPath = noLoginList.map(item => { 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
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