Commit 76add0e0 by 程智春

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents b699bef8 2de08701
const app = getApp()
const app = getApp();
console.log(app, 'apppppppppp')
console.log(app, "apppppppppp");
Component({
pageLifetimes: {
show() {
console.log('哈哈哈哈')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
console.log("哈哈哈哈");
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
});
}
}
},
......@@ -17,106 +16,108 @@ Component({
selected: 0,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [{
pagePath: "/pages/home/main",
iconPath: "https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectedIconPath: "https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
text: "组件",
list: [
{
pagePath: "/pages/home/main",
iconPath:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectedIconPath:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
text: "组件",
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 1, //0 iconfont 1 image
imgUrl: "https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectImgUrl: "https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
link: {
key: "1.1.1.7",
link: "/personalCenter/spokesmanCenter?distributionModel=1",
name: "分销商中心",
type: 1
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 1, //0 iconfont 1 image
imgUrl:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectImgUrl:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
link: {
key: "1.1.1.7",
link: "/personalCenter/spokesmanCenter?distributionModel=1",
name: "分销商中心",
type: 1
},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
}, {
pagePath: "/pages/index/main",
iconPath: "/static/images/bofang.png",
selectedIconPath: "/static/images/bofang.png",
text: "接口",
{
pagePath: "/pages/index/main",
iconPath: "/static/images/bofang.png",
selectedIconPath: "/static/images/bofang.png",
text: "接口",
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 0, //0 iconfont 1 image
imgUrl: "",
selectImgUrl: "",
link: {},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
}],
componentData: {}
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 0, //0 iconfont 1 image
imgUrl: "",
selectImgUrl: "",
link: {},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
}
],
componentData: {},
show: true
},
attached() {
let that = this
let that = this;
if (app.globalData.footerVal) {
that.setData({
componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list
})
});
} else {
app.footerCallBack = function (params) {
app.footerCallBack = function(params) {
that.setData({
componentData: params.componentData,
list: params.componentData.list
})
}
});
};
}
// ----------webview 变化
console.log('启动1111',this.getTabBar())
console.log("启动1111", this.getTabBar());
app.webviewCallBack = function (state,params) {
console.log('webview变化',state,params)
}
app.webviewCallBack = function(state, params) {
console.log("webview变化", state, params);
};
},
methods: {
init() {
},
init() {},
switchTab(e) {
const {
index
} = e.currentTarget.dataset
console.log('755555555', this.data.list[index].link)
const { index } = e.currentTarget.dataset;
console.log("755555555", this.data.list[index].link);
app.$themeToLink(this.data.list[index]['link'],1)
app.$themeToLink(this.data.list[index]["link"], 1);
// this.toPage(this.data.list[index].link,index)
// this.setData({
// selected: index
// })
// this.setData({
// selected: index
// })
},
toPage(data,index){
console.log('index98',index,this)
toPage(data, index) {
console.log("index98", index, this);
// index=index==0?index+1:index
// 跳转
if (data.link=='/') {
wx.switchTab({
url: '/pages/home/main',
})
}else{
wx.switchTab({
url: `/pages/tabBar${index}/main`,
})
// ?from=tabbar&backpath=${
// data.link
// }
}
// 跳转
if (data.link == "/") {
wx.switchTab({
url: "/pages/home/main"
});
} else {
wx.switchTab({
url: `/pages/tabBar${index}/main`
});
// ?from=tabbar&backpath=${
// data.link
// }
}
}
}
})
});
<!--miniprogram/custom-tab-bar/index.wxml-->
<cover-view class="tab-bar">
<cover-view class="antt ant-daipinglun"></cover-view>
<cover-view class="iconfont icon-fenzhi">3</cover-view>
<cover-view class="tab-bar" wx:if="{{show}}">
<cover-view class="antt ant-daipinglun"></cover-view>
<cover-view class="iconfont icon-fenzhi">3</cover-view>
<cover-view class="tab-bar-border"></cover-view>
<cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.link}}" data-index="{{index}}"
bindtap="switchTab">
<cover-view
wx:for="{{list}}"
wx:key="index"
class="tab-bar-item"
data-path="{{item.link}}"
data-index="{{index}}"
bindtap="switchTab"
>
<cover-view wx:if="{{item.iconType==0||!item.iconType}}">
<cover-view class="antt {{item.icon}}"></cover-view>
</cover-view>
<cover-view wx:elif="{{item.iconType==1}}"
class="img-view"
style="width:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};height:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}}">
<cover-view
wx:elif="{{item.iconType==1}}"
class="img-view"
style="width:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};height:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}}"
>
<cover-image src="{{selected === index ? item.selectImgUrl : item.imgUrl}}"></cover-image>
</cover-view>
<!-- 名称 -->
<cover-view
style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? componentData.selectionTextNum*2 : componentData.defaultTextNum*2}}rpx">
<cover-view style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? componentData.selectionTextNum*2 : componentData.defaultTextNum*2}}rpx">
{{item.title}}</cover-view>
</cover-view>
</cover-view>
\ No newline at end of file
</cover-view>
<template>
<div
ref="ThemeDataPlant"
class="ThemeDataPlant"
:style="{
'background-color': pageSettingData.backgroundColor,
'background-image':bacImage,
'background-repeat':pageSettingData.backgroundFit == 'repeat' ? 'repeat' : 'no-repeat',
'position':pageSettingData.backgroundImageLock ? 'fixed' : 'absolute',
}"
>
</div>
</template>
<script>
export default {
props: {
},
components : {
// 'area-navigation' : () => import('~/components/theme/components/other/area-navigation')
},
data() {
return {
flag: false,
render: true,
pageInfo:{},
pageData:{},
pageSettingData:{},
bacImage:""
};
},
created(){
if (this.mpApp.globalData.pageList) {
this.pageInfo = this.mpApp.globalData.pageList.filter((item) => item.pageCode == 1)[0];
this.pageSettingData = JSON.parse(this.pageInfo.pageSettingData);
console.log(this.pageInfo.pageSettingData,'kl')
}
},
mounted(){
this.bacImage = `url(${this.pageSettingData.backgroundImage})`
},
computed:{
}
};
</script>
<style lang="scss" scoped>
.ThemeDataPlant {
width:100%;
height: 100%;
position: absolute;
top:0;
z-index: -1;
}
.ThemeDataPlant::before {
content: " ";
// position: var(--lock);
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
// background-color: var(--bg_color);
// background-image: var(--image);
// background-repeat: var(--repeat);
background-size: 100% auto;
}
</style>
<template>
<div class="bottomCont">
<div class="bc1 flex">
<i></i>
<p @click="showVConsoles">底线在此,不能更低了</p>
<i></i>
</div>
<div class="bc2">
<img :src="shopInfo.logoUrl" alt />
</div>
<div class="bc3">
<!-- 送颂 -->
<p v-if="shopInfo.shopCode=='songsong'">送颂科技提供技术支持</p>
<!-- 嗨有料 -->
<p v-else-if="shopInfo.shopCode=='HYL' || shopInfo.shopCode=='Id9uwD' "></p>
<!-- <p
v-else-if="Array.isArray(this.$store.state.sceneModule.songCopyright)"
@click="showCookie"
>{{this.$store.state.sceneModule.songCopyright.some(item=>item==shopInfo.shopCode)?'送颂科技提供技术支持':'小工蚁(上股交N板企业300258)提供平台服务'}}</p> -->
</div>
<div class="height7"></div>
</div>
</template>
<script type="text/ecmascript-6">
import { DFSImg } from "@/utils/index";
export default {
data() {
return {
shopInfo: {
logoUrl:''
},
};
},
created(){
this.shopInfo = this.mpApp.globalData.shopInfo
this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400)
console.log(this.shopInfo,'mpapp123')
},
onLoad() {
},
onShow(){
},
methods:{
}
}
</script>
<style lang="scss" scoped>
.bottomCont {
width: 100%;
position: absolute;
padding: 10px 0;
z-index:10;
div {
width: 70%;
margin: 0 auto;
text-align: center;
color: #999;
font-size: 13px;
}
.bc1 {
justify-content: space-between;
align-items: center;
i {
width: 15%;
height: 1px;
background: #c3c3c3;
}
}
.bc2 {
width: 64px;
height: 64px;
margin-top: 20px;
margin-bottom: 10px;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
.height7{
width:100%;
height: 50px;
}
}
</style>
......@@ -39,6 +39,7 @@ mpApp.pageCallBack = function () { }
mpApp.footerCallBack = function () { }
// webview变化
mpApp.webviewCallBack = function () { }
mpApp.shareInit = function () {};
console.log('3555555', wx)
// 全局跳转 data为link对象
......
<template>
<div class="domain">
<view class="ant-daipinglun">1</view>
<!-- <view class="ant-daipinglun">1</view> -->
<!-- <goods-list id="goodsList"></goods-list> -->
<scroll-view @scroll="scrolls" @scrolltolower="scrolltolower" style="height:100vh;" scroll-y="true">
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner'">
<banner :datas="item"></banner>
</div>
<div v-else-if="item.componentCode=='goods-list'" style="height:100%;">
<goods-list class="goodsListItem" :datas="item"></goods-list>
</div>
<div v-else-if="item.componentCode == 'area-navigation'">
<area-navigation :datas="item"></area-navigation>
</div>
<div v-else-if="item.componentCode == 'cube-nav'">
<cube-nav :datas="item"></cube-nav>
</div>
<div v-else-if="item.componentCode == 'time-limited-discount'">
<time-limited-discount :datas="item"></time-limited-discount>
</div>
<div v-if="item.componentCode == 'links'">
<links :datas="item"></links>
</div>
<div v-if="item.componentCode == 'interval'">
<interval :datas="item"></interval>
</div>
<div v-if="item.componentCode == 'partition'">
<partition :datas="item"></partition>
</div>
<div v-if="item.componentCode == 'shop-popup'">
<shop-popup :datas="item"></shop-popup>
</div>
<div v-if="item.componentCode == 'float-button'">
<float-button :datas="item"></float-button>
<div style="position:relative">
<ThemeDataPlant></ThemeDataPlant>
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner'">
<banner :datas="item"></banner>
</div>
<div v-else-if="item.componentCode=='goods-list'" style="height:100%;">
<goods-list class="goodsListItem" :datas="item"></goods-list>
</div>
<div v-else-if="item.componentCode == 'area-navigation'">
<area-navigation :datas="item"></area-navigation>
</div>
<div v-else-if="item.componentCode == 'cube-nav'">
<cube-nav :datas="item"></cube-nav>
</div>
<div v-else-if="item.componentCode == 'time-limited-discount'">
<time-limited-discount :datas="item"></time-limited-discount>
</div>
<div v-if="item.componentCode == 'links'">
<links :datas="item"></links>
</div>
<div v-if="item.componentCode == 'interval'">
<interval :datas="item"></interval>
</div>
<div v-if="item.componentCode == 'partition'">
<partition :datas="item"></partition>
</div>
<div v-if="item.componentCode == 'shop-popup'">
<shop-popup :datas="item"></shop-popup>
</div>
<div v-if="item.componentCode == 'float-button'">
<float-button :datas="item"></float-button>
</div>
</div>
<div v-if="item.componentCode == 'goods-search'">
<goods-search :datas="item"></goods-search>
......@@ -44,6 +47,7 @@
<pop-up :datas="item"></pop-up>
</div>
</div>
<bottomCont></bottomCont>
</scroll-view>
<!-- <image
src="http://cdn.mayi888.com/public/jpg/33ff0efc-96b5-4044-a65a-07799dfe98e1.jpg?x-oss-process=image/resize,limit_1,w_750"
......@@ -58,15 +62,20 @@
<van-button type="primary">按钮</van-button> -->
<!-- </div> -->
<share-popup></share-popup>
</div>
</template>
<script>
import shop from "@/api/shop";
import bottomCont from "../../components/bottomCont"
import ThemeDataPlant from "../../components/ThemeDataPlant"
import links from '@/components/basicTool/link/index.vue'
import interval from '@/components/basicTool/interval/index.vue'
import partition from '@/components/basicTool/partition/index.vue'
import shopPopup from '@/components/basicTool/shop-popup/index.vue'
import { setTabBarActive, checkTabbarPage } from "../../utils/mayi.js";
const app = getApp();
export default {
data() {
......@@ -80,9 +89,57 @@ export default {
interval,
partition,
shopPopup,
bottomCont,
ThemeDataPlant
},
onShareAppMessage(res) {
let shareVal={};
if (res.from === "button") {
console.log(res.target,'-----------78');
return new Promise((resolve,reject)=>{
shop.getShopInfo({ shopMixId: "antgood" }).then(res=>{
if(res.data.code ==200){
let {shopName} = res.data.data;
let logoUrl = app.DFSImg(res.data.data.logoUrl,500,400,0);
resolve({
title: shopName,
path: "page/home/main",
imageUrl:logoUrl,
success: function(res) {
console.log("成功", res);
}
});
}
})
}).then(res=>{
return {
...res,
}
})
}
// return {
// title: shareVal.title,
// path: "page/home/main",
// imageUrl:shareVal.imageUrl,
// success: function(res) {
// console.log("成功", res);
// }
// };
},
onLoad() {
onLoad(options) {
let that = this;
// 来源
if (options.from == "logout") {
//来自用户登出
wx.removeStorage({
key: "sessionid"
});
wx.removeStorage({
key: "openid"
});
}
// 获取页面数据
if (this.mpApp.globalData.pageList) {
that.init(this.mpApp.globalData.pageList);
} else {
......@@ -118,4 +175,4 @@ export default {
/* text-align: center; */
/* padding-top: 50%; */
}
</style>
\ No newline at end of file
</style>
......@@ -10,7 +10,8 @@
"float-button":"/static/nativeComponents/FloatButton/index",
"goods-search":"/static/nativeComponents/GoodsSearch/index",
"notice":"/static/nativeComponents/Notice/index",
"pop-up":"/static/nativeComponents/PopUp/index"
"pop-up":"/static/nativeComponents/PopUp/index",
"share-popup":"/static/nativeComponents/SharePopup/index"
},
"enablePullDownRefresh":true
}
\ No newline at end of file
......@@ -133,7 +133,8 @@ export default {
if(this.page.includes("?")){
this.params="&mixid=" + this.shopId;
}
options.params && (this.params += "&" + serialize(options.params));
options.params && (this.params += "&" + serialize(decodeURIComponent(options.params)));
console.log(this.page,this.params)
} else if (options.from && options.from == "livedBackShop") {
//直播页back到商城
this.page = decodeURIComponent(options.backpath);
......
......@@ -19,7 +19,7 @@ export default {
return {
link: process.env.BASE_URL,
page: "/",
params: "?mixid=" + this.$store.state.mixid,
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1",
index: 1,
ss: "",
};
......@@ -35,7 +35,7 @@ export default {
// tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex==this.index && (this.index = 0);
homeIndex != 0 && homeIndex == this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link
......
......@@ -19,7 +19,7 @@ export default {
return {
link: process.env.BASE_URL,
page: "/",
params: "?mixid=" + this.$store.state.mixid,
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1",
index: 2,
ss: "",
};
......
......@@ -19,7 +19,7 @@ export default {
return {
link: process.env.BASE_URL,
page: "/",
params: "?mixid=" + this.$store.state.mixid,
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1",
index: 3,
ss: "",
};
......
......@@ -19,7 +19,7 @@ export default {
return {
link: process.env.BASE_URL,
page: "/",
params: "?mixid=" + this.$store.state.mixid,
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1",
index: 4,
ss: "",
};
......
......@@ -5,6 +5,7 @@ export function getUrlofLink(data) {
// 全局跳转 data:link数据 option:是否为底部栏触发
export function $themeToLink(data, option) {
let app = getApp();
let type = data.type;
// 点击底部栏
......@@ -72,6 +73,7 @@ export function $themeToLink(data, option) {
// this.$themeCouponClick(data.feature.value.couponCode, data.feature.value);
} else if (featureType == 1) {//分享
console.log('是分享了。。。。');
app.shareInit({ itemList: data.feature.value });
} else if (featureType == "themeMemberCardClick" || featureType == 2) { //会员卡
// this.$themeMemberCardClick(data.feature.value);
}
......
const app = getApp();
const { $themeToLink } = app;
const componentOptions = {
// 组件选项
options: {
multipleSlots: true
},
behaviors: [],
properties: {},
// 组件数据
data: {
isPageHidden: false, // 页面是否处于隐藏状态
showPop: false,
custom: {
textShow: 1,
itemList: [1, 1, 1],
itemListInfo: [],
href: "",
toPage: "", //跳转的页面
callback: "", //回调函数
extends: {} //额外参数
},
distributorVal: "",
type: 0,
phone: "",
href: "",
posterId: -1,
spokesmanGroupId: "",
spokesmanShopId: "",
spokesmanRelId: "",
hasInvitationStatus: 0,
nickname: "",
shareGoodsInfo: {},
giftIsSend: false,
miniProgram: 0,
flag: false,
productId: "",
copyLink: "32132132"
},
// 数据监听器
observers: {},
// 组件方法
methods: {
init() {
let _this = this;
let { custom } =this.data;
app.shareInit = function(list) {
for (const key in list) {
if (list.hasOwnProperty(key)) {
if (custom[key] !== "undefined" && custom[key] !== undefined && list[key] !== "undefined" && list[key] !== undefined) {
custom[key] = list[key];
}
}
}
_this.setData({ custom });
_this.showPopup();
};
},
showPopup() {
this.setData({ showPop: true });
this.getTabBar().setData({ show: false });
},
onClose() {
this.setData({ showPop: false });
this.getTabBar().setData({ show: true });
},
cancel() {
this.onClose();
},
copyText(e) {
let { text } = e.currentTarget.dataset;
let pagePath = getCurrentPages()[0].route;
// let copyVal = pagePath + text;
wx.setClipboardData({
data: copyVal,
success: function(res) {
wx.getClipboardData({
success: function(res) {
wx.showToast({ title: "复制成功" });
}
});
}
});
},
toPosters() {
let linkVal = `/goods/posters`;
$themeToLink({ type: 1, link: linkVal });
},
},
// 组件生命周期
lifetimes: {
created() {},
attached() {
this.init();
},
ready() {},
moved() {},
detached() {}
},
definitionFilter() {},
// 页面生命周期
pageLifetimes: {
// 页面被展示
show() {
const { isPageHidden } = this.data;
// show事件发生前,页面不是处于隐藏状态时
if (!isPageHidden) {
return;
}
// 重新执行定时器等操作
},
// 页面被隐藏
hide() {
this.setData({
isPageHidden: true
});
// 清除定时器等操作
},
// 页面尺寸变化时
resize() {}
}
};
Component(componentOptions);
{
"component": true,
"usingComponents": {
"van-popup": "/static/vant/popup/index"
}
}
<!-- 分享弹窗 -->
<view class="SharePopup" id="SharePopup">
<van-popup
show="{{ showPop }}"
position="bottom"
bind:close="onClose"
>
<!-- <view class="share-tip">
<text style="color:#333;font-size:28rpx;">朋友通过你分享的页面成功购买后,你可获得奖励金</text>
<text style="color:#333;font-size:24rpx;">可在【我的】 - 【distributorVal】查看奖励金</text>
</view>
<view class="share-tip">
<text style="color:#333;font-size:28rpx;">朋友通过你分享的页面成功登录后,将成为你的客户</text>
<text style="color:#333;font-size:24rpx;">可在【我的】 - 【distributorVal】-【我的客户】查看</text>
</view> -->
<view class="share-main">
<view class="share-item" wx:if="{{custom.itemList[0]==1}}">
<button
type="text"
open-type="share"
class="shareButton"
>
<image src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/015d5cd2-183a-44aa-9b66-5f7c2e627089.png"></image>
<text class="item-text">微信分享</text>
</button>
</view>
<view
class="share-item"
bindtap="copyText"
data-text="{{copyLink}}"
wx:if="{{custom.itemList[1]==1}}"
>
<image src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/0320a722-25d2-4a30-900f-790c2a541f2f.png"></image>
<text class="item-text">复制链接</text>
</view>
<view
class="share-item"
bindtap="toPosters"
wx:if="{{custom.itemList[2]==1}}"
>
<image src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/18d0044d-9634-4c89-8321-3e8ff8e94cce.png"></image>
<text class="item-text">生成海报</text>
</view>
</view>
<view class="share-cancel" bindtap="cancel">取消</view>
</van-popup>
</view>
.share-tip {
padding: 24rpx 0 0 32rpx;
text-align: center;
}
.share-tip text {
line-height: 48rpx;
}
.share-main {
width: 100%;
height: 254rpx;
display: flex;
justify-content: space-around;
align-items: center;
border-bottom: 20rpx solid #eeeeed;
}
.shareButton {
background-color: transparent;
padding-left: 0;
padding-right: 0;
line-height: inherit;
border-radius:0;
font-size: 28rpx;
}
.shareButton::after {
border: none;
}
.share-main .share-item {
text-align: center;
color: #333;
font-size: 28rpx;
}
.share-main .share-item image {
width: 112rpx;
height: 112rpx;
margin-bottom: 10rpx;
}
.share-cancel {
width: 100%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
font-size: 34rpx;
color: #f82f2e;
}
......@@ -20,7 +20,7 @@ const componentOptions = {
// 组件数据
data: {
isPageHidden: false, // 页面是否处于隐藏状态
hideItem: false,
// hideItem: false,
timeData: {}
},
// 数据监听器
......
<!-- 活动列表item -->
<view
class="activityListItem"
wx:if="{{!hideItem||!datas.isEnd}}"
wx:if="{{!datas.isEnd}}"
bindtap="toActivity"
>
<view class="title">
......
......@@ -191,7 +191,7 @@ const componentOptions = {
});
}
if (ids.length == 0) {
this.setData({ isLoading:true });
this.setData({ isLoading:false });
return;
}
promoteApi.query_single_item_activity_list_by_ids(ids).then(res => {
......@@ -246,10 +246,9 @@ const componentOptions = {
// 组件生命周期
lifetimes: {
created() {},
attached() {
ready() {
this.getData();
},
ready() {},
moved() {},
detached() {}
},
......@@ -258,12 +257,12 @@ const componentOptions = {
pageLifetimes: {
// 页面被展示
show() {
this.getData();
const { isPageHidden } = this.data;
// show事件发生前,页面不是处于隐藏状态时
if (!isPageHidden) {
return;
}
this.getData();
// 重新执行定时器等操作
},
......
......@@ -118,14 +118,13 @@
</view>
</view>
<!-- 活动列表 -->
<block wx:if="{{datas.componentData.dimension == 1 && isLoading}}">
<activity-list-item
wx:for="{{datas.componentData.actList}}"
wx:key="index"
datas="{{item}}"
num="{{index}}"
countDownShow="{{datas.componentData['countDownShow']}}"
></activity-list-item>
</block>
<activity-list-item
wx:if="{{datas.componentData.dimension == 1}}"
wx:for="{{datas.componentData.actList}}"
wx:key="index"
datas="{{item}}"
num="{{index}}"
countDownShow="{{datas.componentData['countDownShow']}}"
></activity-list-item>
</view>
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