index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <!-- 奖励明细页面 -->
  3. <view class="header">
  4. <view class="header-one">
  5. </view>
  6. <view class="content">
  7. <u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
  8. :is-scroll="false" :current="current" @change="change"></u-tabs>
  9. <u-select style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" laber-name="brandName" :list="brandList"></u-select>
  10. <u-calendar style=" color: #fff;" @change="changetime" v-model="showDate" :mode="mode"></u-calendar>
  11. <view @click="search">
  12. <u-search :show-action="true" :animation="true"></u-search>
  13. </view>
  14. </view>
  15. <view class="content-one" v-for="(item,index) in datalist" :key="index">
  16. <view class="content-one-view">
  17. </view>
  18. <view class="content-one-text">获得奖励:{{item.money}}元</view>
  19. <view class="content-two">
  20. <view class="">
  21. 轮胎型号
  22. </view>
  23. <view class="">
  24. {{item.tireModel}}
  25. </view>
  26. </view>
  27. <view class="content-two">
  28. <view class="">
  29. 扫码胎号
  30. </view>
  31. <view class="">
  32. {{item.tyreNum}}
  33. </view>
  34. </view>
  35. <view class="content-two">
  36. <view class="">
  37. 奖励类型
  38. </view>
  39. <view class="">
  40. {{getWay}}
  41. </view>
  42. </view>
  43. <view class="content-two">
  44. <view class="">
  45. 获得时间
  46. </view>
  47. <view class="">
  48. {{item.createTime}}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. request
  57. } from '../../../common/request/request'
  58. require("promise.prototype.finally").shim()
  59. export default {
  60. data() {
  61. return {
  62. datalist: [],
  63. getWay: '',
  64. list: [{
  65. name: '全部'
  66. }, {
  67. name: '品牌'
  68. }, {
  69. name: '时间',
  70. }],
  71. itemList: [{
  72. head: "赛轮 12R22.5 18PR S838",
  73. body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
  74. open: true,
  75. disabled: true
  76. }, {
  77. head: "赛轮 12R22.5 18PR S838",
  78. body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
  79. open: false,
  80. }, {
  81. head: "赛轮 12R22.5 18PR S838",
  82. body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
  83. open: false,
  84. }],
  85. brandList:[],
  86. // brandList: [{
  87. // value: '1',
  88. // label: '赛轮'
  89. // },
  90. // {
  91. // value: '2',
  92. // label: '黑鹰'
  93. // }
  94. // ],
  95. current: 0,
  96. showBrand: false,
  97. showDate: false,
  98. mode: 'range',
  99. // 开始时间
  100. startTime: '',
  101. // 结束时间
  102. endTime: '',
  103. };
  104. },
  105. created() {
  106. this.data()
  107. this.getBrandList()
  108. },
  109. methods: {
  110. // 获取奖励明细
  111. data() {
  112. request({
  113. url: '/myPage/getPageScanRewordList',
  114. method: 'post',
  115. data: {
  116. 'storeId': '1000',
  117. 'userId': '123',
  118. 'current': '1',
  119. 'size': '10'
  120. }
  121. }).then(res => {
  122. console.log(res)
  123. this.datalist = res.data.data
  124. // 判断扫码类型
  125. for (var i = 0; i < res.data.data.length; i++) {
  126. if (res.data.data[i].getWay == 0) {
  127. this.getWay = "车主扫码"
  128. } else {
  129. this.getWay = "门店扫码"
  130. }
  131. }
  132. console.log(res.data.data)
  133. }).catch(err => {
  134. console.log(err)
  135. })
  136. .finally(() => {
  137. setTimeout(() => {
  138. uni.hideLoading();
  139. this.loading = false;
  140. }, 1000)
  141. })
  142. },
  143. // 时间选择器获取时间
  144. changetime(e) {
  145. console.log(e)
  146. this.startTime = e.startDate
  147. this.endTime = e.endDate
  148. request({
  149. url: '/myPage/getPageScanRewordList',
  150. method: 'post',
  151. data: {
  152. 'storeId': '1000',
  153. 'userId': '123',
  154. 'current': '1',
  155. 'size': '10',
  156. 'startTime': this.startTime +' 00:00:00',
  157. 'endTime': this.endTime +' 00:00:00'
  158. }
  159. }).then(res => {
  160. console.log(res)
  161. this.datalist = res.data.data
  162. // 判断扫码类型
  163. for (var i = 0; i < res.data.data.length; i++) {
  164. if (res.data.data[i].getWay == 0) {
  165. this.getWay = "车主扫码"
  166. } else {
  167. this.getWay = "门店扫码"
  168. }
  169. }
  170. console.log(res.data.data)
  171. }).catch(err => {
  172. console.log(err)
  173. })
  174. .finally(() => {
  175. setTimeout(() => {
  176. uni.hideLoading();
  177. this.loading = false;
  178. }, 1000)
  179. })
  180. },
  181. // 获取品牌列表
  182. getBrandList() {
  183. request({
  184. url: '/baseReq/getBrandList',
  185. method: 'post',
  186. data: {
  187. 'storeId': '1000',
  188. 'userId': '123'
  189. }
  190. }).then(res => {
  191. console.log(res)
  192. this.brandList = res.data.data
  193. console.log(this.brandList)
  194. }).catch(err => {
  195. console.log(err)
  196. })
  197. .finally(() => {
  198. setTimeout(() => {
  199. uni.hideLoading();
  200. this.loading = false;
  201. }, 1000)
  202. })
  203. },
  204. // 点击获取品牌
  205. confirm(e) {
  206. console.log(e)
  207. },
  208. search() {
  209. this.$u.route({
  210. url: 'pages/me/search/index',
  211. })
  212. },
  213. change(index) {
  214. this.current = index;
  215. if (this.current == 1) {
  216. this.showBrand = true
  217. } else if (this.current == 2) {
  218. this.showDate = true
  219. }
  220. }
  221. }
  222. }
  223. </script>
  224. <style lang="scss" scoped>
  225. .header {
  226. height: 400rpx;
  227. width: 100%;
  228. background: #0094FE;
  229. color: #fff;
  230. font-size: 28rpx;
  231. }
  232. .header-one {
  233. text-align: center;
  234. padding-top: 10rpx;
  235. }
  236. .header-one>text {
  237. font-size: 52rpx;
  238. }
  239. .content {
  240. display: flex;
  241. justify-content: space-between;
  242. width: 700rpx;
  243. margin-top: 80rpx;
  244. }
  245. .content-one {
  246. width: 690rpx;
  247. height: 305rpx;
  248. background: #FFFFFF;
  249. box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
  250. border-radius: 20rpx;
  251. margin: 0 auto;
  252. margin-top: 30rpx;
  253. }
  254. .content-one-view {
  255. width: 6rpx;
  256. height: 30rpx;
  257. background: #0292FD;
  258. position: relative;
  259. top: 20rpx;
  260. left: 30rpx;
  261. }
  262. .content-one-text {
  263. position: relative;
  264. top: -8rpx;
  265. left: 60rpx;
  266. font-size: 24rpx;
  267. font-weight: bold;
  268. color: #000;
  269. }
  270. .content-one-time {
  271. position: relative;
  272. top: -40rpx;
  273. left: 530rpx;
  274. font-size: 13rpx;
  275. color: #626262;
  276. }
  277. .content-two {
  278. display: flex;
  279. justify-content: space-between;
  280. font-size: 24rpx;
  281. color: #6A6A6A;
  282. margin-top: 25rpx;
  283. margin-left: 30rpx;
  284. margin-right: 30rpx;
  285. }
  286. </style>