Blame view
src/pages/myOrder/myOrder.vue
3.74 KB
4506eedf6 ss |
1 |
<template> |
e4713149a 我的订单修改 |
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<view class="content"> <view class="header"> <!-- 搜索--> <!-- <view class="searchBar"> <icon class="searchIcon" type="search" size="14"></icon> <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search"/> </view> --> <view class="screenBar"> <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)" > <view class="screenItem" v-bind:class="{ active: current === item.current }" >{{ item.text }}</view> </view> </view> </view> <view class="orderList"> <view v-for="(order) in orderList" |
92d01cfd5 修正订单数据 |
25 |
:key="order.pay_id" |
e4713149a 我的订单修改 |
26 27 28 29 |
> <OrderCard :order="order" :current="current" |
eed6c3ca9 订单列表添加支付和取消功能,修改订... |
30 |
v-if="order.order_info !== null" |
e4713149a 我的订单修改 |
31 32 33 34 35 |
></OrderCard> </view> </view> <view class="footer">没有更多订单了,去商城看看吧~</view> </view> |
843fce64e feat(master): 加入 ... |
36 |
</template> |
987972474 订单页card组件提取 |
37 |
<script> |
92d01cfd5 修正订单数据 |
38 39 |
import OrderCard from "./components/OrderCard.vue"; import store from "@/store"; |
72d769fb7 myOrder |
40 |
|
e4713149a 我的订单修改 |
41 42 |
export default { components: { |
92d01cfd5 修正订单数据 |
43 |
OrderCard: OrderCard |
e4713149a 我的订单修改 |
44 45 46 47 48 |
}, data() { return { // 顶部筛选项 screenItems: [ |
92d01cfd5 修正订单数据 |
49 50 51 |
{ current: "10", text: "全部" }, { current: "0", text: "待付款" }, { current: "1", text: "待收货" }, |
34703a767 订单逻辑修改 |
52 |
{ current: "2", text: "已完成" } |
e4713149a 我的订单修改 |
53 54 55 56 |
// {current:"3",text:'已评价'}, // {current:"4",text:'退款'}, ], // 当前所在item 默认10-->全部 |
92d01cfd5 修正订单数据 |
57 58 |
current: "10" }; |
e4713149a 我的订单修改 |
59 |
}, |
a8284c675 修改冲突 |
60 |
|
34703a767 订单逻辑修改 |
61 62 63 64 65 |
onShow() { store.dispatch("myOrder/getList", { way: "" }); }, |
e4713149a 我的订单修改 |
66 67 |
onLoad: function(option) { // 获取订单列表 |
34703a767 订单逻辑修改 |
68 69 70 |
// store.dispatch("myOrder/getList", { // way: "" // }); |
e4713149a 我的订单修改 |
71 |
// 从user过来传的status,给current,以显示对应item |
92d01cfd5 修正订单数据 |
72 |
this.current = option.status; |
e4713149a 我的订单修改 |
73 74 75 |
}, computed: { orderList() { |
fed83ad11 新增数据 |
76 |
console.log('orderList', this.$store.state.myOrder.orderList); |
92d01cfd5 修正订单数据 |
77 78 |
return this.$store.state.myOrder.orderList; } |
e4713149a 我的订单修改 |
79 80 81 82 83 |
}, methods: { // tab点击事件 onClickItem(e) { if (this.current !== e) { |
92d01cfd5 修正订单数据 |
84 |
this.current = e; |
e4713149a 我的订单修改 |
85 |
} |
92d01cfd5 修正订单数据 |
86 87 88 |
} } }; |
4506eedf6 ss |
89 90 |
</script> |
72a08fa45 icon |
91 |
<style lang="scss"> |
e4713149a 我的订单修改 |
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
.content { display: flex; flex-direction: column; align-items: center; background-color: #f7f6f6; min-height: 100vh; .header { background-color: #ffffff; width: 100%; // height: 232rpx; padding: 20rpx 40rpx 16rpx 40rpx; box-sizing: border-box; position: fixed; top: 0; left: 0; // .searchBar { // width: 670rpx; // display: flex; // justify-content: center; // align-items: center; // box-sizing: border-box; // padding: 0rpx 16rpx; // border: 1px solid #ff6b4a; // border-radius: 8rpx; // background-color: #ffffff; // } .screenBar { width: 670rpx; // height: 110rpx; height: 70rpx; display: flex; flex-direction: row; justify-content: space-between; align-items: center; color: #333333; font-size: 32rpx; } .screenItem { height: 50rpx; font-size: 32rpx; color: #333333; display: flex; justify-content: center; align-items: center; transition: all 0.2s; } .active { // font-size: 34rpx; color: #ec5d3b; } .searchIpt { height: 68rpx; width: 670rpx; padding: 16rpx; font-size: 28rpx; box-sizing: border-box; } } .orderList { // margin-top: 232rpx; margin-top: 132rpx; } .footer { font-size: 14px; color: #b8b8b8; margin: 40rpx 0; } } |
4506eedf6 ss |
161 |
</style> |