leiji.vue
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<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>