order.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的订单'></cus-header>
  4. <view class="tab adfac">
  5. <view class="tab-pre" :class="{'active':tindex===index}" @click="changeTab(item,index)"
  6. v-for="(item,index) in statusList" :key="index">{{item}}</view>
  7. </view>
  8. <view class="list">
  9. <view class="list-pre" v-for="(item,index) in list" :key="index" @click.prevent="handleDetail(item)">
  10. <view class="list-pre-top adfacjb">
  11. <view class="list-pre-top-no">订单号:{{item.no}}</view>
  12. <view class="list-pre-top-status" :class="statusColor[item.status]">{{statusCfg[item.status]}}</view>
  13. </view>
  14. <view class="list-pre-info adf">
  15. <view class="list-pre-info-left adfac">
  16. <image class="list-pre-info-left-img" :src="imgBase+'order_img.png'"></image>
  17. <view class="list-pre-info-left-texts">
  18. <view class="list-pre-info-left-texts-num">{{typeCfg[item.type]}}{{item.sum}}次,剩余{{item.next}}次可用</view>
  19. <view class="list-pre-info-left-texts-date">有效期至 {{item.date}}</view>
  20. </view>
  21. </view>
  22. <view class="list-pre-info-right">¥{{item.price.toFixed(2)}}</view>
  23. </view>
  24. <view class="list-pre-btns adf">
  25. <view class="list-pre-btns-pre cancel" v-if="item.status==0" @click.stop="orderCancel">取消订单</view>
  26. <view class="list-pre-btns-pre" @click.stop="buyAgain">再次购买</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data(){
  35. return {
  36. tindex:0,
  37. statusList:['全部','已支付','待支付','已取消'],
  38. statusCfg:{
  39. 0:'待支付',
  40. 1:'已支付',
  41. 2:'已取消'
  42. },
  43. statusColor:{
  44. 0:'dzf',
  45. 1:'yzf',
  46. 2:'yqx'
  47. },
  48. typeCfg:{
  49. 1:'基础版',
  50. 2:'专业版'
  51. },
  52. list:[
  53. {
  54. no:'20229485872902',
  55. status:1,
  56. type:1,
  57. sum:1,
  58. next:1,
  59. price:99,
  60. date:'2025-11-11'
  61. },
  62. {
  63. no:'20229485872902',
  64. status:0,
  65. type:2,
  66. sum:5,
  67. next:4,
  68. price:199,
  69. date:'2025-11-11'
  70. },
  71. {
  72. no:'20229485872902',
  73. status:2,
  74. type:2,
  75. sum:10,
  76. next:0,
  77. price:799,
  78. date:'2025-11-11'
  79. }
  80. ]
  81. }
  82. },
  83. methods:{
  84. changeTab(item,index){
  85. this.tindex = index;
  86. },
  87. handleDetail(item){
  88. uni.navigateTo({
  89. url:'/pagesMy/orderDetail?item='+encodeURIComponent(JSON.stringify(item))
  90. })
  91. },
  92. orderCancel(){
  93. },
  94. buyAgain(){
  95. },
  96. }
  97. }
  98. </script>
  99. <style scoped lang="scss">
  100. .default_page{
  101. padding: 0 24rpx 40rpx;
  102. box-sizing: border-box;
  103. background: #F7F7F7;
  104. .tab{
  105. position: fixed;
  106. left: 0;
  107. right: 0;
  108. height: 90rpx;
  109. background: #FFFFFF;
  110. &-pre{
  111. width: 25%;
  112. height: 90rpx;
  113. font-family: PingFangSC, PingFang SC;
  114. font-weight: 400;
  115. font-size: 28rpx;
  116. color: #667E90;
  117. line-height: 90rpx;
  118. text-align: center;
  119. position: relative;
  120. &.active{
  121. font-weight: bold;
  122. font-size: 32rpx;
  123. color: #002846;
  124. &::after{
  125. content: '';
  126. width: 48rpx;
  127. height: 6rpx;
  128. background: #904A87;
  129. border-radius: 5rpx;
  130. position: absolute;
  131. left: 50%;
  132. margin-left: -24rpx;
  133. bottom: 4rpx;
  134. }
  135. }
  136. }
  137. }
  138. .list{
  139. padding-top: 110rpx;
  140. &-pre{
  141. background: #FFFFFF;
  142. border-radius: 25rpx;
  143. margin-top: 20rpx;
  144. padding: 36rpx 24rpx 29rpx;
  145. &:first-child{
  146. margin-top: 0;
  147. }
  148. &-top{
  149. &-no{
  150. font-family: PingFangSC, PingFang SC;
  151. font-weight: 400;
  152. font-size: 26rpx;
  153. color: #667E90;
  154. line-height: 30rpx;
  155. }
  156. &-status{
  157. padding: 6rpx 13rpx;
  158. border-radius: 6rpx;
  159. font-family: PingFangSC, PingFang SC;
  160. font-weight: 400;
  161. font-size: 24rpx;
  162. line-height: 30rpx;
  163. &.yzf{
  164. color: #33A7A7;
  165. background: rgba(51,167,167,0.08);
  166. }
  167. &.dzf{
  168. color: #FD4F66;
  169. background: rgba(244,101,122,0.1);
  170. }
  171. &.yqx{
  172. color: #667E90;
  173. background: #F0F2F8;
  174. }
  175. }
  176. }
  177. &-info{
  178. margin-top: 16rpx;
  179. border-top: 1rpx solid #EFEFEF;
  180. padding-top: 32rpx;
  181. justify-content: space-between;
  182. &-left{
  183. &-img{
  184. width: 64rpx;
  185. height: 64rpx;
  186. }
  187. &-texts{
  188. margin-left: 20rpx;
  189. &-num{
  190. font-family: PingFang-SC, PingFang-SC;
  191. font-weight: bold;
  192. font-size: 30rpx;
  193. color: #002846;
  194. line-height: 30rpx;
  195. }
  196. &-date{
  197. font-family: PingFangSC, PingFang SC;
  198. font-weight: 400;
  199. font-size: 26rpx;
  200. color: #667E90;
  201. line-height: 30rpx;
  202. margin-top: 20rpx;
  203. }
  204. }
  205. }
  206. &-right{
  207. font-family: PingFang-SC, PingFang-SC;
  208. font-weight: bold;
  209. font-size: 30rpx;
  210. color: #1D2129;
  211. line-height: 30rpx;
  212. text-align: right;
  213. }
  214. }
  215. &-btns{
  216. justify-content: flex-end;
  217. margin-top: 30rpx;
  218. &-pre{
  219. background: #904A87;
  220. border-radius: 27rpx;
  221. border: 1rpx solid #904A87;
  222. font-family: PingFangSC, PingFang SC;
  223. font-weight: 400;
  224. font-size: 24rpx;
  225. color: #FFFFFF;
  226. line-height: 30rpx;
  227. padding: 12rpx 26rpx;
  228. letter-spacing: 2rpx;
  229. margin-left: 30rpx;
  230. &.cancel{
  231. background: #FFFFFF;
  232. border: 1rpx solid #E2E2E2;
  233. color: #95A5B1;
  234. }
  235. }
  236. }
  237. }
  238. }
  239. }
  240. </style>