changeCard.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <template>
  2. <view class="content">
  3. <view class="content1 flex">
  4. <span @click='switchStatus(1)' :class='status==1?"active":""' class='default'>邀请</span>
  5. <span @click='switchStatus(2)' :class='status==2?"active":""' class='default'>黑名单</span>
  6. </view>
  7. <view class="content2 ">
  8. <view class="row" v-for="(item,index) in cardList" :key="index">
  9. <view class="card-list-item"
  10. :style="item.cardManagementInfo.currentBackground?'background:url('+item.cardManagementInfo.currentBackground+');background-size:100% 100%':''">
  11. <view class="card-content style1" v-if="item.cardManagementInfo.cuttentTemplate==1">
  12. <view class="left">
  13. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture?item.cardManagementInfo.headSculpture:'/static/imgs/card/defaulthead.png'" width="66px" height="66px"
  14. shape="circle"></u--image>
  15. </view>
  16. <view class="right">
  17. <view class="row1">
  18. <text class="name">{{item.cardManagementInfo.name}}</text>
  19. <text class="post">{{item.cardManagementInfo.post}}</text>
  20. </view>
  21. <view class="row2">
  22. {{item.cardManagementInfo.companyName}}
  23. </view>
  24. <view class="row3 flex">
  25. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.cardManagementInfo.icon+'.png'" width="13px"
  26. height="16px"></u--image> <view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  27. </view>
  28. <view class="row4 flex">
  29. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.cardManagementInfo.icon+'.png'" width="12px"
  30. height="13px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  31. </view>
  32. <view class="row4 flex">
  33. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.cardManagementInfo.icon+'.png'" width="10px"
  34. height="12px"></u--image><view class='icon-text'>{{item.cardManagementInfo.remark?item.cardManagementInfo.remark:'--'}}</view>
  35. </view>
  36. <!-- <view class="">
  37. 备注
  38. </view> -->
  39. </view>
  40. </view>
  41. <view class="card-content style1 flex-between" v-if="item.cardManagementInfo.cuttentTemplate==2">
  42. <view class="right">
  43. <view class="row1">
  44. <text class="name">{{item.cardManagementInfo.name}}</text>
  45. <text class="post">{{item.cardManagementInfo.post}}</text>
  46. </view>
  47. <view class="row2">
  48. {{item.cardManagementInfo.companyName}}
  49. </view>
  50. <view class="row3 flex">
  51. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.cardManagementInfo.icon+'.png'" width="13px"
  52. height="16px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  53. </view>
  54. <view class="row4 flex">
  55. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.cardManagementInfo.icon+'.png'" width="12px"
  56. height="13px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  57. </view>
  58. <view class="row4 flex">
  59. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.cardManagementInfo.icon+'.png'" width="10px"
  60. height="12px"></u--image><view class='icon-text'>{{item.cardManagementInfo.remark?item.cardManagementInfo.remark:'--'}}</view>
  61. </view>
  62. <!-- <view class="">
  63. 备注
  64. </view> -->
  65. </view>
  66. <view class="left">
  67. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  68. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  69. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  70. height="66px" shape="circle" v-else></u--image>
  71. </view>
  72. </view>
  73. <view class="card-content style2" v-if="item.cardManagementInfo.cuttentTemplate==3">
  74. <view class="top">
  75. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  76. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  77. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  78. height="66px" shape="circle" v-else></u--image>
  79. </view>
  80. <view class="bottom flex">
  81. <view class="left">
  82. <view class="row1">
  83. <text class="name">{{item.cardManagementInfo.name}}</text>
  84. <text class="post">{{item.cardManagementInfo.post}}</text>
  85. </view>
  86. <view class="row2">
  87. {{item.cardManagementInfo.companyName}}
  88. </view>
  89. </view>
  90. <view class="right">
  91. <view class="row3 flex">
  92. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.cardManagementInfo.icon+'.png'" width="13px"
  93. height="16px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  94. </view>
  95. <view class="row4 flex">
  96. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.cardManagementInfo.icon+'.png'" width="12px"
  97. height="13px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  98. </view>
  99. <view class="row4 flex">
  100. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.cardManagementInfo.icon+'.png'" width="10px"
  101. height="12px"></u--image><view class='icon-text'>{{item.cardManagementInfo.remark?item.cardManagementInfo.remark:'--'}}</view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="card-content style2" v-if="item.cardManagementInfo.cuttentTemplate==4">
  107. <view class="top">
  108. <view class="row1">
  109. <text class="name">{{item.cardManagementInfo.name}}</text>
  110. <text class="post">{{item.cardManagementInfo.post}}</text>
  111. </view>
  112. <view class="row2">
  113. {{item.cardManagementInfo.companyName}}
  114. </view>
  115. </view>
  116. <view class="bottom flex">
  117. <view class="left">
  118. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  119. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  120. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  121. height="66px" shape="circle" v-else></u--image>
  122. </view>
  123. <view class="right">
  124. <view class="row3 flex">
  125. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.cardManagementInfo.icon+'.png'" width="13px"
  126. height="16px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  127. </view>
  128. <view class="row4 flex">
  129. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.cardManagementInfo.icon+'.png'" width="12px"
  130. height="13px"></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  131. </view>
  132. <view class="row4 flex">
  133. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.cardManagementInfo.icon+'.png'" width="10px"
  134. height="12px"></u--image><view class='icon-text'>{{item.cardManagementInfo.remark?item.cardManagementInfo.remark:'--'}}</view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="car-bottom flex">
  140. <view class="status-btns" v-if="item.status==0">
  141. <span class='status-btn' @click='cardExchangeInfoEdit(1,item)'> 拉黑</span>
  142. <span class='status-btn error' @click='cardExchangeInfoEdit(2,item)'>拒绝</span>
  143. <span class='status-btn success' @click='cardExchangeInfoEdit(3,item)'>接受</span>
  144. </view>
  145. <view class="status-btns" v-else>
  146. <span class='status' v-if="item.status==1">已接受</span>
  147. <span class='status' v-if="item.status==3">已拒绝</span>
  148. <span class='status' v-if="item.status==5">已过期</span>
  149. <span v-if="item.status==7" class='status-btn' @click='cardExchangeInfoEdit(4,item)'>移除</span>
  150. </view>
  151. </view>
  152. </view>
  153. <view style='margin:0 20rpx;color:#666666;font-size: 26rpx;' class="flex flex-between">
  154. <span>来自: {{item.circleName}}</span>
  155. <span> {{parseTime(item.gmtCreate)}}</span>
  156. </view>
  157. </view>
  158. </view>
  159. <u-toast ref="uToast"></u-toast>
  160. </view>
  161. </template>
  162. <script>
  163. export default {
  164. data() {
  165. return {
  166. userInfo: {},
  167. status: 1,
  168. cardList: [{
  169. cardManagementInfo: {}
  170. }],
  171. };
  172. },
  173. onLoad() {
  174. this.userInfo = uni.getStorageSync("userInfo")
  175. this.getList()
  176. },
  177. methods: {
  178. switchStatus(status) {
  179. this.status = status
  180. this.getList()
  181. },
  182. getList() {
  183. uni.showLoading({
  184. title: '数据加载中'
  185. })
  186. this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'list', {
  187. receiveId: this.userInfo.id,
  188. status: this.status
  189. }, failres => {
  190. console.log('res+++++', failres.errmsg)
  191. uni.showToast({
  192. icon: "none",
  193. title: failres.errmsg,
  194. duration: 3000
  195. });
  196. uni.hideLoading()
  197. }).then(res => {
  198. uni.hideLoading()
  199. this.cardList = res.data.items
  200. })
  201. },
  202. cardExchangeInfoEdit(type, val) {
  203. uni.showLoading({
  204. title: '数据加载中'
  205. })
  206. this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'update', {
  207. cardExchangeInfo: JSON.stringify(val),
  208. updateFlag: type
  209. }, failres => {
  210. console.log('res+++++', failres.errmsg)
  211. uni.showToast({
  212. icon: "none",
  213. title: failres.errmsg,
  214. duration: 3000
  215. });
  216. uni.hideLoading()
  217. }).then(res => {
  218. uni.hideLoading()
  219. uni.showToast({
  220. icon: "success",
  221. title: '操作成功!',
  222. duration: 2000
  223. });
  224. this.getList()
  225. })
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. .content1 {
  232. background: #112253;
  233. padding: 0rpx 20rpx 160rpx 20rpx;
  234. box-sizing: border-box;
  235. border-radius: 0px 0px 20rpx 20rpx;
  236. }
  237. .default {
  238. color: rgba(255, 255, 255, 0.5);
  239. font-size: 26rpx;
  240. padding: 20rpx;
  241. position: relative;
  242. }
  243. .active {
  244. color: #fff;
  245. font-size: 32rpx;
  246. }
  247. .active:after {
  248. content: '';
  249. display: block;
  250. width: 10px;
  251. height: 2px;
  252. background: #fff;
  253. position: absolute;
  254. left: 50%;
  255. transform: translateX(-50%);
  256. bottom: 0;
  257. }
  258. .content2 {
  259. position: relative;
  260. top: -144rpx;
  261. padding: 20rpx;
  262. .icon-text{
  263. margin-left:10rpx;
  264. }
  265. .style1 {
  266. display: flex;
  267. padding: 20rpx 30rpx;
  268. width: 85%;
  269. margin-bottom: 70rpx;
  270. .left {
  271. width: 132rpx;
  272. height: 132rpx;
  273. border-radius: 50%;
  274. }
  275. .right {
  276. margin-left: 40rpx;
  277. .row1 {
  278. .name {
  279. font-size: 38rpx;
  280. font-weight: bold;
  281. color: #040000;
  282. margin-right: 20rpx;
  283. }
  284. .post {
  285. font-size: 26rpx;
  286. font-weight: 500;
  287. color: #666666;
  288. }
  289. }
  290. .row2 {
  291. margin-top: 20rpx;
  292. font-size: 24rpx;
  293. font-weight: bold;
  294. color: #323333;
  295. }
  296. .row3,.row4 {
  297. margin-top: 30rpx;
  298. font-size: 24rpx;
  299. font-weight: 500;
  300. color: #323333;
  301. }
  302. }
  303. }
  304. .style2 {
  305. padding: 30rpx;
  306. .top {
  307. .row1 {
  308. .name {
  309. font-size: 38rpx;
  310. font-weight: bold;
  311. color: #040000;
  312. margin-right: 20rpx;
  313. }
  314. .post {
  315. font-size: 26rpx;
  316. font-weight: 500;
  317. color: #666666;
  318. }
  319. }
  320. .row2 {
  321. margin-top: 20rpx;
  322. font-size: 24rpx;
  323. font-weight: bold;
  324. color: #323333;
  325. }
  326. }
  327. .bottom {
  328. margin-top: 20rpx;
  329. .left {
  330. margin-right: 40rpx;
  331. .row1 {
  332. .name {
  333. font-size: 38rpx;
  334. font-weight: bold;
  335. color: #040000;
  336. margin-right: 20rpx;
  337. }
  338. .post {
  339. font-size: 26rpx;
  340. font-weight: 500;
  341. color: #666666;
  342. }
  343. }
  344. .row2 {
  345. margin-top: 20rpx;
  346. font-size: 24rpx;
  347. font-weight: bold;
  348. color: #323333;
  349. }
  350. }
  351. .right {
  352. .row1,
  353. .row2 {
  354. font-size: 24rpx;
  355. font-weight: 500;
  356. color: #323333;
  357. }
  358. .row2 {
  359. margin-top: 20rpx;
  360. }
  361. .row3,.row4 {
  362. margin-top: 30rpx;
  363. font-size: 24rpx;
  364. font-weight: 500;
  365. color: #323333;
  366. }
  367. }
  368. }
  369. }
  370. }
  371. .card-list {
  372. padding: 0 20rpx;
  373. .title-name {
  374. font-weight: bold;
  375. color: #19191A;
  376. margin: 20rpx 0;
  377. }
  378. }
  379. .card-list-item {
  380. width: calc(100% + 40rpx);
  381. left: -20rpx;
  382. position: relative;
  383. border-radius: 30rpx;
  384. padding: 40rpx;
  385. box-sizing: border-box;
  386. .car-bottom {
  387. justify-content: flex-end;
  388. }
  389. .left {
  390. width: 30%;
  391. .top {
  392. margin-bottom: 20rpx;
  393. }
  394. .img {
  395. width: 80%;
  396. }
  397. .bottom {}
  398. }
  399. .right {
  400. .row1 {
  401. .line {
  402. width: 1px;
  403. height: 20px;
  404. margin: 0 20rpx;
  405. background: black;
  406. }
  407. }
  408. }
  409. }
  410. .icon-text {
  411. margin-left: 10px;
  412. font-size: 24rpx;
  413. font-weight: 500;
  414. color: #323333;
  415. }
  416. .status-btns {
  417. margin: 10rpx 0 25rpx;
  418. }
  419. .status-btns span {
  420. margin-right: 10rpx;
  421. border-radius: 10rpx;
  422. background: #fff;
  423. border: 1px solid rgba(0, 0, 0, 0.20);
  424. padding: 10rpx 30rpx;
  425. font-size: 26rpx;
  426. }
  427. .status {
  428. color: #666;
  429. }
  430. .error {
  431. color: #FF4E4E;
  432. }
  433. .success {
  434. color: #279D2A;
  435. }
  436. </style>