MyCenter.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <div class="right-wrap">
  3. <div class="myTabs" style="background: #fff;">
  4. <el-tabs style="padding: 0 20px 40px 20px;" v-model="activeName" @tab-click="handleClick">
  5. <!-- <el-tab-pane label="我的积分" name="first">
  6. <el-radio-group v-model="firstTabPosition" style="margin-bottom: 30px;">
  7. <el-radio-button v-for="(item, index) in firstTabsList" :key="index" :label="item.value"
  8. @click="handleClickFirstTabs(item.value)">
  9. {{ item.name }}
  10. </el-radio-button>
  11. </el-radio-group>
  12. <div v-if="firstTabPosition == 'integralList'" class="integralList">
  13. <el-select style="width: 220px; margin-right: 30px;" size="small" v-model="value"
  14. placeholder="请选择积分类型">
  15. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  16. </el-option>
  17. </el-select>
  18. <el-date-picker style="width: 220px; margin-right: 30px;" size="small" v-model="time" type="date"
  19. placeholder="选择日期"></el-date-picker>
  20. <el-button size="small" style="margin-right: 30px;" type="primary">查询</el-button>
  21. <el-button size="small" type="default">重置</el-button>
  22. <el-table size="small" :data="tableData" border style="margin-top: 30px;width: 100%">
  23. <el-table-column align="center" type="index" width="50" label="序号"></el-table-column>
  24. <el-table-column align="center" prop="date" label="积分类型"></el-table-column>
  25. <el-table-column align="center" prop="name" label="积分"></el-table-column>
  26. <el-table-column align="center" prop="address" label="获取时间"></el-table-column>
  27. </el-table>
  28. <div class="myPage">
  29. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  30. :current-page="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="10"
  31. layout="total, sizes, prev, pager, next, jumper" :total="40">
  32. </el-pagination>
  33. </div>
  34. </div>
  35. <div v-else class="integralRules" v-html="integralRules"></div>
  36. </el-tab-pane> -->
  37. <el-tab-pane label="我的兑换" name="second">
  38. <el-radio-group v-model="secondTabPosition" @change="handleClickSecondTabs">
  39. <el-radio-button v-for="(item, index) in secondTabsList" :key="index" :label="item.value">
  40. {{ item.name }}
  41. </el-radio-button>
  42. </el-radio-group>
  43. <div class="gainList_container content">
  44. <div class="gains_wrapper">
  45. <el-empty v-if="secondList.length==0" :image-size="200"></el-empty>
  46. <div v-else class="list_wrapper">
  47. <div class="list">
  48. <div v-for="(item,index) in secondList" :key="index" class="item">
  49. <div class="img-wapper">
  50. <el-image
  51. :src="item.imgUrl"
  52. class="item-icon"></el-image>
  53. </div>
  54. <div class="main">
  55. <p class="goods_name">{{ item.name }}</p>
  56. <p class="date">
  57. 兑换时间
  58. {{ item.createTime }}
  59. </p>
  60. <div class="buttons">
  61. <button class="button-item actived" @click="handleClickGoods(item.orderId)">
  62. 查看信息
  63. <svg width="16" height="16" viewBox="0 0 16 16"
  64. fill="none" xmlns="http://www.w3.org/2000/svg" class="arrow">
  65. <path d="M12.5855 5.33203C13.0117 5.33203 13.2425 5.83111 12.9664 6.15586L8.38099 11.5505C8.18132 11.7854 7.81872 11.7854 7.61905 11.5505L3.0336 6.15586C2.75757 5.83111 2.98837 5.33203 3.41457 5.33203L12.5855 5.33203Z" fill="#916BE1"></path>
  66. </svg>
  67. </button>
  68. </div>
  69. </div>
  70. <div class="status bottom">
  71. <span v-if="item.orderType==0">已兑换</span>
  72. <span v-if="item.orderType==1">待确认</span>
  73. <span v-if="item.orderType==2">作废</span>
  74. <span v-if="item.orderType==3">已确认</span>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </el-tab-pane>
  82. <el-tab-pane label="我的礼品劵" name="third">
  83. <div class="gainList_container content">
  84. <div class="gains_wrapper">
  85. <el-empty v-if="thirdList.length==0" :image-size="200"></el-empty>
  86. <div v-else class="list_wrapper">
  87. <div class="list">
  88. <div v-for="(item,index) in thirdList" :key="index" class="item isVirtual">
  89. <div class="img-wapper">
  90. <el-image
  91. :src="item.imgUrl"
  92. class="item-icon"></el-image>
  93. </div>
  94. <div class="main">
  95. <p class="goods_name">{{ item.title }}</p>
  96. <p class="date">
  97. 兑换截止时间:
  98. {{ item.endTime }}
  99. </p>
  100. </div>
  101. <div class="status">
  102. <router-link v-if="item.status == 1" to="/home/pointsMall" class="use-btn">
  103. 去使用
  104. <i class="el-icon-arrow-right"></i>
  105. </router-link>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </el-tab-pane>
  113. </el-tabs>
  114. </div>
  115. </div>
  116. </template>
  117. <script scoped>
  118. import { orderList, welfareList, } from "@/api/allApi";
  119. export default {
  120. data() {
  121. return {
  122. firstList:[],
  123. firstTabPosition: 'integralList',
  124. firstTabsList: [
  125. {
  126. value: 'integralList',
  127. name: '积分列表',
  128. },
  129. {
  130. value: 'integralRules',
  131. name: '积分规则',
  132. },
  133. ],
  134. secondList:[
  135. ],
  136. secondTabPosition: 'all',
  137. secondTabsList: [
  138. {
  139. value: 'all',
  140. name: '全部',
  141. },
  142. {
  143. value: '0',
  144. name: '已兑换',
  145. },
  146. {
  147. value: '1',
  148. name: '待确认',
  149. },
  150. {
  151. value: '3',
  152. name: '已确认',
  153. },
  154. {
  155. value: '2',
  156. name: '作废',
  157. },
  158. ],
  159. thirdList:[],
  160. options: [{
  161. value: '选项1',
  162. label: '黄金糕'
  163. }, {
  164. value: '选项2',
  165. label: '双皮奶'
  166. }, {
  167. value: '选项3',
  168. label: '蚵仔煎'
  169. }, {
  170. value: '选项4',
  171. label: '龙须面'
  172. }, {
  173. value: '选项5',
  174. label: '北京烤鸭'
  175. }],
  176. value: '',
  177. time: '',
  178. tableData: [],
  179. currentPage: 4,
  180. integralRules: '<p>1. 掘金小铺【公益进展】最新公益活动进展在这里,感谢掘友们的大力支持</p> <p>2. 小铺商品春夏限定4月上新啦</p>',
  181. activeName: 'second',
  182. };
  183. },
  184. created() {
  185. this.getSecondList('1,2,3');
  186. this.getThirdList();
  187. },
  188. methods: {
  189. getFirstList(val){
  190. },
  191. getSecondList(val){
  192. orderList({orderType:val}).then(response=>{
  193. this.secondList = response.data.data;
  194. })
  195. },
  196. getThirdList(){
  197. welfareList({status:'1'}).then(response=>{
  198. const dataList = response.data.data;
  199. dataList.forEach(element => {
  200. element.imgUrl = element.relationWelfareVo.imgUrl;
  201. element.title = element.relationWelfareVo.title;
  202. element.startTime = element.relationWelfareVo.startTime;
  203. element.endTime = element.relationWelfareVo.endTime;
  204. element.welfareId = element.relationWelfareVo.welfareId;
  205. });
  206. this.thirdList = dataList;
  207. })
  208. },
  209. handleClickGoods(orderId) {
  210. this.$router.push({
  211. path: '/home/myCenter/goodsDetail',
  212. query: {
  213. orderId: orderId,
  214. }
  215. });
  216. },
  217. handleSizeChange(val) {
  218. console.log(`每页 ${val} 条`);
  219. },
  220. handleCurrentChange(val) {
  221. console.log(`当前页: ${val}`);
  222. },
  223. handleClickFirstTabs(val) {
  224. console.log(val);
  225. },
  226. handleClickSecondTabs(val) {
  227. if(val=='all'){
  228. val = '0,1,2,3'
  229. }
  230. this.getSecondList(val);
  231. },
  232. handleClick(tab, event) {
  233. console.log('111');
  234. console.log(tab.name, event);
  235. var name = tab.name;
  236. if(name=='first'){
  237. this.getFirstList();
  238. }
  239. if(name=='second'){
  240. this.getSecondList('0,1,2,3');
  241. }
  242. if(name=='third'){
  243. this.getThirdList();
  244. }
  245. },
  246. }
  247. };
  248. </script>
  249. <style scoped>
  250. .right-wrap {
  251. width: 100%;
  252. }
  253. .myPage {
  254. margin-top: 30px;
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. }
  259. .gainList_container {
  260. min-height: 560px;
  261. }
  262. .gainList_container .gains_wrapper {
  263. position: relative;
  264. box-sizing: border-box;
  265. padding-top: 20px;
  266. padding-left: 20px;
  267. }
  268. .gainList_container .gains_wrapper .list {
  269. display: flex;
  270. flex-wrap: wrap;
  271. margin: -20px 0 0 -20px;
  272. }
  273. .item.isVirtual{
  274. background: #f7f8fa;
  275. border: 1px solid #e5e6eb;
  276. }
  277. .item {
  278. display: flex;
  279. align-items: center;
  280. flex: 0 1 auto;
  281. width: calc(50% - 30px);
  282. min-width: 410px;
  283. height: 116px;
  284. padding-right: 6px;
  285. background: #fff;
  286. border: 1px solid #e5e6eb;
  287. box-sizing: border-box;
  288. border-radius: 4px;
  289. margin-right: 20px;
  290. margin-top: 20px;
  291. }
  292. .item .img-wapper {
  293. width: 114px;
  294. height: 114px;
  295. margin-right: 16px;
  296. background: #f7f8fa;
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. }
  301. .item .img-wapper .item-icon {
  302. max-width: 72px;
  303. max-height: 72px;
  304. }
  305. .item .main {
  306. flex: auto;
  307. }
  308. .item .date, .item .goods_name {
  309. overflow: hidden;
  310. text-overflow: ellipsis;
  311. }
  312. .item .goods_name {
  313. display: -webkit-box;
  314. -webkit-box-orient: vertical;
  315. -webkit-line-clamp: 1;
  316. font-size: 16px;
  317. line-height: 24px;
  318. color: #252933;
  319. padding-bottom: 4px;
  320. }
  321. .item p {
  322. margin: 0;
  323. }
  324. .item .date {
  325. white-space: nowrap;
  326. font-size: 14px;
  327. line-height: 22px;
  328. color: #8a919f;
  329. }
  330. .item .buttons {
  331. margin-top: 8px;
  332. margin-left: -8px;
  333. display: flex;
  334. align-items: center;
  335. }
  336. .item .button-item.actived {
  337. background: #f2f3f5;
  338. color: #8a919f;
  339. }
  340. .item .button-item {
  341. cursor: pointer;
  342. display: flex;
  343. align-items: center;
  344. font-size: 13px;
  345. padding: 0 8px;
  346. height: 26px;
  347. margin-left: 8px;
  348. font-weight: 500;
  349. background: #f2f3f5;
  350. border-radius: 50px;
  351. color: #8a919f;
  352. white-space: nowrap;
  353. border: none;
  354. }
  355. .item .arrow {
  356. width: 12px;
  357. height: 12px;
  358. margin-left: 2px;
  359. transform: rotate(-90deg);
  360. }
  361. svg:not(:root) {
  362. overflow: hidden;
  363. }
  364. .item .button-item svg path {
  365. fill: currentColor;
  366. }
  367. .status{
  368. margin-right: 30px;
  369. font-size: 13px;
  370. }
  371. .status.bottom{
  372. margin-top: 55px;
  373. }
  374. .status .use-btn {
  375. color: #1e80ff;
  376. }
  377. </style>