<template>
<div>
<div class="content clearfix" v-on:click="goorderingDetail(v)" v-for="(v,index) in anylist" :key="index">
<div class="clearfix">
<div class="fl dingnumber">订单号&nbsp;&nbsp;<span>{{v.orderNum}}</span></div>
<div class="fr state">{{v.state}}</div>
</div>
<div class="clearfix receive">
<div class="fl">收</div>
<div class="fr add reAdd">{{v.receiveAdd}}</div>
</div>
<div class="clearfix send">
<div class="fl">发</div>
<div class="fr add sAdd">{{v.sendAdd}}</div>
</div>
<div class="date fl">2018年9月28日&nbsp;&nbsp;&nbsp;&nbsp;12:00</div>
<div class="fr sure" v-on:click.stop="gosureReceive(v)">确认取件</div>
</div>
</div>
</template> <script>
import $ from 'jquery'
export default {
name: 'ordering',
data () {
return {
anylist: []
}
},
mounted () {
this.ready()
},
methods: {
ready: function () {
$.ajax({
type: 'GET',
url: './../../../static/ing.json',
data: {},
dataType: 'json'
}).then(res => {
// console.log(res)
// console.log(res.data)
this.anylist = res.data
})
.catch(error => {
console.log(error)
})
},
goorderingDetail: function (v) {
// console.log(v.receiveAdd)
// console.log(v.sendAdd)
/* 获取当前点击内容的收件发件地址 */
var IreAdd = v.receiveAdd
var IseAdd = v.sendAdd
var IOrderNum = v.orderNum
sessionStorage.setItem('IReAdd', JSON.stringify(IreAdd))
sessionStorage.setItem('ISeAdd', JSON.stringify(IseAdd))
sessionStorage.setItem('IOrderNum', JSON.stringify(IOrderNum))
this.$router.push({path: '/orderingDetail'})
},
gosureReceive: function (v) {
// console.log(v.receiveAdd)
// console.log(v.sendAdd)
/* 获取当前点击内容的收件发件地址 */
var IreAdd = v.receiveAdd
var IseAdd = v.sendAdd
sessionStorage.setItem('IReAdd', JSON.stringify(IreAdd))
sessionStorage.setItem('ISeAdd', JSON.stringify(IseAdd))
this.$router.push({path: '/sureReceive'})
}
}
}
</script> <style scoped>
.content{
width: 96%;
margin: auto;
padding: 0.3rem;
background: #ffffff;
box-shadow: 5px 5px 5px #eae8e8;
margin-top: 0.5rem;
}
.dingnumber{
font-size: 0.8rem;
line-height: 1.7rem;
}
.state{
font-size: 1rem;
letter-spacing: 1px;
color: #ff7c1d;
margin-right: 0.5rem;
font-weight: bold;
}
.receive,.send{
font-size: 0.9rem;
font-weight: bold;
color: #ff7c1d;
margin-top: 1rem;
}
.add{
width: 85%;
vertical-align: bottom;
word-break:keep-all;/* 不换行 */
white-space:nowrap;/* 不换行 */
overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
}
.date{
text-align: left;
font-size: 0.8rem;
padding: 0.2rem;
margin-top: 2rem;
}
.sure{
padding: 0.5rem 1rem 0.5rem 1rem;
border: 1.5px solid #ff7c1d;
letter-spacing: 1px;
border-radius: 0.3rem;
margin-top: 0.9rem;
margin-right: 0.3rem;
font-weight: bold;
color: #ff7c1d;
font-size: 0.9rem;
z-index: 1000;
}
</style>

上面代码中,第3行和第17行:

第3行和第17行函数都包含在v-for循环中,参数中传入的参数v都可以获取到数据集合

第50和第62行在函数中传入v即可获取到对应的值(但是需要在定义函数和使用函数时都传入参数v才能用)

最新文章

  1. ASP.NET MVC Model验证(三)
  2. BZOJ 2438: [中山市选2011]杀人游戏
  3. 字符模型和Windows等价程序
  4. asp.net mvc4使用百度ueditor编辑器
  5. PostgreSQL的创建表
  6. 低功耗之战!ANT VS Bluetooth LE
  7. 小测试 php代理,nginx代理,直接访问对比
  8. (64位oracle使用32位的PLSQL)安装64位的oracle数据库软件,使用32位的PLSQL Developer连接方法
  9. xamarin Android activity生命周期详解
  10. java遍历Map
  11. 批量数据的Excel导入
  12. [Demo_01] MapReduce 实现密码 Top10 统计
  13. Spark算子讲解(二)
  14. pandas与sqlalchemy交互实现科学计算
  15. (转载)C#工具箱Menustrip控件中分割线的设置方法
  16. java 数据导入xls
  17. C++STL 算法
  18. LinkedBlockQueue生产消费源码解析
  19. Asp.net单点登录解决方案
  20. python学习(十六)写爬虫爬取糗事百科段子

热门文章

  1. 设计模式之九:建造者模式(Builder)
  2. Unity UGUI——UI基础,Canvas
  3. elasticsearch搜索类型简单介绍
  4. Java:JDBC操作
  5. 学习参考《矩阵分析与应用(第二版)张贤达》PDF
  6. ajax和axios请求本地json数据对比
  7. Tomcat 的三种高级运行模式
  8. sendfile复习
  9. 怎么成为合格的WEB前端开发工程师
  10. 网络最大流算法—Dinic算法及优化