changeCard.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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 v-for='(item,index) in cardList' class="item">
  9. <!-- <view class="card-list-item" style="background:red"> -->
  10. <view class="card-list-item"
  11. :style="item.cardManagementInfo.currentBackground?'background:url('+item.cardManagementInfo.currentBackground+');background-size:100% 100%':''">
  12. <view class="card-content style1" v-if="item.cardManagementInfo.cuttentTemplate==1">
  13. <view class="left">
  14. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  15. shape="circle"></u--image>
  16. </view>
  17. <view class="right">
  18. <view class="row1">
  19. <text class="name">{{item.cardManagementInfo.name}}</text>
  20. <text class="post">{{item.cardManagementInfo.post}}</text>
  21. </view>
  22. <view class="row2">
  23. {{item.cardManagementInfo.companyName}}
  24. </view>
  25. <view class="row3 flex" @click="">
  26. <u--image :showLoading="true" src="/static/imgs/card/address1.png" width="13px" height="16px"
  27. ></u--image>
  28. <view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  29. </view>
  30. <view class="row4 flex">
  31. <u--image :showLoading="true" src="/static/imgs/card/phone1.png" width="12px" height="13px"
  32. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="card-content style1 flex-between" v-if="item.cardManagementInfo.cuttentTemplate==2">
  37. <view class="right">
  38. <view class="row1">
  39. <text class="name">{{item.cardManagementInfo.name}}</text>
  40. <text class="post">{{item.cardManagementInfo.post}}</text>
  41. </view>
  42. <view class="row2">
  43. {{item.cardManagementInfo.companyName}}
  44. </view>
  45. <view class="row3 flex">
  46. <u--image :showLoading="true" src="/static/imgs/card/address3.png" width="13px" height="16px"
  47. ></u--image>
  48. <view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  49. </view>
  50. <view class="row4 flex">
  51. <u--image :showLoading="true" src="/static/imgs/card/phone3.png" width="12px" height="13px"
  52. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  53. </view>
  54. </view>
  55. <view class="left">
  56. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  57. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  58. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png" width="66px"
  59. height="66px" shape="circle" v-else></u--image>
  60. </view>
  61. </view>
  62. <view class="card-content style2" v-if="item.cardManagementInfo.cuttentTemplate==3">
  63. <view class="top">
  64. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  65. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  66. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png" width="66px"
  67. height="66px" shape="circle" v-else></u--image>
  68. </view>
  69. <view class="bottom flex">
  70. <view class="left">
  71. <view class="row1">
  72. <text class="name">{{item.cardManagementInfo.name}}</text>
  73. <text class="post">{{item.cardManagementInfo.post}}</text>
  74. </view>
  75. <view class="row2">
  76. {{item.cardManagementInfo.companyName}}
  77. </view>
  78. </view>
  79. <view class="right">
  80. <view class="row1 flex">
  81. <u--image :showLoading="true" src="/static/imgs/card/address1.png" width="13px" height="16px"
  82. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  83. </view>
  84. <view class="row2 flex">
  85. <u--image :showLoading="true" src="/static/imgs/card/phone1.png" width="12px" height="13px"
  86. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="card-content style2" v-if="item.cardManagementInfo.cuttentTemplate==4">
  92. <view class="top">
  93. <view class="row1">
  94. <text class="name">{{item.cardManagementInfo.name}}</text>
  95. <text class="post">{{item.cardManagementInfo.post}}</text>
  96. </view>
  97. <view class="row2">
  98. {{item.cardManagementInfo.companyName}}
  99. </view>
  100. </view>
  101. <view class="bottom flex">
  102. <view class="left">
  103. <u--image :showLoading="true" :src="item.cardManagementInfo.headSculpture" width="66px" height="66px"
  104. shape="circle" v-if="item.cardManagementInfo.headSculpture"></u--image>
  105. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png"
  106. width="66px" height="66px" shape="circle" v-else></u--image>
  107. </view>
  108. <view class="right">
  109. <view class="row1 flex">
  110. <u--image :showLoading="true" src="/static/imgs/card/address2.png" width="13px" height="16px"
  111. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.province }}{{ item.cardManagementInfo.city }}{{ item.cardManagementInfo.area }}</view>
  112. </view>
  113. <view class="row2 flex">
  114. <u--image :showLoading="true" src="/static/imgs/card/phone2.png" width="12px" height="13px"
  115. ></u--image><view class='icon-text'>{{ item.cardManagementInfo.phone }}</view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="status-btns" v-if="item.status==0">
  121. <span class='status-btn' @click='cardExchangeInfoEdit(1,item)'> 拉黑</span>
  122. <span class='status-btn error' @click='cardExchangeInfoEdit(2,item)'>拒绝</span>
  123. <span class='status-btn success' @click='cardExchangeInfoEdit(3,item)'>接受</span>
  124. </view>
  125. <view class="status-btns" v-else>
  126. <span class='status' v-if="item.status==1">已接受</span>
  127. <span class='status' v-if="item.status==3">已拒绝</span>
  128. <span class='status' v-if="item.status==5">已过期</span>
  129. <span v-if="item.status==7" class='status-btn' @click='cardExchangeInfoEdit(4,item)'>移除</span>
  130. </view>
  131. </view>
  132. <view style='margin:0 20rpx;' class="flex flex-between">
  133. <span>来至 {{item.circleName}}</span>
  134. <span> {{parseTime(item.gmtCreate)}}</span>
  135. </view>
  136. <!-- <view class="left">
  137. <view class="top flex-row-center">
  138. <image :src="item.headSculpture" mode="widthFix" class="img"></image>
  139. </view>
  140. <view class="bottom flex flex-evenly">
  141. <uni-icons @click="toHome(item)" type="home" size="20"></uni-icons>
  142. <text @click='switchType(item)'>{{item.classify?item.classifyName:'默'}}</text>
  143. <uni-icons @click='share(item)' type="redo" size="20" color=''></uni-icons>
  144. </view>
  145. </view>
  146. <view class="right">
  147. <view class="row1 flex">
  148. <text>{{item.name}}</text>
  149. <text class="line"></text>
  150. <text>{{item.post}}</text>
  151. <u-checkbox-group v-if='islongPress' placement="column"
  152. @change="checkboxChange($event,index)">
  153. <u-checkbox :name='index+1' :checked='item.checked'
  154. :customStyle="{marginBottom: '8px'}">
  155. </u-checkbox>
  156. </u-checkbox-group>
  157. </view>
  158. <view class="row2">
  159. {{item.companyName}}
  160. </view>
  161. <view class="row3" @click="toMap(item)">
  162. <uni-icons type="redo" size="20"></uni-icons>
  163. <text>{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
  164. </view>
  165. <view class="row3">
  166. <uni-icons type="redo" size="20"></uni-icons>
  167. <text>{{item.phone}}</text>
  168. </view>
  169. <view @click='remarkEdit(item)' class="row3">
  170. <uni-icons type="redo" size="20"></uni-icons>
  171. <text>{{item.remark?item.remark:'单击添加备注'}}</text>
  172. </view>
  173. </view> -->
  174. </view>
  175. <!--< view class="row" v-for="(item,index) in cardList" :key="index">
  176. <view class="flex">
  177. <view class="left">
  178. <view class="top flex-row-center">
  179. <image :src="item.cardManagementInfo.headSculpture" mode="widthFix" class="img"></image>
  180. </view>
  181. </view>
  182. <view class="right">
  183. <view class="row1 flex">
  184. <text>{{item.cardManagementInfo.name}}</text>
  185. <text class="line"></text>
  186. <text>{{item.cardManagementInfo.post}}</text>
  187. </view>
  188. <view class="row2">
  189. {{item.cardManagementInfo.companyName}}
  190. </view>
  191. <view class="row3" @click="toMap">
  192. <uni-icons type="redo" size="20"></uni-icons>
  193. <text>{{item.cardManagementInfo.detailedAddress}}</text>
  194. </view>
  195. <view class="row3">
  196. <uni-icons type="redo" size="20"></uni-icons>
  197. <text>{{item.cardManagementInfo.phone}}</text>
  198. </view>
  199. </view>
  200. </view>
  201. <view class="" v-if="item.status==0">
  202. <span @click='cardExchangeInfoEdit(1,item)'> 拉黑</span>
  203. <span @click='cardExchangeInfoEdit(2,item)'>拒绝</span>
  204. <span @click='cardExchangeInfoEdit(3,item)'>接受</span>
  205. <span @click='cardExchangeInfoEdit(4,item)'>移除</span>
  206. </view>
  207. <view class="" v-else>
  208. <span v-if="item.status==1">已接受</span>
  209. <span v-if="item.status==3">已拒绝</span>
  210. <span v-if="item.status==5">已过期</span>
  211. <span v-if="item.status==7">已拉黑</span>
  212. </view>
  213. <view class="flex flex-between">
  214. <span>来至 {{item.circleName}}</span>
  215. <span> {{parseTime(item.gmtCreate)}}</span>
  216. </view>
  217. </view> -->
  218. </view>
  219. <u-toast ref="uToast"></u-toast>
  220. </view>
  221. </template>
  222. <script>
  223. export default {
  224. data() {
  225. return {
  226. userInfo:{},
  227. status:1,
  228. cardList:[{cardManagementInfo:{}}],
  229. };
  230. },
  231. onLoad() {
  232. this.userInfo = uni.getStorageSync("userInfo")
  233. this.getList()
  234. },
  235. methods:{
  236. switchStatus(status){
  237. this.status=status
  238. this.getList()
  239. },
  240. getList(){
  241. uni.showLoading({
  242. title: '数据加载中'
  243. })
  244. this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'list', {
  245. receiveId:this.userInfo.id,
  246. status:this.status
  247. }, failres => {
  248. console.log('res+++++', failres.errmsg)
  249. this.$refs.uToast.show({
  250. type: 'error',
  251. message: failres.errmsg,
  252. })
  253. uni.hideLoading()
  254. }).then(res => {
  255. uni.hideLoading()
  256. this.cardList = res.data.items
  257. })
  258. },
  259. cardExchangeInfoEdit(type,val){
  260. uni.showLoading({
  261. title: '数据加载中'
  262. })
  263. this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'update', {
  264. cardExchangeInfo:JSON.stringify(val),
  265. updateFlag:type
  266. }, failres => {
  267. console.log('res+++++', failres.errmsg)
  268. this.$refs.uToast.show({
  269. type: 'error',
  270. message: failres.errmsg,
  271. })
  272. uni.hideLoading()
  273. }).then(res => {
  274. uni.hideLoading()
  275. this.$refs.uToast.show({
  276. type: 'success',
  277. message: "操作成功!",
  278. })
  279. this.getList()
  280. })
  281. }
  282. }
  283. }
  284. </script>
  285. <style lang="scss" scoped>
  286. .content1 {
  287. background: #112253;
  288. padding: 0rpx 20rpx 160rpx 20rpx;
  289. box-sizing: border-box;
  290. border-radius: 0px 0px 20rpx 20rpx;
  291. }
  292. // .content2 {
  293. // margin-top:-112rpx;
  294. // border: 1px solid #ccc;
  295. // border-radius: 30rpx;
  296. // padding: 40rpx;
  297. // box-sizing: border-box;
  298. // .left {
  299. // width: 30%;
  300. // .top {
  301. // margin-bottom: 20rpx;
  302. // }
  303. // .img {
  304. // width: 80%;
  305. // }
  306. // .bottom {
  307. // }
  308. // }
  309. // .right {
  310. // .row1 {
  311. // .line {
  312. // width: 1px;
  313. // height: 20px;
  314. // margin: 0 20rpx;
  315. // background: black;
  316. // }
  317. // }
  318. // }
  319. // }
  320. .default{
  321. color:rgba(255, 255, 255, 0.5);
  322. font-size:26rpx;
  323. padding:20rpx;
  324. position:relative;
  325. }
  326. .active{
  327. color:#fff;
  328. font-size:32rpx;
  329. }
  330. .active:after{
  331. content:'';
  332. display:block;
  333. width:10px;
  334. height:2px;
  335. background:#fff;
  336. position: absolute;
  337. left: 50%;
  338. transform: translateX(-50%);
  339. bottom: 0;
  340. }
  341. .content2 {
  342. // padding:0 20rpx;
  343. position: relative;
  344. top: -144rpx;
  345. .style1 {
  346. display: flex;
  347. padding: 20rpx 30rpx;
  348. width: 85%;
  349. margin-bottom: 90rpx;
  350. .left {
  351. width: 132rpx;
  352. height: 132rpx;
  353. border-radius: 50%;
  354. }
  355. .right {
  356. margin-left: 40rpx;
  357. .row1 {
  358. .name {
  359. font-size: 38rpx;
  360. font-weight: bold;
  361. color: #040000;
  362. margin-right: 20rpx;
  363. }
  364. .post {
  365. font-size: 26rpx;
  366. font-weight: 500;
  367. color: #666666;
  368. }
  369. }
  370. .row2 {
  371. font-size: 24rpx;
  372. font-weight: bold;
  373. color: #323333;
  374. }
  375. .row3 {
  376. margin-top: 30rpx;
  377. font-size: 24rpx;
  378. font-weight: 500;
  379. color: #323333;
  380. }
  381. .row2,.row4 {
  382. margin-top: 10rpx;
  383. }
  384. }
  385. }
  386. .style2 {
  387. padding: 30rpx;
  388. margin-bottom: 100rpx;
  389. .top {
  390. .row1 {
  391. .name {
  392. font-size: 38rpx;
  393. font-weight: bold;
  394. color: #040000;
  395. margin-right: 20rpx;
  396. }
  397. .post {
  398. font-size: 26rpx;
  399. font-weight: 500;
  400. color: #666666;
  401. }
  402. }
  403. .row2 {
  404. margin-top: 10rpx;
  405. font-size: 24rpx;
  406. font-weight: bold;
  407. color: #323333;
  408. }
  409. }
  410. .bottom {
  411. margin-top: 48rpx;
  412. .left {
  413. margin-right: 40rpx;
  414. .row1 {
  415. .name {
  416. font-size: 38rpx;
  417. font-weight: bold;
  418. color: #040000;
  419. margin-right: 20rpx;
  420. }
  421. .post {
  422. font-size: 26rpx;
  423. font-weight: 500;
  424. color: #666666;
  425. }
  426. }
  427. .row2 {
  428. margin-top: 10rpx;
  429. font-size: 24rpx;
  430. font-weight: bold;
  431. color: #323333;
  432. }
  433. }
  434. .right {
  435. .row1,
  436. .row2 {
  437. font-size: 24rpx;
  438. font-weight: 500;
  439. color: #323333;
  440. }
  441. .row2,.row4 {
  442. margin-top: 10rpx;
  443. }
  444. }
  445. }
  446. }
  447. .card-list-item {
  448. width: calc(100%);
  449. // left:-20rpx;
  450. position: relative;
  451. border-radius: 30rpx;
  452. padding: 40rpx;
  453. box-sizing: border-box;
  454. .car-bottom {
  455. position: absolute;
  456. bottom: 63rpx;
  457. left: 20rpx;
  458. bottom:24rpx;
  459. width:94.9%;
  460. background: url("../../static/imgs/card/bg5.png") no-repeat center;
  461. background-size: 100% 100%;
  462. height: 80rpx;
  463. // width: calc(100% - 40rpx);
  464. .left {
  465. // top: -40rpx;
  466. position: absolute;
  467. padding: 20rpx 0;
  468. width: 70vw;
  469. height: 80rpx;
  470. box-sizing: border-box;
  471. display: flex;
  472. align-items: center;
  473. justify-content: space-evenly;
  474. z-index:100;
  475. left: 0px;
  476. // background-size: 100% 100%;
  477. overflow-y: hidden;
  478. }
  479. }
  480. .left {
  481. width: 30%;
  482. .top {
  483. margin-bottom: 20rpx;
  484. }
  485. .img {
  486. width: 80%;
  487. }
  488. .bottom {}
  489. }
  490. .right {
  491. .row1 {
  492. .line {
  493. width: 1px;
  494. height: 20px;
  495. margin: 0 20rpx;
  496. background: black;
  497. }
  498. }
  499. }
  500. }
  501. }
  502. .icon-text{
  503. margin-left: 10px;
  504. font-size: 24rpx;
  505. font-weight: 500;
  506. color: #323333;
  507. }
  508. .status-btns{
  509. margin:10rpx 0 25rpx;
  510. text-align:right;
  511. }
  512. .status-btns span{
  513. background:#fff;
  514. border:1px solid rgba(0, 0, 0, 0.20);
  515. padding:10rpx 30rpx;
  516. font-size:26rpx;
  517. }
  518. .status{
  519. color:#666;
  520. }
  521. .error{
  522. color:#FF4E4E;
  523. }
  524. .success{
  525. color:#279D2A;
  526. }
  527. </style>