index.vue 7.6 KB

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