Skip to content

Commit

Permalink
Merge branch 'unicloud'
Browse files Browse the repository at this point in the history
  • Loading branch information
Samciu committed Jul 5, 2021
2 parents 1abc054 + b4edcf6 commit 1dae7d0
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 3 deletions.
77 changes: 77 additions & 0 deletions pages/activity/components/subscribeGuide/subscribeGuide.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<template>
<view>
<view class="subscribe-guide-bg"></view>
<view class="subscribe-guide is-show">
<view class="img-box">
<image
class=""
mode="widthFix"
src="https://h5.chuxingyouhui.com/shop/assets/y-project/8efd35a49d786a1e6612da3d1375db69.png"
/>
</view>
</view>
</view>
</template>

<style lang="scss" scoped>
.img-box {
display: block;
width: 696rpx;
height: 380rpx;
overflow: hidden;
}
image {
display: block;
width: 26448rpx;
animation: image-play 2.5s steps(37) infinite;
}
.subscribe-guide {
position: fixed;
bottom: 60%;
left: 50%;
margin-left: -348rpx;
z-index: 9999;
}
.subscribe-guide-bg {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 9999;
}
.subscribe-guide-animation-box {
width: 696rpx;
height: 380rpx;
}
.subscribe-guide-animation {
height: 100%;
background: url(https://h5.chuxingyouhui.com/shop/assets/y-project/8efd35a49d786a1e6612da3d1375db69.png)
no-repeat 0 top;
background-size: 26448rpx 100%;
animation: play 2.5s steps(37) infinite;
}
@keyframes play {
0% {
background-position-x: 0;
}
100% {
background-position-x: -25752rpx;
}
}
@keyframes image-play {
100% {
transform: translate3d(-25752rpx, 0, 0);
}
}
</style>
34 changes: 31 additions & 3 deletions pages/activity/sign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<view class="part1">
<block v-for="(item, index) in info.taskSignList" :key="index">
<view class="line" v-if="index > 0"></view>
<view class="item" @click="jump(item)">
<view class="item" @click="sign(item)">
<image class="" :src="item.logo"></image>
<text class="">{{ item.name }}</text>
<view class="btn-black">立即领取</view>
Expand Down Expand Up @@ -170,27 +170,34 @@
<contactBox @closeExchange="closeExchange" :info="info" />
</uni-popup>
</loginWrap>
<subscribeGuide v-show="showGide" />
<customTabBar tab="sign"></customTabBar>
</view>
</template>

<script>
import { getTaskSignInfo, getTaskSignDo, getInviteList } from "@/request";
import { getTaskSignInfo, getTaskSignDo, getInviteList, getSignSubscribe } from "@/request";
import rulesBox from "./components/rulesBox/rulesBox.vue";
import contactBox from "./components/contactBox/contactBox.vue";
import subscribeGuide from "./components/subscribeGuide/subscribeGuide.vue";
export default {
data() {
return {
info: {},
inviteList: [],
templateIds: [],
showGide: false
};
},
components: {
rulesBox,
contactBox,
subscribeGuide
},
onLoad() {
this.getSignSubscribe();
},
onLoad() {},
onShow(e) {
console.log("onShow", e);
this.getTaskSignInfo();
Expand All @@ -208,10 +215,31 @@ export default {
console.log("inviteList", res.data.data);
},
async getSignSubscribe() {
const [err, res] = await getSignSubscribe();
this.templateIds = res.data.data.templateIds
},
async getTaskSignDo(data) {
const [err, res] = await getTaskSignDo(data);
},
async sign(item) {
// 发起申请订阅权限界面
const templateIds = this.templateIds;
this.showGide = true;
const [error, res] = await uni.requestSubscribeMessage({
tmplIds: templateIds,
});
this.showGide = false;
// 判断是否订阅至少一条
// const hasSubscribed = !error && Object.keys(res).some(key => res[key] == "accept")
// if (!hasSubscribed) return;
this.jump(item)
},
async jump(item) {
const [err, res] = await uni.navigateToMiniProgram({
appId: item.package.minapp.appid,
Expand Down
7 changes: 7 additions & 0 deletions request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,11 @@ export const getInviteList = async data => {
url: "/minapp/v1/task/sign/invite/list",
data,
})
}

export const getSignSubscribe = async data => {
return request({
url: "/minapp/v1/task/sign/subscribe",
data,
})
}

0 comments on commit 1dae7d0

Please sign in to comment.