代码更新

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,14 +101,11 @@
} }
}, },
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]
}); })
let arr = uni.getStorageSync('ADRESS_LOCATION') this.$bus.$on('value-updated', (newValue) => {
//
if (arr.length > 0) { this.street = newValue.split(',')[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

@ -1,6 +1,6 @@
<template> <template>
<view class="gather"> <view class="gather">
<!-- <view class="site-box flex_a_c_j_sb"> <!-- <view class="site-box flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation"> <view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="iconfont icon-weizhi" style="margin-left: 20rpx;"></view> <view class="iconfont icon-weizhi" style="margin-left: 20rpx;"></view>
<view class="town_name">{{street}}</view> <view class="town_name">{{street}}</view>
@ -14,44 +14,45 @@
</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">
<view class="title project"> <view class="title project">
<view>更多功能</view> <view>更多功能</view>
<view class="edit" @click="editFlag = !editFlag">{{editFlag?'完成':'编辑'}}</view> <view class="edit" @click="editFlag = !editFlag">{{editFlag?'完成':'编辑'}}</view>
</view> </view>
<view class="content"> <view class="content">
<block v-if="nowMenuList.length>0"> <block v-if="nowMenuList.length>0">
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show> <u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
<view class="examine" @click="editFlag?removeMenu(item):clickMenu(item.type, item.data)"> <view class="examine" @click="editFlag?removeMenu(item):clickMenu(item.type, item.data)">
<image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill"> <image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill">
</image> </image>
<u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon>
<text class="text">{{item.name}}</text> <text class="text">{{item.name}}</text>
</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"
</view> style="text-align: center;width: 100%;color: #aaa;">还没有应用,点我添加应用</view>
</view> </view>
<view v-if="editFlag" class="business com special_work edit_card"> </view>
<view class="title project" style="padding: 0 28rpx;"> <view v-if="editFlag" class="business com special_work edit_card">
<view>编辑功能</view> <view class="title project" style="padding: 0 28rpx;">
<view class="edit2" @click="editComfirm">完成</view> <view>编辑功能</view>
</view> <view class="edit2" @click="editComfirm">完成</view>
<view class="content"> </view>
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show> <view class="content">
<view class="examine" @click="pushMenu(item)"> <u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
<image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill"> <view class="examine" @click="pushMenu(item)">
</image> <image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill">
<u-icon class="icon" name="plus-circle-fill"></u-icon> </image>
<text class="text">{{item.name}}</text> <u-icon class="icon" name="plus-circle-fill"></u-icon>
</view> <text class="text">{{item.name}}</text>
</u-transition> </view>
</view> </u-transition>
</view> </view>
</view>
<view class="" v-if='jurisdiction==false&&isShow==false'> <view class="" v-if='jurisdiction==false&&isShow==false'>
<emptyPage title="暂无信息"></emptyPage> <emptyPage title="暂无信息"></emptyPage>
@ -92,7 +93,7 @@
import { import {
getDiy getDiy
} from '@/api/api.js'; } from '@/api/api.js';
import uniMP from '@/utils/uniMP.js'; import uniMP from '@/utils/uniMP.js';
export default { export default {
components: { components: {
@ -115,25 +116,24 @@
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', type: 2,
type: 2, },
}, {
{ name: '供销平台',
name: '供销平台', icon: 'shsz.png',
icon: 'shsz.png', data: '__UNI__B5B1EDD',
data: '__UNI__B5B1EDD', 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
@ -187,55 +194,58 @@
// #endif // #endif
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);
pushMenu(data){ break;
this.nowMenuList.push(data); }
this.AllMenuList = this.AllMenuList.filter((item)=>{ },
return item.name!=data.name; //
}) pushMenu(data) {
}, this.nowMenuList.push(data);
// this.AllMenuList = this.AllMenuList.filter((item) => {
removeMenu(data){ return item.name != data.name;
this.AllMenuList.push(data); })
this.nowMenuList = this.nowMenuList.filter((item)=>{ },
return item.name!=data.name; //
}) removeMenu(data) {
}, this.AllMenuList.push(data);
// this.nowMenuList = this.nowMenuList.filter((item) => {
editComfirm(){ return item.name != data.name;
this.editFlag = false; })
uni.setStorageSync('gatherAllMenuList', JSON.stringify(this.AllMenuList)); },
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList)); //
}, editComfirm() {
getUniMp(appid){ this.editFlag = false;
console.log('点击供销平台'); uni.setStorageSync('gatherAllMenuList', JSON.stringify(this.AllMenuList));
// #ifdef APP-PLUS uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
uniMP.loadMP(appid); },
return ; getUniMp(appid) {
// #endif console.log('点击供销平台');
uni.showToast({ // #ifdef APP-PLUS
icon: 'none', uniMP.loadMP(appid);
title: 'H5不支持打开小程序' return;
}) // #endif
}, uni.showToast({
appLocation() { icon: 'none',
title: 'H5不支持打开小程序'
})
},
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,
@ -420,11 +429,11 @@
.site-box { .site-box {
width: 100%; width: 100%;
/* #ifdef MP || APP-PLUS */ /* #ifdef MP || APP-PLUS */
height: 170rpx; height: 170rpx;
/* #endif */ /* #endif */
/* #ifdef H5 */ /* #ifdef H5 */
height: 120rpx; height: 120rpx;
/* #endif */ /* #endif */
margin-bottom: 26.32rpx; margin-bottom: 26.32rpx;
position: absolute; position: absolute;
@ -479,23 +488,26 @@
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{
font-size: 26rpx; .edit {
font-weight: 400; font-size: 26rpx;
&::after{ font-weight: 400;
content: '>';
margin-left: 10rpx; &::after {
} content: '>';
} margin-left: 10rpx;
.edit2{ }
font-size: 26rpx; }
font-weight: 400;
} .edit2 {
} font-size: 26rpx;
font-weight: 400;
}
}
.content { .content {
display: flex; display: flex;
@ -510,7 +522,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
// margin: 0 0 33.33rpx 33.33rpx !important; // margin: 0 0 33.33rpx 33.33rpx !important;
.icon_img { .icon_img {
@ -518,11 +530,11 @@
height: 63.16rpx; height: 63.16rpx;
} }
.icon{ .icon {
position: absolute; position: absolute;
top: 0rpx; top: 0rpx;
right: 25rpx; right: 25rpx;
} }
.text { .text {
font-size: 26.32rpx; font-size: 26.32rpx;
@ -555,8 +567,8 @@
} }
} }
.edit_card{ .edit_card {
background-color: #fff; background-color: #fff;
padding-top: 28rpx; padding-top: 28rpx;
} }
</style> </style>

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,35 +690,46 @@
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, that.loadVideo = false
limit: that.limit, that.getVideoData([res.data]);
is_star: that.isSatrt, }).catch(err => {
community_id: that.videoID return uni.showToast({
}).then(res => { title: err,
that.loadVideo = false icon: 'none',
that.getVideoData(res.data.list); duration: 2000
}).catch(err => { });
return uni.showToast({ })
title: err, // that.isUser ?
icon: 'none', // myVideoList(that.userUid, {
duration: 2000 // page: that.page,
}); // limit: that.limit,
}) : // is_star: that.isSatrt,
graphicLstApi({ // community_id: that.videoID
page: that.page, // }).then(res => {
limit: that.limit, // that.loadVideo = false
category_id: -1 // that.getVideoData(res.data.list);
}).then(res => { // }).catch(err => {
that.getVideoData(res.data.list); // return uni.showToast({
}).catch(err => { // title: err,
return uni.showToast({ // icon: 'none',
title: err, // duration: 2000
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;
@ -866,61 +878,90 @@
} }
}, },
get() { get() {
// 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, this.loadVideo = false
limit: this.limit, this.page = 1;
is_star: this.isSatrt, var msg = [res.data];
community_id: this.videoID
}).then(async (res) => { for (let i = 0; i < msg.length; i++) {
this.loadVideo = false msg[i]['isMore'] = false
this.page = this.page + 1; msg[i]['playIng'] = false
var msg = res.data.list; msg[i]['state'] = false
for (let i = 0; i < msg.length; i++) { msg[i]['isplay'] = false
msg[i]['isMore'] = false msg[i]['loading'] = false
msg[i]['playIng'] = false msg[i]['community_id'] = msg[i]['community_id'].toString()
msg[i]['state'] = false }
msg[i]['isplay'] = false this.dataList = msg;
msg[i]['loading'] = false if (this.dataList.length !== 0) {
msg[i]['community_id'] = msg[i]['community_id'].toString() this.dataList[this.k].state = 'play';
} uni.createVideoContext(this.dataList[this.k].community_id, this).play()
this.dataList = msg; }
if (this.dataList.length !== 0) { }).catch(err => {
this.dataList[this.k].state = 'play'; return uni.showToast({
uni.createVideoContext(this.dataList[this.k].community_id, this).play() title: err,
} icon: 'none',
}).catch(err => { duration: 2000
return uni.showToast({ });
title: err, })
icon: 'none',
duration: 2000
});
}) : // this.isUser ?
graphicLstApi({ // myVideoList(this.userUid, {
page: this.page, // page: this.page,
limit: this.limit, // limit: this.limit,
category_id: -1 // is_star: this.isSatrt,
}).then(async (res) => { // community_id: this.videoID
this.page = this.page + 1; // }).then(async (res) => {
var msg = res.data.list; // this.loadVideo = false
for (let i = 0; i < msg.length; i++) { // this.page = this.page + 1;
msg[i]['isMore'] = false // var msg = res.data.list;
msg[i]['playIng'] = false // for (let i = 0; i < msg.length; i++) {
msg[i]['state'] = false // msg[i]['isMore'] = false
msg[i]['isplay'] = false // msg[i]['playIng'] = false
msg[i]['community_id'] = msg[i]['community_id'].toString() // msg[i]['state'] = false
} // msg[i]['isplay'] = false
this.dataList = msg; // msg[i]['loading'] = false
}).catch(err => { // msg[i]['community_id'] = msg[i]['community_id'].toString()
return uni.showToast({ // }
title: err, // this.dataList = msg;
icon: 'none', // if (this.dataList.length !== 0) {
duration: 2000 // 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,8 +24,10 @@
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange' @change='dchange'> <zbpSwiper :isSelectPlace="true" :town='street' :streetname='street' :location_Arr="locationArr"
</zbpSwiper> @change='dchange'>
</zbpSwiper>
<view class="list"> <view class="list">
<navigator hover-class="none" <navigator hover-class="none"
@ -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,