index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <template>
  2. <view>
  3. <view class="wrap">
  4. <view class="u-tabs-box" style="width:100%">
  5. <u-tabs :list="list" :is-scroll="false" :current="current" @change="handleFilterBrand"></u-tabs>
  6. </view>
  7. <view class="page-box" v-if="pages!=0">
  8. <view class="order" v-for="(res,index) in orderList" :key="index">
  9. <view class="order-one">
  10. </view>
  11. <text class="order-one-text">核销金额:¥{{res.amount}}</text>
  12. <view class="order-one-view">
  13. {{b2bStatus}}
  14. </view>
  15. <view class="order-one-xian">
  16. </view>
  17. <view class="order-two">
  18. <view class="">
  19. 创建时间
  20. </view>
  21. <view class="">
  22. {{res.createTime}}
  23. </view>
  24. </view>
  25. <view class="order-two">
  26. <view class="">
  27. 审核时间
  28. </view>
  29. <view class="">
  30. {{res.agentAuditTime}}
  31. </view>
  32. </view>
  33. <view class="order-two">
  34. <view class="">
  35. {{res.brandName}}轮胎
  36. </view>
  37. <view class="">
  38. ¥{{res.amount}}
  39. </view>
  40. </view>
  41. <view class="order-two">
  42. <view class="">
  43. 当前状态
  44. </view>
  45. <view class="">
  46. {{b2bStatus}}
  47. </view>
  48. </view>
  49. </view>
  50. <u-loadmore :status="status" />
  51. </view>
  52. <view v-else style="margin-top: 100rpx;">
  53. <u-empty text="暂无数据" mode="list"></u-empty>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. request
  61. } from '../../../common/request/request'
  62. require("promise.prototype.finally").shim()
  63. export default {
  64. data() {
  65. return {
  66. orderList: [
  67. ],
  68. length: '',
  69. status: '没',
  70. pages: '',
  71. b2bStatus: '',
  72. list: [{
  73. name: "待审核"
  74. }, {
  75. name: "已审核"
  76. }, {
  77. name: "已失效"
  78. }],
  79. current: 0,
  80. current3: 0,
  81. current2: 1
  82. };
  83. },
  84. onLoad() {},
  85. created() {
  86. this.getDate()
  87. },
  88. methods: {
  89. // 获取列表数据
  90. getDate() {
  91. uni.showLoading({
  92. title: '加载中...'
  93. });
  94. request({
  95. url: '/myapp/storeSelectCoupon',
  96. method: 'post',
  97. data: {
  98. storeId: this.$store.state.storeInfo.storeId,
  99. "size": 10, //门店0
  100. "current": this.current2,
  101. "status": this.current3,
  102. 'userId': this.$store.state.storeInfo.userId
  103. }
  104. }).then(res => {
  105. this.orderList = this.orderList.concat(res.data.data.records)
  106. // 页数
  107. this.pages = res.data.data.pages
  108. for (let i = 0; i < res.data.data.records.length; i++) {
  109. if (res.data.data.records[i].status == 0) {
  110. this.b2bStatus = "待审核"
  111. } else if (res.data.data.records[i].status == 2) {
  112. this.b2bStatus = "已审核"
  113. } else {
  114. this.b2bStatus = "已失效"
  115. }
  116. }
  117. }).catch(err => {
  118. console.log(err)
  119. })
  120. .finally(() => {
  121. setTimeout(() => {
  122. uni.hideLoading();
  123. this.loading = false;
  124. }, 300)
  125. })
  126. },
  127. handleFilterBrand: function(v2) {
  128. this.current = v2
  129. if (v2 == 0) {
  130. this.current1 = 0
  131. this.current3 = 0
  132. } else if (v2 == 1) {
  133. this.current1 = 4
  134. this.current3 = 4
  135. } else {
  136. this.current1 = 3
  137. this.current3 = 3
  138. }
  139. this.current2 = 1
  140. request({
  141. url: '/myapp/storeSelectCoupon',
  142. method: 'post',
  143. data: {
  144. storeId: this.$store.state.storeInfo.storeId,
  145. "size": 10, //门店0
  146. "current": this.current2,
  147. "status": this.current1,
  148. 'userId': this.$store.state.storeInfo.userId
  149. }
  150. }).then(res => {
  151. this.orderList = res.data.data.records
  152. // 页数
  153. this.pages = res.data.data.pages
  154. // this.orderList = this.orderList.concat(res.data.data.records)
  155. for (let i = 0; i < res.data.data.records.length; i++) {
  156. console.log(res.data.data.records[i].b2bStatus)
  157. if (res.data.data.records[i].status == 0) {
  158. this.b2bStatus = "待审核"
  159. } else if (res.data.data.records[i].status == 2) {
  160. this.b2bStatus = "已审核"
  161. } else {
  162. this.b2bStatus = "已失效"
  163. }
  164. }
  165. }).catch(err => {
  166. console.log(err)
  167. })
  168. .finally(() => {
  169. setTimeout(() => {
  170. uni.hideLoading();
  171. this.loading = false;
  172. }, 300)
  173. })
  174. }
  175. },
  176. onReachBottom() {
  177. setTimeout(() => {
  178. if (this.current2 > this.pages) {
  179. this.status = 'nomore'
  180. } else {
  181. this.current2 = ++this.current2;
  182. this.status = 'loading';
  183. this.getDate()
  184. }
  185. }, 2000)
  186. }
  187. }
  188. </script>
  189. <style>
  190. /* #ifndef H5 */
  191. page {
  192. height: 100%;
  193. background-color: #f2f2f2;
  194. }
  195. /* #endif */
  196. </style>
  197. <style lang="scss" scoped>
  198. .u-tabs-box {
  199. width: 100%;
  200. // padding-left:30rpx;
  201. }
  202. .order-one-view {
  203. width: 120rpx;
  204. line-height: 40rpx;
  205. background-color: #0094FE;
  206. position: relative;
  207. left: 575rpx;
  208. top: -35rpx;
  209. border-top-left-radius: 50rpx;
  210. border-bottom-left-radius: 50rpx;
  211. font-size: 24rpx;
  212. color: #fff;
  213. text-align: center;
  214. }
  215. // 插件代码
  216. .order {
  217. width: 710rpx;
  218. background-color: #ffffff;
  219. margin: 20rpx auto;
  220. border-radius: 20rpx;
  221. box-sizing: border-box;
  222. padding: 20rpx;
  223. font-size: 28rpx;
  224. .top {
  225. display: flex;
  226. justify-content: space-between;
  227. .left {
  228. display: flex;
  229. align-items: center;
  230. .store {
  231. margin: 0 10rpx;
  232. font-size: 32rpx;
  233. font-weight: bold;
  234. }
  235. }
  236. .right {
  237. color: $u-type-warning-dark;
  238. }
  239. }
  240. .item {
  241. display: flex;
  242. margin: 20rpx 0 0;
  243. .left {
  244. margin-right: 20rpx;
  245. image {
  246. width: 200rpx;
  247. height: 200rpx;
  248. border-radius: 10rpx;
  249. }
  250. }
  251. .content {
  252. .title {
  253. font-size: 28rpx;
  254. line-height: 50rpx;
  255. }
  256. .type {
  257. margin: 10rpx 0;
  258. font-size: 24rpx;
  259. color: $u-tips-color;
  260. }
  261. .delivery-time {
  262. color: #e5d001;
  263. font-size: 24rpx;
  264. }
  265. }
  266. .right {
  267. margin-left: 10rpx;
  268. padding-top: 20rpx;
  269. text-align: right;
  270. .decimal {
  271. font-size: 24rpx;
  272. margin-top: 4rpx;
  273. }
  274. .number {
  275. color: $u-tips-color;
  276. font-size: 24rpx;
  277. }
  278. }
  279. }
  280. .total {
  281. margin-top: 20rpx;
  282. text-align: right;
  283. font-size: 24rpx;
  284. .total-price {
  285. font-size: 32rpx;
  286. }
  287. }
  288. .bottom {
  289. display: flex;
  290. margin-top: 40rpx;
  291. padding: 0 10rpx;
  292. justify-content: space-between;
  293. align-items: center;
  294. .btn {
  295. line-height: 52rpx;
  296. width: 160rpx;
  297. border-radius: 26rpx;
  298. border: 2rpx solid $u-border-color;
  299. font-size: 26rpx;
  300. text-align: center;
  301. color: $u-type-info-dark;
  302. }
  303. .evaluate {
  304. color: $u-type-warning-dark;
  305. border-color: $u-type-warning-dark;
  306. }
  307. }
  308. }
  309. .centre {
  310. text-align: center;
  311. margin: 200rpx auto;
  312. font-size: 32rpx;
  313. image {
  314. width: 164rpx;
  315. height: 164rpx;
  316. border-radius: 50%;
  317. margin-bottom: 20rpx;
  318. }
  319. .tips {
  320. font-size: 24rpx;
  321. color: #999999;
  322. margin-top: 20rpx;
  323. }
  324. .btn {
  325. margin: 80rpx auto;
  326. width: 200rpx;
  327. border-radius: 32rpx;
  328. line-height: 64rpx;
  329. color: #ffffff;
  330. font-size: 26rpx;
  331. background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
  332. }
  333. }
  334. .wrap {
  335. display: flex;
  336. flex-direction: column;
  337. height: calc(100vh - var(--window-top));
  338. width: 100%;
  339. }
  340. .swiper-box {
  341. flex: 1;
  342. }
  343. .swiper-item {
  344. height: 100%;
  345. }
  346. // 手敲代码
  347. .order-one {
  348. width: 6rpx;
  349. height: 30rpx;
  350. margin-top: 5rpx;
  351. margin-right: 30rpx;
  352. background-color: #0292FD;
  353. float: left;
  354. }
  355. .order-two {
  356. display: flex;
  357. justify-content: space-between;
  358. margin-top: 15rpx;
  359. font-size: 24rpx;
  360. color: #6A6A6A;
  361. }
  362. // 线
  363. .order-one-xian {
  364. width: 642rpx;
  365. height: 1rpx;
  366. border-bottom: 1rpx solid #E7E8EA;
  367. margin: 0 auto;
  368. margin-top: -20rpx;
  369. margin-bottom: 30rpx;
  370. }
  371. .order-one-text {
  372. font-size: 28rpx;
  373. font-weight: bold;
  374. color: #000;
  375. }
  376. </style>