金诚优选前端代码
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.

558 lines
17 KiB

  1. <template>
  2. <view>
  3. <lf-nav :spreadOut="true" :showIcon="true" bgColor="white" title="在线商城订单"></lf-nav>
  4. <view class="lf-row-between lf-bg-white">
  5. <view class="online-tab" :class="online_tab==0?'online-active':''" @click="online_tab = 0">线上订单</view>
  6. <view class="online-tab" :class="online_tab==1?'online-active':''" @click="online_tab = 1">线下订单</view>
  7. </view>
  8. <view v-if="online_tab == 0">
  9. 线上订单
  10. </view>
  11. <view v-else>
  12. <view class="special_tab">
  13. <u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
  14. </view>
  15. <view class="lf-p-30 lf-flex lf-w-100 lf-bg-white lf-m-b-30">
  16. <u-icon name="search" class="search-icon"></u-icon>
  17. <input class="rom-search" type="text" placeholder="请输入商品名称" />
  18. </view>
  19. <swiper :style="{height: '1200rpx', width: '750rpx'}" :current="current" @change="swiperChange">
  20. <swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex">
  21. <scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="tabItem.isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
  22. <view v-for="(item2,index2) of tabItem.list" :key="index2" class="online-card">
  23. <view class="lf-font-24 lf-color-777">
  24. 订单编号783974398749328
  25. </view>
  26. <view class="lf-m-t-30">
  27. <text class="lf-iconfont icon-Group- lf-font-28"></text>
  28. <text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">精品超市</text>
  29. <text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text>
  30. </view>
  31. <view v-for="i of 5">
  32. <view class="lf-m-t-30" style="display: flex;">
  33. <image class="content-img" src="https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png" mode="aspectFill"></image>
  34. <view class="lf-m-l-15">
  35. <view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">爱他美较大婴儿配方奶粉较大婴儿配方奶粉较大婴儿配方奶粉2段 900g</view>
  36. <view class="lf-font-24 lf-color-777 lf-m-t-14 lf-row-between">
  37. <view>1900g</view>
  38. <view class="lf-font-32 lf-color-price">385</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="lf-row-between lf-m-t-30">
  43. <view class="lf-font-24 lf-color-777">订单关闭</view>
  44. <view class="lf-color-price lf-font-24">删除订单</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="loading-more lf-m-b-10">
  49. <text :class="{'loading-more-text': tabItem.loadingClass}" v-if="tabItem.list.length">{{tabItem.loadingText}}</text>
  50. <lf-nocontent v-else></lf-nocontent>
  51. <!-- <view>
  52. {{tabItem.list.length}}
  53. </view> -->
  54. </view>
  55. </scroll-view>
  56. </swiper-item>
  57. </swiper>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. online_tab: 1,
  66. tab_list: [
  67. {
  68. id: 1,
  69. name: '综合',
  70. list: [
  71. {
  72. id: 10,
  73. original_price: "4111.00",
  74. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  75. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  76. price: "2412.00",
  77. product_id: 1008,
  78. sale: 0,
  79. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  80. },
  81. {
  82. id: 10,
  83. original_price: "4111.00",
  84. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  85. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  86. price: "2412.00",
  87. product_id: 1008,
  88. sale: 0,
  89. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  90. },
  91. {
  92. id: 10,
  93. original_price: "4111.00",
  94. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  95. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  96. price: "2412.00",
  97. product_id: 1008,
  98. sale: 0,
  99. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  100. },
  101. {
  102. id: 10,
  103. original_price: "4111.00",
  104. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  105. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  106. price: "2412.00",
  107. product_id: 1008,
  108. sale: 0,
  109. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  110. }
  111. ],
  112. isRefresher: false,
  113. loadingClass: false,
  114. loadingText: '正在加载中',
  115. page: 1,
  116. isPage: true
  117. },
  118. {
  119. id: 2,
  120. name: '销量',
  121. list: [
  122. {
  123. id: 10,
  124. original_price: "4111.00",
  125. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  126. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  127. price: "2412.00",
  128. product_id: 1008,
  129. sale: 0,
  130. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  131. },
  132. {
  133. id: 10,
  134. original_price: "4111.00",
  135. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  136. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  137. price: "2412.00",
  138. product_id: 1008,
  139. sale: 0,
  140. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  141. },
  142. {
  143. id: 10,
  144. original_price: "4111.00",
  145. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  146. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  147. price: "2412.00",
  148. product_id: 1008,
  149. sale: 0,
  150. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  151. }
  152. ],
  153. isRefresher: false,
  154. loadingClass: true,
  155. loadingText: '正在加载中',
  156. page: 1,
  157. isPage: true
  158. },
  159. {
  160. id: 3,
  161. name: '上新',
  162. list: [
  163. {
  164. id: 10,
  165. original_price: "4111.00",
  166. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  167. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  168. price: "2412.00",
  169. product_id: 1008,
  170. sale: 0,
  171. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  172. },
  173. {
  174. id: 10,
  175. original_price: "4111.00",
  176. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  177. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  178. price: "2412.00",
  179. product_id: 1008,
  180. sale: 0,
  181. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  182. },
  183. {
  184. id: 10,
  185. original_price: "4111.00",
  186. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  187. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  188. price: "2412.00",
  189. product_id: 1008,
  190. sale: 0,
  191. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  192. }
  193. ],
  194. isRefresher: false,
  195. loadingClass: true,
  196. loadingText: '正在加载中',
  197. page: 1,
  198. isPage: true
  199. },
  200. {
  201. id: 4,
  202. name: '价格',
  203. list: [
  204. {
  205. id: 10,
  206. original_price: "4111.00",
  207. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  208. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  209. price: "2412.00",
  210. product_id: 1008,
  211. sale: 0,
  212. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  213. },
  214. {
  215. id: 10,
  216. original_price: "4111.00",
  217. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  218. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  219. price: "2412.00",
  220. product_id: 1008,
  221. sale: 0,
  222. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  223. },
  224. {
  225. id: 10,
  226. original_price: "4111.00",
  227. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  228. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  229. price: "2412.00",
  230. product_id: 1008,
  231. sale: 0,
  232. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  233. }
  234. ],
  235. isRefresher: false,
  236. loadingClass: true,
  237. loadingText: '正在加载中',
  238. page: 1,
  239. isPage: true
  240. }
  241. ],
  242. current: 0,
  243. windowHeight: 0,
  244. loadingClass: false,
  245. loadingText: '没有更多数据啦~'
  246. }
  247. },
  248. methods: {
  249. tabChange(index){
  250. this.current = index;
  251. this.clearTabItem();
  252. this.getData();
  253. },
  254. getData() {
  255. let tab_item = this.tab_list[this.current];
  256. let isPage = false;
  257. tab_item.isPage = isPage;
  258. if(!isPage){
  259. tab_item.loadingClass = false;
  260. tab_item.loadingText = '没有更多数据啦~';
  261. }
  262. tab_item.isRefresher = false;
  263. },
  264. // 滑块下标值变化
  265. swiperChange(event){
  266. this.current = event.detail.current;
  267. if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理
  268. },
  269. // 页面触底,加载下一页
  270. onScrolltolower(){
  271. let tab_item = this.tab_list[this.current];
  272. if(tab_item.isPage){
  273. tab_item.page = tab_item.page + 1;
  274. this.getData();
  275. }
  276. },
  277. // scroll-view 下拉刷新
  278. onRefresherrefresh(){
  279. this.$u.throttle(() => {
  280. this.clearTabItem();
  281. this.getData();
  282. }, 200);
  283. },
  284. clearTabItem(){
  285. let tab_item = this.tab_list[this.current];
  286. tab_item.page = 1;
  287. tab_item.isPage = true;
  288. tab_item.isRefresher = true;
  289. tab_item.loadingClass = true;
  290. tab_item.loadingText = '正在加载中';
  291. tab_item.list = [];
  292. this.$set(this.tab_list, this.current, tab_item);
  293. // this.$refs.uWaterfallFather[this.current].clear();
  294. }
  295. },
  296. onShow(){
  297. this.windowHeight = getApp().globalData.windowHeight;
  298. }
  299. }
  300. </script>
  301. <style>
  302. page {
  303. background-color: #F8F8F8;
  304. }
  305. </style>
  306. <style scoped lang="scss">
  307. .content-img {
  308. width: 130rpx;
  309. height: 130rpx;
  310. border-radius: 5rpx;
  311. }
  312. .online-card {
  313. width: 686rpx;
  314. height: auto;
  315. background: #FFFFFF;
  316. border-radius: 20rpx;
  317. margin-bottom: 30rpx;
  318. padding: 30rpx;
  319. }
  320. .online-tab {
  321. width: 375rpx;
  322. height: 90rpx;
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. color: #555555;
  327. font-size: 32rpx;
  328. }
  329. .online-active {
  330. background: #15716E;
  331. color: #FFFFFF;
  332. border-radius: 45rpx 45rpx 0rpx 0rpx;
  333. }
  334. //tab相关
  335. .search-icon {
  336. position: relative;
  337. bottom: 0;
  338. left: 54rpx;
  339. }
  340. /deep/.input-placeholder{
  341. color: #777;
  342. font-size: 28rpx;
  343. }
  344. .rom-search {
  345. width: 686rpx;
  346. height: 60rpx;
  347. background: #F4F8F8;
  348. border-radius: 30rpx;
  349. padding-left: 74rpx;
  350. font-size: 28rpx;
  351. }
  352. .goods-rom {
  353. border-radius: 20rpx;
  354. width: 333rpx;
  355. height: 497rpx;
  356. background-color: white;
  357. box-shadow: 0px 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  358. &:nth-child(2n) {
  359. margin-right: 0;
  360. }
  361. &:nth-child(n + 3) {
  362. margin-top: 20rpx;
  363. }
  364. }
  365. .introduct {
  366. padding: 0 0 30rpx 32rpx;
  367. }
  368. .com{
  369. width: 100%;
  370. height: 100%;
  371. box-sizing: border-box;
  372. padding: 0rpx 28rpx;
  373. }
  374. .shop-head {
  375. width: 100%;
  376. height: 400rpx;
  377. position: relative;
  378. }
  379. .shop-flex {
  380. display: flex;
  381. padding: 30rpx;
  382. }
  383. .shop-title {
  384. width: 686rpx;
  385. height: 274rpx;
  386. border-radius: 20rpx;
  387. background-color: white;
  388. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  389. margin: 0 auto;
  390. position: relative;
  391. top: -32rpx;
  392. }
  393. .shop-img {
  394. width: 90rpx;
  395. height: 90rpx;
  396. margin-right: 15rpx;
  397. }
  398. .shop-function {
  399. width: 80rpx;
  400. height: 80rpx;
  401. border-radius: 50%;
  402. font-size: 40rpx;
  403. }
  404. .function-total {
  405. display: flex;
  406. justify-content: space-between;
  407. padding: 0 65rpx 0 65rpx;
  408. }
  409. /deep/.u-scroll-box {
  410. display: flex;
  411. justify-content: center;
  412. align-items: center;
  413. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  414. }
  415. /deep/.special_tab .u-tabs .u-scroll-box .u-tab-bar {
  416. background-color: #15716E!important;
  417. width: 80rpx!important;
  418. position: absolute;
  419. height: 10rpx;
  420. left: 0;
  421. border-radius: 8rpx 8rpx 0px 0px!important;
  422. bottom: -12rpx;
  423. }
  424. /deep/ .u-tab-item {
  425. font-size: 28rpx!important;
  426. }
  427. //价格筛选伪类
  428. // /deep/.special_tab .u-tab-item:nth-child(4n) ::after{
  429. // font-size: 48rpx!important;
  430. // content: '';
  431. // color: red;
  432. // }
  433. // loading加载
  434. .loading-more {
  435. align-items: center;
  436. justify-content: center;
  437. padding-top: 10px;
  438. padding-bottom: 10px;
  439. text-align: center;
  440. font-size: 28rpx;
  441. color: #999;
  442. }
  443. .loading-more-text::before {
  444. content: '';
  445. width: 20px;
  446. height: 20px;
  447. display: inline-block;
  448. vertical-align: middle;
  449. -webkit-animation: weuiLoading 1s steps(12, end) infinite;
  450. animation: weuiLoading 1s steps(12, end) infinite;
  451. background-repeat: no-repeat;
  452. background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E");
  453. background-size: 100%;
  454. }
  455. @keyframes weuiLoading {
  456. 0% {
  457. transform: rotate3d(0, 0, 1, 0deg);
  458. }
  459. 100% {
  460. transform: rotate3d(0, 0, 1, 360deg);
  461. }
  462. }
  463. .list-warter {
  464. border-radius: 20rpx;
  465. margin: 10px 5px;
  466. margin-top: 0px;
  467. background-color: #ffffff;
  468. // padding: 8px;
  469. position: relative;
  470. overflow: hidden;
  471. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  472. }
  473. .u-close {
  474. position: absolute;
  475. top: 32rpx;
  476. right: 32rpx;
  477. }
  478. .list-image {
  479. width: 100%;
  480. border-radius: 4px;
  481. }
  482. .list-title {
  483. font-size: 28rpx;
  484. font-weight: bold;
  485. color: $u-main-color;
  486. }
  487. .list-label{
  488. position: absolute;
  489. bottom: 0;
  490. right: 0;
  491. background-color: rgba(0,0,0,0.5);
  492. width: 140rpx;
  493. height: 48rpx;
  494. border-radius: 20rpx 0rpx 0rpx 0rpx;
  495. font-size: 22rpx;
  496. color: #FFFFFF;
  497. line-height: 48rpx;
  498. text-align: center;
  499. }
  500. .list-tag {
  501. display: flex;
  502. margin-top: 5px;
  503. }
  504. .list-tag-owner {
  505. background-color: $u-type-error;
  506. color: #FFFFFF;
  507. display: flex;
  508. align-items: center;
  509. padding: 4rpx 14rpx;
  510. border-radius: 50rpx;
  511. font-size: 20rpx;
  512. line-height: 1;
  513. }
  514. .list-tag-text {
  515. border: 1px solid $u-type-primary;
  516. color: $u-type-primary;
  517. margin-left: 10px;
  518. border-radius: 50rpx;
  519. line-height: 1;
  520. padding: 4rpx 14rpx;
  521. display: flex;
  522. align-items: center;
  523. border-radius: 50rpx;
  524. font-size: 20rpx;
  525. }
  526. .list-price {
  527. font-size: 30rpx;
  528. color: $u-type-error;
  529. margin-top: 5px;
  530. display: flex;
  531. align-items: center;
  532. }
  533. </style>