Commit a52407a0 authored by zhangjianguo's avatar zhangjianguo

1

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