|
@@ -5,6 +5,7 @@
|
|
|
<image class="top_box_img" :src="head_img" mode="aspectFill"></image>
|
|
|
<view class="top_box_text">
|
|
|
<text class="text_box_top">{{title}}</text><text class="text_box_bottom" style="display:none">{{user_name}}</text>
|
|
|
+ <view class="tx_btn" @click="subTap()"><text class="iconfont tixingn">{{tixing_str}}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="popup-open" @click="showGoods()">
|
|
@@ -70,7 +71,8 @@
|
|
|
title:"888",
|
|
|
user_name:'1',
|
|
|
head_img:"../static/images/loginLogo.png",
|
|
|
- liveId: ''
|
|
|
+ liveId: '',
|
|
|
+ tixing_str:'直播提醒'
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -78,6 +80,18 @@
|
|
|
this.roomID = options.roomId
|
|
|
this.userID = "1323565280579813376"
|
|
|
this.liveId = options.liveId
|
|
|
+ NET.request(API.isSubscribed + options.liveId, {}, 'GET').then(res => {
|
|
|
+ if(res.data==false){
|
|
|
+ this.tixing_str="直播提醒"
|
|
|
+ }else{
|
|
|
+ this.tixing_str="取消提醒"
|
|
|
+ }
|
|
|
+ //this.goodsList = res.data
|
|
|
+ }).catch(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
// NET.request(API.getLiveGoodsDetail + options.liveId, {}, 'GET').then(res => {
|
|
|
// this.goodsList = res.data
|
|
|
// }).catch(res => {
|
|
@@ -86,8 +100,6 @@
|
|
|
// type: 'warning',
|
|
|
// })
|
|
|
// })
|
|
|
- },
|
|
|
- onReady() {
|
|
|
let menuButtonObject = wx.getMenuButtonBoundingClientRect();
|
|
|
wx.getSystemInfo({
|
|
|
success: res => {
|
|
@@ -113,6 +125,53 @@
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ subTap: function() {
|
|
|
+ let that = this;
|
|
|
+ if(that.tixing_str=="取消提醒"){
|
|
|
+ var post_data={liveId:that.liveId,mid:uni.getStorageSync("userData").userId}
|
|
|
+ post_data.isDelete=0;
|
|
|
+ NET.request(API.subscribeLive, post_data, 'POST').then(res => {
|
|
|
+ if(that.tixing_str=="取消提醒"){
|
|
|
+ that.tixing_str="直播提醒"
|
|
|
+ }else{
|
|
|
+ that.tixing_str="取消提醒"
|
|
|
+ }
|
|
|
+ //this.goodsList = res.data
|
|
|
+ }).catch(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.requestSubscribeMessage({
|
|
|
+ tmplIds: ['y0X1cZfbEMg7HdTGN_bW8v7TKeI3M0CHSVTY1zStIXM'],
|
|
|
+ success(res) {
|
|
|
+ if(res.y0X1cZfbEMg7HdTGN_bW8v7TKeI3M0CHSVTY1zStIXM=="accept"){
|
|
|
+ var post_data={liveId:that.liveId,mid:uni.getStorageSync("userData").userId}
|
|
|
+ if(that.tixing_str=="直播提醒"){
|
|
|
+ post_data.isDelete=1;
|
|
|
+ }else{
|
|
|
+ post_data.isDelete=0;
|
|
|
+ }
|
|
|
+ NET.request(API.subscribeLive, post_data, 'POST').then(res => {
|
|
|
+ if(that.tixing_str=="取消提醒"){
|
|
|
+ that.tixing_str="直播提醒"
|
|
|
+ }else{
|
|
|
+ that.tixing_str="取消提醒"
|
|
|
+ }
|
|
|
+ //this.goodsList = res.data
|
|
|
+ }).catch(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ console.log('444', res);
|
|
|
+ }
|
|
|
+ //console.log('1111', res);
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log('2222', res);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 打开弹窗
|
|
|
showGoods() {
|
|
|
this.$refs.popup.open()
|
|
@@ -471,14 +530,17 @@
|
|
|
}
|
|
|
}
|
|
|
.top_box{
|
|
|
- width: 304rpx;
|
|
|
- height: 86rpx;
|
|
|
- position: absolute;
|
|
|
- z-index: 100;
|
|
|
- background:rgba(0, 0, 0, 0.4);
|
|
|
- border-radius: 100px;
|
|
|
- top: 182rpx;
|
|
|
- left: 30rpx;
|
|
|
+ width: auto;
|
|
|
+ height: 86rpx;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 100;
|
|
|
+ background: rgba(0, 0, 0, 0.4);
|
|
|
+ -webkit-border-radius: 100px;
|
|
|
+ border-radius: 100px;
|
|
|
+ top: 182rpx;
|
|
|
+ left: 30rpx;
|
|
|
+ padding-right: 10rpx;
|
|
|
+
|
|
|
}
|
|
|
.top_box_img{
|
|
|
width: 86rpx;
|
|
@@ -490,21 +552,46 @@
|
|
|
float: left;
|
|
|
color: #fff;
|
|
|
margin-left: 30rpx;
|
|
|
- width: 180rpx;
|
|
|
+
|
|
|
padding-top: 2rpx;
|
|
|
}
|
|
|
.text_box_top{
|
|
|
- font-size: 34rpx;
|
|
|
- width: 100%;
|
|
|
- display: block;
|
|
|
- height: 30rpx;
|
|
|
- float: left;
|
|
|
- margin-top: 19rpx;
|
|
|
+ font-size: 34rpx;
|
|
|
+ /* width: 100%; */
|
|
|
+ display: block;
|
|
|
+ height: 30rpx;
|
|
|
+ float: left;
|
|
|
+ margin-top: 19rpx;
|
|
|
+ display: inline-block;
|
|
|
}
|
|
|
.text_box_bottom{
|
|
|
font-size: 22rpx;
|
|
|
float: left;
|
|
|
margin-top: 10rpx;
|
|
|
}
|
|
|
+ .tx_btn{
|
|
|
+ background: #4fa237;
|
|
|
+ display: inline-block;
|
|
|
+ height: 70rpx;
|
|
|
+ margin-top: 5rpx;
|
|
|
+ border-radius: 60rpx;
|
|
|
+ line-height: 70rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ margin-left: 30rpx;
|
|
|
+ }
|
|
|
+ .tx_btn image{
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ margin-top: 5rpx;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
+ .tixingn{
|
|
|
+ font-size: 34rpx;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tixingn:before {
|
|
|
+ font-size: 60rpx;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|