index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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" label-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:JSON.parse(JSON.stringify([])),
  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. label: ''
  104. };
  105. },
  106. created() {
  107. this.data()
  108. this.getBrandList()
  109. },
  110. methods: {
  111. // 获取奖励明细
  112. data() {
  113. request({
  114. url: '/myPage/getPageScanRewordList',
  115. method: 'post',
  116. data: {
  117. 'storeId': '1000',
  118. 'userId': '123',
  119. 'current': '1',
  120. 'size': '10'
  121. }
  122. }).then(res => {
  123. console.log(res)
  124. this.datalist = res.data.data
  125. // 判断扫码类型
  126. for (var i = 0; i < res.data.data.length; i++) {
  127. if (res.data.data[i].getWay == 0) {
  128. this.getWay = "车主扫码"
  129. } else {
  130. this.getWay = "门店扫码"
  131. }
  132. }
  133. console.log(res.data.data)
  134. }).catch(err => {
  135. console.log(err)
  136. })
  137. .finally(() => {
  138. setTimeout(() => {
  139. uni.hideLoading();
  140. this.loading = false;
  141. }, 1000)
  142. })
  143. },
  144. // 时间选择器获取时间
  145. changetime(e) {
  146. console.log(e)
  147. this.startTime = e.startDate
  148. this.endTime = e.endDate
  149. request({
  150. url: '/myPage/getPageScanRewordList',
  151. method: 'post',
  152. data: {
  153. 'storeId': '1000',
  154. 'userId': '123',
  155. 'current': '1',
  156. 'size': '10',
  157. 'startTime': this.startTime +' 00:00:00',
  158. 'endTime': this.endTime +' 00:00:00'
  159. }
  160. }).then(res => {
  161. console.log(res)
  162. this.datalist = res.data.data
  163. // 判断扫码类型
  164. for (var i = 0; i < res.data.data.length; i++) {
  165. if (res.data.data[i].getWay == 0) {
  166. this.getWay = "车主扫码"
  167. } else {
  168. this.getWay = "门店扫码"
  169. }
  170. }
  171. console.log(res.data.data)
  172. }).catch(err => {
  173. console.log(err)
  174. })
  175. .finally(() => {
  176. setTimeout(() => {
  177. uni.hideLoading();
  178. this.loading = false;
  179. }, 1000)
  180. })
  181. },
  182. // 获取品牌列表
  183. getBrandList() {
  184. request({
  185. url: '/baseReq/getBrandList',
  186. method: 'post',
  187. data: {
  188. 'storeId': '1000',
  189. 'userId': '123'
  190. }
  191. }).then(res => {
  192. this.brandList = JSON.parse(JSON.stringify(res.data.data))
  193. }).catch(err => {
  194. console.log(err)
  195. })
  196. .finally(() => {
  197. setTimeout(() => {
  198. uni.hideLoading();
  199. this.loading = false;
  200. }, 1000)
  201. })
  202. },
  203. // 点击获取品牌
  204. confirm(e) {
  205. console.log(e)
  206. console.log(e[0].label)
  207. this.label = e[0].label
  208. request({
  209. url: '/myPage/getPageScanRewordList',
  210. method: 'post',
  211. data: {
  212. 'storeId': '1000',
  213. 'userId': '123',
  214. 'current': '1',
  215. 'size': '10',
  216. 'searchKey': this.label
  217. }
  218. }).then(res => {
  219. console.log(res)
  220. this.datalist = res.data.data
  221. // 判断扫码类型
  222. for (var i = 0; i < res.data.data.length; i++) {
  223. if (res.data.data[i].getWay == 0) {
  224. this.getWay = "车主扫码"
  225. } else {
  226. this.getWay = "门店扫码"
  227. }
  228. }
  229. console.log(res.data.data)
  230. }).catch(err => {
  231. console.log(err)
  232. })
  233. .finally(() => {
  234. setTimeout(() => {
  235. uni.hideLoading();
  236. this.loading = false;
  237. }, 1000)
  238. })
  239. },
  240. search() {
  241. this.$u.route({
  242. url: 'pages/me/search/index',
  243. })
  244. },
  245. change(index) {
  246. this.current = index;
  247. if (this.current == 1) {
  248. this.showBrand = true
  249. } else if (this.current == 2) {
  250. this.showDate = true
  251. }
  252. this.data()
  253. }
  254. }
  255. }
  256. </script>
  257. <style lang="scss" scoped>
  258. .header {
  259. height: 400rpx;
  260. width: 100%;
  261. background: #0094FE;
  262. color: #fff;
  263. font-size: 28rpx;
  264. }
  265. .header-one {
  266. text-align: center;
  267. padding-top: 10rpx;
  268. }
  269. .header-one>text {
  270. font-size: 52rpx;
  271. }
  272. .content {
  273. display: flex;
  274. justify-content: space-between;
  275. width: 700rpx;
  276. margin-top: 80rpx;
  277. }
  278. .content-one {
  279. width: 690rpx;
  280. height: 305rpx;
  281. background: #FFFFFF;
  282. box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
  283. border-radius: 20rpx;
  284. margin: 0 auto;
  285. margin-top: 30rpx;
  286. }
  287. .content-one-view {
  288. width: 6rpx;
  289. height: 30rpx;
  290. background: #0292FD;
  291. position: relative;
  292. top: 20rpx;
  293. left: 30rpx;
  294. }
  295. .content-one-text {
  296. position: relative;
  297. top: -8rpx;
  298. left: 60rpx;
  299. font-size: 24rpx;
  300. font-weight: bold;
  301. color: #000;
  302. }
  303. .content-one-time {
  304. position: relative;
  305. top: -40rpx;
  306. left: 530rpx;
  307. font-size: 13rpx;
  308. color: #626262;
  309. }
  310. .content-two {
  311. display: flex;
  312. justify-content: space-between;
  313. font-size: 24rpx;
  314. color: #6A6A6A;
  315. margin-top: 25rpx;
  316. margin-left: 30rpx;
  317. margin-right: 30rpx;
  318. }
  319. </style>