金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
6.2 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="订单管理" :showIcon="true" bgColor="#fff" @changeHeight="e => nav_height = e"></lf-nav>
  4. <view class="head">
  5. <u-tabs :list="tab_list" active-color="#0F31A3" inactive-color='#777777' :is-scroll="true" :current="tab_current" @change="tabChange"></u-tabs>
  6. </view>
  7. <swiper :style="{height: autoHeight}" :current="tab_current" @change="swiperChange">
  8. <swiper-item v-for="(tab_item, tab_index) in tab_list" :key="tab_index">
  9. <scroll-view :style="{height: autoHeight}" :scroll-y="true">
  10. <view class="content">
  11. <view class="card" v-for="(item, index) in 10" :key="index">
  12. <view class="lf-flex">
  13. <image class="goods-img"></image>
  14. <view class="info">
  15. <view class="lf-font-26 lf-color-333 lf-line-2">爱他美较大婴儿配方奶粉较大配方奶粉较2段 </view>
  16. <view class="lf-row-between" style="line-height: 1;">
  17. <text class="lf-font-24 lf-color-777">1900g</text>
  18. <text class="lf-font-32 lf-font-bold" style="color: #F63434;">¥385</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="order-num">
  23. <view class="deliver" v-if="index == 1" @click="deliver">发货</view>
  24. <view v-else>待付款</view>
  25. <view style="color: #F63434;">删除订单</view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </swiper-item>
  31. </swiper>
  32. <u-popup mode="bottom" v-model="show_deliver" :round="true" borderRadius="20">
  33. <view class="popup-content">
  34. <view class="title">选择物流商家</view>
  35. <picker mode="selector" :range="columns" :value="select_index" @change="selectChange">
  36. <view class="logistics" @click="show_logistics = true">
  37. <text>{{ columns[select_index] || '请选择物流' }}</text>
  38. <text class="lf-iconfont icon--1"></text>
  39. </view>
  40. </picker>
  41. <view class="title">订单编号</view>
  42. <input class="input" placeholder="请输入订单编号" v-model="orderNum" />
  43. <button class="btn" @click="confirm">确认发货</button>
  44. </view>
  45. </u-popup>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data(){
  51. let _public = {
  52. page: 1,
  53. isPage: true,
  54. loadingClass: true,
  55. loadingText: '正在加载中'
  56. }
  57. return {
  58. tab_current: 0,
  59. tab_list: [{
  60. name: '全部',
  61. list: [],
  62. ..._public
  63. },{
  64. name: '待付款',
  65. list: [],
  66. ..._public
  67. },{
  68. name: '待发货',
  69. list: [],
  70. ..._public
  71. },{
  72. name: '待提货',
  73. list: [],
  74. ..._public
  75. }],
  76. scrollH: 0,
  77. nav_height: 0,
  78. show_deliver: false,
  79. columns: [
  80. '中通快递', '申通快递', '圆通快递', '国通快递', '百世汇通快递',
  81. '顺丰快递', '京东快递', '天猫快递', 'EMS特快'
  82. ],
  83. show_logistics: false,
  84. select_index: null,
  85. orderNum: ''
  86. }
  87. },
  88. computed: {
  89. autoHeight(){
  90. return `calc(${this.scrollH}px - ${this.nav_height}px - 86rpx)`;
  91. }
  92. },
  93. onLoad(){
  94. let info = uni.getSystemInfoSync();
  95. this.scrollH = info.screenHeight;
  96. },
  97. methods: {
  98. tabChange(event){
  99. this.tab_current = event;
  100. },
  101. swiperChange(event){
  102. this.tab_current = event.detail.current;
  103. },
  104. deliver(){
  105. console.log("1111111");
  106. this.show_deliver = true;
  107. },
  108. selectChange(event){
  109. this.select_index = event.detail.value;
  110. },
  111. // 确认发货
  112. confirm(){
  113. console.log("选择的物流:", this.columns[this.select_index] || '未选择');
  114. console.log("订单号:", this.orderNum || '未输入');
  115. if(this.columns[this.select_index] && this.orderNum){
  116. this.show_deliver = false;
  117. }else{
  118. this.$msg('请将信息补充完整')
  119. }
  120. }
  121. }
  122. }
  123. </script>
  124. <style>
  125. page{
  126. background-color: #F8F8F8;
  127. }
  128. </style>
  129. <style lang="scss" scoped="scoped">
  130. .head{
  131. background-color: #FFFFFF;
  132. }
  133. .content{
  134. padding: 30rpx 32rpx;
  135. .card{
  136. width: 686rpx;
  137. height: max-content;
  138. background: #FFFFFF;
  139. border-radius: 20rpx;
  140. padding: 30rpx;
  141. box-sizing: border-box;
  142. &:nth-child(n+2){
  143. margin-top: 20rpx;
  144. }
  145. .shop-name{
  146. font-size: 28rpx;
  147. color: #222222;
  148. font-weight: bold;
  149. margin: 0 15rpx;
  150. }
  151. .goods-img{
  152. width: 130rpx;
  153. height: 130rpx;
  154. border-radius: 5rpx;
  155. margin-right: 15rpx;
  156. background-color: #EEEEEE;
  157. }
  158. .info{
  159. width: 480rpx;
  160. height: 130rpx;
  161. display: flex;
  162. flex-direction: column;
  163. justify-content: space-between;
  164. }
  165. .order-num{
  166. font-size: 24rpx;
  167. color: #555555;
  168. display: flex;
  169. justify-content: space-between;
  170. margin-top: 28rpx;
  171. .deliver{
  172. width: 109rpx;
  173. height: 35rpx;
  174. background: #0E2F9E;
  175. border-radius: 17rpx;
  176. font-size: 24rpx;
  177. color: #FFFFFF;
  178. line-height: 35rpx;
  179. text-align: center;
  180. }
  181. }
  182. }
  183. }
  184. .popup-content{
  185. width: 750rpx;
  186. height: max-content;
  187. background-color: #FFFFFF;
  188. box-sizing: border-box;
  189. padding: 60rpx 32rpx;
  190. .title{
  191. color: #555555;
  192. font-size: 28rpx;
  193. margin-bottom: 30rpx;
  194. }
  195. .logistics{
  196. width: 686rpx;
  197. height: 80rpx;
  198. background: rgba(14, 47, 158, 0.05);
  199. border-radius: 5rpx;
  200. border: 1rpx solid #0E2F9E;
  201. color: #0E2F9E;
  202. font-size: 28rpx;
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: center;
  206. padding: 0 30rpx;
  207. box-sizing: border-box;
  208. margin-bottom: 60rpx;
  209. }
  210. .input{
  211. width: 686rpx;
  212. height: 80rpx;
  213. background: rgba(14, 47, 158, 0.05);
  214. border-radius: 5rpx;
  215. padding: 0 30rpx;
  216. font-size: 28rpx;
  217. margin-bottom: 100rpx;
  218. }
  219. .btn{
  220. width: 550rpx;
  221. height: 100rpx;
  222. background: #0D2E9A;
  223. border-radius: 50rpx;
  224. line-height: 100rpx;
  225. color: #FFFFFF;
  226. }
  227. }
  228. // tabs 样式修改
  229. /deep/.u-scroll-box {
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  234. }
  235. /deep/.u-scroll-box .u-tab-bar {
  236. background-color: #0F31A3!important;
  237. width: 80rpx!important;
  238. position: absolute;
  239. left: 0;
  240. bottom: -12rpx;
  241. }
  242. /deep/.special_tab .u-tabs .u-scroll-box .u-tab-bar {
  243. background-color: #0F31A3!important;
  244. width: 56rpx!important;
  245. position: absolute;
  246. height: 5rpx!important;
  247. left: 8rpx;
  248. bottom: -4rpx;
  249. }
  250. /deep/ .u-tab-item {
  251. font-size: 28rpx!important;
  252. }
  253. </style>