index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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" v-if="res.agentAuditTime != null">
  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. this.orderList = this.orderList.concat(res.data.data.records)
  109. for (let i = 0; i < res.data.data.records.length; i++) {
  110. if (res.data.data.records[i].status == 0) {
  111. this.b2bStatus = "待审核"
  112. } else if (res.data.data.records[i].status == 2) {
  113. this.b2bStatus = "已审核"
  114. } else {
  115. this.b2bStatus = "已失效"
  116. }
  117. }
  118. }).catch(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. if (res.data.data.records[i].status == 0) {
  157. this.b2bStatus = "待审核"
  158. } else if (res.data.data.records[i].status == 2) {
  159. this.b2bStatus = "已审核"
  160. } else {
  161. this.b2bStatus = "已失效"
  162. }
  163. }
  164. }).catch(err => {
  165. })
  166. .finally(() => {
  167. setTimeout(() => {
  168. uni.hideLoading();
  169. this.loading = false;
  170. }, 300)
  171. })
  172. }
  173. },
  174. onReachBottom() {
  175. setTimeout(() => {
  176. if (this.current2 > this.pages) {
  177. this.status = 'nomore'
  178. } else {
  179. this.current2 = ++this.current2;
  180. this.status = 'loading';
  181. this.getDate()
  182. }
  183. }, 2000)
  184. }
  185. }
  186. </script>
  187. <style>
  188. /* #ifndef H5 */
  189. page {
  190. height: 100%;
  191. background-color: #f2f2f2;
  192. }
  193. /* #endif */
  194. </style>
  195. <style lang="scss" scoped>
  196. .u-tabs-box {
  197. width: 100%;
  198. // padding-left:30rpx;
  199. }
  200. .order-one-view {
  201. width: 120rpx;
  202. line-height: 40rpx;
  203. background-color: #0094FE;
  204. position: relative;
  205. left: 575rpx;
  206. top: -35rpx;
  207. border-top-left-radius: 50rpx;
  208. border-bottom-left-radius: 50rpx;
  209. font-size: 24rpx;
  210. color: #fff;
  211. text-align: center;
  212. }
  213. // 插件代码
  214. .order {
  215. width: 710rpx;
  216. background-color: #ffffff;
  217. margin: 20rpx auto;
  218. border-radius: 20rpx;
  219. box-sizing: border-box;
  220. padding: 20rpx;
  221. font-size: 28rpx;
  222. .top {
  223. display: flex;
  224. justify-content: space-between;
  225. .left {
  226. display: flex;
  227. align-items: center;
  228. .store {
  229. margin: 0 10rpx;
  230. font-size: 32rpx;
  231. font-weight: bold;
  232. }
  233. }
  234. .right {
  235. color: $u-type-warning-dark;
  236. }
  237. }
  238. .item {
  239. display: flex;
  240. margin: 20rpx 0 0;
  241. .left {
  242. margin-right: 20rpx;
  243. image {
  244. width: 200rpx;
  245. height: 200rpx;
  246. border-radius: 10rpx;
  247. }
  248. }
  249. .content {
  250. .title {
  251. font-size: 28rpx;
  252. line-height: 50rpx;
  253. }
  254. .type {
  255. margin: 10rpx 0;
  256. font-size: 24rpx;
  257. color: $u-tips-color;
  258. }
  259. .delivery-time {
  260. color: #e5d001;
  261. font-size: 24rpx;
  262. }
  263. }
  264. .right {
  265. margin-left: 10rpx;
  266. padding-top: 20rpx;
  267. text-align: right;
  268. .decimal {
  269. font-size: 24rpx;
  270. margin-top: 4rpx;
  271. }
  272. .number {
  273. color: $u-tips-color;
  274. font-size: 24rpx;
  275. }
  276. }
  277. }
  278. .total {
  279. margin-top: 20rpx;
  280. text-align: right;
  281. font-size: 24rpx;
  282. .total-price {
  283. font-size: 32rpx;
  284. }
  285. }
  286. .bottom {
  287. display: flex;
  288. margin-top: 40rpx;
  289. padding: 0 10rpx;
  290. justify-content: space-between;
  291. align-items: center;
  292. .btn {
  293. line-height: 52rpx;
  294. width: 160rpx;
  295. border-radius: 26rpx;
  296. border: 2rpx solid $u-border-color;
  297. font-size: 26rpx;
  298. text-align: center;
  299. color: $u-type-info-dark;
  300. }
  301. .evaluate {
  302. color: $u-type-warning-dark;
  303. border-color: $u-type-warning-dark;
  304. }
  305. }
  306. }
  307. .centre {
  308. text-align: center;
  309. margin: 200rpx auto;
  310. font-size: 32rpx;
  311. image {
  312. width: 164rpx;
  313. height: 164rpx;
  314. border-radius: 50%;
  315. margin-bottom: 20rpx;
  316. }
  317. .tips {
  318. font-size: 24rpx;
  319. color: #999999;
  320. margin-top: 20rpx;
  321. }
  322. .btn {
  323. margin: 80rpx auto;
  324. width: 200rpx;
  325. border-radius: 32rpx;
  326. line-height: 64rpx;
  327. color: #ffffff;
  328. font-size: 26rpx;
  329. background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
  330. }
  331. }
  332. .wrap {
  333. display: flex;
  334. flex-direction: column;
  335. height: calc(100vh - var(--window-top));
  336. width: 100%;
  337. }
  338. .swiper-box {
  339. flex: 1;
  340. }
  341. .swiper-item {
  342. height: 100%;
  343. }
  344. // 手敲代码
  345. .order-one {
  346. width: 6rpx;
  347. height: 30rpx;
  348. margin-top: 5rpx;
  349. margin-right: 30rpx;
  350. background-color: #0292FD;
  351. float: left;
  352. }
  353. .order-two {
  354. display: flex;
  355. justify-content: space-between;
  356. margin-top: 15rpx;
  357. font-size: 24rpx;
  358. color: #6A6A6A;
  359. }
  360. // 线
  361. .order-one-xian {
  362. width: 642rpx;
  363. height: 1rpx;
  364. border-bottom: 1rpx solid #E7E8EA;
  365. margin: 0 auto;
  366. margin-top: -20rpx;
  367. margin-bottom: 30rpx;
  368. }
  369. .order-one-text {
  370. font-size: 28rpx;
  371. font-weight: bold;
  372. color: #000;
  373. }
  374. </style>