leiji.vue 2.2 KB
<template>
	<view class="container">
		<view class="goodlist">
			<view class="goodlistitem flex" v-for="(item,index) in listshilist" :key="index" @cilck="entergood(item)">
				<view class="goodlistimg">
					<image :src="item.image" mode=""></image>
				</view>
				<view class="goodlistright">
					<view class="goodrighttop flextwo">
						<view class="goodname">{{item.name}}</view>
						<view class="shareimg">
							<image src="../static/share.png" mode="" class="sharebtn"></image>
						</view>
					</view>
					<view class="zhibo flextwo">
						<view class="zhiboleft">{{item.anchor.name}}{{item.anchor.platform}}</view>
						<view class="kaibo">{{item.anchor_time.time}}开播</view>
					</view>
					<view class="zhiboprice">
						直播价 ¥<text class="pricege">{{item.live_price}}</text>送同款234ml
					</view>
					<view class="cankao flextwo">
						<view class="cankaoleft">参考价(京东¥{{item.r_price}}元)</view>
						
						<view class="canceltixing" @click.stop="cancelti(index,item.id)">
							取消提醒
						</view>
						
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import app from "../App.vue"
		
	    export default {
			 props: ["listshilist"],
	        data() {
	            return {
	                
	            }
	        },
	        onLoad() {
	
	
	
	        },
	        methods: {
				// 取消提醒
	           cancelti(index,id){
				   let that = this;
				   var url = "goods/addUserGoods"
				   var param={
					goods_id:id
				   }
				   app.post(url, param, "post").then(res => {
				   	console.log('取消订阅', res)
				   	uni.showToast({
				   		title:"取消订阅成功",
						icon:"none"
				   	})
					console.log(index)
					let newlishsilist=that.listshilist;
					newlishsilist.splice(index,1)
					that.listshilist=newlishsilist;
					that.$forceUpdate()
					that.$emit('tixing', that.listshilist)
				   
				   }).catch(err => {
				   	console.log(err)
				   })
			   },
			   // 进入链接页面
			   entergood(item){
			   	uni.navigateTo({
			   		url:"/pages/xinyuan/goodlianjie?code="+item.code
			   	})
			   }
	      
	        }
	
	    }
</script>

<style>
	@import url("../style/goodlist");
</style>