代码更新

This commit is contained in:
jia 2023-09-02 21:05:37 +08:00
parent df8132a504
commit 4cedd8415d
9 changed files with 383 additions and 355 deletions

15
App.vue
View File

@ -10,6 +10,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// #ifdef APP-PLUS // #ifdef APP-PLUS
let jpushModule = uni.requireNativePlugin("JG-JPush"); let jpushModule = uni.requireNativePlugin("JG-JPush");
const mp = uni.requireNativePlugin('uniMP');
// #endif // #endif
import { import {
checkLogin checkLogin
@ -74,7 +75,18 @@
}, },
onLaunch: function(option) { onLaunch: function(option) {
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
this.globalData.uid = this.$store.state.app.uid this.globalData.uid = this.$store.state.app.uid;
//uni
mp.onUniMPEventReceive(ret=>{
console.log('小程序事件: ', ret);
if(ret.event=='closeApp'){
mp.closeUniMP(ret.fromAppid, (ret)=>{
console.log('closeUniMP: '+JSON.stringify(ret));
});
}
});
let that = this; let that = this;
// #ifdef MP // #ifdef MP
if (HTTP_REQUEST_URL == '') { if (HTTP_REQUEST_URL == '') {
@ -188,7 +200,6 @@
}, },
onShow() { onShow() {
let that = this let that = this

View File

@ -26,9 +26,7 @@
<script> <script>
import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItems.vue' import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItems.vue'
import {
getUserInfo
} from '@/api/user.js';
export default { export default {
components: { components: {
WaterfallsFlowItem WaterfallsFlowItem
@ -110,7 +108,7 @@ export default {
deep:true deep:true
}, },
mounted(){ mounted(){
console.log('1111111111')
this.getUserInfo() this.getUserInfo()
}, },
@ -122,22 +120,9 @@ export default {
} }
} }
}, },
mounted(){
this.getUserInfo()
},
methods: { methods: {
/**
* 获取个人用户信息
*/
getUserInfo: function() {
console.log('111111111')
let that = this;
getUserInfo().then(res => {
// that.userInfo = res.data;
console.log(res.data)
});
},
// //
waterFall() { waterFall() {
const i = this.mark; const i = this.mark;

View File

@ -71,16 +71,17 @@
type: Object, type: Object,
default: () => ({}) default: () => ({})
}, },
show: { town: {
type: Boolean, type:String,
default: false default: false
}, },
}, },
data() { data() {
return { return {
defaInd: [0, 0], defaInd: [0, 0],
street: '', street: '',
streeta: '',
showPicker: false, showPicker: false,
styleConfig: [], styleConfig: [],
columnData: [], columnData: [],
@ -100,13 +101,10 @@
} }
}, },
watch: { watch:{
street(newval, val) { street(nval,val) {
// console.log(newval, val) this.street=nval
this.street = newval
// console.log(newval, val)
} }
}, },
created() { created() {
@ -117,17 +115,13 @@
}, },
mounted() { mounted() {
uni.$on('init', function(data) { uni.$on('add', (res)=> {
console.log('init data ', data); this.street=res.split(',')[0]
})
this.$bus.$on('value-updated', (newValue) => {
//
this.street = newValue.split(',')[0]
}); });
let arr = uni.getStorageSync('ADRESS_LOCATION')
if (arr.length > 0) {
this.street = arr.split(',')[0]
} else {
this.appLocation()
}
}, },
methods: { methods: {
@ -141,42 +135,7 @@
this.isSelectPlace ? this.showPicker = true : '' this.isSelectPlace ? this.showPicker = true : ''
}, },
appLocation() {
uni.getLocation({
type: 'wgs84',
timeout: '10',
success: (res) => {
// console.log(res)
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
let town = res.data.address_reference.town.title
let street_id = res.data.address_reference.town.id
this.street = res.data.address_component.street
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
fail: (err) => {
uni.showToast({
title: "获取定位超时",
icon: 'none',
duration: 2000
});
}
});
},
confirm(e) { confirm(e) {
this.showPicker = false this.showPicker = false
@ -184,11 +143,11 @@
this.$emit('change', e) this.$emit('change', e)
this.street = e.value[1].name this.street = e.value[1].name
uni.setStorageSync('ADRESS_LOCATION', uni.$emit('add',e.value[1].name+','+e.value[1].code)
this.$bus.$emit('value-updated',
e.value[1].name + ',' + e.value[1].name + ',' +
e.value[1].code);
e.value[1].code
)
}, },
changeHandler(e) { changeHandler(e) {
const { const {

View File

@ -23,7 +23,7 @@ Vue.prototype.$util = util;
Vue.prototype.$Cache = Cache; Vue.prototype.$Cache = Cache;
Vue.prototype.$eventHub = new Vue(); Vue.prototype.$eventHub = new Vue();
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$bus = new Vue();
// #ifdef H5 // #ifdef H5
import { parseQuery } from "./utils"; import { parseQuery } from "./utils";
import Auth from './libs/wechat'; import Auth from './libs/wechat';

View File

@ -14,7 +14,7 @@
</view> </view>
</view> --> </view> -->
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange'></zbpSwiper> <zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" :town='street' @kkchange='kkchange'></zbpSwiper>
<u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText" <u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText"
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty> icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
<view class="business com special_work"> <view class="business com special_work">
@ -33,7 +33,8 @@
</view> </view>
</u-transition> </u-transition>
</block> </block>
<view v-else-if="!editFlag" @click="editFlag = true" style="text-align: center;width: 100%;color: #aaa;">还没有应用,点我添加应用</view> <view v-else-if="!editFlag" @click="editFlag = true"
style="text-align: center;width: 100%;color: #aaa;">还没有应用,点我添加应用</view>
</view> </view>
</view> </view>
<view v-if="editFlag" class="business com special_work edit_card"> <view v-if="editFlag" class="business com special_work edit_card">
@ -115,12 +116,11 @@
isShow: false, isShow: false,
bgColor: '', bgColor: '',
isFshow: false, isFshow: false,
street:'', street: '',
// //
editFlag: false, editFlag: false,
// //
AllMenuList: [ AllMenuList: [{
{
name: '商户平台', name: '商户平台',
icon: 'spgl.png', icon: 'spgl.png',
data: '/pages/moreProject/moreProject', data: '/pages/moreProject/moreProject',
@ -133,7 +133,7 @@
type: 1, type: 1,
}, },
], ],
nowMenuList: [] nowMenuList: [],
street: '', street: '',
showPicker: false, showPicker: false,
columnData: [] columnData: []
@ -157,7 +157,7 @@
this.jurisdiction = true this.jurisdiction = true
} }
this.getUserInfo() this.getUserInfo()
this.appLocation()
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -165,12 +165,19 @@
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
mounted() { mounted() {
this.appLocation() if(this.street.length<=0){
this.selfLocation()
}
// #ifdef H5 // #ifdef H5
// //
window.addEventListener("scroll", this.scrolling); window.addEventListener("scroll", this.scrolling);
// #endif // #endif
this.$bus.$on('value-updated', (newValue) => {
//
this.street = newValue.split(',')[0]
});
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -188,54 +195,57 @@
methods: { methods: {
// //
initMenu(){ initMenu() {
let all = uni.getStorageSync('gatherAllMenuList'); let all = uni.getStorageSync('gatherAllMenuList');
let now = uni.getStorageSync('gatherNowMenuList'); let now = uni.getStorageSync('gatherNowMenuList');
if(all){ if (all) {
this.AllMenuList = JSON.parse(all); this.AllMenuList = JSON.parse(all);
} }
if(now){ if (now) {
this.nowMenuList = JSON.parse(now); this.nowMenuList = JSON.parse(now);
} }
}, },
clickMenu(e, data){ clickMenu(e, data) {
switch(e){ switch (e) {
case 1: this.getUniMp(data);break; case 1:
case 2: this.navigator(data);break; this.getUniMp(data);
break;
case 2:
this.navigator(data);
break;
} }
}, },
// //
pushMenu(data){ pushMenu(data) {
this.nowMenuList.push(data); this.nowMenuList.push(data);
this.AllMenuList = this.AllMenuList.filter((item)=>{ this.AllMenuList = this.AllMenuList.filter((item) => {
return item.name!=data.name; return item.name != data.name;
}) })
}, },
// //
removeMenu(data){ removeMenu(data) {
this.AllMenuList.push(data); this.AllMenuList.push(data);
this.nowMenuList = this.nowMenuList.filter((item)=>{ this.nowMenuList = this.nowMenuList.filter((item) => {
return item.name!=data.name; return item.name != data.name;
}) })
}, },
// //
editComfirm(){ editComfirm() {
this.editFlag = false; this.editFlag = false;
uni.setStorageSync('gatherAllMenuList', JSON.stringify(this.AllMenuList)); uni.setStorageSync('gatherAllMenuList', JSON.stringify(this.AllMenuList));
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList)); uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
}, },
getUniMp(appid){ getUniMp(appid) {
console.log('点击供销平台'); console.log('点击供销平台');
// #ifdef APP-PLUS // #ifdef APP-PLUS
uniMP.loadMP(appid); uniMP.loadMP(appid);
return ; return;
// #endif // #endif
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: 'H5不支持打开小程序' title: 'H5不支持打开小程序'
}) })
}, },
appLocation() {
changeHandler(e) { changeHandler(e) {
const { const {
columnIndex, columnIndex,
@ -251,8 +261,8 @@
this.$refs.uPicker.setColumnValues(1, res.data); this.$refs.uPicker.setColumnValues(1, res.data);
}); });
} }
}
}, },
Area() { Area() {
getArea({ getArea({
city_code: 510500 city_code: 510500
@ -294,12 +304,11 @@
lat: latitude, lat: latitude,
long: longitude long: longitude
}).then(res => { }).then(res => {
this.town = res.data.address_reference.town.title let town = res.data.address_reference.town.title
this.street_id = res.data.address_reference.town.id let street_id = res.data.address_reference.town.id
this.street = res.data.address_component.street this.street = res.data.address_component.street
uni.setStorageSync('ADRESS_LOCATION', uni.$emit('add',town+','+street_id)
this.town + ',' + this.town + ',' +
this.street_id)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,
@ -479,19 +488,22 @@
margin-bottom: 38.6rpx; margin-bottom: 38.6rpx;
} }
.project{ .project {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
.edit{
.edit {
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
&::after{
&::after {
content: '>'; content: '>';
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
.edit2{
.edit2 {
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
} }
@ -518,7 +530,7 @@
height: 63.16rpx; height: 63.16rpx;
} }
.icon{ .icon {
position: absolute; position: absolute;
top: 0rpx; top: 0rpx;
right: 25rpx; right: 25rpx;
@ -555,7 +567,7 @@
} }
} }
.edit_card{ .edit_card {
background-color: #fff; background-color: #fff;
padding-top: 28rpx; padding-top: 28rpx;
} }

View File

@ -23,7 +23,8 @@
</view> </view>
<zbpSwiper ref='list' :isSelectPlace="true" :show='show' :location_Arr="locationArr" @kkchange='kkchange' @change='dchange'> <zbpSwiper ref='list' :isSelectPlace="true" :town='street' :show='show' :location_Arr="locationArr" @kkchange='kkchange'
@change='dchange'>
</zbpSwiper> </zbpSwiper>
@ -143,7 +144,7 @@
import zbpSwiper from '@/components/zbpSwiper' import zbpSwiper from '@/components/zbpSwiper'
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'; import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue' import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue'
import Cache from '@/utils/cache';
import { import {
getSlideAPI getSlideAPI
} from '@/api/lihai.js' } from '@/api/lihai.js'
@ -236,7 +237,7 @@
this.getCateList() this.getCateList()
this.getArticle() this.getArticle()
this.getGoods() this.getGoods()
this.selfLocation()
this.Area() this.Area()
this.setPermissions() this.setPermissions()
@ -262,12 +263,17 @@
this.getGoods() this.getGoods()
}, },
mounted() { mounted() {
this.selfLocation()
// #ifdef H5 // #ifdef H5
// //
window.addEventListener("scroll", this.scrolling); window.addEventListener("scroll", this.scrolling);
// #endif // #endif
this.$bus.$on('value-updated', (newValue) => {
//
this.street = newValue.split(',')[0]
});
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
onPageScroll(e) { onPageScroll(e) {
@ -436,12 +442,11 @@
}, },
dchange(e) { dchange(e) {
this.$refs.list.street= e.value[1].name this.$refs.list.street = e.value[1].name
this.street = e.value[1].name this.street = e.value[1].name
}, },
gogogo(item) { gogogo(item) {
if (item.video_link.length > 0) { if (item.video_link.length > 0) {
uni.navigateTo({ uni.navigateTo({
// #ifdef MP || H5 // #ifdef MP || H5
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}` url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}`
@ -528,7 +533,7 @@
type: 'wgs84', type: 'wgs84',
timeout: '10', timeout: '10',
success: (res) => { success: (res) => {
// console.log(res)
this.isshow = false this.isshow = false
let latitude, longitude; let latitude, longitude;
latitude = res.latitude.toString(); latitude = res.latitude.toString();
@ -537,7 +542,13 @@
lat: latitude, lat: latitude,
long: longitude long: longitude
}).then(res => { }).then(res => {
let town = res.data.address_reference.town.title
let street_id = res.data.address_reference.town.id
this.street = res.data.address_component.street this.street = res.data.address_component.street
// console.log(this.street)
uni.$emit('add',town+','+street_id)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,

View File

@ -343,6 +343,7 @@
import mentioned from '../components/mentioned/mentioned.vue' import mentioned from '../components/mentioned/mentioned.vue'
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import { import {
deoList,
videoList, videoList,
myVideoList, myVideoList,
graphicStartApi, graphicStartApi,
@ -689,28 +690,10 @@
let that = this; let that = this;
if (!that.loadVideo) return if (!that.loadVideo) return
that.loadVideo = true that.loadVideo = true
that.isUser ?
myVideoList(that.userUid, { deoList(that.videoID).then(res => {
page: that.page,
limit: that.limit,
is_star: that.isSatrt,
community_id: that.videoID
}).then(res => {
that.loadVideo = false that.loadVideo = false
that.getVideoData(res.data.list); that.getVideoData([res.data]);
}).catch(err => {
return uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}) :
graphicLstApi({
page: that.page,
limit: that.limit,
category_id: -1
}).then(res => {
that.getVideoData(res.data.list);
}).catch(err => { }).catch(err => {
return uni.showToast({ return uni.showToast({
title: err, title: err,
@ -718,6 +701,35 @@
duration: 2000 duration: 2000
}); });
}) })
// that.isUser ?
// myVideoList(that.userUid, {
// page: that.page,
// limit: that.limit,
// is_star: that.isSatrt,
// community_id: that.videoID
// }).then(res => {
// that.loadVideo = false
// that.getVideoData(res.data.list);
// }).catch(err => {
// return uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// });
// }) :
// graphicLstApi({
// page: that.page,
// limit: that.limit,
// category_id: -1
// }).then(res => {
// that.getVideoData(res.data.list);
// }).catch(err => {
// return uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// });
// })
}, },
getFocusList() { getFocusList() {
let that = this; let that = this;
@ -869,16 +881,12 @@
// if(!this.loadVideo) return // if(!this.loadVideo) return
this.loadVideo = true this.loadVideo = true
// 这个方法主要就是用来第一次进入视频播放时用来处理的 // 这个方法主要就是用来第一次进入视频播放时用来处理的
this.isUser ?
myVideoList(this.userUid, { deoList(this.videoID).then(async (res) => {
page: this.page,
limit: this.limit,
is_star: this.isSatrt,
community_id: this.videoID
}).then(async (res) => {
this.loadVideo = false this.loadVideo = false
this.page = this.page + 1; this.page = 1;
var msg = res.data.list; var msg = [res.data];
for (let i = 0; i < msg.length; i++) { for (let i = 0; i < msg.length; i++) {
msg[i]['isMore'] = false msg[i]['isMore'] = false
msg[i]['playIng'] = false msg[i]['playIng'] = false
@ -898,29 +906,62 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
}) :
graphicLstApi({
page: this.page,
limit: this.limit,
category_id: -1
}).then(async (res) => {
this.page = this.page + 1;
var msg = res.data.list;
for (let i = 0; i < msg.length; i++) {
msg[i]['isMore'] = false
msg[i]['playIng'] = false
msg[i]['state'] = false
msg[i]['isplay'] = false
msg[i]['community_id'] = msg[i]['community_id'].toString()
}
this.dataList = msg;
}).catch(err => {
return uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}) })
// this.isUser ?
// myVideoList(this.userUid, {
// page: this.page,
// limit: this.limit,
// is_star: this.isSatrt,
// community_id: this.videoID
// }).then(async (res) => {
// this.loadVideo = false
// this.page = this.page + 1;
// var msg = res.data.list;
// for (let i = 0; i < msg.length; i++) {
// msg[i]['isMore'] = false
// msg[i]['playIng'] = false
// msg[i]['state'] = false
// msg[i]['isplay'] = false
// msg[i]['loading'] = false
// msg[i]['community_id'] = msg[i]['community_id'].toString()
// }
// this.dataList = msg;
// if (this.dataList.length !== 0) {
// this.dataList[this.k].state = 'play';
// uni.createVideoContext(this.dataList[this.k].community_id, this).play()
// }
// }).catch(err => {
// return uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// });
// }) :
// graphicLstApi({
// page: this.page,
// limit: this.limit,
// category_id: -1
// }).then(async (res) => {
// this.page = this.page + 1;
// var msg = res.data.list;
// for (let i = 0; i < msg.length; i++) {
// msg[i]['isMore'] = false
// msg[i]['playIng'] = false
// msg[i]['state'] = false
// msg[i]['isplay'] = false
// msg[i]['community_id'] = msg[i]['community_id'].toString()
// }
// this.dataList = msg;
// }).catch(err => {
// return uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// });
// })
}, },
onpullingdown() { onpullingdown() {
this.refreshing = true this.refreshing = true

View File

@ -15,7 +15,7 @@
<!-- 头部导航 --> <!-- 头部导航 -->
<view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#ffffff'}"> <!-- <view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#ffffff'}">
<view class="tool-bar"> <view class="tool-bar">
<view class='iconfont icon-xiangzuo' @tap='goBack'></view> <view class='iconfont icon-xiangzuo' @tap='goBack'></view>
@ -29,7 +29,7 @@
<view class="items" @click.stop="navTap(3)"> <view class="items" @click.stop="navTap(3)">
<text class="tName" :class="currentNav==3?'on':''">列表</text> <text class="tName" :class="currentNav==3?'on':''">列表</text>
</view> </view>
</view> </view> -->
<swiper v-show="currentNav !== 3" :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" <swiper v-show="currentNav !== 3" :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'"
:vertical="true" @animationfinish="animationfinish" @change="change" :current="k" :indicator-dots="false"> :vertical="true" @animationfinish="animationfinish" @change="change" :current="k" :indicator-dots="false">
<swiper-item v-for="(list,index) in dataList"> <swiper-item v-for="(list,index) in dataList">
@ -420,6 +420,7 @@
watch: { watch: {
k(new_k, old_k) { k(new_k, old_k) {
const max = new_k + 2; const max = new_k + 2;
if (this.max < max) { if (this.max < max) {
this.max = max; this.max = max;
} }
@ -427,6 +428,7 @@
this.oldCurrent = this.currentNav this.oldCurrent = this.currentNav
return false return false
} }
this.dataList[old_k].playIng = false //如果视频暂停,就加载封面 this.dataList[old_k].playIng = false //如果视频暂停,就加载封面
this.dataList[old_k].isplay = true this.dataList[old_k].isplay = true
this.dataList[old_k].state = 'pause' this.dataList[old_k].state = 'pause'
@ -819,16 +821,21 @@
msg[i]['isplay'] = true msg[i]['isplay'] = true
msg[i]['loading'] = false msg[i]['loading'] = false
that.dataList.push(msg[i]) that.dataList.push(msg[i])
{console.log(i,that.k)}
//#ifndef H5 //#ifndef H5
if (i == 0 && that.k == 0) { if (i == 0 && that.k == 0) {
this.dataList[0].isplay = false this.dataList[0].isplay = false
this.dataList[0].playIng = true this.dataList[0].playIng = true
this.dataList[0].state = 'play' this.dataList[0].state = 'play'
this.dataList[0].loading = false this.dataList[0].loading = false
console.log('32')
uni.createVideoContext(that.dataList[0].community_id + '' + 0, that).play() uni.createVideoContext(that.dataList[0].community_id + '' + 0, that).play()
} }
//#endif //#endif
} }
//#ifdef MP //#ifdef MP
if (this.k == 0) { if (this.k == 0) {
this.videoShare(this.dataList[0]); this.videoShare(this.dataList[0]);

View File

@ -3,10 +3,10 @@
<view class="circle_friends_wrapper"> <view class="circle_friends_wrapper">
<view> <view @click="selectLocation">
<view class="site-box flex_a_c_j_sb" :style="{'background-color':backColor}"> <view class="site-box flex_a_c_j_sb" :style="{'background-color':backColor}">
<view :class="['place_wrapper','flex_a_c',isFshow?'sitebox':'']" @click="selectLocation"> <view :class="['place_wrapper','flex_a_c',isFshow?'sitebox':'']" >
<view :class="['iconfont','icon-weizhi',isFshow?'sitebox':'']" style="margin-left: 20rpx;"> <view :class="['iconfont','icon-weizhi',isFshow?'sitebox':'']" style="margin-left: 20rpx;">
</view> </view>
<view class="town_name">{{street}}</view> <view class="town_name">{{street}}</view>
@ -24,9 +24,11 @@
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange' @change='dchange'> <zbpSwiper :isSelectPlace="true" :town='street' :streetname='street' :location_Arr="locationArr"
@change='dchange'>
</zbpSwiper> </zbpSwiper>
<view class="list"> <view class="list">
<navigator hover-class="none" <navigator hover-class="none"
:url="`/pages/nongKe/supply_chain/supplier?type_id=10&street_id=${street_id}`"> :url="`/pages/nongKe/supply_chain/supplier?type_id=10&street_id=${street_id}`">
@ -249,20 +251,15 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.cateGoods = [] this.cateGoods = []
this.list() this.list()
this.Area() this.Area()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
onLoad() { onLoad() {
this.getArticle() this.getArticle()
this.selfLocation()
this.Area() this.Area()
this.setPermissions() this.setPermissions()
@ -288,11 +285,19 @@
this.list() this.list()
}, },
mounted() { mounted() {
// #ifdef H5 // #ifdef H5
// //
window.addEventListener("scroll", this.scrolling); window.addEventListener("scroll", this.scrolling);
// #endif // #endif
this.$bus.$on('value-updated', (newValue) => {
//
this.street = newValue.split(',')[0]
});
if(this.street.length<=0){
this.selfLocation()
}
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -315,7 +320,6 @@
// #endif // #endif
methods: { methods: {
list() { list() {
spuInfo('510502106', this.where1).then(res => { spuInfo('510502106', this.where1).then(res => {
// console.log(res) // console.log(res)
@ -364,9 +368,7 @@
}, },
kkchange(e) {
this.bgColor = e
},
@ -415,7 +417,6 @@
}, },
confirm(e) { confirm(e) {
this.street = e.value[1].name this.street = e.value[1].name
this.street_id = e.value[1].code this.street_id = e.value[1].code
this.town = e.value[1].name this.town = e.value[1].name
@ -530,9 +531,10 @@
this.town = res.data.address_reference.town.title this.town = res.data.address_reference.town.title
this.street_id = res.data.address_reference.town.id this.street_id = res.data.address_reference.town.id
this.street = res.data.address_component.street this.street = res.data.address_component.street
uni.setStorageSync('ADRESS_LOCATION', uni.$emit('add',this.town+','+this.street_id)
this.town + ',' +this.street_id) // uni.setStorageSync('ADRESS_LOCATION',
this.list() // this.town + ',' + this.street_id)
// this.list()
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,