From 6ccb9ca8f1f71d41fbbe1a384367e6477cb78bd2 Mon Sep 17 00:00:00 2001 From: zhangjing Date: Fri, 26 Jan 2024 17:37:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B7=BB=E5=8A=A0=E6=A2=B5=E5=91=97=E5=BC=B9?= =?UTF-8?q?=E7=AA=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/interfaces/index.js | 9 ++++++- api/request.js | 4 +-- app.json | 6 ----- pages/index/index.js | 41 +++++++++++++++++++++++++++++- pages/index/index.wxml | 14 +++++++++-- pages/index/index.wxss | 56 ++++++++++++++++++++++++++++++++++++++++- pages/user/index.wxml | 4 +-- 7 files changed, 119 insertions(+), 15 deletions(-) diff --git a/api/interfaces/index.js b/api/interfaces/index.js index 496edd9..46ed569 100644 --- a/api/interfaces/index.js +++ b/api/interfaces/index.js @@ -36,11 +36,18 @@ const articlesSubscribe = (article_id) => req({ url: "cms/articles/subscribe/" + article_id }) +// 广告开关 +const festival = () => req({ + url: "festival" +}) + + export default ({ home, articlesList, articlesSee, articlesClass, articlesFavorite, - articlesSubscribe + articlesSubscribe, + festival }) \ No newline at end of file diff --git a/api/request.js b/api/request.js index fd0b7a4..0cd406c 100644 --- a/api/request.js +++ b/api/request.js @@ -11,8 +11,8 @@ import {updToken} from './updateToken' // https://api.siyuankunlun.com //正式地址 // wxecf8786d25af47b3 正式appid -const api = "https://apitest.siyuankunlun.com/api/" -// const api = "https://api.siyuankunlun.com/api/" +// const api = "https://apitest.siyuankunlun.com/api/" +const api = "https://api.siyuankunlun.com/api/" const header = { "Accept" : "application/json" diff --git a/app.json b/app.json index c9159e0..9535af7 100644 --- a/app.json +++ b/app.json @@ -62,12 +62,6 @@ "iconPath": "/static/tabBarIcon/02.png", "selectedIconPath": "/static/tabBarIcon/02_active.png" }, - { - "pagePath": "pages/member/index", - "text": "锶源会员", - "iconPath": "/static/tabBarIcon/04.png", - "selectedIconPath": "/static/tabBarIcon/04_active.png" - }, { "pagePath": "pages/user/index", "text": "锶人中心", diff --git a/pages/index/index.js b/pages/index/index.js index 4399d6a..8d35c36 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -14,6 +14,8 @@ Page({ videos : '', isFixedTop : 0, barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + showActivity : '', + checkBubble : false }, /** @@ -30,7 +32,13 @@ Page({ data : options.invite }) } - console.log(wx.getStorageSync("inviteData")) + + // 获取开关接口 + wx.$api.index.festival().then(res => { + this.setData({ + showActivity: res.data.show_activity + }) + }).catch(err => {}) }, /** @@ -102,4 +110,35 @@ Page({ url: '/pages/article/index?type=' + e.currentTarget.dataset.type }) }, + + // 梵呗弹框关闭 + checkTap() { + this.setData({ + showActivity: !this.data.showActivity, + checkBubble: true + }) + }, + + bubbleTap() { + this.setData({ + showActivity: true, + checkBubble: false + }) + }, + + checkWx() { + this.setData({ + showActivity: !this.data.showActivity, + checkBubble: true + }) + wx.navigateToMiniProgram({ + appId: 'wx9ae0c63d0c58caeb', + path: '/pages/activity/activity', + envVersion: 'release', + success: res=> { + // 打开成功 + console.log("跳转小程序成功!",res); + } + }) + } }) \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0e25df8..8bf4928 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -13,7 +13,7 @@ - + @@ -110,4 +110,14 @@ - \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 8609f74..27c44a3 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -151,7 +151,7 @@ /* 用水指南 */ .other { - padding: 0 30rpx; + padding: 30rpx 30rpx 0; box-sizing: border-box; } @@ -339,4 +339,58 @@ top: 0; left: 0; z-index: 99; +} + + +/* 梵呗弹框 */ +.checkEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 1000; + display: none; +} + +.checkEject.active { + display: block; +} + +.checkCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1001; + text-align: center; + display: none; + box-sizing: border-box; + padding-top: 95rpx; +} + +.checkCont.active { + display: -webkit-box; +} + +.checkCont-img { + width: 100%; + border-radius: 20rpx; +} + +.checkCont-close { + width: 70rpx; + margin-top: 25rpx; +} + +.bubble { + position: fixed; + right: 0; + bottom: 12%; + width: 15%; + z-index: 100000; } \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index bf0b430..17d26b7 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -196,11 +196,11 @@ 库存量信息 {{ caseOrder.residue}} - + 邀请码