order.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="sub-base-container">
  3. <view class="search-box">
  4. <v-search @searchCallback="searchCallback" @clearCallback="clearCallback"></v-search>
  5. </view>
  6. <view class="tabs">
  7. <view :class="['tab-item',{active:active === index}]" v-for="(item,index) in tabsList" :key="index"
  8. @click="handleTab(index)">{{item}}</view>
  9. </view>
  10. <view class="shop-list">
  11. <view class="shop-item" v-for="(item,index) in 3" :key="index">
  12. <view class="shop-head">
  13. <view class="shop-title">
  14. <text>从化荔博园店铺</text>
  15. <up-icon class="icon" name="arrow-right" size="12" color="rgba(137, 137, 137, 0.69)"></up-icon>
  16. </view>
  17. <text class="status">{{statusStr[active]}}</text>
  18. </view>
  19. <view class="shop-cont">
  20. <image class="shop-img" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png">
  21. </image>
  22. <view class="shop-info">
  23. <view class="shop-name flex">
  24. <text>海南妃子笑荔枝新鲜采摘</text>
  25. <text class="shop-price">¥25</text>
  26. </view>
  27. <view class="shop-text flex">
  28. <text>3斤装规格</text>
  29. <text>x1</text>
  30. </view>
  31. <up-text size="12" color="#AFAFAF" text="坏单包退 包邮"></up-text>
  32. <view class="total">
  33. <view v-if="active==3 || active==4">共优惠 <text class="num">¥10</text></view>
  34. <view v-if="active!=0 || active!=1">实付款 <text class="num">¥25</text></view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="shop-foot flex">
  39. <view class="more">更多</view>
  40. <view class="shop-button" v-if="active==0 || active==1">
  41. <view>取消订单</view>
  42. <view>付款</view>
  43. </view>
  44. <view class="shop-button" v-else-if="active==2">
  45. <view>删除订单</view>
  46. <view>提醒发货</view>
  47. </view>
  48. <view class="shop-button" v-else-if="active==3">
  49. <view>删除订单</view>
  50. <view>查看物流</view>
  51. <view class="confirm">确认收货</view>
  52. </view>
  53. <view class="shop-button" v-else="active==4">
  54. <view>申请售后</view>
  55. <view>去评价</view>
  56. <view class="confirm">再买一单</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script setup>
  64. import {
  65. ref
  66. } from "vue"
  67. const searchCallback = (e) => {
  68. console.log('搜索', e)
  69. }
  70. const clearCallback = () => {
  71. console.log('clear')
  72. }
  73. const active = ref(0)
  74. const tabsList = ["全部", "待付款", "待发货", "待收货", "待评价", "退款/售后"]
  75. const handleTab = (index) => {
  76. active.value = index
  77. }
  78. const statusStr = {
  79. 0:"待付款",
  80. 1:"待付款",
  81. 2:"待发货",
  82. 3:"待收货",
  83. 4:"交易成功",
  84. 5:"退款/售后",
  85. }
  86. // const shopList = [
  87. // {
  88. // status:0,
  89. // }
  90. // ]
  91. </script>
  92. <style lang="scss" scoped>
  93. .sub-base-container {
  94. padding: 0;
  95. .search-box{
  96. padding: 16rpx 24rpx 20rpx;
  97. background: #fff;
  98. }
  99. .tabs {
  100. width: 100%;
  101. padding: 0 24rpx 16rpx;
  102. box-sizing: border-box;
  103. display: flex;
  104. overflow-x: auto;
  105. background: #fff;
  106. .tab-item {
  107. // flex: 1;
  108. width: 150px;
  109. text-align: center;
  110. color: #000;
  111. font-size: 28rpx;
  112. padding: 10rpx 0;
  113. white-space: nowrap;
  114. &.active {
  115. border-radius: 10rpx;
  116. background: rgba(243, 193, 29, 0.2);
  117. }
  118. }
  119. }
  120. .shop-list {
  121. font-size: 28rpx;
  122. .flex {
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. }
  127. .shop-item {
  128. background: #fff;
  129. padding: 20rpx 24rpx;
  130. .shop-head {
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. .shop-title {
  135. font-weight: 500;
  136. display: flex;
  137. .icon{
  138. margin-left: 2rpx;
  139. }
  140. }
  141. .status {
  142. color: #F3C11D;
  143. }
  144. }
  145. .shop-cont {
  146. width: 100%;
  147. display: flex;
  148. margin: 20rpx 0;
  149. .shop-img {
  150. width: 182rpx;
  151. height: 182rpx;
  152. margin-right: 10rpx;
  153. border-radius: 10rpx;
  154. }
  155. .shop-info {
  156. width: calc(100% - 182rpx - 10rpx);
  157. .shop-name {
  158. font-size: 28rpx;
  159. font-weight: 500;
  160. .shop-price {
  161. font-weight: 400;
  162. }
  163. }
  164. .shop-text {
  165. color: #717070;
  166. }
  167. .total {
  168. margin-top: 20rpx;
  169. display: flex;
  170. justify-content: flex-end;
  171. .num{
  172. font-weight: 500;
  173. font-size: 34rpx;
  174. }
  175. view + view{
  176. margin-left: 20rpx;
  177. }
  178. }
  179. }
  180. }
  181. .shop-foot{
  182. .more{
  183. color: rgba(0, 0, 0, 0.5);
  184. }
  185. .shop-button{
  186. display: flex;
  187. align-items: center;
  188. view{
  189. width: 164rpx;
  190. padding: 10rpx 0;
  191. text-align: center;
  192. border-radius: 50rpx;
  193. border: 2rpx solid rgba(0, 0, 0, 0.3);
  194. }
  195. .confirm{
  196. background: #FFD95E;
  197. border: 2rpx solid transparent;
  198. }
  199. view + view{
  200. margin-left: 20rpx;
  201. }
  202. }
  203. }
  204. }
  205. .shop-item + .shop-item{
  206. margin-top: 10rpx;
  207. }
  208. }
  209. }
  210. </style>