userCenterIntegralExchangeRecord.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <div class="userCenterIntegralExchangeRecord">
  3. <!-- <div class="outer3">
  4. <div class="center">
  5. <div class="centerLeft">
  6. <div class="centerTop">
  7. <span>{{
  8. $i18n.locale == "zh" ? "我的兑换记录" : "Exchange Record"
  9. }}</span>
  10. </div>
  11. <div class="centerBottom">
  12. <span
  13. >{{
  14. $i18n.locale == "zh" ? "小积分" : "SmallIntegral"
  15. }}&nbsp;/&nbsp;{{
  16. $i18n.locale == "zh" ? "大兑换" : "BigExchange"
  17. }}&nbsp;/&nbsp;{{
  18. $i18n.locale == "zh" ? "超惊喜" : "SuperSurprise"
  19. }}&nbsp;/&nbsp;{{
  20. $i18n.locale == "zh" ? "不等待" : "Don'tWait"
  21. }}</span
  22. >
  23. </div>
  24. </div>
  25. <div class="centerRight">
  26. <img
  27. src="https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngcb776d7fd3ad018f8528faa5d3b23a6cf3e7e6ff44d4ee9fd3a32f5822112194"
  28. />
  29. </div>
  30. </div>
  31. </div> -->
  32. <div class="topImg">
  33. <div v-if="isZh">
  34. <img
  35. style="display: block; width: 100%; height: 100%"
  36. src="../../../assets/我的兑换记录.png"
  37. alt=""
  38. />
  39. </div>
  40. <div v-else>
  41. <img
  42. style="display: block; width: 100%; height: 100%"
  43. src="../../../assets/22.png"
  44. alt=""
  45. />
  46. </div>
  47. </div>
  48. <div class="exchangeRecord">
  49. {{
  50. $i18n.locale === "zh" ? "查询到兑换记录" : "Exchange Record Found"
  51. }}&nbsp;{{ this.forRecord ? this.forRecord : "0" }}&nbsp;{{
  52. $i18n.locale === "zh" ? "条" : "Strip"
  53. }}
  54. </div>
  55. <!-- 无兑换记录 -->
  56. <div v-if="isShow" class="noRecord">
  57. <div class="noRecordImg">
  58. <img src="../../../assets/record.png" alt="" />
  59. </div>
  60. <div>
  61. <span class="info5">{{
  62. $i18n.locale == "zh" ? "没有查询到兑换记录" : "No Results"
  63. }}</span>
  64. </div>
  65. </div>
  66. <!-- 有兑换记录 -->
  67. <div v-else class="recorded">
  68. <el-table
  69. :data="data"
  70. height="550px"
  71. :cell-style="{ textAlign: 'center' }"
  72. :header-cell-style="{ backgroundColor: '#f8f8f8' }"
  73. style="width: 100%"
  74. >
  75. <el-table-column
  76. :prop="$i18n.locale === 'zh' ? 'commodityName' : 'commodityNameEn'"
  77. :label="$i18n.locale === 'zh' ? '福利' : 'Welfare'"
  78. width="width"
  79. align="center"
  80. >
  81. </el-table-column>
  82. <el-table-column
  83. align="center"
  84. prop="point"
  85. :label="$i18n.locale === 'zh' ? '积分' : 'Integral'"
  86. width="width"
  87. >
  88. </el-table-column>
  89. <el-table-column
  90. align="center"
  91. prop="prop"
  92. :label="$i18n.locale === 'zh' ? '兑换时间' : 'Exchange Time'"
  93. width="width"
  94. >
  95. <template slot-scope="scope">
  96. <div>
  97. {{ scope.row.createDate | time("YYYY-MM-DD HH:mm:ss") }}
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column
  102. align="center"
  103. prop="prop"
  104. :label="$i18n.locale === 'zh' ? '兑换状态' : 'Exchange Status'"
  105. width="width"
  106. >
  107. <template>
  108. <div v-if="isZh">
  109. <img src="../../../assets/recordsuccess.png" alt="" />
  110. </div>
  111. <div v-else>
  112. <img src="../../../assets/兑换英文.png" alt="" />
  113. </div>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <el-pagination
  118. background
  119. @size-change="
  120. (val) => {
  121. page.pageSize = val;
  122. }
  123. "
  124. @current-change="
  125. (val) => {
  126. page.pageNo = val;
  127. }
  128. "
  129. layout="prev, pager, next"
  130. :total="page.total"
  131. :current-page="page.pageNo"
  132. :page-sizes="[10, 20, 50, 100]"
  133. :page-size="page.pageSize"
  134. style="text-align: center; margin-top: 20px"
  135. >
  136. </el-pagination>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. import moment from "moment";
  142. import { getPersonalOrder } from "@/api/user";
  143. export default {
  144. name: "userCenterIntegralExchangeRecord",
  145. data() {
  146. return {
  147. isShow: false,
  148. page: {
  149. pageNo: 1,
  150. pageSize: 10,
  151. total: 0,
  152. },
  153. shopDetail: {},
  154. data: [],
  155. forRecord: "",
  156. isZh: true,
  157. detailId:null,
  158. };
  159. },
  160. filters: {
  161. time(date, type) {
  162. return moment(date).format(type);
  163. },
  164. },
  165. watch: {
  166. "$i18n.locale": {
  167. handler: function () {
  168. this.isZh = !this.isZh;
  169. },
  170. deep: true,
  171. },
  172. },
  173. mounted() {
  174. let language = window.localStorage.getItem("locale");
  175. if (language == "zh") {
  176. this.isZh = true;
  177. } else {
  178. this.isZh = false;
  179. }
  180. this.detailId = window.localStorage.getItem("detailID")
  181. // this.shopDetail = this.$route.query.item;
  182. this.initData();
  183. },
  184. methods: {
  185. initData() {
  186. let param = this.detailId;
  187. console.log(param);
  188. getPersonalOrder(param).then((res) => {
  189. this.data = res.data;
  190. this.forRecord = res.data.length;
  191. if (!this.forRecord) {
  192. this.isShow = true;
  193. }
  194. });
  195. },
  196. },
  197. };
  198. </script>
  199. <style lang="less" scoped>
  200. .userCenterIntegralExchangeRecord {
  201. // width: 100%;
  202. background: #fff;
  203. min-height: 800px;
  204. .topImg {
  205. width: 984px;
  206. height: 126px;
  207. }
  208. .outer3 {
  209. height: 136px;
  210. background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng57d0f7528232684af7dcede85c7461f034e12072a9167c35411a147a2f0e124f)
  211. 100% no-repeat;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. .center {
  216. width: 443px;
  217. height: 126px;
  218. display: flex;
  219. .centerLeft {
  220. display: flex;
  221. flex-direction: column;
  222. align-items: flex-start;
  223. margin-top: 30px;
  224. .centerTop {
  225. margin-left: 10px;
  226. width: 216px;
  227. height: 30px;
  228. display: block;
  229. overflow-wrap: break-word;
  230. color: rgba(255, 255, 255, 1);
  231. font-size: 30px;
  232. letter-spacing: 6px;
  233. font-family: SourceHanSansCN-Heavy;
  234. white-space: nowrap;
  235. line-height: 30px;
  236. text-align: left;
  237. text-shadow: 0px 4px 2px rgba(0, 77, 195, 1);
  238. }
  239. .centerBottom {
  240. width: 206px;
  241. height: 11px;
  242. display: block;
  243. overflow-wrap: break-word;
  244. color: rgba(255, 255, 255, 1);
  245. font-size: 11px;
  246. letter-spacing: 2.200000047683716px;
  247. font-family: SourceHanSansCN-Regular;
  248. white-space: nowrap;
  249. line-height: 11px;
  250. text-align: left;
  251. text-shadow: 0px 4px 2px rgba(0, 77, 195, 1);
  252. margin-top: 11px;
  253. }
  254. }
  255. .centerRight {
  256. margin-left: 105px;
  257. width: 135px;
  258. height: 126px;
  259. }
  260. }
  261. }
  262. .exchangeRecord {
  263. width: 130px;
  264. height: 20px;
  265. display: block;
  266. overflow-wrap: break-word;
  267. color: rgba(119, 138, 164, 1);
  268. font-size: 14px;
  269. white-space: nowrap;
  270. line-height: 20px;
  271. text-align: left;
  272. margin: 18px 0;
  273. }
  274. // 无兑换记录
  275. .noRecord {
  276. width: 983px;
  277. height: 362px;
  278. // background: #999;
  279. display: flex;
  280. flex-direction: column;
  281. justify-content: center;
  282. align-items: center;
  283. .info5 {
  284. width: 180px;
  285. height: 28px;
  286. display: block;
  287. overflow-wrap: break-word;
  288. color: rgba(156, 156, 156, 1);
  289. font-size: 20px;
  290. font-family: PingFangSC-Medium;
  291. white-space: nowrap;
  292. line-height: 28px;
  293. text-align: left;
  294. }
  295. }
  296. // 有兑换记录
  297. .recorded {
  298. height: 32px;
  299. background-color: #f5f5f5;
  300. width: 100%;
  301. margin: 16px 0;
  302. // padding-left: 186px;
  303. .layer2 {
  304. overflow-wrap: break-word;
  305. color: rgba(51, 51, 51, 1);
  306. font-size: 16px;
  307. white-space: nowrap;
  308. width: 835px;
  309. height: 31px;
  310. line-height: 31px;
  311. margin: 1px 0;
  312. display: flex;
  313. justify-content: space-around;
  314. }
  315. .content {
  316. margin: 11px 0;
  317. margin-left: -186px;
  318. width: 100%;
  319. height: 330px;
  320. display: flex;
  321. // background: #999;
  322. .cLeft {
  323. height: 206px;
  324. background-color: rgba(207, 215, 228, 0.8);
  325. width: 174px;
  326. display: flex;
  327. justify-content: center;
  328. // align-content: center;
  329. .img {
  330. margin-top: 14px;
  331. width: 141px;
  332. height: 174px;
  333. background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng0faf2cf0dec2a633fbefba7fc82c1992230df91bc2337fe7b1ea5a32646c8110)
  334. 100% no-repeat;
  335. }
  336. }
  337. .content_01 {
  338. width: 280px;
  339. height: 152px;
  340. margin: 16px 0 0 16px;
  341. margin-left: -5px;
  342. .info1 {
  343. width: 280px;
  344. height: 30px;
  345. display: block;
  346. overflow-wrap: break-word;
  347. color: rgba(51, 51, 51, 1);
  348. font-size: 20px;
  349. font-family: PingFangSC-Semibold;
  350. white-space: nowrap;
  351. line-height: 30px;
  352. text-align: left;
  353. }
  354. .box5 {
  355. height: 32px;
  356. border-radius: 16px;
  357. background-color: rgba(240, 242, 245, 1);
  358. margin-top: 90px;
  359. width: 222px;
  360. margin-left: 10px;
  361. .bd1 {
  362. width: 196px;
  363. height: 30px;
  364. margin-left: 25px;
  365. display: flex;
  366. justify-content: space-around;
  367. .txt4 {
  368. width: 48px;
  369. height: 30px;
  370. display: block;
  371. color: rgba(51, 51, 51, 1);
  372. font-size: 16px;
  373. line-height: 30px;
  374. }
  375. .word16 {
  376. width: 130px;
  377. height: 30px;
  378. display: block;
  379. color: rgba(0, 145, 255, 1);
  380. font-size: 16px;
  381. line-height: 30px;
  382. }
  383. }
  384. }
  385. }
  386. .content_02 {
  387. .word17 {
  388. width: 101px;
  389. height: 30px;
  390. display: block;
  391. overflow-wrap: break-word;
  392. color: rgba(224, 32, 32, 1);
  393. font-size: 16px;
  394. white-space: nowrap;
  395. line-height: 30px;
  396. text-align: left;
  397. margin: 16px 0 0 16px;
  398. }
  399. }
  400. .content_03 {
  401. .word18 {
  402. width: 97px;
  403. height: 30px;
  404. display: block;
  405. overflow-wrap: break-word;
  406. color: rgba(153, 153, 153, 1);
  407. font-size: 16px;
  408. white-space: nowrap;
  409. line-height: 30px;
  410. text-align: left;
  411. margin: 16px 0 0 99px;
  412. }
  413. }
  414. .content_04 {
  415. margin: 4px 0 0 109px;
  416. }
  417. }
  418. }
  419. }
  420. </style>