Commit a52407a0 authored by zhangjianguo's avatar zhangjianguo

1

parent 5a4e35a1
......@@ -74,20 +74,20 @@
}
]
},
{
"root": "pages/live",
"plugins": {
"live-player-plugin": {
"version": "1.0.18",
"provider": "wx2b03c6e691cd7370"
}
},
"pages": [
{
"path": "index"
}
]
},
// {
// "root": "pages/live",
// "plugins": {
// "live-player-plugin": {
// "version": "1.0.18",
// "provider": "wx2b03c6e691cd7370"
// }
// },
// "pages": [
// {
// "path": "index"
// }
// ]
// },
{
"root": "pages/user-center",
"pages": [{
......
......@@ -15,7 +15,7 @@
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
>
<view class="couponlist">
......@@ -138,6 +138,16 @@ export default {
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
goUrl(item){
uni.navigateTo({
......
......@@ -302,7 +302,7 @@ export default {
url: "/api/Mall/GetGoosPoster",
data: {
goodsId: this.id,
path: "/pages/goods/goods?id=" + this.id + "&pid=" + u.UserId,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId,
},
},
(res) => {
......
......@@ -292,8 +292,8 @@ export default {
}else{
this.id = option.GoodsId ? option.GoodsId : 29; //40887 59512 46942
}
if(option&&option.pid){
uni.setStorageSync("pid", {pid:option.pid});
if(option&&option.user_id){
uni.setStorageSync("pid", {pid:option.user_id});
}
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
......
......@@ -66,7 +66,10 @@
</template>
</view>
</template>
<view v-if="showtabs==true">
<tabbar></tabbar>
</view>
<view class="tips_t" v-if="add_show==1&& JSON.stringify(setting) != '{}' " :style="{
'border-radius':setting.add_app_bg_radius+'rpx',
'opacity':setting.add_app_bg_transparency/100
......@@ -110,6 +113,7 @@ export default {
pageId:0,
setting:{},
add_show:1,
showtabs:true,
};
},
components: {
......@@ -133,19 +137,35 @@ export default {
quicknav
},
onLoad(options) {
// let options= {//测试
// scene:'share',
// user_id:19992,
// params:{"id":106118,"path":"/pages/goods/goods","user_id":19992}
// }
console.log(options,'option');
let c = this.$uiConfig.is_bang ? 78 : 50;
this.contentHeight = this.$utils.calcContentHeight(c);
if(options&&options.page_id){
this.pageId=options.page_id
this.showtabs=false
this.contentHeight = this.$utils.calcContentHeight();
}
if(options&&options.user_id){
uni.setStorageSync("pid", {pid:options.user_id});
}
if(options&&options.scene){//兼容之前小程序的调转
if(options.scene == 'share' && options.params){
setTimeout(()=>{
uni.navigateTo({
url:options.params.path+'?id='+options.params.id,
});
},500)
}
}
if(options&&options.pid){
uni.setStorageSync("pid", {pid:options.pid});
}
let c = this.$uiConfig.is_bang ? 78 : 50;
this.contentHeight = this.$utils.calcContentHeight(c);
this.init();
let set = uni.getStorageSync("basedata")? uni.getStorageSync("basedata").mall.setting:{};
if(!uni.getStorageSync("add_top_app")){
......@@ -157,12 +177,21 @@ export default {
console.log(uni.getStorageSync("basedata"))
uni.showNavigationBarLoading();
},
onShareAppMessage(res) {
return {
title:this.setting.share_title?this.setting.share_title:uni.getStorageSync("basedata").mall.name,
path: "/pages/index/index?user_id=" + uni.getStorageSync('mall_UserInfo') ?uni.getStorageSync('mall_UserInfo').UserId:'',
imageUrl: this.setting.share_pic?this.setting.share_pic:'',
};
},
onShow() {
setTimeout(() => {
uni.hideNavigationBarLoading();
}, 500);
this.mainColor = this.$uiConfig.mainColor;
this.init()
},
methods: {
init() {
this.request2(
......@@ -177,9 +206,16 @@ export default {
this.myPageData=res.data;
uni.setStorageSync("basedata", res.data);
if (res.data.home_pages.title != "") {
if(this.pageId==0){
uni.setNavigationBarTitle({
title: res.data.home_pages.title,
});
}else{
uni.setNavigationBarTitle({
title: res.data.home_pages.navs[0].name,
});
}
uni.setNavigationBarColor({
//字体颜色
frontColor:res.data.navbar.top_text_color,
......
<template>
<view class="liveStyle" :style="{ height: contentHeight }">
<u-empty v-if="g.length == 0" text="暂无相关直播列表" mode="coupon"></u-empty>
<template
v-if="g.length > 0"
style="
height: calc(100vh -50px);
width: calc(100vw -20px);
overflow: hidden;
margin-left: 10px;
padding-top: 10px;
"
>
<scroll-view
:scroll-y="true"
@scrolltolower="lower"
:enable-back-to-top="true"
:enable-flex="true"
style="height: 100%; padding: 10px; padding-bottom: 0px;"
@scrolltolower="lower"
:style="{ height: '100%' ,}"
>
<view class="u-good-list" >
<u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)">
<view class="good-img">
<image
mode="aspectFit"
:src="cx.cover_img"
style="width: 100%; height: 100%;"
/>
</view>
<view class="good-name">{{ cx.name }}</view>
<view class="good-info">
<u-avatar :src="cx.anchor_img" size="80" ></u-avatar>
<Text style="font-size: 12px;">{{cx.anchor_name}}</Text>
</view>
</view>
</u-col>
</u-row>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</template>
<tabbars></tabbars>
</view>
</template>
<script>
import tabbars from '@/components/tabbar/index';
export default {
components: {
tabbars
},
data() {
return {
mc: "",
secondary: "",
pageTitle: "直播列表",
page: 1,
list: [],
pageCount: 1,
loading: true,
contentHeight: 0,
g:[],
msg:{
pageIndex: 1,
pageSize:10,
},
page_count: 1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
};
},
onLoad(option) {
uni.showNavigationBarLoading();
this.init();
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
let c = this.$uiConfig.is_bang ? 80 : 52;
this.contentHeight = this.$utils.calcContentHeight(c-40) + "px";
this.initPage();
uni.showNavigationBarLoading();
this.init();
},
methods: {
initPage() {
......@@ -48,27 +107,73 @@ export default {
});
},
init() {
let h = this.apiheader();
if (page < pageCount) {
this.request(
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: "",
header: h,
data: {
r: "api/live/index",
page: this.page,
},
url: '/api/AppletUser/GetLiveHouseList',
data: this.msg
},
(res) => {
this.list = res.data.list;
this.pageCount = 1;
res => {
uni.hideLoading();
uni.hideNavigationBarLoading();
if(res.resultCode==1){
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
},
};
</script>
<style></style>
<style>
.liveStyle{
background: #f3f4f6;
}
.liveStyle .u-good-list .good {
background: #fff;
border-radius: 10px;
overflow: hidden;
margin-bottom: 10px;
}
.liveStyle .u-good-list .good .good-img {
width: calc(50vw);
height: calc(50vw);
display: block;
}
.liveStyle .u-good-list .good .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 3px;
font-size: 13px;
margin: 7px 10px;
height: 36px;
}
.liveStyle .u-good-list .good .good-info {
display: flex;
margin: 7px 10px;
margin-top: 0;
align-items: flex-end;
padding-bottom: 5px;
}
</style>
......@@ -65,7 +65,7 @@
{
url: '/api/AppletUser/GetWeiXinQRCodeForApplet',
data: {
Path:'pages/index/index?pid=' + that.UserInfo.UserId,
Path:'pages/index/index?user_id=' + that.UserInfo.UserId,
With:that.qrcode.QrCodeSize,
}
},
......
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